|
|
Sets a callback method that will be called each time a python object is tested for an intersection with an incoming ray.
- Parameters:
-
| fptrPythonIntersectionCallback | the python method that will be called each time an intersection test is performed on a python object. |
- Remarks:
- This callback can be used to create new objects by redefining the intersection routine. The callback will be called each time Vue needs to know if a ray intersects a python object and, if it is the case, to compute impact normal, position and distance.
- Callback description:
- The Python callback should accept 6 floats and 2 ints, and return a tuple of 7 floats (impact distance, position and normal vectors) if an intersection occured, else nothing. The callback should look like this:
(f, f, f, f, f, f, f) fptrPythonIntersectionCallback(x_pos, y_pos, z_pos, x_dir, y_dir, z_dir, ray_level, shadow_ray) when an intersection occurs,
() fptrPythonIntersectionCallback(x_pos, y_pos, z_pos, x_dir, y_dir, z_dir, ray_level, shadow_ray) when there is no intersection.
where:
(x_pos, y_pos, z_pos) is the incoming ray start point.
(x_dir, y_dir, z_dir) is the incoming ray direction vector.
ray_level is the ray depth value.
shadow_ray is a flag which is true (1) when incoming ray is a shadow ray.
- Remarks:
- To remove the callback, simply call this method with no parameter.
- Returns:
- True if the callback was succesfully set (or removed), false otherwise.
- See also:
- SetVolumetricDensityCallback, SetImpactaspectCallback.
|