Struct ncollide2df64::geom::Box
pub struct Box { // some fields omitted }
Geometry of a box.
Parameters:
- N - type of an extent of the box
- V - vector of extents. This determines the box dimension
Methods
impl Box
fn new(half_extents: V) -> Box
Creates a new box from its half-extents. Half-extents are the box half-width along each axis. Each half-extent must be greater than 0.04.
fn new_with_margin(half_extents: V, margin: N) -> Box
Creates a new box from its half-extents and its margin. Half-extents are the box half-width along each axis. Each half-extent must be greater than the margin.
impl Box
fn half_extents(&self) -> V
The half-extents of this box. Half-extents are the box half-width along each axis.
fn margin(&self) -> N
The margin surrounding this box.
Note that unlike most other geometries, a box has an interior margin. Therefore, the
real extents of the box (those that have been passed to the Box constructor) equal the sum
of the margin and its half-extents (as returned by the half_extents
method).
Trait Implementations
impl HasAABB for Box
impl Eq for Box
Automatically derived.
impl ToStr for Box
Automatically derived.
fn to_str(&self) -> ~str
impl Clone for Box
Automatically derived.
fn clone(&self) -> Box
impl<__E: Encoder> Encodable<__E> for Box
Automatically derived.
fn encode(&self, __arg_0: &mut __E)
impl<__D: Decoder> Decodable<__D> for Box
Automatically derived.
fn decode(__arg_0: &mut __D) -> Box
impl RayCast for Box
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.
impl Volumetric for Box
fn mass_properties(&self, density: &N) -> (N, V, II)
Given a density, this computes the mass, center of mass, and inertia tensor of this object.
impl HasMargin for Box
fn margin(&self) -> N
The geometry margin.
impl<_M: Rotate<V> + Transform<V>> Implicit<V, _M> for Box
fn support_point_without_margin(&self, m: &_M, dir: &V) -> V
Evaluates the support function of the object. A support function is a
function associating a vector to the geometry point which maximizes their
dot product. This does not include the margin
of the object. Margins are
geometry-dependent. Use support_point
to sample the complete geometry.
Arguments:
dir
- the input of the support function. It is not required for it to be normalized.
fn support_point(&self, transform: &M, dir: &V) -> V
Evaluates the support function of the object. A support function is a function associating a vector to the geometry point which maximizes their dot product.
Arguments:
dir
- the input of the support function. It is not required for it to be normalized.
impl<_M: Rotate<V>> PreferedSamplingDirections<V, _M> for Box
fn sample(&self, transform: &_M, f: |V|)
Applies a function to this geometry with a given transform.