Announcement

Collapse
No announcement yet.

Per Bone Physics and Weight Blend for Pawn Ragdoll

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Per Bone Physics and Weight Blend for Pawn Ragdoll

    Simply looking to replicate the exact behavior that is shown in the Physical Animation Content Example demo, but on a character whose root component is a physics enabled collision capsule, NOT a skeletal mesh as in the content demo.

    I have not been able to do per-bone blending unless I detach from the root component primitive or disable physics on it.

    What I have is a physics enabled root component sphere that moves in all three dimensions and uses physics and forces to get around. I'd like to somehow have a skeletal mesh constrained to or parented to it so that it follows the root component but can still simulate bodies below certain joint chains. Is this posisble?

    The only ragdolls I see examples of are detaching from the parent or disabling physics on it. I've tried a lot of configuratiosn including making the root body (pelvis) kineamtic as well as detaching and then setting the transform to match every frame. I've also just tried unwelding the bodies but still be a tick prereq and child of.

    There certainly seems to be something absolute about the capsule as its child skeletal mesh's root, and trying to use an actor whose RootComponent is a skeletal mesh doesn't seem correct. So I simply want to know if this is possible or anyone has tried something similar.

    If I wanted to have typical pawn with a physics simulated capsule component at the root , IS IT POSSIBLE to ragdoll selected bones in the attached skeletal mesh?
    Last edited by ShimShade; 01-14-2015, 09:43 AM.

    Dev Blog | Twitter | Greenlight Campaign (browser) | Disc Jam Announce Trailer

    #2
    Attached skeletal meshes will refuse to have SimulatePhysics set on their primitive component. This is because that flag is for letting the position of the component be controlled by physics, i.e.: gravity, impulses, etc. Applying both physics updates and parent transform updates will cause double transform issues and so this is forbidden.

    Body SimulatePhysics, on the other hand, is entirely separate from "full" physics simulation and can still be turned on for attached components. The component transform is still maintained by parent attachment, but the bodies of the skeletal mesh are driven by physics, including the velocity of that parent attachment.

    In order to turn on body physics only, simply avoid calling SetSimulatePhysics and do something like this:
    Code:
    	Mesh->SetAllBodiesBelowSimulatePhysics( RecoilBone, true );
    	Mesh->SetAllBodiesBelowPhysicsBlendWeight( RecoilBone, RecoilRagdollBlend );
    	Mesh->AddImpulse( DamageDirection * 2500.0f, RecoilBone );
    You'll probably need finer control than this, making partial ragdolls look good is a pain. But that should get you started.

    -Camille

    Comment

    Working...
    X