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,
position: Vector<f32>,
velocity_y: f32,
radius: f32,
height: f32,
) -> Option<TriangleHit>
pub fn collide_capsule( &self, position: Vector<f32>, velocity_y: f32, radius: f32, height: f32, ) -> Option<TriangleHit>
Resolves a vertical capsule against this mesh.
position is the bottom of the capsule, height its total height.
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