Browse Source

Merge pull request #1662 from seanpaultaylor/next

Minor tweaking on PhysicsVehicle
Sean Taylor 11 years ago
parent
commit
d18247df56

+ 23 - 27
gameplay/src/PhysicsController.h

@@ -476,10 +476,30 @@ private:
     {
     public:
 
+        /**
+         * Constructor.
+         */
+        DebugDrawer(); 
+
         /** 
-         * DebugVertex.
-         * @script{ignore}
+         * Destructor.
          */
+        ~DebugDrawer();
+        
+        void begin(const Matrix& viewProjection);
+        void end();
+
+        // Overridden Bullet functions from btIDebugDraw.
+        void drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor);        
+        void drawLine(const btVector3& from, const btVector3& to, const btVector3& color);        
+        void drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color);        
+        void reportErrorWarning(const char* warningString);
+        void draw3dText(const btVector3& location, const char* textString);        
+        void setDebugMode(int mode);        
+        int getDebugMode() const;
+        
+    private:
+
         struct DebugVertex
         {
             /**
@@ -516,31 +536,7 @@ private:
              * The alpha component of the vertex.
              */
             float a;
-        };
-
-        /**
-         * Constructor.
-         */
-        DebugDrawer(); 
-
-        /** 
-         * Destructor.
-         */
-        ~DebugDrawer();
-        
-        void begin(const Matrix& viewProjection);
-        void end();
-
-        // Overridden Bullet functions from btIDebugDraw.
-        void drawLine(const btVector3& from, const btVector3& to, const btVector3& fromColor, const btVector3& toColor);        
-        void drawLine(const btVector3& from, const btVector3& to, const btVector3& color);        
-        void drawContactPoint(const btVector3& pointOnB, const btVector3& normalOnB, btScalar distance, int lifeTime, const btVector3& color);        
-        void reportErrorWarning(const char* warningString);
-        void draw3dText(const btVector3& location, const char* textString);        
-        void setDebugMode(int mode);        
-        int    getDebugMode() const;
-        
-    private:
+        };    	
         
         int _mode;
         MeshBatch* _meshBatch;

+ 3 - 3
gameplay/src/PhysicsVehicle.cpp

@@ -224,14 +224,14 @@ void PhysicsVehicle::setEnabled(bool enable)
     getRigidBody()->setEnabled(enable);
 }
 
-unsigned int PhysicsVehicle::getNumWheels() const
+unsigned int PhysicsVehicle::getWheelCount() const
 {
     return (unsigned int)_wheels.size();
 }
 
-PhysicsVehicleWheel* PhysicsVehicle::getWheel(unsigned int i)
+PhysicsVehicleWheel* PhysicsVehicle::getWheel(unsigned int index)
 {
-    return _wheels.at(i);
+    return _wheels.at(index);
 }
 
 void PhysicsVehicle::addWheel(PhysicsVehicleWheel* wheel)

+ 4 - 4
gameplay/src/PhysicsVehicle.h

@@ -45,11 +45,11 @@ public:
     void setEnabled(bool enable);
 
     /**
-     * Returns the number of wheels on this vehicle.
+     * Gets the number of wheels on this vehicle.
      *
      * @return the number of wheels on this vehicle.
      */
-    unsigned int getNumWheels() const;
+    unsigned int getWheelCount() const;
 
     /**
      * Gets the wheel at the specified index.
@@ -67,12 +67,12 @@ public:
     void addWheel(PhysicsVehicleWheel* wheel);
 
     /**
-     * Returns an indication of vehicle speed in kilometers per hour.
+     * Gets an indication of vehicle speed in kilometers per hour.
      */
     float getSpeedKph() const;
 
     /**
-     * Returns a lagged version of vehicle speed in kilometers per hour,
+     * Gets a lagged version of vehicle speed in kilometers per hour,
      * for example that might be used to control engine sounds.
      */
     float getSpeedSmoothKph() const;

+ 4 - 4
gameplay/src/lua/lua_PhysicsVehicle.cpp

@@ -41,7 +41,7 @@ void luaRegister_PhysicsVehicle()
         {"getDrivedownStart", lua_PhysicsVehicle_getDrivedownStart},
         {"getDrivingForce", lua_PhysicsVehicle_getDrivingForce},
         {"getNode", lua_PhysicsVehicle_getNode},
-        {"getNumWheels", lua_PhysicsVehicle_getNumWheels},
+        {"getWheelCount", lua_PhysicsVehicle_getWheelCount},
         {"getRigidBody", lua_PhysicsVehicle_getRigidBody},
         {"getShapeType", lua_PhysicsVehicle_getShapeType},
         {"getSpeedKph", lua_PhysicsVehicle_getSpeedKph},
@@ -902,7 +902,7 @@ int lua_PhysicsVehicle_getNode(lua_State* state)
     return 0;
 }
 
-int lua_PhysicsVehicle_getNumWheels(lua_State* state)
+int lua_PhysicsVehicle_getWheelCount(lua_State* state)
 {
     // Get the number of parameters.
     int paramCount = lua_gettop(state);
@@ -915,7 +915,7 @@ int lua_PhysicsVehicle_getNumWheels(lua_State* state)
             if ((lua_type(state, 1) == LUA_TUSERDATA))
             {
                 PhysicsVehicle* instance = getInstance(state);
-                unsigned int result = instance->getNumWheels();
+                unsigned int result = instance->getWheelCount();
 
                 // Push the return value onto the stack.
                 lua_pushunsigned(state, result);
@@ -923,7 +923,7 @@ int lua_PhysicsVehicle_getNumWheels(lua_State* state)
                 return 1;
             }
 
-            lua_pushstring(state, "lua_PhysicsVehicle_getNumWheels - Failed to match the given parameters to a valid function signature.");
+            lua_pushstring(state, "lua_PhysicsVehicle_getWheelCount - Failed to match the given parameters to a valid function signature.");
             lua_error(state);
             break;
         }

+ 1 - 1
gameplay/src/lua/lua_PhysicsVehicle.h

@@ -25,7 +25,7 @@ int lua_PhysicsVehicle_getDrivedownFull(lua_State* state);
 int lua_PhysicsVehicle_getDrivedownStart(lua_State* state);
 int lua_PhysicsVehicle_getDrivingForce(lua_State* state);
 int lua_PhysicsVehicle_getNode(lua_State* state);
-int lua_PhysicsVehicle_getNumWheels(lua_State* state);
+int lua_PhysicsVehicle_getWheelCount(lua_State* state);
 int lua_PhysicsVehicle_getRigidBody(lua_State* state);
 int lua_PhysicsVehicle_getShapeType(lua_State* state);
 int lua_PhysicsVehicle_getSpeedKph(lua_State* state);

+ 1 - 0
samples/racer/sample-racer.pro

@@ -49,6 +49,7 @@ linux: PRE_TARGETDEPS += $$PWD/../../external-deps/lib/linux/x86_64/libgameplay-
 linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/shaders ../res$$escape_expand(\n\t))
 linux: QMAKE_POST_LINK += $$quote(rsync -rau $$PWD/../../gameplay/res/ui ../res$$escape_expand(\n\t))
 linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/../../gameplay/res/logo_powered_white.png ../res$$escape_expand(\n\t))
+linux: QMAKE_POST_LINK += $$quote(cp -rf $$PWD/game.dxt.config ../game.config$$escape_expand(\n\t))
 
 macx: QMAKE_CXXFLAGS += -x c++ -stdlib=libc++ -w -arch x86_64
 macx: QMAKE_OBJECTIVE_CFLAGS += -x objective-c++ -stdlib=libc++ -w -arch x86_64