Expand description
Cloth, rope, and soft body game integration for Chaos RPG.
Provides Verlet-based cloth simulation (ClothStrip), chain-based rope
physics (RopeChain), spring-mass soft body blobs (SoftBodyBlob), and
concrete game-entity wrappers (boss capes, tendrils, robes, soul chains,
slime enemies, quantum blobs, weapon trails, pendulum traps, chest lids).
All types use glam::Vec3 for 3D positions and reuse constraint-solving
patterns from crate::physics::soft_body.
Structs§
- Boss
Cape - A cloth strip attached to a boss entity. Anchor points (top row) follow the boss position. Responds to vortex fields and movement.
- ClothId
- Identifies an instance within the manager.
- Cloth
Rope Manager - Central manager owning all active cloth, rope, and soft body instances. Steps all each frame, removes expired ones, and provides render data.
- Cloth
Strip - A rectangular grid of Verlet-integrated point masses connected by distance and bend constraints, simulating cloth or fabric.
- Distance
Constraint - A rigid distance constraint between two point indices.
- Hydra
Tendril - A rope chain connecting two hydra split instances. The tendril can be severed when enough damage is dealt to the connection point.
- Necro
Soul Chain - A rope connecting a necromancer to a recently killed enemy. Dark energy particles flow along the chain. The chain breaks when the enemy is too far or the soul is consumed.
- Pendulum
Trap - A pendulum trap using a rope chain with a fixed top point. Swings under gravity and damages entities on contact with the weighted end.
- Player
Robe - 2-3 short cloth strips for the mage class, swaying with player movement.
- Quantum
Blob - A soft body that oscillates between two shapes (Eigenstate boss mechanic). The frequency can be configured and represents the quantum superposition oscillation.
- Rope
Chain - A chain of point masses connected by distance constraints, forming a rope.
- RopeId
- Slime
Enemy - A soft body blob that deforms on hit, jiggles, and reforms. Lower HP results in more wobbly behavior (lower spring stiffness).
- Soft
Body Blob - A spring-connected mesh of points forming a deformable 2D blob (circle of perimeter points plus a center point).
- Soft
Body Id - Treasure
Chest Lid - A simple hinge implemented as a two-segment rope. The hinge point is fixed, and the lid swings open when interacted with.
- Verlet
Point - A single Verlet-integrated point mass used by cloth and rope systems.
- Weapon
Trail - A chain of segments that follows a weapon swing path. On impact, segments compress (bunch up) then relax back.
Constants§
- MAX_
CLOTH - Maximum number of active instances per type.
- MAX_
ROPES - MAX_
SOFTBODIES