Permalink
Browse files

BUGFIX: fixed a null pointer exception (those still exist!?)

  • Loading branch information...
1 parent 8084e52 commit 17066f0a4f67d91a030d1bf834d5096b1878b956 @gnuvince committed Jan 24, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 CoreLib/Sources/Scene/Objects/Node.cpp
@@ -50,9 +50,14 @@ void Node<real>::Update()
// du noeud parent, qu'on suppose calculées.
///////////////////////////////////////
- Transformation<real> parent_transformation = GetParent()->GetLocalTransformation();
- mLocalToGlobal = parent_transformation.GetMatrix() * GetLocalTransformation().GetMatrix();
- mGlobalToLocal = GetLocalTransformation().GetMatrix() * parent_transformation.GetInverseMatrix();
+
+ Node* parent = GetParent();
+
+ if (parent != NULL) {
+ Transformation<real> parent_transformation = parent->GetLocalTransformation();
+ mLocalToGlobal = parent_transformation.GetMatrix() * GetLocalTransformation().GetMatrix();
+ mGlobalToLocal = GetLocalTransformation().GetMatrix() * parent_transformation.GetInverseMatrix();
+ }
// Update child nodes
for ( uint i=0 ; i<mChildren.size() ; ++i )

0 comments on commit 17066f0

Please sign in to comment.