pub struct TriangleMesh { /* private fields */ }Expand description
A static triangle mesh prepared for capsule collision and raycasts.
Implementations§
Source§impl TriangleMesh
impl TriangleMesh
Sourcepub fn from_vertices(positions: &[[f32; 3]], indices: &[u32]) -> Self
pub fn from_vertices(positions: &[[f32; 3]], indices: &[u32]) -> Self
Builds a mesh from raw vertex positions and triangle indices.
Degenerate triangles and out-of-range indices are skipped. A bounding volume hierarchy is built once the mesh exceeds 16 triangles.
Sourcepub fn collide_capsule(
&self,
segment_bottom: Vector<f32>,
segment_top: Vector<f32>,
radius: f32,
up: Vector<f32>,
motion: Motion,
) -> Option<TriangleHit>
pub fn collide_capsule( &self, segment_bottom: Vector<f32>, segment_top: Vector<f32>, radius: f32, up: Vector<f32>, motion: Motion, ) -> Option<TriangleHit>
Resolves a capsule aligned with up against this mesh.
segment_bottom/segment_top are the capsule’s inner segment
endpoints (sphere centers), up the unit vector walkable ground is
measured against. Returns None when nothing touches.
Auto Trait Implementations§
impl Freeze for TriangleMesh
impl RefUnwindSafe for TriangleMesh
impl Send for TriangleMesh
impl Sync for TriangleMesh
impl Unpin for TriangleMesh
impl UnsafeUnpin for TriangleMesh
impl UnwindSafe for TriangleMesh
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more