[−][src]Struct physme::dim3::RigidBody
The rigid body.
Fields
position: Vec3
Current position of this rigid body.
rotation: Quat
Current rotation of this rigid body.
NOTE: collisions checks may or may not be broken if this is not a multiple of 90 degrees.
linvel: Vec3
Current linear velocity of this rigid body.
terminal: Vec3
The terminal linear velocity of a semikinematic body.
Defaults to f32::INFINITY
.
angvel: Quat
Current angular velocity of this rigid body.
ang_term: f32
The terminal angular velocity of a semikinematic body.
Defaults to f32::INFINITY
.
status: Status
The status, i.e. static or semikinematic.
Affects how forces and collisions affect this rigid body.
Implementations
impl RigidBody
[src]
pub fn new(mass: Mass) -> Self
[src]
Returns a new RigidBody
with just a mass and all other components set to their defaults.
pub fn with_position(self, position: Vec3) -> Self
[src]
Returns a RigidBody
identical to this one, but with the position set to a new one.
pub fn with_rotation(self, rotation: Quat) -> Self
[src]
Returns a RigidBody
identical to this one, but with the rotation set to a new one.
pub fn with_linear_velocity(self, linvel: Vec3) -> Self
[src]
Returns a RigidBody
identical to this one, but with the linear velocity set to a new one.
pub fn with_angular_velocity(self, angvel: Quat) -> Self
[src]
Returns a RigidBody
identical to this one, but with the linear velocity set to a new one.
pub fn with_terminal(self, terminal: Vec3) -> Self
[src]
Returns a RigidBody
identical to this one, but with the terminal linear velocity set to a new one.
pub fn with_angular_terminal(self, terminal: f32) -> Self
[src]
Returns a RigidBody
identical to this one, but with the terminal linear velocity set to a new one.
pub fn with_acceleration(self, acceleration: Vec3) -> Self
[src]
Returns a RigidBody
identical to this one, but with the acceleration set to a new one.
pub fn with_status(self, status: Status) -> Self
[src]
Returns a RigidBody
identical to this one, but with the status set to a new one.
pub fn with_active(self, active: bool) -> Self
[src]
Returns a RigidBody
identical to this one, but with the active flag set to a new one.
pub fn with_sensor(self, sensor: bool) -> Self
[src]
Returns a RigidBody
identical to this one, but with the sensor flag set to a new one.
pub fn apply_linear_impulse(&mut self, impulse: Vec3)
[src]
Applies an impulse to the RigidBody
s linear velocity.
pub fn apply_angular_impulse(&mut self, impulse: Quat)
[src]
Applies an impulse to the RigidBody
s linear velocity.
pub fn apply_force(&mut self, force: Vec3)
[src]
Applies a force to the RigidBody
s acceleration accumulator.
pub fn is_active(&self) -> bool
[src]
Gets the active flag.
pub fn is_sensor(&self) -> bool
[src]
Gets the sensor flag.
pub fn mass(&self) -> f32
[src]
Gets the mass
pub fn inverse_mass(&self) -> f32
[src]
Gets the mass
pub fn set_active(&mut self, active: bool)
[src]
Sets the active flag.
pub fn set_sensor(&mut self, sensor: bool)
[src]
Sets the sensor flag.
pub fn set_mass(&mut self, mass: Mass)
[src]
Sets the mass.
Trait Implementations
impl Clone for RigidBody
[src]
impl Copy for RigidBody
[src]
impl Debug for RigidBody
[src]
impl<'de> Deserialize<'de> for RigidBody
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl DeserializeProperty for RigidBody
[src]
fn deserialize(
deserializer: &mut dyn Deserializer<'_>,
property_type_registry: &PropertyTypeRegistry
) -> Result<Box<dyn Property>, Error>
[src]
deserializer: &mut dyn Deserializer<'_>,
property_type_registry: &PropertyTypeRegistry
) -> Result<Box<dyn Property>, Error>
impl Properties for RigidBody
[src]
fn prop(&self, name: &str) -> Option<&dyn Property>
[src]
fn prop_mut(&mut self, name: &str) -> Option<&mut dyn Property>
[src]
fn prop_with_index(&self, index: usize) -> Option<&dyn Property>
[src]
fn prop_with_index_mut(&mut self, index: usize) -> Option<&mut dyn Property>
[src]
fn prop_name(&self, index: usize) -> Option<&str>
[src]
fn prop_len(&self) -> usize
[src]
fn iter_props(&self) -> PropertyIter<'_>
[src]
fn set_prop(&mut self, name: &str, value: &(dyn Property + 'static))
fn to_dynamic(&self) -> DynamicProperties
impl Property for RigidBody
[src]
fn type_name(&self) -> &str
[src]
fn any(&self) -> &dyn Any
[src]
fn any_mut(&mut self) -> &mut dyn Any
[src]
fn clone_prop(&self) -> Box<dyn Property>
[src]
fn set(&mut self, value: &dyn Property)
[src]
fn apply(&mut self, value: &dyn Property)
[src]
fn as_properties(&self) -> Option<&dyn Properties>
[src]
fn serializable<'a>(
&'a self,
registry: &'a PropertyTypeRegistry
) -> Serializable<'a>
[src]
&'a self,
registry: &'a PropertyTypeRegistry
) -> Serializable<'a>
fn property_type(&self) -> PropertyType
[src]
impl Serialize for RigidBody
[src]
Auto Trait Implementations
impl RefUnwindSafe for RigidBody
impl Send for RigidBody
impl Sync for RigidBody
impl Unpin for RigidBody
impl UnwindSafe for RigidBody
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Clone + Any,
T: Clone + Any,
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<P> PropertiesVal for P where
P: Properties,
P: Properties,
fn prop_val<T>(&self, name: &str) -> Option<&T> where
T: 'static,
T: 'static,
fn set_prop_val<T>(&mut self, name: &str, value: T) where
T: 'static,
T: 'static,
impl<T> Resource for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src]
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,