Enum nphysics2d::object::WorldObject
[−]
[src]
pub enum WorldObject<N: Real> { RigidBody(RigidBodyHandle<N>), Sensor(SensorHandle<N>), }
An object that has been added to a World.
Variants
RigidBody(RigidBodyHandle<N>)
A rigid body handle.
Sensor(SensorHandle<N>)
A sensor handle.
Methods
impl<N: Real> WorldObject<N>
[src]
fn rigid_body_uid(rb: &RigidBodyHandle<N>) -> usize
[src]
The unique identifier a rigid body would have if it was wrapped on a WorldObject
.
This identifier remains unique and will not change as long as rb
is kept alive in memory.
fn sensor_uid(s: &SensorHandle<N>) -> usize
[src]
The unique identifier a sensor would have if it was wrapped on a WorldObject
.
This identifier remains unique and will not change as long as s
is kept alive in memory.
fn is_rigid_body(&self) -> bool
[src]
Whether or not this is a rigid body.
fn is_sensor(&self) -> bool
[src]
Whether or not this is a sensor.
fn unwrap_sensor(self) -> SensorHandle<N>
[src]
Unwraps this object as a sensor or fails.
fn unwrap_rigid_body(self) -> RigidBodyHandle<N>
[src]
Unwraps this object as a rigid body or fails.
fn uid(&self) -> usize
[src]
Returns a unique id for this world object.
fn borrow(&self) -> WorldObjectBorrowed<N>
[src]
Borrows this world object.
fn borrow_sensor(&self) -> Ref<Sensor<N>>
[src]
Borrows this world object as a sensor.
fn borrow_rigid_body(&self) -> Ref<RigidBody<N>>
[src]
Borrows this world object as a rigid body.
fn borrow_mut(&mut self) -> WorldObjectBorrowedMut<N>
[src]
Mutably borrows this world object.
fn borrow_mut_sensor(&mut self) -> RefMut<Sensor<N>>
[src]
Mutably borrows this world object as a sensor.
fn borrow_mut_rigid_body(&mut self) -> RefMut<RigidBody<N>>
[src]
Mutably borrows this world object as a rigid body.
Trait Implementations
impl<N: Clone + Real> Clone for WorldObject<N>
[src]
fn clone(&self) -> WorldObject<N>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more