Fixed a possible transformation problem in debug render.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1289 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-03-19 09:33:59 +00:00
parent eefa8390a9
commit ca91742a1e
1 changed files with 13 additions and 19 deletions

View File

@ -290,8 +290,8 @@ void CAnimatedMeshSceneNode::render()
{ {
scene::IMeshBuffer* mb = m->getMeshBuffer(i); scene::IMeshBuffer* mb = m->getMeshBuffer(i);
mat = Materials[i]; mat = Materials[i];
mat.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR; mat.MaterialType = video::EMT_TRANSPARENT_ADD_COLOR;
if (RenderFromIdentity) if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() ); driver->setTransform(video::ETS_WORLD, core::matrix4() );
else if (Mesh->getMeshType() == EAMT_SKINNED) else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
@ -317,8 +317,8 @@ void CAnimatedMeshSceneNode::render()
if (transparent == isTransparentPass) if (transparent == isTransparentPass)
{ {
scene::IMeshBuffer* mb = m->getMeshBuffer(i); scene::IMeshBuffer* mb = m->getMeshBuffer(i);
if (RenderFromIdentity) if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() ); driver->setTransform(video::ETS_WORLD, core::matrix4() );
else if (Mesh->getMeshType() == EAMT_SKINNED) else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
@ -394,7 +394,7 @@ void CAnimatedMeshSceneNode::render()
for (u32 g=0; g< m->getMeshBufferCount(); ++g) for (u32 g=0; g< m->getMeshBufferCount(); ++g)
{ {
const IMeshBuffer* mb = m->getMeshBuffer(g); const IMeshBuffer* mb = m->getMeshBuffer(g);
if (Mesh->getMeshType() == EAMT_SKINNED) if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
@ -404,6 +404,7 @@ void CAnimatedMeshSceneNode::render()
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
} }
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
if ( DebugDataVisible & scene::EDS_BBOX ) if ( DebugDataVisible & scene::EDS_BBOX )
driver->draw3DBox(Box, video::SColor(0,255,255,255)); driver->draw3DBox(Box, video::SColor(0,255,255,255));
@ -475,8 +476,8 @@ void CAnimatedMeshSceneNode::render()
for (u32 g=0; g<m->getMeshBufferCount(); ++g) for (u32 g=0; g<m->getMeshBufferCount(); ++g)
{ {
const IMeshBuffer* mb = m->getMeshBuffer(g); const IMeshBuffer* mb = m->getMeshBuffer(g);
if (RenderFromIdentity) if (RenderFromIdentity)
driver->setTransform(video::ETS_WORLD, core::matrix4() ); driver->setTransform(video::ETS_WORLD, core::matrix4() );
else if (Mesh->getMeshType() == EAMT_SKINNED) else if (Mesh->getMeshType() == EAMT_SKINNED)
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation); driver->setTransform(video::ETS_WORLD, AbsoluteTransformation * ((SSkinMeshBuffer*)mb)->Transformation);
@ -586,10 +587,9 @@ IBoneSceneNode* CAnimatedMeshSceneNode::getJointNode(const c8* jointName)
checkJoints(); checkJoints();
ISkinnedMesh *skinnedMesh=(ISkinnedMesh*)Mesh; ISkinnedMesh *skinnedMesh=(ISkinnedMesh*)Mesh;
s32 number = skinnedMesh->getJointNumber(jointName); const s32 number = skinnedMesh->getJointNumber(jointName);
if (number == -1) if (number == -1)
{ {
@ -825,6 +825,7 @@ void CAnimatedMeshSceneNode::setMesh(IAnimatedMesh* mesh)
Mesh->grab(); Mesh->grab();
} }
// returns the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, // returns the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh,
// or the absolutetransformation if it's a normal scenenode // or the absolutetransformation if it's a normal scenenode
const SMD3QuaterionTag& CAnimatedMeshSceneNode::getMD3TagTransformation( const core::stringc & tagname) const SMD3QuaterionTag& CAnimatedMeshSceneNode::getMD3TagTransformation( const core::stringc & tagname)
@ -973,26 +974,18 @@ void CAnimatedMeshSceneNode::animateJoints(bool CalculateAbsolutePositions)
{ {
//---slow--- //---slow---
for (u32 n=0;n<JointChildSceneNodes.size();++n) for (u32 n=0;n<JointChildSceneNodes.size();++n)
{
if (JointChildSceneNodes[n]->getParent()==this) if (JointChildSceneNodes[n]->getParent()==this)
{ {
JointChildSceneNodes[n]->updateAbsolutePositionOfAllChildren(); //temp, should be an option JointChildSceneNodes[n]->updateAbsolutePositionOfAllChildren(); //temp, should be an option
} }
}
} }
} }
} }
} }
void CAnimatedMeshSceneNode::checkJoints() void CAnimatedMeshSceneNode::checkJoints()
{ {
if (!Mesh || Mesh->getMeshType() != EAMT_SKINNED) if (!Mesh || Mesh->getMeshType() != EAMT_SKINNED)
@ -1010,6 +1003,7 @@ void CAnimatedMeshSceneNode::checkJoints()
} }
} }
void CAnimatedMeshSceneNode::beginTransition() void CAnimatedMeshSceneNode::beginTransition()
{ {
if (!JointsUsed) if (!JointsUsed)