Allow using polylines as a collider shape.

This commit is contained in:
Crozet Sébastien
2021-01-26 16:41:21 +01:00
parent e1f50eb6e8
commit 23a86c294e
10 changed files with 294 additions and 53 deletions

View File

@@ -299,6 +299,11 @@ impl ColliderBuilder {
Self::new(SharedShape::round_triangle(a, b, c, border_radius))
}
/// Initializes a collider builder with a polyline shape defined by its vertex and index buffers.
pub fn polyline(vertices: Vec<Point<Real>>, indices: Option<Vec<[u32; 2]>>) -> Self {
Self::new(SharedShape::polyline(vertices, indices))
}
/// Initializes a collider builder with a triangle mesh shape defined by its vertex and index buffers.
pub fn trimesh(vertices: Vec<Point<Real>>, indices: Vec<[u32; 3]>) -> Self {
Self::new(SharedShape::trimesh(vertices, indices))