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
impl ClothPhysics
Sourcepub fn cloth_mesh_count(&self) -> u32
pub fn cloth_mesh_count(&self) -> u32
Number of cloth mesh sections
pub fn set_cloth_mesh_count(&mut self, value: u32)
Sourcepub fn skin_bone_count(&self) -> u32
pub fn skin_bone_count(&self) -> u32
Number of skin bones
pub fn set_skin_bone_count(&mut self, value: u32)
Sourcepub fn skin_bones(&self) -> &[u16]
pub fn skin_bones(&self) -> &[u16]
Skin bone indices (U16_)
Zero-copy view of the underlying std::vector.
Sourcepub fn skin_bones_mut(&mut self) -> &mut [u16]
pub fn skin_bones_mut(&mut self) -> &mut [u16]
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_skin_bones(&mut self, values: &[u16])
pub fn resize_skin_bones(&mut self, count: usize)
Sourcepub fn sim_enabled(&self) -> &[u8] ⓘ
pub fn sim_enabled(&self) -> &[u8] ⓘ
Per-vertex simulation enable flags (U8__)
Zero-copy view of the underlying std::vector.
Sourcepub fn sim_enabled_mut(&mut self) -> &mut [u8] ⓘ
pub fn sim_enabled_mut(&mut self) -> &mut [u8] ⓘ
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_sim_enabled(&mut self, values: &[u8])
pub fn resize_sim_enabled(&mut self, count: usize)
Sourcepub fn vertex_bones(&self) -> &[u32]
pub fn vertex_bones(&self) -> &[u32]
Per-vertex bone indices (U32_)
Zero-copy view of the underlying std::vector.
Sourcepub fn vertex_bones_mut(&mut self) -> &mut [u32]
pub fn vertex_bones_mut(&mut self) -> &mut [u32]
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_vertex_bones(&mut self, values: &[u32])
pub fn resize_vertex_bones(&mut self, count: usize)
Sourcepub fn vertex_weights(&self) -> &[u32]
pub fn vertex_weights(&self) -> &[u32]
Per-vertex bone weights (U32_)
Zero-copy view of the underlying std::vector.
Sourcepub fn vertex_weights_mut(&mut self) -> &mut [u32]
pub fn vertex_weights_mut(&mut self) -> &mut [u32]
Zero-copy mutable view. Resize first — the borrow forbids it after.
pub fn set_vertex_weights(&mut self, values: &[u32])
pub fn resize_vertex_weights(&mut self, count: usize)
Sourcepub fn colliders_len(&self) -> usize
pub fn colliders_len(&self) -> usize
Cloth colliders (PHCC)
Sourcepub fn colliders(&self, index: usize) -> Option<Ref<'_, ClothCollider>>
pub fn colliders(&self, index: usize) -> Option<Ref<'_, ClothCollider>>
Borrows element index in place. None when out of range.
pub fn colliders_mut( &mut self, index: usize, ) -> Option<RefMut<'_, ClothCollider>>
Sourcepub fn colliders_iter(
&self,
) -> impl ExactSizeIterator<Item = Ref<'_, ClothCollider>>
pub fn colliders_iter( &self, ) -> impl ExactSizeIterator<Item = Ref<'_, ClothCollider>>
Iterate the elements, borrowing each in turn.
pub fn resize_colliders(&mut self, count: usize)
Sourcepub fn proxies_len(&self) -> usize
pub fn proxies_len(&self) -> usize
Cloth proxies (PHAC)
Sourcepub fn proxies(&self, index: usize) -> Option<Ref<'_, ClothProxy>>
pub fn proxies(&self, index: usize) -> Option<Ref<'_, ClothProxy>>
Borrows element index in place. None when out of range.
pub fn proxies_mut(&mut self, index: usize) -> Option<RefMut<'_, ClothProxy>>
Sourcepub fn proxies_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, ClothProxy>>
pub fn proxies_iter(&self) -> impl ExactSizeIterator<Item = Ref<'_, ClothProxy>>
Iterate the elements, borrowing each in turn.
pub fn resize_proxies(&mut self, count: usize)
pub fn set_density(&mut self, value: f32)
pub fn set_tracking(&mut self, value: f32)
Sourcepub fn stretch_stiffness(&self) -> f32
pub fn stretch_stiffness(&self) -> f32
Stretch stiffness
pub fn set_stretch_stiffness(&mut self, value: f32)
Sourcepub fn horizontal_stiffness(&self) -> f32
pub fn horizontal_stiffness(&self) -> f32
Horizontal stiffness
pub fn set_horizontal_stiffness(&mut self, value: f32)
Sourcepub fn bending_stiffness(&self) -> f32
pub fn bending_stiffness(&self) -> f32
Bending stiffness
pub fn set_bending_stiffness(&mut self, value: f32)
pub fn set_damping(&mut self, value: f32)
pub fn set_friction(&mut self, value: f32)
pub fn set_gravity(&mut self, value: f32)
Sourcepub fn explosion_scale(&self) -> f32
pub fn explosion_scale(&self) -> f32
Explosion force scale
pub fn set_explosion_scale(&mut self, value: f32)
Sourcepub fn wind_scale(&self) -> f32
pub fn wind_scale(&self) -> f32
Wind force scale
pub fn set_wind_scale(&mut self, value: f32)
Sourcepub fn shear_stiffness(&self) -> f32
pub fn shear_stiffness(&self) -> f32
Shear stiffness
pub fn set_shear_stiffness(&mut self, value: f32)
Sourcepub fn drag_factor(&self) -> f32
pub fn drag_factor(&self) -> f32
Drag factor
pub fn set_drag_factor(&mut self, value: f32)
Sourcepub fn lift_factor(&self) -> f32
pub fn lift_factor(&self) -> f32
Lift factor (v4+)
pub fn set_lift_factor(&mut self, value: f32)
Sourcepub fn sphere_stiffness(&self) -> f32
pub fn sphere_stiffness(&self) -> f32
Sphere collider stiffness (v4+)
pub fn set_sphere_stiffness(&mut self, value: f32)
pub fn set_flatten(&mut self, value: u32)
Sourcepub fn active(&self) -> Ref<'_, AnimRefU32>
pub fn active(&self) -> Ref<'_, AnimRefU32>
Animated active state Borrows the field in place — no copy, no allocation.
pub fn active_mut(&mut self) -> RefMut<'_, AnimRefU32>
Sourcepub fn use_skin_collision(&self) -> u32
pub fn use_skin_collision(&self) -> u32
Use skin mesh for collision
pub fn set_use_skin_collision(&mut self, value: u32)
Sourcepub fn skin_offset(&self) -> f32
pub fn skin_offset(&self) -> f32
Skin collision offset
pub fn set_skin_offset(&mut self, value: f32)
Sourcepub fn skin_exponent(&self) -> f32
pub fn skin_exponent(&self) -> f32
Skin collision exponent
pub fn set_skin_exponent(&mut self, value: f32)
Sourcepub fn skin_stiffness(&self) -> f32
pub fn skin_stiffness(&self) -> f32
Skin collision stiffness
pub fn set_skin_stiffness(&mut self, value: f32)
Sourcepub fn local_channels(&self) -> u32
pub fn local_channels(&self) -> u32
Local force channel bitmask
pub fn set_local_channels(&mut self, value: u32)
Sourcepub fn local_wind(&self) -> Vector3f
pub fn local_wind(&self) -> Vector3f
Local wind direction and magnitude