Commit b2f55c36 authored by hybrid's avatar hybrid

Let md2 animate even with hw buffers.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1098 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 37e2685c
...@@ -417,6 +417,7 @@ void CAnimatedMeshMD2::updateInterpolationBuffer(s32 frame, s32 startFrameLoop, ...@@ -417,6 +417,7 @@ void CAnimatedMeshMD2::updateInterpolationBuffer(s32 frame, s32 startFrameLoop,
//update bounding box //update bounding box
InterpolationBuffer.setBoundingBox(BoxList[secondFrame].getInterpolated(BoxList[firstFrame], div)); InterpolationBuffer.setBoundingBox(BoxList[secondFrame].getInterpolated(BoxList[firstFrame], div));
InterpolationBuffer.setDirty();
} }
......
...@@ -79,7 +79,6 @@ IMesh* CSkinnedMesh::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 ...@@ -79,7 +79,6 @@ IMesh* CSkinnedMesh::getMesh(s32 frame, s32 detailLevel, s32 startFrameLoop, s32
//! blend: {0-old position, 1-New position} //! blend: {0-old position, 1-New position}
void CSkinnedMesh::animateMesh(f32 frame, f32 blend) void CSkinnedMesh::animateMesh(f32 frame, f32 blend)
{ {
if ( !HasAnimation || lastAnimatedFrame==frame) if ( !HasAnimation || lastAnimatedFrame==frame)
return; return;
...@@ -91,7 +90,6 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend) ...@@ -91,7 +90,6 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend)
for (u32 i=0; i<AllJoints.size(); ++i) for (u32 i=0; i<AllJoints.size(); ++i)
{ {
//To Bitplane: The joints can be animated here with no input from their parents, but for setAnimationMode extra checks are needed to their parents //To Bitplane: The joints can be animated here with no input from their parents, but for setAnimationMode extra checks are needed to their parents
SJoint *Joint = AllJoints[i]; SJoint *Joint = AllJoints[i];
const core::vector3df oldPosition = Joint->Animatedposition; const core::vector3df oldPosition = Joint->Animatedposition;
...@@ -132,7 +130,6 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend) ...@@ -132,7 +130,6 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend)
buildAll_LocalAnimatedMatrices(); buildAll_LocalAnimatedMatrices();
//----------------- //-----------------
} }
} }
...@@ -431,17 +428,14 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint, ...@@ -431,17 +428,14 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint,
//! Preforms a software skin on this mesh based of joint positions //! Preforms a software skin on this mesh based of joint positions
void CSkinnedMesh::skinMesh() void CSkinnedMesh::skinMesh()
{ {
if ( !HasAnimation) if ( !HasAnimation)
return; return;
//---------------- //----------------
// Temp! // Temp!
buildAll_GlobalAnimatedMatrices(); buildAll_GlobalAnimatedMatrices();
//----------------- //-----------------
if (!HardwareSkinning) if (!HardwareSkinning)
{ {
//Software skin.... //Software skin....
...@@ -466,10 +460,9 @@ void CSkinnedMesh::skinMesh() ...@@ -466,10 +460,9 @@ void CSkinnedMesh::skinMesh()
for (i=0; i<RootJoints.size(); ++i) for (i=0; i<RootJoints.size(); ++i)
SkinJoint(RootJoints[i], 0); SkinJoint(RootJoints[i], 0);
} }
} }
void CSkinnedMesh::SkinJoint(SJoint *Joint, SJoint *ParentJoint) void CSkinnedMesh::SkinJoint(SJoint *Joint, SJoint *ParentJoint)
{ {
if (Joint->Weights.size()) if (Joint->Weights.size())
...@@ -522,16 +515,6 @@ void CSkinnedMesh::SkinJoint(SJoint *Joint, SJoint *ParentJoint) ...@@ -522,16 +515,6 @@ void CSkinnedMesh::SkinJoint(SJoint *Joint, SJoint *ParentJoint)
} }
E_ANIMATED_MESH_TYPE CSkinnedMesh::getMeshType() const E_ANIMATED_MESH_TYPE CSkinnedMesh::getMeshType() const
{ {
return EAMT_SKINNED; return EAMT_SKINNED;
...@@ -940,7 +923,6 @@ void CSkinnedMesh::finalize() ...@@ -940,7 +923,6 @@ void CSkinnedMesh::finalize()
if (HasAnimation) if (HasAnimation)
{ {
//--- optimize and check keyframes --- //--- optimize and check keyframes ---
for(i=0;i<AllJoints.size();++i) for(i=0;i<AllJoints.size();++i)
{ {
...@@ -1103,9 +1085,6 @@ void CSkinnedMesh::finalize() ...@@ -1103,9 +1085,6 @@ void CSkinnedMesh::finalize()
Buffer->Transformation=AllJoints[i]->GlobalAnimatedMatrix; Buffer->Transformation=AllJoints[i]->GlobalAnimatedMatrix;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment