[−][src]Trait mgf::Shape
A type that describes a set of points in space.
Shape is usually used to describe static static objects such as a regular
Sphere
or Capsule
. It allows for these shapes to be decomposed into
some arbitrary center point and displaced by Vectors.
Required methods
fn center(&self) -> Point3<f32>
Returns the center of mass of the geometry, assuming a regular density.
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
Returns the closest point on the shape to the given point.
Provided methods
Loading content...Implementors
impl Shape for Component
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for AABB
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for Capsule
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for Compound
[src]
fn center(&self) -> Point3<f32>
[src]
The point returned by a compound shape is the displacement of the object and not the center of mass. It is impossible for Compound to calculate the center of mass given it has no information regarding the mass of individual components.
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for ConvexMesh
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, _to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for Mesh
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, _to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for OBB
[src]
fn center(&self) -> Point3<f32>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
[src]
fn set_pos(&mut self, p: Point3<f32>)
[src]
impl Shape for Plane
[src]
fn center(&self) -> Point3<f32>
[src]
Conceptually, it's hard to consider any point of a plane the "center".