Hi,
When i ran ragdoll simulation if i enable transition and backto irrlicht animation result is very bad (see video)
Ninja with transition. (bad result when back to irrlicht animation)
http://www.youtube.com/watch?v=_XsCG4H4PjA
but i disable transition result is good.
Ninja without transition. (it's ok)
http://www.youtube.com/watch?v=OYV9NCV8EMg
Question is that problem depend on matrix ? Global matrix use when ragdoll simulate and irrlicht animation use local matrix, is'n it ?
I saw Unity AdvancedRagdoll, How should i do this in irrlicht ? Please suggest me.
Unity AdvancedRagdoll.
http://activeden.net/item/advancedragdoll/144172
[Solved] Ragdoll backto irrlicht animation system
[Solved] Ragdoll backto irrlicht animation system
Last edited by wing64 on Fri Apr 22, 2011 5:17 am, edited 1 time in total.
@hybrid: This's ragdoll code switch enable/disable. The key is setSkinningSpace() for use global axis from physx or local axis from skinned mesh.
@bitplane: I'm not sure i understand about global and local matrix but i think before backto irrlicht animation if i can convert joint position and rotation in global axis to local axis and set backto IBoneSceneNode i think this problem is solve. If i wrong please notice me.
Thanks for reply.
Code: Select all
void physxmgr_ragdoll_set_simulate_enable_single( ragdoll_t* in_rd, bool enable )
{
ragdoll_t* rd = in_rd;
if( !rd || !rd->node )
return;
rd->simulate = enable;
if( !rd->simulate )
{
// restore old rotation when back to irrlicht animation
rd->node->setRotation( rd->rot );
rd->node->updateAbsolutePosition( );
rd->node->setJointMode( EJUOR_CONTROL );
}
else
{
// FIX use zero transition allway when enable ragdoll
//rd->node->setTransitionTime( 0 );
rd->node->setJointMode( EJUOR_CONTROL );
}
ragdoll_element_t* re = NULL;
// ERDF_COUNT = max number of joint in ragdoll
for( u32 i = 0; i < ERDF_COUNT; ++i )
{
re = &rd->elements[i];
if( re && re->b0 && re->a0 )
{
re->b0->setSkinningSpace( rd->simulate?EBSS_GLOBAL:EBSS_LOCAL );
if( rd->simulate )
re->a0->clearBodyFlag( NX_BF_KINEMATIC );
else
re->a0->raiseBodyFlag( NX_BF_KINEMATIC );
}
} // for
}
Thanks for reply.
This problem solved.
http://www.youtube.com/watch?v=H1gnnjYFltU
http://www.youtube.com/watch?v=H1gnnjYFltU