Trait collide::Collider [−][src]
pub trait Collider<Other = Self> {
type Vector: VectorSpace;
fn collision_info(
&self,
other: &Other
) -> Option<CollisionInfo<Self::Vector>>;
fn check_collision(&self, other: &Other) -> bool { ... }
}
Expand description
The collider trait, all colliders need to implement.
Associated Types
type Vector: VectorSpace
type Vector: VectorSpace
The vector type of this collider.
Required methods
fn collision_info(&self, other: &Other) -> Option<CollisionInfo<Self::Vector>>
fn collision_info(&self, other: &Other) -> Option<CollisionInfo<Self::Vector>>
If both colliders collide, returns some collision info, else returns none.
Provided methods
fn check_collision(&self, other: &Other) -> bool
fn check_collision(&self, other: &Other) -> bool
Checks the collision between two colliders. Defaults to a check of the return value of collision info.