RagdollBuilder
- Module
- Physics
- Header
#include "Physics/RagdollBuilder.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
std::vector<Mat4> | BuildPartPoses | Part-indexed world joint matrices for Ragdoll::SetPose. |
bool | QueryAssetCollision | What the group filter of a ragdoll built from asset answers for every pair of its bodies, keyed by bone name — the question the broad phase asks it. |
FPhysicsBodyDef | AutoFitBody | Editor authoring helpers. |
FPhysicsAsset | GenerateAsset |
Function details
BuildPartPoses
static std::vector<Mat4> BuildPartPoses(const std::vector<RagdollBodyMapping>& mappings, size_t partCount, const Mat4& modelToWorld, const std::vector<Mat4>& globalModel)Part-indexed world joint matrices for Ragdoll::SetPose. SetPose walks the ragdoll's PART array and adds its root offset to every joint translation, so callers must pass these with a zero root offset. Feeding it bone-indexed matrices scrambles any asset-built ragdoll whose part order differs from bone order. Parts without a usable mapping fall back to modelToWorld so they at least land on the entity, not the origin.
QueryAssetCollision
static bool QueryAssetCollision(const FPhysicsAsset& asset, const Skeleton& skeleton, std::unordered_map<std::string, std::unordered_map<std::string, bool>>& outCanCollide)What the group filter of a ragdoll built from asset answers for every pair of its bodies, keyed by bone name — the question the broad phase asks it. The empty name stands for an ordinary world body. False when the asset builds no ragdoll on this skeleton.
AutoFitBody
static FPhysicsBodyDef AutoFitBody(const Skeleton& skeleton, int32_t boneIndex)Editor authoring helpers. AutoFitBody fits a capsule to the bone's length toward its first child (falling back to a small sphere for terminal bones); GenerateAsset runs it for every eligible bone and wires the parent-child constraints — the "auto-rig" the editor offers on an empty asset.
GenerateAsset
static FPhysicsAsset GenerateAsset(const Skeleton& skeleton)