[src]

Struct ncollide2df64::geom::Mesh

pub struct Mesh {
    // some fields omitted
}

Geometry commonly known as a 2d line strip or a 3d triangle mesh.

Methods

impl Mesh

fn new(vertices: Arc<~[V]>, indices: Arc<~[uint]>, uvs: Option<Arc<~[(N, N, N)]>>, normals: Option<Arc<~[V]>>) -> Mesh

Builds a new mesh with a default margin of 0.04.

fn new_with_margin(vertices: Arc<~[V]>, indices: Arc<~[uint]>, uvs: Option<Arc<~[(N, N, N)]>>, normals: Option<Arc<~[V]>>, margin: N) -> Mesh

Builds a new mesh with a custom margin.

impl Mesh

fn vertices<'a>(&'a self) -> &'a Arc<~[V]>

The vertices of this mesh.

fn bounding_volumes<'a>(&'a self) -> &'a [AABB]

Bounding volumes of the subsimplices.

fn indices<'a>(&'a self) -> &'a Arc<~[uint]>

The indices of this mesh.

fn uvs<'a>(&'a self) -> &'a Option<Arc<~[(N, N, N)]>>

The texture coordinates of this mesh.

fn normals<'a>(&'a self) -> &'a Option<Arc<~[V]>>

The normals of this mesh.

fn bvt<'a>(&'a self) -> &'a BVT<uint, AABB>

The acceleration structure used for efficient collision detection and ray casting.

fn margin(&self) -> N

The collision margin used by this mesh.

impl Mesh

fn element_at(&self, i: uint) -> E

Gets the i-th mesh element.

Trait Implementations

impl Clone for Mesh

fn clone(&self) -> Mesh

impl ConcaveGeom for Mesh

fn map_part_at(&self, i: uint, f: |&M, &Geom|)

Applies a function to each sub-geometry of this concave geometry.

fn map_transformed_part_at(&self, m: &M, i: uint, f: |&M, &Geom|)

Applies a transformation matrix and a function to each sub-geometry of this concave geometry.

fn approx_interferences_with_aabb(&self, aabb: &AABB, out: &mut ~[uint])

Computes the indices of every sub-geometry which might intersect a given AABB.

fn approx_interferences_with_ray(&self, ray: &Ray, out: &mut ~[uint])

Computes the indices of every sub-geometry which might intersect a given Ray.

fn aabb_at<'a>(&'a self, i: uint) -> &'a AABB

Gets the AABB of the geometry identified by the index i.

impl HasAABB for Mesh

fn aabb(&self, m: &M) -> AABB

The object’s AABB.

impl RayCast for Mesh

fn toi_with_ray(&self, ray: &Ray) -> Option<N>

Computes the time of impact between this geometry and a ray

fn toi_and_normal_with_ray(&self, ray: &Ray) -> Option<(N, V)>

Computes the intersection point between this geometry and a ray.

fn intersects_ray(&self, ray: &Ray) -> bool

Tests whether a ray intersects this geometry.

fn toi_with_transform_and_ray(&self, m: &M, ray: &Ray) -> Option<N>

Computes the time of impact between this transform geometry and a ray.

fn toi_and_normal_with_transform_and_ray(&self, m: &M, ray: &Ray) -> Option<(N, V)>

Computes the time of impact, and normal between this transformed geometry and a ray.

fn intersects_with_transform_and_ray(&self, m: &M, ray: &Ray) -> bool

Tests whether a ray intersects this transformed geometry.

impl Volumetric for Mesh

fn mass_properties(&self, _: &N) -> (N, V, II)

Given a density, this computes the mass, center of mass, and inertia tensor of this object.