pub struct CollisionObject<N: RealField + Copy, T> { /* private fields */ }
Expand description
A stand-alone object that has a position and a shape.
Implementations§
Source§impl<N: RealField + Copy, T> CollisionObject<N, T>
impl<N: RealField + Copy, T> CollisionObject<N, T>
Sourcepub fn new(
proxy_handle: Option<BroadPhaseProxyHandle>,
graph_index: Option<CollisionObjectGraphIndex>,
position: Isometry<N>,
shape: ShapeHandle<N>,
groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T,
) -> CollisionObject<N, T>
pub fn new( proxy_handle: Option<BroadPhaseProxyHandle>, graph_index: Option<CollisionObjectGraphIndex>, position: Isometry<N>, shape: ShapeHandle<N>, groups: CollisionGroups, query_type: GeometricQueryType<N>, data: T, ) -> CollisionObject<N, T>
Creates a new collision object.
Sourcepub fn graph_index(&self) -> Option<CollisionObjectGraphIndex>
pub fn graph_index(&self) -> Option<CollisionObjectGraphIndex>
The collision object non-stable graph index.
This index may change whenever a collision object is removed from the world.
Sourcepub fn set_graph_index(&mut self, index: Option<CollisionObjectGraphIndex>)
pub fn set_graph_index(&mut self, index: Option<CollisionObjectGraphIndex>)
Sets the collision object unique but non-stable graph index.
Sourcepub fn update_flags_mut(&mut self) -> &mut CollisionObjectUpdateFlags
pub fn update_flags_mut(&mut self) -> &mut CollisionObjectUpdateFlags
Mutable reference to this collision object’s update flags.
Sourcepub fn clear_update_flags(&mut self)
pub fn clear_update_flags(&mut self)
Clears the update flags of this collision object.
Sourcepub fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
pub fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
The collision object’s broad phase proxy unique identifier.
Sourcepub fn set_proxy_handle(&mut self, handle: Option<BroadPhaseProxyHandle>)
pub fn set_proxy_handle(&mut self, handle: Option<BroadPhaseProxyHandle>)
Set collision object’s broad phase proxy unique identifier.
Sourcepub fn predicted_position(&self) -> Option<&Isometry<N>>
pub fn predicted_position(&self) -> Option<&Isometry<N>>
The predicted collision object position.
Sourcepub fn set_position(&mut self, pos: Isometry<N>)
pub fn set_position(&mut self, pos: Isometry<N>)
Sets the position of the collision object and resets the predicted position to None.
Sourcepub fn set_position_with_prediction(
&mut self,
pos: Isometry<N>,
prediction: Isometry<N>,
)
pub fn set_position_with_prediction( &mut self, pos: Isometry<N>, prediction: Isometry<N>, )
Sets the position of the collision object and resets the predicted position.
Sourcepub fn set_predicted_position(&mut self, pos: Option<Isometry<N>>)
pub fn set_predicted_position(&mut self, pos: Option<Isometry<N>>)
Sets the predicted position of the collision object.
Sourcepub fn set_deformations(&mut self, coords: &[N])
pub fn set_deformations(&mut self, coords: &[N])
Deforms the underlying shape if possible.
Panics if the shape is not deformable.
Sourcepub fn shape(&self) -> &ShapeHandle<N>
pub fn shape(&self) -> &ShapeHandle<N>
The collision object shape.
Sourcepub fn set_shape(&mut self, shape: ShapeHandle<N>)
pub fn set_shape(&mut self, shape: ShapeHandle<N>)
Set the collision object shape.
Sourcepub fn collision_groups(&self) -> &CollisionGroups
pub fn collision_groups(&self) -> &CollisionGroups
The collision groups of the collision object.
Sourcepub fn set_collision_groups(&mut self, groups: CollisionGroups)
pub fn set_collision_groups(&mut self, groups: CollisionGroups)
Sets the collision groups of this collision object.
Sourcepub fn query_type(&self) -> GeometricQueryType<N>
pub fn query_type(&self) -> GeometricQueryType<N>
The kind of queries this collision object is expected to .
Sourcepub fn set_query_type(&mut self, query_type: GeometricQueryType<N>)
pub fn set_query_type(&mut self, query_type: GeometricQueryType<N>)
Sets the GeometricQueryType
of the collision object.
Use CollisionWorld::set_query_type
to use this method.
Trait Implementations§
Source§impl<N: RealField + Copy, T> CollisionObjectRef<N> for CollisionObject<N, T>
impl<N: RealField + Copy, T> CollisionObjectRef<N> for CollisionObject<N, T>
Source§fn graph_index(&self) -> Option<CollisionObjectGraphIndex>
fn graph_index(&self) -> Option<CollisionObjectGraphIndex>
Source§fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
fn proxy_handle(&self) -> Option<BroadPhaseProxyHandle>
Source§fn predicted_position(&self) -> Option<&Isometry<N>>
fn predicted_position(&self) -> Option<&Isometry<N>>
Source§fn collision_groups(&self) -> &CollisionGroups
fn collision_groups(&self) -> &CollisionGroups
Source§fn query_type(&self) -> GeometricQueryType<N>
fn query_type(&self) -> GeometricQueryType<N>
Source§fn update_flags(&self) -> CollisionObjectUpdateFlags
fn update_flags(&self) -> CollisionObjectUpdateFlags
Source§fn compute_aabb(&self) -> AABB<N>
fn compute_aabb(&self) -> AABB<N>
self.predicted_position()
.Source§fn compute_swept_aabb(&self) -> AABB<N>
fn compute_swept_aabb(&self) -> AABB<N>
self.predict_position()
into account. Read moreAuto Trait Implementations§
impl<N, T> Freeze for CollisionObject<N, T>
impl<N, T> !RefUnwindSafe for CollisionObject<N, T>
impl<N, T> Send for CollisionObject<N, T>where
T: Send,
impl<N, T> Sync for CollisionObject<N, T>where
T: Sync,
impl<N, T> Unpin for CollisionObject<N, T>
impl<N, T> !UnwindSafe for CollisionObject<N, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.