some minor comment-renames, and moved some data from box/sphere into common convex.
This commit is contained in:
@@ -181,7 +181,7 @@ bool SimulationIsland::Simulate(btIDebugDraw* debugDrawer,int numSolverIteration
|
||||
}
|
||||
*/
|
||||
|
||||
//OverlappingPairCache* scene = getCollisionWorld()->getPairCache();
|
||||
//btOverlappingPairCache* scene = getCollisionWorld()->getPairCache();
|
||||
|
||||
btContactSolverInfo solverInfo;
|
||||
|
||||
@@ -449,10 +449,13 @@ void SimulationIsland::UpdateAabbs(btIDebugDraw* debugDrawer,btBroadphaseInterfa
|
||||
if (reportMe)
|
||||
{
|
||||
reportMe = false;
|
||||
assert(0);
|
||||
/*
|
||||
printf("Overflow in AABB, object removed from simulation \n");
|
||||
printf("If you can reproduce this, please email bugs@continuousphysics.com\n");
|
||||
printf("Please include above information, your Platform, version of OS.\n");
|
||||
printf("Thanks.\n");
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ CONCAVE_SHAPES_END_HERE,
|
||||
};
|
||||
|
||||
|
||||
///BroadphaseProxy
|
||||
///btBroadphaseProxy
|
||||
struct btBroadphaseProxy
|
||||
{
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ struct btCollisionAlgorithmConstructionInfo
|
||||
};
|
||||
|
||||
|
||||
///CollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher.
|
||||
///btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher.
|
||||
///It is persistent over frames
|
||||
class btCollisionAlgorithm
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ virtual ~btOverlapCallback()
|
||||
virtual bool processOverlap(btBroadphasePair& pair) = 0;
|
||||
};
|
||||
|
||||
///OverlappingPairCache maintains the objects with overlapping AABB
|
||||
///btOverlappingPairCache maintains the objects with overlapping AABB
|
||||
///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase
|
||||
class btOverlappingPairCache : public btBroadphaseInterface
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ class btOverlappingPairCache;
|
||||
|
||||
|
||||
|
||||
///CollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.
|
||||
///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.
|
||||
///Time of Impact, Closest Points and Penetration Depth.
|
||||
class btCollisionDispatcher : public btDispatcher
|
||||
{
|
||||
|
||||
@@ -27,7 +27,7 @@ extern ContactAddedCallback gContactAddedCallback;
|
||||
|
||||
|
||||
|
||||
///ManifoldResult is a helper class to manage contact results.
|
||||
///btManifoldResult is a helper class to manage contact results.
|
||||
class btManifoldResult : public btDiscreteCollisionDetectorInterface::Result
|
||||
{
|
||||
btPersistentManifold* m_manifoldPtr;
|
||||
|
||||
@@ -17,7 +17,7 @@ subject to the following restrictions:
|
||||
|
||||
btVector3 btBoxShape::getHalfExtents() const
|
||||
{
|
||||
return m_boxHalfExtents1 * m_localScaling;
|
||||
return m_implicitShapeDimensions * m_localScaling;
|
||||
}
|
||||
//{
|
||||
|
||||
|
||||
@@ -22,20 +22,16 @@ subject to the following restrictions:
|
||||
#include "LinearMath/btPoint3.h"
|
||||
#include "LinearMath/btSimdMinMax.h"
|
||||
|
||||
///BoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box
|
||||
///btBoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box
|
||||
class btBoxShape: public btPolyhedralConvexShape
|
||||
{
|
||||
|
||||
btVector3 m_boxHalfExtents1;
|
||||
//btVector3 m_boxHalfExtents1; //use m_implicitShapeDimensions instead
|
||||
|
||||
|
||||
public:
|
||||
|
||||
btVector3 getHalfExtents() const;
|
||||
//{ return m_boxHalfExtents1 * m_localScaling;}
|
||||
//const btVector3& getHalfExtents() const{ return m_boxHalfExtents1;}
|
||||
|
||||
|
||||
|
||||
virtual int getShapeType() const { return BOX_SHAPE_PROXYTYPE;}
|
||||
|
||||
@@ -81,7 +77,10 @@ public:
|
||||
}
|
||||
|
||||
|
||||
btBoxShape( const btVector3& boxHalfExtents) : m_boxHalfExtents1(boxHalfExtents){};
|
||||
btBoxShape( const btVector3& boxHalfExtents)
|
||||
{
|
||||
m_implicitShapeDimensions = boxHalfExtents;
|
||||
};
|
||||
|
||||
virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const;
|
||||
|
||||
|
||||
@@ -33,6 +33,16 @@ struct btConvexCastResult;
|
||||
/// used in combination with GJK or btConvexCast
|
||||
class btConvexShape : public btCollisionShape
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
//local scaling. collisionMargin is not scaled !
|
||||
btVector3 m_localScaling;
|
||||
|
||||
btVector3 m_implicitShapeDimensions;
|
||||
|
||||
btScalar m_collisionMargin;
|
||||
|
||||
public:
|
||||
btConvexShape();
|
||||
|
||||
@@ -42,7 +52,10 @@ public:
|
||||
//notice that the vectors should be unit length
|
||||
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const= 0;
|
||||
|
||||
// testing for hullnode code
|
||||
const btVector3& getImplicitShapeDimensions() const
|
||||
{
|
||||
return m_implicitShapeDimensions;
|
||||
}
|
||||
|
||||
///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
|
||||
void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
|
||||
@@ -70,11 +83,7 @@ public:
|
||||
{
|
||||
return m_collisionMargin;
|
||||
}
|
||||
private:
|
||||
btScalar m_collisionMargin;
|
||||
//local scaling. collisionMargin is not scaled !
|
||||
protected:
|
||||
btVector3 m_localScaling;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ subject to the following restrictions:
|
||||
|
||||
#define MAX_NUM_SPHERES 5
|
||||
|
||||
///MultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex)
|
||||
///btMultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex)
|
||||
class btMultiSphereShape : public btConvexShape
|
||||
|
||||
{
|
||||
|
||||
@@ -20,8 +20,8 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
btSphereShape ::btSphereShape (btScalar radius)
|
||||
: m_radius(radius)
|
||||
{
|
||||
m_implicitShapeDimensions.setX(radius);
|
||||
}
|
||||
|
||||
btVector3 btSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
|
||||
|
||||
@@ -19,11 +19,10 @@ subject to the following restrictions:
|
||||
#include "btConvexShape.h"
|
||||
#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types
|
||||
|
||||
///SphereShape implements an implicit (getSupportingVertex) Sphere
|
||||
///btSphereShape implements an implicit (getSupportingVertex) Sphere
|
||||
class btSphereShape : public btConvexShape
|
||||
|
||||
{
|
||||
btScalar m_radius;
|
||||
|
||||
public:
|
||||
btSphereShape (btScalar radius);
|
||||
@@ -41,7 +40,7 @@ public:
|
||||
|
||||
virtual int getShapeType() const { return SPHERE_SHAPE_PROXYTYPE; }
|
||||
|
||||
btScalar getRadius() const { return m_radius;}
|
||||
btScalar getRadius() const { return m_implicitShapeDimensions.getX();}
|
||||
|
||||
//debugging
|
||||
virtual char* getName()const {return "SPHERE";}
|
||||
@@ -54,7 +53,7 @@ public:
|
||||
{
|
||||
//to improve gjk behaviour, use radius+margin as the full margin, so never get into the penetration case
|
||||
//this means, non-uniform scaling is not supported anymore
|
||||
return m_localScaling[0] * m_radius + btConvexShape::getMargin();
|
||||
return m_localScaling.getX() * getRadius() + btConvexShape::getMargin();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ extern ContactDestroyedCallback gContactDestroyedCallback;
|
||||
|
||||
#define MANIFOLD_CACHE_SIZE 4
|
||||
|
||||
///PersistentManifold maintains contact points, and reduces them to 4.
|
||||
///btPersistentManifold maintains contact points, and reduces them to 4.
|
||||
///It does contact filtering/contact reduction.
|
||||
class btPersistentManifold
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user