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§
Sourcefn graph_index(&self) -> Option<CollisionObjectGraphIndex>
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.
Sourcefn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
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.
Sourcefn predicted_position(&self) -> Option<&Isometry<N>>
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.
Sourcefn collision_groups(&self) -> &CollisionGroups
fn collision_groups(&self) -> &CollisionGroups
The collision groups of this collision object.
Sourcefn query_type(&self) -> GeometricQueryType<N>
fn query_type(&self) -> GeometricQueryType<N>
The type of geometric queries this collision object is subjected to.
Sourcefn update_flags(&self) -> CollisionObjectUpdateFlags
fn update_flags(&self) -> CollisionObjectUpdateFlags
Flags indicating what changed in this collision object.
Provided Methods§
Sourcefn compute_aabb(&self) -> AABB<N>
fn compute_aabb(&self) -> AABB<N>
Computes the AABB of this collision object, ignoring self.predicted_position()
.
Sourcefn compute_swept_aabb(&self) -> AABB<N>
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.