Skip to main content

Shape

Trait Shape 

Source
pub trait Shape {
    // Required methods
    fn is_convex(&self) -> bool;
    fn clone_box(&self) -> ShapeWrapper;
    fn get_shape_type(&self) -> ShapeType;

    // Provided methods
    fn get_radius(&self) -> Option<f32> { ... }
    fn get_half_extents(&self) -> Option<Vector3<f32>> { ... }
    fn get_half_length(&self) -> Option<f32> { ... }
    fn get_mesh_path(&self) -> Option<String> { ... }
}
Expand description

Shape trait for defining geometric shapes.

Required Methods§

Source

fn is_convex(&self) -> bool

Returns whether the shape is convex or not.

Source

fn clone_box(&self) -> ShapeWrapper

Clones the shape and returns a boxed version of it.

Source

fn get_shape_type(&self) -> ShapeType

Returns the shape type.

Provided Methods§

Source

fn get_radius(&self) -> Option<f32>

Returns the radius of the shape.

Source

fn get_half_extents(&self) -> Option<Vector3<f32>>

Returns the half extents of the shape.

Source

fn get_half_length(&self) -> Option<f32>

Returns the half length of the shape.

Source

fn get_mesh_path(&self) -> Option<String>

Returns the mesh path of the shape.

Implementors§