Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2016-01-17 23:35:32 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2016-01-26 00:14:46 +0300
commitb64d5809e7e3b832e2a011869db68e70b4b4e6fc (patch)
treeaa4f6714da9f546eeee7dffed9236f9c8309524b /extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
parent3c72e302e1eb25de43dd9d077f0c730cc02b5674 (diff)
Upgrade Bullet to version 2.83.
I tried to carefully preserve all patches since the last upgrade. Improves T47195, cloth collision detection bug. Differential Revision: https://developer.blender.org/D1739
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
index 89cad168210..c68402418f7 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
@@ -92,11 +92,10 @@ protected:
int m_internalType;
///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
- union
- {
- void* m_userObjectPointer;
- int m_userIndex;
- };
+
+ void* m_userObjectPointer;
+
+ int m_userIndex;
///time of impact calculation
btScalar m_hitFraction;
@@ -110,13 +109,11 @@ protected:
/// If some object should have elaborate collision filtering by sub-classes
int m_checkCollideWith;
+ btAlignedObjectArray<const btCollisionObject*> m_objectsWithoutCollisionCheck;
+
///internal update revision number. It will be increased when the object changes. This allows some subsystems to perform lazy evaluation.
int m_updateRevision;
- virtual bool checkCollideWithOverride(const btCollisionObject* /* co */) const
- {
- return true;
- }
public:
@@ -225,7 +222,34 @@ public:
return m_collisionShape;
}
-
+ void setIgnoreCollisionCheck(const btCollisionObject* co, bool ignoreCollisionCheck)
+ {
+ if (ignoreCollisionCheck)
+ {
+ //We don't check for duplicates. Is it ok to leave that up to the user of this API?
+ //int index = m_objectsWithoutCollisionCheck.findLinearSearch(co);
+ //if (index == m_objectsWithoutCollisionCheck.size())
+ //{
+ m_objectsWithoutCollisionCheck.push_back(co);
+ //}
+ }
+ else
+ {
+ m_objectsWithoutCollisionCheck.remove(co);
+ }
+ m_checkCollideWith = m_objectsWithoutCollisionCheck.size() > 0;
+ }
+
+ virtual bool checkCollideWithOverride(const btCollisionObject* co) const
+ {
+ int index = m_objectsWithoutCollisionCheck.findLinearSearch(co);
+ if (index < m_objectsWithoutCollisionCheck.size())
+ {
+ return false;
+ }
+ return true;
+ }
+