Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Friends | List of all members
GeometryIntersectionMap Class Reference

Class holding the intersections computed between a packet of rays and the scene. More...

Public Member Functions

 GeometryIntersectionMap (GeometryIntersectionPool &intersection_pool, GeometryMatrixPool &matrix_pool, GeometryCustomDataPool &custom_data_pool)
 
GeometryIntersectionnew_intersection ()
 
void free_intersection (GeometryIntersection *inter)
 
GMathMatrix4x4d * new_matrix ()
 
void free_matrix (GMathMatrix4x4d *m)
 
template<class T >
GeometryCustomDatanew_custom_data ()
 
template<class T >
GeometryCustomDatanew_custom_data (const T &value)
 
GeometryCustomDatanew_custom_data (size_t size)
 
void free_custom_data (GeometryCustomData *data)
 
void set_limits (const unsigned int &max_path_length, const float &transparency_threshold)
 Set the limits to consider when building lists of intersections.
 
void set_transparency_threshold (const float &transparency_threshold)
 Set the minimum transparency value under which a fragment is considered opaque.
 
void set_max_path_length (const unsigned int &max_path_length)
 Set the maximum length of a transparency path.
 
void set_depth_offset (const unsigned int &depth_offset)
 Set the depth offset to apply to intersections inserted in lists.
 
const float & get_transparency_threshold () const
 Get the minimum transparency value under which a fragment is considered opaque.
 
const unsigned int & get_max_path_length () const
 Get the maximum length of a transparency path.
 
const unsigned int & get_depth_offset () const
 Get the depth offset to apply to intersections inserted in lists.
 
void init (const unsigned int &path_count, const double &tfar=gmath_infinity)
 Set the number of paths and clear them all.
 
void init (const unsigned int &path_count, const double *tfar)
 Set the number of paths and clear them all.
 
void clear ()
 Release intersections path memory.
 
void clear_path (const unsigned int &path_index, const double &tfar=gmath_infinity)
 Clear a path and set its far clip plane.
 
void clear_paths (const unsigned int &begin_index, const unsigned int &end_index, const double &tfar=gmath_infinity)
 Clear several paths and set their far clip plane.
 
void clear_paths (const unsigned int &begin_index, const unsigned int &end_index, const double *tfar)
 Clear several paths and set their far clip plane.
 
bool insert_intersection (const unsigned int &path_index, GeometryIntersection *inter)
 Insert an intersection into a path.
 
void remove_intersection (const unsigned int &path_index, GeometryIntersection *inter)
 Remove an intersection from a path.
 
const unsigned int & get_path_count () const
 Get the number of paths.
 
const GeometryIntersectionPathget_path (const unsigned int &path_index) const
 Get a path from its index.
 
void transform_path (const unsigned int &path_index, const GMathMatrix4x4d &xform, const unsigned int &xform_level)
 Transform all intersections in a path by a matrix.
 
void transform_path (const unsigned int &path_index, const GMathMatrix4x4d &xform, const GMathMatrix4x4d &motion_xform, const unsigned int &xform_level)
 Transform all intersections in a path by a matrix.
 
void clamp_path (const unsigned int &path_index, const double &t, const bool &shorten_path=true)
 Clamp a path to a given distance.
 
size_t get_memory_size () const
 Get the memory occupation.
 

Friends

class GeometryRaytraceCtx
 

Detailed Description

Class holding the intersections computed between a packet of rays and the scene.

Member Function Documentation

void GeometryIntersectionMap::clamp_path ( const unsigned int &  path_index,
const double &  t,
const bool &  shorten_path = true 
)

Clamp a path to a given distance.

Parameters
path_indexthe index of the path to clamp
tthe distance at which the path must be clamped
shorten_pathwhen true, all intersections that are beyond the given distance are removed from the path
void GeometryIntersectionMap::clear_path ( const unsigned int &  path_index,
const double &  tfar = gmath_infinity 
)

Clear a path and set its far clip plane.

Parameters
[in]path_indexthe index of the path to clear
[in]tfarthe far clip plane value
void GeometryIntersectionMap::clear_paths ( const unsigned int &  begin_index,
const unsigned int &  end_index,
const double &  tfar = gmath_infinity 
)

Clear several paths and set their far clip plane.

Parameters
[in]begin_indexthe index of the first path to clear
[in]end_indexthe index following the last path to clear
[in]tfarthe far clip plane value
void GeometryIntersectionMap::clear_paths ( const unsigned int &  begin_index,
const unsigned int &  end_index,
const double *  tfar 
)

Clear several paths and set their far clip plane.

Parameters
[in]begin_indexthe index of the first path to clear
[in]end_indexthe index following the last path to clear
[in]tfaran array of far clip plane values, one per path
void GeometryIntersectionMap::init ( const unsigned int &  path_count,
const double &  tfar = gmath_infinity 
)

Set the number of paths and clear them all.

Parameters
[in]path_countset the number of paths
[in]tfarthe far clip plane value
void GeometryIntersectionMap::init ( const unsigned int &  path_count,
const double *  tfar 
)

Set the number of paths and clear them all.

Parameters
[in]path_countset the number of paths
[in]tfaran array of far clip plane values, one per path
bool GeometryIntersectionMap::insert_intersection ( const unsigned int &  path_index,
GeometryIntersection inter 
)

Insert an intersection into a path.

Parameters
[in]path_indexthe index of the path
[in]interthe intersection to insert
Returns
true if the insertion is possible, else false
void GeometryIntersectionMap::remove_intersection ( const unsigned int &  path_index,
GeometryIntersection inter 
)

Remove an intersection from a path.

Parameters
[in]path_indexthe index of the path
[in]interthe intersection to remove
Note
This doesn't free the given intersection
void GeometryIntersectionMap::set_limits ( const unsigned int &  max_path_length,
const float &  transparency_threshold 
)
inline

Set the limits to consider when building lists of intersections.

Parameters
[in]max_path_lengththe maximum length of a transparency path
[in]transparency_thresholdthe minimum transparency value under which a fragment is considered opaque
void GeometryIntersectionMap::transform_path ( const unsigned int &  path_index,
const GMathMatrix4x4d &  xform,
const unsigned int &  xform_level 
)
inline

Transform all intersections in a path by a matrix.

Parameters
[in]path_indexthe index of the path
[in]xformthe transformation matrix
[in]xform_levellevel in the hierarchy of scene objects the xform corresponds to
void GeometryIntersectionMap::transform_path ( const unsigned int &  path_index,
const GMathMatrix4x4d &  xform,
const GMathMatrix4x4d &  motion_xform,
const unsigned int &  xform_level 
)
inline

Transform all intersections in a path by a matrix.

Parameters
[in]path_indexthe index of the path
[in]xformthe transformation matrix
[in]motion_xformthe transformation matrix at (t + dt)
[in]xform_levellevel in the hierarchy of scene objects the xform corresponds to