Panagiotis Christopoulos Charitos 14 ani în urmă
părinte
comite
ff9d120754
3 a modificat fișierele cu 9 adăugiri și 15 ștergeri
  1. 2 2
      anki/scene/Camera.h
  2. 2 2
      anki/scene/Movable.cpp
  3. 5 11
      anki/scene/Movable.h

+ 2 - 2
anki/scene/Camera.h

@@ -97,9 +97,9 @@ public:
 	/// Overrides Movable::moveUpdate(). This does:
 	/// Overrides Movable::moveUpdate(). This does:
 	/// - Update view matrix
 	/// - Update view matrix
 	/// - Update frustum
 	/// - Update frustum
-	void moveUpdate()
+	void movableUpdate()
 	{
 	{
-		Movable::moveUpdate();
+		Movable::movableUpdate();
 		updateViewMatrix();
 		updateViewMatrix();
 		getFrustum().transform(getWorldTransform());
 		getFrustum().transform(getWorldTransform());
 	}
 	}

+ 2 - 2
anki/scene/Movable.cpp

@@ -20,7 +20,7 @@ Movable::Movable(uint flags_, Movable* parent, PropertyMap& pmap)
 //==============================================================================
 //==============================================================================
 void Movable::update()
 void Movable::update()
 {
 {
-	if(getParent() == NULL)
+	if(getParent() == NULL) // If root
 	{
 	{
 		updateWorldTransform();
 		updateWorldTransform();
 	}
 	}
@@ -53,7 +53,7 @@ void Movable::updateWorldTransform()
 	if(prevWTrf != wTrf)
 	if(prevWTrf != wTrf)
 	{
 	{
 		enableFlag(MF_MOVED);
 		enableFlag(MF_MOVED);
-		moveUpdate();
+		movableUpdate();
 	}
 	}
 	else
 	else
 	{
 	{

+ 5 - 11
anki/scene/Movable.h

@@ -15,12 +15,6 @@ class PropertyMap;
 /// @{
 /// @{
 
 
 /// Interface for movable scene nodes
 /// Interface for movable scene nodes
-///
-/// When the local tranform changes we calculate the @a dummyWTrf for this
-/// movable and it's children. The @a dummyWTrf contains the final world
-/// transformation. Why dont we set the @a wTrf at once? Because we the local
-/// transformation may change in the logic part of the main loop and we dont
-/// want
 class Movable: public Object<Movable>
 class Movable: public Object<Movable>
 {
 {
 public:
 public:
@@ -139,13 +133,13 @@ public:
 	}
 	}
 	/// @}
 	/// @}
 
 
-	/// This is called by the scene's main update method only when the object
-	/// had actually moved
-	virtual void moveUpdate()
+	/// This is called by the @a update() method only when the object had
+	/// actually moved
+	virtual void movableUpdate()
 	{}
 	{}
 
 
-	/// Update self and children world transform, if root node. Called every
-	/// frame.
+	/// Update self and children world transform recursively, if root node.
+	/// Need to call this at every frame.
 	/// @note Don't update if child because we start from roots and go to
 	/// @note Don't update if child because we start from roots and go to
 	///       children and we don't want a child to be updated before the
 	///       children and we don't want a child to be updated before the
 	///       parent
 	///       parent