Replies: 2 comments
-
|
Concretely, I don't understand this part: "inNeutralPose1 and inNeutralPose2 must match as closely as possible, preferably the position of the mappable joints should be identical." For me, the positions in the ragdoll skeleton are the positions of the RagdollSettings::Part (RigidBodies/CapsuleShapes), like in the RagdollSettings *RagdollLoader::sCreate() function. And so that doesn't match my GLTF, where the joints are at the top of the arms (upperarm in the photo) for example, and not in the center (between lowerarm_r and upperarm_r, like the capsule in sCreate). |
Beta Was this translation helpful? Give feedback.
-
|
I think the simplest way to make it work is (and from the top of my head, so I may have made a mistake):
Note that there are variations possible on this because transforms can be stored in several places (I've hinted at some of them). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
First of all, thank you for this amazing library.
I'm trying to make a ragdoll the right way.
I was previously using NVIDIA PhysX. My approach was very simple:
Now I'm switching to Jolt and I'm already excited about the power of Skeleton + Ragdoll + SkeletonMapper. It seems perfect for mixing animation and ragdoll, filling in bones without RigidBody, handling parent/child collisions, etc.
My goal is very simple to start: a character that plays normal animation (graphics only) most of the time, and when hit (gameplay event), it falls into a full ragdoll (start of physic simulation for this character).
From what I've understood so far, the recommended way is:
Keep my full Mixamo skeleton (high-detail, ~60 bones) for rendering and animation. (in a JPH::Skeleton)
Create a much smaller JPH::Skeleton + RagdollSettings (low-detail, ~15-20 joints: hips, spine1-2, head, upper/lower arms, upper/lower legs, etc.).
In the ragdoll, the RigidBodies + capsules are centered in the middle of the segments (not at the joints).
Create two SkeletonPose:
Init this two with Sample func (This is the moment where I need to sample the default/bind poses to set up the skeletons so the mapper works afterward. Since I don't have any .tof files, I probably need to create keyframes and push them into the AnimatedJointVector of SkeletalAnimation?)
I checked the JPH::RagdollSettings* sCreate function and it doesn't seem to initialize the skeleton pose properly. I need to figure out how to sample or init it without a .tof file.
Actually, I don't really understand the relationship between the ragdoll skeleton's positions and the RagdollSettings::Part.
Use SkeletonMapper + MapReverse (to drive the ragdoll from first pos to start death) and Map (to get the physical pose back to the visual skeleton).
So basically, I use MapReverse only once, at the moment of death, to set up my ragdoll pose from the current animation. Then, every frame, I just retrieve the physical pose with Map (directly) after PhysicsSystem::Update(), and apply it to my Vulkan visual nodes, without even calling CalculateJointMatrices() again.
Is this the correct/recommended approach for this use-case?
What I'm not sure about either is whether the constraint positions (mPosition1 / mPosition2) need to exactly match the GLTF node positions (e.g. top of the arm / shoulder joint), or if the SkeletonMapper with LockAllTranslations can handle a small offset here without visually breaking the character (shoulders detaching, weird stretching, etc.).
Thank you :)
Beta Was this translation helpful? Give feedback.
All reactions