Fix issue
This commit is contained in:
parent
7f219dd99c
commit
0126677808
|
@ -101,19 +101,13 @@ class ContactManifold {
|
|||
/// True if the contact manifold has already been added into an island
|
||||
bool isAlreadyInIsland;
|
||||
|
||||
/// Index of the first body of the manifold in the mRigidBodyComponents array (only if body 1 is a RigidBody)
|
||||
uint32 rigidBody1Index;
|
||||
|
||||
/// Index of the second body of the manifold in the mRigidBodyComponents array (only if body 2 is a RigidBody)
|
||||
uint32 rigidBody2Index;
|
||||
|
||||
public:
|
||||
|
||||
// -------------------- Methods -------------------- //
|
||||
|
||||
/// Constructor
|
||||
ContactManifold(Entity bodyEntity1, Entity bodyEntity2, Entity colliderEntity1, Entity colliderEntity2,
|
||||
uint contactPointsIndex, uint8 nbContactPoints, uint32 rigidBody1Index, uint32 rigidBody2Index);
|
||||
uint contactPointsIndex, uint8 nbContactPoints);
|
||||
|
||||
// -------------------- Friendship -------------------- //
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ using namespace reactphysics3d;
|
|||
|
||||
// Constructor
|
||||
ContactManifold::ContactManifold(Entity bodyEntity1, Entity bodyEntity2, Entity colliderEntity1, Entity colliderEntity2,
|
||||
uint contactPointsIndex, uint8 nbContactPoints, uint32 rigidBody1Index, uint32 rigidBody2Index)
|
||||
uint contactPointsIndex, uint8 nbContactPoints)
|
||||
:contactPointsIndex(contactPointsIndex), bodyEntity1(bodyEntity1), bodyEntity2(bodyEntity2),
|
||||
colliderEntity1(colliderEntity1), colliderEntity2(colliderEntity2), nbContactPoints(nbContactPoints), frictionImpulse1(0), frictionImpulse2(0),
|
||||
frictionTwistImpulse(0), isAlreadyInIsland(false), rigidBody1Index(rigidBody1Index), rigidBody2Index(rigidBody2Index) {
|
||||
frictionTwistImpulse(0), isAlreadyInIsland(false) {
|
||||
|
||||
}
|
||||
|
|
|
@ -732,12 +732,10 @@ void CollisionDetectionSystem::createContacts() {
|
|||
contactPair.contactPointsIndex = mCurrentContactPoints->size();
|
||||
|
||||
// Add the associated contact pair to both bodies of the pair (used to create islands later)
|
||||
uint32 rigidBody1Index = 0;
|
||||
uint32 rigidBody2Index = 0;
|
||||
if (mRigidBodyComponents.hasComponentGetIndex(contactPair.body1Entity, rigidBody1Index)) {
|
||||
if (mRigidBodyComponents.hasComponent(contactPair.body1Entity)) {
|
||||
mRigidBodyComponents.addContacPair(contactPair.body1Entity, p);
|
||||
}
|
||||
if (mRigidBodyComponents.hasComponentGetIndex(contactPair.body2Entity, rigidBody2Index)) {
|
||||
if (mRigidBodyComponents.hasComponent(contactPair.body2Entity)) {
|
||||
mRigidBodyComponents.addContacPair(contactPair.body2Entity, p);
|
||||
}
|
||||
|
||||
|
@ -753,7 +751,7 @@ void CollisionDetectionSystem::createContacts() {
|
|||
|
||||
// Create and add the contact manifold
|
||||
mCurrentContactManifolds->emplace(contactPair.body1Entity, contactPair.body2Entity, contactPair.collider1Entity,
|
||||
contactPair.collider2Entity, contactPointsIndex, nbContactPoints, rigidBody1Index, rigidBody2Index);
|
||||
contactPair.collider2Entity, contactPointsIndex, nbContactPoints);
|
||||
|
||||
assert(potentialManifold.nbPotentialContactPoints > 0);
|
||||
|
||||
|
@ -837,7 +835,7 @@ void CollisionDetectionSystem::createSnapshotContacts(List<ContactPair>& contact
|
|||
|
||||
// Create and add the contact manifold
|
||||
contactManifolds.emplace(contactPair.body1Entity, contactPair.body2Entity, contactPair.collider1Entity,
|
||||
contactPair.collider2Entity, contactPointsIndex, nbContactPoints, 0, 0);
|
||||
contactPair.collider2Entity, contactPointsIndex, nbContactPoints);
|
||||
|
||||
assert(potentialManifold.nbPotentialContactPoints > 0);
|
||||
|
||||
|
|
|
@ -127,8 +127,8 @@ void ContactSolverSystem::initializeForIsland(uint islandIndex) {
|
|||
|
||||
assert(externalManifold.nbContactPoints > 0);
|
||||
|
||||
const uint rigidBodyIndex1 = externalManifold.rigidBody1Index;
|
||||
const uint rigidBodyIndex2 = externalManifold.rigidBody2Index;
|
||||
const uint rigidBodyIndex1 = mRigidBodyComponents.getEntityIndex(externalManifold.bodyEntity1);
|
||||
const uint rigidBodyIndex2 = mRigidBodyComponents.getEntityIndex(externalManifold.bodyEntity2);
|
||||
|
||||
// Get the two bodies of the contact
|
||||
assert(body1 != nullptr);
|
||||
|
|
Loading…
Reference in New Issue
Block a user