Prechádzať zdrojové kódy

Minor fix to getGravity function signature (removed random extra parameter).
Fixes recently added SpriteBatch draw function to draw sprites using the given position as the center.

Chris Culy 14 rokov pred
rodič
commit
f03e69b185

+ 1 - 1
gameplay/src/PhysicsController.cpp

@@ -109,7 +109,7 @@ PhysicsSpringConstraint* PhysicsController::createSpringConstraint(PhysicsRigidB
     return constraint;
     return constraint;
 }
 }
 
 
-const Vector3& PhysicsController::getGravity(const Vector3& gravity) const
+const Vector3& PhysicsController::getGravity() const
 {
 {
     return _gravity;
     return _gravity;
 }
 }

+ 1 - 1
gameplay/src/PhysicsController.h

@@ -173,7 +173,7 @@ public:
      * 
      * 
      * @return The gravity vector.
      * @return The gravity vector.
      */
      */
-    const Vector3& getGravity(const Vector3& gravity) const;
+    const Vector3& getGravity() const;
 
 
     /**
     /**
      * Sets the gravity vector for the simulated physics world.
      * Sets the gravity vector for the simulated physics world.

+ 2 - 2
gameplay/src/SpriteBatch.cpp

@@ -250,8 +250,8 @@ void SpriteBatch::draw(const Vector3& position, const Vector3& right, const Vect
 {
 {
     // Calculate the vertex positions.
     // Calculate the vertex positions.
     Vector3 p[4];
     Vector3 p[4];
-    p[0] = position - 0.5f * width * right;
-    p[1] = position + 0.5f * width * right;
+    p[0] = position - 0.5f * width * right - 0.5f * height * forward;
+    p[1] = position + 0.5f * width * right - 0.5f * height * forward;
     p[2] = p[0] + height * forward;
     p[2] = p[0] + height * forward;
     p[3] = p[1] + height * forward;
     p[3] = p[1] + height * forward;