Struct ncollide_geometry::shape::TriMesh
[−]
[src]
pub struct TriMesh<P: Point> { /* fields omitted */ }
Shape commonly known as a 2d line strip or a 3d triangle mesh.
Methods
impl<P: Point> TriMesh<P>
[src]
fn new(
vertices: Arc<Vec<P>>,
indices: Arc<Vec<Point3<usize>>>,
uvs: Option<Arc<Vec<Point2<P::Real>>>>,
normals: Option<Arc<Vec<P::Vector>>>
) -> TriMesh<P>
vertices: Arc<Vec<P>>,
indices: Arc<Vec<Point3<usize>>>,
uvs: Option<Arc<Vec<Point2<P::Real>>>>,
normals: Option<Arc<Vec<P::Vector>>>
) -> TriMesh<P>
Builds a new mesh.
fn base_mesh(&self) -> &BaseMesh<P, Point3<usize>, Triangle<P>>
The base representation of this mesh.
fn vertices(&self) -> &Arc<Vec<P>>
The vertices of this mesh.
fn bounding_volumes(&self) -> &[AABB<P>]
Bounding volumes of the subsimplices.
fn indices(&self) -> &Arc<Vec<Point3<usize>>>
The indices of this mesh.
fn uvs(&self) -> &Option<Arc<Vec<Point2<P::Real>>>>
The texture coordinates of this mesh.
fn normals(&self) -> &Option<Arc<Vec<P::Vector>>>
The normals of this mesh.
fn bvt(&self) -> &BVT<usize, AABB<P>>
The acceleration structure used for efficient collision detection and ray casting.
impl<P: Point> TriMesh<P>
[src]
fn triangle_at(&self, i: usize) -> Triangle<P>
Gets the i-th mesh element.
Trait Implementations
impl<P: Point> Clone for TriMesh<P>
[src]
fn clone(&self) -> TriMesh<P>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<P: Point, M: Isometry<P>> CompositeShape<P, M> for TriMesh<P>
[src]
fn map_part_at(&self, i: usize, f: &mut FnMut(&M, &Shape<P, M>))
Applies a function to each sub-shape of this concave shape.
fn map_transformed_part_at(
&self,
i: usize,
m: &M,
f: &mut FnMut(&M, &Shape<P, M>)
)
&self,
i: usize,
m: &M,
f: &mut FnMut(&M, &Shape<P, M>)
)
Applies a transformation matrix and a function to each sub-shape of this concave shape. Read more
fn aabb_at(&self, i: usize) -> AABB<P>
Gets the AABB of the shape identified by the index i
.
fn bvt(&self) -> &BVT<usize, AABB<P>>
Gets the acceleration structure of the concave shape.
impl<P: Point, M: Isometry<P>> Shape<P, M> for TriMesh<P>
[src]
fn aabb(&self, m: &M) -> AABB<P>
The AABB of self
.
fn bounding_sphere(&self, m: &M) -> BoundingSphere<P>
The bounding sphere of self
.
fn as_ray_cast(&self) -> Option<&RayCast<P, M>>
The RayCast
implementation of self
.
fn as_point_query(&self) -> Option<&PointQuery<P, M>>
The PointQuery
implementation of self
.
fn as_composite_shape(&self) -> Option<&CompositeShape<P, M>>
The composite shape representation of self
if applicable.
fn is_composite_shape(&self) -> bool
Whether self
uses a composite shape-based representation.
fn as_support_map(&self) -> Option<&SupportMap<P, M>>
The support mapping of self
if applicable.
fn is_support_map(&self) -> bool
Whether self
uses a supportmapping-based representation.
impl<P: Point, M: Isometry<P>> HasBoundingVolume<M, AABB<P>> for TriMesh<P>
[src]
fn bounding_volume(&self, m: &M) -> AABB<P>
The bounding volume of self
transformed by m
.
impl<P: Point, M: Isometry<P>> HasBoundingVolume<M, BoundingSphere<P>> for TriMesh<P>
[src]
fn bounding_volume(&self, m: &M) -> BoundingSphere<P>
The bounding volume of self
transformed by m
.
impl<P: Point, M: Isometry<P>> RayCast<P, M> for TriMesh<P>
[src]
fn toi_with_ray(&self, m: &M, ray: &Ray<P>, solid: bool) -> Option<P::Real>
Computes the time of impact between this transform shape and a ray.
fn toi_and_normal_with_ray(
&self,
m: &M,
ray: &Ray<P>,
solid: bool
) -> Option<RayIntersection<P::Vector>>
&self,
m: &M,
ray: &Ray<P>,
solid: bool
) -> Option<RayIntersection<P::Vector>>
Computes the time of impact, and normal between this transformed shape and a ray.
fn toi_and_normal_and_uv_with_ray(
&self,
m: &M,
ray: &Ray<P>,
solid: bool
) -> Option<RayIntersection<P::Vector>>
&self,
m: &M,
ray: &Ray<P>,
solid: bool
) -> Option<RayIntersection<P::Vector>>
Computes time of impact, normal, and texture coordinates (uv) between this transformed shape and a ray. Read more
fn intersects_ray(&self, m: &M, ray: &Ray<P>) -> bool
Tests whether a ray intersects this transformed shape.
impl<P: Point, M: Isometry<P>> PointQuery<P, M> for TriMesh<P>
[src]
fn project_point(&self, m: &M, point: &P, solid: bool) -> PointProjection<P>
Projects a point on self
transformed by m
.
fn distance_to_point(&self, m: &M, point: &P, solid: bool) -> P::Real
Computes the minimal distance between a point and self
transformed by m
.
fn contains_point(&self, m: &M, point: &P) -> bool
Tests if the given point is inside of self
transformed by m
.