Browse Source

- Scene joints now use S32 and not U32. This is consistent with returning (-1) when an error occurs.

MelvMay-GG 12 years ago
parent
commit
4d397f4

+ 84 - 17
engine/source/2d/scene/Scene.cc

@@ -1542,7 +1542,7 @@ void Scene::mergeScene( const Scene* pScene )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-b2Joint* Scene::findJoint( const U32 jointId )
+b2Joint* Scene::findJoint( const S32 jointId )
 {
 {
     // Find joint.
     // Find joint.
     typeJointHash::iterator itr = mJoints.find( jointId );
     typeJointHash::iterator itr = mJoints.find( jointId );
@@ -1552,7 +1552,7 @@ b2Joint* Scene::findJoint( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-b2JointType Scene::getJointType( const U32 jointId )
+b2JointType Scene::getJointType( const S32 jointId )
 {
 {
     // Sanity!
     // Sanity!
     if ( jointId >= mJointMasterId )
     if ( jointId >= mJointMasterId )
@@ -1566,7 +1566,7 @@ b2JointType Scene::getJointType( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::findJointId( b2Joint* pJoint )
+S32 Scene::findJointId( b2Joint* pJoint )
 {
 {
     // Sanity!
     // Sanity!
     AssertFatal( pJoint != NULL, "Joint cannot be NULL." );
     AssertFatal( pJoint != NULL, "Joint cannot be NULL." );
@@ -1585,7 +1585,7 @@ U32 Scene::findJointId( b2Joint* pJoint )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createJoint( b2JointDef* pJointDef )
+S32 Scene::createJoint( b2JointDef* pJointDef )
 {
 {
     // Sanity!
     // Sanity!
     AssertFatal( pJointDef != NULL, "Joint definition cannot be NULL." );
     AssertFatal( pJointDef != NULL, "Joint definition cannot be NULL." );
@@ -1594,7 +1594,7 @@ U32 Scene::createJoint( b2JointDef* pJointDef )
     b2Joint* pJoint = mpWorld->CreateJoint( pJointDef );
     b2Joint* pJoint = mpWorld->CreateJoint( pJointDef );
 
 
     // Allocate joint Id.
     // Allocate joint Id.
-    const U32 jointId = mJointMasterId++;
+    const S32 jointId = mJointMasterId++;
 
 
     // Insert joint.
     // Insert joint.
     typeJointHash::iterator itr = mJoints.insert( jointId, pJoint );
     typeJointHash::iterator itr = mJoints.insert( jointId, pJoint );
@@ -1650,7 +1650,7 @@ bool Scene::hasJoints( SceneObject* pSceneObject )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createDistanceJoint(
+S32 Scene::createDistanceJoint(
     const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
     const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
     const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
     const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
     const F32 length,
     const F32 length,
@@ -1667,6 +1667,13 @@ U32 Scene::createDistanceJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createDistanceJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -1857,7 +1864,7 @@ F32 Scene::getDistanceJointDampingRatio( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createRopeJoint(
+S32 Scene::createRopeJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const F32 maxLength,
         const F32 maxLength,
@@ -1872,6 +1879,13 @@ U32 Scene::createRopeJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createRopeJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -1948,7 +1962,7 @@ F32 Scene::getRopeJointMaxLength( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createRevoluteJoint(
+S32 Scene::createRevoluteJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const bool collideConnected )
         const bool collideConnected )
@@ -1962,6 +1976,13 @@ U32 Scene::createRevoluteJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createRevoluteJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -2115,7 +2136,7 @@ bool Scene::getRevoluteJointMotor(
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createWeldJoint(
+S32 Scene::createWeldJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const F32 frequency,
         const F32 frequency,
@@ -2131,6 +2152,13 @@ U32 Scene::createWeldJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createWeldJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -2266,7 +2294,7 @@ F32 Scene::getWeldJointDampingRatio( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createWheelJoint(
+S32 Scene::createWheelJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& worldAxis,
         const b2Vec2& worldAxis,
@@ -2281,6 +2309,13 @@ U32 Scene::createWheelJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createWheelJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -2481,7 +2516,7 @@ F32 Scene::getWheelJointDampingRatio( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createFrictionJoint(
+S32 Scene::createFrictionJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const F32 maxForce,
         const F32 maxForce,
@@ -2497,6 +2532,13 @@ U32 Scene::createFrictionJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createFrictionJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -2631,7 +2673,7 @@ F32 Scene::getFrictionJointMaxTorque( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createPrismaticJoint(
+S32 Scene::createPrismaticJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& worldAxis,
         const b2Vec2& worldAxis,
@@ -2646,6 +2688,13 @@ U32 Scene::createPrismaticJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createPrismaticJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -2800,7 +2849,7 @@ bool Scene::getPrismaticJointMotor(
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createPulleyJoint(
+S32 Scene::createPulleyJoint(
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
         const b2Vec2& worldGroundAnchorA, const b2Vec2& worldGroundAnchorB,
         const b2Vec2& worldGroundAnchorA, const b2Vec2& worldGroundAnchorB,
@@ -2817,6 +2866,13 @@ U32 Scene::createPulleyJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createPulleyJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
@@ -2841,7 +2897,7 @@ U32 Scene::createPulleyJoint(
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createTargetJoint(
+S32 Scene::createTargetJoint(
         const SceneObject* pSceneObject,
         const SceneObject* pSceneObject,
         const b2Vec2& worldTarget,
         const b2Vec2& worldTarget,
         const F32 maxForce,
         const F32 maxForce,
@@ -2858,8 +2914,12 @@ U32 Scene::createTargetJoint(
         return -1;
         return -1;
     }
     }
 
 
-    // Sanity!
-    AssertFatal( pSceneObject != NULL, "Invalid scene object." );
+    // Check for invalid object.
+    if ( pSceneObject == NULL )
+    {
+        Con::warnf("Scene::createPulleyJoint() - Cannot create joint without a scene object." );
+        return -1;
+    }
 
 
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBody = pSceneObject->getBody();
     b2Body* pBody = pSceneObject->getBody();
@@ -3118,7 +3178,7 @@ F32 Scene::getTargetJointDampingRatio( const U32 jointId )
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-U32 Scene::createMotorJoint(
+S32 Scene::createMotorJoint(
             const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
             const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
             const b2Vec2 linearOffset,
             const b2Vec2 linearOffset,
             const F32 angularOffset,
             const F32 angularOffset,
@@ -3136,6 +3196,13 @@ U32 Scene::createMotorJoint(
         return -1;
         return -1;
     }
     }
 
 
+    // Check for two invalid objects.
+    if ( pSceneObjectA == NULL && pSceneObjectB == NULL )
+    {
+        Con::warnf("Scene::createMotorJoint() - Cannot create joint without at least a single scene object." );
+        return -1;
+    }
+
     // Fetch bodies.
     // Fetch bodies.
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyA = pSceneObjectA != NULL ? pSceneObjectA->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();
     b2Body* pBodyB = pSceneObjectB != NULL ? pSceneObjectB->getBody() : getGroundBody();

+ 17 - 17
engine/source/2d/scene/Scene.h

@@ -162,8 +162,8 @@ class Scene :
     public virtual Tickable
     public virtual Tickable
 {
 {
 public:
 public:
-    typedef HashMap<U32, b2Joint*>              typeJointHash;
-    typedef HashMap<U32, U32>                   typeReverseJointHash;
+    typedef HashMap<S32, b2Joint*>              typeJointHash;
+    typedef HashMap<U32, S32>                   typeReverseJointHash;
     typedef Vector<tDeleteRequest>              typeDeleteVector;
     typedef Vector<tDeleteRequest>              typeDeleteVector;
     typedef Vector<TickContact>                 typeContactVector;
     typedef Vector<TickContact>                 typeContactVector;
     typedef HashMap<b2Contact*, TickContact>    typeContactHash;
     typedef HashMap<b2Contact*, TickContact>    typeContactHash;
@@ -219,7 +219,7 @@ private:
     /// Joint access.
     /// Joint access.
     typeJointHash               mJoints;
     typeJointHash               mJoints;
     typeReverseJointHash        mReverseJoints;
     typeReverseJointHash        mReverseJoints;
-    U32                         mJointMasterId;
+    S32                         mJointMasterId;
 
 
     /// Scene controllers.
     /// Scene controllers.
     SimObjectPtr<SimSet>	    mControllers;
     SimObjectPtr<SimSet>	    mControllers;
@@ -352,15 +352,15 @@ public:
 
 
     /// Joint access.
     /// Joint access.
     inline U32              getJointCount( void ) const                 { return mJoints.size(); }
     inline U32              getJointCount( void ) const                 { return mJoints.size(); }
-    b2JointType             getJointType( const U32 jointId );
-    b2Joint*                findJoint( const U32 jointId );
-    U32                     findJointId( b2Joint* pJoint );
-    U32                     createJoint( b2JointDef* pJointDef );
+    b2JointType             getJointType( const S32 jointId );
+    b2Joint*                findJoint( const S32 jointId );
+    S32                     findJointId( b2Joint* pJoint );
+    S32                     createJoint( b2JointDef* pJointDef );
     bool                    deleteJoint( const U32 jointId );
     bool                    deleteJoint( const U32 jointId );
     bool                    hasJoints( SceneObject* pSceneObject );
     bool                    hasJoints( SceneObject* pSceneObject );
 
 
     /// Distance joint.
     /// Distance joint.
-    U32                     createDistanceJoint(
+    S32                     createDistanceJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const F32 length = -1.0f,
                                 const F32 length = -1.0f,
@@ -387,7 +387,7 @@ public:
     F32                     getDistanceJointDampingRatio( const U32 jointId );
     F32                     getDistanceJointDampingRatio( const U32 jointId );
 
 
     /// Rope joint.
     /// Rope joint.
-    U32                     createRopeJoint(
+    S32                     createRopeJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const F32 maxLength = -1.0f,
                                 const F32 maxLength = -1.0f,
@@ -400,7 +400,7 @@ public:
     F32                     getRopeJointMaxLength( const U32 jointId );
     F32                     getRopeJointMaxLength( const U32 jointId );
 
 
     /// Revolute joint.
     /// Revolute joint.
-    U32                     createRevoluteJoint(
+    S32                     createRevoluteJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const bool collideConnected = false );
                                 const bool collideConnected = false );
@@ -427,7 +427,7 @@ public:
                                 F32& motorSpeed,
                                 F32& motorSpeed,
                                 F32& maxMotorTorque );
                                 F32& maxMotorTorque );
     /// Weld joint.
     /// Weld joint.
-    U32                     createWeldJoint(
+    S32                     createWeldJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const F32 frequency = 0.0f,
                                 const F32 frequency = 0.0f,
@@ -447,7 +447,7 @@ public:
     F32                     getWeldJointDampingRatio( const U32 jointId );
     F32                     getWeldJointDampingRatio( const U32 jointId );
 
 
     /// Wheel joint.
     /// Wheel joint.
-    U32                     createWheelJoint(
+    S32                     createWheelJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
                                 const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
                                 const b2Vec2& worldAxis,
                                 const b2Vec2& worldAxis,
@@ -478,7 +478,7 @@ public:
     F32                     getWheelJointDampingRatio( const U32 jointId );
     F32                     getWheelJointDampingRatio( const U32 jointId );
 
 
     /// Friction joint.
     /// Friction joint.
-    U32                     createFrictionJoint(
+    S32                     createFrictionJoint(
                                 const SceneObject* pSceneObjectA,const  SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA,const  SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const b2Vec2& localAnchorA = b2Vec2_zero, const b2Vec2& localAnchorB = b2Vec2_zero,
                                 const F32 maxForce = 0.0f,
                                 const F32 maxForce = 0.0f,
@@ -498,7 +498,7 @@ public:
     F32                     getFrictionJointMaxTorque( const U32 jointId );
     F32                     getFrictionJointMaxTorque( const U32 jointId );
 
 
     /// Prismatic joint.
     /// Prismatic joint.
-    U32                     createPrismaticJoint(
+    S32                     createPrismaticJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
                                 const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
                                 const b2Vec2& worldAxis,
                                 const b2Vec2& worldAxis,
@@ -527,7 +527,7 @@ public:
                                 F32& maxMotorTorque );
                                 F32& maxMotorTorque );
 
 
     /// Pulley joint.
     /// Pulley joint.
-    U32                     createPulleyJoint(
+    S32                     createPulleyJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
                                 const b2Vec2& localAnchorA, const b2Vec2& localAnchorB,
                                 const b2Vec2& worldGroundAnchorA, const b2Vec2& worldGroundAnchorB,
                                 const b2Vec2& worldGroundAnchorA, const b2Vec2& worldGroundAnchorB,
@@ -536,7 +536,7 @@ public:
                                 const bool collideConnected = false );
                                 const bool collideConnected = false );
 
 
     /// Target (a.k.a Mouse) joint.
     /// Target (a.k.a Mouse) joint.
-    U32                     createTargetJoint(
+    S32                     createTargetJoint(
                                 const SceneObject* pSceneObject,
                                 const SceneObject* pSceneObject,
                                 const b2Vec2& worldTarget,
                                 const b2Vec2& worldTarget,
                                 const F32 maxForce,
                                 const F32 maxForce,
@@ -570,7 +570,7 @@ public:
     F32                     getTargetJointDampingRatio( const U32 jointId );
     F32                     getTargetJointDampingRatio( const U32 jointId );
 
 
     /// Motor Joint.
     /// Motor Joint.
-    U32                     createMotorJoint(
+    S32                     createMotorJoint(
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const SceneObject* pSceneObjectA, const SceneObject* pSceneObjectB,
                                 const b2Vec2 linearOffset = b2Vec2_zero,
                                 const b2Vec2 linearOffset = b2Vec2_zero,
                                 const F32 angularOffset = 0.0f,
                                 const F32 angularOffset = 0.0f,

+ 47 - 47
engine/source/2d/scene/Scene_ScriptBinding.h

@@ -319,7 +319,7 @@ ConsoleMethod(Scene, isJoint, bool, 3, 3,   "(int jointId) Gets whether the join
                                             "@return whether the joint Id is valid or not." )
                                             "@return whether the joint Id is valid or not." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi( argv[2] );
+    const S32 jointId = dAtoi( argv[2] );
 
 
     return object->findJoint( jointId ) != NULL;
     return object->findJoint( jointId ) != NULL;
 }                                                                  
 }                                                                  
@@ -332,7 +332,7 @@ ConsoleMethod(Scene, getJointType, const char*, 3, 3,   "(int jointId) Gets the
                                                                 "@return The type of joint of the specified joint Id." )
                                                                 "@return The type of joint of the specified joint Id." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi( argv[2] );
+    const S32 jointId = dAtoi( argv[2] );
 
 
     // Fetch joint type.
     // Fetch joint type.
     const b2JointType jointType = object->getJointType( jointId );
     const b2JointType jointType = object->getJointType( jointId );
@@ -351,7 +351,7 @@ ConsoleMethod(Scene, deleteJoint, bool, 3, 3,           "(int jointId) Deletes t
                                                                 "@return Whether the joint was successfully deleted or not." )
                                                                 "@return Whether the joint was successfully deleted or not." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi( argv[2] );
+    const S32 jointId = dAtoi( argv[2] );
 
 
     return object->deleteJoint( jointId );
     return object->deleteJoint( jointId );
 }
 }
@@ -490,7 +490,7 @@ ConsoleMethod(Scene, setDistanceJointLength, void, 4, 4,    "(jointId, length) S
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 length = dAtof(argv[3]);
     const F32 length = dAtof(argv[3]);
@@ -506,7 +506,7 @@ ConsoleMethod(Scene, getDistanceJointLength, F32, 3, 3,     "(jointId) Gets the
                                                                     "@return Returns the distance the joint should maintain between scene objects (-1 indicates error)." )
                                                                     "@return Returns the distance the joint should maintain between scene objects (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getDistanceJointLength( jointId );
     return object->getDistanceJointLength( jointId );
@@ -520,7 +520,7 @@ ConsoleMethod(Scene, setDistanceJointFrequency, void, 4, 4, "(jointId, frequency
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 frequency = dAtof(argv[3]);
     const F32 frequency = dAtof(argv[3]);
@@ -536,7 +536,7 @@ ConsoleMethod(Scene, getDistanceJointFrequency, F32, 3, 3,  "(jointId) Gets the
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getDistanceJointFrequency( jointId );
     return object->getDistanceJointFrequency( jointId );
@@ -550,7 +550,7 @@ ConsoleMethod(Scene, setDistanceJointDampingRatio, void, 4, 4,  "(jointId, dampi
                                                                         "@return Returns no value." )
                                                                         "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 dampingRatio = dAtof(argv[3]);
     const F32 dampingRatio = dAtof(argv[3]);
@@ -566,7 +566,7 @@ ConsoleMethod(Scene, getDistanceJointDampingRatio, F32, 3, 3,   "(jointId) Gets
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getDistanceJointDampingRatio( jointId );
     return object->getDistanceJointDampingRatio( jointId );
@@ -688,7 +688,7 @@ ConsoleMethod(Scene, setRopeJointMaxLength, void, 4, 4,     "(jointId, maxLength
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 maxLength = dAtof(argv[3]);
     const F32 maxLength = dAtof(argv[3]);
@@ -704,7 +704,7 @@ ConsoleMethod(Scene, getRopeJointMaxLength, F32, 3, 3,     "(jointId) Gets the m
                                                                     "@return Returns the maximum rigid length of the rope (-1 indicates error)." )
                                                                     "@return Returns the maximum rigid length of the rope (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getRopeJointMaxLength( jointId );
     return object->getRopeJointMaxLength( jointId );
@@ -819,7 +819,7 @@ ConsoleMethod(Scene, setRevoluteJointLimit, void, 4, 6,     "(jointId, enableLim
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const bool enableLimit = dAtob(argv[3]);
     const bool enableLimit = dAtob(argv[3]);
@@ -837,7 +837,7 @@ ConsoleMethod(Scene, getRevoluteJointLimit, const char*, 3, 3,  "(jointId) Gets
                                                                         "@return Returns whether the joint has angular limits or not and the limits themselves (empty string indicates error)." )
                                                                         "@return Returns whether the joint has angular limits or not and the limits themselves (empty string indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Args.
     // Args.
     bool enableLimit;
     bool enableLimit;
@@ -866,7 +866,7 @@ ConsoleMethod(Scene, setRevoluteJointMotor, void, 4, 6,     "(jointId, enableMot
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const bool enableMotor = dAtob(argv[3]);
     const bool enableMotor = dAtob(argv[3]);
@@ -884,7 +884,7 @@ ConsoleMethod(Scene, getRevoluteJointMotor, const char*, 3, 3,  "(jointId) Gets
                                                                         "@return Returns whether the joint has a motor or not and the motor settings (empty string indicates error)." )
                                                                         "@return Returns whether the joint has a motor or not and the motor settings (empty string indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Args.
     // Args.
     bool enableMotor;
     bool enableMotor;
@@ -1028,7 +1028,7 @@ ConsoleMethod(Scene, setWeldJointFrequency, void, 4, 4,     "(jointId, frequency
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 frequency = dAtof(argv[3]);
     const F32 frequency = dAtof(argv[3]);
@@ -1044,7 +1044,7 @@ ConsoleMethod(Scene, getWeldJointFrequency, F32, 3, 3,     "(jointId) Gets the m
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getWeldJointFrequency( jointId );
     return object->getWeldJointFrequency( jointId );
@@ -1058,7 +1058,7 @@ ConsoleMethod(Scene, setWeldJointDampingRatio, void, 4, 4,      "(jointId, dampi
                                                                         "@return Returns no value." )
                                                                         "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 dampingRatio = dAtof(argv[3]);
     const F32 dampingRatio = dAtof(argv[3]);
@@ -1074,7 +1074,7 @@ ConsoleMethod(Scene, getWeldJointDampingRatio, F32, 3, 3,       "(jointId) Gets
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getWeldJointDampingRatio( jointId );
     return object->getWeldJointDampingRatio( jointId );
@@ -1201,7 +1201,7 @@ ConsoleMethod(Scene, setWheelJointMotor, void, 4, 6,        "(jointId, enableMot
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const bool enableMotor = dAtob(argv[3]);
     const bool enableMotor = dAtob(argv[3]);
@@ -1219,7 +1219,7 @@ ConsoleMethod(Scene, getWheelJointMotor, const char*, 3, 3, "(jointId) Gets whet
                                                                     "@return Returns whether the joint has a motor or not and the motor settings (empty string indicates error)." )
                                                                     "@return Returns whether the joint has a motor or not and the motor settings (empty string indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Args.
     // Args.
     bool enableMotor;
     bool enableMotor;
@@ -1246,7 +1246,7 @@ ConsoleMethod(Scene, setWheelJointFrequency, void, 4, 4,    "(jointId, frequency
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 frequency = dAtof(argv[3]);
     const F32 frequency = dAtof(argv[3]);
@@ -1262,7 +1262,7 @@ ConsoleMethod(Scene, getWheelJointFrequency, F32, 3, 3,     "(jointId) Gets the
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getWheelJointFrequency( jointId );
     return object->getWheelJointFrequency( jointId );
@@ -1276,7 +1276,7 @@ ConsoleMethod(Scene, setWheelJointDampingRatio, void, 4, 4,     "(jointId, dampi
                                                                         "@return Returns no value." )
                                                                         "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 dampingRatio = dAtof(argv[3]);
     const F32 dampingRatio = dAtof(argv[3]);
@@ -1292,7 +1292,7 @@ ConsoleMethod(Scene, getWheelJointDampingRatio, F32, 3, 3,      "(jointId) Gets
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getWheelJointDampingRatio( jointId );
     return object->getWheelJointDampingRatio( jointId );
@@ -1418,7 +1418,7 @@ ConsoleMethod(Scene, setFrictionJointMaxForce, void, 4, 4,  "(jointId, maxForce)
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 maxForce = dAtof(argv[3]);
     const F32 maxForce = dAtof(argv[3]);
@@ -1434,7 +1434,7 @@ ConsoleMethod(Scene, getFrictionJointMaxForce, F32, 3, 3,   "(jointId) Sets the
                                                                     "@return Returns the maximum friction force (-1 indicates error)." )
                                                                     "@return Returns the maximum friction force (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getFrictionJointMaxForce( jointId );
     return object->getFrictionJointMaxForce( jointId );
@@ -1448,7 +1448,7 @@ ConsoleMethod(Scene, setFrictionJointMaxTorque, void, 4, 4, "(jointId, maxTorque
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 maxTorque = dAtof(argv[3]);
     const F32 maxTorque = dAtof(argv[3]);
@@ -1464,7 +1464,7 @@ ConsoleMethod(Scene, getFrictionJointMaxTorque, F32, 3, 3,  "(jointId) Gets the
                                                                     "@return Returns the maximum torque force (-1 indicates error)." )
                                                                     "@return Returns the maximum torque force (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getFrictionJointMaxTorque( jointId );
     return object->getFrictionJointMaxTorque( jointId );
@@ -1591,7 +1591,7 @@ ConsoleMethod(Scene, setPrismaticJointLimit, void, 4, 6,    "(jointId, enableLim
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const bool enableLimit = dAtob(argv[3]);
     const bool enableLimit = dAtob(argv[3]);
@@ -1608,7 +1608,7 @@ ConsoleMethod(Scene, getPrismaticJointLimit, const char*, 3, 3, "(jointId) Gets
                                                                         "@return Returns whether the joint has translational limits or not and the limits themselves (empty string indicates error)." )
                                                                         "@return Returns whether the joint has translational limits or not and the limits themselves (empty string indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Args.
     // Args.
     bool enableLimit;
     bool enableLimit;
@@ -1637,7 +1637,7 @@ ConsoleMethod(Scene, setPrismaticJointMotor, void, 4, 6,    "(jointId, enableMot
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const bool enableMotor = dAtob(argv[3]);
     const bool enableMotor = dAtob(argv[3]);
@@ -1654,7 +1654,7 @@ ConsoleMethod(Scene, getPrismaticJointMotor, const char*, 3, 3,    "(jointId) Ge
                                                                             "@return Returns whether the joint has a motor or not and the motor settings (empty string indicates error)." )
                                                                             "@return Returns whether the joint has a motor or not and the motor settings (empty string indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Args.
     // Args.
     bool enableMotor;
     bool enableMotor;
@@ -1902,7 +1902,7 @@ ConsoleMethod(Scene, setTargetJointTarget, void, 4, 5,      "(jointId, worldTarg
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // World target.
     // World target.
     const U32 worldTargetElementCount = Utility::mGetStringElementCount(argv[3]);
     const U32 worldTargetElementCount = Utility::mGetStringElementCount(argv[3]);
@@ -1934,7 +1934,7 @@ ConsoleMethod(Scene, getTargetJointTarget, const char*, 3, 3,   "(jointId) Gets
                                                                         "@return Returns the target world point for the scene object (always 0,0 if error)." )
                                                                         "@return Returns the target world point for the scene object (always 0,0 if error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     const Vector2 worldTarget = object->getTargetJointTarget( jointId );
     const Vector2 worldTarget = object->getTargetJointTarget( jointId );
@@ -1950,7 +1950,7 @@ ConsoleMethod(Scene, setTargetJointFrequency, void, 4, 4,   "(jointId, frequency
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 frequency = dAtof(argv[3]);
     const F32 frequency = dAtof(argv[3]);
@@ -1966,7 +1966,7 @@ ConsoleMethod(Scene, getTargetJointFrequency, F32, 3, 3,   "(jointId) Gets the m
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
                                                                     "@return Returns the mass-spring-damper frequency in Hertz (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getTargetJointFrequency( jointId );
     return object->getTargetJointFrequency( jointId );
@@ -1980,7 +1980,7 @@ ConsoleMethod(Scene, setTargetJointDampingRatio, void, 4, 4,    "(jointId, dampi
                                                                         "@return Returns no value." )
                                                                         "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 dampingRatio = dAtof(argv[3]);
     const F32 dampingRatio = dAtof(argv[3]);
@@ -1996,7 +1996,7 @@ ConsoleMethod(Scene, getTargetJointDampingRatio, F32, 3, 3,    "(jointId) Sets t
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
                                                                         "@return Returns the damping ratio (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getTargetJointDampingRatio( jointId );
     return object->getTargetJointDampingRatio( jointId );
@@ -2110,7 +2110,7 @@ ConsoleMethod(Scene, setMotorJointLinearOffset, void, 4, 5,     "(jointId, linea
                                                                         "@return Returns no value." )
                                                                         "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Linear offset.
     // Linear offset.
     const U32 linearOffsetElementCount = Utility::mGetStringElementCount(argv[3]);
     const U32 linearOffsetElementCount = Utility::mGetStringElementCount(argv[3]);
@@ -2142,7 +2142,7 @@ ConsoleMethod(Scene, getMotorJointLinearOffset, const char*, 3, 3,  "(jointId) G
                                                                             "@return Returns the linear offset in sceneObjectA space (always 0,0 if error)." )
                                                                             "@return Returns the linear offset in sceneObjectA space (always 0,0 if error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     const Vector2 linearOffset = object->getMotorJointLinearOffset( jointId );
     const Vector2 linearOffset = object->getMotorJointLinearOffset( jointId );
@@ -2158,7 +2158,7 @@ ConsoleMethod(Scene, setMotorJointAngularOffset, void, 4, 4,    "(jointId, angul
                                                                         "@return Returns no value." )
                                                                         "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 angularOffset = mDegToRad(dAtof(argv[3]));
     const F32 angularOffset = mDegToRad(dAtof(argv[3]));
@@ -2174,7 +2174,7 @@ ConsoleMethod(Scene, getMotorJointAngularOffset, F32, 3, 3,     "(jointId) Gets
                                                                         "@return Returns the angularOffset between the bodies (-1 indicates error)." )
                                                                         "@return Returns the angularOffset between the bodies (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return mRadToDeg( object->getMotorJointAngularOffset( jointId ) );
     return mRadToDeg( object->getMotorJointAngularOffset( jointId ) );
@@ -2188,7 +2188,7 @@ ConsoleMethod(Scene, setMotorJointMaxForce, void, 4, 4,     "(jointId, maxForce)
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 maxForce = dAtof(argv[3]);
     const F32 maxForce = dAtof(argv[3]);
@@ -2204,7 +2204,7 @@ ConsoleMethod(Scene, getMotorJointMaxForce, F32, 3, 3,   "(jointId) Sets the max
                                                                     "@return Returns the maximum motor force (-1 indicates error)." )
                                                                     "@return Returns the maximum motor force (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getMotorJointMaxForce( jointId );
     return object->getMotorJointMaxForce( jointId );
@@ -2218,7 +2218,7 @@ ConsoleMethod(Scene, setMotorJointMaxTorque, void, 4, 4, "(jointId, maxTorque) S
                                                                     "@return Returns no value." )
                                                                     "@return Returns no value." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Fetch args.
     // Fetch args.
     const F32 maxTorque = dAtof(argv[3]);
     const F32 maxTorque = dAtof(argv[3]);
@@ -2234,7 +2234,7 @@ ConsoleMethod(Scene, getMotorJointMaxTorque, F32, 3, 3,  "(jointId) Gets the max
                                                                     "@return Returns the maximum motor torque force (-1 indicates error)." )
                                                                     "@return Returns the maximum motor torque force (-1 indicates error)." )
 {
 {
     // Fetch joint Id.
     // Fetch joint Id.
-    const U32 jointId = dAtoi(argv[2]);
+    const S32 jointId = dAtoi(argv[2]);
 
 
     // Access joint.
     // Access joint.
     return object->getMotorJointMaxTorque( jointId );
     return object->getMotorJointMaxTorque( jointId );