ncollide3d::pipeline::object

Trait CollisionObjectRef

Source
pub trait CollisionObjectRef<N: RealField + Copy> {
    // Required methods
    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;

    // Provided methods
    fn compute_aabb(&self) -> AABB<N> { ... }
    fn compute_swept_aabb(&self) -> AABB<N> { ... }
}
Expand description

Trait implemented by collision objects.

Required Methods§

Source

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.

Source

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.

Source

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

The position of this collision object.

Source

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.

Source

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

The shape of this collision object.

Source

fn collision_groups(&self) -> &CollisionGroups

The collision groups of this collision object.

Source

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

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

Source

fn update_flags(&self) -> CollisionObjectUpdateFlags

Flags indicating what changed in this collision object.

Provided Methods§

Source

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

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

Source

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.

Implementors§