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

source

pub fn bounding_sphere(&self, pos: &Isometry<Real>) -> BoundingSphere

Computes the world-space bounding sphere of this triangle mesh, transformed by pos.

source

pub fn local_bounding_sphere(&self) -> BoundingSphere

Computes the local-space bounding sphere of this triangle mesh.

source§

impl TriMesh

source

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.

source

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.

source

pub fn set_flags(&mut self, flags: TriMeshFlags) -> Result<(), TopologyError>

Sets the flags of this triangle mesh, controlling its optional associated data.

source

pub fn transform_vertices(&mut self, transform: &Isometry<Real>)

Transforms in-place the vertices of this triangle mesh.

source

pub fn scaled(self, scale: &Vector<Real>) -> Self

Returns a scaled version of this triangle mesh.

source

pub fn append(&mut self, rhs: &TriMesh)

Appends a second triangle mesh to this triangle mesh.

source

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.

source

pub fn flat_indices(&self) -> &[u32]

A flat view of the index buffer of this mesh.

source

pub fn reverse(&mut self)

Reverse the orientation of the triangle mesh.

source

pub fn triangles(&self) -> impl ExactSizeIterator<Item = Triangle> + '_

An iterator through all the triangles of this mesh.

Trait Implementations§

source§

impl RayCast for TriMesh

source§

fn cast_local_ray(&self, ray: &Ray, max_toi: Real, solid: bool) -> Option<Real>

Computes the time of impact between this transform shape and a ray.
source§

fn cast_local_ray_and_get_normal( &self, ray: &Ray, max_toi: Real, solid: bool ) -> Option<RayIntersection>

Computes the time of impact, and normal between this transformed shape and a ray.
source§

fn intersects_local_ray(&self, ray: &Ray, max_toi: Real) -> bool

Tests whether a ray intersects this transformed shape.
source§

fn cast_ray( &self, m: &Isometry<Real>, ray: &Ray, max_toi: Real, solid: bool ) -> Option<Real>

Computes the time of impact between this transform shape and a ray.
source§

fn cast_ray_and_get_normal( &self, m: &Isometry<Real>, ray: &Ray, max_toi: Real, solid: bool ) -> Option<RayIntersection>

Computes the time of impact, and normal between this transformed shape and a ray.
source§

fn intersects_ray(&self, m: &Isometry<Real>, ray: &Ray, max_toi: Real) -> bool

Tests whether a ray intersects this transformed shape.
source§

impl Shape for TriMesh

source§

fn clone_box(&self) -> Box<dyn Shape>

Clones this shape into a boxed trait-object.
source§

fn compute_local_aabb(&self) -> Aabb

Computes the Aabb of this shape.
source§

fn compute_local_bounding_sphere(&self) -> BoundingSphere

Computes the bounding-sphere of this shape.
source§

fn compute_aabb(&self, position: &Isometry<Real>) -> Aabb

Computes the Aabb of this shape with the given position.
source§

fn mass_properties(&self, density: Real) -> MassProperties

Compute the mass-properties of this shape given its uniform density.
source§

fn shape_type(&self) -> ShapeType

Gets the type tag of this shape.
source§

fn as_typed_shape(&self) -> TypedShape<'_>

Gets the underlying shape as an enum.
source§

fn ccd_thickness(&self) -> Real

source§

fn ccd_angular_thickness(&self) -> Real

source§

fn as_composite_shape(&self) -> Option<&dyn SimdCompositeShape>

source§

fn compute_bounding_sphere(&self, position: &Isometry<Real>) -> BoundingSphere

Computes the bounding-sphere of this shape with the given position.
source§

fn is_convex(&self) -> bool

Is this shape known to be convex? Read more
source§

fn as_support_map(&self) -> Option<&dyn SupportMap>

Convents this shape into its support mapping, if it has one.
source§

fn as_polygonal_feature_map(&self) -> Option<(&dyn PolygonalFeatureMap, Real)>

Converts this shape to a polygonal feature-map, if it is one.
source§

fn feature_normal_at_point( &self, _feature: FeatureId, _point: &Point<Real> ) -> Option<Unit<Vector<Real>>>

The shape’s normal at the given point located on a specific feature.
source§

fn compute_swept_aabb( &self, start_pos: &Isometry<Real>, end_pos: &Isometry<Real> ) -> Aabb

Computes the swept Aabb of this shape, i.e., the space it would occupy by moving from the given start position to the given end position.
source§

impl SimdCompositeShape for TriMesh

source§

fn map_part_at( &self, i: u32, f: &mut dyn FnMut(Option<&Isometry<Real>>, &dyn Shape) )

Applies a function to one sub-shape of this composite shape.
source§

fn qbvh(&self) -> &Qbvh<u32>

Gets the acceleration structure of the composite shape.