mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
rigid body on rigid body reactions
This commit is contained in:
parent
d8f889f840
commit
6a930f3da1
3 changed files with 10 additions and 4 deletions
|
|
@ -1230,8 +1230,15 @@ bool RigidShape::resolveCollision(Rigid& ns,CollisionList& cList)
|
||||||
|
|
||||||
// Apply impulses to the rigid body to keep it from
|
// Apply impulses to the rigid body to keep it from
|
||||||
// penetrating the surface.
|
// penetrating the surface.
|
||||||
ns.resolveCollision(cList[i].point,
|
if (c.object->getTypeMask() & VehicleObjectType)
|
||||||
cList[i].normal);
|
{
|
||||||
|
RigidShape* otherRigid = dynamic_cast<RigidShape*>(c.object);
|
||||||
|
if (otherRigid)
|
||||||
|
ns.resolveCollision(cList[i].point, cList[i].normal, &otherRigid->mRigid);
|
||||||
|
else
|
||||||
|
ns.resolveCollision(cList[i].point, cList[i].normal);
|
||||||
|
}
|
||||||
|
else ns.resolveCollision(cList[i].point, cList[i].normal);
|
||||||
collided = true;
|
collided = true;
|
||||||
|
|
||||||
// Keep track of objects we collide with
|
// Keep track of objects we collide with
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,6 @@ class RigidShape: public ShapeBase
|
||||||
|
|
||||||
CollisionList mCollisionList;
|
CollisionList mCollisionList;
|
||||||
CollisionList mContacts;
|
CollisionList mContacts;
|
||||||
Rigid mRigid;
|
|
||||||
ShapeBaseConvex mConvex;
|
ShapeBaseConvex mConvex;
|
||||||
S32 restCount;
|
S32 restCount;
|
||||||
|
|
||||||
|
|
@ -233,6 +232,7 @@ class RigidShape: public ShapeBase
|
||||||
public:
|
public:
|
||||||
// Test code...
|
// Test code...
|
||||||
static ClippedPolyList* sPolyList;
|
static ClippedPolyList* sPolyList;
|
||||||
|
Rigid mRigid;
|
||||||
|
|
||||||
//
|
//
|
||||||
RigidShape();
|
RigidShape();
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,6 @@ class Vehicle : public RigidShape
|
||||||
|
|
||||||
CollisionList mCollisionList;
|
CollisionList mCollisionList;
|
||||||
CollisionList mContacts;
|
CollisionList mContacts;
|
||||||
Rigid mRigid;
|
|
||||||
ShapeBaseConvex mConvex;
|
ShapeBaseConvex mConvex;
|
||||||
S32 restCount;
|
S32 restCount;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue