Struct ncollide_geometry::shape::BaseMesh
[−]
[src]
pub struct BaseMesh<P: Point, I, E> { /* fields omitted */ }
A mesh generic wrt. the contained mesh elements characterized by vertices.
Methods
impl<P, I, E> BaseMesh<P, I, E> where
P: Point,
E: BaseMeshElement<I, P> + HasBoundingVolume<Id, AABB<P>>,
[src]
P: Point,
E: BaseMeshElement<I, P> + HasBoundingVolume<Id, AABB<P>>,
fn new(
vertices: Arc<Vec<P>>,
indices: Arc<Vec<I>>,
uvs: Option<Arc<Vec<Point2<P::Real>>>>,
normals: Option<Arc<Vec<P::Vector>>>
) -> BaseMesh<P, I, E>
vertices: Arc<Vec<P>>,
indices: Arc<Vec<I>>,
uvs: Option<Arc<Vec<Point2<P::Real>>>>,
normals: Option<Arc<Vec<P::Vector>>>
) -> BaseMesh<P, I, E>
Builds a new mesh.
impl<P, I, E> BaseMesh<P, I, E> where
P: Point,
[src]
P: Point,
fn vertices(&self) -> &Arc<Vec<P>>
The vertices of this mesh.
fn len(&self) -> usize
The number of primitives on thes mesh.
fn bounding_volumes(&self) -> &[AABB<P>]
Bounding volumes of the subsimplices.
fn indices(&self) -> &Arc<Vec<I>>
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, I, E> BaseMesh<P, I, E> where
P: Point,
E: BaseMeshElement<I, P>,
[src]
P: Point,
E: BaseMeshElement<I, P>,
fn element_at(&self, i: usize) -> E
Gets the i-th mesh element.
Trait Implementations
impl<P, I, E> Clone for BaseMesh<P, I, E> where
P: Point,
[src]
P: Point,
fn clone(&self) -> BaseMesh<P, I, E>
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, M, I, E> HasBoundingVolume<M, AABB<P>> for BaseMesh<P, I, E> where
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P>,
[src]
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P>,
fn bounding_volume(&self, m: &M) -> AABB<P>
The bounding volume of self
transformed by m
.
impl<P, M, I, E> HasBoundingVolume<M, BoundingSphere<P>> for BaseMesh<P, I, E> where
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P>,
[src]
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P>,
fn bounding_volume(&self, m: &M) -> BoundingSphere<P>
The bounding volume of self
transformed by m
.
impl<P, M, I, E> RayCast<P, M> for BaseMesh<P, I, E> where
P: Point,
M: Isometry<P>,
I: Index<usize, Output = usize>,
E: BaseMeshElement<I, P> + RayCast<P, Id>,
[src]
P: Point,
M: Isometry<P>,
I: Index<usize, Output = usize>,
E: BaseMeshElement<I, P> + RayCast<P, Id>,
fn toi_with_ray(&self, m: &M, ray: &Ray<P>, _: 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>,
_: bool
) -> Option<RayIntersection<P::Vector>>
&self,
m: &M,
ray: &Ray<P>,
_: 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, M, I, E> PointQuery<P, M> for BaseMesh<P, I, E> where
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P> + PointQuery<P, Id> + RichPointQuery<P, Id>,
[src]
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P> + PointQuery<P, Id> + RichPointQuery<P, Id>,
fn project_point(&self, m: &M, point: &P, solid: bool) -> PointProjection<P>
Projects a point on 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
.
fn distance_to_point(&self, m: &M, pt: &P, solid: bool) -> P::Real
Computes the minimal distance between a point and self
transformed by m
.
impl<P, M, I, E> RichPointQuery<P, M> for BaseMesh<P, I, E> where
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P> + RichPointQuery<P, Id>,
[src]
P: Point,
M: Isometry<P>,
E: BaseMeshElement<I, P> + RichPointQuery<P, Id>,
type ExtraInfo = PointProjectionInfo<E::ExtraInfo>
Additional shape-specific projection information Read more
fn project_point_with_extra_info(
&self,
m: &M,
point: &P,
_: bool
) -> (PointProjection<P>, Self::ExtraInfo)
&self,
m: &M,
point: &P,
_: bool
) -> (PointProjection<P>, Self::ExtraInfo)
Projects a point on self
transformed by m
.