getMeshForCurrentFrame() function redundant (call twice in 1.OnAnimate() & 2.render()), isn't it ? I try delete that function at OnAnimate() function and test result is ok. Suggest me if i'm wrong.
Old OnAnimate
Code: Select all
void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
{
buildFrameNr(timeMs-LastTimeMs);
if (Mesh)
{
scene::IMesh * mesh = getMeshForCurrentFrame();
if (mesh)
Box = mesh->getBoundingBox();
}
LastTimeMs = timeMs;
IAnimatedMeshSceneNode::OnAnimate ( timeMs );
}
Code: Select all
void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
{
buildFrameNr(timeMs-LastTimeMs);
LastTimeMs = timeMs;
IAnimatedMeshSceneNode::OnAnimate ( timeMs );
}
Old setTransitionTime
Code: Select all
void CAnimatedMeshSceneNode::setTransitionTime(f32 time)
{
if (time != 0.0f)
{
checkJoints();
setJointMode(EJUOR_CONTROL);
TransitionTime = (u32)core::floor32(time*1000.0f);
}
}
Code: Select all
void CAnimatedMeshSceneNode::setTransitionTime(f32 time)
{
if (time != 0.0f)
{
checkJoints();
setJointMode(EJUOR_CONTROL);
TransitionTime = (u32)core::floor32(time*1000.0f);
}
else if (time == 0.0f)
{
checkJoints();
setJointMode(EJUOR_NONE);
TransitionTime = 0;
}
}