Just want to confirm that what I am doing is correct.
First I attach the bag to the characters hand bone
Code: Select all
entity->attachObjectToBone( m_AttachBoneName, m_Bag, rotation, m_Offset );
Code: Select all
entity->getSkeleton()->setBlendMode( Ogre::ANIMBLEND_CUMULATIVE );
size_t count = entity->getNumManualLodLevels();
for ( size_t i = 0; i < count; ++i )
{
entity->getManualLodLevel( i )->getSkeleton()->setBlendMode( Ogre::ANIMBLEND_CUMULATIVE );
}
Code: Select all
//---------------------------------------------------------------------
void AnimationState::copyStateFrom(const AnimationState& animState)
{
// the new code to copy the blend mask data
if ( !mBlendMask && animState.hasBlendMask() )
_setBlendMask( animState.mBlendMask );
else if ( mBlendMask )
{
if ( animState.hasBlendMask() )
_setBlendMaskData( &(*animState.mBlendMask)[0] );
else
destroyBlendMask();
}
mTimePos = animState.mTimePos;
mLength = animState.mLength;
mWeight = animState.mWeight;
mEnabled = animState.mEnabled;
mLoop = animState.mLoop;
mParent->_notifyDirty();
}
Code: Select all
int index = entity->getCurrentLodIndex() - 1;
if ( index > -1 )
{
entity->_updateAnimation();
}