pub trait UserGeometryImpl {
// Required methods
fn bounds(&self) -> RTCBounds;
fn intersect(
&self,
geom_id: u32,
prim_id: u32,
ctx: &RTCRayQueryContext,
ray_hit: &mut RTCRayHit,
);
}Expand description
The user geometry implementation. If you want to use custom geometry, you need to implement this trait. See the examples/ for an example of how to implement one.
Required Methods§
Sourcefn intersect(
&self,
geom_id: u32,
prim_id: u32,
ctx: &RTCRayQueryContext,
ray_hit: &mut RTCRayHit,
)
fn intersect( &self, geom_id: u32, prim_id: u32, ctx: &RTCRayQueryContext, ray_hit: &mut RTCRayHit, )
Computes an intersection between the given ray and the geometry. If an intersection is found,
- the ray’s
tfarfield - the hit’s normals (
Ng_x,Ng_y,Ng_z) - the hit’s
uandvcoordinates - the hit’s
primID,geomIDandinstID
must all be updated.
Setting ray_hit.hit.geomID to the supplied geom_id signals an intersection.