Trait UserGeometryImpl

Source
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§

Source

fn bounds(&self) -> RTCBounds

Returns the bounds of the geometry

Source

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 tfar field
  • the hit’s normals (Ng_x, Ng_y, Ng_z)
  • the hit’s u and v coordinates
  • the hit’s primID, geomID and instID

must all be updated.

Setting ray_hit.hit.geomID to the supplied geom_id signals an intersection.

Implementors§