Skeletal mesh: Kinematic and simulated coordinate systems mismatch (off by 90')
For a SkeletalMeshComponent, the bone transforms are internally stored in different coordinate systems (off by 90'), depending on whether the bone is kinematic or simulated. Whether or not this mismatch is intentional, it causes issues in several situations.
In pose record and playback at PhysX level:
The mismatch can be seen directly by following these steps for some skeletal mesh component: (pseudo)
This works fine if the "SkeletalMeshComponent->SetSimulatePhysics( false );" line is commented out, as long as the skeletal mesh does not interact with (touch) other simulated actors.
However, if the skeleton is set to kinematic mode (the aforementioned line is not commented out), then the pose sequence plays back fine except being tilted by 90 degrees around the Y axis!
In the Physics Asset Tool (PhAT):
This seems like the likely cause for this bug in PhAT: https://answers.unrealengine.com/questions/102065/simulation-problem-in-phat-if-bone-is-marked-as-ki.html
This can be seen as follows:
The skeletal mesh becomes quickly completely corrupted, but it can be seen in the first few frames that some of the bones are making sharp 90' jumps on each frame.
On a dedicated server with incompletely enabled simulation:
The rotation issue described in https://answers.unrealengine.com/questions/104567/enabling-skeletalmeshcomponent-physics-on-a-dedica.html is likely also caused by this. (See "The rotation issue" subheading.)
Engine versions: 4.5.0-0+UE4, 4.4.3-0+UE4 (source builds)
asked Oct 26 '14 at 09:23 AM in Bug Reports
I added physics sim record feature in PhAT as well as Persona, and you can check what I did in 4.7. (big tool bar with "Record"
There is two issue with recording physics sim, and that is you'll need the bone transform finally blended with physics, not before. Also I fixed an issue with root bone not matching (not identity) with phat, which might be partially issue.
The reason the record feature was added with 4.7 is because we also added double buffering system, where double buffering guarantees the buffer you query is what was last updated pose with physics blended.
You can check the code in 4.7. AnimationRecorder.h/cpp.
answered Mar 20 '15 at 11:23 PM
@JonathanDorman: Sure, I am using Owen from Content Examples and used roughly the following steps and code. I hope I didn't forget anything crucial! You might want to omit the replication part and implement it as a standalone game, maybe.
In YourProject.Build.cs, add PhysX stuff to the following to get direct access to PhysX:
Then, add the following to ControlledRagdoll.h:
(By the way, if someone knows how to replicate 3rd party data structs without this kind of a workaround, then please share! Thanks!)
And to ControlledRagdoll.cpp:
ps. There was a bug with reparenting at least in 4.4.3: "Save All" does/did not save reparenting information, instead you have to manually save the asset. Maybe you can file a bug report for this if this is still true with 4.5 and you think this is not too minor to be filed?
Follow this question
Once you sign in you will be able to subscribe for any updates here