Enum mgf::Component [−][src]
A component is a generic volume that can either be a Sphere or Capsule at runtime. Anything that can collide with a Sphere and a Capsule can collide with a component.
Variants
Sphere(Sphere)
Capsule(Capsule)
Methods
impl Component
[src]
impl Component
pub fn deconstruct(
&self
) -> (Point3<f32>, Quaternion<f32>, ComponentConstructor)
[src]
pub fn deconstruct(
&self
) -> (Point3<f32>, Quaternion<f32>, ComponentConstructor)
Create a ComponentConstructor and return the position and rotation of the Component.
Trait Implementations
impl Copy for Component
[src]
impl Copy for Component
impl Clone for Component
[src]
impl Clone for Component
fn clone(&self) -> Component
[src]
fn clone(&self) -> Component
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Component
[src]
impl Debug for Component
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Volumetric for Component
[src]
impl Volumetric for Component
fn rotate<R: Rotation3<f32>>(self, r: R) -> Self
[src]
fn rotate<R: Rotation3<f32>>(self, r: R) -> Self
Rotate the bound in place. This is useless for spheres.
fn rotate_about<R: Rotation3<f32>>(self, r: R, p: Point3<f32>) -> Self
[src]
fn rotate_about<R: Rotation3<f32>>(self, r: R, p: Point3<f32>) -> Self
Rotates the object around a point.
impl From<Sphere> for Component
[src]
impl From<Sphere> for Component
impl From<Capsule> for Component
[src]
impl From<Capsule> for Component
impl Add<Vector3<f32>> for Component
[src]
impl Add<Vector3<f32>> for Component
type Output = Self
The resulting type after applying the +
operator.
fn add(self, v: Vector3<f32>) -> Self
[src]
fn add(self, v: Vector3<f32>) -> Self
Performs the +
operation.
impl Sub<Vector3<f32>> for Component
[src]
impl Sub<Vector3<f32>> for Component
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, v: Vector3<f32>) -> Self
[src]
fn sub(self, v: Vector3<f32>) -> Self
Performs the -
operation.
impl AddAssign<Vector3<f32>> for Component
[src]
impl AddAssign<Vector3<f32>> for Component
fn add_assign(&mut self, v: Vector3<f32>)
[src]
fn add_assign(&mut self, v: Vector3<f32>)
Performs the +=
operation.
impl SubAssign<Vector3<f32>> for Component
[src]
impl SubAssign<Vector3<f32>> for Component
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
fn sub_assign(&mut self, v: Vector3<f32>)
Performs the -=
operation.
impl Shape for Component
[src]
impl Shape for Component
fn center(&self) -> Point3<f32>
[src]
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>
[src]
fn closest_point(&self, to: Point3<f32>) -> Point3<f32>
Returns the closest point on the shape to the given point.
fn set_pos(&mut self, p: Point3<f32>)
[src]
fn set_pos(&mut self, p: Point3<f32>)
Sets the center of the shape to p.
impl BoundedBy<AABB> for Component
[src]
impl BoundedBy<AABB> for Component
impl BoundedBy<Sphere> for Component
[src]
impl BoundedBy<Sphere> for Component
impl<P: Particle> Intersects<Component> for P
[src]
impl<P: Particle> Intersects<Component> for P
fn intersection(&self, rhs: &Component) -> Option<Intersection>
[src]
fn intersection(&self, rhs: &Component) -> Option<Intersection>
Returns an Intersection if one exists.
impl Inertia for Component
[src]
impl Inertia for Component