Type Alias parry2d_f64::shape::TriMesh
source · pub type TriMesh = GenericTriMesh<DefaultStorage>;Expand description
A triangle-mesh.
Aliased Type§
struct TriMesh { /* private fields */ }Implementations§
source§impl TriMesh
impl TriMesh
sourcepub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere
pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere
Computes the world-space bounding sphere of this triangle mesh, transformed by pos.
sourcepub fn local_bounding_sphere(&self) -> BoundingSphere
pub fn local_bounding_sphere(&self) -> BoundingSphere
Computes the local-space bounding sphere of this triangle mesh.
source§impl TriMesh
impl TriMesh
sourcepub fn new(vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>) -> Self
pub fn new(vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>) -> Self
Creates a new triangle mesh from a vertex buffer and an index buffer.
sourcepub fn with_flags(
vertices: Vec<Point<Real>>,
indices: Vec<[u32; 3]>,
flags: TriMeshFlags
) -> Self
pub fn with_flags( vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>, flags: TriMeshFlags ) -> Self
Creates a new triangle mesh from a vertex buffer and an index buffer, and flags controlling optional properties.
sourcepub fn set_flags(&mut self, flags: TriMeshFlags) -> Result<(), TopologyError>
pub fn set_flags(&mut self, flags: TriMeshFlags) -> Result<(), TopologyError>
Sets the flags of this triangle mesh, controlling its optional associated data.
sourcepub fn transform_vertices(&mut self, transform: &Isometry<Real>)
pub fn transform_vertices(&mut self, transform: &Isometry<Real>)
Transforms in-place the vertices of this triangle mesh.
sourcepub fn scaled(self, scale: &Vector<Real>) -> Self
pub fn scaled(self, scale: &Vector<Real>) -> Self
Returns a scaled version of this triangle mesh.
sourcepub fn from_polygon(vertices: Vec<Point<Real>>) -> Option<Self>
pub fn from_polygon(vertices: Vec<Point<Real>>) -> Option<Self>
Create a TriMesh from a set of points assumed to describe a counter-clockwise non-convex polygon.
This operation may fail if the input polygon is invalid, e.g. it is non-simple or has zero surface area.
sourcepub fn flat_indices(&self) -> &[u32]
pub fn flat_indices(&self) -> &[u32]
A flat view of the index buffer of this mesh.
sourcepub fn triangles(&self) -> impl ExactSizeIterator<Item = Triangle> + '_
pub fn triangles(&self) -> impl ExactSizeIterator<Item = Triangle> + '_
An iterator through all the triangles of this mesh.
Trait Implementations§
source§impl RayCast for TriMesh
impl RayCast for TriMesh
source§fn cast_local_ray(&self, ray: &Ray, max_toi: Real, solid: bool) -> Option<Real>
fn cast_local_ray(&self, ray: &Ray, max_toi: Real, solid: bool) -> Option<Real>
source§fn cast_local_ray_and_get_normal(
&self,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
fn cast_local_ray_and_get_normal( &self, ray: &Ray, max_toi: Real, solid: bool ) -> Option<RayIntersection>
source§fn intersects_local_ray(&self, ray: &Ray, max_toi: Real) -> bool
fn intersects_local_ray(&self, ray: &Ray, max_toi: Real) -> bool
source§fn cast_ray(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<Real>
fn cast_ray( &self, m: &Isometry<Real>, ray: &Ray, max_toi: Real, solid: bool ) -> Option<Real>
source§fn cast_ray_and_get_normal(
&self,
m: &Isometry<Real>,
ray: &Ray,
max_toi: Real,
solid: bool
) -> Option<RayIntersection>
fn cast_ray_and_get_normal( &self, m: &Isometry<Real>, ray: &Ray, max_toi: Real, solid: bool ) -> Option<RayIntersection>
source§impl Shape for TriMesh
impl Shape for TriMesh
source§fn compute_local_aabb(&self) -> Aabb
fn compute_local_aabb(&self) -> Aabb
Aabb of this shape.source§fn compute_local_bounding_sphere(&self) -> BoundingSphere
fn compute_local_bounding_sphere(&self) -> BoundingSphere
source§fn compute_aabb(&self, position: &Isometry<Real>) -> Aabb
fn compute_aabb(&self, position: &Isometry<Real>) -> Aabb
Aabb of this shape with the given position.