Skip to main content

ClothPhysics

Struct ClothPhysics 

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

PHCL — Cloth physics (v0–v4, 192 bytes)

Full cloth simulation configuration: skin bone binding, stiffness parameters, damping, wind/explosion/gravity scales, colliders, and proxies. Added in MODL v28.

Implementations§

Source§

impl ClothPhysics

Source

pub fn new() -> Self

§Panics

Panics if the native allocation fails.

Source

pub fn cloth_mesh_count(&self) -> u32

Number of cloth mesh sections

Source

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

Source

pub fn skin_bone_count(&self) -> u32

Number of skin bones

Source

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

Source

pub fn skin_bones(&self) -> &[u16]

Skin bone indices (U16_) Zero-copy view of the underlying std::vector.

Source

pub fn skin_bones_mut(&mut self) -> &mut [u16]

Zero-copy mutable view. Resize first — the borrow forbids it after.

Source

pub fn set_skin_bones(&mut self, values: &[u16])

Source

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

Source

pub fn sim_enabled(&self) -> &[u8]

Per-vertex simulation enable flags (U8__) Zero-copy view of the underlying std::vector.

Source

pub fn sim_enabled_mut(&mut self) -> &mut [u8]

Zero-copy mutable view. Resize first — the borrow forbids it after.

Source

pub fn set_sim_enabled(&mut self, values: &[u8])

Source

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

Source

pub fn vertex_bones(&self) -> &[u32]

Per-vertex bone indices (U32_) Zero-copy view of the underlying std::vector.

Source

pub fn vertex_bones_mut(&mut self) -> &mut [u32]

Zero-copy mutable view. Resize first — the borrow forbids it after.

Source

pub fn set_vertex_bones(&mut self, values: &[u32])

Source

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

Source

pub fn vertex_weights(&self) -> &[u32]

Per-vertex bone weights (U32_) Zero-copy view of the underlying std::vector.

Source

pub fn vertex_weights_mut(&mut self) -> &mut [u32]

Zero-copy mutable view. Resize first — the borrow forbids it after.

Source

pub fn set_vertex_weights(&mut self, values: &[u32])

Source

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

Source

pub fn colliders_len(&self) -> usize

Cloth colliders (PHCC)

Source

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

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

Source

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

Source

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

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn proxies_len(&self) -> usize

Cloth proxies (PHAC)

Source

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

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

Source

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

Source

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

Iterate the elements, borrowing each in turn.

Source

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

Source

pub fn density(&self) -> f32

Cloth density

Source

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

Source

pub fn tracking(&self) -> f32

Tracking factor

Source

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

Source

pub fn stretch_stiffness(&self) -> f32

Stretch stiffness

Source

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

Source

pub fn horizontal_stiffness(&self) -> f32

Horizontal stiffness

Source

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

Source

pub fn bending_stiffness(&self) -> f32

Bending stiffness

Source

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

Source

pub fn damping(&self) -> f32

Damping coefficient

Source

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

Source

pub fn friction(&self) -> f32

Friction coefficient

Source

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

Source

pub fn gravity(&self) -> f32

Gravity influence

Source

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

Source

pub fn explosion_scale(&self) -> f32

Explosion force scale

Source

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

Source

pub fn wind_scale(&self) -> f32

Wind force scale

Source

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

Source

pub fn shear_stiffness(&self) -> f32

Shear stiffness

Source

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

Source

pub fn drag_factor(&self) -> f32

Drag factor

Source

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

Source

pub fn lift_factor(&self) -> f32

Lift factor (v4+)

Source

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

Source

pub fn sphere_stiffness(&self) -> f32

Sphere collider stiffness (v4+)

Source

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

Source

pub fn flatten(&self) -> u32

Flatten mode (v4+)

Source

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

Source

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

Animated active state Borrows the field in place — no copy, no allocation.

Source

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

Source

pub fn use_skin_collision(&self) -> u32

Use skin mesh for collision

Source

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

Source

pub fn skin_offset(&self) -> f32

Skin collision offset

Source

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

Source

pub fn skin_exponent(&self) -> f32

Skin collision exponent

Source

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

Source

pub fn skin_stiffness(&self) -> f32

Skin collision stiffness

Source

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

Source

pub fn local_channels(&self) -> u32

Local force channel bitmask

Source

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

Source

pub fn local_wind(&self) -> Vector3f

Local wind direction and magnitude

Source

pub fn set_local_wind(&mut self, value: Vector3f)

Trait Implementations§

Source§

impl Debug for ClothPhysics

Source§

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

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

impl Default for ClothPhysics

Source§

fn default() -> Self

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

impl Drop for ClothPhysics

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 ClothPhysics

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.