[video]Ragdoll and hkaRagdollPoweredConstraintController issues

[video]Ragdoll and hkaRagdollPoweredConstraintController issues

Hello everyone,

Sorry for creating the same topic twice, but I was unable to create a topic with yt link, nor I couldn't upload mp4 file as attachment - the topic just wasn't being created despite the 'success' message. Not to mention that I can't edit my previous posts, I don't know, maybe its a new user restriction or a board policy in general...

Anyway, I'm having a problem with my ragdoll simulation. I'm following as an example animations showcase demo, so far I have implemented successfully all the ragdoll initialization part and ragdoll driving to animation with support of hit reactions. I've also kinda got standard ragdoll scenario to work, but only by not using the hkaRagdollPoweredConstraintController. Please check the included video to observe what happens, any ideas on what could cause this ragdoll "freezing" are more then appreciated. If more details are in order, just let me know. Below is a code snippet and a mentioned video.

Quote:

link here, just replace [dot] with the proper symbol -> www[dot]youtube[dot]com/watch?v=LZXjHuCIAkg

void cHkRagdollAnimations::UpdateRagdollToMatchAnimation(hkaPose& pose, float dt)
{
    // Get the ragdoll's reference pose in model space
    // We use this pose as the in+out pose to the mapper below
    const hkaSkeleton* rSkel = m_ragdollInstance->getSkeleton();
    hkLocalBuffer<hkQsTransform> ragdollModelSpace( rSkel->m_bones.getSize() );
    hkaSkeletonUtils::transformLocalPoseToModelPose( rSkel->m_bones.getSize(), rSkel->m_parentIndices.begin(), rSkel->m_referencePose.begin(), ragdollModelSpace.begin() );
    // Map the pose from the animation (highres) to ragdoll (lowres)
    m_highResToRagdollMapper->mapPose( pose.getSyncedPoseModelSpace().begin(), rSkel->m_referencePose.begin(), ragdollModelSpace.begin(), hkaSkeletonMapper::CURRENT_POSE );
//with this block commented out, the ragdoll works  
        // Drive the powered constraints to this ragdoll pose using a controller
        {
            hkLocalBuffer<hkQsTransform> ragdollLocalSpace( rSkel->m_bones.getSize() );
            hkaSkeletonUtils::transformModelPoseToLocalPose( rSkel->m_bones.getSize(), rSkel->m_parentIndices.begin(), ragdollModelSpace.begin(), ragdollLocalSpace.begin() );
            hkaRagdollPoweredConstraintController::startMotors(m_ragdollInstance);
            hkaRagdollPoweredConstraintController::driveToPose( m_ragdollInstance, ragdollLocalSpace.begin() ) ;
        }
 ////  
    // Get the current pose from the ragdoll, map it back to the character
    {
        m_ragdollInstance->getPoseModelSpace(ragdollModelSpace.begin(), m_currentTransform);
        const hkQsTransform* localBIn  = pose.getSyncedPoseLocalSpace().begin();
        hkQsTransform*       modelBOut = pose.accessSyncedPoseModelSpace().begin();
        m_ragdollToHighResMapper->mapPose( ragdollModelSpace.begin(), localBIn, modelBOut, hkaSkeletonMapper::CURRENT_POSE );
    }
}

And btw, yes, I could live with this what I already got, but I want to also implement getting up from ragdoll, so I need to be able to drive ragdoll to a specific pose :)

Thx in advance!

1 contribution / 0 nouveau(x)
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.