VolumeRayIntersectorInterface< TYPE > Class Template Reference

#include <volumerayintersector.h>

Detailed Description

template<typename TYPE>
class maxon::VolumeRayIntersectorInterface< TYPE >

Internal. VolumeRayIntersectorInterface allows to access perform volume-ray intersection.

Public Member Functions

MAXON_METHOD Result< void > Init (const Volume &volumeObject, Bool isSDF=false)
 
MAXON_METHOD Result< BoolGetClosestHit (const VolumeRay &ray, VolumeRayHit< TYPE > &hit, VOLUME_RAY_TYPE rayType=VOLUME_RAY_TYPE::WORLD_SPACE)
 
MAXON_METHOD Result< BoolGetClosestHit (const VolumeRay &ray, VolumeRayHit< TYPE > &hit, const maxon::GridAccessorRef< TYPE > &accessor, VOLUME_RAY_TYPE rayType=VOLUME_RAY_TYPE::WORLD_SPACE)
 
MAXON_METHOD Result< BoolGetClosestHit (const VolumeRay &ray, VolumeRayHit< TYPE > &hit, Delegate< Bool(TYPE, Bool)> &&condition, const maxon::GridAccessorRef< TYPE > &accessor, VOLUME_RAY_TYPE rayType=VOLUME_RAY_TYPE::WORLD_SPACE)
 
MAXON_METHOD Result< BoolGetAllHits (const VolumeRay &ray, BaseArray< VolumeRayHit< TYPE >> &hit, Delegate< Bool(TYPE, Bool)> &&condition, const maxon::GridAccessorRef< TYPE > &accessor, VOLUME_RAY_TYPE rayType=VOLUME_RAY_TYPE::WORLD_SPACE)
 

Static Public Member Functions

static MAXON_FUNCTION Result< VolumeRayIntersectorRef< TYPE > > Create ()
 

Private Member Functions

 MAXON_INTERFACE_SIMPLE_VIRTUAL (VolumeRayIntersectorInterface, MAXON_REFERENCE_NORMAL)
 

Member Function Documentation

◆ MAXON_INTERFACE_SIMPLE_VIRTUAL()

MAXON_INTERFACE_SIMPLE_VIRTUAL ( VolumeRayIntersectorInterface< TYPE >  ,
MAXON_REFERENCE_NORMAL   
)
private

◆ Create()

static MAXON_FUNCTION Result<VolumeRayIntersectorRef<TYPE> > Create ( )
static

◆ Init()

MAXON_METHOD Result<void> Init ( const Volume &  volumeObject,
Bool  isSDF = false 
)

Initialize the intersector with a volume object in a read only state.

Parameters
[in]volumeObjectThe volume object to initialize this intersector for.
[in]isSDFIf true this volume is interpreted as SDF and an SDF intersector is used instead of a value intersector.
Returns
True if the intersector was initialized with a volume, false otherwise.

◆ GetClosestHit() [1/3]

MAXON_METHOD Result<Bool> GetClosestHit ( const VolumeRay ray,
VolumeRayHit< TYPE > &  hit,
VOLUME_RAY_TYPE  rayType = VOLUME_RAY_TYPE::WORLD_SPACE 
)

Perform a ray-volume intersection and gives the position of the hit (if any), but does not retrieve the value of the volume at the intersection point.

Parameters
[in]rayThe ray used for the intersection test.
[in]hitThe structure holding the two intersection points.
[in]rayTypeThe space this ray should be cast in.
Returns
True if the ray has hit the volume this intersector has been initialized with, false otherwise.

◆ GetClosestHit() [2/3]

MAXON_METHOD Result<Bool> GetClosestHit ( const VolumeRay ray,
VolumeRayHit< TYPE > &  hit,
const maxon::GridAccessorRef< TYPE > &  accessor,
VOLUME_RAY_TYPE  rayType = VOLUME_RAY_TYPE::WORLD_SPACE 
)

Perform a ray-volume intersection and gives the position of the hit (if any), as well as the value of the volume at the intersection point.

Parameters
[in]rayThe ray used for the intersection test.
[in]hitThe structure holding the two intersection points and the value.
[in]accessorThe accessor to use to sample the volume's value with.
[in]rayTypeThe space this ray should be cast in.
Returns
True if the ray has hit the volume this intersector has been initialized with, false otherwise.

◆ GetClosestHit() [3/3]

MAXON_METHOD Result<Bool> GetClosestHit ( const VolumeRay ray,
VolumeRayHit< TYPE > &  hit,
Delegate< Bool(TYPE, Bool)> &&  condition,
const maxon::GridAccessorRef< TYPE > &  accessor,
VOLUME_RAY_TYPE  rayType = VOLUME_RAY_TYPE::WORLD_SPACE 
)

Perform a ray-volume intersection and gives the position of the first hit (if any) that verifies the given condition, and also gives the value of the volume at the intersection point.

Parameters
[in]rayThe ray used for the intersection test.
[in]hitThe structure holding the two intersection points and the value.
[in]conditionThe condition that needs to be fulfilled to choose an intersection point. The algorithm works by looking at the intersection points in a closest-first order, and stops and returns at the first point that fulfills the condition.
[in]accessorThe accessor to use to sample the volume's value with.
[in]rayTypeThe space this ray should be cast in.
Returns
True if the ray has hit the volume this intersector has been initialized with, false otherwise.

◆ GetAllHits()

MAXON_METHOD Result<Bool> GetAllHits ( const VolumeRay ray,
BaseArray< VolumeRayHit< TYPE >> &  hit,
Delegate< Bool(TYPE, Bool)> &&  condition,
const maxon::GridAccessorRef< TYPE > &  accessor,
VOLUME_RAY_TYPE  rayType = VOLUME_RAY_TYPE::WORLD_SPACE 
)

Perform a ray-volume intersection and gives the position of all the hits (if any) that verify the given condition, and also gives the value of the volume at each intersection point.

Parameters
[in]rayThe ray used for the intersection test.
[in]hitThe structure holding the two intersection points and the value.
[in]conditionThe condition that needs to be fulfilled to choose an intersection point. The algorithm works by looking at the intersection points in a closest-first order, and stops and returns at the first point that fulfills the condition.
[in]accessorThe accessor to use to sample the volume's value with.
[in]rayTypeThe space this ray should be cast in.
Returns
True if the ray has hit the volume this intersector has been initialized with, false otherwise.