Struct ncollide2df64::bounding_volume::AABB
pub struct AABB { // some fields omitted }
An Axis Aligned Bounding Box.
Parameter:
V
- type of the points of the bounding box. It determines the AABB dimension.N
- type of the one components of the aabb points.
Methods
impl AABB
fn mins<'r>(&'r self) -> &'r V
Reference to the AABB point with the smallest components along each axis.
fn maxs<'r>(&'r self) -> &'r V
Reference to the AABB point with the biggest components along each axis.
impl AABB
fn new(mins: V, maxs: V) -> AABB
Creates a new AABB.
Arguments:
mins
- position of the point with the smallest coordinates.maxs
- position of the point with the highest coordinates. Each component ofmins
must be smaller than the related components ofmaxs
.
fn new_invalid() -> AABB
Creates an invalid AABB with:
* mins = Bounded::max_value()
* maxs = Bounded::max_value()
.
This is useful to build aabb using merges.
Trait Implementations
impl ToStr for AABB
Automatically derived.
fn to_str(&self) -> ~str
impl Eq for AABB
Automatically derived.
impl Clone for AABB
Automatically derived.
fn clone(&self) -> AABB
impl<__E: Encoder> Encodable<__E> for AABB
Automatically derived.
fn encode(&self, __arg_0: &mut __E)
impl<__D: Decoder> Decodable<__D> for AABB
Automatically derived.
fn decode(__arg_0: &mut __D) -> AABB
impl BoundingVolume for AABB
fn intersects(&self, other: &AABB) -> bool
Checks if this bounding volume intersect with another one.
fn contains(&self, other: &AABB) -> bool
Checks if this bounding volume contains another one.
fn merge(&mut self, other: &AABB)
Merges this bounding volume with another one. The merge is done in-place.
fn merged(&self, other: &AABB) -> AABB
Merges this bounding volume with another one.
impl Translation<V> for AABB
fn translation(&self) -> V
fn inv_translation(&self) -> V
fn append_translation(&mut self, dv: &V)
fn append_translation_cpy(aabb: &AABB, dv: &V) -> AABB
fn prepend_translation(&mut self, dv: &V)
fn prepend_translation_cpy(aabb: &AABB, dv: &V) -> AABB
fn set_translation(&mut self, v: V)
impl LooseBoundingVolume for AABB
fn loosen(&mut self, amount: N)
Enlarges this bounding volume.
fn loosened(&self, amount: N) -> AABB
Creates a new, enlarged version, of this bounding volume.
impl RayCast for AABB
fn toi_with_ray(&self, ray: &Ray) -> Option<N>
Computes the time of impact between this geometry and a ray
fn toi_and_normal_with_ray(&self, ray: &Ray) -> Option<(N, V)>
Computes the intersection point between this geometry and a ray.
fn intersects_ray(&self, ray: &Ray) -> bool
Tests whether a ray intersects this geometry.
fn toi_with_transform_and_ray(&self, m: &M, ray: &Ray) -> Option<N>
Computes the time of impact between this transform geometry and a ray.
fn toi_and_normal_with_transform_and_ray(&self, m: &M, ray: &Ray) -> Option<(N, V)>
Computes the time of impact, and normal between this transformed geometry and a ray.
fn intersects_with_transform_and_ray(&self, m: &M, ray: &Ray) -> bool
Tests whether a ray intersects this transformed geometry.