[][src]Struct mgf::Compound

pub struct Compound {
    pub disp: Vector3<f32>,
    pub rot: Quaternion<f32>,
    pub shapes: SmallVec<[usize; 1]>,
    pub bvh: BVH<AABB, Component>,
}

An aggregate structure of Spheres and Capsules. Has a position and rotation.

Fields

disp: Vector3<f32>

The displacement of the object.

rot: Quaternion<f32>

The rotation of the object. Assumed to be normalized.

shapes: SmallVec<[usize; 1]>

Indices of the geometries composing the compound in the BVH. One-to-one with the constructing vector.

bvh: BVH<AABB, Component>

BVH storing the components to improve collision efficiency.

Methods

impl Compound[src]

pub fn new(components: Vec<Component>) -> Self[src]

Trait Implementations

impl BoundedBy<AABB> for Compound[src]

impl BoundedBy<Sphere> for Compound[src]

impl<P: Particle> Intersects<Compound> for P[src]

impl<RHS> Contacts<RHS> for Compound where
    RHS: Contacts<Component> + BoundedBy<AABB>, 
[src]

fn last_contact(&self, rhs: &RHS) -> Option<Contact>[src]

Returns the last contact found, if one exists.

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 set_pos(&mut self, p: Point3<f32>)[src]

Sets the center of the shape to p.

impl Clone for Compound[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl AddAssign<Vector3<f32>> for Compound[src]

impl SubAssign<Vector3<f32>> for Compound[src]

Auto Trait Implementations

impl Send for Compound

impl Sync for Compound

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.