RagdollData¶
from acron.ragdoll import RagdollData
- class RagdollData¶
Bases:
Bases:
TypedReferenceCountOne corpse: a Verlet particle body simulated in WORLD space, a port of Tesseract’s
ragdolldata(engine/ragdoll.h) – the same integration, the same friction model, the same constraint schedule and tuning constants.World collision is a flat floor plane at
get_floor_z(), standing in for cube geometry; the caller probes the real floor height under the body and sets it before seeding. The solver runs entirely in double precision so a body settles identically regardless of how the engine’s PN_stdfloat is built.Driving it: seed every vert (seed_vert) then call
finish_seed(), and after that call step(dt) once per frame.step()pays the elapsed time down in fixed 5-10 ms substeps and freezes the body for good once it has rested forget_expire_offset()of sim-time, after whichstep()is a genuine no-op and the pose never changes again.Inheritance diagram
digraph inheritance3c7b107781 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "RagdollData" [URL="acron.ragdoll.RagdollData.html#acron.ragdoll.RagdollData",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "RagdollData" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }- __init__()¶
Builds a corpse against a shared skeleton.
scaleconverts the .cfg’s model units to world units.
- finish_seed()¶
Call once after seeding every vert: primes the substep length and the tri orientations, which constrain_rot needs immediately.
- property frozen bool¶
True once the settle-freeze has fired: the body has rested for
get_expire_offset()and the pose is final. Latches.True once the settle-freeze has fired: the body has rested for
get_expire_offset()and the pose is final. Latches.True once the settle-freeze has fired: the body has rested for
get_expire_offset()and the pose is final. Latches.
- get_air_fric()¶
- get_body_fric()¶
- get_body_fric_scale()¶
- static get_class_type()¶
- get_collisions()¶
- get_constraint_iters()¶
- get_expire_offset()¶
- get_floor_z()¶
- get_gravity()¶
– tuning (defaults are Tesseract’s; the caller may override) ——-
- get_ground_fric()¶
- get_max_substeps()¶
The substep budget for ONE
step()call. Tesseract catches up without a bound because a substep is microseconds; a bound keeps a stalled frame from buying a burst of substeps and feeding its own slowness.
- get_num_verts()¶
- get_rot_fric()¶
- get_rot_fric_stop()¶
- get_scale()¶
- get_time()¶
- get_timestep_max()¶
- get_timestep_min()¶
- get_vert()¶
– readback ——————————————————–
- is_frozen()¶
True once the settle-freeze has fired: the body has rested for
get_expire_offset()and the pose is final. Latches.True once the settle-freeze has fired: the body has rested for
get_expire_offset()and the pose is final. Latches.
- seed_vert()¶
– seeding ———————————————————
Places vert i at a world position with a starting velocity. As in initragdoll, the velocity is baked in as a backward oldpos offset of one minimum timestep.
- set_air_fric()¶
- set_body_fric()¶
- set_body_fric_scale()¶
- set_constraint_iters()¶
- set_expire_offset()¶
- set_floor_z()¶
– world ———————————————————–
– world ———————————————————–
- set_gravity()¶
– tuning (defaults are Tesseract’s; the caller may override) ——-
- set_ground_fric()¶
- set_max_substeps()¶
The substep budget for ONE
step()call. Tesseract catches up without a bound because a substep is microseconds; a bound keeps a stalled frame from buying a burst of substeps and feeding its own slowness.
- set_rot_fric()¶
- set_rot_fric_stop()¶
- set_timestep_max()¶
- set_timestep_min()¶
- step()¶
– the loop ——————————————————–
Advance by a driver tick, in 5-10 ms substeps. Mirrors moveragdoll(): the substep length is capped at timestep_max and never shorter than timestep_min (the leftover rides the accumulator), and once the body has rested for expire_offset of sim-time it freezes for good – a settled corpse has nothing left to compute, and creeping forever looks worse than still.