RagdollData

class RagdollData

Bases: TypedReferenceCount

One 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 for get_expire_offset() of sim-time, after which step() 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=""]; }
RagdollData.__init__()

Builds a corpse against a shared skeleton. scale converts the .cfg’s model units to world units.

RagdollData.finish_seed()

Call once after seeding every vert: primes the substep length and the tri orientations, which constrain_rot needs immediately.

RagdollData.get_air_fric()
RagdollData.get_body_fric()
RagdollData.get_body_fric_scale()
static RagdollData.get_class_type()
RagdollData.get_collisions()
RagdollData.get_constraint_iters()
RagdollData.get_expire_offset()
RagdollData.get_floor_z()
RagdollData.get_gravity()

– tuning (defaults are Tesseract’s; the caller may override) ——-

RagdollData.get_ground_fric()
RagdollData.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.

RagdollData.get_num_verts()
RagdollData.get_rot_fric()
RagdollData.get_rot_fric_stop()
RagdollData.get_scale()
RagdollData.get_time()
RagdollData.get_timestep_max()
RagdollData.get_timestep_min()
RagdollData.get_vert()

– readback ——————————————————–

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

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

RagdollData.set_air_fric()
RagdollData.set_body_fric()
RagdollData.set_body_fric_scale()
RagdollData.set_constraint_iters()
RagdollData.set_expire_offset()
RagdollData.set_floor_z()

– world ———————————————————–

– world ———————————————————–

RagdollData.set_gravity()

– tuning (defaults are Tesseract’s; the caller may override) ——-

RagdollData.set_ground_fric()
RagdollData.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.

RagdollData.set_rot_fric()
RagdollData.set_rot_fric_stop()
RagdollData.set_timestep_max()
RagdollData.set_timestep_min()
RagdollData.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.