Commit 199c83da authored by lukeph's avatar lukeph

fixed a bug in skinnedMesh

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1150 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d42ac070
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
#include "IAnimatedMeshSceneNode.h" #include "IAnimatedMeshSceneNode.h"
#include "os.h" #include "os.h"
namespace irr namespace irr
{ {
namespace scene namespace scene
...@@ -245,10 +242,10 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint, ...@@ -245,10 +242,10 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint,
foundPositionIndex = -1; foundPositionIndex = -1;
//Test the Hints... //Test the Hints...
if ((u32)positionHint < PositionKeys.size()) if (positionHint>=0 && (u32)positionHint < PositionKeys.size())
{ {
//check this hint //check this hint
if (PositionKeys[positionHint].frame>=frame && PositionKeys[positionHint-1].frame<frame ) if (positionHint>0 && PositionKeys[positionHint].frame>=frame && PositionKeys[positionHint-1].frame<frame )
foundPositionIndex=positionHint; foundPositionIndex=positionHint;
else if (positionHint+1 < (s32)PositionKeys.size()) else if (positionHint+1 < (s32)PositionKeys.size())
{ {
...@@ -302,10 +299,10 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint, ...@@ -302,10 +299,10 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint,
foundScaleIndex = -1; foundScaleIndex = -1;
//Test the Hints... //Test the Hints...
if ((u32)scaleHint < ScaleKeys.size()) if (scaleHint>=0 && (u32)scaleHint < ScaleKeys.size())
{ {
//check this hint //check this hint
if (ScaleKeys[scaleHint].frame>=frame && ScaleKeys[scaleHint-1].frame<frame ) if (scaleHint>0 && ScaleKeys[scaleHint].frame>=frame && ScaleKeys[scaleHint-1].frame<frame )
foundScaleIndex=scaleHint; foundScaleIndex=scaleHint;
else if (scaleHint+1 < (s32)ScaleKeys.size()) else if (scaleHint+1 < (s32)ScaleKeys.size())
{ {
...@@ -360,10 +357,10 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint, ...@@ -360,10 +357,10 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *Joint,
foundRotationIndex = -1; foundRotationIndex = -1;
//Test the Hints... //Test the Hints...
if ((u32)rotationHint < RotationKeys.size()) if (rotationHint>=0 && (u32)rotationHint < RotationKeys.size())
{ {
//check this hint //check this hint
if (RotationKeys[rotationHint].frame>=frame && RotationKeys[rotationHint-1].frame<frame ) if (rotationHint>0 && RotationKeys[rotationHint].frame>=frame && RotationKeys[rotationHint-1].frame<frame )
foundRotationIndex=rotationHint; foundRotationIndex=rotationHint;
else if (rotationHint+1 < (s32)RotationKeys.size()) else if (rotationHint+1 < (s32)RotationKeys.size())
{ {
......
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