Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 22:40

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 28.04.2008, 22:43 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
I found this little gem in an essential - but probably little-used to date - function. Take a look at the if condition:
Code:
   DLLEXP bool setNodeTransformMatrix( NodeHandle node, const float *mat4x4 )
   {
      SceneNode *sn = Modules::sceneMan().resolveNodeHandle( node );
      
      if( sn != 0x0 || mat4x4 == 0x0 )
      {
         static Matrix4f mat;
         memcpy( mat.c, mat4x4, 16 * sizeof( float ) );
         sn->setTransform( mat );
         return true;
      }
      else
      {
         Modules::log().writeDebugInfo( "Invalid node handle %i in setNodeTransformMatrix", node );
         return false;
      }
   }

I am pretty sure it should be like this instead:
Code:
      if( sn != 0x0 && mat4x4 != 0x0 )
      {
         static Matrix4f mat;
         memcpy( mat.c, mat4x4, 16 * sizeof( float ) );
         sn->setTransform( mat );
         return true;
      }
      else
      {
         //...
      }
   }

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 29.04.2008, 09:23 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Thanks for pointing this out. Fixed it in the svn.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group