Remove unused cachedCollisionData variable
This commit is contained in:
parent
f403a6e804
commit
f09331c185
|
@ -169,8 +169,7 @@ void CollisionDetection::computeMiddlePhase() {
|
|||
mNarrowPhaseInfoList = new (mSingleFrameAllocator.allocate(sizeof(NarrowPhaseInfo)))
|
||||
NarrowPhaseInfo(pair, shape1->getCollisionShape(),
|
||||
shape2->getCollisionShape(), shape1->getLocalToWorldTransform(),
|
||||
shape2->getLocalToWorldTransform(), shape1->getCachedCollisionData(),
|
||||
shape2->getCachedCollisionData(), mSingleFrameAllocator);
|
||||
shape2->getLocalToWorldTransform(), mSingleFrameAllocator);
|
||||
mNarrowPhaseInfoList->next = firstNarrowPhaseInfo;
|
||||
|
||||
}
|
||||
|
@ -488,8 +487,7 @@ NarrowPhaseInfo* CollisionDetection::computeMiddlePhaseForProxyShapes(Overlappin
|
|||
// for the narrow-phase collision detection
|
||||
narrowPhaseInfo = new (mPoolAllocator.allocate(sizeof(NarrowPhaseInfo))) NarrowPhaseInfo(pair, shape1->getCollisionShape(),
|
||||
shape2->getCollisionShape(), shape1->getLocalToWorldTransform(),
|
||||
shape2->getLocalToWorldTransform(), shape1->getCachedCollisionData(),
|
||||
shape2->getCachedCollisionData(), mPoolAllocator);
|
||||
shape2->getLocalToWorldTransform(), mPoolAllocator);
|
||||
|
||||
}
|
||||
// Concave vs Convex algorithm
|
||||
|
|
|
@ -55,7 +55,6 @@ void MiddlePhaseTriangleCallback::testTriangle(const Vector3* trianglePoints, co
|
|||
isShape1Convex ? triangleShape : mConvexProxyShape->getCollisionShape(),
|
||||
shape1->getLocalToWorldTransform(),
|
||||
shape2->getLocalToWorldTransform(),
|
||||
shape1->getCachedCollisionData(),
|
||||
shape2->getCachedCollisionData(), mAllocator);
|
||||
mAllocator);
|
||||
narrowPhaseInfoList->next = firstNarrowPhaseInfo;
|
||||
}
|
||||
|
|
|
@ -35,12 +35,10 @@ using namespace reactphysics3d;
|
|||
// Constructor
|
||||
NarrowPhaseInfo::NarrowPhaseInfo(OverlappingPair* pair, CollisionShape* shape1,
|
||||
CollisionShape* shape2, const Transform& shape1Transform,
|
||||
const Transform& shape2Transform, void** cachedData1, void** cachedData2,
|
||||
Allocator& shapeAllocator)
|
||||
const Transform& shape2Transform, Allocator& shapeAllocator)
|
||||
: overlappingPair(pair), collisionShape1(shape1), collisionShape2(shape2),
|
||||
shape1ToWorldTransform(shape1Transform), shape2ToWorldTransform(shape2Transform),
|
||||
contactPoints(nullptr), cachedCollisionData1(cachedData1),
|
||||
cachedCollisionData2(cachedData2), next(nullptr), collisionShapeAllocator(shapeAllocator) {
|
||||
contactPoints(nullptr), next(nullptr), collisionShapeAllocator(shapeAllocator) {
|
||||
|
||||
// Add a collision info for the two collision shapes into the overlapping pair (if not present yet)
|
||||
overlappingPair->addLastFrameInfoIfNecessary(shape1->getId(), shape2->getId());
|
||||
|
|
|
@ -63,14 +63,6 @@ struct NarrowPhaseInfo {
|
|||
/// Linked-list of contact points created during the narrow-phase
|
||||
ContactPointInfo* contactPoints;
|
||||
|
||||
/// Cached collision data of the proxy shape
|
||||
// TODO : Check if we can use separating axis in OverlappingPair instead of cachedCollisionData1 and cachedCollisionData2
|
||||
void** cachedCollisionData1;
|
||||
|
||||
/// Cached collision data of the proxy shape
|
||||
// TODO : Check if we can use separating axis in OverlappingPair instead of cachedCollisionData1 and cachedCollisionData2
|
||||
void** cachedCollisionData2;
|
||||
|
||||
/// Pointer to the next element in the linked list
|
||||
NarrowPhaseInfo* next;
|
||||
|
||||
|
@ -80,7 +72,7 @@ struct NarrowPhaseInfo {
|
|||
/// Constructor
|
||||
NarrowPhaseInfo(OverlappingPair* pair, CollisionShape* shape1,
|
||||
CollisionShape* shape2, const Transform& shape1Transform,
|
||||
const Transform& shape2Transform, void** cachedData1, void** cachedData2, Allocator& shapeAllocator);
|
||||
const Transform& shape2Transform, Allocator& shapeAllocator);
|
||||
|
||||
/// Destructor
|
||||
~NarrowPhaseInfo();
|
||||
|
|
|
@ -37,18 +37,13 @@ using namespace reactphysics3d;
|
|||
*/
|
||||
ProxyShape::ProxyShape(CollisionBody* body, CollisionShape* shape, const Transform& transform, decimal mass)
|
||||
:mBody(body), mCollisionShape(shape), mLocalToBodyTransform(transform), mMass(mass),
|
||||
mNext(nullptr), mBroadPhaseID(-1), mCachedCollisionData(nullptr), mUserData(nullptr),
|
||||
mCollisionCategoryBits(0x0001), mCollideWithMaskBits(0xFFFF) {
|
||||
mNext(nullptr), mBroadPhaseID(-1), mCollisionCategoryBits(0x0001), mCollideWithMaskBits(0xFFFF) {
|
||||
|
||||
}
|
||||
|
||||
// Destructor
|
||||
ProxyShape::~ProxyShape() {
|
||||
|
||||
// Release the cached collision data memory
|
||||
if (mCachedCollisionData != nullptr) {
|
||||
free(mCachedCollisionData);
|
||||
}
|
||||
}
|
||||
|
||||
// Return true if a point is inside the collision shape
|
||||
|
|
|
@ -66,9 +66,6 @@ class ProxyShape {
|
|||
/// Broad-phase ID (node ID in the dynamic AABB tree)
|
||||
int mBroadPhaseID;
|
||||
|
||||
/// Cached collision data
|
||||
void* mCachedCollisionData;
|
||||
|
||||
/// Pointer to user data
|
||||
void* mUserData;
|
||||
|
||||
|
@ -168,9 +165,6 @@ class ProxyShape {
|
|||
/// Return the next proxy shape in the linked list of proxy shapes
|
||||
const ProxyShape* getNext() const;
|
||||
|
||||
/// Return the pointer to the cached collision data
|
||||
void** getCachedCollisionData();
|
||||
|
||||
/// Return the local scaling vector of the collision shape
|
||||
Vector3 getLocalScaling() const;
|
||||
|
||||
|
@ -201,11 +195,6 @@ class ProxyShape {
|
|||
|
||||
};
|
||||
|
||||
// Return the pointer to the cached collision data
|
||||
inline void** ProxyShape::getCachedCollisionData() {
|
||||
return &mCachedCollisionData;
|
||||
}
|
||||
|
||||
// Return the collision shape
|
||||
/**
|
||||
* @return Pointer to the internal collision shape
|
||||
|
|
Loading…
Reference in New Issue
Block a user