Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Public Attributes | Friends | List of all members
GeometryIntersection Class Reference

Class corresponding to an intersection that is outputed by the raytracer. More...

Inheritance diagram for GeometryIntersection:
GeometryFragment

Public Member Functions

ModuleMaterialget_shading_material () const
 Get the material that has to be evaluated when shading the fragment.
 
void set_shading_material (ModuleMaterial *material)
 Set the material that has to be evaluated when shading the fragment.
 
const ShadingVariableAccessorget_shading_variables () const
 Get the defined shading variables for the fragment shading.
 
void set_shading_variables (const ShadingVariableAccessor *shading_variables)
 Set shading variables accessor.
 
const float & get_shading_opacity () const
 Get the minimum opacity of the material used for the shading.
 
void set_shading_opacity (const float &opacity)
 Set the shading opacity.
 
void clear (const double &tfar=gmath_infinity)
 Clear the intersection.
 
void copy_params (const GeometryIntersection &other)
 Copy the description of the intersection without the geometric data.
 
void copy_params_and_matrix_dt (const GeometryIntersection &other)
 Copy the description of a fragment without replacing the pointer on the matrix dt but in copying the other matrix dt on the current pointer. If there is no matrix dt in other then it will copy the world matrix in the current matrix dt.
 
GeometryIntersectionget_prev () const
 Get the previous intersection in the list.
 
GeometryIntersectionget_next () const
 Get the next intersection in the list.
 
const unsigned int & get_depth () const
 Get the depth of the intersection in the list.
 
- Public Member Functions inherited from GeometryFragment
void clear ()
 Clear the fragment.
 
void init (const GeometryObjectDescriptor &object, const GeometrySampleDescriptor &sample=GeometrySampleDescriptor(), const GeometryMediumDescriptor &medium=GeometryMediumDescriptor())
 Init the fragment.
 
void init (const GeometryObjectDescriptor &object, const GeometrySampleDescriptor &sample, const GMathMatrix4x4d &world_matrix, GMathMatrix4x4d *world_matrix_dt=0)
 Init the fragment.
 
void init (const GeometryObjectDescriptor &object, const GeometrySampleDescriptor &sample, const GeometryMediumDescriptor &medium, const GMathMatrix4x4d &world_matrix, GMathMatrix4x4d *world_matrix_dt=0)
 Init the fragment.
 
void set_object_desc (const GeometryObjectDescriptor &object)
 Set informations about the geometry and the scene objects.
 
void set_sample_desc (const GeometrySampleDescriptor &sample)
 Set informations about the location of the fragment on the geometry.
 
void set_medium_desc (const GeometryMediumDescriptor &medium)
 Set informations about the medium.
 
bool is_facing (const CtxEval &eval_ctx) const
 Tell if the fragment normal is facing the incident ray.
 
bool is_facing (const CtxEval &eval_ctx, const GMathVec3d &direction) const
 Tell if the fragment normal is facing a given direction.
 
void set_scene_object (ModuleSceneObject *object, const unsigned int &index=0, GeometryOverride *override=0)
 Init the hierarchy of scene objects to 1 element and set its pointer, its index in the scene, and the geometry override applied on it.
 
void set_scene_object_count (const unsigned int &count)
 Set the size of the scene objects hierarchy.
 
void set_scene_object (const unsigned int &i, ModuleSceneObject *object, const unsigned int &index=0, GeometryOverride *override=0)
 Set the pointer to a scene object in the hierarchy, the index in the scene, and the geometry override applied on it.
 
void set_geometry_index (const unsigned int &geometry_index)
 Set the index of the geometry in regard to the first scene object in the hierarchy.
 
void set_local_geometry_index (const unsigned int &geometry_index)
 Sets the index of the geometry hit in the last scene object.
 
void set_vertex_id (const unsigned int &vertex_id)
 Set the ID of the vertex associated to the fragment.
 
void set_primitive_id (const unsigned int &primitive_id)
 Set the ID of the primitive in which the fragment is.
 
void set_sub_primitive_id (const unsigned int &primitive_id)
 Set the ID of the sub-primitive in which the fragment is.
 
void set_material_index (const unsigned int &material_index)
 Set the index of the material in regard to the first scene object in the hierarchy.
 
void reset_world_matrix ()
 Reset the world matrix to identity.
 
void set_world_matrix (const GMathMatrix4x4d &xform)
 Set the world matrix of the geometry.
 
void multiply_world_matrix (const GMathMatrix4x4d &xform)
 Multiply the matrix of the geometry by another matrix.
 
void set_world_matrix_dt (GMathMatrix4x4d *xform)
 Set the world matrix of the geometry at (t + dt)
 
void set_ray (const GMathRay *ray)
 Set the ray associated to the fragment.
 
void set_local_eye_dir (const GMathVec3d &eye_dir)
 Set the direction of the eye in the geometry space.
 
void set_time (const double &time, const double &delta=0.0)
 Set the local time of the fragment and its delta (related to the frame)
 
void set_uv (const double &u, const double &v)
 Set UV coordinates of the fragment on the primitive.
 
void set_uvw (const double &u, const double &v, const double &w)
 Set UVW coordinates of the fragment on the primitive.
 
void set_sub_uv (const double &u, const double &v)
 Set UV coordinates of the fragment on the sub-primitive.
 
void set_sub_uvw (const double &u, const double &v, const double &w)
 Set UVW coordinates of the fragment on the sub-primitive.
 
void set_geometry (const GeometryObject *base_geometry, const GeometryObject *deformed_geometry=0)
 Set the pointers to the geometry representations.
 
void set_medium_opacity (const float &opacity)
 Set the opacity of the fragment.
 
void set_medium_thickness (const float &thickness)
 Set the thickness of the fragment.
 
void set_medium_density (const float &density)
 Set the density of the fragment.
 
void set_medium_density_diff (const GMathVec3f &density_diff)
 Set the differential of the density for the fragment.
 
void set_custom_data (GeometryCustomData *data)
 Attach custom data to the fragment.
 
const GeometrySourceHierarchyget_scene_objects () const
 Get the hierarchy of scene objects from which the geometry is accessible.
 
unsigned int get_scene_object_count () const
 Get the size of the scene object hierarchy.
 
unsigned int get_scene_object_index (const unsigned int &i) const
 Get the index of a scene object in the hierarchy.
 
unsigned int get_first_scene_object_index () const
 Get the index in the scene of the first scene object in the hierarchy.
 
unsigned int get_last_scene_object_index () const
 Get the index in regard to its parent of the last scene object in the hierarchy.
 
unsigned int get_first_visibility_object_index () const
 Get the index of the first scene object overriding visibility or the last object if no override.
 
ModuleSceneObjectget_scene_object (const unsigned int &i) const
 Get the pointer to a scene object in the hierarchy.
 
ModuleSceneObjectget_first_scene_object () const
 Get the pointer to the first scene object in the hierarchy.
 
ModuleSceneObjectget_last_scene_object () const
 Get the pointer to the last scene object in the hierarchy.
 
ModuleSceneObjectget_first_visibility_object () const
 Get the pointer to the first scene object overriding visibility or the last object if no override.
 
GeometryOverrideget_geometry_override (const unsigned int &i) const
 Get the geometry override of a scene object in the hierarchy.
 
GeometryOverrideget_first_geometry_override () const
 Get the geometry override in the scene of the first scene object in the hierarchy.
 
GeometryOverrideget_last_geometry_override () const
 Get the geometry override in regard to its parent of the last scene object in the hierarchy.
 
GeometryOverrideget_first_visibility_geometry_override () const
 Get the geometry override of the first scene object overriding visibility or the last object if no override.
 
const unsigned int & get_geometry_index () const
 Get the index of the geometry in regard to the first scene object in the hierarchy.
 
const unsigned int & get_local_geometry_index () const
 Returns the index of the last geometry hit in the scene object.
 
const unsigned int & get_vertex_id () const
 Get the ID of the vertex associated to the fragment.
 
const unsigned int & get_primitive_id () const
 Get the ID of the primitive containing the fragment.
 
const unsigned int & get_sub_primitive_id () const
 Get the ID of the sub-primitive containing the fragment.
 
const unsigned int & get_material_index () const
 Get the index of the material in regard to the first scene object in the hierarchy.
 
bool has_world_matrix () const
 Tell if the geometry has a transformation matrix.
 
const GMathMatrix4x4d & get_world_matrix () const
 Get the transformation matrix of the geometry.
 
GMathMatrix4x4d * get_world_matrix_dt () const
 Get the transformation matrix of the geometry at (t + dt)
 
const GMathRayget_ray () const
 Get the ray that has generated the fragment.
 
const GMathVec3d & get_local_eye_dir () const
 Get the local direction of the eye that see the fragment.
 
GMathVec3d get_uvw () const
 Get the parametric coordinates of the fragment in the primitive.
 
GMathVec3d get_sub_uvw () const
 Get the parametric coordinates of the fragment in the sub-primitive.
 
const double & get_time () const
 Get the local time of the fragment (related to the frame)
 
const double & get_time_delta () const
 Get the time delta used to compute the motion vector.
 
const double & get_u () const
 Get the U parametric coordinate of the fragment in the primitive.
 
const double & get_v () const
 Get the V parametric coordinate of the fragment in the primitive.
 
const double & get_w () const
 Get the W parametric coordinate of the fragment in the primitive.
 
const double & get_sub_u () const
 Get the U parametric coordinate of the fragment in the sub-primitive.
 
const double & get_sub_v () const
 Get the V parametric coordinate of the fragment in the sub-primitive.
 
const double & get_sub_w () const
 Get the W parametric coordinate of the fragment in the sub-primitive.
 
const GeometryObjectget_base_geometry () const
 Get a pointer to the non deformed version of the geometry.
 
const GeometryObjectget_deformed_geometry () const
 Get a pointer to the deformed version of the geometry.
 
const float & get_medium_opacity () const
 Get the opacity of the fragment.
 
const float & get_medium_thickness () const
 Get the thickness of the fragment.
 
const float & get_medium_density () const
 Get the density of the fragment.
 
const GMathVec3f & get_medium_density_diff () const
 Get the differential of the density for the fragment.
 
const GeometryObjectDescriptorget_object_desc () const
 Get informations about the geometry and the scene objects.
 
const GeometrySampleDescriptorget_sample_desc () const
 Get informations about the location of the fragment on the geometry.
 
const GeometryMediumDescriptorget_medium_desc () const
 Get informations about the medium.
 
GeometryCustomDataget_custom_data () const
 Get the custom data attached to the fragment.
 
const GeometrySampleget_local_sample (const CtxEval &eval_ctx) const
 Get the geometric values associated to the fragment in the local space of the geometry.
 
const GeometrySampleget_world_sample (const CtxEval &eval_ctx) const
 Get the geometric values associated to the fragment in world space.
 
const GeometryDifferentialget_differentials (const CtxEval &eval_ctx) const
 Get differential geometry associated to the fragment.
 
const double & get_primitive_area (const CtxEval &eval_ctx) const
 Get the area of the primitive on which the fragment is.
 
void set_user_sample (const GeometrySample &sample)
 Override the values of samples with an user defined one.
 
void set_user_sample (const GeometrySample &sample, const GMathMatrix4x4d &xform, GMathMatrix4x4d *xform_dt=0)
 Override the values of samples with an user defined one.
 
void set_user_sample (const GeometrySample &local_sample, const GeometrySample &world_sample, const GMathMatrix4x4d &xform, GMathMatrix4x4d *xform_dt=0)
 Override the values of samples with an user defined one.
 
void set_user_differentials (const GeometryDifferential &diff)
 Override the differentials on the geometry with user defined ones.
 
void set_user_differentials (const CtxEval &eval_ctx, const GMathVec3d &dpdx, const GMathVec3d &dpdy)
 Override the differentials on the geometry with user defined ones.
 
void set_user_differentials (const CtxEval &eval_ctx, const GMathVec3d &dpdx, const GMathVec3d &dpdy, const double &area)
 Override the differentials on the geometry with user defined ones.
 
void set_user_differentials (const CtxEval &eval_ctx, const double &spot_size)
 Override the differentials on the geometry with user defined ones.
 
void set_user_primitive_area (const double &area)
 Override the value of the primitive area with an user defined one.
 
void copy_params (const GeometryFragment &other)
 Copy the description of a fragment without the geometric data.
 
void copy_params_and_matrix_dt (const GeometryFragment &other)
 Copy the description of a fragment without replacing the pointer on the matrix dt but in copying the other matrix dt on the current pointer. If there is no matrix dt in other then it will copy the world matrix in the current matrix dt.
 
bool is_near_edge (const CtxEval &eval_ctx, const double &edge_width, double &weight) const
 
bool is_near_visible_edge (const CtxEval &eval_ctx, const double &edge_width, double &weight) const
 
bool is_near_sub_edge (const CtxEval &eval_ctx, const double &edge_width, double &weight) const
 
void set_user_surface_sample (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv)
 Helper function to init an user surface sample and override the fragment ones with it.
 
void set_user_surface_sample (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathVec3d &smoothed_position, const GMathVec3d &smoothed_normal)
 
void set_user_surface_sample (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathMatrix4x4d &xform, GMathMatrix4x4d *xform_dt=0)
 
void set_user_surface_sample (const GMathVec3d &position, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathVec3d &smoothed_position, const GMathVec3d &smoothed_normal, const GMathMatrix4x4d &xform, GMathMatrix4x4d *xform_dt=0)
 
void set_user_point_sample (const GMathVec3d &position, const GMathVec3d &normal, const bool &normalized)
 Helper function to init an user point sample and override the fragment ones with it.
 
void set_user_point_sample (const GMathVec3d &geometric_position, const GMathVec3d &geometric_normal, const GMathVec3d &smoothed_position, const GMathVec3d &smoothed_normal, const bool &normalized)
 
void set_user_point_sample (const GMathVec3d &position, const GMathVec3d &normal, const bool &normalized, const GMathMatrix4x4d &xform, GMathMatrix4x4d *xform_dt=0)
 
void set_user_point_sample (const GMathVec3d &geometric_position, const GMathVec3d &geometric_normal, const GMathVec3d &smoothed_position, const GMathVec3d &smoothed_normal, const bool &normalized, const GMathMatrix4x4d &xform, GMathMatrix4x4d *xform_dt=0)
 

Public Attributes

double t
 distance of the intersection to the ray origin
 
double bias
 bias to apply to the position when casting a new ray from this intersection to avoid self intersections
 
double smoothing
 amount of smoothing to apply on the position when casting secondary rays from this intersection
 

Friends

class GeometryIntersectionPool
 
class GeometryIntersectionMap
 
class GeometryRaytraceCtx
 
class GeometryDeferredShading
 

Additional Inherited Members

- Static Public Member Functions inherited from GeometryFragment
static void compute_differentials (const GeometrySample &sample, const GMathRay *ray, GeometryDifferential &diff)
 
static void compute_differentials (const GeometrySample &sample, const double &spot_size, GeometryDifferential &diff)
 
static void compute_position_differentials (const GMathVec3d &position, const GMathVec3d &normal, const GMathRay &ray, GeometryPositionDifferential &diff)
 
static void compute_parametric_differentials (const GMathVec3d &normal, const GMathVec3d &dpdu, const GMathVec3d &dpdv, const GMathVec3d &dpdx, const GMathVec3d &dpdy, GMathVec2d &duvdx, GMathVec2d &duvdy)
 

Detailed Description

Class corresponding to an intersection that is outputed by the raytracer.

An intersection can be part of a list if there are transparent objects in the scene.

Member Function Documentation

ModuleMaterial* GeometryIntersection::get_shading_material ( ) const
inline

Get the material that has to be evaluated when shading the fragment.

Note
This material is resolved during the raytracing and also takes in account shading layers.
const float& GeometryIntersection::get_shading_opacity ( ) const
inline

Get the minimum opacity of the material used for the shading.

Note
This value is affected by the opacity mode used during the raytracing.
const ShadingVariableAccessor* GeometryIntersection::get_shading_variables ( ) const
inline

Get the defined shading variables for the fragment shading.

Note
This accessor is resolved during the raytracing and also takes in account shading layers.
void GeometryIntersection::set_shading_material ( ModuleMaterial material)
inline

Set the material that has to be evaluated when shading the fragment.

Note
This material is resolved during the raytracing and also takes in account shading layers.