Struct ncollide2d::world::CollisionObject
source · pub struct CollisionObject<N: Real, T> { /* private fields */ }
Expand description
A stand-alone object that has a position and a shape.
Implementations§
source§impl<N: Real, T> CollisionObject<N, T>
impl<N: Real, T> CollisionObject<N, T>
sourcepub fn new(
handle: CollisionObjectHandle,
proxy_handle: ProxyHandle,
position: Isometry<N>,
shape: ShapeHandle<N>,
groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T
) -> CollisionObject<N, T>
pub fn new(
handle: CollisionObjectHandle,
proxy_handle: ProxyHandle,
position: Isometry<N>,
shape: ShapeHandle<N>,
groups: CollisionGroups,
query_type: GeometricQueryType<N>,
data: T
) -> CollisionObject<N, T>
Creates a new collision object.
sourcepub fn handle(&self) -> CollisionObjectHandle
pub fn handle(&self) -> CollisionObjectHandle
The collision object unique handle.
sourcepub fn proxy_handle(&self) -> ProxyHandle
pub fn proxy_handle(&self) -> ProxyHandle
The collision object’s broad phase proxy unique identifier.
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.
sourcepub fn shape(&self) -> &ShapeHandle<N>
pub fn shape(&self) -> &ShapeHandle<N>
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 query_type(&self) -> GeometricQueryType<N>
pub fn query_type(&self) -> GeometricQueryType<N>
The kind of queries this collision object is expected to .
Auto Trait Implementations§
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
N: Unpin,
T: Unpin,
impl<N, T> !UnwindSafe for CollisionObject<N, T>
Blanket Implementations§
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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe 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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.