Skip to main content

RigidBody

Struct RigidBody 

Source
pub struct RigidBody { /* private fields */ }
Expand description

PHRB — Rigid body (v2–v4, 56–104 bytes)

Havok rigid body with density, friction, restitution, damping, gravity scale, and collision shape references.

Implementations§

Source§

impl RigidBody

Source

pub fn new() -> Self

§Panics

Panics if the native allocation fails.

Source

pub fn simulation_type(&self) -> u16

Simulation mode (v3+)

Source

pub fn set_simulation_type(&mut self, value: u16)

Source

pub fn parent_bone_index(&self) -> u16

Parent bone index

Source

pub fn set_parent_bone_index(&mut self, value: u16)

Source

pub fn physics_type(&self) -> u32

Engine-specific body type (v3+)

Source

pub fn set_physics_type(&mut self, value: u32)

Source

pub fn density(&self) -> f32

Body density

Source

pub fn set_density(&mut self, value: f32)

Source

pub fn friction(&self) -> f32

Surface friction

Source

pub fn set_friction(&mut self, value: f32)

Source

pub fn restitution(&self) -> f32

Elasticity / bounciness

Source

pub fn set_restitution(&mut self, value: f32)

Source

pub fn linear_damping(&self) -> f32

Linear velocity damping

Source

pub fn set_linear_damping(&mut self, value: f32)

Source

pub fn angular_damping(&self) -> f32

Angular velocity damping

Source

pub fn set_angular_damping(&mut self, value: f32)

Source

pub fn gravity_scale(&self) -> f32

Gravity influence scale

Source

pub fn set_gravity_scale(&mut self, value: f32)

Source

pub fn dynamic_state(&self) -> Ref<'_, AnimRefU32>

Animated dynamic state (v4+) Borrows the field in place — no copy, no allocation.

Source

pub fn dynamic_state_mut(&mut self) -> RefMut<'_, AnimRefU32>

Source

pub fn dynamic_blend_out(&self) -> f32

Dynamic blend-out duration (v4+)

Source

pub fn set_dynamic_blend_out(&mut self, value: f32)

Source

pub fn rigid_body_shape_len(&self) -> usize

Collision shapes (PHSH)

Source

pub fn rigid_body_shape(&self, index: usize) -> Option<Ref<'_, PhysicsShape>>

Borrows element index in place. None when out of range.

Source

pub fn rigid_body_shape_mut( &mut self, index: usize, ) -> Option<RefMut<'_, PhysicsShape>>

Source

pub fn rigid_body_shape_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, PhysicsShape>>

Iterate the elements, borrowing each in turn.

Source

pub fn resize_rigid_body_shape(&mut self, count: usize)

Source

pub fn flags(&self) -> RigidBodyFlag

Rigid body flags

Source

pub fn set_flags(&mut self, value: RigidBodyFlag)

Source

pub fn local_forces(&self) -> u16

Local force channel bitmask

Source

pub fn set_local_forces(&mut self, value: u16)

Source

pub fn world_forces(&self) -> u16

World force channel bitmask

Source

pub fn set_world_forces(&mut self, value: u16)

Source

pub fn priority(&self) -> u32

Simulation priority

Source

pub fn set_priority(&mut self, value: u32)

Trait Implementations§

Source§

impl Debug for RigidBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RigidBody

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for RigidBody

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for RigidBody

Auto Trait Implementations§

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> 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, 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.