Pārlūkot izejas kodu

Adds joystick control to forms test and fixes projectPoint in framework (protect against null scene and use world matrix not local one).

Ken Whatmough 13 gadi atpakaļ
vecāks
revīzija
d697de8ba9
1 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 3 3
      gameplay/src/Form.cpp

+ 3 - 3
gameplay/src/Form.cpp

@@ -711,12 +711,12 @@ bool Form::projectPoint(int x, int y, Vector3* point)
 {
 {
     Scene* scene = _node->getScene();
     Scene* scene = _node->getScene();
     GP_ASSERT(scene);
     GP_ASSERT(scene);
-    Camera* camera = scene->getActiveCamera();
+    Camera* camera;
 
 
-    if (camera)
+    if (scene && (camera = scene->getActiveCamera()))
     {
     {
         // Get info about the form's position.
         // Get info about the form's position.
-        Matrix m = _node->getMatrix();
+        Matrix m = _node->getWorldMatrix();
         Vector3 min(0, 0, 0);
         Vector3 min(0, 0, 0);
         m.transformPoint(&min);
         m.transformPoint(&min);