[][src]Trait ncollide2d::pipeline::object::CollisionObjectRef

pub trait CollisionObjectRef<N: RealField> {
    fn graph_index(&self) -> Option<CollisionObjectGraphIndex>;
fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>;
fn position(&self) -> &Isometry<N>;
fn predicted_position(&self) -> Option<&Isometry<N>>;
fn shape(&self) -> &dyn Shape<N>;
fn collision_groups(&self) -> &CollisionGroups;
fn query_type(&self) -> GeometricQueryType<N>;
fn update_flags(&self) -> CollisionObjectUpdateFlags; fn compute_aabb(&self) -> AABB<N> { ... }
fn compute_swept_aabb(&self) -> AABB<N> { ... } }

Trait implemented by collision objects.

Required methods

fn graph_index(&self) -> Option<CollisionObjectGraphIndex>

The interaction graph index of this collision object, if it has been registered into an interaction graph.

Se the glue::create_proxies for more details.

fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>

The broad-phase proxy handle of this collision object, if it has been registered into a broad-phase.

Se the glue::create_proxies for more details.

fn position(&self) -> &Isometry<N>

The position of this collision object.

fn predicted_position(&self) -> Option<&Isometry<N>>

The expected position of this collision object in the next updates.

This is used to enlarge the collision object bounding volume such that at yields more potential interaction pairs. This is typically needed for CCD (continuous collision detection) to be sure the broad-phase does not miss pential interactions in-between two discontinuous positions of the collision object.

fn shape(&self) -> &dyn Shape<N>

The shape of this collision object.

fn collision_groups(&self) -> &CollisionGroups

The collision groups of this collision object.

fn query_type(&self) -> GeometricQueryType<N>

The type of geometric queries this collision object is subjected to.

fn update_flags(&self) -> CollisionObjectUpdateFlags

Flags indicating what changed in this collision object.

Loading content...

Provided methods

fn compute_aabb(&self) -> AABB<N>

Computes the AABB of this collision object, ignoring self.predicted_position().

fn compute_swept_aabb(&self) -> AABB<N>

Computes the swept AABB of this collision object, taking self.predict_position() into account.

Given the AABB of this collision object at the position self.position()’, and the AABB of this collision object at the position self.predicted_position()`, this returns an AABB that bounds both.

Loading content...

Implementors

Loading content...