ncollide3d::pipeline::object

Struct CollisionObject

Source
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>

Source

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.

Source

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.

Source

pub fn set_graph_index(&mut self, index: Option<CollisionObjectGraphIndex>)

Sets the collision object unique but non-stable graph index.

Source

pub fn update_flags_mut(&mut self) -> &mut CollisionObjectUpdateFlags

Mutable reference to this collision object’s update flags.

Source

pub fn clear_update_flags(&mut self)

Clears the update flags of this collision object.

Source

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

The collision object’s broad phase proxy unique identifier.

Source

pub fn set_proxy_handle(&mut self, handle: Option<BroadPhaseProxyHandle>)

Set collision object’s broad phase proxy unique identifier.

Source

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

The collision object position.

Source

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

The predicted collision object position.

Source

pub fn set_position(&mut self, pos: Isometry<N>)

Sets the position of the collision object and resets the predicted position to None.

Source

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.

Source

pub fn set_predicted_position(&mut self, pos: Option<Isometry<N>>)

Sets the predicted position of the collision object.

Source

pub fn set_deformations(&mut self, coords: &[N])

Deforms the underlying shape if possible.

Panics if the shape is not deformable.

Source

pub fn shape(&self) -> &ShapeHandle<N>

The collision object shape.

Source

pub fn set_shape(&mut self, shape: ShapeHandle<N>)

Set the collision object shape.

Source

pub fn collision_groups(&self) -> &CollisionGroups

The collision groups of the collision object.

Source

pub fn set_collision_groups(&mut self, groups: CollisionGroups)

Sets the collision groups of this collision object.

Source

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

The kind of queries this collision object is expected to .

Source

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.

Source

pub fn data(&self) -> &T

Reference to the user-defined data associated to this object.

Source

pub fn data_mut(&mut self) -> &mut T

Mutable reference to the user-defined data associated to this object.

Trait Implementations§

Source§

impl<N: RealField + Copy, T> CollisionObjectRef<N> for CollisionObject<N, T>

Source§

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

The interaction graph index of this collision object, if it has been registered into an interaction graph. Read more
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. Read more
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. Read more
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.
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. Read more

Auto Trait Implementations§

§

impl<N, T> Freeze for CollisionObject<N, T>
where T: Freeze, N: Freeze,

§

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>
where T: Unpin, N: Unpin,

§

impl<N, T> !UnwindSafe for CollisionObject<N, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.