Struct mgf::Moving
[−]
[src]
pub struct Moving<T: Copy + Clone + Shape>(pub T, pub Vector3<f32>);
A geometry swept accross a given path of motion.
Methods
impl<T: Copy + Clone + Shape> Moving<T>[src]
fn sweep(obj: T, vel: Vector3<f32>) -> Self[src]
Create a moving object with velocity of vel
fn vel(&self) -> Vector3<f32>[src]
Return the velocity of the object.
Trait Implementations
impl<B: Bound, T: Copy + Clone + Shape + BoundedBy<B>> BoundedBy<B> for Moving<T>[src]
fn bounds(&self) -> B[src]
The bounds for a swept object is the bounds extended in the direction and magnitude of the velocity.
impl<T> Collider<Contact, T> for Moving<Component> where
T: Collider<Contact, Moving<Sphere>> + Collider<Contact, Moving<Capsule>>, [src]
T: Collider<Contact, Moving<Sphere>> + Collider<Contact, Moving<Capsule>>,
fn collide<F: FnMut(Contact)>(&self, rhs: &T, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Component> for Moving<Sphere>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Component, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Component> for Moving<Capsule>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Component, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl<T: Copy + Copy + Clone + Shape> Copy for Moving<T>[src]
impl<T: Clone + Copy + Clone + Shape> Clone for Moving<T>[src]
fn clone(&self) -> Moving<T>[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<T: Debug + Copy + Clone + Shape> Debug for Moving<T>[src]
impl<T: Copy + Clone + Shape> AsRef<T> for Moving<T>[src]
impl<T: Copy + Clone + Shape> Delta for Moving<T>[src]
impl Collider<Intersection, Ray> for Moving<Sphere>[src]
fn collide<F: FnMut(Intersection)>(&self, rhs: &Ray, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Plane> for Moving<Sphere>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Plane, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Plane> for Moving<Capsule>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Plane, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Triangle> for Moving<Sphere>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Triangle> for Moving<Capsule>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Triangle, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Rectangle> for Moving<Sphere>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Rectangle, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl Collider<Contact, Rectangle> for Moving<Capsule>[src]
fn collide<F: FnMut(Contact)>(&self, rhs: &Rectangle, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl<Recv, Arg> Collider<Contact, Arg> for Moving<Recv> where
Arg: Shape + Copy,
Recv: Collider<Contact, Moving<Arg>> + Shape + Copy, [src]
Arg: Shape + Copy,
Recv: Collider<Contact, Moving<Arg>> + Shape + Copy,
fn collide<F: FnMut(Contact)>(&self, other: &Arg, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl<K, T> Collider<Contact, Moving<T>> for Moving<K> where
K: Collider<Contact, Moving<T>> + Copy + Clone + Shape,
T: Copy + Clone + Shape, [src]
K: Collider<Contact, Moving<T>> + Copy + Clone + Shape,
T: Copy + Clone + Shape,
Any two moving object collision can be reduced to a one moving one static. object collision. This is done by finding the relative velocity between the two objects.
fn collide<F: FnMut(Contact)>(&self, other: &Moving<T>, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl<Recv, Arg> Collider<LocalContact, Arg> for Moving<Recv> where
Recv: Shape + Copy,
Arg: Shape + Collider<Contact, Moving<Recv>> + Copy, [src]
Recv: Shape + Copy,
Arg: Shape + Collider<Contact, Moving<Recv>> + Copy,
fn collide<F: FnMut(LocalContact)>(&self, other: &Arg, callback: F) -> bool[src]
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.
impl<Recv, Arg> Collider<LocalContact, Moving<Arg>> for Moving<Recv> where
Recv: Shape + Collider<Contact, Moving<Arg>> + Copy,
Arg: Shape + Copy, [src]
Recv: Shape + Collider<Contact, Moving<Arg>> + Copy,
Arg: Shape + Copy,
fn collide<F: FnMut(LocalContact)>(
&self,
other: &Moving<Arg>,
callback: F
) -> bool[src]
&self,
other: &Moving<Arg>,
callback: F
) -> bool
Collide with an object and call the callback for as many contacts there are. True is returned if any contact is found. Read more
fn check_collision(&self, other: &T) -> Option<CollisionType>[src]
Returns the first collision found if any exists.