Removed bullet headers. They are part of the system.
Removed bullet headers. They are part of the system.

--- a/source/bheaders/.svn/all-wcprops
+++ /dev/null
@@ -1,6 +1,1 @@
-K 25
-svn:wc:ra_dav:version-url
-V 52
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders
-END
 

--- a/source/bheaders/.svn/entries
+++ /dev/null
@@ -1,32 +1,1 @@
-10
 
-dir
-43
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet/trunk/source/bheaders
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet
-
-
-
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-d286d458-e9d7-44e5-8155-503c4d2c87dc
-
-Bullet
-dir
-
-

--- a/source/bheaders/Bullet/.svn/all-wcprops
+++ /dev/null
@@ -1,24 +1,1 @@
-K 25
-svn:wc:ra_dav:version-url
-V 59
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet
-END
-Bullet-C-Api.h
-K 25
-svn:wc:ra_dav:version-url
-V 74
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/Bullet-C-Api.h
-END
-btBulletDynamicsCommon.h
-K 25
-svn:wc:ra_dav:version-url
-V 84
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/btBulletDynamicsCommon.h
-END
-btBulletCollisionCommon.h
-K 25
-svn:wc:ra_dav:version-url
-V 85
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/btBulletCollisionCommon.h
-END
 

--- a/source/bheaders/Bullet/.svn/entries
+++ /dev/null
@@ -1,155 +1,1 @@
-10
 
-dir
-43
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet/trunk/source/bheaders/Bullet
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet
-
-
-
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-d286d458-e9d7-44e5-8155-503c4d2c87dc
-
-BulletDynamics
-dir
-
-BulletSoftBody
-dir
-
-BulletCollision
-dir
-
-BulletMultiThreaded
-dir
-
-LinearMath
-dir
-
-Bullet-C-Api.h
-file
-
-
-
-
-2011-02-26T06:26:37.000000Z
-8e3c0696d8d7cad8a1eea59b63703e92
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-7396
-
-btBulletDynamicsCommon.h
-file
-
-
-
-
-2011-02-26T06:26:37.000000Z
-498218dae1799f29ced9bdc71a3abc63
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2198
-
-btBulletCollisionCommon.h
-file
-
-
-
-
-2011-02-26T06:26:37.000000Z
-c3548a56d11709dce4c22d5b01e17d00
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3453
-
-ibmsdk
-dir
-
-MiniCL
-dir
-
-vectormath
-dir
-
-

--- a/source/bheaders/Bullet/.svn/text-base/Bullet-C-Api.h.svn-base
+++ /dev/null
@@ -1,177 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-/*

-	Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's.

-	Work in progress, functionality will be added on demand.

-

-	If possible, use the richer Bullet C++ API, by including "btBulletDynamicsCommon.h"

-*/

-

-#ifndef BULLET_C_API_H

-#define BULLET_C_API_H

-

-#define PL_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name

-

-#ifdef BT_USE_DOUBLE_PRECISION

-typedef double	plReal;

-#else

-typedef float	plReal;

-#endif

-

-typedef plReal	plVector3[3];

-typedef plReal	plQuaternion[4];

-

-#ifdef __cplusplus

-extern "C" { 

-#endif

-

-/**	Particular physics SDK (C-API) */

-	PL_DECLARE_HANDLE(plPhysicsSdkHandle);

-

-/** 	Dynamics world, belonging to some physics SDK (C-API)*/

-	PL_DECLARE_HANDLE(plDynamicsWorldHandle);

-

-/** Rigid Body that can be part of a Dynamics World (C-API)*/	

-	PL_DECLARE_HANDLE(plRigidBodyHandle);

-

-/** 	Collision Shape/Geometry, property of a Rigid Body (C-API)*/

-	PL_DECLARE_HANDLE(plCollisionShapeHandle);

-

-/** Constraint for Rigid Bodies (C-API)*/

-	PL_DECLARE_HANDLE(plConstraintHandle);

-

-/** Triangle Mesh interface (C-API)*/

-	PL_DECLARE_HANDLE(plMeshInterfaceHandle);

-

-/** Broadphase Scene/Proxy Handles (C-API)*/

-	PL_DECLARE_HANDLE(plCollisionBroadphaseHandle);

-	PL_DECLARE_HANDLE(plBroadphaseProxyHandle);

-	PL_DECLARE_HANDLE(plCollisionWorldHandle);

-

-/**

-	Create and Delete a Physics SDK	

-*/

-

-	extern	plPhysicsSdkHandle	plNewBulletSdk(); //this could be also another sdk, like ODE, PhysX etc.

-	extern	void		plDeletePhysicsSdk(plPhysicsSdkHandle	physicsSdk);

-

-/** Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */

-

-	typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2);

-

-	extern plCollisionBroadphaseHandle	plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback);

-

-	extern void	plDestroyBroadphase(plCollisionBroadphaseHandle bp);

-

-	extern 	plBroadphaseProxyHandle plCreateProxy(plCollisionBroadphaseHandle bp, void* clientData, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);

-

-	extern void plDestroyProxy(plCollisionBroadphaseHandle bp, plBroadphaseProxyHandle proxyHandle);

-

-	extern void plSetBoundingBox(plBroadphaseProxyHandle proxyHandle, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);

-

-/* todo: add pair cache support with queries like add/remove/find pair */

-	

-	extern plCollisionWorldHandle plCreateCollisionWorld(plPhysicsSdkHandle physicsSdk);

-

-/* todo: add/remove objects */

-	

-

-/* Dynamics World */

-

-	extern  plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdk);

-

-	extern  void           plDeleteDynamicsWorld(plDynamicsWorldHandle world);

-

-	extern	void	plStepSimulation(plDynamicsWorldHandle,	plReal	timeStep);

-

-	extern  void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);

-

-	extern  void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);

-

-

-/* Rigid Body  */

-

-	extern  plRigidBodyHandle plCreateRigidBody(	void* user_data,  float mass, plCollisionShapeHandle cshape );

-

-	extern  void plDeleteRigidBody(plRigidBodyHandle body);

-

-

-/* Collision Shape definition */

-

-	extern  plCollisionShapeHandle plNewSphereShape(plReal radius);

-	extern  plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z);

-	extern  plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height);	

-	extern  plCollisionShapeHandle plNewConeShape(plReal radius, plReal height);

-	extern  plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height);

-	extern	plCollisionShapeHandle plNewCompoundShape();

-	extern	void	plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn);

-

-	extern  void plDeleteShape(plCollisionShapeHandle shape);

-

-	/* Convex Meshes */

-	extern  plCollisionShapeHandle plNewConvexHullShape();

-	extern  void		plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z);

-/* Concave static triangle meshes */

-	extern  plMeshInterfaceHandle		   plNewMeshInterface();

-	extern  void		plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);

-	extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);

-

-	extern  void plSetScaling(plCollisionShapeHandle shape, plVector3 scaling);

-

-/* SOLID has Response Callback/Table/Management */

-/* PhysX has Triggers, User Callbacks and filtering */

-/* ODE has the typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2); */

-

-/*	typedef void plUpdatedPositionCallback(void* userData, plRigidBodyHandle	rbHandle, plVector3 pos); */

-/*	typedef void plUpdatedOrientationCallback(void* userData, plRigidBodyHandle	rbHandle, plQuaternion orientation); */

-

-	/* get world transform */

-	extern void	plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);

-	extern void	plGetPosition(plRigidBodyHandle object,plVector3 position);

-	extern void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation);

-

-	/* set world transform (position/orientation) */

-	extern  void plSetPosition(plRigidBodyHandle object, const plVector3 position);

-	extern  void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation);

-	extern	void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient);

-	extern	void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);

-

-	typedef struct plRayCastResult {

-		plRigidBodyHandle		m_body;  

-		plCollisionShapeHandle	m_shape; 		

-		plVector3				m_positionWorld; 		

-		plVector3				m_normalWorld;

-	} plRayCastResult;

-

-	extern  int plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plRayCastResult res);

-

-	/* Sweep API */

-

-	/* extern  plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); */

-

-	/* Continuous Collision Detection API */

-	

-	// needed for source/blender/blenkernel/intern/collision.c

-	double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3]);

-

-#ifdef __cplusplus

-}

-#endif

-

-

-#endif //BULLET_C_API_H

-

 

--- a/source/bheaders/Bullet/.svn/text-base/btBulletCollisionCommon.h.svn-base
+++ /dev/null
@@ -1,69 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BULLET_COLLISION_COMMON_H

-#define BULLET_COLLISION_COMMON_H

-

-///Common headerfile includes for Bullet Collision Detection

-

-///Bullet's btCollisionWorld and btCollisionObject definitions

-#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"

-#include "BulletCollision/CollisionDispatch/btCollisionObject.h"

-

-///Collision Shapes

-#include "BulletCollision/CollisionShapes/btBoxShape.h"

-#include "BulletCollision/CollisionShapes/btSphereShape.h"

-#include "BulletCollision/CollisionShapes/btCapsuleShape.h"

-#include "BulletCollision/CollisionShapes/btCylinderShape.h"

-#include "BulletCollision/CollisionShapes/btConeShape.h"

-#include "BulletCollision/CollisionShapes/btStaticPlaneShape.h"

-#include "BulletCollision/CollisionShapes/btConvexHullShape.h"

-#include "BulletCollision/CollisionShapes/btTriangleMesh.h"

-#include "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h"

-#include "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h"

-#include "BulletCollision/CollisionShapes/btTriangleMeshShape.h"

-#include "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h"

-#include "BulletCollision/CollisionShapes/btCompoundShape.h"

-#include "BulletCollision/CollisionShapes/btTetrahedronShape.h"

-#include "BulletCollision/CollisionShapes/btEmptyShape.h"

-#include "BulletCollision/CollisionShapes/btMultiSphereShape.h"

-#include "BulletCollision/CollisionShapes/btUniformScalingShape.h"

-

-///Narrowphase Collision Detector

-#include "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h"

-

-//btSphereBoxCollisionAlgorithm is broken, use gjk for now

-//#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h"

-#include "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h"

-

-///Dispatching and generation of collision pairs (broadphase)

-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"

-#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"

-#include "BulletCollision/BroadphaseCollision/btAxisSweep3.h"

-#include "BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h"

-#include "BulletCollision/BroadphaseCollision/btDbvtBroadphase.h"

-

-///Math library & Utils

-#include "LinearMath/btQuaternion.h"

-#include "LinearMath/btTransform.h"

-#include "LinearMath/btDefaultMotionState.h"

-#include "LinearMath/btQuickprof.h"

-#include "LinearMath/btIDebugDraw.h"

-#include "LinearMath/btSerializer.h"

-

-

-#endif //BULLET_COLLISION_COMMON_H

-

 

--- a/source/bheaders/Bullet/.svn/text-base/btBulletDynamicsCommon.h.svn-base
+++ /dev/null
@@ -1,50 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BULLET_DYNAMICS_COMMON_H

-#define BULLET_DYNAMICS_COMMON_H

-

-///Common headerfile includes for Bullet Dynamics, including Collision Detection

-#include "btBulletCollisionCommon.h"

-

-#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"

-#include "BulletDynamics/Dynamics/btContinuousDynamicsWorld.h"

-

-#include "BulletDynamics/Dynamics/btSimpleDynamicsWorld.h"

-#include "BulletDynamics/Dynamics/btRigidBody.h"

-

-#include "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btHingeConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btConeTwistConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btSliderConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btUniversalConstraint.h"

-#include "BulletDynamics/ConstraintSolver/btHinge2Constraint.h"

-

-#include "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h"

-

-

-///Vehicle simulation, with wheel contact simulated by raycasts

-#include "BulletDynamics/Vehicle/btRaycastVehicle.h"

-

-

-

-

-

-

-#endif //BULLET_DYNAMICS_COMMON_H

-

 

--- a/source/bheaders/Bullet/Bullet-C-Api.h
+++ /dev/null
@@ -1,177 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-/*

-	Draft high-level generic physics C-API. For low-level access, use the physics SDK native API's.

-	Work in progress, functionality will be added on demand.

-

-	If possible, use the richer Bullet C++ API, by including "btBulletDynamicsCommon.h"

-*/

-

-#ifndef BULLET_C_API_H

-#define BULLET_C_API_H

-

-#define PL_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name

-

-#ifdef BT_USE_DOUBLE_PRECISION

-typedef double	plReal;

-#else

-typedef float	plReal;

-#endif

-

-typedef plReal	plVector3[3];

-typedef plReal	plQuaternion[4];

-

-#ifdef __cplusplus

-extern "C" { 

-#endif

-

-/**	Particular physics SDK (C-API) */

-	PL_DECLARE_HANDLE(plPhysicsSdkHandle);

-

-/** 	Dynamics world, belonging to some physics SDK (C-API)*/

-	PL_DECLARE_HANDLE(plDynamicsWorldHandle);

-

-/** Rigid Body that can be part of a Dynamics World (C-API)*/	

-	PL_DECLARE_HANDLE(plRigidBodyHandle);

-

-/** 	Collision Shape/Geometry, property of a Rigid Body (C-API)*/

-	PL_DECLARE_HANDLE(plCollisionShapeHandle);

-

-/** Constraint for Rigid Bodies (C-API)*/

-	PL_DECLARE_HANDLE(plConstraintHandle);

-

-/** Triangle Mesh interface (C-API)*/

-	PL_DECLARE_HANDLE(plMeshInterfaceHandle);

-

-/** Broadphase Scene/Proxy Handles (C-API)*/

-	PL_DECLARE_HANDLE(plCollisionBroadphaseHandle);

-	PL_DECLARE_HANDLE(plBroadphaseProxyHandle);

-	PL_DECLARE_HANDLE(plCollisionWorldHandle);

-

-/**

-	Create and Delete a Physics SDK	

-*/

-

-	extern	plPhysicsSdkHandle	plNewBulletSdk(); //this could be also another sdk, like ODE, PhysX etc.

-	extern	void		plDeletePhysicsSdk(plPhysicsSdkHandle	physicsSdk);

-

-/** Collision World, not strictly necessary, you can also just create a Dynamics World with Rigid Bodies which internally manages the Collision World with Collision Objects */

-

-	typedef void(*btBroadphaseCallback)(void* clientData, void* object1,void* object2);

-

-	extern plCollisionBroadphaseHandle	plCreateSapBroadphase(btBroadphaseCallback beginCallback,btBroadphaseCallback endCallback);

-

-	extern void	plDestroyBroadphase(plCollisionBroadphaseHandle bp);

-

-	extern 	plBroadphaseProxyHandle plCreateProxy(plCollisionBroadphaseHandle bp, void* clientData, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);

-

-	extern void plDestroyProxy(plCollisionBroadphaseHandle bp, plBroadphaseProxyHandle proxyHandle);

-

-	extern void plSetBoundingBox(plBroadphaseProxyHandle proxyHandle, plReal minX,plReal minY,plReal minZ, plReal maxX,plReal maxY, plReal maxZ);

-

-/* todo: add pair cache support with queries like add/remove/find pair */

-	

-	extern plCollisionWorldHandle plCreateCollisionWorld(plPhysicsSdkHandle physicsSdk);

-

-/* todo: add/remove objects */

-	

-

-/* Dynamics World */

-

-	extern  plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdk);

-

-	extern  void           plDeleteDynamicsWorld(plDynamicsWorldHandle world);

-

-	extern	void	plStepSimulation(plDynamicsWorldHandle,	plReal	timeStep);

-

-	extern  void plAddRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);

-

-	extern  void plRemoveRigidBody(plDynamicsWorldHandle world, plRigidBodyHandle object);

-

-

-/* Rigid Body  */

-

-	extern  plRigidBodyHandle plCreateRigidBody(	void* user_data,  float mass, plCollisionShapeHandle cshape );

-

-	extern  void plDeleteRigidBody(plRigidBodyHandle body);

-

-

-/* Collision Shape definition */

-

-	extern  plCollisionShapeHandle plNewSphereShape(plReal radius);

-	extern  plCollisionShapeHandle plNewBoxShape(plReal x, plReal y, plReal z);

-	extern  plCollisionShapeHandle plNewCapsuleShape(plReal radius, plReal height);	

-	extern  plCollisionShapeHandle plNewConeShape(plReal radius, plReal height);

-	extern  plCollisionShapeHandle plNewCylinderShape(plReal radius, plReal height);

-	extern	plCollisionShapeHandle plNewCompoundShape();

-	extern	void	plAddChildShape(plCollisionShapeHandle compoundShape,plCollisionShapeHandle childShape, plVector3 childPos,plQuaternion childOrn);

-

-	extern  void plDeleteShape(plCollisionShapeHandle shape);

-

-	/* Convex Meshes */

-	extern  plCollisionShapeHandle plNewConvexHullShape();

-	extern  void		plAddVertex(plCollisionShapeHandle convexHull, plReal x,plReal y,plReal z);

-/* Concave static triangle meshes */

-	extern  plMeshInterfaceHandle		   plNewMeshInterface();

-	extern  void		plAddTriangle(plMeshInterfaceHandle meshHandle, plVector3 v0,plVector3 v1,plVector3 v2);

-	extern  plCollisionShapeHandle plNewStaticTriangleMeshShape(plMeshInterfaceHandle);

-

-	extern  void plSetScaling(plCollisionShapeHandle shape, plVector3 scaling);

-

-/* SOLID has Response Callback/Table/Management */

-/* PhysX has Triggers, User Callbacks and filtering */

-/* ODE has the typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2); */

-

-/*	typedef void plUpdatedPositionCallback(void* userData, plRigidBodyHandle	rbHandle, plVector3 pos); */

-/*	typedef void plUpdatedOrientationCallback(void* userData, plRigidBodyHandle	rbHandle, plQuaternion orientation); */

-

-	/* get world transform */

-	extern void	plGetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);

-	extern void	plGetPosition(plRigidBodyHandle object,plVector3 position);

-	extern void plGetOrientation(plRigidBodyHandle object,plQuaternion orientation);

-

-	/* set world transform (position/orientation) */

-	extern  void plSetPosition(plRigidBodyHandle object, const plVector3 position);

-	extern  void plSetOrientation(plRigidBodyHandle object, const plQuaternion orientation);

-	extern	void plSetEuler(plReal yaw,plReal pitch,plReal roll, plQuaternion orient);

-	extern	void plSetOpenGLMatrix(plRigidBodyHandle object, plReal* matrix);

-

-	typedef struct plRayCastResult {

-		plRigidBodyHandle		m_body;  

-		plCollisionShapeHandle	m_shape; 		

-		plVector3				m_positionWorld; 		

-		plVector3				m_normalWorld;

-	} plRayCastResult;

-

-	extern  int plRayCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plRayCastResult res);

-

-	/* Sweep API */

-

-	/* extern  plRigidBodyHandle plObjectCast(plDynamicsWorldHandle world, const plVector3 rayStart, const plVector3 rayEnd, plVector3 hitpoint, plVector3 normal); */

-

-	/* Continuous Collision Detection API */

-	

-	// needed for source/blender/blenkernel/intern/collision.c

-	double plNearestPoints(float p1[3], float p2[3], float p3[3], float q1[3], float q2[3], float q3[3], float *pa, float *pb, float normal[3]);

-

-#ifdef __cplusplus

-}

-#endif

-

-

-#endif //BULLET_C_API_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/.svn/all-wcprops
+++ /dev/null
@@ -1,18 +1,1 @@
-K 25
-svn:wc:ra_dav:version-url
-V 75
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision
-END
-Doxyfile
-K 25
-svn:wc:ra_dav:version-url
-V 84
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/Doxyfile
-END
-CMakeLists.txt
-K 25
-svn:wc:ra_dav:version-url
-V 90
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CMakeLists.txt
-END
 

--- a/source/bheaders/Bullet/BulletCollision/.svn/entries
+++ /dev/null
@@ -1,115 +1,1 @@
-10
 
-dir
-43
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet/trunk/source/bheaders/Bullet/BulletCollision
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet
-
-
-
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-d286d458-e9d7-44e5-8155-503c4d2c87dc
-
-CollisionShapes
-dir
-
-Doxyfile
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-3b8ed5b6cf1225f44472b265c74a75f4
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-30305
-
-BroadphaseCollision
-dir
-
-Gimpact
-dir
-
-NarrowPhaseCollision
-dir
-
-ibmsdk
-dir
-
-CollisionDispatch
-dir
-
-CMakeLists.txt
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-c15bc337f39fdd9364ba31259791b704
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-11171
-
-

--- a/source/bheaders/Bullet/BulletCollision/.svn/text-base/CMakeLists.txt.svn-base
+++ /dev/null
@@ -1,276 +1,1 @@
-INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src  )

-

-SET(BulletCollision_SRCS

-	BroadphaseCollision/btAxisSweep3.cpp

-	BroadphaseCollision/btBroadphaseProxy.cpp

-	BroadphaseCollision/btCollisionAlgorithm.cpp

-	BroadphaseCollision/btDbvt.cpp

-	BroadphaseCollision/btDbvtBroadphase.cpp

-	BroadphaseCollision/btDispatcher.cpp

-	BroadphaseCollision/btMultiSapBroadphase.cpp

-	BroadphaseCollision/btOverlappingPairCache.cpp

-	BroadphaseCollision/btQuantizedBvh.cpp

-	BroadphaseCollision/btSimpleBroadphase.cpp

-	CollisionDispatch/btActivatingCollisionAlgorithm.cpp

-	CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp

-	CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp

-	CollisionDispatch/btBoxBoxDetector.cpp

-	CollisionDispatch/btCollisionDispatcher.cpp

-	CollisionDispatch/btCollisionObject.cpp

-	CollisionDispatch/btCollisionWorld.cpp

-	CollisionDispatch/btCompoundCollisionAlgorithm.cpp

-	CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp

-	CollisionDispatch/btConvexConvexAlgorithm.cpp

-	CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp

-	CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp

-	CollisionDispatch/btDefaultCollisionConfiguration.cpp

-	CollisionDispatch/btEmptyCollisionAlgorithm.cpp

-	CollisionDispatch/btGhostObject.cpp

-	CollisionDispatch/btInternalEdgeUtility.cpp

-	CollisionDispatch/btInternalEdgeUtility.h

-	CollisionDispatch/btManifoldResult.cpp

-	CollisionDispatch/btSimulationIslandManager.cpp

-	CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp

-	CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp

-	CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp

-	CollisionDispatch/btUnionFind.cpp

-	CollisionDispatch/SphereTriangleDetector.cpp

-	CollisionShapes/btBoxShape.cpp

-	CollisionShapes/btBox2dShape.cpp

-	CollisionShapes/btBvhTriangleMeshShape.cpp

-	CollisionShapes/btCapsuleShape.cpp

-	CollisionShapes/btCollisionShape.cpp

-	CollisionShapes/btCompoundShape.cpp

-	CollisionShapes/btConcaveShape.cpp

-	CollisionShapes/btConeShape.cpp

-	CollisionShapes/btConvexHullShape.cpp

-	CollisionShapes/btConvexInternalShape.cpp

-	CollisionShapes/btConvexPointCloudShape.cpp

-	CollisionShapes/btConvexShape.cpp

-	CollisionShapes/btConvex2dShape.cpp

-	CollisionShapes/btConvexTriangleMeshShape.cpp

-	CollisionShapes/btCylinderShape.cpp

-	CollisionShapes/btEmptyShape.cpp

-	CollisionShapes/btHeightfieldTerrainShape.cpp

-	CollisionShapes/btMinkowskiSumShape.cpp

-	CollisionShapes/btMultimaterialTriangleMeshShape.cpp

-	CollisionShapes/btMultiSphereShape.cpp

-	CollisionShapes/btOptimizedBvh.cpp

-	CollisionShapes/btPolyhedralConvexShape.cpp

-	CollisionShapes/btScaledBvhTriangleMeshShape.cpp

-	CollisionShapes/btShapeHull.cpp

-	CollisionShapes/btSphereShape.cpp

-	CollisionShapes/btStaticPlaneShape.cpp

-	CollisionShapes/btStridingMeshInterface.cpp

-	CollisionShapes/btTetrahedronShape.cpp

-	CollisionShapes/btTriangleBuffer.cpp

-	CollisionShapes/btTriangleCallback.cpp

-	CollisionShapes/btTriangleIndexVertexArray.cpp

-	CollisionShapes/btTriangleIndexVertexMaterialArray.cpp

-	CollisionShapes/btTriangleMesh.cpp

-	CollisionShapes/btTriangleMeshShape.cpp

-	CollisionShapes/btUniformScalingShape.cpp

-	Gimpact/btContactProcessing.cpp

-	Gimpact/btGenericPoolAllocator.cpp

-	Gimpact/btGImpactBvh.cpp

-	Gimpact/btGImpactCollisionAlgorithm.cpp

-	Gimpact/btGImpactQuantizedBvh.cpp

-	Gimpact/btGImpactShape.cpp

-	Gimpact/btTriangleShapeEx.cpp

-	Gimpact/gim_box_set.cpp

-	Gimpact/gim_contact.cpp

-	Gimpact/gim_memory.cpp

-	Gimpact/gim_tri_collision.cpp

-	NarrowPhaseCollision/btContinuousConvexCollision.cpp

-	NarrowPhaseCollision/btConvexCast.cpp

-	NarrowPhaseCollision/btGjkConvexCast.cpp

-	NarrowPhaseCollision/btGjkEpa2.cpp

-	NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp

-	NarrowPhaseCollision/btGjkPairDetector.cpp

-	NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp

-	NarrowPhaseCollision/btPersistentManifold.cpp

-	NarrowPhaseCollision/btRaycastCallback.cpp

-	NarrowPhaseCollision/btSubSimplexConvexCast.cpp

-	NarrowPhaseCollision/btVoronoiSimplexSolver.cpp

-)

-

-SET(Root_HDRS

-	../btBulletCollisionCommon.h

-)

-SET(BroadphaseCollision_HDRS

-	BroadphaseCollision/btAxisSweep3.h

-	BroadphaseCollision/btBroadphaseInterface.h

-	BroadphaseCollision/btBroadphaseProxy.h

-	BroadphaseCollision/btCollisionAlgorithm.h

-	BroadphaseCollision/btDbvt.h

-	BroadphaseCollision/btDbvtBroadphase.h

-	BroadphaseCollision/btDispatcher.h

-	BroadphaseCollision/btMultiSapBroadphase.h

-	BroadphaseCollision/btOverlappingPairCache.h

-	BroadphaseCollision/btOverlappingPairCallback.h

-	BroadphaseCollision/btQuantizedBvh.h

-	BroadphaseCollision/btSimpleBroadphase.h

-)

-SET(CollisionDispatch_HDRS

-	CollisionDispatch/btActivatingCollisionAlgorithm.h

-	CollisionDispatch/btBoxBoxCollisionAlgorithm.h

-	CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h

-	CollisionDispatch/btBoxBoxDetector.h

-	CollisionDispatch/btCollisionConfiguration.h

-	CollisionDispatch/btCollisionCreateFunc.h

-	CollisionDispatch/btCollisionDispatcher.h

-	CollisionDispatch/btCollisionObject.h

-	CollisionDispatch/btCollisionWorld.h

-	CollisionDispatch/btCompoundCollisionAlgorithm.h

-	CollisionDispatch/btConvexConcaveCollisionAlgorithm.h

-	CollisionDispatch/btConvexConvexAlgorithm.h

-	CollisionDispatch/btConvex2dConvex2dAlgorithm.h

-	CollisionDispatch/btConvexPlaneCollisionAlgorithm.h

-	CollisionDispatch/btDefaultCollisionConfiguration.h

-	CollisionDispatch/btEmptyCollisionAlgorithm.h

-	CollisionDispatch/btGhostObject.h

-	CollisionDispatch/btManifoldResult.h

-	CollisionDispatch/btSimulationIslandManager.h

-	CollisionDispatch/btSphereBoxCollisionAlgorithm.h

-	CollisionDispatch/btSphereSphereCollisionAlgorithm.h

-	CollisionDispatch/btSphereTriangleCollisionAlgorithm.h

-	CollisionDispatch/btUnionFind.h

-	CollisionDispatch/SphereTriangleDetector.h

-)

-SET(CollisionShapes_HDRS

-	CollisionShapes/btBoxShape.h

-	CollisionShapes/btBox2dShape.h

-	CollisionShapes/btBvhTriangleMeshShape.h

-	CollisionShapes/btCapsuleShape.h

-	CollisionShapes/btCollisionMargin.h

-	CollisionShapes/btCollisionShape.h

-	CollisionShapes/btCompoundShape.h

-	CollisionShapes/btConcaveShape.h

-	CollisionShapes/btConeShape.h

-	CollisionShapes/btConvexHullShape.h

-	CollisionShapes/btConvexInternalShape.h

-	CollisionShapes/btConvexPointCloudShape.h

-	CollisionShapes/btConvexShape.h

-	CollisionShapes/btConvex2dShape.h

-	CollisionShapes/btConvexTriangleMeshShape.h

-	CollisionShapes/btCylinderShape.h

-	CollisionShapes/btEmptyShape.h

-	CollisionShapes/btHeightfieldTerrainShape.h

-	CollisionShapes/btMaterial.h

-	CollisionShapes/btMinkowskiSumShape.h

-	CollisionShapes/btMultimaterialTriangleMeshShape.h

-	CollisionShapes/btMultiSphereShape.h

-	CollisionShapes/btOptimizedBvh.h

-	CollisionShapes/btPolyhedralConvexShape.h

-	CollisionShapes/btScaledBvhTriangleMeshShape.h

-	CollisionShapes/btShapeHull.h

-	CollisionShapes/btSphereShape.h

-	CollisionShapes/btStaticPlaneShape.h

-	CollisionShapes/btStridingMeshInterface.h

-	CollisionShapes/btTetrahedronShape.h

-	CollisionShapes/btTriangleBuffer.h

-	CollisionShapes/btTriangleCallback.h

-	CollisionShapes/btTriangleIndexVertexArray.h

-	CollisionShapes/btTriangleIndexVertexMaterialArray.h

-	CollisionShapes/btTriangleInfoMap.h

-	CollisionShapes/btTriangleMesh.h

-	CollisionShapes/btTriangleMeshShape.h

-	CollisionShapes/btTriangleShape.h

-	CollisionShapes/btUniformScalingShape.h

-)

-SET(Gimpact_HDRS

-	Gimpact/btBoxCollision.h

-	Gimpact/btClipPolygon.h

-	Gimpact/btContactProcessing.h

-	Gimpact/btGenericPoolAllocator.h

-	Gimpact/btGeometryOperations.h

-	Gimpact/btGImpactBvh.h

-	Gimpact/btGImpactCollisionAlgorithm.h

-	Gimpact/btGImpactMassUtil.h

-	Gimpact/btGImpactQuantizedBvh.h

-	Gimpact/btGImpactShape.h

-	Gimpact/btQuantization.h

-	Gimpact/btTriangleShapeEx.h

-	Gimpact/gim_array.h

-	Gimpact/gim_basic_geometry_operations.h

-	Gimpact/gim_bitset.h

-	Gimpact/gim_box_collision.h

-	Gimpact/gim_box_set.h

-	Gimpact/gim_clip_polygon.h

-	Gimpact/gim_contact.h

-	Gimpact/gim_geom_types.h

-	Gimpact/gim_geometry.h

-	Gimpact/gim_hash_table.h

-	Gimpact/gim_linear_math.h

-	Gimpact/gim_math.h

-	Gimpact/gim_memory.h

-	Gimpact/gim_radixsort.h

-	Gimpact/gim_tri_collision.h

-)

-SET(NarrowPhaseCollision_HDRS

-	NarrowPhaseCollision/btContinuousConvexCollision.h

-	NarrowPhaseCollision/btConvexCast.h

-	NarrowPhaseCollision/btConvexPenetrationDepthSolver.h

-	NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h

-	NarrowPhaseCollision/btGjkConvexCast.h

-	NarrowPhaseCollision/btGjkEpa2.h

-	NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h

-	NarrowPhaseCollision/btGjkPairDetector.h

-	NarrowPhaseCollision/btManifoldPoint.h

-	NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h

-	NarrowPhaseCollision/btPersistentManifold.h

-	NarrowPhaseCollision/btPointCollector.h

-	NarrowPhaseCollision/btRaycastCallback.h

-	NarrowPhaseCollision/btSimplexSolverInterface.h

-	NarrowPhaseCollision/btSubSimplexConvexCast.h

-	NarrowPhaseCollision/btVoronoiSimplexSolver.h

-)

-

-SET(BulletCollision_HDRS

-	${Root_HDRS}

-	${BroadphaseCollision_HDRS}

-	${CollisionDispatch_HDRS}

-	${CollisionShapes_HDRS}

-	${Gimpact_HDRS}

-	${NarrowPhaseCollision_HDRS}

-)

-

-

-ADD_LIBRARY(BulletCollision ${BulletCollision_SRCS} ${BulletCollision_HDRS})

-SET_TARGET_PROPERTIES(BulletCollision PROPERTIES VERSION ${BULLET_VERSION})

-SET_TARGET_PROPERTIES(BulletCollision PROPERTIES SOVERSION ${BULLET_VERSION})

-IF (BUILD_SHARED_LIBS)

-  TARGET_LINK_LIBRARIES(BulletCollision LinearMath)

-ENDIF (BUILD_SHARED_LIBS)

-

-

-IF (INSTALL_LIBS)

-	IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)

-		#INSTALL of other files requires CMake 2.6

-		IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)

-			IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-				INSTALL(TARGETS BulletCollision DESTINATION .)

-			ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-				INSTALL(TARGETS BulletCollision DESTINATION lib${LIB_SUFFIX})

-				INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

-DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)

-				INSTALL(FILES ../btBulletCollisionCommon.h

-DESTINATION ${INCLUDE_INSTALL_DIR}/BulletCollision)

-			ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-		ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)

-		

-		IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-			SET_TARGET_PROPERTIES(BulletCollision PROPERTIES FRAMEWORK true)

-		

-			SET_TARGET_PROPERTIES(BulletCollision PROPERTIES PUBLIC_HEADER ${Root_HDRS})

-			# Have to list out sub-directories manually:

-			SET_PROPERTY(SOURCE ${BroadphaseCollision_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/BroadphaseCollision)

-			SET_PROPERTY(SOURCE ${CollisionDispatch_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/CollisionDispatch)

-			SET_PROPERTY(SOURCE ${CollisionShapes_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/CollisionShapes)

-			SET_PROPERTY(SOURCE ${Gimpact_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/Gimpact)

-			SET_PROPERTY(SOURCE ${NarrowPhaseCollision_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/NarrowPhaseCollision)

-		

-		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)

-ENDIF (INSTALL_LIBS)

 

--- a/source/bheaders/Bullet/BulletCollision/.svn/text-base/Doxyfile.svn-base
+++ /dev/null
@@ -1,747 +1,1 @@
-# Doxyfile 1.2.4

-

-# This file describes the settings to be used by doxygen for a project

-#

-# All text after a hash (#) is considered a comment and will be ignored

-# The format is:

-#       TAG = value [value, ...]

-# For lists items can also be appended using:

-#       TAG += value [value, ...]

-# Values that contain spaces should be placed between quotes (" ")

-

-#---------------------------------------------------------------------------

-# General configuration options

-#---------------------------------------------------------------------------

-

-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 

-# by quotes) that should identify the project. 

-PROJECT_NAME           = "Bullet Continuous Collision Detection Library"

-

-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 

-# This could be handy for archiving the generated documentation or 

-# if some version control system is used.

-

-PROJECT_NUMBER         = 

-

-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 

-# base path where the generated documentation will be put. 

-# If a relative path is entered, it will be relative to the location 

-# where doxygen was started. If left blank the current directory will be used.

-

-OUTPUT_DIRECTORY       = 

-

-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 

-# documentation generated by doxygen is written. Doxygen will use this 

-# information to generate all constant output in the proper language. 

-# The default language is English, other supported languages are: 

-# Dutch, French, Italian, Czech, Swedish, German, Finnish, Japanese, 

-# Korean, Hungarian, Norwegian, Spanish, Romanian, Russian, Croatian, 

-# Polish, Portuguese and Slovene.

-

-OUTPUT_LANGUAGE        = English

-

-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 

-# documentation are documented, even if no documentation was available. 

-# Private class members and static file members will be hidden unless 

-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 

-

-EXTRACT_ALL            = YES

-

-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 

-# will be included in the documentation. 

-

-EXTRACT_PRIVATE        = YES

-

-# If the EXTRACT_STATIC tag is set to YES all static members of a file 

-# will be included in the documentation. 

-

-EXTRACT_STATIC         = YES

-

-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 

-# undocumented members of documented classes, files or namespaces. 

-# If set to NO (the default) these members will be included in the 

-# various overviews, but no documentation section is generated. 

-# This option has no effect if EXTRACT_ALL is enabled. 

-

-HIDE_UNDOC_MEMBERS     = NO

-

-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 

-# undocumented classes that are normally visible in the class hierarchy. 

-# If set to NO (the default) these class will be included in the various 

-# overviews. This option has no effect if EXTRACT_ALL is enabled. 

-

-HIDE_UNDOC_CLASSES     = NO

-

-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 

-# include brief member descriptions after the members that are listed in 

-# the file and class documentation (similar to JavaDoc). 

-# Set to NO to disable this. 

-

-BRIEF_MEMBER_DESC      = YES

-

-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 

-# the brief description of a member or function before the detailed description. 

-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 

-# brief descriptions will be completely suppressed. 

-

-REPEAT_BRIEF           = YES

-

-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 

-# Doxygen will generate a detailed section even if there is only a brief 

-# description. 

-

-ALWAYS_DETAILED_SEC    = NO

-

-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 

-# path before files name in the file list and in the header files. If set 

-# to NO the shortest path that makes the file name unique will be used. 

-

-FULL_PATH_NAMES        = NO

-

-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 

-# can be used to strip a user defined part of the path. Stripping is 

-# only done if one of the specified strings matches the left-hand part of 

-# the path. It is allowed to use relative paths in the argument list.

-

-STRIP_FROM_PATH        = 

-

-# The INTERNAL_DOCS tag determines if documentation 

-# that is typed after a \internal command is included. If the tag is set 

-# to NO (the default) then the documentation will be excluded. 

-# Set it to YES to include the internal documentation. 

-

-INTERNAL_DOCS          = NO

-

-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 

-# generate a class diagram (in Html and LaTeX) for classes with base or 

-# super classes. Setting the tag to NO turns the diagrams off. 

-

-CLASS_DIAGRAMS         = YES

-

-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 

-# be generated. Documented entities will be cross-referenced with these sources. 

-

-SOURCE_BROWSER         = YES

-

-# Setting the INLINE_SOURCES tag to YES will include the body 

-# of functions and classes directly in the documentation. 

-

-INLINE_SOURCES         = NO

-

-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 

-# doxygen to hide any special comment blocks from generated source code 

-# fragments. Normal C and C++ comments will always remain visible. 

-

-STRIP_CODE_COMMENTS    = YES

-

-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 

-# file names in lower case letters. If set to YES upper case letters are also 

-# allowed. This is useful if you have classes or files whose names only differ 

-# in case and if your file system supports case sensitive file names. Windows 

-# users are adviced to set this option to NO.

-

-CASE_SENSE_NAMES       = YES

-

-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 

-# will show members with their full class and namespace scopes in the 

-# documentation. If set to YES the scope will be hidden. 

-

-HIDE_SCOPE_NAMES       = NO

-

-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 

-# will generate a verbatim copy of the header file for each class for 

-# which an include is specified. Set to NO to disable this. 

-

-VERBATIM_HEADERS       = YES

-

-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 

-# will put list of the files that are included by a file in the documentation 

-# of that file. 

-

-SHOW_INCLUDE_FILES     = YES

-

-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 

-# will interpret the first line (until the first dot) of a JavaDoc-style 

-# comment as the brief description. If set to NO, the JavaDoc 

-# comments  will behave just like the Qt-style comments (thus requiring an 

-# explict @brief command for a brief description. 

-

-JAVADOC_AUTOBRIEF      = YES

-

-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 

-# member inherits the documentation from any documented member that it 

-# reimplements. 

-

-INHERIT_DOCS           = YES

-

-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 

-# is inserted in the documentation for inline members. 

-

-INLINE_INFO            = YES

-

-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 

-# will sort the (detailed) documentation of file and class members 

-# alphabetically by member name. If set to NO the members will appear in 

-# declaration order. 

-

-SORT_MEMBER_DOCS       = YES

-

-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 

-# tag is set to YES, then doxygen will reuse the documentation of the first 

-# member in the group (if any) for the other members of the group. By default 

-# all members of a group must be documented explicitly.

-

-DISTRIBUTE_GROUP_DOC   = NO

-

-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 

-# Doxygen uses this value to replace tabs by spaces in code fragments. 

-

-TAB_SIZE               = 8

-

-# The ENABLE_SECTIONS tag can be used to enable conditional 

-# documentation sections, marked by \if sectionname ... \endif. 

-

-ENABLED_SECTIONS       = 

-

-# The GENERATE_TODOLIST tag can be used to enable (YES) or 

-# disable (NO) the todo list. This list is created by putting \todo 

-# commands in the documentation.

-

-GENERATE_TODOLIST      = YES

-

-# The GENERATE_TESTLIST tag can be used to enable (YES) or 

-# disable (NO) the test list. This list is created by putting \test 

-# commands in the documentation.

-

-GENERATE_TESTLIST      = YES

-

-# This tag can be used to specify a number of aliases that acts 

-# as commands in the documentation. An alias has the form "name=value". 

-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 

-# put the command \sideeffect (or @sideeffect) in the documentation, which 

-# will result in a user defined paragraph with heading "Side Effects:". 

-# You can put \n's in the value part of an alias to insert newlines. 

-

-ALIASES                = 

-

-#---------------------------------------------------------------------------

-# configuration options related to warning and progress messages

-#---------------------------------------------------------------------------

-

-# The QUIET tag can be used to turn on/off the messages that are generated 

-# by doxygen. Possible values are YES and NO. If left blank NO is used. 

-

-QUIET                  = NO

-

-# The WARNINGS tag can be used to turn on/off the warning messages that are 

-# generated by doxygen. Possible values are YES and NO. If left blank 

-# NO is used. 

-

-WARNINGS               = YES

-

-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 

-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 

-# automatically be disabled. 

-

-WARN_IF_UNDOCUMENTED   = YES

-

-# The WARN_FORMAT tag determines the format of the warning messages that 

-# doxygen can produce. The string should contain the $file, $line, and $text 

-# tags, which will be replaced by the file and line number from which the 

-# warning originated and the warning text. 

-

-WARN_FORMAT            = "$file:$line: $text"

-

-# The WARN_LOGFILE tag can be used to specify a file to which warning 

-# and error messages should be written. If left blank the output is written 

-# to stderr. 

-

-WARN_LOGFILE           = 

-

-#---------------------------------------------------------------------------

-# configuration options related to the input files

-#---------------------------------------------------------------------------

-

-# The INPUT tag can be used to specify the files and/or directories that contain 

-# documented source files. You may enter file names like "myfile.cpp" or 

-# directories like "/usr/src/myproject". Separate the files or directories 

-# with spaces. 

-

-INPUT                  = .

-

-

-# If the value of the INPUT tag contains directories, you can use the 

-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 

-# and *.h) to filter out the source-files in the directories. If left 

-# blank all files are included. 

-

-FILE_PATTERNS          = *.h *.cpp *.c

-

-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 

-# should be searched for input files as well. Possible values are YES and NO. 

-# If left blank NO is used. 

-

-RECURSIVE              = YES

-

-# The EXCLUDE tag can be used to specify files and/or directories that should 

-# excluded from the INPUT source files. This way you can easily exclude a 

-# subdirectory from a directory tree whose root is specified with the INPUT tag. 

-

-EXCLUDE                = 

-

-# If the value of the INPUT tag contains directories, you can use the 

-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 

-# certain files from those directories. 

-

-EXCLUDE_PATTERNS       = 

-

-# The EXAMPLE_PATH tag can be used to specify one or more files or 

-# directories that contain example code fragments that are included (see 

-# the \include command). 

-

-EXAMPLE_PATH           = 

-

-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 

-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 

-# and *.h) to filter out the source-files in the directories. If left 

-# blank all files are included. 

-

-EXAMPLE_PATTERNS       = 

-

-# The IMAGE_PATH tag can be used to specify one or more files or 

-# directories that contain image that are included in the documentation (see 

-# the \image command). 

-

-IMAGE_PATH             = 

-

-# The INPUT_FILTER tag can be used to specify a program that doxygen should 

-# invoke to filter for each input file. Doxygen will invoke the filter program 

-# by executing (via popen()) the command <filter> <input-file>, where <filter> 

-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 

-# input file. Doxygen will then use the output that the filter program writes 

-# to standard output. 

-

-INPUT_FILTER           = 

-

-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 

-# INPUT_FILTER) will be used to filter the input files when producing source 

-# files to browse. 

-

-FILTER_SOURCE_FILES    = NO

-

-#---------------------------------------------------------------------------

-# configuration options related to the alphabetical class index

-#---------------------------------------------------------------------------

-

-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 

-# of all compounds will be generated. Enable this if the project 

-# contains a lot of classes, structs, unions or interfaces. 

-

-ALPHABETICAL_INDEX     = NO

-

-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 

-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 

-# in which this list will be split (can be a number in the range [1..20]) 

-

-COLS_IN_ALPHA_INDEX    = 5

-

-# In case all classes in a project start with a common prefix, all 

-# classes will be put under the same header in the alphabetical index. 

-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 

-# should be ignored while generating the index headers. 

-

-IGNORE_PREFIX          = 

-

-#---------------------------------------------------------------------------

-# configuration options related to the HTML output

-#---------------------------------------------------------------------------

-

-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 

-# generate HTML output. 

-

-GENERATE_HTML          = YES

-

-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 

-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 

-# put in front of it. If left blank `html' will be used as the default path. 

-

-HTML_OUTPUT            = html

-

-# The HTML_HEADER tag can be used to specify a personal HTML header for 

-# each generated HTML page. If it is left blank doxygen will generate a 

-# standard header.

-

-HTML_HEADER            = 

-

-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 

-# each generated HTML page. If it is left blank doxygen will generate a 

-# standard footer.

-

-HTML_FOOTER            = 

-

-# The HTML_STYLESHEET tag can be used to specify a user defined cascading 

-# style sheet that is used by each HTML page. It can be used to 

-# fine-tune the look of the HTML output. If the tag is left blank doxygen 

-# will generate a default style sheet 

-

-HTML_STYLESHEET        = 

-

-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 

-# files or namespaces will be aligned in HTML using tables. If set to 

-# NO a bullet list will be used. 

-

-HTML_ALIGN_MEMBERS     = YES

-

-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 

-# will be generated that can be used as input for tools like the 

-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 

-# of the generated HTML documentation. 

-

-GENERATE_HTMLHELP      = NO

-

-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 

-# top of each HTML page. The value NO (the default) enables the index and 

-# the value YES disables it. 

-

-DISABLE_INDEX          = NO

-

-# This tag can be used to set the number of enum values (range [1..20]) 

-# that doxygen will group on one line in the generated HTML documentation. 

-

-ENUM_VALUES_PER_LINE   = 4

-

-# If the GENERATE_TREEVIEW tag is set to YES, a side pannel will be

-# generated containing a tree-like index structure (just like the one that 

-# is generated for HTML Help). For this to work a browser that supports 

-# JavaScript and frames is required (for instance Netscape 4.0+ 

-# or Internet explorer 4.0+). 

-

-GENERATE_TREEVIEW      = NO

-

-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 

-# used to set the initial width (in pixels) of the frame in which the tree 

-# is shown. 

-

-TREEVIEW_WIDTH         = 250

-

-#---------------------------------------------------------------------------

-# configuration options related to the LaTeX output

-#---------------------------------------------------------------------------

-

-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 

-# generate Latex output. 

-

-GENERATE_LATEX         = NO

-

-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 

-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 

-# put in front of it. If left blank `latex' will be used as the default path. 

-

-LATEX_OUTPUT           = latex

-

-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 

-# LaTeX documents. This may be useful for small projects and may help to 

-# save some trees in general. 

-

-COMPACT_LATEX          = NO

-

-# The PAPER_TYPE tag can be used to set the paper type that is used 

-# by the printer. Possible values are: a4, a4wide, letter, legal and 

-# executive. If left blank a4wide will be used. 

-

-PAPER_TYPE             = a4wide

-

-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 

-# packages that should be included in the LaTeX output. 

-

-EXTRA_PACKAGES         = 

-

-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 

-# the generated latex document. The header should contain everything until 

-# the first chapter. If it is left blank doxygen will generate a 

-# standard header. Notice: only use this tag if you know what you are doing! 

-

-LATEX_HEADER           = 

-

-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 

-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 

-# contain links (just like the HTML output) instead of page references 

-# This makes the output suitable for online browsing using a pdf viewer. 

-

-PDF_HYPERLINKS         = NO

-

-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 

-# plain latex in the generated Makefile. Set this option to YES to get a 

-# higher quality PDF documentation. 

-

-USE_PDFLATEX           = NO

-

-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 

-# command to the generated LaTeX files. This will instruct LaTeX to keep 

-# running if errors occur, instead of asking the user for help. 

-# This option is also used when generating formulas in HTML. 

-

-LATEX_BATCHMODE        = NO

-

-#---------------------------------------------------------------------------

-# configuration options related to the RTF output

-#---------------------------------------------------------------------------

-

-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 

-# The RTF output is optimised for Word 97 and may not look very pretty with 

-# other RTF readers or editors.

-

-GENERATE_RTF           = NO

-

-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 

-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 

-# put in front of it. If left blank `rtf' will be used as the default path. 

-

-RTF_OUTPUT             = rtf

-

-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 

-# RTF documents. This may be useful for small projects and may help to 

-# save some trees in general. 

-

-COMPACT_RTF            = NO

-

-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 

-# will contain hyperlink fields. The RTF file will 

-# contain links (just like the HTML output) instead of page references. 

-# This makes the output suitable for online browsing using a WORD or other. 

-# programs which support those fields. 

-# Note: wordpad (write) and others do not support links. 

-

-RTF_HYPERLINKS         = NO

-

-# Load stylesheet definitions from file. Syntax is similar to doxygen's 

-# config file, i.e. a series of assigments. You only have to provide 

-# replacements, missing definitions are set to their default value. 

-

-RTF_STYLESHEET_FILE    = 

-

-#---------------------------------------------------------------------------

-# configuration options related to the man page output

-#---------------------------------------------------------------------------

-

-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 

-# generate man pages 

-

-GENERATE_MAN           = NO

-

-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 

-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 

-# put in front of it. If left blank `man' will be used as the default path. 

-

-MAN_OUTPUT             = man

-

-# The MAN_EXTENSION tag determines the extension that is added to 

-# the generated man pages (default is the subroutine's section .3) 

-

-MAN_EXTENSION          = .3

-

-#---------------------------------------------------------------------------

-# configuration options related to the XML output

-#---------------------------------------------------------------------------

-

-# If the GENERATE_XML tag is set to YES Doxygen will 

-# generate an XML file that captures the structure of 

-# the code including all documentation. Warning: This feature 

-# is still experimental and very incomplete.

-

-GENERATE_XML           = NO

-

-#---------------------------------------------------------------------------

-# Configuration options related to the preprocessor   

-#---------------------------------------------------------------------------

-

-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 

-# evaluate all C-preprocessor directives found in the sources and include 

-# files. 

-

-ENABLE_PREPROCESSING   = YES

-

-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 

-# names in the source code. If set to NO (the default) only conditional 

-# compilation will be performed. Macro expansion can be done in a controlled 

-# way by setting EXPAND_ONLY_PREDEF to YES. 

-

-MACRO_EXPANSION        = NO

-

-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 

-# then the macro expansion is limited to the macros specified with the 

-# PREDEFINED and EXPAND_AS_PREDEFINED tags. 

-

-EXPAND_ONLY_PREDEF     = NO

-

-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 

-# in the INCLUDE_PATH (see below) will be search if a #include is found. 

-

-SEARCH_INCLUDES        = YES

-

-# The INCLUDE_PATH tag can be used to specify one or more directories that 

-# contain include files that are not input files but should be processed by 

-# the preprocessor. 

-

-INCLUDE_PATH           = ../../generic/extern

-

-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 

-# patterns (like *.h and *.hpp) to filter out the header-files in the 

-# directories. If left blank, the patterns specified with FILE_PATTERNS will 

-# be used. 

-

-INCLUDE_FILE_PATTERNS  = 

-

-# The PREDEFINED tag can be used to specify one or more macro names that 

-# are defined before the preprocessor is started (similar to the -D option of 

-# gcc). The argument of the tag is a list of macros of the form: name 

-# or name=definition (no spaces). If the definition and the = are 

-# omitted =1 is assumed. 

-

-PREDEFINED             = 

-

-# If the MACRO_EXPANSION and EXPAND_PREDEF_ONLY tags are set to YES then 

-# this tag can be used to specify a list of macro names that should be expanded. 

-# The macro definition that is found in the sources will be used. 

-# Use the PREDEFINED tag if you want to use a different macro definition. 

-

-EXPAND_AS_DEFINED      = 

-

-#---------------------------------------------------------------------------

-# Configuration::addtions related to external references   

-#---------------------------------------------------------------------------

-

-# The TAGFILES tag can be used to specify one or more tagfiles. 

-

-TAGFILES               = 

-

-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 

-# a tag file that is based on the input files it reads. 

-

-GENERATE_TAGFILE       = 

-

-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 

-# in the class index. If set to NO only the inherited external classes 

-# will be listed. 

-

-ALLEXTERNALS           = NO

-

-# The PERL_PATH should be the absolute path and name of the perl script 

-# interpreter (i.e. the result of `which perl'). 

-

-PERL_PATH              = /usr/bin/perl

-

-#---------------------------------------------------------------------------

-# Configuration options related to the dot tool   

-#---------------------------------------------------------------------------

-

-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 

-# available from the path. This tool is part of Graphviz, a graph visualization 

-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 

-# have no effect if this option is set to NO (the default) 

-

-HAVE_DOT               = YES

-

-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 

-# will generate a graph for each documented class showing the direct and 

-# indirect inheritance relations. Setting this tag to YES will force the 

-# the CLASS_DIAGRAMS tag to NO.

-

-CLASS_GRAPH            = YES

-

-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 

-# will generate a graph for each documented class showing the direct and 

-# indirect implementation dependencies (inheritance, containment, and 

-# class references variables) of the class with other documented classes. 

-

-COLLABORATION_GRAPH    = YES

-

-# If the ENABLE_PREPROCESSING, INCLUDE_GRAPH, and HAVE_DOT tags are set to 

-# YES then doxygen will generate a graph for each documented file showing 

-# the direct and indirect include dependencies of the file with other 

-# documented files. 

-

-INCLUDE_GRAPH          = YES

-

-# If the ENABLE_PREPROCESSING, INCLUDED_BY_GRAPH, and HAVE_DOT tags are set to 

-# YES then doxygen will generate a graph for each documented header file showing 

-# the documented files that directly or indirectly include this file 

-

-INCLUDED_BY_GRAPH      = YES

-

-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 

-# will graphical hierarchy of all classes instead of a textual one. 

-

-GRAPHICAL_HIERARCHY    = YES

-

-# The tag DOT_PATH can be used to specify the path where the dot tool can be 

-# found. If left blank, it is assumed the dot tool can be found on the path. 

-

-DOT_PATH               = 

-

-# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 

-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 

-# this value, doxygen will try to truncate the graph, so that it fits within 

-# the specified constraint. Beware that most browsers cannot cope with very 

-# large images. 

-

-MAX_DOT_GRAPH_WIDTH    = 1024

-

-# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 

-# (in pixels) of the graphs generated by dot. If a graph becomes larger than 

-# this value, doxygen will try to truncate the graph, so that it fits within 

-# the specified constraint. Beware that most browsers cannot cope with very 

-# large images. 

-

-MAX_DOT_GRAPH_HEIGHT   = 1024

-

-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 

-# generate a legend page explaining the meaning of the various boxes and 

-# arrows in the dot generated graphs. 

-

-GENERATE_LEGEND        = YES

-

-#---------------------------------------------------------------------------

-# Configuration::addtions related to the search engine   

-#---------------------------------------------------------------------------

-

-# The SEARCHENGINE tag specifies whether or not a search engine should be 

-# used. If set to NO the values of all tags below this one will be ignored. 

-

-SEARCHENGINE           = NO

-

-# The CGI_NAME tag should be the name of the CGI script that 

-# starts the search engine (doxysearch) with the correct parameters. 

-# A script with this name will be generated by doxygen. 

-

-CGI_NAME               = search.cgi

-

-# The CGI_URL tag should be the absolute URL to the directory where the 

-# cgi binaries are located. See the documentation of your http daemon for 

-# details. 

-

-CGI_URL                = 

-

-# The DOC_URL tag should be the absolute URL to the directory where the 

-# documentation is located. If left blank the absolute path to the 

-# documentation, with file:// prepended to it, will be used. 

-

-DOC_URL                = 

-

-# The DOC_ABSPATH tag should be the absolute path to the directory where the 

-# documentation is located. If left blank the directory on the local machine 

-# will be used. 

-

-DOC_ABSPATH            = 

-

-# The BIN_ABSPATH tag must point to the directory where the doxysearch binary 

-# is installed. 

-

-BIN_ABSPATH            = c:\program files\doxygen\bin

-

-# The EXT_DOC_PATHS tag can be used to specify one or more paths to 

-# documentation generated for other projects. This allows doxysearch to search 

-# the documentation for these projects as well. 

-

-EXT_DOC_PATHS          = 

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/all-wcprops
+++ /dev/null
@@ -1,78 +1,1 @@
-K 25
-svn:wc:ra_dav:version-url
-V 95
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision
-END
-btQuantizedBvh.h
-K 25
-svn:wc:ra_dav:version-url
-V 112
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
-END
-btDispatcher.h
-K 25
-svn:wc:ra_dav:version-url
-V 110
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btDispatcher.h
-END
-btOverlappingPairCache.h
-K 25
-svn:wc:ra_dav:version-url
-V 120
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
-END
-btMultiSapBroadphase.h
-K 25
-svn:wc:ra_dav:version-url
-V 118
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h
-END
-btDbvtBroadphase.h
-K 25
-svn:wc:ra_dav:version-url
-V 114
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
-END
-btBroadphaseInterface.h
-K 25
-svn:wc:ra_dav:version-url
-V 119
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
-END
-btBroadphaseProxy.h
-K 25
-svn:wc:ra_dav:version-url
-V 115
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
-END
-btAxisSweep3.h
-K 25
-svn:wc:ra_dav:version-url
-V 110
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h
-END
-btDbvt.h
-K 25
-svn:wc:ra_dav:version-url
-V 104
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btDbvt.h
-END
-btOverlappingPairCallback.h
-K 25
-svn:wc:ra_dav:version-url
-V 123
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h
-END
-btCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 118
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
-END
-btSimpleBroadphase.h
-K 25
-svn:wc:ra_dav:version-url
-V 116
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
-END
 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/entries
+++ /dev/null
@@ -1,437 +1,1 @@
-10
 
-dir
-43
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet/trunk/source/bheaders/Bullet/BulletCollision/BroadphaseCollision
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet
-
-
-
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-d286d458-e9d7-44e5-8155-503c4d2c87dc
-
-btQuantizedBvh.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-eaa93c81a10bba5e3072b51484af00a9
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-18878
-
-btDispatcher.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-b4e8b89c6f60d6384bb0ed59abb82a93
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3590
-
-btOverlappingPairCache.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-10e50908c26e82e9f70bb7812d007651
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-12950
-
-btMultiSapBroadphase.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-6ce534deff076afdb5edb973057ee11f
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5536
-
-btDbvtBroadphase.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-192e0002d6b302cb4368b54a2de5d547
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-6380
-
-btBroadphaseInterface.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-485e50b66f18216f49fe658847f6de37
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3660
-
-btBroadphaseProxy.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-1a07a99379db9d7819e69b5fdd70d9a2
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-8104
-
-btAxisSweep3.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-0cba66bfe905883408f95f1a4a79caae
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-33407
-
-btDbvt.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-6475dd3c852c0da7a210e24941d4b5d2
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-33253
-
-btOverlappingPairCallback.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-ba88f5f6d37412abedb839513978d045
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1750
-
-btCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-e7443bfdc574ddbf8b26b2204cf98113
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2558
-
-btSimpleBroadphase.h
-file
-
-
-
-
-2011-02-26T06:26:35.000000Z
-cc8cb395b6bc249cc0417f2ddb06bc3f
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5524
-
-

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btAxisSweep3.h.svn-base
+++ /dev/null
@@ -1,1052 +1,1 @@
-//Bullet Continuous Collision Detection and Physics Library

-//Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-//

-// btAxisSweep3.h

-//

-// Copyright (c) 2006 Simon Hobbs

-//

-// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

-//

-// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

-//

-// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-//

-// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-//

-// 3. This notice may not be removed or altered from any source distribution.

-

-#ifndef AXIS_SWEEP_3_H

-#define AXIS_SWEEP_3_H

-

-#include "LinearMath/btVector3.h"

-#include "btOverlappingPairCache.h"

-#include "btBroadphaseInterface.h"

-#include "btBroadphaseProxy.h"

-#include "btOverlappingPairCallback.h"

-#include "btDbvtBroadphase.h"

-

-//#define DEBUG_BROADPHASE 1

-#define USE_OVERLAP_TEST_ON_REMOVES 1

-

-/// The internal templace class btAxisSweep3Internal implements the sweep and prune broadphase.

-/// It uses quantized integers to represent the begin and end points for each of the 3 axis.

-/// Dont use this class directly, use btAxisSweep3 or bt32BitAxisSweep3 instead.

-template <typename BP_FP_INT_TYPE>

-class btAxisSweep3Internal : public btBroadphaseInterface

-{

-protected:

-

-	BP_FP_INT_TYPE	m_bpHandleMask;

-	BP_FP_INT_TYPE	m_handleSentinel;

-

-public:

-	

- BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	class Edge

-	{

-	public:

-		BP_FP_INT_TYPE m_pos;			// low bit is min/max

-		BP_FP_INT_TYPE m_handle;

-

-		BP_FP_INT_TYPE IsMax() const {return static_cast<BP_FP_INT_TYPE>(m_pos & 1);}

-	};

-

-public:

-	class	Handle : public btBroadphaseProxy

-	{

-	public:

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-	

-		// indexes into the edge arrays

-		BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3];		// 6 * 2 = 12

-//		BP_FP_INT_TYPE m_uniqueId;

-		btBroadphaseProxy*	m_dbvtProxy;//for faster raycast

-		//void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject

-	

-		SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}

-		SIMD_FORCE_INLINE BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];}

-	};		// 24 bytes + 24 for Edge structures = 44 bytes total per entry

-

-	

-protected:

-	btVector3 m_worldAabbMin;						// overall system bounds

-	btVector3 m_worldAabbMax;						// overall system bounds

-

-	btVector3 m_quantize;						// scaling factor for quantization

-

-	BP_FP_INT_TYPE m_numHandles;						// number of active handles

-	BP_FP_INT_TYPE m_maxHandles;						// max number of handles

-	Handle* m_pHandles;						// handles pool

-	

-	BP_FP_INT_TYPE m_firstFreeHandle;		// free handles list

-

-	Edge* m_pEdges[3];						// edge arrays for the 3 axes (each array has m_maxHandles * 2 + 2 sentinel entries)

-	void* m_pEdgesRawPtr[3];

-

-	btOverlappingPairCache* m_pairCache;

-

-	///btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.

-	btOverlappingPairCallback* m_userPairCallback;

-	

-	bool	m_ownsPairCache;

-

-	int	m_invalidPair;

-

-	///additional dynamic aabb structure, used to accelerate ray cast queries.

-	///can be disabled using a optional argument in the constructor

-	btDbvtBroadphase*	m_raycastAccelerator;

-	btOverlappingPairCache*	m_nullPairCache;

-

-

-	// allocation/deallocation

-	BP_FP_INT_TYPE allocHandle();

-	void freeHandle(BP_FP_INT_TYPE handle);

-	

-

-	bool testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1);

-

-#ifdef DEBUG_BROADPHASE

-	void debugPrintAxis(int axis,bool checkCardinality=true);

-#endif //DEBUG_BROADPHASE

-

-	//Overlap* AddOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);

-	//void RemoveOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);

-

-	

-

-	void sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-	void sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-	void sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-	void sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-

-public:

-

-	btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0,bool disableRaycastAccelerator = false);

-

-	virtual	~btAxisSweep3Internal();

-

-	BP_FP_INT_TYPE getNumHandles() const

-	{

-		return m_numHandles;

-	}

-

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);

-	

-	BP_FP_INT_TYPE addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);

-	void removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher);

-	void updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);

-	SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}

-

-	virtual void resetPool(btDispatcher* dispatcher);

-

-	void	processAllOverlappingPairs(btOverlapCallback* callback);

-

-	//Broadphase Interface

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);

-	virtual void  getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-	

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));

-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);

-

-	

-	void quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const;

-	///unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result

-	void unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-	

-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-	btOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_pairCache;

-	}

-	const btOverlappingPairCache*	getOverlappingPairCache() const

-	{

-		return m_pairCache;

-	}

-

-	void	setOverlappingPairUserCallback(btOverlappingPairCallback* pairCallback)

-	{

-		m_userPairCallback = pairCallback;

-	}

-	const btOverlappingPairCallback*	getOverlappingPairUserCallback() const

-	{

-		return m_userPairCallback;

-	}

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const

-	{

-		aabbMin = m_worldAabbMin;

-		aabbMax = m_worldAabbMax;

-	}

-

-	virtual void	printStats()

-	{

-/*		printf("btAxisSweep3.h\n");

-		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);

-		printf("aabbMin=%f,%f,%f,aabbMax=%f,%f,%f\n",m_worldAabbMin.getX(),m_worldAabbMin.getY(),m_worldAabbMin.getZ(),

-			m_worldAabbMax.getX(),m_worldAabbMax.getY(),m_worldAabbMax.getZ());

-			*/

-

-	}

-

-};

-

-////////////////////////////////////////////////////////////////////

-

-

-

-

-#ifdef DEBUG_BROADPHASE

-#include <stdio.h>

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3<BP_FP_INT_TYPE>::debugPrintAxis(int axis, bool checkCardinality)

-{

-	int numEdges = m_pHandles[0].m_maxEdges[axis];

-	printf("SAP Axis %d, numEdges=%d\n",axis,numEdges);

-

-	int i;

-	for (i=0;i<numEdges+1;i++)

-	{

-		Edge* pEdge = m_pEdges[axis] + i;

-		Handle* pHandlePrev = getHandle(pEdge->m_handle);

-		int handleIndex = pEdge->IsMax()? pHandlePrev->m_maxEdges[axis] : pHandlePrev->m_minEdges[axis];

-		char beginOrEnd;

-		beginOrEnd=pEdge->IsMax()?'E':'B';

-		printf("	[%c,h=%d,p=%x,i=%d]\n",beginOrEnd,pEdge->m_handle,pEdge->m_pos,handleIndex);

-	}

-

-	if (checkCardinality)

-		btAssert(numEdges == m_numHandles*2+1);

-}

-#endif //DEBUG_BROADPHASE

-

-template <typename BP_FP_INT_TYPE>

-btBroadphaseProxy*	btAxisSweep3Internal<BP_FP_INT_TYPE>::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)

-{

-		(void)shapeType;

-		BP_FP_INT_TYPE handleId = addHandle(aabbMin,aabbMax, userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,multiSapProxy);

-		

-		Handle* handle = getHandle(handleId);

-		

-		if (m_raycastAccelerator)

-		{

-			btBroadphaseProxy* rayProxy = m_raycastAccelerator->createProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,0);

-			handle->m_dbvtProxy = rayProxy;

-		}

-		return handle;

-}

-

-

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)

-{

-	Handle* handle = static_cast<Handle*>(proxy);

-	if (m_raycastAccelerator)

-		m_raycastAccelerator->destroyProxy(handle->m_dbvtProxy,dispatcher);

-	removeHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), dispatcher);

-}

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)

-{

-	Handle* handle = static_cast<Handle*>(proxy);

-	handle->m_aabbMin = aabbMin;

-	handle->m_aabbMax = aabbMax;

-	updateHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), aabbMin, aabbMax,dispatcher);

-	if (m_raycastAccelerator)

-		m_raycastAccelerator->setAabb(handle->m_dbvtProxy,aabbMin,aabbMax,dispatcher);

-

-}

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)

-{

-	if (m_raycastAccelerator)

-	{

-		m_raycastAccelerator->rayTest(rayFrom,rayTo,rayCallback,aabbMin,aabbMax);

-	} else

-	{

-		//choose axis?

-		BP_FP_INT_TYPE axis = 0;

-		//for each proxy

-		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)

-		{

-			if (m_pEdges[axis][i].IsMax())

-			{

-				rayCallback.process(getHandle(m_pEdges[axis][i].m_handle));

-			}

-		}

-	}

-}

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)

-{

-	if (m_raycastAccelerator)

-	{

-		m_raycastAccelerator->aabbTest(aabbMin,aabbMax,callback);

-	} else

-	{

-		//choose axis?

-		BP_FP_INT_TYPE axis = 0;

-		//for each proxy

-		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)

-		{

-			if (m_pEdges[axis][i].IsMax())

-			{

-				Handle* handle = getHandle(m_pEdges[axis][i].m_handle);

-				if (TestAabbAgainstAabb2(aabbMin,aabbMax,handle->m_aabbMin,handle->m_aabbMax))

-				{

-					callback.process(handle);

-				}

-			}

-		}

-	}

-}

-

-

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const

-{

-	Handle* pHandle = static_cast<Handle*>(proxy);

-	aabbMin = pHandle->m_aabbMin;

-	aabbMax = pHandle->m_aabbMax;

-}

-

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const

-{

-	Handle* pHandle = static_cast<Handle*>(proxy);

-

-	unsigned short vecInMin[3];

-	unsigned short vecInMax[3];

-

-	vecInMin[0] = m_pEdges[0][pHandle->m_minEdges[0]].m_pos ;

-	vecInMax[0] = m_pEdges[0][pHandle->m_maxEdges[0]].m_pos +1 ;

-	vecInMin[1] = m_pEdges[1][pHandle->m_minEdges[1]].m_pos ;

-	vecInMax[1] = m_pEdges[1][pHandle->m_maxEdges[1]].m_pos +1 ;

-	vecInMin[2] = m_pEdges[2][pHandle->m_minEdges[2]].m_pos ;

-	vecInMax[2] = m_pEdges[2][pHandle->m_maxEdges[2]].m_pos +1 ;

-	

-	aabbMin.setValue((btScalar)(vecInMin[0]) / (m_quantize.getX()),(btScalar)(vecInMin[1]) / (m_quantize.getY()),(btScalar)(vecInMin[2]) / (m_quantize.getZ()));

-	aabbMin += m_worldAabbMin;

-	

-	aabbMax.setValue((btScalar)(vecInMax[0]) / (m_quantize.getX()),(btScalar)(vecInMax[1]) / (m_quantize.getY()),(btScalar)(vecInMax[2]) / (m_quantize.getZ()));

-	aabbMax += m_worldAabbMin;

-}

-

-

-

-

-template <typename BP_FP_INT_TYPE>

-btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)

-:m_bpHandleMask(handleMask),

-m_handleSentinel(handleSentinel),

-m_pairCache(pairCache),

-m_userPairCallback(0),

-m_ownsPairCache(false),

-m_invalidPair(0),

-m_raycastAccelerator(0)

-{

-	BP_FP_INT_TYPE maxHandles = static_cast<BP_FP_INT_TYPE>(userMaxHandles+1);//need to add one sentinel handle

-

-	if (!m_pairCache)

-	{

-		void* ptr = btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16);

-		m_pairCache = new(ptr) btHashedOverlappingPairCache();

-		m_ownsPairCache = true;

-	}

-

-	if (!disableRaycastAccelerator)

-	{

-		m_nullPairCache = new (btAlignedAlloc(sizeof(btNullPairCache),16)) btNullPairCache();

-		m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase(m_nullPairCache);//m_pairCache);

-		m_raycastAccelerator->m_deferedcollide = true;//don't add/remove pairs

-	}

-

-	//btAssert(bounds.HasVolume());

-

-	// init bounds

-	m_worldAabbMin = worldAabbMin;

-	m_worldAabbMax = worldAabbMax;

-

-	btVector3 aabbSize = m_worldAabbMax - m_worldAabbMin;

-

-	BP_FP_INT_TYPE	maxInt = m_handleSentinel;

-

-	m_quantize = btVector3(btScalar(maxInt),btScalar(maxInt),btScalar(maxInt)) / aabbSize;

-

-	// allocate handles buffer, using btAlignedAlloc, and put all handles on free list

-	m_pHandles = new Handle[maxHandles];

-	

-	m_maxHandles = maxHandles;

-	m_numHandles = 0;

-

-	// handle 0 is reserved as the null index, and is also used as the sentinel

-	m_firstFreeHandle = 1;

-	{

-		for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++)

-			m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));

-		m_pHandles[maxHandles - 1].SetNextFree(0);

-	}

-

-	{

-		// allocate edge buffers

-		for (int i = 0; i < 3; i++)

-		{

-			m_pEdgesRawPtr[i] = btAlignedAlloc(sizeof(Edge)*maxHandles*2,16);

-			m_pEdges[i] = new(m_pEdgesRawPtr[i]) Edge[maxHandles * 2];

-		}

-	}

-	//removed overlap management

-

-	// make boundary sentinels

-	

-	m_pHandles[0].m_clientObject = 0;

-

-	for (int axis = 0; axis < 3; axis++)

-	{

-		m_pHandles[0].m_minEdges[axis] = 0;

-		m_pHandles[0].m_maxEdges[axis] = 1;

-

-		m_pEdges[axis][0].m_pos = 0;

-		m_pEdges[axis][0].m_handle = 0;

-		m_pEdges[axis][1].m_pos = m_handleSentinel;

-		m_pEdges[axis][1].m_handle = 0;

-#ifdef DEBUG_BROADPHASE

-		debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-

-	}

-

-}

-

-template <typename BP_FP_INT_TYPE>

-btAxisSweep3Internal<BP_FP_INT_TYPE>::~btAxisSweep3Internal()

-{

-	if (m_raycastAccelerator)

-	{

-		m_nullPairCache->~btOverlappingPairCache();

-		btAlignedFree(m_nullPairCache);

-		m_raycastAccelerator->~btDbvtBroadphase();

-		btAlignedFree (m_raycastAccelerator);

-	}

-

-	for (int i = 2; i >= 0; i--)

-	{

-		btAlignedFree(m_pEdgesRawPtr[i]);

-	}

-	delete [] m_pHandles;

-

-	if (m_ownsPairCache)

-	{

-		m_pairCache->~btOverlappingPairCache();

-		btAlignedFree(m_pairCache);

-	}

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const

-{

-#ifdef OLD_CLAMPING_METHOD

-	///problem with this clamping method is that the floating point during quantization might still go outside the range [(0|isMax) .. (m_handleSentinel&m_bpHandleMask]|isMax]

-	///see http://code.google.com/p/bullet/issues/detail?id=87

-	btVector3 clampedPoint(point);

-	clampedPoint.setMax(m_worldAabbMin);

-	clampedPoint.setMin(m_worldAabbMax);

-	btVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize;

-	out[0] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getX() & m_bpHandleMask) | isMax);

-	out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & m_bpHandleMask) | isMax);

-	out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & m_bpHandleMask) | isMax);

-#else

-	btVector3 v = (point - m_worldAabbMin) * m_quantize;

-	out[0]=(v[0]<=0)?(BP_FP_INT_TYPE)isMax:(v[0]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[0]&m_bpHandleMask)|isMax);

-	out[1]=(v[1]<=0)?(BP_FP_INT_TYPE)isMax:(v[1]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[1]&m_bpHandleMask)|isMax);

-	out[2]=(v[2]<=0)?(BP_FP_INT_TYPE)isMax:(v[2]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[2]&m_bpHandleMask)|isMax);

-#endif //OLD_CLAMPING_METHOD

-}

-

-

-template <typename BP_FP_INT_TYPE>

-BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()

-{

-	btAssert(m_firstFreeHandle);

-

-	BP_FP_INT_TYPE handle = m_firstFreeHandle;

-	m_firstFreeHandle = getHandle(handle)->GetNextFree();

-	m_numHandles++;

-

-	return handle;

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::freeHandle(BP_FP_INT_TYPE handle)

-{

-	btAssert(handle > 0 && handle < m_maxHandles);

-

-	getHandle(handle)->SetNextFree(m_firstFreeHandle);

-	m_firstFreeHandle = handle;

-

-	m_numHandles--;

-}

-

-

-template <typename BP_FP_INT_TYPE>

-BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)

-{

-	// quantize the bounds

-	BP_FP_INT_TYPE min[3], max[3];

-	quantize(min, aabbMin, 0);

-	quantize(max, aabbMax, 1);

-

-	// allocate a handle

-	BP_FP_INT_TYPE handle = allocHandle();

-	

-

-	Handle* pHandle = getHandle(handle);

-	

-	pHandle->m_uniqueId = static_cast<int>(handle);

-	//pHandle->m_pOverlaps = 0;

-	pHandle->m_clientObject = pOwner;

-	pHandle->m_collisionFilterGroup = collisionFilterGroup;

-	pHandle->m_collisionFilterMask = collisionFilterMask;

-	pHandle->m_multiSapParentProxy = multiSapProxy;

-

-	// compute current limit of edge arrays

-	BP_FP_INT_TYPE limit = static_cast<BP_FP_INT_TYPE>(m_numHandles * 2);

-

-	

-	// insert new edges just inside the max boundary edge

-	for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++)

-	{

-

-		m_pHandles[0].m_maxEdges[axis] += 2;

-

-		m_pEdges[axis][limit + 1] = m_pEdges[axis][limit - 1];

-

-		m_pEdges[axis][limit - 1].m_pos = min[axis];

-		m_pEdges[axis][limit - 1].m_handle = handle;

-

-		m_pEdges[axis][limit].m_pos = max[axis];

-		m_pEdges[axis][limit].m_handle = handle;

-

-		pHandle->m_minEdges[axis] = static_cast<BP_FP_INT_TYPE>(limit - 1);

-		pHandle->m_maxEdges[axis] = limit;

-	}

-

-	// now sort the new edges to their correct position

-	sortMinDown(0, pHandle->m_minEdges[0], dispatcher,false);

-	sortMaxDown(0, pHandle->m_maxEdges[0], dispatcher,false);

-	sortMinDown(1, pHandle->m_minEdges[1], dispatcher,false);

-	sortMaxDown(1, pHandle->m_maxEdges[1], dispatcher,false);

-	sortMinDown(2, pHandle->m_minEdges[2], dispatcher,true);

-	sortMaxDown(2, pHandle->m_maxEdges[2], dispatcher,true);

-

-

-	return handle;

-}

-

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher)

-{

-

-	Handle* pHandle = getHandle(handle);

-

-	//explicitly remove the pairs containing the proxy

-	//we could do it also in the sortMinUp (passing true)

-	///@todo: compare performance

-	if (!m_pairCache->hasDeferredRemoval())

-	{

-		m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher);

-	}

-

-	// compute current limit of edge arrays

-	int limit = static_cast<int>(m_numHandles * 2);

-	

-	int axis;

-

-	for (axis = 0;axis<3;axis++)

-	{

-		m_pHandles[0].m_maxEdges[axis] -= 2;

-	}

-

-	// remove the edges by sorting them up to the end of the list

-	for ( axis = 0; axis < 3; axis++)

-	{

-		Edge* pEdges = m_pEdges[axis];

-		BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis];

-		pEdges[max].m_pos = m_handleSentinel;

-

-		sortMaxUp(axis,max,dispatcher,false);

-

-

-		BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];

-		pEdges[i].m_pos = m_handleSentinel;

-

-

-		sortMinUp(axis,i,dispatcher,false);

-

-		pEdges[limit-1].m_handle = 0;

-		pEdges[limit-1].m_pos = m_handleSentinel;

-		

-#ifdef DEBUG_BROADPHASE

-			debugPrintAxis(axis,false);

-#endif //DEBUG_BROADPHASE

-

-

-	}

-

-

-	// free the handle

-	freeHandle(handle);

-

-	

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::resetPool(btDispatcher* dispatcher)

-{

-	if (m_numHandles == 0)

-	{

-		m_firstFreeHandle = 1;

-		{

-			for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < m_maxHandles; i++)

-				m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));

-			m_pHandles[m_maxHandles - 1].SetNextFree(0);

-		}

-	}

-}       

-

-

-extern int gOverlappingPairs;

-//#include <stdio.h>

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatcher* dispatcher)

-{

-

-	if (m_pairCache->hasDeferredRemoval())

-	{

-	

-		btBroadphasePairArray&	overlappingPairArray = m_pairCache->getOverlappingPairArray();

-

-		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end

-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());

-

-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);

-		m_invalidPair = 0;

-

-		

-		int i;

-

-		btBroadphasePair previousPair;

-		previousPair.m_pProxy0 = 0;

-		previousPair.m_pProxy1 = 0;

-		previousPair.m_algorithm = 0;

-		

-		

-		for (i=0;i<overlappingPairArray.size();i++)

-		{

-		

-			btBroadphasePair& pair = overlappingPairArray[i];

-

-			bool isDuplicate = (pair == previousPair);

-

-			previousPair = pair;

-

-			bool needsRemoval = false;

-

-			if (!isDuplicate)

-			{

-				///important to use an AABB test that is consistent with the broadphase

-				bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);

-

-				if (hasOverlap)

-				{

-					needsRemoval = false;//callback->processOverlap(pair);

-				} else

-				{

-					needsRemoval = true;

-				}

-			} else

-			{

-				//remove duplicate

-				needsRemoval = true;

-				//should have no algorithm

-				btAssert(!pair.m_algorithm);

-			}

-			

-			if (needsRemoval)

-			{

-				m_pairCache->cleanOverlappingPair(pair,dispatcher);

-

-		//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);

-		//		m_overlappingPairArray.pop_back();

-				pair.m_pProxy0 = 0;

-				pair.m_pProxy1 = 0;

-				m_invalidPair++;

-				gOverlappingPairs--;

-			} 

-			

-		}

-

-	///if you don't like to skip the invalid pairs in the array, execute following code:

-	#define CLEAN_INVALID_PAIRS 1

-	#ifdef CLEAN_INVALID_PAIRS

-

-		//perform a sort, to sort 'invalid' pairs to the end

-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());

-

-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);

-		m_invalidPair = 0;

-	#endif//CLEAN_INVALID_PAIRS

-		

-		//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());

-	}

-

-}

-

-

-template <typename BP_FP_INT_TYPE>

-bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)

-{

-	const Handle* pHandleA = static_cast<Handle*>(proxy0);

-	const Handle* pHandleB = static_cast<Handle*>(proxy1);

-	

-	//optimization 1: check the array index (memory address), instead of the m_pos

-

-	for (int axis = 0; axis < 3; axis++)

-	{ 

-		if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || 

-			pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) 

-		{ 

-			return false; 

-		} 

-	} 

-	return true;

-}

-

-template <typename BP_FP_INT_TYPE>

-bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1)

-{

-	//optimization 1: check the array index (memory address), instead of the m_pos

-

-	if (pHandleA->m_maxEdges[axis0] < pHandleB->m_minEdges[axis0] || 

-		pHandleB->m_maxEdges[axis0] < pHandleA->m_minEdges[axis0] ||

-		pHandleA->m_maxEdges[axis1] < pHandleB->m_minEdges[axis1] ||

-		pHandleB->m_maxEdges[axis1] < pHandleA->m_minEdges[axis1]) 

-	{ 

-		return false; 

-	} 

-	return true;

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)

-{

-//	btAssert(bounds.IsFinite());

-	//btAssert(bounds.HasVolume());

-

-	Handle* pHandle = getHandle(handle);

-

-	// quantize the new bounds

-	BP_FP_INT_TYPE min[3], max[3];

-	quantize(min, aabbMin, 0);

-	quantize(max, aabbMax, 1);

-

-	// update changed edges

-	for (int axis = 0; axis < 3; axis++)

-	{

-		BP_FP_INT_TYPE emin = pHandle->m_minEdges[axis];

-		BP_FP_INT_TYPE emax = pHandle->m_maxEdges[axis];

-

-		int dmin = (int)min[axis] - (int)m_pEdges[axis][emin].m_pos;

-		int dmax = (int)max[axis] - (int)m_pEdges[axis][emax].m_pos;

-

-		m_pEdges[axis][emin].m_pos = min[axis];

-		m_pEdges[axis][emax].m_pos = max[axis];

-

-		// expand (only adds overlaps)

-		if (dmin < 0)

-			sortMinDown(axis, emin,dispatcher,true);

-

-		if (dmax > 0)

-			sortMaxUp(axis, emax,dispatcher,true);

-

-		// shrink (only removes overlaps)

-		if (dmin > 0)

-			sortMinUp(axis, emin,dispatcher,true);

-

-		if (dmax < 0)

-			sortMaxDown(axis, emax,dispatcher,true);

-

-#ifdef DEBUG_BROADPHASE

-	debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-	}

-

-	

-}

-

-

-

-

-// sorting a min edge downwards can only ever *add* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)

-{

-

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pPrev = pEdge - 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pEdge->m_pos < pPrev->m_pos)

-	{

-		Handle* pHandlePrev = getHandle(pPrev->m_handle);

-

-		if (pPrev->IsMax())

-		{

-			// if previous edge is a maximum check the bounds and add an overlap if necessary

-			const int axis1 = (1  << axis) & 3;

-			const int axis2 = (1  << axis1) & 3;

-			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandlePrev,axis1,axis2))

-			{

-				m_pairCache->addOverlappingPair(pHandleEdge,pHandlePrev);

-				if (m_userPairCallback)

-					m_userPairCallback->addOverlappingPair(pHandleEdge,pHandlePrev);

-

-				//AddOverlap(pEdge->m_handle, pPrev->m_handle);

-

-			}

-

-			// update edge reference in other handle

-			pHandlePrev->m_maxEdges[axis]++;

-		}

-		else

-			pHandlePrev->m_minEdges[axis]++;

-

-		pHandleEdge->m_minEdges[axis]--;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pPrev;

-		*pPrev = swap;

-

-		// decrement

-		pEdge--;

-		pPrev--;

-	}

-

-#ifdef DEBUG_BROADPHASE

-	debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-

-}

-

-// sorting a min edge upwards can only ever *remove* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)

-{

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pNext = pEdge + 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))

-	{

-		Handle* pHandleNext = getHandle(pNext->m_handle);

-

-		if (pNext->IsMax())

-		{

-			Handle* handle0 = getHandle(pEdge->m_handle);

-			Handle* handle1 = getHandle(pNext->m_handle);

-			const int axis1 = (1  << axis) & 3;

-			const int axis2 = (1  << axis1) & 3;

-			

-			// if next edge is maximum remove any overlap between the two handles

-			if (updateOverlaps 

-#ifdef USE_OVERLAP_TEST_ON_REMOVES

-				&& testOverlap2D(handle0,handle1,axis1,axis2)

-#endif //USE_OVERLAP_TEST_ON_REMOVES

-				)

-			{

-				

-

-				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);	

-				if (m_userPairCallback)

-					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);

-				

-			}

-

-

-			// update edge reference in other handle

-			pHandleNext->m_maxEdges[axis]--;

-		}

-		else

-			pHandleNext->m_minEdges[axis]--;

-

-		pHandleEdge->m_minEdges[axis]++;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pNext;

-		*pNext = swap;

-

-		// increment

-		pEdge++;

-		pNext++;

-	}

-

-

-}

-

-// sorting a max edge downwards can only ever *remove* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)

-{

-

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pPrev = pEdge - 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pEdge->m_pos < pPrev->m_pos)

-	{

-		Handle* pHandlePrev = getHandle(pPrev->m_handle);

-

-		if (!pPrev->IsMax())

-		{

-			// if previous edge was a minimum remove any overlap between the two handles

-			Handle* handle0 = getHandle(pEdge->m_handle);

-			Handle* handle1 = getHandle(pPrev->m_handle);

-			const int axis1 = (1  << axis) & 3;

-			const int axis2 = (1  << axis1) & 3;

-

-			if (updateOverlaps  

-#ifdef USE_OVERLAP_TEST_ON_REMOVES

-				&& testOverlap2D(handle0,handle1,axis1,axis2)

-#endif //USE_OVERLAP_TEST_ON_REMOVES

-				)

-			{

-				//this is done during the overlappingpairarray iteration/narrowphase collision

-

-				

-				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);

-				if (m_userPairCallback)

-					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);

-			

-

-

-			}

-

-			// update edge reference in other handle

-			pHandlePrev->m_minEdges[axis]++;;

-		}

-		else

-			pHandlePrev->m_maxEdges[axis]++;

-

-		pHandleEdge->m_maxEdges[axis]--;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pPrev;

-		*pPrev = swap;

-

-		// decrement

-		pEdge--;

-		pPrev--;

-	}

-

-	

-#ifdef DEBUG_BROADPHASE

-	debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-

-}

-

-// sorting a max edge upwards can only ever *add* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)

-{

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pNext = pEdge + 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))

-	{

-		Handle* pHandleNext = getHandle(pNext->m_handle);

-

-		const int axis1 = (1  << axis) & 3;

-		const int axis2 = (1  << axis1) & 3;

-

-		if (!pNext->IsMax())

-		{

-			// if next edge is a minimum check the bounds and add an overlap if necessary

-			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandleNext,axis1,axis2))

-			{

-				Handle* handle0 = getHandle(pEdge->m_handle);

-				Handle* handle1 = getHandle(pNext->m_handle);

-				m_pairCache->addOverlappingPair(handle0,handle1);

-				if (m_userPairCallback)

-					m_userPairCallback->addOverlappingPair(handle0,handle1);

-			}

-

-			// update edge reference in other handle

-			pHandleNext->m_minEdges[axis]--;

-		}

-		else

-			pHandleNext->m_maxEdges[axis]--;

-

-		pHandleEdge->m_maxEdges[axis]++;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pNext;

-		*pNext = swap;

-

-		// increment

-		pEdge++;

-		pNext++;

-	}

-	

-}

-

-

-

-////////////////////////////////////////////////////////////////////

-

-

-/// The btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase.

-/// It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats.

-/// For large worlds and many objects, use bt32BitAxisSweep3 or btDbvtBroadphase instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance.

-class btAxisSweep3 : public btAxisSweep3Internal<unsigned short int>

-{

-public:

-

-	btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);

-

-};

-

-/// The bt32BitAxisSweep3 allows higher precision quantization and more objects compared to the btAxisSweep3 sweep and prune.

-/// This comes at the cost of more memory per handle, and a bit slower performance.

-/// It uses arrays rather then lists for storage of the 3 axis.

-class bt32BitAxisSweep3 : public btAxisSweep3Internal<unsigned int>

-{

-public:

-

-	bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);

-

-};

-

-#endif

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btBroadphaseInterface.h.svn-base
+++ /dev/null
@@ -1,83 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef		BROADPHASE_INTERFACE_H

-#define 	BROADPHASE_INTERFACE_H

-

-

-

-struct btDispatcherInfo;

-class btDispatcher;

-#include "btBroadphaseProxy.h"

-

-class btOverlappingPairCache;

-

-

-

-struct	btBroadphaseAabbCallback

-{

-	virtual ~btBroadphaseAabbCallback() {}

-	virtual bool	process(const btBroadphaseProxy* proxy) = 0;

-};

-

-

-struct	btBroadphaseRayCallback : public btBroadphaseAabbCallback

-{

-	///added some cached data to accelerate ray-AABB tests

-	btVector3		m_rayDirectionInverse;

-	unsigned int	m_signs[3];

-	btScalar		m_lambda_max;

-

-	virtual ~btBroadphaseRayCallback() {}

-};

-

-#include "LinearMath/btVector3.h"

-

-///The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.

-///Some implementations for this broadphase interface include btAxisSweep3, bt32BitAxisSweep3 and btDbvtBroadphase.

-///The actual overlapping pair management, storage, adding and removing of pairs is dealt by the btOverlappingPairCache class.

-class btBroadphaseInterface

-{

-public:

-	virtual ~btBroadphaseInterface() {}

-

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy) =0;

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)=0;

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0;

-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const =0;

-

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0)) = 0;

-

-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback) = 0;

-

-	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher)=0;

-

-	virtual	btOverlappingPairCache*	getOverlappingPairCache()=0;

-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const =0;

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const =0;

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher) { (void) dispatcher; };

-

-	virtual void	printStats() = 0;

-

-};

-

-#endif //BROADPHASE_INTERFACE_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btBroadphaseProxy.h.svn-base
+++ /dev/null
@@ -1,271 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BROADPHASE_PROXY_H

-#define BROADPHASE_PROXY_H

-

-#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btAlignedAllocator.h"

-

-

-/// btDispatcher uses these types

-/// IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave

-/// to facilitate type checking

-/// CUSTOM_POLYHEDRAL_SHAPE_TYPE,CUSTOM_CONVEX_SHAPE_TYPE and CUSTOM_CONCAVE_SHAPE_TYPE can be used to extend Bullet without modifying source code

-enum BroadphaseNativeTypes

-{

-	// polyhedral convex shapes

-	BOX_SHAPE_PROXYTYPE,

-	TRIANGLE_SHAPE_PROXYTYPE,

-	TETRAHEDRAL_SHAPE_PROXYTYPE,

-	CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE,

-	CONVEX_HULL_SHAPE_PROXYTYPE,

-	CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE,

-	CUSTOM_POLYHEDRAL_SHAPE_TYPE,

-//implicit convex shapes

-IMPLICIT_CONVEX_SHAPES_START_HERE,

-	SPHERE_SHAPE_PROXYTYPE,

-	MULTI_SPHERE_SHAPE_PROXYTYPE,

-	CAPSULE_SHAPE_PROXYTYPE,

-	CONE_SHAPE_PROXYTYPE,

-	CONVEX_SHAPE_PROXYTYPE,

-	CYLINDER_SHAPE_PROXYTYPE,

-	UNIFORM_SCALING_SHAPE_PROXYTYPE,

-	MINKOWSKI_SUM_SHAPE_PROXYTYPE,

-	MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,

-	BOX_2D_SHAPE_PROXYTYPE,

-	CONVEX_2D_SHAPE_PROXYTYPE,

-	CUSTOM_CONVEX_SHAPE_TYPE,

-//concave shapes

-CONCAVE_SHAPES_START_HERE,

-	//keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!

-	TRIANGLE_MESH_SHAPE_PROXYTYPE,

-	SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE,

-	///used for demo integration FAST/Swift collision library and Bullet

-	FAST_CONCAVE_MESH_PROXYTYPE,

-	//terrain

-	TERRAIN_SHAPE_PROXYTYPE,

-///Used for GIMPACT Trimesh integration

-	GIMPACT_SHAPE_PROXYTYPE,

-///Multimaterial mesh

-    MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE,

-	

-	EMPTY_SHAPE_PROXYTYPE,

-	STATIC_PLANE_PROXYTYPE,

-	CUSTOM_CONCAVE_SHAPE_TYPE,

-CONCAVE_SHAPES_END_HERE,

-

-	COMPOUND_SHAPE_PROXYTYPE,

-

-	SOFTBODY_SHAPE_PROXYTYPE,

-	HFFLUID_SHAPE_PROXYTYPE,

-	HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE,

-	INVALID_SHAPE_PROXYTYPE,

-

-	MAX_BROADPHASE_COLLISION_TYPES

-	

-};

-

-

-///The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 

-///It stores collision shape type information, collision filter information and a client object, typically a btCollisionObject or btRigidBody.

-ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy

-{

-

-BT_DECLARE_ALIGNED_ALLOCATOR();

-	

-	///optional filtering to cull potential collisions

-	enum CollisionFilterGroups

-	{

-	        DefaultFilter = 1,

-	        StaticFilter = 2,

-	        KinematicFilter = 4,

-	        DebrisFilter = 8,

-			SensorTrigger = 16,

-			CharacterFilter = 32,

-	        AllFilter = -1 //all bits sets: DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger

-	};

-

-	//Usually the client btCollisionObject or Rigidbody class

-	void*	m_clientObject;

-	short int m_collisionFilterGroup;

-	short int m_collisionFilterMask;

-	void*	m_multiSapParentProxy;		

-	int			m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.

-

-	btVector3	m_aabbMin;

-	btVector3	m_aabbMax;

-

-	SIMD_FORCE_INLINE int getUid() const

-	{

-		return m_uniqueId;

-	}

-

-	//used for memory pools

-	btBroadphaseProxy() :m_clientObject(0),m_multiSapParentProxy(0)

-	{

-	}

-

-	btBroadphaseProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)

-		:m_clientObject(userPtr),

-		m_collisionFilterGroup(collisionFilterGroup),

-		m_collisionFilterMask(collisionFilterMask),

-		m_aabbMin(aabbMin),

-		m_aabbMax(aabbMax)

-	{

-		m_multiSapParentProxy = multiSapParentProxy;

-	}

-

-	

-

-	static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType)

-	{

-		return (proxyType  < IMPLICIT_CONVEX_SHAPES_START_HERE);

-	}

-

-	static SIMD_FORCE_INLINE bool	isConvex(int proxyType)

-	{

-		return (proxyType < CONCAVE_SHAPES_START_HERE);

-	}

-

-	static SIMD_FORCE_INLINE bool	isNonMoving(int proxyType)

-	{

-		return (isConcave(proxyType) && !(proxyType==GIMPACT_SHAPE_PROXYTYPE));

-	}

-

-	static SIMD_FORCE_INLINE bool	isConcave(int proxyType)

-	{

-		return ((proxyType > CONCAVE_SHAPES_START_HERE) &&

-			(proxyType < CONCAVE_SHAPES_END_HERE));

-	}

-	static SIMD_FORCE_INLINE bool	isCompound(int proxyType)

-	{

-		return (proxyType == COMPOUND_SHAPE_PROXYTYPE);

-	}

-

-	static SIMD_FORCE_INLINE bool	isSoftBody(int proxyType)

-	{

-		return (proxyType == SOFTBODY_SHAPE_PROXYTYPE);

-	}

-

-	static SIMD_FORCE_INLINE bool isInfinite(int proxyType)

-	{

-		return (proxyType == STATIC_PLANE_PROXYTYPE);

-	}

-

-	static SIMD_FORCE_INLINE bool isConvex2d(int proxyType)

-	{

-		return (proxyType == BOX_2D_SHAPE_PROXYTYPE) ||	(proxyType == CONVEX_2D_SHAPE_PROXYTYPE);

-	}

-

-	

-}

-;

-

-class btCollisionAlgorithm;

-

-struct btBroadphaseProxy;

-

-

-

-///The btBroadphasePair class contains a pair of aabb-overlapping objects.

-///A btDispatcher can search a btCollisionAlgorithm that performs exact/narrowphase collision detection on the actual collision shapes.

-ATTRIBUTE_ALIGNED16(struct) btBroadphasePair

-{

-	btBroadphasePair ()

-		:

-	m_pProxy0(0),

-		m_pProxy1(0),

-		m_algorithm(0),

-		m_internalInfo1(0)

-	{

-	}

-

-BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	btBroadphasePair(const btBroadphasePair& other)

-		:		m_pProxy0(other.m_pProxy0),

-				m_pProxy1(other.m_pProxy1),

-				m_algorithm(other.m_algorithm),

-				m_internalInfo1(other.m_internalInfo1)

-	{

-	}

-	btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1)

-	{

-

-		//keep them sorted, so the std::set operations work

-		if (proxy0.m_uniqueId < proxy1.m_uniqueId)

-        { 

-            m_pProxy0 = &proxy0; 

-            m_pProxy1 = &proxy1; 

-        }

-        else 

-        { 

-			m_pProxy0 = &proxy1; 

-            m_pProxy1 = &proxy0; 

-        }

-

-		m_algorithm = 0;

-		m_internalInfo1 = 0;

-

-	}

-	

-	btBroadphaseProxy* m_pProxy0;

-	btBroadphaseProxy* m_pProxy1;

-	

-	mutable btCollisionAlgorithm* m_algorithm;

-	union { void* m_internalInfo1; int m_internalTmpValue;};//don't use this data, it will be removed in future version.

-

-};

-

-/*

-//comparison for set operation, see Solid DT_Encounter

-SIMD_FORCE_INLINE bool operator<(const btBroadphasePair& a, const btBroadphasePair& b) 

-{ 

-    return a.m_pProxy0 < b.m_pProxy0 || 

-        (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 < b.m_pProxy1); 

-}

-*/

-

-

-

-class btBroadphasePairSortPredicate

-{

-	public:

-

-		bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b )

-		{

-			const int uidA0 = a.m_pProxy0 ? a.m_pProxy0->m_uniqueId : -1;

-			const int uidB0 = b.m_pProxy0 ? b.m_pProxy0->m_uniqueId : -1;

-			const int uidA1 = a.m_pProxy1 ? a.m_pProxy1->m_uniqueId : -1;

-			const int uidB1 = b.m_pProxy1 ? b.m_pProxy1->m_uniqueId : -1;

-

-			 return uidA0 > uidB0 || 

-				(a.m_pProxy0 == b.m_pProxy0 && uidA1 > uidB1) ||

-				(a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 == b.m_pProxy1 && a.m_algorithm > b.m_algorithm); 

-		}

-};

-

-

-SIMD_FORCE_INLINE bool operator==(const btBroadphasePair& a, const btBroadphasePair& b) 

-{

-	 return (a.m_pProxy0 == b.m_pProxy0) && (a.m_pProxy1 == b.m_pProxy1);

-}

-

-

-#endif //BROADPHASE_PROXY_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,81 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef COLLISION_ALGORITHM_H

-#define COLLISION_ALGORITHM_H

-

-#include "LinearMath/btScalar.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-struct btBroadphaseProxy;

-class btDispatcher;

-class btManifoldResult;

-class btCollisionObject;

-struct btDispatcherInfo;

-class	btPersistentManifold;

-

-typedef btAlignedObjectArray<btPersistentManifold*>	btManifoldArray;

-

-struct btCollisionAlgorithmConstructionInfo

-{

-	btCollisionAlgorithmConstructionInfo()

-		:m_dispatcher1(0),

-		m_manifold(0)

-	{

-	}

-	btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)

-		:m_dispatcher1(dispatcher)

-	{

-		(void)temp;

-	}

-

-	btDispatcher*	m_dispatcher1;

-	btPersistentManifold*	m_manifold;

-

-	int	getDispatcherId();

-

-};

-

-

-///btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher.

-///It is persistent over frames

-class btCollisionAlgorithm

-{

-

-protected:

-

-	btDispatcher*	m_dispatcher;

-

-protected:

-	int	getDispatcherId();

-	

-public:

-

-	btCollisionAlgorithm() {};

-

-	btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);

-

-	virtual ~btCollisionAlgorithm() {};

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray) = 0;

-};

-

-

-#endif //COLLISION_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btDbvt.h.svn-base
+++ /dev/null
@@ -1,1257 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-///btDbvt implementation by Nathanael Presson

-

-#ifndef BT_DYNAMIC_BOUNDING_VOLUME_TREE_H

-#define BT_DYNAMIC_BOUNDING_VOLUME_TREE_H

-

-#include "LinearMath/btAlignedObjectArray.h"

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btTransform.h"

-#include "LinearMath/btAabbUtil2.h"

-

-//

-// Compile time configuration

-//

-

-

-// Implementation profiles

-#define DBVT_IMPL_GENERIC		0	// Generic implementation	

-#define DBVT_IMPL_SSE			1	// SSE

-

-// Template implementation of ICollide

-#ifdef _WIN32

-#if (defined (_MSC_VER) && _MSC_VER >= 1400)

-#define	DBVT_USE_TEMPLATE		1

-#else

-#define	DBVT_USE_TEMPLATE		0

-#endif

-#else

-#define	DBVT_USE_TEMPLATE		0

-#endif

-

-// Use only intrinsics instead of inline asm

-#define DBVT_USE_INTRINSIC_SSE	1

-

-// Using memmov for collideOCL

-#define DBVT_USE_MEMMOVE		1

-

-// Enable benchmarking code

-#define	DBVT_ENABLE_BENCHMARK	0

-

-// Inlining

-#define DBVT_INLINE				SIMD_FORCE_INLINE

-

-// Specific methods implementation

-

-//SSE gives errors on a MSVC 7.1

-#if defined (BT_USE_SSE) && defined (_WIN32)

-#define DBVT_SELECT_IMPL		DBVT_IMPL_SSE

-#define DBVT_MERGE_IMPL			DBVT_IMPL_SSE

-#define DBVT_INT0_IMPL			DBVT_IMPL_SSE

-#else

-#define DBVT_SELECT_IMPL		DBVT_IMPL_GENERIC

-#define DBVT_MERGE_IMPL			DBVT_IMPL_GENERIC

-#define DBVT_INT0_IMPL			DBVT_IMPL_GENERIC

-#endif

-

-#if	(DBVT_SELECT_IMPL==DBVT_IMPL_SSE)||	\

-	(DBVT_MERGE_IMPL==DBVT_IMPL_SSE)||	\

-	(DBVT_INT0_IMPL==DBVT_IMPL_SSE)

-#include <emmintrin.h>

-#endif

-

-//

-// Auto config and checks

-//

-

-#if DBVT_USE_TEMPLATE

-#define	DBVT_VIRTUAL

-#define DBVT_VIRTUAL_DTOR(a)

-#define DBVT_PREFIX					template <typename T>

-#define DBVT_IPOLICY				T& policy

-#define DBVT_CHECKTYPE				static const ICollide&	typechecker=*(T*)1;(void)typechecker;

-#else

-#define	DBVT_VIRTUAL_DTOR(a)		virtual ~a() {}

-#define DBVT_VIRTUAL				virtual

-#define DBVT_PREFIX

-#define DBVT_IPOLICY				ICollide& policy

-#define DBVT_CHECKTYPE

-#endif

-

-#if DBVT_USE_MEMMOVE

-#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)

-#include <memory.h>

-#endif

-#include <string.h>

-#endif

-

-#ifndef DBVT_USE_TEMPLATE

-#error "DBVT_USE_TEMPLATE undefined"

-#endif

-

-#ifndef DBVT_USE_MEMMOVE

-#error "DBVT_USE_MEMMOVE undefined"

-#endif

-

-#ifndef DBVT_ENABLE_BENCHMARK

-#error "DBVT_ENABLE_BENCHMARK undefined"

-#endif

-

-#ifndef DBVT_SELECT_IMPL

-#error "DBVT_SELECT_IMPL undefined"

-#endif

-

-#ifndef DBVT_MERGE_IMPL

-#error "DBVT_MERGE_IMPL undefined"

-#endif

-

-#ifndef DBVT_INT0_IMPL

-#error "DBVT_INT0_IMPL undefined"

-#endif

-

-//

-// Defaults volumes

-//

-

-/* btDbvtAabbMm			*/ 

-struct	btDbvtAabbMm

-{

-	DBVT_INLINE btVector3			Center() const	{ return((mi+mx)/2); }

-	DBVT_INLINE btVector3			Lengths() const	{ return(mx-mi); }

-	DBVT_INLINE btVector3			Extents() const	{ return((mx-mi)/2); }

-	DBVT_INLINE const btVector3&	Mins() const	{ return(mi); }

-	DBVT_INLINE const btVector3&	Maxs() const	{ return(mx); }

-	static inline btDbvtAabbMm		FromCE(const btVector3& c,const btVector3& e);

-	static inline btDbvtAabbMm		FromCR(const btVector3& c,btScalar r);

-	static inline btDbvtAabbMm		FromMM(const btVector3& mi,const btVector3& mx);

-	static inline btDbvtAabbMm		FromPoints(const btVector3* pts,int n);

-	static inline btDbvtAabbMm		FromPoints(const btVector3** ppts,int n);

-	DBVT_INLINE void				Expand(const btVector3& e);

-	DBVT_INLINE void				SignedExpand(const btVector3& e);

-	DBVT_INLINE bool				Contain(const btDbvtAabbMm& a) const;

-	DBVT_INLINE int					Classify(const btVector3& n,btScalar o,int s) const;

-	DBVT_INLINE btScalar			ProjectMinimum(const btVector3& v,unsigned signs) const;

-	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-	

-	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,

-		const btVector3& b);

-

-	DBVT_INLINE friend btScalar		Proximity(	const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-	DBVT_INLINE friend int			Select(		const btDbvtAabbMm& o,

-		const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-	DBVT_INLINE friend void			Merge(		const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b,

-		btDbvtAabbMm& r);

-	DBVT_INLINE friend bool			NotEqual(	const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-private:

-	DBVT_INLINE void				AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const;

-private:

-	btVector3	mi,mx;

-};

-

-// Types	

-typedef	btDbvtAabbMm	btDbvtVolume;

-

-/* btDbvtNode				*/ 

-struct	btDbvtNode

-{

-	btDbvtVolume	volume;

-	btDbvtNode*		parent;

-	DBVT_INLINE bool	isleaf() const		{ return(childs[1]==0); }

-	DBVT_INLINE bool	isinternal() const	{ return(!isleaf()); }

-	union

-	{

-		btDbvtNode*	childs[2];

-		void*	data;

-		int		dataAsInt;

-	};

-};

-

-///The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree).

-///This btDbvt is used for soft body collision detection and for the btDbvtBroadphase. It has a fast insert, remove and update of nodes.

-///Unlike the btQuantizedBvh, nodes can be dynamically moved around, which allows for change in topology of the underlying data structure.

-struct	btDbvt

-{

-	/* Stack element	*/ 

-	struct	sStkNN

-	{

-		const btDbvtNode*	a;

-		const btDbvtNode*	b;

-		sStkNN() {}

-		sStkNN(const btDbvtNode* na,const btDbvtNode* nb) : a(na),b(nb) {}

-	};

-	struct	sStkNP

-	{

-		const btDbvtNode*	node;

-		int			mask;

-		sStkNP(const btDbvtNode* n,unsigned m) : node(n),mask(m) {}

-	};

-	struct	sStkNPS

-	{

-		const btDbvtNode*	node;

-		int			mask;

-		btScalar	value;

-		sStkNPS() {}

-		sStkNPS(const btDbvtNode* n,unsigned m,btScalar v) : node(n),mask(m),value(v) {}

-	};

-	struct	sStkCLN

-	{

-		const btDbvtNode*	node;

-		btDbvtNode*		parent;

-		sStkCLN(const btDbvtNode* n,btDbvtNode* p) : node(n),parent(p) {}

-	};

-	// Policies/Interfaces

-

-	/* ICollide	*/ 

-	struct	ICollide

-	{		

-		DBVT_VIRTUAL_DTOR(ICollide)

-			DBVT_VIRTUAL void	Process(const btDbvtNode*,const btDbvtNode*)		{}

-		DBVT_VIRTUAL void	Process(const btDbvtNode*)					{}

-		DBVT_VIRTUAL void	Process(const btDbvtNode* n,btScalar)			{ Process(n); }

-		DBVT_VIRTUAL bool	Descent(const btDbvtNode*)					{ return(true); }

-		DBVT_VIRTUAL bool	AllLeaves(const btDbvtNode*)					{ return(true); }

-	};

-	/* IWriter	*/ 

-	struct	IWriter

-	{

-		virtual ~IWriter() {}

-		virtual void		Prepare(const btDbvtNode* root,int numnodes)=0;

-		virtual void		WriteNode(const btDbvtNode*,int index,int parent,int child0,int child1)=0;

-		virtual void		WriteLeaf(const btDbvtNode*,int index,int parent)=0;

-	};

-	/* IClone	*/ 

-	struct	IClone

-	{

-		virtual ~IClone()	{}

-		virtual void		CloneLeaf(btDbvtNode*) {}

-	};

-

-	// Constants

-	enum	{

-		SIMPLE_STACKSIZE	=	64,

-		DOUBLE_STACKSIZE	=	SIMPLE_STACKSIZE*2

-	};

-

-	// Fields

-	btDbvtNode*		m_root;

-	btDbvtNode*		m_free;

-	int				m_lkhd;

-	int				m_leaves;

-	unsigned		m_opath;

-

-	

-	btAlignedObjectArray<sStkNN>	m_stkStack;

-

-

-	// Methods

-	btDbvt();

-	~btDbvt();

-	void			clear();

-	bool			empty() const { return(0==m_root); }

-	void			optimizeBottomUp();

-	void			optimizeTopDown(int bu_treshold=128);

-	void			optimizeIncremental(int passes);

-	btDbvtNode*		insert(const btDbvtVolume& box,void* data);

-	void			update(btDbvtNode* leaf,int lookahead=-1);

-	void			update(btDbvtNode* leaf,btDbvtVolume& volume);

-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity,btScalar margin);

-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity);

-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,btScalar margin);	

-	void			remove(btDbvtNode* leaf);

-	void			write(IWriter* iwriter) const;

-	void			clone(btDbvt& dest,IClone* iclone=0) const;

-	static int		maxdepth(const btDbvtNode* node);

-	static int		countLeaves(const btDbvtNode* node);

-	static void		extractLeaves(const btDbvtNode* node,btAlignedObjectArray<const btDbvtNode*>& leaves);

-#if DBVT_ENABLE_BENCHMARK

-	static void		benchmark();

-#else

-	static void		benchmark(){}

-#endif

-	// DBVT_IPOLICY must support ICollide policy/interface

-	DBVT_PREFIX

-		static void		enumNodes(	const btDbvtNode* root,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		static void		enumLeaves(	const btDbvtNode* root,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		void		collideTT(	const btDbvtNode* root0,

-		const btDbvtNode* root1,

-		DBVT_IPOLICY);

-

-	DBVT_PREFIX

-		void		collideTTpersistentStack(	const btDbvtNode* root0,

-		  const btDbvtNode* root1,

-		  DBVT_IPOLICY);

-#if 0

-	DBVT_PREFIX

-		void		collideTT(	const btDbvtNode* root0,

-		const btDbvtNode* root1,

-		const btTransform& xform,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		void		collideTT(	const btDbvtNode* root0,

-		const btTransform& xform0,

-		const btDbvtNode* root1,

-		const btTransform& xform1,

-		DBVT_IPOLICY);

-#endif

-

-	DBVT_PREFIX

-		void		collideTV(	const btDbvtNode* root,

-		const btDbvtVolume& volume,

-		DBVT_IPOLICY);

-	///rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thread-safe (uses locking etc)

-	///rayTest is slower than rayTestInternal, because it builds a local stack, using memory allocations, and it recomputes signs/rayDirectionInverses each time

-	DBVT_PREFIX

-		static void		rayTest(	const btDbvtNode* root,

-		const btVector3& rayFrom,

-		const btVector3& rayTo,

-		DBVT_IPOLICY);

-	///rayTestInternal is faster than rayTest, because it uses a persistent stack (to reduce dynamic memory allocations to a minimum) and it uses precomputed signs/rayInverseDirections

-	///rayTestInternal is used by btDbvtBroadphase to accelerate world ray casts

-	DBVT_PREFIX

-		void		rayTestInternal(	const btDbvtNode* root,

-								const btVector3& rayFrom,

-								const btVector3& rayTo,

-								const btVector3& rayDirectionInverse,

-								unsigned int signs[3],

-								btScalar lambda_max,

-								const btVector3& aabbMin,

-								const btVector3& aabbMax,

-								DBVT_IPOLICY) const;

-

-	DBVT_PREFIX

-		static void		collideKDOP(const btDbvtNode* root,

-		const btVector3* normals,

-		const btScalar* offsets,

-		int count,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		static void		collideOCL(	const btDbvtNode* root,

-		const btVector3* normals,

-		const btScalar* offsets,

-		const btVector3& sortaxis,

-		int count,								

-		DBVT_IPOLICY,

-		bool fullsort=true);

-	DBVT_PREFIX

-		static void		collideTU(	const btDbvtNode* root,

-		DBVT_IPOLICY);

-	// Helpers	

-	static DBVT_INLINE int	nearest(const int* i,const btDbvt::sStkNPS* a,btScalar v,int l,int h)

-	{

-		int	m=0;

-		while(l<h)

-		{

-			m=(l+h)>>1;

-			if(a[i[m]].value>=v) l=m+1; else h=m;

-		}

-		return(h);

-	}

-	static DBVT_INLINE int	allocate(	btAlignedObjectArray<int>& ifree,

-		btAlignedObjectArray<sStkNPS>& stock,

-		const sStkNPS& value)

-	{

-		int	i;

-		if(ifree.size()>0)

-		{ i=ifree[ifree.size()-1];ifree.pop_back();stock[i]=value; }

-		else

-		{ i=stock.size();stock.push_back(value); }

-		return(i); 

-	}

-	//

-private:

-	btDbvt(const btDbvt&)	{}	

-};

-

-//

-// Inline's

-//

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromCE(const btVector3& c,const btVector3& e)

-{

-	btDbvtAabbMm box;

-	box.mi=c-e;box.mx=c+e;

-	return(box);

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromCR(const btVector3& c,btScalar r)

-{

-	return(FromCE(c,btVector3(r,r,r)));

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromMM(const btVector3& mi,const btVector3& mx)

-{

-	btDbvtAabbMm box;

-	box.mi=mi;box.mx=mx;

-	return(box);

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3* pts,int n)

-{

-	btDbvtAabbMm box;

-	box.mi=box.mx=pts[0];

-	for(int i=1;i<n;++i)

-	{

-		box.mi.setMin(pts[i]);

-		box.mx.setMax(pts[i]);

-	}

-	return(box);

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3** ppts,int n)

-{

-	btDbvtAabbMm box;

-	box.mi=box.mx=*ppts[0];

-	for(int i=1;i<n;++i)

-	{

-		box.mi.setMin(*ppts[i]);

-		box.mx.setMax(*ppts[i]);

-	}

-	return(box);

-}

-

-//

-DBVT_INLINE void		btDbvtAabbMm::Expand(const btVector3& e)

-{

-	mi-=e;mx+=e;

-}

-

-//

-DBVT_INLINE void		btDbvtAabbMm::SignedExpand(const btVector3& e)

-{

-	if(e.x()>0) mx.setX(mx.x()+e[0]); else mi.setX(mi.x()+e[0]);

-	if(e.y()>0) mx.setY(mx.y()+e[1]); else mi.setY(mi.y()+e[1]);

-	if(e.z()>0) mx.setZ(mx.z()+e[2]); else mi.setZ(mi.z()+e[2]);

-}

-

-//

-DBVT_INLINE bool		btDbvtAabbMm::Contain(const btDbvtAabbMm& a) const

-{

-	return(	(mi.x()<=a.mi.x())&&

-		(mi.y()<=a.mi.y())&&

-		(mi.z()<=a.mi.z())&&

-		(mx.x()>=a.mx.x())&&

-		(mx.y()>=a.mx.y())&&

-		(mx.z()>=a.mx.z()));

-}

-

-//

-DBVT_INLINE int		btDbvtAabbMm::Classify(const btVector3& n,btScalar o,int s) const

-{

-	btVector3			pi,px;

-	switch(s)

-	{

-	case	(0+0+0):	px=btVector3(mi.x(),mi.y(),mi.z());

-		pi=btVector3(mx.x(),mx.y(),mx.z());break;

-	case	(1+0+0):	px=btVector3(mx.x(),mi.y(),mi.z());

-		pi=btVector3(mi.x(),mx.y(),mx.z());break;

-	case	(0+2+0):	px=btVector3(mi.x(),mx.y(),mi.z());

-		pi=btVector3(mx.x(),mi.y(),mx.z());break;

-	case	(1+2+0):	px=btVector3(mx.x(),mx.y(),mi.z());

-		pi=btVector3(mi.x(),mi.y(),mx.z());break;

-	case	(0+0+4):	px=btVector3(mi.x(),mi.y(),mx.z());

-		pi=btVector3(mx.x(),mx.y(),mi.z());break;

-	case	(1+0+4):	px=btVector3(mx.x(),mi.y(),mx.z());

-		pi=btVector3(mi.x(),mx.y(),mi.z());break;

-	case	(0+2+4):	px=btVector3(mi.x(),mx.y(),mx.z());

-		pi=btVector3(mx.x(),mi.y(),mi.z());break;

-	case	(1+2+4):	px=btVector3(mx.x(),mx.y(),mx.z());

-		pi=btVector3(mi.x(),mi.y(),mi.z());break;

-	}

-	if((btDot(n,px)+o)<0)		return(-1);

-	if((btDot(n,pi)+o)>=0)	return(+1);

-	return(0);

-}

-

-//

-DBVT_INLINE btScalar	btDbvtAabbMm::ProjectMinimum(const btVector3& v,unsigned signs) const

-{

-	const btVector3*	b[]={&mx,&mi};

-	const btVector3		p(	b[(signs>>0)&1]->x(),

-		b[(signs>>1)&1]->y(),

-		b[(signs>>2)&1]->z());

-	return(btDot(p,v));

-}

-

-//

-DBVT_INLINE void		btDbvtAabbMm::AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const

-{

-	for(int i=0;i<3;++i)

-	{

-		if(d[i]<0)

-		{ smi+=mx[i]*d[i];smx+=mi[i]*d[i]; }

-		else

-		{ smi+=mi[i]*d[i];smx+=mx[i]*d[i]; }

-	}

-}

-

-//

-DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,

-								  const btDbvtAabbMm& b)

-{

-#if	DBVT_INT0_IMPL == DBVT_IMPL_SSE

-	const __m128	rt(_mm_or_ps(	_mm_cmplt_ps(_mm_load_ps(b.mx),_mm_load_ps(a.mi)),

-		_mm_cmplt_ps(_mm_load_ps(a.mx),_mm_load_ps(b.mi))));

-	const __int32*	pu((const __int32*)&rt);

-	return((pu[0]|pu[1]|pu[2])==0);

-#else

-	return(	(a.mi.x()<=b.mx.x())&&

-		(a.mx.x()>=b.mi.x())&&

-		(a.mi.y()<=b.mx.y())&&

-		(a.mx.y()>=b.mi.y())&&

-		(a.mi.z()<=b.mx.z())&&		

-		(a.mx.z()>=b.mi.z()));

-#endif

-}

-

-

-

-//

-DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,

-								  const btVector3& b)

-{

-	return(	(b.x()>=a.mi.x())&&

-		(b.y()>=a.mi.y())&&

-		(b.z()>=a.mi.z())&&

-		(b.x()<=a.mx.x())&&

-		(b.y()<=a.mx.y())&&

-		(b.z()<=a.mx.z()));

-}

-

-

-

-

-

-//////////////////////////////////////

-

-

-//

-DBVT_INLINE btScalar	Proximity(	const btDbvtAabbMm& a,

-								  const btDbvtAabbMm& b)

-{

-	const btVector3	d=(a.mi+a.mx)-(b.mi+b.mx);

-	return(btFabs(d.x())+btFabs(d.y())+btFabs(d.z()));

-}

-

-

-

-//

-DBVT_INLINE int			Select(	const btDbvtAabbMm& o,

-							   const btDbvtAabbMm& a,

-							   const btDbvtAabbMm& b)

-{

-#if	DBVT_SELECT_IMPL == DBVT_IMPL_SSE

-	static ATTRIBUTE_ALIGNED16(const unsigned __int32)	mask[]={0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff};

-	///@todo: the intrinsic version is 11% slower

-#if DBVT_USE_INTRINSIC_SSE

-

-	union btSSEUnion ///NOTE: if we use more intrinsics, move btSSEUnion into the LinearMath directory

-	{

-	   __m128		ssereg;

-	   float		floats[4];

-	   int			ints[4];

-	};

-

-	__m128	omi(_mm_load_ps(o.mi));

-	omi=_mm_add_ps(omi,_mm_load_ps(o.mx));

-	__m128	ami(_mm_load_ps(a.mi));

-	ami=_mm_add_ps(ami,_mm_load_ps(a.mx));

-	ami=_mm_sub_ps(ami,omi);

-	ami=_mm_and_ps(ami,_mm_load_ps((const float*)mask));

-	__m128	bmi(_mm_load_ps(b.mi));

-	bmi=_mm_add_ps(bmi,_mm_load_ps(b.mx));

-	bmi=_mm_sub_ps(bmi,omi);

-	bmi=_mm_and_ps(bmi,_mm_load_ps((const float*)mask));

-	__m128	t0(_mm_movehl_ps(ami,ami));

-	ami=_mm_add_ps(ami,t0);

-	ami=_mm_add_ss(ami,_mm_shuffle_ps(ami,ami,1));

-	__m128 t1(_mm_movehl_ps(bmi,bmi));

-	bmi=_mm_add_ps(bmi,t1);

-	bmi=_mm_add_ss(bmi,_mm_shuffle_ps(bmi,bmi,1));

-	

-	btSSEUnion tmp;

-	tmp.ssereg = _mm_cmple_ss(bmi,ami);

-	return tmp.ints[0]&1;

-

-#else

-	ATTRIBUTE_ALIGNED16(__int32	r[1]);

-	__asm

-	{

-		mov		eax,o

-			mov		ecx,a

-			mov		edx,b

-			movaps	xmm0,[eax]

-		movaps	xmm5,mask

-			addps	xmm0,[eax+16]	

-		movaps	xmm1,[ecx]

-		movaps	xmm2,[edx]

-		addps	xmm1,[ecx+16]

-		addps	xmm2,[edx+16]

-		subps	xmm1,xmm0

-			subps	xmm2,xmm0

-			andps	xmm1,xmm5

-			andps	xmm2,xmm5

-			movhlps	xmm3,xmm1

-			movhlps	xmm4,xmm2

-			addps	xmm1,xmm3

-			addps	xmm2,xmm4

-			pshufd	xmm3,xmm1,1

-			pshufd	xmm4,xmm2,1

-			addss	xmm1,xmm3

-			addss	xmm2,xmm4

-			cmpless	xmm2,xmm1

-			movss	r,xmm2

-	}

-	return(r[0]&1);

-#endif

-#else

-	return(Proximity(o,a)<Proximity(o,b)?0:1);

-#endif

-}

-

-//

-DBVT_INLINE void		Merge(	const btDbvtAabbMm& a,

-							  const btDbvtAabbMm& b,

-							  btDbvtAabbMm& r)

-{

-#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE

-	__m128	ami(_mm_load_ps(a.mi));

-	__m128	amx(_mm_load_ps(a.mx));

-	__m128	bmi(_mm_load_ps(b.mi));

-	__m128	bmx(_mm_load_ps(b.mx));

-	ami=_mm_min_ps(ami,bmi);

-	amx=_mm_max_ps(amx,bmx);

-	_mm_store_ps(r.mi,ami);

-	_mm_store_ps(r.mx,amx);

-#else

-	for(int i=0;i<3;++i)

-	{

-		if(a.mi[i]<b.mi[i]) r.mi[i]=a.mi[i]; else r.mi[i]=b.mi[i];

-		if(a.mx[i]>b.mx[i]) r.mx[i]=a.mx[i]; else r.mx[i]=b.mx[i];

-	}

-#endif

-}

-

-//

-DBVT_INLINE bool		NotEqual(	const btDbvtAabbMm& a,

-								 const btDbvtAabbMm& b)

-{

-	return(	(a.mi.x()!=b.mi.x())||

-		(a.mi.y()!=b.mi.y())||

-		(a.mi.z()!=b.mi.z())||

-		(a.mx.x()!=b.mx.x())||

-		(a.mx.y()!=b.mx.y())||

-		(a.mx.z()!=b.mx.z()));

-}

-

-//

-// Inline's

-//

-

-//

-DBVT_PREFIX

-inline void		btDbvt::enumNodes(	const btDbvtNode* root,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		policy.Process(root);

-	if(root->isinternal())

-	{

-		enumNodes(root->childs[0],policy);

-		enumNodes(root->childs[1],policy);

-	}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::enumLeaves(	const btDbvtNode* root,

-								   DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root->isinternal())

-		{

-			enumLeaves(root->childs[0],policy);

-			enumLeaves(root->childs[1],policy);

-		}

-		else

-		{

-			policy.Process(root);

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTT(	const btDbvtNode* root0,

-								  const btDbvtNode* root1,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root0&&root1)

-		{

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-4;

-			btAlignedObjectArray<sStkNN>	stkStack;

-			stkStack.resize(DOUBLE_STACKSIZE);

-			stkStack[0]=sStkNN(root0,root1);

-			do	{		

-				sStkNN	p=stkStack[--depth];

-				if(depth>treshold)

-				{

-					stkStack.resize(stkStack.size()*2);

-					treshold=stkStack.size()-4;

-				}

-				if(p.a==p.b)

-				{

-					if(p.a->isinternal())

-					{

-						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);

-						stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);

-						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);

-					}

-				}

-				else if(Intersect(p.a->volume,p.b->volume))

-				{

-					if(p.a->isinternal())

-					{

-						if(p.b->isinternal())

-						{

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);

-						}

-						else

-						{

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);

-						}

-					}

-					else

-					{

-						if(p.b->isinternal())

-						{

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);

-						}

-						else

-						{

-							policy.Process(p.a,p.b);

-						}

-					}

-				}

-			} while(depth);

-		}

-}

-

-

-

-DBVT_PREFIX

-inline void		btDbvt::collideTTpersistentStack(	const btDbvtNode* root0,

-								  const btDbvtNode* root1,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root0&&root1)

-		{

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-4;

-			

-			m_stkStack.resize(DOUBLE_STACKSIZE);

-			m_stkStack[0]=sStkNN(root0,root1);

-			do	{		

-				sStkNN	p=m_stkStack[--depth];

-				if(depth>treshold)

-				{

-					m_stkStack.resize(m_stkStack.size()*2);

-					treshold=m_stkStack.size()-4;

-				}

-				if(p.a==p.b)

-				{

-					if(p.a->isinternal())

-					{

-						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);

-						m_stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);

-						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);

-					}

-				}

-				else if(Intersect(p.a->volume,p.b->volume))

-				{

-					if(p.a->isinternal())

-					{

-						if(p.b->isinternal())

-						{

-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);

-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);

-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);

-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);

-						}

-						else

-						{

-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b);

-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b);

-						}

-					}

-					else

-					{

-						if(p.b->isinternal())

-						{

-							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);

-							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);

-						}

-						else

-						{

-							policy.Process(p.a,p.b);

-						}

-					}

-				}

-			} while(depth);

-		}

-}

-

-#if 0

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTT(	const btDbvtNode* root0,

-								  const btDbvtNode* root1,

-								  const btTransform& xform,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root0&&root1)

-		{

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-4;

-			btAlignedObjectArray<sStkNN>	stkStack;

-			stkStack.resize(DOUBLE_STACKSIZE);

-			stkStack[0]=sStkNN(root0,root1);

-			do	{

-				sStkNN	p=stkStack[--depth];

-				if(Intersect(p.a->volume,p.b->volume,xform))

-				{

-					if(depth>treshold)

-					{

-						stkStack.resize(stkStack.size()*2);

-						treshold=stkStack.size()-4;

-					}

-					if(p.a->isinternal())

-					{

-						if(p.b->isinternal())

-						{					

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);

-						}

-						else

-						{

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);

-						}

-					}

-					else

-					{

-						if(p.b->isinternal())

-						{

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);

-						}

-						else

-						{

-							policy.Process(p.a,p.b);

-						}

-					}

-				}

-			} while(depth);

-		}

-}

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTT(	const btDbvtNode* root0,

-								  const btTransform& xform0,

-								  const btDbvtNode* root1,

-								  const btTransform& xform1,

-								  DBVT_IPOLICY)

-{

-	const btTransform	xform=xform0.inverse()*xform1;

-	collideTT(root0,root1,xform,policy);

-}

-#endif 

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTV(	const btDbvtNode* root,

-								  const btDbvtVolume& vol,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			ATTRIBUTE_ALIGNED16(btDbvtVolume)		volume(vol);

-			btAlignedObjectArray<const btDbvtNode*>	stack;

-			stack.resize(0);

-			stack.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(root);

-			do	{

-				const btDbvtNode*	n=stack[stack.size()-1];

-				stack.pop_back();

-				if(Intersect(n->volume,volume))

-				{

-					if(n->isinternal())

-					{

-						stack.push_back(n->childs[0]);

-						stack.push_back(n->childs[1]);

-					}

-					else

-					{

-						policy.Process(n);

-					}

-				}

-			} while(stack.size()>0);

-		}

-}

-

-DBVT_PREFIX

-inline void		btDbvt::rayTestInternal(	const btDbvtNode* root,

-								const btVector3& rayFrom,

-								const btVector3& rayTo,

-								const btVector3& rayDirectionInverse,

-								unsigned int signs[3],

-								btScalar lambda_max,

-								const btVector3& aabbMin,

-								const btVector3& aabbMax,

-								DBVT_IPOLICY) const

-{

-        (void) rayTo;

-	DBVT_CHECKTYPE

-	if(root)

-	{

-		btVector3 resultNormal;

-

-		int								depth=1;

-		int								treshold=DOUBLE_STACKSIZE-2;

-		btAlignedObjectArray<const btDbvtNode*>	stack;

-		stack.resize(DOUBLE_STACKSIZE);

-		stack[0]=root;

-		btVector3 bounds[2];

-		do	

-		{

-			const btDbvtNode*	node=stack[--depth];

-			bounds[0] = node->volume.Mins()-aabbMax;

-			bounds[1] = node->volume.Maxs()-aabbMin;

-			btScalar tmin=1.f,lambda_min=0.f;

-			unsigned int result1=false;

-			result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);

-			if(result1)

-			{

-				if(node->isinternal())

-				{

-					if(depth>treshold)

-					{

-						stack.resize(stack.size()*2);

-						treshold=stack.size()-2;

-					}

-					stack[depth++]=node->childs[0];

-					stack[depth++]=node->childs[1];

-				}

-				else

-				{

-					policy.Process(node);

-				}

-			}

-		} while(depth);

-	}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::rayTest(	const btDbvtNode* root,

-								const btVector3& rayFrom,

-								const btVector3& rayTo,

-								DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			btVector3 rayDir = (rayTo-rayFrom);

-			rayDir.normalize ();

-

-			///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT

-			btVector3 rayDirectionInverse;

-			rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];

-			rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];

-			rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];

-			unsigned int signs[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};

-

-			btScalar lambda_max = rayDir.dot(rayTo-rayFrom);

-

-			btVector3 resultNormal;

-

-			btAlignedObjectArray<const btDbvtNode*>	stack;

-

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-2;

-

-			stack.resize(DOUBLE_STACKSIZE);

-			stack[0]=root;

-			btVector3 bounds[2];

-			do	{

-				const btDbvtNode*	node=stack[--depth];

-

-				bounds[0] = node->volume.Mins();

-				bounds[1] = node->volume.Maxs();

-				

-				btScalar tmin=1.f,lambda_min=0.f;

-				unsigned int result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);

-

-#ifdef COMPARE_BTRAY_AABB2

-				btScalar param=1.f;

-				bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);

-				btAssert(result1 == result2);

-#endif //TEST_BTRAY_AABB2

-

-				if(result1)

-				{

-					if(node->isinternal())

-					{

-						if(depth>treshold)

-						{

-							stack.resize(stack.size()*2);

-							treshold=stack.size()-2;

-						}

-						stack[depth++]=node->childs[0];

-						stack[depth++]=node->childs[1];

-					}

-					else

-					{

-						policy.Process(node);

-					}

-				}

-			} while(depth);

-

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideKDOP(const btDbvtNode* root,

-									const btVector3* normals,

-									const btScalar* offsets,

-									int count,

-									DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			const int						inside=(1<<count)-1;

-			btAlignedObjectArray<sStkNP>	stack;

-			int								signs[sizeof(unsigned)*8];

-			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));

-			for(int i=0;i<count;++i)

-			{

-				signs[i]=	((normals[i].x()>=0)?1:0)+

-					((normals[i].y()>=0)?2:0)+

-					((normals[i].z()>=0)?4:0);

-			}

-			stack.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(sStkNP(root,0));

-			do	{

-				sStkNP	se=stack[stack.size()-1];

-				bool	out=false;

-				stack.pop_back();

-				for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)

-				{

-					if(0==(se.mask&j))

-					{

-						const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);

-						switch(side)

-						{

-						case	-1:	out=true;break;

-						case	+1:	se.mask|=j;break;

-						}

-					}

-				}

-				if(!out)

-				{

-					if((se.mask!=inside)&&(se.node->isinternal()))

-					{

-						stack.push_back(sStkNP(se.node->childs[0],se.mask));

-						stack.push_back(sStkNP(se.node->childs[1],se.mask));

-					}

-					else

-					{

-						if(policy.AllLeaves(se.node)) enumLeaves(se.node,policy);

-					}

-				}

-			} while(stack.size());

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideOCL(	const btDbvtNode* root,

-								   const btVector3* normals,

-								   const btScalar* offsets,

-								   const btVector3& sortaxis,

-								   int count,

-								   DBVT_IPOLICY,

-								   bool fsort)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			const unsigned					srtsgns=(sortaxis[0]>=0?1:0)+

-				(sortaxis[1]>=0?2:0)+

-				(sortaxis[2]>=0?4:0);

-			const int						inside=(1<<count)-1;

-			btAlignedObjectArray<sStkNPS>	stock;

-			btAlignedObjectArray<int>		ifree;

-			btAlignedObjectArray<int>		stack;

-			int								signs[sizeof(unsigned)*8];

-			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));

-			for(int i=0;i<count;++i)

-			{

-				signs[i]=	((normals[i].x()>=0)?1:0)+

-					((normals[i].y()>=0)?2:0)+

-					((normals[i].z()>=0)?4:0);

-			}

-			stock.reserve(SIMPLE_STACKSIZE);

-			stack.reserve(SIMPLE_STACKSIZE);

-			ifree.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(allocate(ifree,stock,sStkNPS(root,0,root->volume.ProjectMinimum(sortaxis,srtsgns))));

-			do	{

-				const int	id=stack[stack.size()-1];

-				sStkNPS		se=stock[id];

-				stack.pop_back();ifree.push_back(id);

-				if(se.mask!=inside)

-				{

-					bool	out=false;

-					for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)

-					{

-						if(0==(se.mask&j))

-						{

-							const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);

-							switch(side)

-							{

-							case	-1:	out=true;break;

-							case	+1:	se.mask|=j;break;

-							}

-						}

-					}

-					if(out) continue;

-				}

-				if(policy.Descent(se.node))

-				{

-					if(se.node->isinternal())

-					{

-						const btDbvtNode* pns[]={	se.node->childs[0],se.node->childs[1]};

-						sStkNPS		nes[]={	sStkNPS(pns[0],se.mask,pns[0]->volume.ProjectMinimum(sortaxis,srtsgns)),

-							sStkNPS(pns[1],se.mask,pns[1]->volume.ProjectMinimum(sortaxis,srtsgns))};

-						const int	q=nes[0].value<nes[1].value?1:0;				

-						int			j=stack.size();

-						if(fsort&&(j>0))

-						{

-							/* Insert 0	*/ 

-							j=nearest(&stack[0],&stock[0],nes[q].value,0,stack.size());

-							stack.push_back(0);

-#if DBVT_USE_MEMMOVE

-							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));

-#else

-							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];

-#endif

-							stack[j]=allocate(ifree,stock,nes[q]);

-							/* Insert 1	*/ 

-							j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size());

-							stack.push_back(0);

-#if DBVT_USE_MEMMOVE

-							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));

-#else

-							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];

-#endif

-							stack[j]=allocate(ifree,stock,nes[1-q]);

-						}

-						else

-						{

-							stack.push_back(allocate(ifree,stock,nes[q]));

-							stack.push_back(allocate(ifree,stock,nes[1-q]));

-						}

-					}

-					else

-					{

-						policy.Process(se.node,se.value);

-					}

-				}

-			} while(stack.size());

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTU(	const btDbvtNode* root,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			btAlignedObjectArray<const btDbvtNode*>	stack;

-			stack.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(root);

-			do	{

-				const btDbvtNode*	n=stack[stack.size()-1];

-				stack.pop_back();

-				if(policy.Descent(n))

-				{

-					if(n->isinternal())

-					{ stack.push_back(n->childs[0]);stack.push_back(n->childs[1]); }

-					else

-					{ policy.Process(n); }

-				}

-			} while(stack.size()>0);

-		}

-}

-

-//

-// PP Cleanup

-//

-

-#undef DBVT_USE_MEMMOVE

-#undef DBVT_USE_TEMPLATE

-#undef DBVT_VIRTUAL_DTOR

-#undef DBVT_VIRTUAL

-#undef DBVT_PREFIX

-#undef DBVT_IPOLICY

-#undef DBVT_CHECKTYPE

-#undef DBVT_IMPL_GENERIC

-#undef DBVT_IMPL_SSE

-#undef DBVT_USE_INTRINSIC_SSE

-#undef DBVT_SELECT_IMPL

-#undef DBVT_MERGE_IMPL

-#undef DBVT_INT0_IMPL

-

-#endif

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btDbvtBroadphase.h.svn-base
+++ /dev/null
@@ -1,147 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-///btDbvtBroadphase implementation by Nathanael Presson

-#ifndef BT_DBVT_BROADPHASE_H

-#define BT_DBVT_BROADPHASE_H

-

-#include "BulletCollision/BroadphaseCollision/btDbvt.h"

-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"

-

-//

-// Compile time config

-//

-

-#define	DBVT_BP_PROFILE					0

-//#define DBVT_BP_SORTPAIRS				1

-#define DBVT_BP_PREVENTFALSEUPDATE		0

-#define DBVT_BP_ACCURATESLEEPING		0

-#define DBVT_BP_ENABLE_BENCHMARK		0

-#define DBVT_BP_MARGIN					(btScalar)0.05

-

-#if DBVT_BP_PROFILE

-#define	DBVT_BP_PROFILING_RATE	256

-#include "LinearMath/btQuickprof.h"

-#endif

-

-//

-// btDbvtProxy

-//

-struct btDbvtProxy : btBroadphaseProxy

-{

-	/* Fields		*/ 

-	//btDbvtAabbMm	aabb;

-	btDbvtNode*		leaf;

-	btDbvtProxy*	links[2];

-	int				stage;

-	/* ctor			*/ 

-	btDbvtProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :

-	btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask)

-	{

-		links[0]=links[1]=0;

-	}

-};

-

-typedef btAlignedObjectArray<btDbvtProxy*>	btDbvtProxyArray;

-

-///The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt).

-///One tree is used for static/non-moving objects, and another tree is used for dynamic objects. Objects can move from one tree to the other.

-///This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.

-struct	btDbvtBroadphase : btBroadphaseInterface

-{

-	/* Config		*/ 

-	enum	{

-		DYNAMIC_SET			=	0,	/* Dynamic set index	*/ 

-		FIXED_SET			=	1,	/* Fixed set index		*/ 

-		STAGECOUNT			=	2	/* Number of stages		*/ 

-	};

-	/* Fields		*/ 

-	btDbvt					m_sets[2];					// Dbvt sets

-	btDbvtProxy*			m_stageRoots[STAGECOUNT+1];	// Stages list

-	btOverlappingPairCache*	m_paircache;				// Pair cache

-	btScalar				m_prediction;				// Velocity prediction

-	int						m_stageCurrent;				// Current stage

-	int						m_fupdates;					// % of fixed updates per frame

-	int						m_dupdates;					// % of dynamic updates per frame

-	int						m_cupdates;					// % of cleanup updates per frame

-	int						m_newpairs;					// Number of pairs created

-	int						m_fixedleft;				// Fixed optimization left

-	unsigned				m_updates_call;				// Number of updates call

-	unsigned				m_updates_done;				// Number of updates done

-	btScalar				m_updates_ratio;			// m_updates_done/m_updates_call

-	int						m_pid;						// Parse id

-	int						m_cid;						// Cleanup index

-	int						m_gid;						// Gen id

-	bool					m_releasepaircache;			// Release pair cache on delete

-	bool					m_deferedcollide;			// Defere dynamic/static collision to collide call

-	bool					m_needcleanup;				// Need to run cleanup?

-#if DBVT_BP_PROFILE

-	btClock					m_clock;

-	struct	{

-		unsigned long		m_total;

-		unsigned long		m_ddcollide;

-		unsigned long		m_fdcollide;

-		unsigned long		m_cleanup;

-		unsigned long		m_jobcount;

-	}				m_profiling;

-#endif

-	/* Methods		*/ 

-	btDbvtBroadphase(btOverlappingPairCache* paircache=0);

-	~btDbvtBroadphase();

-	void							collide(btDispatcher* dispatcher);

-	void							optimize();

-	

-	/* btBroadphaseInterface Implementation	*/

-	btBroadphaseProxy*				createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);

-	virtual void					destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void					setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);

-	virtual void					rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));

-	virtual void					aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);

-

-	virtual void					getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-	virtual	void					calculateOverlappingPairs(btDispatcher* dispatcher);

-	virtual	btOverlappingPairCache*	getOverlappingPairCache();

-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const;

-	virtual	void					getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;

-	virtual	void					printStats();

-

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher);

-

-	void	performDeferredRemoval(btDispatcher* dispatcher);

-	

-	void	setVelocityPrediction(btScalar prediction)

-	{

-		m_prediction = prediction;

-	}

-	btScalar getVelocityPrediction() const

-	{

-		return m_prediction;

-	}

-

-	///this setAabbForceUpdate is similar to setAabb but always forces the aabb update. 

-	///it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase.

-	///it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see

-	///http://code.google.com/p/bullet/issues/detail?id=223

-	void							setAabbForceUpdate(		btBroadphaseProxy* absproxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* /*dispatcher*/);

-

-	static void						benchmark(btBroadphaseInterface*);

-

-

-};

-

-#endif

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btDispatcher.h.svn-base
+++ /dev/null
@@ -1,109 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef _DISPATCHER_H

-#define _DISPATCHER_H

-

-#include "LinearMath/btScalar.h"

-

-class btCollisionAlgorithm;

-struct btBroadphaseProxy;

-class btRigidBody;

-class	btCollisionObject;

-class btOverlappingPairCache;

-

-

-class btPersistentManifold;

-class btStackAlloc;

-

-struct btDispatcherInfo

-{

-	enum DispatchFunc

-	{

-		DISPATCH_DISCRETE = 1,

-		DISPATCH_CONTINUOUS

-	};

-	btDispatcherInfo()

-		:m_timeStep(btScalar(0.)),

-		m_stepCount(0),

-		m_dispatchFunc(DISPATCH_DISCRETE),

-		m_timeOfImpact(btScalar(1.)),

-		m_useContinuous(false),

-		m_debugDraw(0),

-		m_enableSatConvex(false),

-		m_enableSPU(true),

-		m_useEpa(true),

-		m_allowedCcdPenetration(btScalar(0.04)),

-		m_useConvexConservativeDistanceUtil(false),

-		m_convexConservativeDistanceThreshold(0.0f),

-		m_convexMaxDistanceUseCPT(false),

-		m_stackAllocator(0)

-	{

-

-	}

-	btScalar	m_timeStep;

-	int			m_stepCount;

-	int			m_dispatchFunc;

-	mutable btScalar	m_timeOfImpact;

-	bool		m_useContinuous;

-	class btIDebugDraw*	m_debugDraw;

-	bool		m_enableSatConvex;

-	bool		m_enableSPU;

-	bool		m_useEpa;

-	btScalar	m_allowedCcdPenetration;

-	bool		m_useConvexConservativeDistanceUtil;

-	btScalar	m_convexConservativeDistanceThreshold;

-	bool		m_convexMaxDistanceUseCPT;

-	btStackAlloc*	m_stackAllocator;

-};

-

-///The btDispatcher interface class can be used in combination with broadphase to dispatch calculations for overlapping pairs.

-///For example for pairwise collision detection, calculating contact points stored in btPersistentManifold or user callbacks (game logic).

-class btDispatcher

-{

-

-

-public:

-	virtual ~btDispatcher() ;

-

-	virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0;

-

-	virtual btPersistentManifold*	getNewManifold(void* body0,void* body1)=0;

-

-	virtual void releaseManifold(btPersistentManifold* manifold)=0;

-

-	virtual void clearManifold(btPersistentManifold* manifold)=0;

-

-	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0;

-

-	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0;

-

-	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)  =0;

-

-	virtual int getNumManifolds() const = 0;

-

-	virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;

-

-	virtual	btPersistentManifold**	getInternalManifoldPointer() = 0;

-

-	virtual	void* allocateCollisionAlgorithm(int size)  = 0;

-

-	virtual	void freeCollisionAlgorithm(void* ptr) = 0;

-

-};

-

-

-#endif //_DISPATCHER_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btMultiSapBroadphase.h.svn-base
+++ /dev/null
@@ -1,152 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-#ifndef BT_MULTI_SAP_BROADPHASE

-#define BT_MULTI_SAP_BROADPHASE

-

-#include "btBroadphaseInterface.h"

-#include "LinearMath/btAlignedObjectArray.h"

-#include "btOverlappingPairCache.h"

-

-

-class btBroadphaseInterface;

-class btSimpleBroadphase;

-

-

-typedef btAlignedObjectArray<btBroadphaseInterface*> btSapBroadphaseArray;

-

-///The btMultiSapBroadphase is a research project, not recommended to use in production. Use btAxisSweep3 or btDbvtBroadphase instead.

-///The btMultiSapBroadphase is a broadphase that contains multiple SAP broadphases.

-///The user can add SAP broadphases that cover the world. A btBroadphaseProxy can be in multiple child broadphases at the same time.

-///A btQuantizedBvh acceleration structures finds overlapping SAPs for each btBroadphaseProxy.

-///See http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=328

-///and http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329

-class btMultiSapBroadphase :public btBroadphaseInterface

-{

-	btSapBroadphaseArray	m_sapBroadphases;

-	

-	btSimpleBroadphase*		m_simpleBroadphase;

-

-	btOverlappingPairCache*	m_overlappingPairs;

-

-	class btQuantizedBvh*			m_optimizedAabbTree;

-

-

-	bool					m_ownsPairCache;

-	

-	btOverlapFilterCallback*	m_filterCallback;

-

-	int			m_invalidPair;

-

-	struct	btBridgeProxy

-	{

-		btBroadphaseProxy*		m_childProxy;

-		btBroadphaseInterface*	m_childBroadphase;

-	};

-

-

-public:

-

-	struct	btMultiSapProxy	: public btBroadphaseProxy

-	{

-

-		///array with all the entries that this proxy belongs to

-		btAlignedObjectArray<btBridgeProxy*> m_bridgeProxies;

-		btVector3	m_aabbMin;

-		btVector3	m_aabbMax;

-

-		int	m_shapeType;

-

-/*		void*	m_userPtr;

-		short int	m_collisionFilterGroup;

-		short int	m_collisionFilterMask;

-*/

-		btMultiSapProxy(const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask)

-			:btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask),

-			m_aabbMin(aabbMin),

-			m_aabbMax(aabbMax),

-			m_shapeType(shapeType)

-		{

-			m_multiSapParentProxy =this;

-		}

-

-		

-	};

-

-protected:

-

-

-	btAlignedObjectArray<btMultiSapProxy*> m_multiSapProxies;

-

-public:

-

-	btMultiSapBroadphase(int maxProxies = 16384,btOverlappingPairCache* pairCache=0);

-

-

-	btSapBroadphaseArray&	getBroadphaseArray()

-	{

-		return m_sapBroadphases;

-	}

-

-	const btSapBroadphaseArray&	getBroadphaseArray() const

-	{

-		return m_sapBroadphases;

-	}

-

-	virtual ~btMultiSapBroadphase();

-

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);

-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));

-

-	void	addToChildBroadphase(btMultiSapProxy* parentMultiSapProxy, btBroadphaseProxy* childProxy, btBroadphaseInterface*	childBroadphase);

-

-	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);

-

-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-	virtual	btOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_overlappingPairs;

-	}

-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const

-	{

-		return m_overlappingPairs;

-	}

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const

-	{

-		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);

-		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);

-	}

-

-	void	buildTree(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax);

-

-	virtual void	printStats();

-

-	void quicksort (btBroadphasePairArray& a, int lo, int hi);

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher);

-

-};

-

-#endif //BT_MULTI_SAP_BROADPHASE

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btOverlappingPairCache.h.svn-base
+++ /dev/null
@@ -1,470 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef OVERLAPPING_PAIR_CACHE_H

-#define OVERLAPPING_PAIR_CACHE_H

-

-

-#include "btBroadphaseInterface.h"

-#include "btBroadphaseProxy.h"

-#include "btOverlappingPairCallback.h"

-

-#include "LinearMath/btAlignedObjectArray.h"

-class btDispatcher;

-

-typedef btAlignedObjectArray<btBroadphasePair>	btBroadphasePairArray;

-

-struct	btOverlapCallback

-{

-	virtual ~btOverlapCallback()

-	{}

-	//return true for deletion of the pair

-	virtual bool	processOverlap(btBroadphasePair& pair) = 0;

-

-};

-

-struct btOverlapFilterCallback

-{

-	virtual ~btOverlapFilterCallback()

-	{}

-	// return true when pairs need collision

-	virtual bool	needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0;

-};

-

-

-

-

-

-

-

-extern int gRemovePairs;

-extern int gAddedPairs;

-extern int gFindPairs;

-

-const int BT_NULL_PAIR=0xffffffff;

-

-///The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.

-///The btHashedOverlappingPairCache and btSortedOverlappingPairCache classes are two implementations.

-class btOverlappingPairCache : public btOverlappingPairCallback

-{

-public:

-	virtual ~btOverlappingPairCache() {} // this is needed so we can get to the derived class destructor

-

-	virtual btBroadphasePair*	getOverlappingPairArrayPtr() = 0;

-	

-	virtual const btBroadphasePair*	getOverlappingPairArrayPtr() const = 0;

-

-	virtual btBroadphasePairArray&	getOverlappingPairArray() = 0;

-

-	virtual	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher) = 0;

-

-	virtual int getNumOverlappingPairs() const = 0;

-

-	virtual void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher) = 0;

-

-	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* callback) = 0;

-

-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher) = 0;

-

-	virtual btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) = 0;

-

-	virtual bool	hasDeferredRemoval() = 0;

-

-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)=0;

-

-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher) = 0;

-

-

-};

-

-/// Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman, Codercorner, http://codercorner.com

-class btHashedOverlappingPairCache : public btOverlappingPairCache

-{

-	btBroadphasePairArray	m_overlappingPairArray;

-	btOverlapFilterCallback* m_overlapFilterCallback;

-	bool		m_blockedForChanges;

-

-

-public:

-	btHashedOverlappingPairCache();

-	virtual ~btHashedOverlappingPairCache();

-

-	

-	void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);

-	

-	SIMD_FORCE_INLINE bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const

-	{

-		if (m_overlapFilterCallback)

-			return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);

-

-		bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;

-		collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-		

-		return collides;

-	}

-

-	// Add a pair and return the new pair. If the pair already exists,

-	// no new pair is created and the old one is returned.

-	virtual btBroadphasePair* 	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)

-	{

-		gAddedPairs++;

-

-		if (!needsBroadphaseCollision(proxy0,proxy1))

-			return 0;

-

-		return internalAddPair(proxy0,proxy1);

-	}

-

-	

-

-	void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-	

-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);

-

-	virtual btBroadphasePair*	getOverlappingPairArrayPtr()

-	{

-		return &m_overlappingPairArray[0];

-	}

-

-	const btBroadphasePair*	getOverlappingPairArrayPtr() const

-	{

-		return &m_overlappingPairArray[0];

-	}

-

-	btBroadphasePairArray&	getOverlappingPairArray()

-	{

-		return m_overlappingPairArray;

-	}

-

-	const btBroadphasePairArray&	getOverlappingPairArray() const

-	{

-		return m_overlappingPairArray;

-	}

-

-	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);

-

-

-

-	btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1);

-

-	int GetCount() const { return m_overlappingPairArray.size(); }

-//	btBroadphasePair* GetPairs() { return m_pairs; }

-

-	btOverlapFilterCallback* getOverlapFilterCallback()

-	{

-		return m_overlapFilterCallback;

-	}

-

-	void setOverlapFilterCallback(btOverlapFilterCallback* callback)

-	{

-		m_overlapFilterCallback = callback;

-	}

-

-	int	getNumOverlappingPairs() const

-	{

-		return m_overlappingPairArray.size();

-	}

-private:

-	

-	btBroadphasePair* 	internalAddPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-	void	growTables();

-

-	SIMD_FORCE_INLINE bool equalsPair(const btBroadphasePair& pair, int proxyId1, int proxyId2)

-	{	

-		return pair.m_pProxy0->getUid() == proxyId1 && pair.m_pProxy1->getUid() == proxyId2;

-	}

-

-	/*

-	// Thomas Wang's hash, see: http://www.concentric.net/~Ttwang/tech/inthash.htm

-	// This assumes proxyId1 and proxyId2 are 16-bit.

-	SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2)

-	{

-		int key = (proxyId2 << 16) | proxyId1;

-		key = ~key + (key << 15);

-		key = key ^ (key >> 12);

-		key = key + (key << 2);

-		key = key ^ (key >> 4);

-		key = key * 2057;

-		key = key ^ (key >> 16);

-		return key;

-	}

-	*/

-

-

-	

-	SIMD_FORCE_INLINE	unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)

-	{

-		int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));

-		// Thomas Wang's hash

-

-		key += ~(key << 15);

-		key ^=  (key >> 10);

-		key +=  (key << 3);

-		key ^=  (key >> 6);

-		key += ~(key << 11);

-		key ^=  (key >> 16);

-		return static_cast<unsigned int>(key);

-	}

-	

-

-

-

-

-	SIMD_FORCE_INLINE btBroadphasePair* internalFindPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, int hash)

-	{

-		int proxyId1 = proxy0->getUid();

-		int proxyId2 = proxy1->getUid();

-		#if 0 // wrong, 'equalsPair' use unsorted uids, copy-past devil striked again. Nat.

-		if (proxyId1 > proxyId2) 

-			btSwap(proxyId1, proxyId2);

-		#endif

-

-		int index = m_hashTable[hash];

-		

-		while( index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)

-		{

-			index = m_next[index];

-		}

-

-		if ( index == BT_NULL_PAIR )

-		{

-			return NULL;

-		}

-

-		btAssert(index < m_overlappingPairArray.size());

-

-		return &m_overlappingPairArray[index];

-	}

-

-	virtual bool	hasDeferredRemoval()

-	{

-		return false;

-	}

-

-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)

-	{

-		m_ghostPairCallback = ghostPairCallback;

-	}

-

-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher);

-	

-

-protected:

-	

-	btAlignedObjectArray<int>	m_hashTable;

-	btAlignedObjectArray<int>	m_next;

-	btOverlappingPairCallback*	m_ghostPairCallback;

-	

-};

-

-

-

-

-///btSortedOverlappingPairCache maintains the objects with overlapping AABB

-///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase

-class	btSortedOverlappingPairCache : public btOverlappingPairCache

-{

-	protected:

-		//avoid brute-force finding all the time

-		btBroadphasePairArray	m_overlappingPairArray;

-

-		//during the dispatch, check that user doesn't destroy/create proxy

-		bool		m_blockedForChanges;

-

-		///by default, do the removal during the pair traversal

-		bool		m_hasDeferredRemoval;

-		

-		//if set, use the callback instead of the built in filter in needBroadphaseCollision

-		btOverlapFilterCallback* m_overlapFilterCallback;

-

-		btOverlappingPairCallback*	m_ghostPairCallback;

-

-	public:

-			

-		btSortedOverlappingPairCache();	

-		virtual ~btSortedOverlappingPairCache();

-

-		virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);

-

-		void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);

-

-		void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);

-		

-		btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-		btBroadphasePair*	findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-			

-		

-		void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-		void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-

-		inline bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const

-		{

-			if (m_overlapFilterCallback)

-				return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);

-

-			bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;

-			collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-			

-			return collides;

-		}

-		

-		btBroadphasePairArray&	getOverlappingPairArray()

-		{

-			return m_overlappingPairArray;

-		}

-

-		const btBroadphasePairArray&	getOverlappingPairArray() const

-		{

-			return m_overlappingPairArray;

-		}

-

-		

-

-

-		btBroadphasePair*	getOverlappingPairArrayPtr()

-		{

-			return &m_overlappingPairArray[0];

-		}

-

-		const btBroadphasePair*	getOverlappingPairArrayPtr() const

-		{

-			return &m_overlappingPairArray[0];

-		}

-

-		int	getNumOverlappingPairs() const

-		{

-			return m_overlappingPairArray.size();

-		}

-		

-		btOverlapFilterCallback* getOverlapFilterCallback()

-		{

-			return m_overlapFilterCallback;

-		}

-

-		void setOverlapFilterCallback(btOverlapFilterCallback* callback)

-		{

-			m_overlapFilterCallback = callback;

-		}

-

-		virtual bool	hasDeferredRemoval()

-		{

-			return m_hasDeferredRemoval;

-		}

-

-		virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)

-		{

-			m_ghostPairCallback = ghostPairCallback;

-		}

-

-		virtual void	sortOverlappingPairs(btDispatcher* dispatcher);

-		

-

-};

-

-

-

-///btNullPairCache skips add/removal of overlapping pairs. Userful for benchmarking and unit testing.

-class btNullPairCache : public btOverlappingPairCache

-{

-

-	btBroadphasePairArray	m_overlappingPairArray;

-

-public:

-

-	virtual btBroadphasePair*	getOverlappingPairArrayPtr()

-	{

-		return &m_overlappingPairArray[0];

-	}

-	const btBroadphasePair*	getOverlappingPairArrayPtr() const

-	{

-		return &m_overlappingPairArray[0];

-	}

-	btBroadphasePairArray&	getOverlappingPairArray()

-	{

-		return m_overlappingPairArray;

-	}

-	

-	virtual	void	cleanOverlappingPair(btBroadphasePair& /*pair*/,btDispatcher* /*dispatcher*/)

-	{

-

-	}

-

-	virtual int getNumOverlappingPairs() const

-	{

-		return 0;

-	}

-

-	virtual void	cleanProxyFromPairs(btBroadphaseProxy* /*proxy*/,btDispatcher* /*dispatcher*/)

-	{

-

-	}

-

-	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* /*callback*/)

-	{

-	}

-

-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* /*dispatcher*/)

-	{

-	}

-

-	virtual btBroadphasePair* findPair(btBroadphaseProxy* /*proxy0*/, btBroadphaseProxy* /*proxy1*/)

-	{

-		return 0;

-	}

-

-	virtual bool	hasDeferredRemoval()

-	{

-		return true;

-	}

-

-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* /* ghostPairCallback */)

-	{

-

-	}

-

-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/)

-	{

-		return 0;

-	}

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/,btDispatcher* /*dispatcher*/)

-	{

-		return 0;

-	}

-

-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)

-	{

-	}

-	

-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher)

-	{

-        (void) dispatcher;

-	}

-

-

-};

-

-

-#endif //OVERLAPPING_PAIR_CACHE_H

-

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btOverlappingPairCallback.h.svn-base
+++ /dev/null
@@ -1,41 +1,1 @@
-

-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef OVERLAPPING_PAIR_CALLBACK_H

-#define OVERLAPPING_PAIR_CALLBACK_H

-

-class btDispatcher;

-struct  btBroadphasePair;

-

-///The btOverlappingPairCallback class is an additional optional broadphase user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.

-class btOverlappingPairCallback

-{

-public:

-	virtual ~btOverlappingPairCallback()

-	{

-

-	}

-	

-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0;

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher) = 0;

-

-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0,btDispatcher* dispatcher) = 0;

-

-};

-

-#endif //OVERLAPPING_PAIR_CALLBACK_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btQuantizedBvh.h.svn-base
+++ /dev/null
@@ -1,580 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef QUANTIZED_BVH_H

-#define QUANTIZED_BVH_H

-

-class btSerializer;

-

-//#define DEBUG_CHECK_DEQUANTIZATION 1

-#ifdef DEBUG_CHECK_DEQUANTIZATION

-#ifdef __SPU__

-#define printf spu_printf

-#endif //__SPU__

-

-#include <stdio.h>

-#include <stdlib.h>

-#endif //DEBUG_CHECK_DEQUANTIZATION

-

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btAlignedAllocator.h"

-

-#ifdef BT_USE_DOUBLE_PRECISION

-#define btQuantizedBvhData btQuantizedBvhDoubleData

-#define btOptimizedBvhNodeData btOptimizedBvhNodeDoubleData

-#define btQuantizedBvhDataName "btQuantizedBvhDoubleData"

-#else

-#define btQuantizedBvhData btQuantizedBvhFloatData

-#define btOptimizedBvhNodeData btOptimizedBvhNodeFloatData

-#define btQuantizedBvhDataName "btQuantizedBvhFloatData"

-#endif

-

-

-

-//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrf__m128.asp

-

-

-//Note: currently we have 16 bytes per quantized node

-#define MAX_SUBTREE_SIZE_IN_BYTES  2048

-

-// 10 gives the potential for 1024 parts, with at most 2^21 (2097152) (minus one

-// actually) triangles each (since the sign bit is reserved

-#define MAX_NUM_PARTS_IN_BITS 10

-

-///btQuantizedBvhNode is a compressed aabb node, 16 bytes.

-///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).

-ATTRIBUTE_ALIGNED16	(struct) btQuantizedBvhNode

-{

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	//12 bytes

-	unsigned short int	m_quantizedAabbMin[3];

-	unsigned short int	m_quantizedAabbMax[3];

-	//4 bytes

-	int	m_escapeIndexOrTriangleIndex;

-

-	bool isLeafNode() const

-	{

-		//skipindex is negative (internal node), triangleindex >=0 (leafnode)

-		return (m_escapeIndexOrTriangleIndex >= 0);

-	}

-	int getEscapeIndex() const

-	{

-		btAssert(!isLeafNode());

-		return -m_escapeIndexOrTriangleIndex;

-	}

-	int	getTriangleIndex() const

-	{

-		btAssert(isLeafNode());

-		// Get only the lower bits where the triangle index is stored

-		return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));

-	}

-	int	getPartId() const

-	{

-		btAssert(isLeafNode());

-		// Get only the highest bits where the part index is stored

-		return (m_escapeIndexOrTriangleIndex>>(31-MAX_NUM_PARTS_IN_BITS));

-	}

-}

-;

-

-/// btOptimizedBvhNode contains both internal and leaf node information.

-/// Total node size is 44 bytes / node. You can use the compressed version of 16 bytes.

-ATTRIBUTE_ALIGNED16 (struct) btOptimizedBvhNode

-{

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	//32 bytes

-	btVector3	m_aabbMinOrg;

-	btVector3	m_aabbMaxOrg;

-

-	//4

-	int	m_escapeIndex;

-

-	//8

-	//for child nodes

-	int	m_subPart;

-	int	m_triangleIndex;

-	int	m_padding[5];//bad, due to alignment

-

-

-};

-

-

-///btBvhSubtreeInfo provides info to gather a subtree of limited size

-ATTRIBUTE_ALIGNED16(class) btBvhSubtreeInfo

-{

-public:

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	//12 bytes

-	unsigned short int	m_quantizedAabbMin[3];

-	unsigned short int	m_quantizedAabbMax[3];

-	//4 bytes, points to the root of the subtree

-	int			m_rootNodeIndex;

-	//4 bytes

-	int			m_subtreeSize;

-	int			m_padding[3];

-

-	btBvhSubtreeInfo()

-	{

-		//memset(&m_padding[0], 0, sizeof(m_padding));

-	}

-

-

-	void	setAabbFromQuantizeNode(const btQuantizedBvhNode& quantizedNode)

-	{

-		m_quantizedAabbMin[0] = quantizedNode.m_quantizedAabbMin[0];

-		m_quantizedAabbMin[1] = quantizedNode.m_quantizedAabbMin[1];

-		m_quantizedAabbMin[2] = quantizedNode.m_quantizedAabbMin[2];

-		m_quantizedAabbMax[0] = quantizedNode.m_quantizedAabbMax[0];

-		m_quantizedAabbMax[1] = quantizedNode.m_quantizedAabbMax[1];

-		m_quantizedAabbMax[2] = quantizedNode.m_quantizedAabbMax[2];

-	}

-}

-;

-

-

-class btNodeOverlapCallback

-{

-public:

-	virtual ~btNodeOverlapCallback() {};

-

-	virtual void processNode(int subPart, int triangleIndex) = 0;

-};

-

-#include "LinearMath/btAlignedAllocator.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-

-

-///for code readability:

-typedef btAlignedObjectArray<btOptimizedBvhNode>	NodeArray;

-typedef btAlignedObjectArray<btQuantizedBvhNode>	QuantizedNodeArray;

-typedef btAlignedObjectArray<btBvhSubtreeInfo>		BvhSubtreeInfoArray;

-

-

-///The btQuantizedBvh class stores an AABB tree that can be quickly traversed on CPU and Cell SPU.

-///It is used by the btBvhTriangleMeshShape as midphase, and by the btMultiSapBroadphase.

-///It is recommended to use quantization for better performance and lower memory requirements.

-ATTRIBUTE_ALIGNED16(class) btQuantizedBvh

-{

-public:

-	enum btTraversalMode

-	{

-		TRAVERSAL_STACKLESS = 0,

-		TRAVERSAL_STACKLESS_CACHE_FRIENDLY,

-		TRAVERSAL_RECURSIVE

-	};

-

-protected:

-

-

-	btVector3			m_bvhAabbMin;

-	btVector3			m_bvhAabbMax;

-	btVector3			m_bvhQuantization;

-

-	int					m_bulletVersion;	//for serialization versioning. It could also be used to detect endianess.

-

-	int					m_curNodeIndex;

-	//quantization data

-	bool				m_useQuantization;

-

-

-

-	NodeArray			m_leafNodes;

-	NodeArray			m_contiguousNodes;

-	QuantizedNodeArray	m_quantizedLeafNodes;

-	QuantizedNodeArray	m_quantizedContiguousNodes;

-	

-	btTraversalMode	m_traversalMode;

-	BvhSubtreeInfoArray		m_SubtreeHeaders;

-

-	//This is only used for serialization so we don't have to add serialization directly to btAlignedObjectArray

-	mutable int m_subtreeHeaderCount;

-

-	

-

-

-

-	///two versions, one for quantized and normal nodes. This allows code-reuse while maintaining readability (no template/macro!)

-	///this might be refactored into a virtual, it is usually not calculated at run-time

-	void	setInternalNodeAabbMin(int nodeIndex, const btVector3& aabbMin)

-	{

-		if (m_useQuantization)

-		{

-			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] ,aabbMin,0);

-		} else

-		{

-			m_contiguousNodes[nodeIndex].m_aabbMinOrg = aabbMin;

-

-		}

-	}

-	void	setInternalNodeAabbMax(int nodeIndex,const btVector3& aabbMax)

-	{

-		if (m_useQuantization)

-		{

-			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0],aabbMax,1);

-		} else

-		{

-			m_contiguousNodes[nodeIndex].m_aabbMaxOrg = aabbMax;

-		}

-	}

-

-	btVector3 getAabbMin(int nodeIndex) const

-	{

-		if (m_useQuantization)

-		{

-			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMin[0]);

-		}

-		//non-quantized

-		return m_leafNodes[nodeIndex].m_aabbMinOrg;

-

-	}

-	btVector3 getAabbMax(int nodeIndex) const

-	{

-		if (m_useQuantization)

-		{

-			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMax[0]);

-		} 

-		//non-quantized

-		return m_leafNodes[nodeIndex].m_aabbMaxOrg;

-		

-	}

-

-	

-	void	setInternalNodeEscapeIndex(int nodeIndex, int escapeIndex)

-	{

-		if (m_useQuantization)

-		{

-			m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = -escapeIndex;

-		} 

-		else

-		{

-			m_contiguousNodes[nodeIndex].m_escapeIndex = escapeIndex;

-		}

-

-	}

-

-	void mergeInternalNodeAabb(int nodeIndex,const btVector3& newAabbMin,const btVector3& newAabbMax) 

-	{

-		if (m_useQuantization)

-		{

-			unsigned short int quantizedAabbMin[3];

-			unsigned short int quantizedAabbMax[3];

-			quantize(quantizedAabbMin,newAabbMin,0);

-			quantize(quantizedAabbMax,newAabbMax,1);

-			for (int i=0;i<3;i++)

-			{

-				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] > quantizedAabbMin[i])

-					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] = quantizedAabbMin[i];

-

-				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] < quantizedAabbMax[i])

-					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] = quantizedAabbMax[i];

-

-			}

-		} else

-		{

-			//non-quantized

-			m_contiguousNodes[nodeIndex].m_aabbMinOrg.setMin(newAabbMin);

-			m_contiguousNodes[nodeIndex].m_aabbMaxOrg.setMax(newAabbMax);		

-		}

-	}

-

-	void	swapLeafNodes(int firstIndex,int secondIndex);

-

-	void	assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex);

-

-protected:

-

-	

-

-	void	buildTree	(int startIndex,int endIndex);

-

-	int	calcSplittingAxis(int startIndex,int endIndex);

-

-	int	sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis);

-	

-	void	walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;

-

-	void	walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;

-	void	walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const;

-	void	walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;

-

-	///tree traversal designed for small-memory processors like PS3 SPU

-	void	walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;

-

-	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal

-	void	walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;

-

-	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal

-	void	walkRecursiveQuantizedTreeAgainstQuantizedTree(const btQuantizedBvhNode* treeNodeA,const btQuantizedBvhNode* treeNodeB,btNodeOverlapCallback* nodeCallback) const;

-	

-

-

-

-	void	updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex);

-

-public:

-	

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	btQuantizedBvh();

-

-	virtual ~btQuantizedBvh();

-

-	

-	///***************************************** expert/internal use only *************************

-	void	setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin=btScalar(1.0));

-	QuantizedNodeArray&	getLeafNodeArray() {			return	m_quantizedLeafNodes;	}

-	///buildInternal is expert use only: assumes that setQuantizationValues and LeafNodeArray are initialized

-	void	buildInternal();

-	///***************************************** expert/internal use only *************************

-

-	void	reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;

-	void	reportRayOverlappingNodex (btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget) const;

-	void	reportBoxCastOverlappingNodex(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin,const btVector3& aabbMax) const;

-

-		SIMD_FORCE_INLINE void quantize(unsigned short* out, const btVector3& point,int isMax) const

-	{

-

-		btAssert(m_useQuantization);

-

-		btAssert(point.getX() <= m_bvhAabbMax.getX());

-		btAssert(point.getY() <= m_bvhAabbMax.getY());

-		btAssert(point.getZ() <= m_bvhAabbMax.getZ());

-

-		btAssert(point.getX() >= m_bvhAabbMin.getX());

-		btAssert(point.getY() >= m_bvhAabbMin.getY());

-		btAssert(point.getZ() >= m_bvhAabbMin.getZ());

-

-		btVector3 v = (point - m_bvhAabbMin) * m_bvhQuantization;

-		///Make sure rounding is done in a way that unQuantize(quantizeWithClamp(...)) is conservative

-		///end-points always set the first bit, so that they are sorted properly (so that neighbouring AABBs overlap properly)

-		///@todo: double-check this

-		if (isMax)

-		{

-			out[0] = (unsigned short) (((unsigned short)(v.getX()+btScalar(1.)) | 1));

-			out[1] = (unsigned short) (((unsigned short)(v.getY()+btScalar(1.)) | 1));

-			out[2] = (unsigned short) (((unsigned short)(v.getZ()+btScalar(1.)) | 1));

-		} else

-		{

-			out[0] = (unsigned short) (((unsigned short)(v.getX()) & 0xfffe));

-			out[1] = (unsigned short) (((unsigned short)(v.getY()) & 0xfffe));

-			out[2] = (unsigned short) (((unsigned short)(v.getZ()) & 0xfffe));

-		}

-

-

-#ifdef DEBUG_CHECK_DEQUANTIZATION

-		btVector3 newPoint = unQuantize(out);

-		if (isMax)

-		{

-			if (newPoint.getX() < point.getX())

-			{

-				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());

-			}

-			if (newPoint.getY() < point.getY())

-			{

-				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());

-			}

-			if (newPoint.getZ() < point.getZ())

-			{

-

-				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());

-			}

-		} else

-		{

-			if (newPoint.getX() > point.getX())

-			{

-				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());

-			}

-			if (newPoint.getY() > point.getY())

-			{

-				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());

-			}

-			if (newPoint.getZ() > point.getZ())

-			{

-				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());

-			}

-		}

-#endif //DEBUG_CHECK_DEQUANTIZATION

-

-	}

-

-

-	SIMD_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const btVector3& point2,int isMax) const

-	{

-

-		btAssert(m_useQuantization);

-

-		btVector3 clampedPoint(point2);

-		clampedPoint.setMax(m_bvhAabbMin);

-		clampedPoint.setMin(m_bvhAabbMax);

-

-		quantize(out,clampedPoint,isMax);

-

-	}

-	

-	SIMD_FORCE_INLINE btVector3	unQuantize(const unsigned short* vecIn) const

-	{

-			btVector3	vecOut;

-			vecOut.setValue(

-			(btScalar)(vecIn[0]) / (m_bvhQuantization.getX()),

-			(btScalar)(vecIn[1]) / (m_bvhQuantization.getY()),

-			(btScalar)(vecIn[2]) / (m_bvhQuantization.getZ()));

-			vecOut += m_bvhAabbMin;

-			return vecOut;

-	}

-

-	///setTraversalMode let's you choose between stackless, recursive or stackless cache friendly tree traversal. Note this is only implemented for quantized trees.

-	void	setTraversalMode(btTraversalMode	traversalMode)

-	{

-		m_traversalMode = traversalMode;

-	}

-

-

-	SIMD_FORCE_INLINE QuantizedNodeArray&	getQuantizedNodeArray()

-	{	

-		return	m_quantizedContiguousNodes;

-	}

-

-

-	SIMD_FORCE_INLINE BvhSubtreeInfoArray&	getSubtreeInfoArray()

-	{

-		return m_SubtreeHeaders;

-	}

-

-////////////////////////////////////////////////////////////////////

-

-	/////Calculate space needed to store BVH for serialization

-	unsigned calculateSerializeBufferSize() const;

-

-	/// Data buffer MUST be 16 byte aligned

-	virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const;

-

-	///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'

-	static btQuantizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian);

-

-	static unsigned int getAlignmentSerializationPadding();

-//////////////////////////////////////////////////////////////////////

-

-	

-	virtual	int	calculateSerializeBufferSizeNew() const;

-

-	///fills the dataBuffer and returns the struct name (and 0 on failure)

-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;

-

-	virtual	void deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData);

-

-	virtual	void deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData);

-

-

-////////////////////////////////////////////////////////////////////

-

-	SIMD_FORCE_INLINE bool isQuantized()

-	{

-		return m_useQuantization;

-	}

-

-private:

-	// Special "copy" constructor that allows for in-place deserialization

-	// Prevents btVector3's default constructor from being called, but doesn't inialize much else

-	// ownsMemory should most likely be false if deserializing, and if you are not, don't call this (it also changes the function signature, which we need)

-	btQuantizedBvh(btQuantizedBvh &other, bool ownsMemory);

-

-}

-;

-

-

-struct	btBvhSubtreeInfoData

-{

-	int			m_rootNodeIndex;

-	int			m_subtreeSize;

-	unsigned short m_quantizedAabbMin[3];

-	unsigned short m_quantizedAabbMax[3];

-};

-

-struct btOptimizedBvhNodeFloatData

-{

-	btVector3FloatData	m_aabbMinOrg;

-	btVector3FloatData	m_aabbMaxOrg;

-	int	m_escapeIndex;

-	int	m_subPart;

-	int	m_triangleIndex;

-	char m_pad[4];

-};

-

-struct btOptimizedBvhNodeDoubleData

-{

-	btVector3DoubleData	m_aabbMinOrg;

-	btVector3DoubleData	m_aabbMaxOrg;

-	int	m_escapeIndex;

-	int	m_subPart;

-	int	m_triangleIndex;

-	char	m_pad[4];

-};

-

-

-struct btQuantizedBvhNodeData

-{

-	unsigned short m_quantizedAabbMin[3];

-	unsigned short m_quantizedAabbMax[3];

-	int	m_escapeIndexOrTriangleIndex;

-};

-

-struct	btQuantizedBvhFloatData

-{

-	btVector3FloatData			m_bvhAabbMin;

-	btVector3FloatData			m_bvhAabbMax;

-	btVector3FloatData			m_bvhQuantization;

-	int					m_curNodeIndex;

-	int					m_useQuantization;

-	int					m_numContiguousLeafNodes;

-	int					m_numQuantizedContiguousNodes;

-	btOptimizedBvhNodeFloatData	*m_contiguousNodesPtr;

-	btQuantizedBvhNodeData		*m_quantizedContiguousNodesPtr;

-	btBvhSubtreeInfoData	*m_subTreeInfoPtr;

-	int					m_traversalMode;

-	int					m_numSubtreeHeaders;

-	

-};

-

-struct	btQuantizedBvhDoubleData

-{

-	btVector3DoubleData			m_bvhAabbMin;

-	btVector3DoubleData			m_bvhAabbMax;

-	btVector3DoubleData			m_bvhQuantization;

-	int							m_curNodeIndex;

-	int							m_useQuantization;

-	int							m_numContiguousLeafNodes;

-	int							m_numQuantizedContiguousNodes;

-	btOptimizedBvhNodeDoubleData	*m_contiguousNodesPtr;

-	btQuantizedBvhNodeData			*m_quantizedContiguousNodesPtr;

-

-	int							m_traversalMode;

-	int							m_numSubtreeHeaders;

-	btBvhSubtreeInfoData		*m_subTreeInfoPtr;

-};

-

-

-SIMD_FORCE_INLINE	int	btQuantizedBvh::calculateSerializeBufferSizeNew() const

-{

-	return sizeof(btQuantizedBvhData);

-}

-

-

-

-#endif //QUANTIZED_BVH_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/.svn/text-base/btSimpleBroadphase.h.svn-base
+++ /dev/null
@@ -1,172 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SIMPLE_BROADPHASE_H

-#define SIMPLE_BROADPHASE_H

-

-

-#include "btOverlappingPairCache.h"

-

-

-struct btSimpleBroadphaseProxy : public btBroadphaseProxy

-{

-	int			m_nextFree;

-	

-//	int			m_handleId;

-

-	

-	btSimpleBroadphaseProxy() {};

-

-	btSimpleBroadphaseProxy(const btVector3& minpt,const btVector3& maxpt,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,void* multiSapProxy)

-	:btBroadphaseProxy(minpt,maxpt,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy)

-	{

-		(void)shapeType;

-	}

-	

-	

-	SIMD_FORCE_INLINE void SetNextFree(int next) {m_nextFree = next;}

-	SIMD_FORCE_INLINE int GetNextFree() const {return m_nextFree;}

-

-	

-

-

-};

-

-///The SimpleBroadphase is just a unit-test for btAxisSweep3, bt32BitAxisSweep3, or btDbvtBroadphase, so use those classes instead.

-///It is a brute force aabb culling broadphase based on O(n^2) aabb checks

-class btSimpleBroadphase : public btBroadphaseInterface

-{

-

-protected:

-

-	int		m_numHandles;						// number of active handles

-	int		m_maxHandles;						// max number of handles

-	int		m_LastHandleIndex;							

-	

-	btSimpleBroadphaseProxy* m_pHandles;						// handles pool

-

-	void* m_pHandlesRawPtr;

-	int		m_firstFreeHandle;		// free handles list

-	

-	int allocHandle()

-	{

-		btAssert(m_numHandles < m_maxHandles);

-		int freeHandle = m_firstFreeHandle;

-		m_firstFreeHandle = m_pHandles[freeHandle].GetNextFree();

-		m_numHandles++;

-		if(freeHandle > m_LastHandleIndex)

-		{

-			m_LastHandleIndex = freeHandle;

-		}

-		return freeHandle;

-	}

-

-	void freeHandle(btSimpleBroadphaseProxy* proxy)

-	{

-		int handle = int(proxy-m_pHandles);

-		btAssert(handle >= 0 && handle < m_maxHandles);

-		if(handle == m_LastHandleIndex)

-		{

-			m_LastHandleIndex--;

-		}

-		proxy->SetNextFree(m_firstFreeHandle);

-		m_firstFreeHandle = handle;

-

-		proxy->m_clientObject = 0;

-

-		m_numHandles--;

-	}

-

-	btOverlappingPairCache*	m_pairCache;

-	bool	m_ownsPairCache;

-

-	int	m_invalidPair;

-

-	

-	

-	inline btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy)

-	{

-		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxy);

-		return proxy0;

-	}

-

-	inline const btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy) const

-	{

-		const btSimpleBroadphaseProxy* proxy0 = static_cast<const btSimpleBroadphaseProxy*>(proxy);

-		return proxy0;

-	}

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher);

-

-

-	void	validate();

-

-protected:

-

-

-	

-

-public:

-	btSimpleBroadphase(int maxProxies=16384,btOverlappingPairCache* overlappingPairCache=0);

-	virtual ~btSimpleBroadphase();

-

-

-		static bool	aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1);

-

-

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);

-

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);

-

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);

-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));

-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);

-		

-	btOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_pairCache;

-	}

-	const btOverlappingPairCache*	getOverlappingPairCache() const

-	{

-		return m_pairCache;

-	}

-

-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const

-	{

-		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);

-		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);

-	}

-

-	virtual void	printStats()

-	{

-//		printf("btSimpleBroadphase.h\n");

-//		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);

-	}

-};

-

-

-

-#endif //SIMPLE_BROADPHASE_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btAxisSweep3.h
+++ /dev/null
@@ -1,1052 +1,1 @@
-//Bullet Continuous Collision Detection and Physics Library

-//Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-//

-// btAxisSweep3.h

-//

-// Copyright (c) 2006 Simon Hobbs

-//

-// This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

-//

-// Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

-//

-// 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-//

-// 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-//

-// 3. This notice may not be removed or altered from any source distribution.

-

-#ifndef AXIS_SWEEP_3_H

-#define AXIS_SWEEP_3_H

-

-#include "LinearMath/btVector3.h"

-#include "btOverlappingPairCache.h"

-#include "btBroadphaseInterface.h"

-#include "btBroadphaseProxy.h"

-#include "btOverlappingPairCallback.h"

-#include "btDbvtBroadphase.h"

-

-//#define DEBUG_BROADPHASE 1

-#define USE_OVERLAP_TEST_ON_REMOVES 1

-

-/// The internal templace class btAxisSweep3Internal implements the sweep and prune broadphase.

-/// It uses quantized integers to represent the begin and end points for each of the 3 axis.

-/// Dont use this class directly, use btAxisSweep3 or bt32BitAxisSweep3 instead.

-template <typename BP_FP_INT_TYPE>

-class btAxisSweep3Internal : public btBroadphaseInterface

-{

-protected:

-

-	BP_FP_INT_TYPE	m_bpHandleMask;

-	BP_FP_INT_TYPE	m_handleSentinel;

-

-public:

-	

- BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	class Edge

-	{

-	public:

-		BP_FP_INT_TYPE m_pos;			// low bit is min/max

-		BP_FP_INT_TYPE m_handle;

-

-		BP_FP_INT_TYPE IsMax() const {return static_cast<BP_FP_INT_TYPE>(m_pos & 1);}

-	};

-

-public:

-	class	Handle : public btBroadphaseProxy

-	{

-	public:

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-	

-		// indexes into the edge arrays

-		BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3];		// 6 * 2 = 12

-//		BP_FP_INT_TYPE m_uniqueId;

-		btBroadphaseProxy*	m_dbvtProxy;//for faster raycast

-		//void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject

-	

-		SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}

-		SIMD_FORCE_INLINE BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];}

-	};		// 24 bytes + 24 for Edge structures = 44 bytes total per entry

-

-	

-protected:

-	btVector3 m_worldAabbMin;						// overall system bounds

-	btVector3 m_worldAabbMax;						// overall system bounds

-

-	btVector3 m_quantize;						// scaling factor for quantization

-

-	BP_FP_INT_TYPE m_numHandles;						// number of active handles

-	BP_FP_INT_TYPE m_maxHandles;						// max number of handles

-	Handle* m_pHandles;						// handles pool

-	

-	BP_FP_INT_TYPE m_firstFreeHandle;		// free handles list

-

-	Edge* m_pEdges[3];						// edge arrays for the 3 axes (each array has m_maxHandles * 2 + 2 sentinel entries)

-	void* m_pEdgesRawPtr[3];

-

-	btOverlappingPairCache* m_pairCache;

-

-	///btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.

-	btOverlappingPairCallback* m_userPairCallback;

-	

-	bool	m_ownsPairCache;

-

-	int	m_invalidPair;

-

-	///additional dynamic aabb structure, used to accelerate ray cast queries.

-	///can be disabled using a optional argument in the constructor

-	btDbvtBroadphase*	m_raycastAccelerator;

-	btOverlappingPairCache*	m_nullPairCache;

-

-

-	// allocation/deallocation

-	BP_FP_INT_TYPE allocHandle();

-	void freeHandle(BP_FP_INT_TYPE handle);

-	

-

-	bool testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1);

-

-#ifdef DEBUG_BROADPHASE

-	void debugPrintAxis(int axis,bool checkCardinality=true);

-#endif //DEBUG_BROADPHASE

-

-	//Overlap* AddOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);

-	//void RemoveOverlap(BP_FP_INT_TYPE handleA, BP_FP_INT_TYPE handleB);

-

-	

-

-	void sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-	void sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-	void sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-	void sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps );

-

-public:

-

-	btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0,bool disableRaycastAccelerator = false);

-

-	virtual	~btAxisSweep3Internal();

-

-	BP_FP_INT_TYPE getNumHandles() const

-	{

-		return m_numHandles;

-	}

-

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);

-	

-	BP_FP_INT_TYPE addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);

-	void removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher);

-	void updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);

-	SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}

-

-	virtual void resetPool(btDispatcher* dispatcher);

-

-	void	processAllOverlappingPairs(btOverlapCallback* callback);

-

-	//Broadphase Interface

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);

-	virtual void  getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-	

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));

-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);

-

-	

-	void quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const;

-	///unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result

-	void unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-	

-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-	btOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_pairCache;

-	}

-	const btOverlappingPairCache*	getOverlappingPairCache() const

-	{

-		return m_pairCache;

-	}

-

-	void	setOverlappingPairUserCallback(btOverlappingPairCallback* pairCallback)

-	{

-		m_userPairCallback = pairCallback;

-	}

-	const btOverlappingPairCallback*	getOverlappingPairUserCallback() const

-	{

-		return m_userPairCallback;

-	}

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const

-	{

-		aabbMin = m_worldAabbMin;

-		aabbMax = m_worldAabbMax;

-	}

-

-	virtual void	printStats()

-	{

-/*		printf("btAxisSweep3.h\n");

-		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);

-		printf("aabbMin=%f,%f,%f,aabbMax=%f,%f,%f\n",m_worldAabbMin.getX(),m_worldAabbMin.getY(),m_worldAabbMin.getZ(),

-			m_worldAabbMax.getX(),m_worldAabbMax.getY(),m_worldAabbMax.getZ());

-			*/

-

-	}

-

-};

-

-////////////////////////////////////////////////////////////////////

-

-

-

-

-#ifdef DEBUG_BROADPHASE

-#include <stdio.h>

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3<BP_FP_INT_TYPE>::debugPrintAxis(int axis, bool checkCardinality)

-{

-	int numEdges = m_pHandles[0].m_maxEdges[axis];

-	printf("SAP Axis %d, numEdges=%d\n",axis,numEdges);

-

-	int i;

-	for (i=0;i<numEdges+1;i++)

-	{

-		Edge* pEdge = m_pEdges[axis] + i;

-		Handle* pHandlePrev = getHandle(pEdge->m_handle);

-		int handleIndex = pEdge->IsMax()? pHandlePrev->m_maxEdges[axis] : pHandlePrev->m_minEdges[axis];

-		char beginOrEnd;

-		beginOrEnd=pEdge->IsMax()?'E':'B';

-		printf("	[%c,h=%d,p=%x,i=%d]\n",beginOrEnd,pEdge->m_handle,pEdge->m_pos,handleIndex);

-	}

-

-	if (checkCardinality)

-		btAssert(numEdges == m_numHandles*2+1);

-}

-#endif //DEBUG_BROADPHASE

-

-template <typename BP_FP_INT_TYPE>

-btBroadphaseProxy*	btAxisSweep3Internal<BP_FP_INT_TYPE>::createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)

-{

-		(void)shapeType;

-		BP_FP_INT_TYPE handleId = addHandle(aabbMin,aabbMax, userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,multiSapProxy);

-		

-		Handle* handle = getHandle(handleId);

-		

-		if (m_raycastAccelerator)

-		{

-			btBroadphaseProxy* rayProxy = m_raycastAccelerator->createProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,dispatcher,0);

-			handle->m_dbvtProxy = rayProxy;

-		}

-		return handle;

-}

-

-

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)

-{

-	Handle* handle = static_cast<Handle*>(proxy);

-	if (m_raycastAccelerator)

-		m_raycastAccelerator->destroyProxy(handle->m_dbvtProxy,dispatcher);

-	removeHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), dispatcher);

-}

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)

-{

-	Handle* handle = static_cast<Handle*>(proxy);

-	handle->m_aabbMin = aabbMin;

-	handle->m_aabbMax = aabbMax;

-	updateHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), aabbMin, aabbMax,dispatcher);

-	if (m_raycastAccelerator)

-		m_raycastAccelerator->setAabb(handle->m_dbvtProxy,aabbMin,aabbMax,dispatcher);

-

-}

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)

-{

-	if (m_raycastAccelerator)

-	{

-		m_raycastAccelerator->rayTest(rayFrom,rayTo,rayCallback,aabbMin,aabbMax);

-	} else

-	{

-		//choose axis?

-		BP_FP_INT_TYPE axis = 0;

-		//for each proxy

-		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)

-		{

-			if (m_pEdges[axis][i].IsMax())

-			{

-				rayCallback.process(getHandle(m_pEdges[axis][i].m_handle));

-			}

-		}

-	}

-}

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback)

-{

-	if (m_raycastAccelerator)

-	{

-		m_raycastAccelerator->aabbTest(aabbMin,aabbMax,callback);

-	} else

-	{

-		//choose axis?

-		BP_FP_INT_TYPE axis = 0;

-		//for each proxy

-		for (BP_FP_INT_TYPE i=1;i<m_numHandles*2+1;i++)

-		{

-			if (m_pEdges[axis][i].IsMax())

-			{

-				Handle* handle = getHandle(m_pEdges[axis][i].m_handle);

-				if (TestAabbAgainstAabb2(aabbMin,aabbMax,handle->m_aabbMin,handle->m_aabbMax))

-				{

-					callback.process(handle);

-				}

-			}

-		}

-	}

-}

-

-

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const

-{

-	Handle* pHandle = static_cast<Handle*>(proxy);

-	aabbMin = pHandle->m_aabbMin;

-	aabbMax = pHandle->m_aabbMax;

-}

-

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::unQuantize(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const

-{

-	Handle* pHandle = static_cast<Handle*>(proxy);

-

-	unsigned short vecInMin[3];

-	unsigned short vecInMax[3];

-

-	vecInMin[0] = m_pEdges[0][pHandle->m_minEdges[0]].m_pos ;

-	vecInMax[0] = m_pEdges[0][pHandle->m_maxEdges[0]].m_pos +1 ;

-	vecInMin[1] = m_pEdges[1][pHandle->m_minEdges[1]].m_pos ;

-	vecInMax[1] = m_pEdges[1][pHandle->m_maxEdges[1]].m_pos +1 ;

-	vecInMin[2] = m_pEdges[2][pHandle->m_minEdges[2]].m_pos ;

-	vecInMax[2] = m_pEdges[2][pHandle->m_maxEdges[2]].m_pos +1 ;

-	

-	aabbMin.setValue((btScalar)(vecInMin[0]) / (m_quantize.getX()),(btScalar)(vecInMin[1]) / (m_quantize.getY()),(btScalar)(vecInMin[2]) / (m_quantize.getZ()));

-	aabbMin += m_worldAabbMin;

-	

-	aabbMax.setValue((btScalar)(vecInMax[0]) / (m_quantize.getX()),(btScalar)(vecInMax[1]) / (m_quantize.getY()),(btScalar)(vecInMax[2]) / (m_quantize.getZ()));

-	aabbMax += m_worldAabbMin;

-}

-

-

-

-

-template <typename BP_FP_INT_TYPE>

-btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btVector3& worldAabbMin,const btVector3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache , bool disableRaycastAccelerator)

-:m_bpHandleMask(handleMask),

-m_handleSentinel(handleSentinel),

-m_pairCache(pairCache),

-m_userPairCallback(0),

-m_ownsPairCache(false),

-m_invalidPair(0),

-m_raycastAccelerator(0)

-{

-	BP_FP_INT_TYPE maxHandles = static_cast<BP_FP_INT_TYPE>(userMaxHandles+1);//need to add one sentinel handle

-

-	if (!m_pairCache)

-	{

-		void* ptr = btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16);

-		m_pairCache = new(ptr) btHashedOverlappingPairCache();

-		m_ownsPairCache = true;

-	}

-

-	if (!disableRaycastAccelerator)

-	{

-		m_nullPairCache = new (btAlignedAlloc(sizeof(btNullPairCache),16)) btNullPairCache();

-		m_raycastAccelerator = new (btAlignedAlloc(sizeof(btDbvtBroadphase),16)) btDbvtBroadphase(m_nullPairCache);//m_pairCache);

-		m_raycastAccelerator->m_deferedcollide = true;//don't add/remove pairs

-	}

-

-	//btAssert(bounds.HasVolume());

-

-	// init bounds

-	m_worldAabbMin = worldAabbMin;

-	m_worldAabbMax = worldAabbMax;

-

-	btVector3 aabbSize = m_worldAabbMax - m_worldAabbMin;

-

-	BP_FP_INT_TYPE	maxInt = m_handleSentinel;

-

-	m_quantize = btVector3(btScalar(maxInt),btScalar(maxInt),btScalar(maxInt)) / aabbSize;

-

-	// allocate handles buffer, using btAlignedAlloc, and put all handles on free list

-	m_pHandles = new Handle[maxHandles];

-	

-	m_maxHandles = maxHandles;

-	m_numHandles = 0;

-

-	// handle 0 is reserved as the null index, and is also used as the sentinel

-	m_firstFreeHandle = 1;

-	{

-		for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++)

-			m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));

-		m_pHandles[maxHandles - 1].SetNextFree(0);

-	}

-

-	{

-		// allocate edge buffers

-		for (int i = 0; i < 3; i++)

-		{

-			m_pEdgesRawPtr[i] = btAlignedAlloc(sizeof(Edge)*maxHandles*2,16);

-			m_pEdges[i] = new(m_pEdgesRawPtr[i]) Edge[maxHandles * 2];

-		}

-	}

-	//removed overlap management

-

-	// make boundary sentinels

-	

-	m_pHandles[0].m_clientObject = 0;

-

-	for (int axis = 0; axis < 3; axis++)

-	{

-		m_pHandles[0].m_minEdges[axis] = 0;

-		m_pHandles[0].m_maxEdges[axis] = 1;

-

-		m_pEdges[axis][0].m_pos = 0;

-		m_pEdges[axis][0].m_handle = 0;

-		m_pEdges[axis][1].m_pos = m_handleSentinel;

-		m_pEdges[axis][1].m_handle = 0;

-#ifdef DEBUG_BROADPHASE

-		debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-

-	}

-

-}

-

-template <typename BP_FP_INT_TYPE>

-btAxisSweep3Internal<BP_FP_INT_TYPE>::~btAxisSweep3Internal()

-{

-	if (m_raycastAccelerator)

-	{

-		m_nullPairCache->~btOverlappingPairCache();

-		btAlignedFree(m_nullPairCache);

-		m_raycastAccelerator->~btDbvtBroadphase();

-		btAlignedFree (m_raycastAccelerator);

-	}

-

-	for (int i = 2; i >= 0; i--)

-	{

-		btAlignedFree(m_pEdgesRawPtr[i]);

-	}

-	delete [] m_pHandles;

-

-	if (m_ownsPairCache)

-	{

-		m_pairCache->~btOverlappingPairCache();

-		btAlignedFree(m_pairCache);

-	}

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::quantize(BP_FP_INT_TYPE* out, const btVector3& point, int isMax) const

-{

-#ifdef OLD_CLAMPING_METHOD

-	///problem with this clamping method is that the floating point during quantization might still go outside the range [(0|isMax) .. (m_handleSentinel&m_bpHandleMask]|isMax]

-	///see http://code.google.com/p/bullet/issues/detail?id=87

-	btVector3 clampedPoint(point);

-	clampedPoint.setMax(m_worldAabbMin);

-	clampedPoint.setMin(m_worldAabbMax);

-	btVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize;

-	out[0] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getX() & m_bpHandleMask) | isMax);

-	out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & m_bpHandleMask) | isMax);

-	out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & m_bpHandleMask) | isMax);

-#else

-	btVector3 v = (point - m_worldAabbMin) * m_quantize;

-	out[0]=(v[0]<=0)?(BP_FP_INT_TYPE)isMax:(v[0]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[0]&m_bpHandleMask)|isMax);

-	out[1]=(v[1]<=0)?(BP_FP_INT_TYPE)isMax:(v[1]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[1]&m_bpHandleMask)|isMax);

-	out[2]=(v[2]<=0)?(BP_FP_INT_TYPE)isMax:(v[2]>=m_handleSentinel)?(BP_FP_INT_TYPE)((m_handleSentinel&m_bpHandleMask)|isMax):(BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v[2]&m_bpHandleMask)|isMax);

-#endif //OLD_CLAMPING_METHOD

-}

-

-

-template <typename BP_FP_INT_TYPE>

-BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()

-{

-	btAssert(m_firstFreeHandle);

-

-	BP_FP_INT_TYPE handle = m_firstFreeHandle;

-	m_firstFreeHandle = getHandle(handle)->GetNextFree();

-	m_numHandles++;

-

-	return handle;

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::freeHandle(BP_FP_INT_TYPE handle)

-{

-	btAssert(handle > 0 && handle < m_maxHandles);

-

-	getHandle(handle)->SetNextFree(m_firstFreeHandle);

-	m_firstFreeHandle = handle;

-

-	m_numHandles--;

-}

-

-

-template <typename BP_FP_INT_TYPE>

-BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::addHandle(const btVector3& aabbMin,const btVector3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy)

-{

-	// quantize the bounds

-	BP_FP_INT_TYPE min[3], max[3];

-	quantize(min, aabbMin, 0);

-	quantize(max, aabbMax, 1);

-

-	// allocate a handle

-	BP_FP_INT_TYPE handle = allocHandle();

-	

-

-	Handle* pHandle = getHandle(handle);

-	

-	pHandle->m_uniqueId = static_cast<int>(handle);

-	//pHandle->m_pOverlaps = 0;

-	pHandle->m_clientObject = pOwner;

-	pHandle->m_collisionFilterGroup = collisionFilterGroup;

-	pHandle->m_collisionFilterMask = collisionFilterMask;

-	pHandle->m_multiSapParentProxy = multiSapProxy;

-

-	// compute current limit of edge arrays

-	BP_FP_INT_TYPE limit = static_cast<BP_FP_INT_TYPE>(m_numHandles * 2);

-

-	

-	// insert new edges just inside the max boundary edge

-	for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++)

-	{

-

-		m_pHandles[0].m_maxEdges[axis] += 2;

-

-		m_pEdges[axis][limit + 1] = m_pEdges[axis][limit - 1];

-

-		m_pEdges[axis][limit - 1].m_pos = min[axis];

-		m_pEdges[axis][limit - 1].m_handle = handle;

-

-		m_pEdges[axis][limit].m_pos = max[axis];

-		m_pEdges[axis][limit].m_handle = handle;

-

-		pHandle->m_minEdges[axis] = static_cast<BP_FP_INT_TYPE>(limit - 1);

-		pHandle->m_maxEdges[axis] = limit;

-	}

-

-	// now sort the new edges to their correct position

-	sortMinDown(0, pHandle->m_minEdges[0], dispatcher,false);

-	sortMaxDown(0, pHandle->m_maxEdges[0], dispatcher,false);

-	sortMinDown(1, pHandle->m_minEdges[1], dispatcher,false);

-	sortMaxDown(1, pHandle->m_maxEdges[1], dispatcher,false);

-	sortMinDown(2, pHandle->m_minEdges[2], dispatcher,true);

-	sortMaxDown(2, pHandle->m_maxEdges[2], dispatcher,true);

-

-

-	return handle;

-}

-

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::removeHandle(BP_FP_INT_TYPE handle,btDispatcher* dispatcher)

-{

-

-	Handle* pHandle = getHandle(handle);

-

-	//explicitly remove the pairs containing the proxy

-	//we could do it also in the sortMinUp (passing true)

-	///@todo: compare performance

-	if (!m_pairCache->hasDeferredRemoval())

-	{

-		m_pairCache->removeOverlappingPairsContainingProxy(pHandle,dispatcher);

-	}

-

-	// compute current limit of edge arrays

-	int limit = static_cast<int>(m_numHandles * 2);

-	

-	int axis;

-

-	for (axis = 0;axis<3;axis++)

-	{

-		m_pHandles[0].m_maxEdges[axis] -= 2;

-	}

-

-	// remove the edges by sorting them up to the end of the list

-	for ( axis = 0; axis < 3; axis++)

-	{

-		Edge* pEdges = m_pEdges[axis];

-		BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis];

-		pEdges[max].m_pos = m_handleSentinel;

-

-		sortMaxUp(axis,max,dispatcher,false);

-

-

-		BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];

-		pEdges[i].m_pos = m_handleSentinel;

-

-

-		sortMinUp(axis,i,dispatcher,false);

-

-		pEdges[limit-1].m_handle = 0;

-		pEdges[limit-1].m_pos = m_handleSentinel;

-		

-#ifdef DEBUG_BROADPHASE

-			debugPrintAxis(axis,false);

-#endif //DEBUG_BROADPHASE

-

-

-	}

-

-

-	// free the handle

-	freeHandle(handle);

-

-	

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::resetPool(btDispatcher* dispatcher)

-{

-	if (m_numHandles == 0)

-	{

-		m_firstFreeHandle = 1;

-		{

-			for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < m_maxHandles; i++)

-				m_pHandles[i].SetNextFree(static_cast<BP_FP_INT_TYPE>(i + 1));

-			m_pHandles[m_maxHandles - 1].SetNextFree(0);

-		}

-	}

-}       

-

-

-extern int gOverlappingPairs;

-//#include <stdio.h>

-

-template <typename BP_FP_INT_TYPE>

-void	btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatcher* dispatcher)

-{

-

-	if (m_pairCache->hasDeferredRemoval())

-	{

-	

-		btBroadphasePairArray&	overlappingPairArray = m_pairCache->getOverlappingPairArray();

-

-		//perform a sort, to find duplicates and to sort 'invalid' pairs to the end

-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());

-

-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);

-		m_invalidPair = 0;

-

-		

-		int i;

-

-		btBroadphasePair previousPair;

-		previousPair.m_pProxy0 = 0;

-		previousPair.m_pProxy1 = 0;

-		previousPair.m_algorithm = 0;

-		

-		

-		for (i=0;i<overlappingPairArray.size();i++)

-		{

-		

-			btBroadphasePair& pair = overlappingPairArray[i];

-

-			bool isDuplicate = (pair == previousPair);

-

-			previousPair = pair;

-

-			bool needsRemoval = false;

-

-			if (!isDuplicate)

-			{

-				///important to use an AABB test that is consistent with the broadphase

-				bool hasOverlap = testAabbOverlap(pair.m_pProxy0,pair.m_pProxy1);

-

-				if (hasOverlap)

-				{

-					needsRemoval = false;//callback->processOverlap(pair);

-				} else

-				{

-					needsRemoval = true;

-				}

-			} else

-			{

-				//remove duplicate

-				needsRemoval = true;

-				//should have no algorithm

-				btAssert(!pair.m_algorithm);

-			}

-			

-			if (needsRemoval)

-			{

-				m_pairCache->cleanOverlappingPair(pair,dispatcher);

-

-		//		m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);

-		//		m_overlappingPairArray.pop_back();

-				pair.m_pProxy0 = 0;

-				pair.m_pProxy1 = 0;

-				m_invalidPair++;

-				gOverlappingPairs--;

-			} 

-			

-		}

-

-	///if you don't like to skip the invalid pairs in the array, execute following code:

-	#define CLEAN_INVALID_PAIRS 1

-	#ifdef CLEAN_INVALID_PAIRS

-

-		//perform a sort, to sort 'invalid' pairs to the end

-		overlappingPairArray.quickSort(btBroadphasePairSortPredicate());

-

-		overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);

-		m_invalidPair = 0;

-	#endif//CLEAN_INVALID_PAIRS

-		

-		//printf("overlappingPairArray.size()=%d\n",overlappingPairArray.size());

-	}

-

-}

-

-

-template <typename BP_FP_INT_TYPE>

-bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)

-{

-	const Handle* pHandleA = static_cast<Handle*>(proxy0);

-	const Handle* pHandleB = static_cast<Handle*>(proxy1);

-	

-	//optimization 1: check the array index (memory address), instead of the m_pos

-

-	for (int axis = 0; axis < 3; axis++)

-	{ 

-		if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || 

-			pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) 

-		{ 

-			return false; 

-		} 

-	} 

-	return true;

-}

-

-template <typename BP_FP_INT_TYPE>

-bool btAxisSweep3Internal<BP_FP_INT_TYPE>::testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1)

-{

-	//optimization 1: check the array index (memory address), instead of the m_pos

-

-	if (pHandleA->m_maxEdges[axis0] < pHandleB->m_minEdges[axis0] || 

-		pHandleB->m_maxEdges[axis0] < pHandleA->m_minEdges[axis0] ||

-		pHandleA->m_maxEdges[axis1] < pHandleB->m_minEdges[axis1] ||

-		pHandleB->m_maxEdges[axis1] < pHandleA->m_minEdges[axis1]) 

-	{ 

-		return false; 

-	} 

-	return true;

-}

-

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::updateHandle(BP_FP_INT_TYPE handle, const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher)

-{

-//	btAssert(bounds.IsFinite());

-	//btAssert(bounds.HasVolume());

-

-	Handle* pHandle = getHandle(handle);

-

-	// quantize the new bounds

-	BP_FP_INT_TYPE min[3], max[3];

-	quantize(min, aabbMin, 0);

-	quantize(max, aabbMax, 1);

-

-	// update changed edges

-	for (int axis = 0; axis < 3; axis++)

-	{

-		BP_FP_INT_TYPE emin = pHandle->m_minEdges[axis];

-		BP_FP_INT_TYPE emax = pHandle->m_maxEdges[axis];

-

-		int dmin = (int)min[axis] - (int)m_pEdges[axis][emin].m_pos;

-		int dmax = (int)max[axis] - (int)m_pEdges[axis][emax].m_pos;

-

-		m_pEdges[axis][emin].m_pos = min[axis];

-		m_pEdges[axis][emax].m_pos = max[axis];

-

-		// expand (only adds overlaps)

-		if (dmin < 0)

-			sortMinDown(axis, emin,dispatcher,true);

-

-		if (dmax > 0)

-			sortMaxUp(axis, emax,dispatcher,true);

-

-		// shrink (only removes overlaps)

-		if (dmin > 0)

-			sortMinUp(axis, emin,dispatcher,true);

-

-		if (dmax < 0)

-			sortMaxDown(axis, emax,dispatcher,true);

-

-#ifdef DEBUG_BROADPHASE

-	debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-	}

-

-	

-}

-

-

-

-

-// sorting a min edge downwards can only ever *add* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)

-{

-

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pPrev = pEdge - 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pEdge->m_pos < pPrev->m_pos)

-	{

-		Handle* pHandlePrev = getHandle(pPrev->m_handle);

-

-		if (pPrev->IsMax())

-		{

-			// if previous edge is a maximum check the bounds and add an overlap if necessary

-			const int axis1 = (1  << axis) & 3;

-			const int axis2 = (1  << axis1) & 3;

-			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandlePrev,axis1,axis2))

-			{

-				m_pairCache->addOverlappingPair(pHandleEdge,pHandlePrev);

-				if (m_userPairCallback)

-					m_userPairCallback->addOverlappingPair(pHandleEdge,pHandlePrev);

-

-				//AddOverlap(pEdge->m_handle, pPrev->m_handle);

-

-			}

-

-			// update edge reference in other handle

-			pHandlePrev->m_maxEdges[axis]++;

-		}

-		else

-			pHandlePrev->m_minEdges[axis]++;

-

-		pHandleEdge->m_minEdges[axis]--;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pPrev;

-		*pPrev = swap;

-

-		// decrement

-		pEdge--;

-		pPrev--;

-	}

-

-#ifdef DEBUG_BROADPHASE

-	debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-

-}

-

-// sorting a min edge upwards can only ever *remove* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMinUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)

-{

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pNext = pEdge + 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))

-	{

-		Handle* pHandleNext = getHandle(pNext->m_handle);

-

-		if (pNext->IsMax())

-		{

-			Handle* handle0 = getHandle(pEdge->m_handle);

-			Handle* handle1 = getHandle(pNext->m_handle);

-			const int axis1 = (1  << axis) & 3;

-			const int axis2 = (1  << axis1) & 3;

-			

-			// if next edge is maximum remove any overlap between the two handles

-			if (updateOverlaps 

-#ifdef USE_OVERLAP_TEST_ON_REMOVES

-				&& testOverlap2D(handle0,handle1,axis1,axis2)

-#endif //USE_OVERLAP_TEST_ON_REMOVES

-				)

-			{

-				

-

-				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);	

-				if (m_userPairCallback)

-					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);

-				

-			}

-

-

-			// update edge reference in other handle

-			pHandleNext->m_maxEdges[axis]--;

-		}

-		else

-			pHandleNext->m_minEdges[axis]--;

-

-		pHandleEdge->m_minEdges[axis]++;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pNext;

-		*pNext = swap;

-

-		// increment

-		pEdge++;

-		pNext++;

-	}

-

-

-}

-

-// sorting a max edge downwards can only ever *remove* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxDown(int axis, BP_FP_INT_TYPE edge, btDispatcher* dispatcher, bool updateOverlaps)

-{

-

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pPrev = pEdge - 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pEdge->m_pos < pPrev->m_pos)

-	{

-		Handle* pHandlePrev = getHandle(pPrev->m_handle);

-

-		if (!pPrev->IsMax())

-		{

-			// if previous edge was a minimum remove any overlap between the two handles

-			Handle* handle0 = getHandle(pEdge->m_handle);

-			Handle* handle1 = getHandle(pPrev->m_handle);

-			const int axis1 = (1  << axis) & 3;

-			const int axis2 = (1  << axis1) & 3;

-

-			if (updateOverlaps  

-#ifdef USE_OVERLAP_TEST_ON_REMOVES

-				&& testOverlap2D(handle0,handle1,axis1,axis2)

-#endif //USE_OVERLAP_TEST_ON_REMOVES

-				)

-			{

-				//this is done during the overlappingpairarray iteration/narrowphase collision

-

-				

-				m_pairCache->removeOverlappingPair(handle0,handle1,dispatcher);

-				if (m_userPairCallback)

-					m_userPairCallback->removeOverlappingPair(handle0,handle1,dispatcher);

-			

-

-

-			}

-

-			// update edge reference in other handle

-			pHandlePrev->m_minEdges[axis]++;;

-		}

-		else

-			pHandlePrev->m_maxEdges[axis]++;

-

-		pHandleEdge->m_maxEdges[axis]--;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pPrev;

-		*pPrev = swap;

-

-		// decrement

-		pEdge--;

-		pPrev--;

-	}

-

-	

-#ifdef DEBUG_BROADPHASE

-	debugPrintAxis(axis);

-#endif //DEBUG_BROADPHASE

-

-}

-

-// sorting a max edge upwards can only ever *add* overlaps

-template <typename BP_FP_INT_TYPE>

-void btAxisSweep3Internal<BP_FP_INT_TYPE>::sortMaxUp(int axis, BP_FP_INT_TYPE edge, btDispatcher* /* dispatcher */, bool updateOverlaps)

-{

-	Edge* pEdge = m_pEdges[axis] + edge;

-	Edge* pNext = pEdge + 1;

-	Handle* pHandleEdge = getHandle(pEdge->m_handle);

-

-	while (pNext->m_handle && (pEdge->m_pos >= pNext->m_pos))

-	{

-		Handle* pHandleNext = getHandle(pNext->m_handle);

-

-		const int axis1 = (1  << axis) & 3;

-		const int axis2 = (1  << axis1) & 3;

-

-		if (!pNext->IsMax())

-		{

-			// if next edge is a minimum check the bounds and add an overlap if necessary

-			if (updateOverlaps && testOverlap2D(pHandleEdge, pHandleNext,axis1,axis2))

-			{

-				Handle* handle0 = getHandle(pEdge->m_handle);

-				Handle* handle1 = getHandle(pNext->m_handle);

-				m_pairCache->addOverlappingPair(handle0,handle1);

-				if (m_userPairCallback)

-					m_userPairCallback->addOverlappingPair(handle0,handle1);

-			}

-

-			// update edge reference in other handle

-			pHandleNext->m_minEdges[axis]--;

-		}

-		else

-			pHandleNext->m_maxEdges[axis]--;

-

-		pHandleEdge->m_maxEdges[axis]++;

-

-		// swap the edges

-		Edge swap = *pEdge;

-		*pEdge = *pNext;

-		*pNext = swap;

-

-		// increment

-		pEdge++;

-		pNext++;

-	}

-	

-}

-

-

-

-////////////////////////////////////////////////////////////////////

-

-

-/// The btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase.

-/// It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats.

-/// For large worlds and many objects, use bt32BitAxisSweep3 or btDbvtBroadphase instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance.

-class btAxisSweep3 : public btAxisSweep3Internal<unsigned short int>

-{

-public:

-

-	btAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);

-

-};

-

-/// The bt32BitAxisSweep3 allows higher precision quantization and more objects compared to the btAxisSweep3 sweep and prune.

-/// This comes at the cost of more memory per handle, and a bit slower performance.

-/// It uses arrays rather then lists for storage of the 3 axis.

-class bt32BitAxisSweep3 : public btAxisSweep3Internal<unsigned int>

-{

-public:

-

-	bt32BitAxisSweep3(const btVector3& worldAabbMin,const btVector3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0, bool disableRaycastAccelerator = false);

-

-};

-

-#endif

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
+++ /dev/null
@@ -1,83 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef		BROADPHASE_INTERFACE_H

-#define 	BROADPHASE_INTERFACE_H

-

-

-

-struct btDispatcherInfo;

-class btDispatcher;

-#include "btBroadphaseProxy.h"

-

-class btOverlappingPairCache;

-

-

-

-struct	btBroadphaseAabbCallback

-{

-	virtual ~btBroadphaseAabbCallback() {}

-	virtual bool	process(const btBroadphaseProxy* proxy) = 0;

-};

-

-

-struct	btBroadphaseRayCallback : public btBroadphaseAabbCallback

-{

-	///added some cached data to accelerate ray-AABB tests

-	btVector3		m_rayDirectionInverse;

-	unsigned int	m_signs[3];

-	btScalar		m_lambda_max;

-

-	virtual ~btBroadphaseRayCallback() {}

-};

-

-#include "LinearMath/btVector3.h"

-

-///The btBroadphaseInterface class provides an interface to detect aabb-overlapping object pairs.

-///Some implementations for this broadphase interface include btAxisSweep3, bt32BitAxisSweep3 and btDbvtBroadphase.

-///The actual overlapping pair management, storage, adding and removing of pairs is dealt by the btOverlappingPairCache class.

-class btBroadphaseInterface

-{

-public:

-	virtual ~btBroadphaseInterface() {}

-

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy) =0;

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher)=0;

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher)=0;

-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const =0;

-

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0)) = 0;

-

-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback) = 0;

-

-	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher)=0;

-

-	virtual	btOverlappingPairCache*	getOverlappingPairCache()=0;

-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const =0;

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const =0;

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher) { (void) dispatcher; };

-

-	virtual void	printStats() = 0;

-

-};

-

-#endif //BROADPHASE_INTERFACE_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
+++ /dev/null
@@ -1,271 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BROADPHASE_PROXY_H

-#define BROADPHASE_PROXY_H

-

-#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btAlignedAllocator.h"

-

-

-/// btDispatcher uses these types

-/// IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave

-/// to facilitate type checking

-/// CUSTOM_POLYHEDRAL_SHAPE_TYPE,CUSTOM_CONVEX_SHAPE_TYPE and CUSTOM_CONCAVE_SHAPE_TYPE can be used to extend Bullet without modifying source code

-enum BroadphaseNativeTypes

-{

-	// polyhedral convex shapes

-	BOX_SHAPE_PROXYTYPE,

-	TRIANGLE_SHAPE_PROXYTYPE,

-	TETRAHEDRAL_SHAPE_PROXYTYPE,

-	CONVEX_TRIANGLEMESH_SHAPE_PROXYTYPE,

-	CONVEX_HULL_SHAPE_PROXYTYPE,

-	CONVEX_POINT_CLOUD_SHAPE_PROXYTYPE,

-	CUSTOM_POLYHEDRAL_SHAPE_TYPE,

-//implicit convex shapes

-IMPLICIT_CONVEX_SHAPES_START_HERE,

-	SPHERE_SHAPE_PROXYTYPE,

-	MULTI_SPHERE_SHAPE_PROXYTYPE,

-	CAPSULE_SHAPE_PROXYTYPE,

-	CONE_SHAPE_PROXYTYPE,

-	CONVEX_SHAPE_PROXYTYPE,

-	CYLINDER_SHAPE_PROXYTYPE,

-	UNIFORM_SCALING_SHAPE_PROXYTYPE,

-	MINKOWSKI_SUM_SHAPE_PROXYTYPE,

-	MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,

-	BOX_2D_SHAPE_PROXYTYPE,

-	CONVEX_2D_SHAPE_PROXYTYPE,

-	CUSTOM_CONVEX_SHAPE_TYPE,

-//concave shapes

-CONCAVE_SHAPES_START_HERE,

-	//keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!

-	TRIANGLE_MESH_SHAPE_PROXYTYPE,

-	SCALED_TRIANGLE_MESH_SHAPE_PROXYTYPE,

-	///used for demo integration FAST/Swift collision library and Bullet

-	FAST_CONCAVE_MESH_PROXYTYPE,

-	//terrain

-	TERRAIN_SHAPE_PROXYTYPE,

-///Used for GIMPACT Trimesh integration

-	GIMPACT_SHAPE_PROXYTYPE,

-///Multimaterial mesh

-    MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE,

-	

-	EMPTY_SHAPE_PROXYTYPE,

-	STATIC_PLANE_PROXYTYPE,

-	CUSTOM_CONCAVE_SHAPE_TYPE,

-CONCAVE_SHAPES_END_HERE,

-

-	COMPOUND_SHAPE_PROXYTYPE,

-

-	SOFTBODY_SHAPE_PROXYTYPE,

-	HFFLUID_SHAPE_PROXYTYPE,

-	HFFLUID_BUOYANT_CONVEX_SHAPE_PROXYTYPE,

-	INVALID_SHAPE_PROXYTYPE,

-

-	MAX_BROADPHASE_COLLISION_TYPES

-	

-};

-

-

-///The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 

-///It stores collision shape type information, collision filter information and a client object, typically a btCollisionObject or btRigidBody.

-ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy

-{

-

-BT_DECLARE_ALIGNED_ALLOCATOR();

-	

-	///optional filtering to cull potential collisions

-	enum CollisionFilterGroups

-	{

-	        DefaultFilter = 1,

-	        StaticFilter = 2,

-	        KinematicFilter = 4,

-	        DebrisFilter = 8,

-			SensorTrigger = 16,

-			CharacterFilter = 32,

-	        AllFilter = -1 //all bits sets: DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger

-	};

-

-	//Usually the client btCollisionObject or Rigidbody class

-	void*	m_clientObject;

-	short int m_collisionFilterGroup;

-	short int m_collisionFilterMask;

-	void*	m_multiSapParentProxy;		

-	int			m_uniqueId;//m_uniqueId is introduced for paircache. could get rid of this, by calculating the address offset etc.

-

-	btVector3	m_aabbMin;

-	btVector3	m_aabbMax;

-

-	SIMD_FORCE_INLINE int getUid() const

-	{

-		return m_uniqueId;

-	}

-

-	//used for memory pools

-	btBroadphaseProxy() :m_clientObject(0),m_multiSapParentProxy(0)

-	{

-	}

-

-	btBroadphaseProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)

-		:m_clientObject(userPtr),

-		m_collisionFilterGroup(collisionFilterGroup),

-		m_collisionFilterMask(collisionFilterMask),

-		m_aabbMin(aabbMin),

-		m_aabbMax(aabbMax)

-	{

-		m_multiSapParentProxy = multiSapParentProxy;

-	}

-

-	

-

-	static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType)

-	{

-		return (proxyType  < IMPLICIT_CONVEX_SHAPES_START_HERE);

-	}

-

-	static SIMD_FORCE_INLINE bool	isConvex(int proxyType)

-	{

-		return (proxyType < CONCAVE_SHAPES_START_HERE);

-	}

-

-	static SIMD_FORCE_INLINE bool	isNonMoving(int proxyType)

-	{

-		return (isConcave(proxyType) && !(proxyType==GIMPACT_SHAPE_PROXYTYPE));

-	}

-

-	static SIMD_FORCE_INLINE bool	isConcave(int proxyType)

-	{

-		return ((proxyType > CONCAVE_SHAPES_START_HERE) &&

-			(proxyType < CONCAVE_SHAPES_END_HERE));

-	}

-	static SIMD_FORCE_INLINE bool	isCompound(int proxyType)

-	{

-		return (proxyType == COMPOUND_SHAPE_PROXYTYPE);

-	}

-

-	static SIMD_FORCE_INLINE bool	isSoftBody(int proxyType)

-	{

-		return (proxyType == SOFTBODY_SHAPE_PROXYTYPE);

-	}

-

-	static SIMD_FORCE_INLINE bool isInfinite(int proxyType)

-	{

-		return (proxyType == STATIC_PLANE_PROXYTYPE);

-	}

-

-	static SIMD_FORCE_INLINE bool isConvex2d(int proxyType)

-	{

-		return (proxyType == BOX_2D_SHAPE_PROXYTYPE) ||	(proxyType == CONVEX_2D_SHAPE_PROXYTYPE);

-	}

-

-	

-}

-;

-

-class btCollisionAlgorithm;

-

-struct btBroadphaseProxy;

-

-

-

-///The btBroadphasePair class contains a pair of aabb-overlapping objects.

-///A btDispatcher can search a btCollisionAlgorithm that performs exact/narrowphase collision detection on the actual collision shapes.

-ATTRIBUTE_ALIGNED16(struct) btBroadphasePair

-{

-	btBroadphasePair ()

-		:

-	m_pProxy0(0),

-		m_pProxy1(0),

-		m_algorithm(0),

-		m_internalInfo1(0)

-	{

-	}

-

-BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	btBroadphasePair(const btBroadphasePair& other)

-		:		m_pProxy0(other.m_pProxy0),

-				m_pProxy1(other.m_pProxy1),

-				m_algorithm(other.m_algorithm),

-				m_internalInfo1(other.m_internalInfo1)

-	{

-	}

-	btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1)

-	{

-

-		//keep them sorted, so the std::set operations work

-		if (proxy0.m_uniqueId < proxy1.m_uniqueId)

-        { 

-            m_pProxy0 = &proxy0; 

-            m_pProxy1 = &proxy1; 

-        }

-        else 

-        { 

-			m_pProxy0 = &proxy1; 

-            m_pProxy1 = &proxy0; 

-        }

-

-		m_algorithm = 0;

-		m_internalInfo1 = 0;

-

-	}

-	

-	btBroadphaseProxy* m_pProxy0;

-	btBroadphaseProxy* m_pProxy1;

-	

-	mutable btCollisionAlgorithm* m_algorithm;

-	union { void* m_internalInfo1; int m_internalTmpValue;};//don't use this data, it will be removed in future version.

-

-};

-

-/*

-//comparison for set operation, see Solid DT_Encounter

-SIMD_FORCE_INLINE bool operator<(const btBroadphasePair& a, const btBroadphasePair& b) 

-{ 

-    return a.m_pProxy0 < b.m_pProxy0 || 

-        (a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 < b.m_pProxy1); 

-}

-*/

-

-

-

-class btBroadphasePairSortPredicate

-{

-	public:

-

-		bool operator() ( const btBroadphasePair& a, const btBroadphasePair& b )

-		{

-			const int uidA0 = a.m_pProxy0 ? a.m_pProxy0->m_uniqueId : -1;

-			const int uidB0 = b.m_pProxy0 ? b.m_pProxy0->m_uniqueId : -1;

-			const int uidA1 = a.m_pProxy1 ? a.m_pProxy1->m_uniqueId : -1;

-			const int uidB1 = b.m_pProxy1 ? b.m_pProxy1->m_uniqueId : -1;

-

-			 return uidA0 > uidB0 || 

-				(a.m_pProxy0 == b.m_pProxy0 && uidA1 > uidB1) ||

-				(a.m_pProxy0 == b.m_pProxy0 && a.m_pProxy1 == b.m_pProxy1 && a.m_algorithm > b.m_algorithm); 

-		}

-};

-

-

-SIMD_FORCE_INLINE bool operator==(const btBroadphasePair& a, const btBroadphasePair& b) 

-{

-	 return (a.m_pProxy0 == b.m_pProxy0) && (a.m_pProxy1 == b.m_pProxy1);

-}

-

-

-#endif //BROADPHASE_PROXY_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
+++ /dev/null
@@ -1,81 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef COLLISION_ALGORITHM_H

-#define COLLISION_ALGORITHM_H

-

-#include "LinearMath/btScalar.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-struct btBroadphaseProxy;

-class btDispatcher;

-class btManifoldResult;

-class btCollisionObject;

-struct btDispatcherInfo;

-class	btPersistentManifold;

-

-typedef btAlignedObjectArray<btPersistentManifold*>	btManifoldArray;

-

-struct btCollisionAlgorithmConstructionInfo

-{

-	btCollisionAlgorithmConstructionInfo()

-		:m_dispatcher1(0),

-		m_manifold(0)

-	{

-	}

-	btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)

-		:m_dispatcher1(dispatcher)

-	{

-		(void)temp;

-	}

-

-	btDispatcher*	m_dispatcher1;

-	btPersistentManifold*	m_manifold;

-

-	int	getDispatcherId();

-

-};

-

-

-///btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatcher.

-///It is persistent over frames

-class btCollisionAlgorithm

-{

-

-protected:

-

-	btDispatcher*	m_dispatcher;

-

-protected:

-	int	getDispatcherId();

-	

-public:

-

-	btCollisionAlgorithm() {};

-

-	btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);

-

-	virtual ~btCollisionAlgorithm() {};

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray) = 0;

-};

-

-

-#endif //COLLISION_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btDbvt.h
+++ /dev/null
@@ -1,1257 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2007 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-///btDbvt implementation by Nathanael Presson

-

-#ifndef BT_DYNAMIC_BOUNDING_VOLUME_TREE_H

-#define BT_DYNAMIC_BOUNDING_VOLUME_TREE_H

-

-#include "LinearMath/btAlignedObjectArray.h"

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btTransform.h"

-#include "LinearMath/btAabbUtil2.h"

-

-//

-// Compile time configuration

-//

-

-

-// Implementation profiles

-#define DBVT_IMPL_GENERIC		0	// Generic implementation	

-#define DBVT_IMPL_SSE			1	// SSE

-

-// Template implementation of ICollide

-#ifdef _WIN32

-#if (defined (_MSC_VER) && _MSC_VER >= 1400)

-#define	DBVT_USE_TEMPLATE		1

-#else

-#define	DBVT_USE_TEMPLATE		0

-#endif

-#else

-#define	DBVT_USE_TEMPLATE		0

-#endif

-

-// Use only intrinsics instead of inline asm

-#define DBVT_USE_INTRINSIC_SSE	1

-

-// Using memmov for collideOCL

-#define DBVT_USE_MEMMOVE		1

-

-// Enable benchmarking code

-#define	DBVT_ENABLE_BENCHMARK	0

-

-// Inlining

-#define DBVT_INLINE				SIMD_FORCE_INLINE

-

-// Specific methods implementation

-

-//SSE gives errors on a MSVC 7.1

-#if defined (BT_USE_SSE) && defined (_WIN32)

-#define DBVT_SELECT_IMPL		DBVT_IMPL_SSE

-#define DBVT_MERGE_IMPL			DBVT_IMPL_SSE

-#define DBVT_INT0_IMPL			DBVT_IMPL_SSE

-#else

-#define DBVT_SELECT_IMPL		DBVT_IMPL_GENERIC

-#define DBVT_MERGE_IMPL			DBVT_IMPL_GENERIC

-#define DBVT_INT0_IMPL			DBVT_IMPL_GENERIC

-#endif

-

-#if	(DBVT_SELECT_IMPL==DBVT_IMPL_SSE)||	\

-	(DBVT_MERGE_IMPL==DBVT_IMPL_SSE)||	\

-	(DBVT_INT0_IMPL==DBVT_IMPL_SSE)

-#include <emmintrin.h>

-#endif

-

-//

-// Auto config and checks

-//

-

-#if DBVT_USE_TEMPLATE

-#define	DBVT_VIRTUAL

-#define DBVT_VIRTUAL_DTOR(a)

-#define DBVT_PREFIX					template <typename T>

-#define DBVT_IPOLICY				T& policy

-#define DBVT_CHECKTYPE				static const ICollide&	typechecker=*(T*)1;(void)typechecker;

-#else

-#define	DBVT_VIRTUAL_DTOR(a)		virtual ~a() {}

-#define DBVT_VIRTUAL				virtual

-#define DBVT_PREFIX

-#define DBVT_IPOLICY				ICollide& policy

-#define DBVT_CHECKTYPE

-#endif

-

-#if DBVT_USE_MEMMOVE

-#if !defined( __CELLOS_LV2__) && !defined(__MWERKS__)

-#include <memory.h>

-#endif

-#include <string.h>

-#endif

-

-#ifndef DBVT_USE_TEMPLATE

-#error "DBVT_USE_TEMPLATE undefined"

-#endif

-

-#ifndef DBVT_USE_MEMMOVE

-#error "DBVT_USE_MEMMOVE undefined"

-#endif

-

-#ifndef DBVT_ENABLE_BENCHMARK

-#error "DBVT_ENABLE_BENCHMARK undefined"

-#endif

-

-#ifndef DBVT_SELECT_IMPL

-#error "DBVT_SELECT_IMPL undefined"

-#endif

-

-#ifndef DBVT_MERGE_IMPL

-#error "DBVT_MERGE_IMPL undefined"

-#endif

-

-#ifndef DBVT_INT0_IMPL

-#error "DBVT_INT0_IMPL undefined"

-#endif

-

-//

-// Defaults volumes

-//

-

-/* btDbvtAabbMm			*/ 

-struct	btDbvtAabbMm

-{

-	DBVT_INLINE btVector3			Center() const	{ return((mi+mx)/2); }

-	DBVT_INLINE btVector3			Lengths() const	{ return(mx-mi); }

-	DBVT_INLINE btVector3			Extents() const	{ return((mx-mi)/2); }

-	DBVT_INLINE const btVector3&	Mins() const	{ return(mi); }

-	DBVT_INLINE const btVector3&	Maxs() const	{ return(mx); }

-	static inline btDbvtAabbMm		FromCE(const btVector3& c,const btVector3& e);

-	static inline btDbvtAabbMm		FromCR(const btVector3& c,btScalar r);

-	static inline btDbvtAabbMm		FromMM(const btVector3& mi,const btVector3& mx);

-	static inline btDbvtAabbMm		FromPoints(const btVector3* pts,int n);

-	static inline btDbvtAabbMm		FromPoints(const btVector3** ppts,int n);

-	DBVT_INLINE void				Expand(const btVector3& e);

-	DBVT_INLINE void				SignedExpand(const btVector3& e);

-	DBVT_INLINE bool				Contain(const btDbvtAabbMm& a) const;

-	DBVT_INLINE int					Classify(const btVector3& n,btScalar o,int s) const;

-	DBVT_INLINE btScalar			ProjectMinimum(const btVector3& v,unsigned signs) const;

-	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-	

-	DBVT_INLINE friend bool			Intersect(	const btDbvtAabbMm& a,

-		const btVector3& b);

-

-	DBVT_INLINE friend btScalar		Proximity(	const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-	DBVT_INLINE friend int			Select(		const btDbvtAabbMm& o,

-		const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-	DBVT_INLINE friend void			Merge(		const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b,

-		btDbvtAabbMm& r);

-	DBVT_INLINE friend bool			NotEqual(	const btDbvtAabbMm& a,

-		const btDbvtAabbMm& b);

-private:

-	DBVT_INLINE void				AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const;

-private:

-	btVector3	mi,mx;

-};

-

-// Types	

-typedef	btDbvtAabbMm	btDbvtVolume;

-

-/* btDbvtNode				*/ 

-struct	btDbvtNode

-{

-	btDbvtVolume	volume;

-	btDbvtNode*		parent;

-	DBVT_INLINE bool	isleaf() const		{ return(childs[1]==0); }

-	DBVT_INLINE bool	isinternal() const	{ return(!isleaf()); }

-	union

-	{

-		btDbvtNode*	childs[2];

-		void*	data;

-		int		dataAsInt;

-	};

-};

-

-///The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree).

-///This btDbvt is used for soft body collision detection and for the btDbvtBroadphase. It has a fast insert, remove and update of nodes.

-///Unlike the btQuantizedBvh, nodes can be dynamically moved around, which allows for change in topology of the underlying data structure.

-struct	btDbvt

-{

-	/* Stack element	*/ 

-	struct	sStkNN

-	{

-		const btDbvtNode*	a;

-		const btDbvtNode*	b;

-		sStkNN() {}

-		sStkNN(const btDbvtNode* na,const btDbvtNode* nb) : a(na),b(nb) {}

-	};

-	struct	sStkNP

-	{

-		const btDbvtNode*	node;

-		int			mask;

-		sStkNP(const btDbvtNode* n,unsigned m) : node(n),mask(m) {}

-	};

-	struct	sStkNPS

-	{

-		const btDbvtNode*	node;

-		int			mask;

-		btScalar	value;

-		sStkNPS() {}

-		sStkNPS(const btDbvtNode* n,unsigned m,btScalar v) : node(n),mask(m),value(v) {}

-	};

-	struct	sStkCLN

-	{

-		const btDbvtNode*	node;

-		btDbvtNode*		parent;

-		sStkCLN(const btDbvtNode* n,btDbvtNode* p) : node(n),parent(p) {}

-	};

-	// Policies/Interfaces

-

-	/* ICollide	*/ 

-	struct	ICollide

-	{		

-		DBVT_VIRTUAL_DTOR(ICollide)

-			DBVT_VIRTUAL void	Process(const btDbvtNode*,const btDbvtNode*)		{}

-		DBVT_VIRTUAL void	Process(const btDbvtNode*)					{}

-		DBVT_VIRTUAL void	Process(const btDbvtNode* n,btScalar)			{ Process(n); }

-		DBVT_VIRTUAL bool	Descent(const btDbvtNode*)					{ return(true); }

-		DBVT_VIRTUAL bool	AllLeaves(const btDbvtNode*)					{ return(true); }

-	};

-	/* IWriter	*/ 

-	struct	IWriter

-	{

-		virtual ~IWriter() {}

-		virtual void		Prepare(const btDbvtNode* root,int numnodes)=0;

-		virtual void		WriteNode(const btDbvtNode*,int index,int parent,int child0,int child1)=0;

-		virtual void		WriteLeaf(const btDbvtNode*,int index,int parent)=0;

-	};

-	/* IClone	*/ 

-	struct	IClone

-	{

-		virtual ~IClone()	{}

-		virtual void		CloneLeaf(btDbvtNode*) {}

-	};

-

-	// Constants

-	enum	{

-		SIMPLE_STACKSIZE	=	64,

-		DOUBLE_STACKSIZE	=	SIMPLE_STACKSIZE*2

-	};

-

-	// Fields

-	btDbvtNode*		m_root;

-	btDbvtNode*		m_free;

-	int				m_lkhd;

-	int				m_leaves;

-	unsigned		m_opath;

-

-	

-	btAlignedObjectArray<sStkNN>	m_stkStack;

-

-

-	// Methods

-	btDbvt();

-	~btDbvt();

-	void			clear();

-	bool			empty() const { return(0==m_root); }

-	void			optimizeBottomUp();

-	void			optimizeTopDown(int bu_treshold=128);

-	void			optimizeIncremental(int passes);

-	btDbvtNode*		insert(const btDbvtVolume& box,void* data);

-	void			update(btDbvtNode* leaf,int lookahead=-1);

-	void			update(btDbvtNode* leaf,btDbvtVolume& volume);

-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity,btScalar margin);

-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,const btVector3& velocity);

-	bool			update(btDbvtNode* leaf,btDbvtVolume& volume,btScalar margin);	

-	void			remove(btDbvtNode* leaf);

-	void			write(IWriter* iwriter) const;

-	void			clone(btDbvt& dest,IClone* iclone=0) const;

-	static int		maxdepth(const btDbvtNode* node);

-	static int		countLeaves(const btDbvtNode* node);

-	static void		extractLeaves(const btDbvtNode* node,btAlignedObjectArray<const btDbvtNode*>& leaves);

-#if DBVT_ENABLE_BENCHMARK

-	static void		benchmark();

-#else

-	static void		benchmark(){}

-#endif

-	// DBVT_IPOLICY must support ICollide policy/interface

-	DBVT_PREFIX

-		static void		enumNodes(	const btDbvtNode* root,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		static void		enumLeaves(	const btDbvtNode* root,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		void		collideTT(	const btDbvtNode* root0,

-		const btDbvtNode* root1,

-		DBVT_IPOLICY);

-

-	DBVT_PREFIX

-		void		collideTTpersistentStack(	const btDbvtNode* root0,

-		  const btDbvtNode* root1,

-		  DBVT_IPOLICY);

-#if 0

-	DBVT_PREFIX

-		void		collideTT(	const btDbvtNode* root0,

-		const btDbvtNode* root1,

-		const btTransform& xform,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		void		collideTT(	const btDbvtNode* root0,

-		const btTransform& xform0,

-		const btDbvtNode* root1,

-		const btTransform& xform1,

-		DBVT_IPOLICY);

-#endif

-

-	DBVT_PREFIX

-		void		collideTV(	const btDbvtNode* root,

-		const btDbvtVolume& volume,

-		DBVT_IPOLICY);

-	///rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thread-safe (uses locking etc)

-	///rayTest is slower than rayTestInternal, because it builds a local stack, using memory allocations, and it recomputes signs/rayDirectionInverses each time

-	DBVT_PREFIX

-		static void		rayTest(	const btDbvtNode* root,

-		const btVector3& rayFrom,

-		const btVector3& rayTo,

-		DBVT_IPOLICY);

-	///rayTestInternal is faster than rayTest, because it uses a persistent stack (to reduce dynamic memory allocations to a minimum) and it uses precomputed signs/rayInverseDirections

-	///rayTestInternal is used by btDbvtBroadphase to accelerate world ray casts

-	DBVT_PREFIX

-		void		rayTestInternal(	const btDbvtNode* root,

-								const btVector3& rayFrom,

-								const btVector3& rayTo,

-								const btVector3& rayDirectionInverse,

-								unsigned int signs[3],

-								btScalar lambda_max,

-								const btVector3& aabbMin,

-								const btVector3& aabbMax,

-								DBVT_IPOLICY) const;

-

-	DBVT_PREFIX

-		static void		collideKDOP(const btDbvtNode* root,

-		const btVector3* normals,

-		const btScalar* offsets,

-		int count,

-		DBVT_IPOLICY);

-	DBVT_PREFIX

-		static void		collideOCL(	const btDbvtNode* root,

-		const btVector3* normals,

-		const btScalar* offsets,

-		const btVector3& sortaxis,

-		int count,								

-		DBVT_IPOLICY,

-		bool fullsort=true);

-	DBVT_PREFIX

-		static void		collideTU(	const btDbvtNode* root,

-		DBVT_IPOLICY);

-	// Helpers	

-	static DBVT_INLINE int	nearest(const int* i,const btDbvt::sStkNPS* a,btScalar v,int l,int h)

-	{

-		int	m=0;

-		while(l<h)

-		{

-			m=(l+h)>>1;

-			if(a[i[m]].value>=v) l=m+1; else h=m;

-		}

-		return(h);

-	}

-	static DBVT_INLINE int	allocate(	btAlignedObjectArray<int>& ifree,

-		btAlignedObjectArray<sStkNPS>& stock,

-		const sStkNPS& value)

-	{

-		int	i;

-		if(ifree.size()>0)

-		{ i=ifree[ifree.size()-1];ifree.pop_back();stock[i]=value; }

-		else

-		{ i=stock.size();stock.push_back(value); }

-		return(i); 

-	}

-	//

-private:

-	btDbvt(const btDbvt&)	{}	

-};

-

-//

-// Inline's

-//

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromCE(const btVector3& c,const btVector3& e)

-{

-	btDbvtAabbMm box;

-	box.mi=c-e;box.mx=c+e;

-	return(box);

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromCR(const btVector3& c,btScalar r)

-{

-	return(FromCE(c,btVector3(r,r,r)));

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromMM(const btVector3& mi,const btVector3& mx)

-{

-	btDbvtAabbMm box;

-	box.mi=mi;box.mx=mx;

-	return(box);

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3* pts,int n)

-{

-	btDbvtAabbMm box;

-	box.mi=box.mx=pts[0];

-	for(int i=1;i<n;++i)

-	{

-		box.mi.setMin(pts[i]);

-		box.mx.setMax(pts[i]);

-	}

-	return(box);

-}

-

-//

-inline btDbvtAabbMm			btDbvtAabbMm::FromPoints(const btVector3** ppts,int n)

-{

-	btDbvtAabbMm box;

-	box.mi=box.mx=*ppts[0];

-	for(int i=1;i<n;++i)

-	{

-		box.mi.setMin(*ppts[i]);

-		box.mx.setMax(*ppts[i]);

-	}

-	return(box);

-}

-

-//

-DBVT_INLINE void		btDbvtAabbMm::Expand(const btVector3& e)

-{

-	mi-=e;mx+=e;

-}

-

-//

-DBVT_INLINE void		btDbvtAabbMm::SignedExpand(const btVector3& e)

-{

-	if(e.x()>0) mx.setX(mx.x()+e[0]); else mi.setX(mi.x()+e[0]);

-	if(e.y()>0) mx.setY(mx.y()+e[1]); else mi.setY(mi.y()+e[1]);

-	if(e.z()>0) mx.setZ(mx.z()+e[2]); else mi.setZ(mi.z()+e[2]);

-}

-

-//

-DBVT_INLINE bool		btDbvtAabbMm::Contain(const btDbvtAabbMm& a) const

-{

-	return(	(mi.x()<=a.mi.x())&&

-		(mi.y()<=a.mi.y())&&

-		(mi.z()<=a.mi.z())&&

-		(mx.x()>=a.mx.x())&&

-		(mx.y()>=a.mx.y())&&

-		(mx.z()>=a.mx.z()));

-}

-

-//

-DBVT_INLINE int		btDbvtAabbMm::Classify(const btVector3& n,btScalar o,int s) const

-{

-	btVector3			pi,px;

-	switch(s)

-	{

-	case	(0+0+0):	px=btVector3(mi.x(),mi.y(),mi.z());

-		pi=btVector3(mx.x(),mx.y(),mx.z());break;

-	case	(1+0+0):	px=btVector3(mx.x(),mi.y(),mi.z());

-		pi=btVector3(mi.x(),mx.y(),mx.z());break;

-	case	(0+2+0):	px=btVector3(mi.x(),mx.y(),mi.z());

-		pi=btVector3(mx.x(),mi.y(),mx.z());break;

-	case	(1+2+0):	px=btVector3(mx.x(),mx.y(),mi.z());

-		pi=btVector3(mi.x(),mi.y(),mx.z());break;

-	case	(0+0+4):	px=btVector3(mi.x(),mi.y(),mx.z());

-		pi=btVector3(mx.x(),mx.y(),mi.z());break;

-	case	(1+0+4):	px=btVector3(mx.x(),mi.y(),mx.z());

-		pi=btVector3(mi.x(),mx.y(),mi.z());break;

-	case	(0+2+4):	px=btVector3(mi.x(),mx.y(),mx.z());

-		pi=btVector3(mx.x(),mi.y(),mi.z());break;

-	case	(1+2+4):	px=btVector3(mx.x(),mx.y(),mx.z());

-		pi=btVector3(mi.x(),mi.y(),mi.z());break;

-	}

-	if((btDot(n,px)+o)<0)		return(-1);

-	if((btDot(n,pi)+o)>=0)	return(+1);

-	return(0);

-}

-

-//

-DBVT_INLINE btScalar	btDbvtAabbMm::ProjectMinimum(const btVector3& v,unsigned signs) const

-{

-	const btVector3*	b[]={&mx,&mi};

-	const btVector3		p(	b[(signs>>0)&1]->x(),

-		b[(signs>>1)&1]->y(),

-		b[(signs>>2)&1]->z());

-	return(btDot(p,v));

-}

-

-//

-DBVT_INLINE void		btDbvtAabbMm::AddSpan(const btVector3& d,btScalar& smi,btScalar& smx) const

-{

-	for(int i=0;i<3;++i)

-	{

-		if(d[i]<0)

-		{ smi+=mx[i]*d[i];smx+=mi[i]*d[i]; }

-		else

-		{ smi+=mi[i]*d[i];smx+=mx[i]*d[i]; }

-	}

-}

-

-//

-DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,

-								  const btDbvtAabbMm& b)

-{

-#if	DBVT_INT0_IMPL == DBVT_IMPL_SSE

-	const __m128	rt(_mm_or_ps(	_mm_cmplt_ps(_mm_load_ps(b.mx),_mm_load_ps(a.mi)),

-		_mm_cmplt_ps(_mm_load_ps(a.mx),_mm_load_ps(b.mi))));

-	const __int32*	pu((const __int32*)&rt);

-	return((pu[0]|pu[1]|pu[2])==0);

-#else

-	return(	(a.mi.x()<=b.mx.x())&&

-		(a.mx.x()>=b.mi.x())&&

-		(a.mi.y()<=b.mx.y())&&

-		(a.mx.y()>=b.mi.y())&&

-		(a.mi.z()<=b.mx.z())&&		

-		(a.mx.z()>=b.mi.z()));

-#endif

-}

-

-

-

-//

-DBVT_INLINE bool		Intersect(	const btDbvtAabbMm& a,

-								  const btVector3& b)

-{

-	return(	(b.x()>=a.mi.x())&&

-		(b.y()>=a.mi.y())&&

-		(b.z()>=a.mi.z())&&

-		(b.x()<=a.mx.x())&&

-		(b.y()<=a.mx.y())&&

-		(b.z()<=a.mx.z()));

-}

-

-

-

-

-

-//////////////////////////////////////

-

-

-//

-DBVT_INLINE btScalar	Proximity(	const btDbvtAabbMm& a,

-								  const btDbvtAabbMm& b)

-{

-	const btVector3	d=(a.mi+a.mx)-(b.mi+b.mx);

-	return(btFabs(d.x())+btFabs(d.y())+btFabs(d.z()));

-}

-

-

-

-//

-DBVT_INLINE int			Select(	const btDbvtAabbMm& o,

-							   const btDbvtAabbMm& a,

-							   const btDbvtAabbMm& b)

-{

-#if	DBVT_SELECT_IMPL == DBVT_IMPL_SSE

-	static ATTRIBUTE_ALIGNED16(const unsigned __int32)	mask[]={0x7fffffff,0x7fffffff,0x7fffffff,0x7fffffff};

-	///@todo: the intrinsic version is 11% slower

-#if DBVT_USE_INTRINSIC_SSE

-

-	union btSSEUnion ///NOTE: if we use more intrinsics, move btSSEUnion into the LinearMath directory

-	{

-	   __m128		ssereg;

-	   float		floats[4];

-	   int			ints[4];

-	};

-

-	__m128	omi(_mm_load_ps(o.mi));

-	omi=_mm_add_ps(omi,_mm_load_ps(o.mx));

-	__m128	ami(_mm_load_ps(a.mi));

-	ami=_mm_add_ps(ami,_mm_load_ps(a.mx));

-	ami=_mm_sub_ps(ami,omi);

-	ami=_mm_and_ps(ami,_mm_load_ps((const float*)mask));

-	__m128	bmi(_mm_load_ps(b.mi));

-	bmi=_mm_add_ps(bmi,_mm_load_ps(b.mx));

-	bmi=_mm_sub_ps(bmi,omi);

-	bmi=_mm_and_ps(bmi,_mm_load_ps((const float*)mask));

-	__m128	t0(_mm_movehl_ps(ami,ami));

-	ami=_mm_add_ps(ami,t0);

-	ami=_mm_add_ss(ami,_mm_shuffle_ps(ami,ami,1));

-	__m128 t1(_mm_movehl_ps(bmi,bmi));

-	bmi=_mm_add_ps(bmi,t1);

-	bmi=_mm_add_ss(bmi,_mm_shuffle_ps(bmi,bmi,1));

-	

-	btSSEUnion tmp;

-	tmp.ssereg = _mm_cmple_ss(bmi,ami);

-	return tmp.ints[0]&1;

-

-#else

-	ATTRIBUTE_ALIGNED16(__int32	r[1]);

-	__asm

-	{

-		mov		eax,o

-			mov		ecx,a

-			mov		edx,b

-			movaps	xmm0,[eax]

-		movaps	xmm5,mask

-			addps	xmm0,[eax+16]	

-		movaps	xmm1,[ecx]

-		movaps	xmm2,[edx]

-		addps	xmm1,[ecx+16]

-		addps	xmm2,[edx+16]

-		subps	xmm1,xmm0

-			subps	xmm2,xmm0

-			andps	xmm1,xmm5

-			andps	xmm2,xmm5

-			movhlps	xmm3,xmm1

-			movhlps	xmm4,xmm2

-			addps	xmm1,xmm3

-			addps	xmm2,xmm4

-			pshufd	xmm3,xmm1,1

-			pshufd	xmm4,xmm2,1

-			addss	xmm1,xmm3

-			addss	xmm2,xmm4

-			cmpless	xmm2,xmm1

-			movss	r,xmm2

-	}

-	return(r[0]&1);

-#endif

-#else

-	return(Proximity(o,a)<Proximity(o,b)?0:1);

-#endif

-}

-

-//

-DBVT_INLINE void		Merge(	const btDbvtAabbMm& a,

-							  const btDbvtAabbMm& b,

-							  btDbvtAabbMm& r)

-{

-#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE

-	__m128	ami(_mm_load_ps(a.mi));

-	__m128	amx(_mm_load_ps(a.mx));

-	__m128	bmi(_mm_load_ps(b.mi));

-	__m128	bmx(_mm_load_ps(b.mx));

-	ami=_mm_min_ps(ami,bmi);

-	amx=_mm_max_ps(amx,bmx);

-	_mm_store_ps(r.mi,ami);

-	_mm_store_ps(r.mx,amx);

-#else

-	for(int i=0;i<3;++i)

-	{

-		if(a.mi[i]<b.mi[i]) r.mi[i]=a.mi[i]; else r.mi[i]=b.mi[i];

-		if(a.mx[i]>b.mx[i]) r.mx[i]=a.mx[i]; else r.mx[i]=b.mx[i];

-	}

-#endif

-}

-

-//

-DBVT_INLINE bool		NotEqual(	const btDbvtAabbMm& a,

-								 const btDbvtAabbMm& b)

-{

-	return(	(a.mi.x()!=b.mi.x())||

-		(a.mi.y()!=b.mi.y())||

-		(a.mi.z()!=b.mi.z())||

-		(a.mx.x()!=b.mx.x())||

-		(a.mx.y()!=b.mx.y())||

-		(a.mx.z()!=b.mx.z()));

-}

-

-//

-// Inline's

-//

-

-//

-DBVT_PREFIX

-inline void		btDbvt::enumNodes(	const btDbvtNode* root,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		policy.Process(root);

-	if(root->isinternal())

-	{

-		enumNodes(root->childs[0],policy);

-		enumNodes(root->childs[1],policy);

-	}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::enumLeaves(	const btDbvtNode* root,

-								   DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root->isinternal())

-		{

-			enumLeaves(root->childs[0],policy);

-			enumLeaves(root->childs[1],policy);

-		}

-		else

-		{

-			policy.Process(root);

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTT(	const btDbvtNode* root0,

-								  const btDbvtNode* root1,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root0&&root1)

-		{

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-4;

-			btAlignedObjectArray<sStkNN>	stkStack;

-			stkStack.resize(DOUBLE_STACKSIZE);

-			stkStack[0]=sStkNN(root0,root1);

-			do	{		

-				sStkNN	p=stkStack[--depth];

-				if(depth>treshold)

-				{

-					stkStack.resize(stkStack.size()*2);

-					treshold=stkStack.size()-4;

-				}

-				if(p.a==p.b)

-				{

-					if(p.a->isinternal())

-					{

-						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);

-						stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);

-						stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);

-					}

-				}

-				else if(Intersect(p.a->volume,p.b->volume))

-				{

-					if(p.a->isinternal())

-					{

-						if(p.b->isinternal())

-						{

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);

-						}

-						else

-						{

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);

-						}

-					}

-					else

-					{

-						if(p.b->isinternal())

-						{

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);

-						}

-						else

-						{

-							policy.Process(p.a,p.b);

-						}

-					}

-				}

-			} while(depth);

-		}

-}

-

-

-

-DBVT_PREFIX

-inline void		btDbvt::collideTTpersistentStack(	const btDbvtNode* root0,

-								  const btDbvtNode* root1,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root0&&root1)

-		{

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-4;

-			

-			m_stkStack.resize(DOUBLE_STACKSIZE);

-			m_stkStack[0]=sStkNN(root0,root1);

-			do	{		

-				sStkNN	p=m_stkStack[--depth];

-				if(depth>treshold)

-				{

-					m_stkStack.resize(m_stkStack.size()*2);

-					treshold=m_stkStack.size()-4;

-				}

-				if(p.a==p.b)

-				{

-					if(p.a->isinternal())

-					{

-						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[0]);

-						m_stkStack[depth++]=sStkNN(p.a->childs[1],p.a->childs[1]);

-						m_stkStack[depth++]=sStkNN(p.a->childs[0],p.a->childs[1]);

-					}

-				}

-				else if(Intersect(p.a->volume,p.b->volume))

-				{

-					if(p.a->isinternal())

-					{

-						if(p.b->isinternal())

-						{

-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);

-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);

-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);

-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);

-						}

-						else

-						{

-							m_stkStack[depth++]=sStkNN(p.a->childs[0],p.b);

-							m_stkStack[depth++]=sStkNN(p.a->childs[1],p.b);

-						}

-					}

-					else

-					{

-						if(p.b->isinternal())

-						{

-							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);

-							m_stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);

-						}

-						else

-						{

-							policy.Process(p.a,p.b);

-						}

-					}

-				}

-			} while(depth);

-		}

-}

-

-#if 0

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTT(	const btDbvtNode* root0,

-								  const btDbvtNode* root1,

-								  const btTransform& xform,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root0&&root1)

-		{

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-4;

-			btAlignedObjectArray<sStkNN>	stkStack;

-			stkStack.resize(DOUBLE_STACKSIZE);

-			stkStack[0]=sStkNN(root0,root1);

-			do	{

-				sStkNN	p=stkStack[--depth];

-				if(Intersect(p.a->volume,p.b->volume,xform))

-				{

-					if(depth>treshold)

-					{

-						stkStack.resize(stkStack.size()*2);

-						treshold=stkStack.size()-4;

-					}

-					if(p.a->isinternal())

-					{

-						if(p.b->isinternal())

-						{					

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b->childs[1]);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b->childs[1]);

-						}

-						else

-						{

-							stkStack[depth++]=sStkNN(p.a->childs[0],p.b);

-							stkStack[depth++]=sStkNN(p.a->childs[1],p.b);

-						}

-					}

-					else

-					{

-						if(p.b->isinternal())

-						{

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[0]);

-							stkStack[depth++]=sStkNN(p.a,p.b->childs[1]);

-						}

-						else

-						{

-							policy.Process(p.a,p.b);

-						}

-					}

-				}

-			} while(depth);

-		}

-}

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTT(	const btDbvtNode* root0,

-								  const btTransform& xform0,

-								  const btDbvtNode* root1,

-								  const btTransform& xform1,

-								  DBVT_IPOLICY)

-{

-	const btTransform	xform=xform0.inverse()*xform1;

-	collideTT(root0,root1,xform,policy);

-}

-#endif 

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTV(	const btDbvtNode* root,

-								  const btDbvtVolume& vol,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			ATTRIBUTE_ALIGNED16(btDbvtVolume)		volume(vol);

-			btAlignedObjectArray<const btDbvtNode*>	stack;

-			stack.resize(0);

-			stack.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(root);

-			do	{

-				const btDbvtNode*	n=stack[stack.size()-1];

-				stack.pop_back();

-				if(Intersect(n->volume,volume))

-				{

-					if(n->isinternal())

-					{

-						stack.push_back(n->childs[0]);

-						stack.push_back(n->childs[1]);

-					}

-					else

-					{

-						policy.Process(n);

-					}

-				}

-			} while(stack.size()>0);

-		}

-}

-

-DBVT_PREFIX

-inline void		btDbvt::rayTestInternal(	const btDbvtNode* root,

-								const btVector3& rayFrom,

-								const btVector3& rayTo,

-								const btVector3& rayDirectionInverse,

-								unsigned int signs[3],

-								btScalar lambda_max,

-								const btVector3& aabbMin,

-								const btVector3& aabbMax,

-								DBVT_IPOLICY) const

-{

-        (void) rayTo;

-	DBVT_CHECKTYPE

-	if(root)

-	{

-		btVector3 resultNormal;

-

-		int								depth=1;

-		int								treshold=DOUBLE_STACKSIZE-2;

-		btAlignedObjectArray<const btDbvtNode*>	stack;

-		stack.resize(DOUBLE_STACKSIZE);

-		stack[0]=root;

-		btVector3 bounds[2];

-		do	

-		{

-			const btDbvtNode*	node=stack[--depth];

-			bounds[0] = node->volume.Mins()-aabbMax;

-			bounds[1] = node->volume.Maxs()-aabbMin;

-			btScalar tmin=1.f,lambda_min=0.f;

-			unsigned int result1=false;

-			result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);

-			if(result1)

-			{

-				if(node->isinternal())

-				{

-					if(depth>treshold)

-					{

-						stack.resize(stack.size()*2);

-						treshold=stack.size()-2;

-					}

-					stack[depth++]=node->childs[0];

-					stack[depth++]=node->childs[1];

-				}

-				else

-				{

-					policy.Process(node);

-				}

-			}

-		} while(depth);

-	}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::rayTest(	const btDbvtNode* root,

-								const btVector3& rayFrom,

-								const btVector3& rayTo,

-								DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			btVector3 rayDir = (rayTo-rayFrom);

-			rayDir.normalize ();

-

-			///what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT

-			btVector3 rayDirectionInverse;

-			rayDirectionInverse[0] = rayDir[0] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[0];

-			rayDirectionInverse[1] = rayDir[1] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[1];

-			rayDirectionInverse[2] = rayDir[2] == btScalar(0.0) ? btScalar(BT_LARGE_FLOAT) : btScalar(1.0) / rayDir[2];

-			unsigned int signs[3] = { rayDirectionInverse[0] < 0.0, rayDirectionInverse[1] < 0.0, rayDirectionInverse[2] < 0.0};

-

-			btScalar lambda_max = rayDir.dot(rayTo-rayFrom);

-

-			btVector3 resultNormal;

-

-			btAlignedObjectArray<const btDbvtNode*>	stack;

-

-			int								depth=1;

-			int								treshold=DOUBLE_STACKSIZE-2;

-

-			stack.resize(DOUBLE_STACKSIZE);

-			stack[0]=root;

-			btVector3 bounds[2];

-			do	{

-				const btDbvtNode*	node=stack[--depth];

-

-				bounds[0] = node->volume.Mins();

-				bounds[1] = node->volume.Maxs();

-				

-				btScalar tmin=1.f,lambda_min=0.f;

-				unsigned int result1 = btRayAabb2(rayFrom,rayDirectionInverse,signs,bounds,tmin,lambda_min,lambda_max);

-

-#ifdef COMPARE_BTRAY_AABB2

-				btScalar param=1.f;

-				bool result2 = btRayAabb(rayFrom,rayTo,node->volume.Mins(),node->volume.Maxs(),param,resultNormal);

-				btAssert(result1 == result2);

-#endif //TEST_BTRAY_AABB2

-

-				if(result1)

-				{

-					if(node->isinternal())

-					{

-						if(depth>treshold)

-						{

-							stack.resize(stack.size()*2);

-							treshold=stack.size()-2;

-						}

-						stack[depth++]=node->childs[0];

-						stack[depth++]=node->childs[1];

-					}

-					else

-					{

-						policy.Process(node);

-					}

-				}

-			} while(depth);

-

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideKDOP(const btDbvtNode* root,

-									const btVector3* normals,

-									const btScalar* offsets,

-									int count,

-									DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			const int						inside=(1<<count)-1;

-			btAlignedObjectArray<sStkNP>	stack;

-			int								signs[sizeof(unsigned)*8];

-			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));

-			for(int i=0;i<count;++i)

-			{

-				signs[i]=	((normals[i].x()>=0)?1:0)+

-					((normals[i].y()>=0)?2:0)+

-					((normals[i].z()>=0)?4:0);

-			}

-			stack.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(sStkNP(root,0));

-			do	{

-				sStkNP	se=stack[stack.size()-1];

-				bool	out=false;

-				stack.pop_back();

-				for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)

-				{

-					if(0==(se.mask&j))

-					{

-						const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);

-						switch(side)

-						{

-						case	-1:	out=true;break;

-						case	+1:	se.mask|=j;break;

-						}

-					}

-				}

-				if(!out)

-				{

-					if((se.mask!=inside)&&(se.node->isinternal()))

-					{

-						stack.push_back(sStkNP(se.node->childs[0],se.mask));

-						stack.push_back(sStkNP(se.node->childs[1],se.mask));

-					}

-					else

-					{

-						if(policy.AllLeaves(se.node)) enumLeaves(se.node,policy);

-					}

-				}

-			} while(stack.size());

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideOCL(	const btDbvtNode* root,

-								   const btVector3* normals,

-								   const btScalar* offsets,

-								   const btVector3& sortaxis,

-								   int count,

-								   DBVT_IPOLICY,

-								   bool fsort)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			const unsigned					srtsgns=(sortaxis[0]>=0?1:0)+

-				(sortaxis[1]>=0?2:0)+

-				(sortaxis[2]>=0?4:0);

-			const int						inside=(1<<count)-1;

-			btAlignedObjectArray<sStkNPS>	stock;

-			btAlignedObjectArray<int>		ifree;

-			btAlignedObjectArray<int>		stack;

-			int								signs[sizeof(unsigned)*8];

-			btAssert(count<int (sizeof(signs)/sizeof(signs[0])));

-			for(int i=0;i<count;++i)

-			{

-				signs[i]=	((normals[i].x()>=0)?1:0)+

-					((normals[i].y()>=0)?2:0)+

-					((normals[i].z()>=0)?4:0);

-			}

-			stock.reserve(SIMPLE_STACKSIZE);

-			stack.reserve(SIMPLE_STACKSIZE);

-			ifree.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(allocate(ifree,stock,sStkNPS(root,0,root->volume.ProjectMinimum(sortaxis,srtsgns))));

-			do	{

-				const int	id=stack[stack.size()-1];

-				sStkNPS		se=stock[id];

-				stack.pop_back();ifree.push_back(id);

-				if(se.mask!=inside)

-				{

-					bool	out=false;

-					for(int i=0,j=1;(!out)&&(i<count);++i,j<<=1)

-					{

-						if(0==(se.mask&j))

-						{

-							const int	side=se.node->volume.Classify(normals[i],offsets[i],signs[i]);

-							switch(side)

-							{

-							case	-1:	out=true;break;

-							case	+1:	se.mask|=j;break;

-							}

-						}

-					}

-					if(out) continue;

-				}

-				if(policy.Descent(se.node))

-				{

-					if(se.node->isinternal())

-					{

-						const btDbvtNode* pns[]={	se.node->childs[0],se.node->childs[1]};

-						sStkNPS		nes[]={	sStkNPS(pns[0],se.mask,pns[0]->volume.ProjectMinimum(sortaxis,srtsgns)),

-							sStkNPS(pns[1],se.mask,pns[1]->volume.ProjectMinimum(sortaxis,srtsgns))};

-						const int	q=nes[0].value<nes[1].value?1:0;				

-						int			j=stack.size();

-						if(fsort&&(j>0))

-						{

-							/* Insert 0	*/ 

-							j=nearest(&stack[0],&stock[0],nes[q].value,0,stack.size());

-							stack.push_back(0);

-#if DBVT_USE_MEMMOVE

-							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));

-#else

-							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];

-#endif

-							stack[j]=allocate(ifree,stock,nes[q]);

-							/* Insert 1	*/ 

-							j=nearest(&stack[0],&stock[0],nes[1-q].value,j,stack.size());

-							stack.push_back(0);

-#if DBVT_USE_MEMMOVE

-							memmove(&stack[j+1],&stack[j],sizeof(int)*(stack.size()-j-1));

-#else

-							for(int k=stack.size()-1;k>j;--k) stack[k]=stack[k-1];

-#endif

-							stack[j]=allocate(ifree,stock,nes[1-q]);

-						}

-						else

-						{

-							stack.push_back(allocate(ifree,stock,nes[q]));

-							stack.push_back(allocate(ifree,stock,nes[1-q]));

-						}

-					}

-					else

-					{

-						policy.Process(se.node,se.value);

-					}

-				}

-			} while(stack.size());

-		}

-}

-

-//

-DBVT_PREFIX

-inline void		btDbvt::collideTU(	const btDbvtNode* root,

-								  DBVT_IPOLICY)

-{

-	DBVT_CHECKTYPE

-		if(root)

-		{

-			btAlignedObjectArray<const btDbvtNode*>	stack;

-			stack.reserve(SIMPLE_STACKSIZE);

-			stack.push_back(root);

-			do	{

-				const btDbvtNode*	n=stack[stack.size()-1];

-				stack.pop_back();

-				if(policy.Descent(n))

-				{

-					if(n->isinternal())

-					{ stack.push_back(n->childs[0]);stack.push_back(n->childs[1]); }

-					else

-					{ policy.Process(n); }

-				}

-			} while(stack.size()>0);

-		}

-}

-

-//

-// PP Cleanup

-//

-

-#undef DBVT_USE_MEMMOVE

-#undef DBVT_USE_TEMPLATE

-#undef DBVT_VIRTUAL_DTOR

-#undef DBVT_VIRTUAL

-#undef DBVT_PREFIX

-#undef DBVT_IPOLICY

-#undef DBVT_CHECKTYPE

-#undef DBVT_IMPL_GENERIC

-#undef DBVT_IMPL_SSE

-#undef DBVT_USE_INTRINSIC_SSE

-#undef DBVT_SELECT_IMPL

-#undef DBVT_MERGE_IMPL

-#undef DBVT_INT0_IMPL

-

-#endif

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h
+++ /dev/null
@@ -1,147 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2009 Erwin Coumans  http://bulletphysics.org

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-///btDbvtBroadphase implementation by Nathanael Presson

-#ifndef BT_DBVT_BROADPHASE_H

-#define BT_DBVT_BROADPHASE_H

-

-#include "BulletCollision/BroadphaseCollision/btDbvt.h"

-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"

-

-//

-// Compile time config

-//

-

-#define	DBVT_BP_PROFILE					0

-//#define DBVT_BP_SORTPAIRS				1

-#define DBVT_BP_PREVENTFALSEUPDATE		0

-#define DBVT_BP_ACCURATESLEEPING		0

-#define DBVT_BP_ENABLE_BENCHMARK		0

-#define DBVT_BP_MARGIN					(btScalar)0.05

-

-#if DBVT_BP_PROFILE

-#define	DBVT_BP_PROFILING_RATE	256

-#include "LinearMath/btQuickprof.h"

-#endif

-

-//

-// btDbvtProxy

-//

-struct btDbvtProxy : btBroadphaseProxy

-{

-	/* Fields		*/ 

-	//btDbvtAabbMm	aabb;

-	btDbvtNode*		leaf;

-	btDbvtProxy*	links[2];

-	int				stage;

-	/* ctor			*/ 

-	btDbvtProxy(const btVector3& aabbMin,const btVector3& aabbMax,void* userPtr,short int collisionFilterGroup, short int collisionFilterMask) :

-	btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask)

-	{

-		links[0]=links[1]=0;

-	}

-};

-

-typedef btAlignedObjectArray<btDbvtProxy*>	btDbvtProxyArray;

-

-///The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt).

-///One tree is used for static/non-moving objects, and another tree is used for dynamic objects. Objects can move from one tree to the other.

-///This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.

-struct	btDbvtBroadphase : btBroadphaseInterface

-{

-	/* Config		*/ 

-	enum	{

-		DYNAMIC_SET			=	0,	/* Dynamic set index	*/ 

-		FIXED_SET			=	1,	/* Fixed set index		*/ 

-		STAGECOUNT			=	2	/* Number of stages		*/ 

-	};

-	/* Fields		*/ 

-	btDbvt					m_sets[2];					// Dbvt sets

-	btDbvtProxy*			m_stageRoots[STAGECOUNT+1];	// Stages list

-	btOverlappingPairCache*	m_paircache;				// Pair cache

-	btScalar				m_prediction;				// Velocity prediction

-	int						m_stageCurrent;				// Current stage

-	int						m_fupdates;					// % of fixed updates per frame

-	int						m_dupdates;					// % of dynamic updates per frame

-	int						m_cupdates;					// % of cleanup updates per frame

-	int						m_newpairs;					// Number of pairs created

-	int						m_fixedleft;				// Fixed optimization left

-	unsigned				m_updates_call;				// Number of updates call

-	unsigned				m_updates_done;				// Number of updates done

-	btScalar				m_updates_ratio;			// m_updates_done/m_updates_call

-	int						m_pid;						// Parse id

-	int						m_cid;						// Cleanup index

-	int						m_gid;						// Gen id

-	bool					m_releasepaircache;			// Release pair cache on delete

-	bool					m_deferedcollide;			// Defere dynamic/static collision to collide call

-	bool					m_needcleanup;				// Need to run cleanup?

-#if DBVT_BP_PROFILE

-	btClock					m_clock;

-	struct	{

-		unsigned long		m_total;

-		unsigned long		m_ddcollide;

-		unsigned long		m_fdcollide;

-		unsigned long		m_cleanup;

-		unsigned long		m_jobcount;

-	}				m_profiling;

-#endif

-	/* Methods		*/ 

-	btDbvtBroadphase(btOverlappingPairCache* paircache=0);

-	~btDbvtBroadphase();

-	void							collide(btDispatcher* dispatcher);

-	void							optimize();

-	

-	/* btBroadphaseInterface Implementation	*/

-	btBroadphaseProxy*				createProxy(const btVector3& aabbMin,const btVector3& aabbMax,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,btDispatcher* dispatcher,void* multiSapProxy);

-	virtual void					destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void					setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);

-	virtual void					rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0), const btVector3& aabbMax = btVector3(0,0,0));

-	virtual void					aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);

-

-	virtual void					getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-	virtual	void					calculateOverlappingPairs(btDispatcher* dispatcher);

-	virtual	btOverlappingPairCache*	getOverlappingPairCache();

-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const;

-	virtual	void					getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const;

-	virtual	void					printStats();

-

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher);

-

-	void	performDeferredRemoval(btDispatcher* dispatcher);

-	

-	void	setVelocityPrediction(btScalar prediction)

-	{

-		m_prediction = prediction;

-	}

-	btScalar getVelocityPrediction() const

-	{

-		return m_prediction;

-	}

-

-	///this setAabbForceUpdate is similar to setAabb but always forces the aabb update. 

-	///it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase.

-	///it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see

-	///http://code.google.com/p/bullet/issues/detail?id=223

-	void							setAabbForceUpdate(		btBroadphaseProxy* absproxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* /*dispatcher*/);

-

-	static void						benchmark(btBroadphaseInterface*);

-

-

-};

-

-#endif

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btDispatcher.h
+++ /dev/null
@@ -1,109 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef _DISPATCHER_H

-#define _DISPATCHER_H

-

-#include "LinearMath/btScalar.h"

-

-class btCollisionAlgorithm;

-struct btBroadphaseProxy;

-class btRigidBody;

-class	btCollisionObject;

-class btOverlappingPairCache;

-

-

-class btPersistentManifold;

-class btStackAlloc;

-

-struct btDispatcherInfo

-{

-	enum DispatchFunc

-	{

-		DISPATCH_DISCRETE = 1,

-		DISPATCH_CONTINUOUS

-	};

-	btDispatcherInfo()

-		:m_timeStep(btScalar(0.)),

-		m_stepCount(0),

-		m_dispatchFunc(DISPATCH_DISCRETE),

-		m_timeOfImpact(btScalar(1.)),

-		m_useContinuous(false),

-		m_debugDraw(0),

-		m_enableSatConvex(false),

-		m_enableSPU(true),

-		m_useEpa(true),

-		m_allowedCcdPenetration(btScalar(0.04)),

-		m_useConvexConservativeDistanceUtil(false),

-		m_convexConservativeDistanceThreshold(0.0f),

-		m_convexMaxDistanceUseCPT(false),

-		m_stackAllocator(0)

-	{

-

-	}

-	btScalar	m_timeStep;

-	int			m_stepCount;

-	int			m_dispatchFunc;

-	mutable btScalar	m_timeOfImpact;

-	bool		m_useContinuous;

-	class btIDebugDraw*	m_debugDraw;

-	bool		m_enableSatConvex;

-	bool		m_enableSPU;

-	bool		m_useEpa;

-	btScalar	m_allowedCcdPenetration;

-	bool		m_useConvexConservativeDistanceUtil;

-	btScalar	m_convexConservativeDistanceThreshold;

-	bool		m_convexMaxDistanceUseCPT;

-	btStackAlloc*	m_stackAllocator;

-};

-

-///The btDispatcher interface class can be used in combination with broadphase to dispatch calculations for overlapping pairs.

-///For example for pairwise collision detection, calculating contact points stored in btPersistentManifold or user callbacks (game logic).

-class btDispatcher

-{

-

-

-public:

-	virtual ~btDispatcher() ;

-

-	virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0;

-

-	virtual btPersistentManifold*	getNewManifold(void* body0,void* body1)=0;

-

-	virtual void releaseManifold(btPersistentManifold* manifold)=0;

-

-	virtual void clearManifold(btPersistentManifold* manifold)=0;

-

-	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1) = 0;

-

-	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1)=0;

-

-	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)  =0;

-

-	virtual int getNumManifolds() const = 0;

-

-	virtual btPersistentManifold* getManifoldByIndexInternal(int index) = 0;

-

-	virtual	btPersistentManifold**	getInternalManifoldPointer() = 0;

-

-	virtual	void* allocateCollisionAlgorithm(int size)  = 0;

-

-	virtual	void freeCollisionAlgorithm(void* ptr) = 0;

-

-};

-

-

-#endif //_DISPATCHER_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h
+++ /dev/null
@@ -1,152 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-#ifndef BT_MULTI_SAP_BROADPHASE

-#define BT_MULTI_SAP_BROADPHASE

-

-#include "btBroadphaseInterface.h"

-#include "LinearMath/btAlignedObjectArray.h"

-#include "btOverlappingPairCache.h"

-

-

-class btBroadphaseInterface;

-class btSimpleBroadphase;

-

-

-typedef btAlignedObjectArray<btBroadphaseInterface*> btSapBroadphaseArray;

-

-///The btMultiSapBroadphase is a research project, not recommended to use in production. Use btAxisSweep3 or btDbvtBroadphase instead.

-///The btMultiSapBroadphase is a broadphase that contains multiple SAP broadphases.

-///The user can add SAP broadphases that cover the world. A btBroadphaseProxy can be in multiple child broadphases at the same time.

-///A btQuantizedBvh acceleration structures finds overlapping SAPs for each btBroadphaseProxy.

-///See http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=328

-///and http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329

-class btMultiSapBroadphase :public btBroadphaseInterface

-{

-	btSapBroadphaseArray	m_sapBroadphases;

-	

-	btSimpleBroadphase*		m_simpleBroadphase;

-

-	btOverlappingPairCache*	m_overlappingPairs;

-

-	class btQuantizedBvh*			m_optimizedAabbTree;

-

-

-	bool					m_ownsPairCache;

-	

-	btOverlapFilterCallback*	m_filterCallback;

-

-	int			m_invalidPair;

-

-	struct	btBridgeProxy

-	{

-		btBroadphaseProxy*		m_childProxy;

-		btBroadphaseInterface*	m_childBroadphase;

-	};

-

-

-public:

-

-	struct	btMultiSapProxy	: public btBroadphaseProxy

-	{

-

-		///array with all the entries that this proxy belongs to

-		btAlignedObjectArray<btBridgeProxy*> m_bridgeProxies;

-		btVector3	m_aabbMin;

-		btVector3	m_aabbMax;

-

-		int	m_shapeType;

-

-/*		void*	m_userPtr;

-		short int	m_collisionFilterGroup;

-		short int	m_collisionFilterMask;

-*/

-		btMultiSapProxy(const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask)

-			:btBroadphaseProxy(aabbMin,aabbMax,userPtr,collisionFilterGroup,collisionFilterMask),

-			m_aabbMin(aabbMin),

-			m_aabbMax(aabbMax),

-			m_shapeType(shapeType)

-		{

-			m_multiSapParentProxy =this;

-		}

-

-		

-	};

-

-protected:

-

-

-	btAlignedObjectArray<btMultiSapProxy*> m_multiSapProxies;

-

-public:

-

-	btMultiSapBroadphase(int maxProxies = 16384,btOverlappingPairCache* pairCache=0);

-

-

-	btSapBroadphaseArray&	getBroadphaseArray()

-	{

-		return m_sapBroadphases;

-	}

-

-	const btSapBroadphaseArray&	getBroadphaseArray() const

-	{

-		return m_sapBroadphases;

-	}

-

-	virtual ~btMultiSapBroadphase();

-

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);

-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));

-

-	void	addToChildBroadphase(btMultiSapProxy* parentMultiSapProxy, btBroadphaseProxy* childProxy, btBroadphaseInterface*	childBroadphase);

-

-	///calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);

-

-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-	virtual	btOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_overlappingPairs;

-	}

-	virtual	const btOverlappingPairCache*	getOverlappingPairCache() const

-	{

-		return m_overlappingPairs;

-	}

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const

-	{

-		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);

-		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);

-	}

-

-	void	buildTree(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax);

-

-	virtual void	printStats();

-

-	void quicksort (btBroadphasePairArray& a, int lo, int hi);

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher);

-

-};

-

-#endif //BT_MULTI_SAP_BROADPHASE

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
+++ /dev/null
@@ -1,470 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef OVERLAPPING_PAIR_CACHE_H

-#define OVERLAPPING_PAIR_CACHE_H

-

-

-#include "btBroadphaseInterface.h"

-#include "btBroadphaseProxy.h"

-#include "btOverlappingPairCallback.h"

-

-#include "LinearMath/btAlignedObjectArray.h"

-class btDispatcher;

-

-typedef btAlignedObjectArray<btBroadphasePair>	btBroadphasePairArray;

-

-struct	btOverlapCallback

-{

-	virtual ~btOverlapCallback()

-	{}

-	//return true for deletion of the pair

-	virtual bool	processOverlap(btBroadphasePair& pair) = 0;

-

-};

-

-struct btOverlapFilterCallback

-{

-	virtual ~btOverlapFilterCallback()

-	{}

-	// return true when pairs need collision

-	virtual bool	needBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const = 0;

-};

-

-

-

-

-

-

-

-extern int gRemovePairs;

-extern int gAddedPairs;

-extern int gFindPairs;

-

-const int BT_NULL_PAIR=0xffffffff;

-

-///The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.

-///The btHashedOverlappingPairCache and btSortedOverlappingPairCache classes are two implementations.

-class btOverlappingPairCache : public btOverlappingPairCallback

-{

-public:

-	virtual ~btOverlappingPairCache() {} // this is needed so we can get to the derived class destructor

-

-	virtual btBroadphasePair*	getOverlappingPairArrayPtr() = 0;

-	

-	virtual const btBroadphasePair*	getOverlappingPairArrayPtr() const = 0;

-

-	virtual btBroadphasePairArray&	getOverlappingPairArray() = 0;

-

-	virtual	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher) = 0;

-

-	virtual int getNumOverlappingPairs() const = 0;

-

-	virtual void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher) = 0;

-

-	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* callback) = 0;

-

-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher) = 0;

-

-	virtual btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) = 0;

-

-	virtual bool	hasDeferredRemoval() = 0;

-

-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)=0;

-

-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher) = 0;

-

-

-};

-

-/// Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman, Codercorner, http://codercorner.com

-class btHashedOverlappingPairCache : public btOverlappingPairCache

-{

-	btBroadphasePairArray	m_overlappingPairArray;

-	btOverlapFilterCallback* m_overlapFilterCallback;

-	bool		m_blockedForChanges;

-

-

-public:

-	btHashedOverlappingPairCache();

-	virtual ~btHashedOverlappingPairCache();

-

-	

-	void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);

-	

-	SIMD_FORCE_INLINE bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const

-	{

-		if (m_overlapFilterCallback)

-			return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);

-

-		bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;

-		collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-		

-		return collides;

-	}

-

-	// Add a pair and return the new pair. If the pair already exists,

-	// no new pair is created and the old one is returned.

-	virtual btBroadphasePair* 	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)

-	{

-		gAddedPairs++;

-

-		if (!needsBroadphaseCollision(proxy0,proxy1))

-			return 0;

-

-		return internalAddPair(proxy0,proxy1);

-	}

-

-	

-

-	void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-	

-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);

-

-	virtual btBroadphasePair*	getOverlappingPairArrayPtr()

-	{

-		return &m_overlappingPairArray[0];

-	}

-

-	const btBroadphasePair*	getOverlappingPairArrayPtr() const

-	{

-		return &m_overlappingPairArray[0];

-	}

-

-	btBroadphasePairArray&	getOverlappingPairArray()

-	{

-		return m_overlappingPairArray;

-	}

-

-	const btBroadphasePairArray&	getOverlappingPairArray() const

-	{

-		return m_overlappingPairArray;

-	}

-

-	void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);

-

-

-

-	btBroadphasePair* findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1);

-

-	int GetCount() const { return m_overlappingPairArray.size(); }

-//	btBroadphasePair* GetPairs() { return m_pairs; }

-

-	btOverlapFilterCallback* getOverlapFilterCallback()

-	{

-		return m_overlapFilterCallback;

-	}

-

-	void setOverlapFilterCallback(btOverlapFilterCallback* callback)

-	{

-		m_overlapFilterCallback = callback;

-	}

-

-	int	getNumOverlappingPairs() const

-	{

-		return m_overlappingPairArray.size();

-	}

-private:

-	

-	btBroadphasePair* 	internalAddPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-	void	growTables();

-

-	SIMD_FORCE_INLINE bool equalsPair(const btBroadphasePair& pair, int proxyId1, int proxyId2)

-	{	

-		return pair.m_pProxy0->getUid() == proxyId1 && pair.m_pProxy1->getUid() == proxyId2;

-	}

-

-	/*

-	// Thomas Wang's hash, see: http://www.concentric.net/~Ttwang/tech/inthash.htm

-	// This assumes proxyId1 and proxyId2 are 16-bit.

-	SIMD_FORCE_INLINE int getHash(int proxyId1, int proxyId2)

-	{

-		int key = (proxyId2 << 16) | proxyId1;

-		key = ~key + (key << 15);

-		key = key ^ (key >> 12);

-		key = key + (key << 2);

-		key = key ^ (key >> 4);

-		key = key * 2057;

-		key = key ^ (key >> 16);

-		return key;

-	}

-	*/

-

-

-	

-	SIMD_FORCE_INLINE	unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)

-	{

-		int key = static_cast<int>(((unsigned int)proxyId1) | (((unsigned int)proxyId2) <<16));

-		// Thomas Wang's hash

-

-		key += ~(key << 15);

-		key ^=  (key >> 10);

-		key +=  (key << 3);

-		key ^=  (key >> 6);

-		key += ~(key << 11);

-		key ^=  (key >> 16);

-		return static_cast<unsigned int>(key);

-	}

-	

-

-

-

-

-	SIMD_FORCE_INLINE btBroadphasePair* internalFindPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, int hash)

-	{

-		int proxyId1 = proxy0->getUid();

-		int proxyId2 = proxy1->getUid();

-		#if 0 // wrong, 'equalsPair' use unsorted uids, copy-past devil striked again. Nat.

-		if (proxyId1 > proxyId2) 

-			btSwap(proxyId1, proxyId2);

-		#endif

-

-		int index = m_hashTable[hash];

-		

-		while( index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)

-		{

-			index = m_next[index];

-		}

-

-		if ( index == BT_NULL_PAIR )

-		{

-			return NULL;

-		}

-

-		btAssert(index < m_overlappingPairArray.size());

-

-		return &m_overlappingPairArray[index];

-	}

-

-	virtual bool	hasDeferredRemoval()

-	{

-		return false;

-	}

-

-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)

-	{

-		m_ghostPairCallback = ghostPairCallback;

-	}

-

-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher);

-	

-

-protected:

-	

-	btAlignedObjectArray<int>	m_hashTable;

-	btAlignedObjectArray<int>	m_next;

-	btOverlappingPairCallback*	m_ghostPairCallback;

-	

-};

-

-

-

-

-///btSortedOverlappingPairCache maintains the objects with overlapping AABB

-///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase

-class	btSortedOverlappingPairCache : public btOverlappingPairCache

-{

-	protected:

-		//avoid brute-force finding all the time

-		btBroadphasePairArray	m_overlappingPairArray;

-

-		//during the dispatch, check that user doesn't destroy/create proxy

-		bool		m_blockedForChanges;

-

-		///by default, do the removal during the pair traversal

-		bool		m_hasDeferredRemoval;

-		

-		//if set, use the callback instead of the built in filter in needBroadphaseCollision

-		btOverlapFilterCallback* m_overlapFilterCallback;

-

-		btOverlappingPairCallback*	m_ghostPairCallback;

-

-	public:

-			

-		btSortedOverlappingPairCache();	

-		virtual ~btSortedOverlappingPairCache();

-

-		virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* dispatcher);

-

-		void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher);

-

-		void	cleanOverlappingPair(btBroadphasePair& pair,btDispatcher* dispatcher);

-		

-		btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-		btBroadphasePair*	findPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-			

-		

-		void	cleanProxyFromPairs(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-		void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-

-

-		inline bool needsBroadphaseCollision(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) const

-		{

-			if (m_overlapFilterCallback)

-				return m_overlapFilterCallback->needBroadphaseCollision(proxy0,proxy1);

-

-			bool collides = (proxy0->m_collisionFilterGroup & proxy1->m_collisionFilterMask) != 0;

-			collides = collides && (proxy1->m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-			

-			return collides;

-		}

-		

-		btBroadphasePairArray&	getOverlappingPairArray()

-		{

-			return m_overlappingPairArray;

-		}

-

-		const btBroadphasePairArray&	getOverlappingPairArray() const

-		{

-			return m_overlappingPairArray;

-		}

-

-		

-

-

-		btBroadphasePair*	getOverlappingPairArrayPtr()

-		{

-			return &m_overlappingPairArray[0];

-		}

-

-		const btBroadphasePair*	getOverlappingPairArrayPtr() const

-		{

-			return &m_overlappingPairArray[0];

-		}

-

-		int	getNumOverlappingPairs() const

-		{

-			return m_overlappingPairArray.size();

-		}

-		

-		btOverlapFilterCallback* getOverlapFilterCallback()

-		{

-			return m_overlapFilterCallback;

-		}

-

-		void setOverlapFilterCallback(btOverlapFilterCallback* callback)

-		{

-			m_overlapFilterCallback = callback;

-		}

-

-		virtual bool	hasDeferredRemoval()

-		{

-			return m_hasDeferredRemoval;

-		}

-

-		virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* ghostPairCallback)

-		{

-			m_ghostPairCallback = ghostPairCallback;

-		}

-

-		virtual void	sortOverlappingPairs(btDispatcher* dispatcher);

-		

-

-};

-

-

-

-///btNullPairCache skips add/removal of overlapping pairs. Userful for benchmarking and unit testing.

-class btNullPairCache : public btOverlappingPairCache

-{

-

-	btBroadphasePairArray	m_overlappingPairArray;

-

-public:

-

-	virtual btBroadphasePair*	getOverlappingPairArrayPtr()

-	{

-		return &m_overlappingPairArray[0];

-	}

-	const btBroadphasePair*	getOverlappingPairArrayPtr() const

-	{

-		return &m_overlappingPairArray[0];

-	}

-	btBroadphasePairArray&	getOverlappingPairArray()

-	{

-		return m_overlappingPairArray;

-	}

-	

-	virtual	void	cleanOverlappingPair(btBroadphasePair& /*pair*/,btDispatcher* /*dispatcher*/)

-	{

-

-	}

-

-	virtual int getNumOverlappingPairs() const

-	{

-		return 0;

-	}

-

-	virtual void	cleanProxyFromPairs(btBroadphaseProxy* /*proxy*/,btDispatcher* /*dispatcher*/)

-	{

-

-	}

-

-	virtual	void setOverlapFilterCallback(btOverlapFilterCallback* /*callback*/)

-	{

-	}

-

-	virtual void	processAllOverlappingPairs(btOverlapCallback*,btDispatcher* /*dispatcher*/)

-	{

-	}

-

-	virtual btBroadphasePair* findPair(btBroadphaseProxy* /*proxy0*/, btBroadphaseProxy* /*proxy1*/)

-	{

-		return 0;

-	}

-

-	virtual bool	hasDeferredRemoval()

-	{

-		return true;

-	}

-

-	virtual	void	setInternalGhostPairCallback(btOverlappingPairCallback* /* ghostPairCallback */)

-	{

-

-	}

-

-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/)

-	{

-		return 0;

-	}

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* /*proxy0*/,btBroadphaseProxy* /*proxy1*/,btDispatcher* /*dispatcher*/)

-	{

-		return 0;

-	}

-

-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)

-	{

-	}

-	

-	virtual void	sortOverlappingPairs(btDispatcher* dispatcher)

-	{

-        (void) dispatcher;

-	}

-

-

-};

-

-

-#endif //OVERLAPPING_PAIR_CACHE_H

-

-

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h
+++ /dev/null
@@ -1,41 +1,1 @@
-

-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef OVERLAPPING_PAIR_CALLBACK_H

-#define OVERLAPPING_PAIR_CALLBACK_H

-

-class btDispatcher;

-struct  btBroadphasePair;

-

-///The btOverlappingPairCallback class is an additional optional broadphase user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.

-class btOverlappingPairCallback

-{

-public:

-	virtual ~btOverlappingPairCallback()

-	{

-

-	}

-	

-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1) = 0;

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher) = 0;

-

-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy0,btDispatcher* dispatcher) = 0;

-

-};

-

-#endif //OVERLAPPING_PAIR_CALLBACK_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
+++ /dev/null
@@ -1,580 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef QUANTIZED_BVH_H

-#define QUANTIZED_BVH_H

-

-class btSerializer;

-

-//#define DEBUG_CHECK_DEQUANTIZATION 1

-#ifdef DEBUG_CHECK_DEQUANTIZATION

-#ifdef __SPU__

-#define printf spu_printf

-#endif //__SPU__

-

-#include <stdio.h>

-#include <stdlib.h>

-#endif //DEBUG_CHECK_DEQUANTIZATION

-

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btAlignedAllocator.h"

-

-#ifdef BT_USE_DOUBLE_PRECISION

-#define btQuantizedBvhData btQuantizedBvhDoubleData

-#define btOptimizedBvhNodeData btOptimizedBvhNodeDoubleData

-#define btQuantizedBvhDataName "btQuantizedBvhDoubleData"

-#else

-#define btQuantizedBvhData btQuantizedBvhFloatData

-#define btOptimizedBvhNodeData btOptimizedBvhNodeFloatData

-#define btQuantizedBvhDataName "btQuantizedBvhFloatData"

-#endif

-

-

-

-//http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/vclrf__m128.asp

-

-

-//Note: currently we have 16 bytes per quantized node

-#define MAX_SUBTREE_SIZE_IN_BYTES  2048

-

-// 10 gives the potential for 1024 parts, with at most 2^21 (2097152) (minus one

-// actually) triangles each (since the sign bit is reserved

-#define MAX_NUM_PARTS_IN_BITS 10

-

-///btQuantizedBvhNode is a compressed aabb node, 16 bytes.

-///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).

-ATTRIBUTE_ALIGNED16	(struct) btQuantizedBvhNode

-{

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	//12 bytes

-	unsigned short int	m_quantizedAabbMin[3];

-	unsigned short int	m_quantizedAabbMax[3];

-	//4 bytes

-	int	m_escapeIndexOrTriangleIndex;

-

-	bool isLeafNode() const

-	{

-		//skipindex is negative (internal node), triangleindex >=0 (leafnode)

-		return (m_escapeIndexOrTriangleIndex >= 0);

-	}

-	int getEscapeIndex() const

-	{

-		btAssert(!isLeafNode());

-		return -m_escapeIndexOrTriangleIndex;

-	}

-	int	getTriangleIndex() const

-	{

-		btAssert(isLeafNode());

-		// Get only the lower bits where the triangle index is stored

-		return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));

-	}

-	int	getPartId() const

-	{

-		btAssert(isLeafNode());

-		// Get only the highest bits where the part index is stored

-		return (m_escapeIndexOrTriangleIndex>>(31-MAX_NUM_PARTS_IN_BITS));

-	}

-}

-;

-

-/// btOptimizedBvhNode contains both internal and leaf node information.

-/// Total node size is 44 bytes / node. You can use the compressed version of 16 bytes.

-ATTRIBUTE_ALIGNED16 (struct) btOptimizedBvhNode

-{

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	//32 bytes

-	btVector3	m_aabbMinOrg;

-	btVector3	m_aabbMaxOrg;

-

-	//4

-	int	m_escapeIndex;

-

-	//8

-	//for child nodes

-	int	m_subPart;

-	int	m_triangleIndex;

-	int	m_padding[5];//bad, due to alignment

-

-

-};

-

-

-///btBvhSubtreeInfo provides info to gather a subtree of limited size

-ATTRIBUTE_ALIGNED16(class) btBvhSubtreeInfo

-{

-public:

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	//12 bytes

-	unsigned short int	m_quantizedAabbMin[3];

-	unsigned short int	m_quantizedAabbMax[3];

-	//4 bytes, points to the root of the subtree

-	int			m_rootNodeIndex;

-	//4 bytes

-	int			m_subtreeSize;

-	int			m_padding[3];

-

-	btBvhSubtreeInfo()

-	{

-		//memset(&m_padding[0], 0, sizeof(m_padding));

-	}

-

-

-	void	setAabbFromQuantizeNode(const btQuantizedBvhNode& quantizedNode)

-	{

-		m_quantizedAabbMin[0] = quantizedNode.m_quantizedAabbMin[0];

-		m_quantizedAabbMin[1] = quantizedNode.m_quantizedAabbMin[1];

-		m_quantizedAabbMin[2] = quantizedNode.m_quantizedAabbMin[2];

-		m_quantizedAabbMax[0] = quantizedNode.m_quantizedAabbMax[0];

-		m_quantizedAabbMax[1] = quantizedNode.m_quantizedAabbMax[1];

-		m_quantizedAabbMax[2] = quantizedNode.m_quantizedAabbMax[2];

-	}

-}

-;

-

-

-class btNodeOverlapCallback

-{

-public:

-	virtual ~btNodeOverlapCallback() {};

-

-	virtual void processNode(int subPart, int triangleIndex) = 0;

-};

-

-#include "LinearMath/btAlignedAllocator.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-

-

-///for code readability:

-typedef btAlignedObjectArray<btOptimizedBvhNode>	NodeArray;

-typedef btAlignedObjectArray<btQuantizedBvhNode>	QuantizedNodeArray;

-typedef btAlignedObjectArray<btBvhSubtreeInfo>		BvhSubtreeInfoArray;

-

-

-///The btQuantizedBvh class stores an AABB tree that can be quickly traversed on CPU and Cell SPU.

-///It is used by the btBvhTriangleMeshShape as midphase, and by the btMultiSapBroadphase.

-///It is recommended to use quantization for better performance and lower memory requirements.

-ATTRIBUTE_ALIGNED16(class) btQuantizedBvh

-{

-public:

-	enum btTraversalMode

-	{

-		TRAVERSAL_STACKLESS = 0,

-		TRAVERSAL_STACKLESS_CACHE_FRIENDLY,

-		TRAVERSAL_RECURSIVE

-	};

-

-protected:

-

-

-	btVector3			m_bvhAabbMin;

-	btVector3			m_bvhAabbMax;

-	btVector3			m_bvhQuantization;

-

-	int					m_bulletVersion;	//for serialization versioning. It could also be used to detect endianess.

-

-	int					m_curNodeIndex;

-	//quantization data

-	bool				m_useQuantization;

-

-

-

-	NodeArray			m_leafNodes;

-	NodeArray			m_contiguousNodes;

-	QuantizedNodeArray	m_quantizedLeafNodes;

-	QuantizedNodeArray	m_quantizedContiguousNodes;

-	

-	btTraversalMode	m_traversalMode;

-	BvhSubtreeInfoArray		m_SubtreeHeaders;

-

-	//This is only used for serialization so we don't have to add serialization directly to btAlignedObjectArray

-	mutable int m_subtreeHeaderCount;

-

-	

-

-

-

-	///two versions, one for quantized and normal nodes. This allows code-reuse while maintaining readability (no template/macro!)

-	///this might be refactored into a virtual, it is usually not calculated at run-time

-	void	setInternalNodeAabbMin(int nodeIndex, const btVector3& aabbMin)

-	{

-		if (m_useQuantization)

-		{

-			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[0] ,aabbMin,0);

-		} else

-		{

-			m_contiguousNodes[nodeIndex].m_aabbMinOrg = aabbMin;

-

-		}

-	}

-	void	setInternalNodeAabbMax(int nodeIndex,const btVector3& aabbMax)

-	{

-		if (m_useQuantization)

-		{

-			quantize(&m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[0],aabbMax,1);

-		} else

-		{

-			m_contiguousNodes[nodeIndex].m_aabbMaxOrg = aabbMax;

-		}

-	}

-

-	btVector3 getAabbMin(int nodeIndex) const

-	{

-		if (m_useQuantization)

-		{

-			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMin[0]);

-		}

-		//non-quantized

-		return m_leafNodes[nodeIndex].m_aabbMinOrg;

-

-	}

-	btVector3 getAabbMax(int nodeIndex) const

-	{

-		if (m_useQuantization)

-		{

-			return unQuantize(&m_quantizedLeafNodes[nodeIndex].m_quantizedAabbMax[0]);

-		} 

-		//non-quantized

-		return m_leafNodes[nodeIndex].m_aabbMaxOrg;

-		

-	}

-

-	

-	void	setInternalNodeEscapeIndex(int nodeIndex, int escapeIndex)

-	{

-		if (m_useQuantization)

-		{

-			m_quantizedContiguousNodes[nodeIndex].m_escapeIndexOrTriangleIndex = -escapeIndex;

-		} 

-		else

-		{

-			m_contiguousNodes[nodeIndex].m_escapeIndex = escapeIndex;

-		}

-

-	}

-

-	void mergeInternalNodeAabb(int nodeIndex,const btVector3& newAabbMin,const btVector3& newAabbMax) 

-	{

-		if (m_useQuantization)

-		{

-			unsigned short int quantizedAabbMin[3];

-			unsigned short int quantizedAabbMax[3];

-			quantize(quantizedAabbMin,newAabbMin,0);

-			quantize(quantizedAabbMax,newAabbMax,1);

-			for (int i=0;i<3;i++)

-			{

-				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] > quantizedAabbMin[i])

-					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMin[i] = quantizedAabbMin[i];

-

-				if (m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] < quantizedAabbMax[i])

-					m_quantizedContiguousNodes[nodeIndex].m_quantizedAabbMax[i] = quantizedAabbMax[i];

-

-			}

-		} else

-		{

-			//non-quantized

-			m_contiguousNodes[nodeIndex].m_aabbMinOrg.setMin(newAabbMin);

-			m_contiguousNodes[nodeIndex].m_aabbMaxOrg.setMax(newAabbMax);		

-		}

-	}

-

-	void	swapLeafNodes(int firstIndex,int secondIndex);

-

-	void	assignInternalNodeFromLeafNode(int internalNode,int leafNodeIndex);

-

-protected:

-

-	

-

-	void	buildTree	(int startIndex,int endIndex);

-

-	int	calcSplittingAxis(int startIndex,int endIndex);

-

-	int	sortAndCalcSplittingIndex(int startIndex,int endIndex,int splitAxis);

-	

-	void	walkStacklessTree(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;

-

-	void	walkStacklessQuantizedTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;

-	void	walkStacklessQuantizedTree(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax,int startNodeIndex,int endNodeIndex) const;

-	void	walkStacklessTreeAgainstRay(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin, const btVector3& aabbMax, int startNodeIndex,int endNodeIndex) const;

-

-	///tree traversal designed for small-memory processors like PS3 SPU

-	void	walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;

-

-	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal

-	void	walkRecursiveQuantizedTreeAgainstQueryAabb(const btQuantizedBvhNode* currentNode,btNodeOverlapCallback* nodeCallback,unsigned short int* quantizedQueryAabbMin,unsigned short int* quantizedQueryAabbMax) const;

-

-	///use the 16-byte stackless 'skipindex' node tree to do a recursive traversal

-	void	walkRecursiveQuantizedTreeAgainstQuantizedTree(const btQuantizedBvhNode* treeNodeA,const btQuantizedBvhNode* treeNodeB,btNodeOverlapCallback* nodeCallback) const;

-	

-

-

-

-	void	updateSubtreeHeaders(int leftChildNodexIndex,int rightChildNodexIndex);

-

-public:

-	

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	btQuantizedBvh();

-

-	virtual ~btQuantizedBvh();

-

-	

-	///***************************************** expert/internal use only *************************

-	void	setQuantizationValues(const btVector3& bvhAabbMin,const btVector3& bvhAabbMax,btScalar quantizationMargin=btScalar(1.0));

-	QuantizedNodeArray&	getLeafNodeArray() {			return	m_quantizedLeafNodes;	}

-	///buildInternal is expert use only: assumes that setQuantizationValues and LeafNodeArray are initialized

-	void	buildInternal();

-	///***************************************** expert/internal use only *************************

-

-	void	reportAabbOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const;

-	void	reportRayOverlappingNodex (btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget) const;

-	void	reportBoxCastOverlappingNodex(btNodeOverlapCallback* nodeCallback, const btVector3& raySource, const btVector3& rayTarget, const btVector3& aabbMin,const btVector3& aabbMax) const;

-

-		SIMD_FORCE_INLINE void quantize(unsigned short* out, const btVector3& point,int isMax) const

-	{

-

-		btAssert(m_useQuantization);

-

-		btAssert(point.getX() <= m_bvhAabbMax.getX());

-		btAssert(point.getY() <= m_bvhAabbMax.getY());

-		btAssert(point.getZ() <= m_bvhAabbMax.getZ());

-

-		btAssert(point.getX() >= m_bvhAabbMin.getX());

-		btAssert(point.getY() >= m_bvhAabbMin.getY());

-		btAssert(point.getZ() >= m_bvhAabbMin.getZ());

-

-		btVector3 v = (point - m_bvhAabbMin) * m_bvhQuantization;

-		///Make sure rounding is done in a way that unQuantize(quantizeWithClamp(...)) is conservative

-		///end-points always set the first bit, so that they are sorted properly (so that neighbouring AABBs overlap properly)

-		///@todo: double-check this

-		if (isMax)

-		{

-			out[0] = (unsigned short) (((unsigned short)(v.getX()+btScalar(1.)) | 1));

-			out[1] = (unsigned short) (((unsigned short)(v.getY()+btScalar(1.)) | 1));

-			out[2] = (unsigned short) (((unsigned short)(v.getZ()+btScalar(1.)) | 1));

-		} else

-		{

-			out[0] = (unsigned short) (((unsigned short)(v.getX()) & 0xfffe));

-			out[1] = (unsigned short) (((unsigned short)(v.getY()) & 0xfffe));

-			out[2] = (unsigned short) (((unsigned short)(v.getZ()) & 0xfffe));

-		}

-

-

-#ifdef DEBUG_CHECK_DEQUANTIZATION

-		btVector3 newPoint = unQuantize(out);

-		if (isMax)

-		{

-			if (newPoint.getX() < point.getX())

-			{

-				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());

-			}

-			if (newPoint.getY() < point.getY())

-			{

-				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());

-			}

-			if (newPoint.getZ() < point.getZ())

-			{

-

-				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());

-			}

-		} else

-		{

-			if (newPoint.getX() > point.getX())

-			{

-				printf("unconservative X, diffX = %f, oldX=%f,newX=%f\n",newPoint.getX()-point.getX(), newPoint.getX(),point.getX());

-			}

-			if (newPoint.getY() > point.getY())

-			{

-				printf("unconservative Y, diffY = %f, oldY=%f,newY=%f\n",newPoint.getY()-point.getY(), newPoint.getY(),point.getY());

-			}

-			if (newPoint.getZ() > point.getZ())

-			{

-				printf("unconservative Z, diffZ = %f, oldZ=%f,newZ=%f\n",newPoint.getZ()-point.getZ(), newPoint.getZ(),point.getZ());

-			}

-		}

-#endif //DEBUG_CHECK_DEQUANTIZATION

-

-	}

-

-

-	SIMD_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const btVector3& point2,int isMax) const

-	{

-

-		btAssert(m_useQuantization);

-

-		btVector3 clampedPoint(point2);

-		clampedPoint.setMax(m_bvhAabbMin);

-		clampedPoint.setMin(m_bvhAabbMax);

-

-		quantize(out,clampedPoint,isMax);

-

-	}

-	

-	SIMD_FORCE_INLINE btVector3	unQuantize(const unsigned short* vecIn) const

-	{

-			btVector3	vecOut;

-			vecOut.setValue(

-			(btScalar)(vecIn[0]) / (m_bvhQuantization.getX()),

-			(btScalar)(vecIn[1]) / (m_bvhQuantization.getY()),

-			(btScalar)(vecIn[2]) / (m_bvhQuantization.getZ()));

-			vecOut += m_bvhAabbMin;

-			return vecOut;

-	}

-

-	///setTraversalMode let's you choose between stackless, recursive or stackless cache friendly tree traversal. Note this is only implemented for quantized trees.

-	void	setTraversalMode(btTraversalMode	traversalMode)

-	{

-		m_traversalMode = traversalMode;

-	}

-

-

-	SIMD_FORCE_INLINE QuantizedNodeArray&	getQuantizedNodeArray()

-	{	

-		return	m_quantizedContiguousNodes;

-	}

-

-

-	SIMD_FORCE_INLINE BvhSubtreeInfoArray&	getSubtreeInfoArray()

-	{

-		return m_SubtreeHeaders;

-	}

-

-////////////////////////////////////////////////////////////////////

-

-	/////Calculate space needed to store BVH for serialization

-	unsigned calculateSerializeBufferSize() const;

-

-	/// Data buffer MUST be 16 byte aligned

-	virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const;

-

-	///deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'

-	static btQuantizedBvh *deSerializeInPlace(void *i_alignedDataBuffer, unsigned int i_dataBufferSize, bool i_swapEndian);

-

-	static unsigned int getAlignmentSerializationPadding();

-//////////////////////////////////////////////////////////////////////

-

-	

-	virtual	int	calculateSerializeBufferSizeNew() const;

-

-	///fills the dataBuffer and returns the struct name (and 0 on failure)

-	virtual	const char*	serialize(void* dataBuffer, btSerializer* serializer) const;

-

-	virtual	void deSerializeFloat(struct btQuantizedBvhFloatData& quantizedBvhFloatData);

-

-	virtual	void deSerializeDouble(struct btQuantizedBvhDoubleData& quantizedBvhDoubleData);

-

-

-////////////////////////////////////////////////////////////////////

-

-	SIMD_FORCE_INLINE bool isQuantized()

-	{

-		return m_useQuantization;

-	}

-

-private:

-	// Special "copy" constructor that allows for in-place deserialization

-	// Prevents btVector3's default constructor from being called, but doesn't inialize much else

-	// ownsMemory should most likely be false if deserializing, and if you are not, don't call this (it also changes the function signature, which we need)

-	btQuantizedBvh(btQuantizedBvh &other, bool ownsMemory);

-

-}

-;

-

-

-struct	btBvhSubtreeInfoData

-{

-	int			m_rootNodeIndex;

-	int			m_subtreeSize;

-	unsigned short m_quantizedAabbMin[3];

-	unsigned short m_quantizedAabbMax[3];

-};

-

-struct btOptimizedBvhNodeFloatData

-{

-	btVector3FloatData	m_aabbMinOrg;

-	btVector3FloatData	m_aabbMaxOrg;

-	int	m_escapeIndex;

-	int	m_subPart;

-	int	m_triangleIndex;

-	char m_pad[4];

-};

-

-struct btOptimizedBvhNodeDoubleData

-{

-	btVector3DoubleData	m_aabbMinOrg;

-	btVector3DoubleData	m_aabbMaxOrg;

-	int	m_escapeIndex;

-	int	m_subPart;

-	int	m_triangleIndex;

-	char	m_pad[4];

-};

-

-

-struct btQuantizedBvhNodeData

-{

-	unsigned short m_quantizedAabbMin[3];

-	unsigned short m_quantizedAabbMax[3];

-	int	m_escapeIndexOrTriangleIndex;

-};

-

-struct	btQuantizedBvhFloatData

-{

-	btVector3FloatData			m_bvhAabbMin;

-	btVector3FloatData			m_bvhAabbMax;

-	btVector3FloatData			m_bvhQuantization;

-	int					m_curNodeIndex;

-	int					m_useQuantization;

-	int					m_numContiguousLeafNodes;

-	int					m_numQuantizedContiguousNodes;

-	btOptimizedBvhNodeFloatData	*m_contiguousNodesPtr;

-	btQuantizedBvhNodeData		*m_quantizedContiguousNodesPtr;

-	btBvhSubtreeInfoData	*m_subTreeInfoPtr;

-	int					m_traversalMode;

-	int					m_numSubtreeHeaders;

-	

-};

-

-struct	btQuantizedBvhDoubleData

-{

-	btVector3DoubleData			m_bvhAabbMin;

-	btVector3DoubleData			m_bvhAabbMax;

-	btVector3DoubleData			m_bvhQuantization;

-	int							m_curNodeIndex;

-	int							m_useQuantization;

-	int							m_numContiguousLeafNodes;

-	int							m_numQuantizedContiguousNodes;

-	btOptimizedBvhNodeDoubleData	*m_contiguousNodesPtr;

-	btQuantizedBvhNodeData			*m_quantizedContiguousNodesPtr;

-

-	int							m_traversalMode;

-	int							m_numSubtreeHeaders;

-	btBvhSubtreeInfoData		*m_subTreeInfoPtr;

-};

-

-

-SIMD_FORCE_INLINE	int	btQuantizedBvh::calculateSerializeBufferSizeNew() const

-{

-	return sizeof(btQuantizedBvhData);

-}

-

-

-

-#endif //QUANTIZED_BVH_H

 

--- a/source/bheaders/Bullet/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
+++ /dev/null
@@ -1,172 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SIMPLE_BROADPHASE_H

-#define SIMPLE_BROADPHASE_H

-

-

-#include "btOverlappingPairCache.h"

-

-

-struct btSimpleBroadphaseProxy : public btBroadphaseProxy

-{

-	int			m_nextFree;

-	

-//	int			m_handleId;

-

-	

-	btSimpleBroadphaseProxy() {};

-

-	btSimpleBroadphaseProxy(const btVector3& minpt,const btVector3& maxpt,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask,void* multiSapProxy)

-	:btBroadphaseProxy(minpt,maxpt,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy)

-	{

-		(void)shapeType;

-	}

-	

-	

-	SIMD_FORCE_INLINE void SetNextFree(int next) {m_nextFree = next;}

-	SIMD_FORCE_INLINE int GetNextFree() const {return m_nextFree;}

-

-	

-

-

-};

-

-///The SimpleBroadphase is just a unit-test for btAxisSweep3, bt32BitAxisSweep3, or btDbvtBroadphase, so use those classes instead.

-///It is a brute force aabb culling broadphase based on O(n^2) aabb checks

-class btSimpleBroadphase : public btBroadphaseInterface

-{

-

-protected:

-

-	int		m_numHandles;						// number of active handles

-	int		m_maxHandles;						// max number of handles

-	int		m_LastHandleIndex;							

-	

-	btSimpleBroadphaseProxy* m_pHandles;						// handles pool

-

-	void* m_pHandlesRawPtr;

-	int		m_firstFreeHandle;		// free handles list

-	

-	int allocHandle()

-	{

-		btAssert(m_numHandles < m_maxHandles);

-		int freeHandle = m_firstFreeHandle;

-		m_firstFreeHandle = m_pHandles[freeHandle].GetNextFree();

-		m_numHandles++;

-		if(freeHandle > m_LastHandleIndex)

-		{

-			m_LastHandleIndex = freeHandle;

-		}

-		return freeHandle;

-	}

-

-	void freeHandle(btSimpleBroadphaseProxy* proxy)

-	{

-		int handle = int(proxy-m_pHandles);

-		btAssert(handle >= 0 && handle < m_maxHandles);

-		if(handle == m_LastHandleIndex)

-		{

-			m_LastHandleIndex--;

-		}

-		proxy->SetNextFree(m_firstFreeHandle);

-		m_firstFreeHandle = handle;

-

-		proxy->m_clientObject = 0;

-

-		m_numHandles--;

-	}

-

-	btOverlappingPairCache*	m_pairCache;

-	bool	m_ownsPairCache;

-

-	int	m_invalidPair;

-

-	

-	

-	inline btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy)

-	{

-		btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxy);

-		return proxy0;

-	}

-

-	inline const btSimpleBroadphaseProxy*	getSimpleProxyFromProxy(btBroadphaseProxy* proxy) const

-	{

-		const btSimpleBroadphaseProxy* proxy0 = static_cast<const btSimpleBroadphaseProxy*>(proxy);

-		return proxy0;

-	}

-

-	///reset broadphase internal structures, to ensure determinism/reproducability

-	virtual void resetPool(btDispatcher* dispatcher);

-

-

-	void	validate();

-

-protected:

-

-

-	

-

-public:

-	btSimpleBroadphase(int maxProxies=16384,btOverlappingPairCache* overlappingPairCache=0);

-	virtual ~btSimpleBroadphase();

-

-

-		static bool	aabbOverlap(btSimpleBroadphaseProxy* proxy0,btSimpleBroadphaseProxy* proxy1);

-

-

-	virtual btBroadphaseProxy*	createProxy(  const btVector3& aabbMin,  const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy);

-

-	virtual void	calculateOverlappingPairs(btDispatcher* dispatcher);

-

-	virtual void	destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);

-	virtual void	setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax, btDispatcher* dispatcher);

-	virtual void	getAabb(btBroadphaseProxy* proxy,btVector3& aabbMin, btVector3& aabbMax ) const;

-

-	virtual void	rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback, const btVector3& aabbMin=btVector3(0,0,0),const btVector3& aabbMax=btVector3(0,0,0));

-	virtual void	aabbTest(const btVector3& aabbMin, const btVector3& aabbMax, btBroadphaseAabbCallback& callback);

-		

-	btOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_pairCache;

-	}

-	const btOverlappingPairCache*	getOverlappingPairCache() const

-	{

-		return m_pairCache;

-	}

-

-	bool	testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);

-

-

-	///getAabb returns the axis aligned bounding box in the 'global' coordinate frame

-	///will add some transform later

-	virtual void getBroadphaseAabb(btVector3& aabbMin,btVector3& aabbMax) const

-	{

-		aabbMin.setValue(-BT_LARGE_FLOAT,-BT_LARGE_FLOAT,-BT_LARGE_FLOAT);

-		aabbMax.setValue(BT_LARGE_FLOAT,BT_LARGE_FLOAT,BT_LARGE_FLOAT);

-	}

-

-	virtual void	printStats()

-	{

-//		printf("btSimpleBroadphase.h\n");

-//		printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);

-	}

-};

-

-

-

-#endif //SIMPLE_BROADPHASE_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CMakeLists.txt
+++ /dev/null
@@ -1,276 +1,1 @@
-INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src  )

-

-SET(BulletCollision_SRCS

-	BroadphaseCollision/btAxisSweep3.cpp

-	BroadphaseCollision/btBroadphaseProxy.cpp

-	BroadphaseCollision/btCollisionAlgorithm.cpp

-	BroadphaseCollision/btDbvt.cpp

-	BroadphaseCollision/btDbvtBroadphase.cpp

-	BroadphaseCollision/btDispatcher.cpp

-	BroadphaseCollision/btMultiSapBroadphase.cpp

-	BroadphaseCollision/btOverlappingPairCache.cpp

-	BroadphaseCollision/btQuantizedBvh.cpp

-	BroadphaseCollision/btSimpleBroadphase.cpp

-	CollisionDispatch/btActivatingCollisionAlgorithm.cpp

-	CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp

-	CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp

-	CollisionDispatch/btBoxBoxDetector.cpp

-	CollisionDispatch/btCollisionDispatcher.cpp

-	CollisionDispatch/btCollisionObject.cpp

-	CollisionDispatch/btCollisionWorld.cpp

-	CollisionDispatch/btCompoundCollisionAlgorithm.cpp

-	CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp

-	CollisionDispatch/btConvexConvexAlgorithm.cpp

-	CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp

-	CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp

-	CollisionDispatch/btDefaultCollisionConfiguration.cpp

-	CollisionDispatch/btEmptyCollisionAlgorithm.cpp

-	CollisionDispatch/btGhostObject.cpp

-	CollisionDispatch/btInternalEdgeUtility.cpp

-	CollisionDispatch/btInternalEdgeUtility.h

-	CollisionDispatch/btManifoldResult.cpp

-	CollisionDispatch/btSimulationIslandManager.cpp

-	CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp

-	CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp

-	CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp

-	CollisionDispatch/btUnionFind.cpp

-	CollisionDispatch/SphereTriangleDetector.cpp

-	CollisionShapes/btBoxShape.cpp

-	CollisionShapes/btBox2dShape.cpp

-	CollisionShapes/btBvhTriangleMeshShape.cpp

-	CollisionShapes/btCapsuleShape.cpp

-	CollisionShapes/btCollisionShape.cpp

-	CollisionShapes/btCompoundShape.cpp

-	CollisionShapes/btConcaveShape.cpp

-	CollisionShapes/btConeShape.cpp

-	CollisionShapes/btConvexHullShape.cpp

-	CollisionShapes/btConvexInternalShape.cpp

-	CollisionShapes/btConvexPointCloudShape.cpp

-	CollisionShapes/btConvexShape.cpp

-	CollisionShapes/btConvex2dShape.cpp

-	CollisionShapes/btConvexTriangleMeshShape.cpp

-	CollisionShapes/btCylinderShape.cpp

-	CollisionShapes/btEmptyShape.cpp

-	CollisionShapes/btHeightfieldTerrainShape.cpp

-	CollisionShapes/btMinkowskiSumShape.cpp

-	CollisionShapes/btMultimaterialTriangleMeshShape.cpp

-	CollisionShapes/btMultiSphereShape.cpp

-	CollisionShapes/btOptimizedBvh.cpp

-	CollisionShapes/btPolyhedralConvexShape.cpp

-	CollisionShapes/btScaledBvhTriangleMeshShape.cpp

-	CollisionShapes/btShapeHull.cpp

-	CollisionShapes/btSphereShape.cpp

-	CollisionShapes/btStaticPlaneShape.cpp

-	CollisionShapes/btStridingMeshInterface.cpp

-	CollisionShapes/btTetrahedronShape.cpp

-	CollisionShapes/btTriangleBuffer.cpp

-	CollisionShapes/btTriangleCallback.cpp

-	CollisionShapes/btTriangleIndexVertexArray.cpp

-	CollisionShapes/btTriangleIndexVertexMaterialArray.cpp

-	CollisionShapes/btTriangleMesh.cpp

-	CollisionShapes/btTriangleMeshShape.cpp

-	CollisionShapes/btUniformScalingShape.cpp

-	Gimpact/btContactProcessing.cpp

-	Gimpact/btGenericPoolAllocator.cpp

-	Gimpact/btGImpactBvh.cpp

-	Gimpact/btGImpactCollisionAlgorithm.cpp

-	Gimpact/btGImpactQuantizedBvh.cpp

-	Gimpact/btGImpactShape.cpp

-	Gimpact/btTriangleShapeEx.cpp

-	Gimpact/gim_box_set.cpp

-	Gimpact/gim_contact.cpp

-	Gimpact/gim_memory.cpp

-	Gimpact/gim_tri_collision.cpp

-	NarrowPhaseCollision/btContinuousConvexCollision.cpp

-	NarrowPhaseCollision/btConvexCast.cpp

-	NarrowPhaseCollision/btGjkConvexCast.cpp

-	NarrowPhaseCollision/btGjkEpa2.cpp

-	NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp

-	NarrowPhaseCollision/btGjkPairDetector.cpp

-	NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp

-	NarrowPhaseCollision/btPersistentManifold.cpp

-	NarrowPhaseCollision/btRaycastCallback.cpp

-	NarrowPhaseCollision/btSubSimplexConvexCast.cpp

-	NarrowPhaseCollision/btVoronoiSimplexSolver.cpp

-)

-

-SET(Root_HDRS

-	../btBulletCollisionCommon.h

-)

-SET(BroadphaseCollision_HDRS

-	BroadphaseCollision/btAxisSweep3.h

-	BroadphaseCollision/btBroadphaseInterface.h

-	BroadphaseCollision/btBroadphaseProxy.h

-	BroadphaseCollision/btCollisionAlgorithm.h

-	BroadphaseCollision/btDbvt.h

-	BroadphaseCollision/btDbvtBroadphase.h

-	BroadphaseCollision/btDispatcher.h

-	BroadphaseCollision/btMultiSapBroadphase.h

-	BroadphaseCollision/btOverlappingPairCache.h

-	BroadphaseCollision/btOverlappingPairCallback.h

-	BroadphaseCollision/btQuantizedBvh.h

-	BroadphaseCollision/btSimpleBroadphase.h

-)

-SET(CollisionDispatch_HDRS

-	CollisionDispatch/btActivatingCollisionAlgorithm.h

-	CollisionDispatch/btBoxBoxCollisionAlgorithm.h

-	CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h

-	CollisionDispatch/btBoxBoxDetector.h

-	CollisionDispatch/btCollisionConfiguration.h

-	CollisionDispatch/btCollisionCreateFunc.h

-	CollisionDispatch/btCollisionDispatcher.h

-	CollisionDispatch/btCollisionObject.h

-	CollisionDispatch/btCollisionWorld.h

-	CollisionDispatch/btCompoundCollisionAlgorithm.h

-	CollisionDispatch/btConvexConcaveCollisionAlgorithm.h

-	CollisionDispatch/btConvexConvexAlgorithm.h

-	CollisionDispatch/btConvex2dConvex2dAlgorithm.h

-	CollisionDispatch/btConvexPlaneCollisionAlgorithm.h

-	CollisionDispatch/btDefaultCollisionConfiguration.h

-	CollisionDispatch/btEmptyCollisionAlgorithm.h

-	CollisionDispatch/btGhostObject.h

-	CollisionDispatch/btManifoldResult.h

-	CollisionDispatch/btSimulationIslandManager.h

-	CollisionDispatch/btSphereBoxCollisionAlgorithm.h

-	CollisionDispatch/btSphereSphereCollisionAlgorithm.h

-	CollisionDispatch/btSphereTriangleCollisionAlgorithm.h

-	CollisionDispatch/btUnionFind.h

-	CollisionDispatch/SphereTriangleDetector.h

-)

-SET(CollisionShapes_HDRS

-	CollisionShapes/btBoxShape.h

-	CollisionShapes/btBox2dShape.h

-	CollisionShapes/btBvhTriangleMeshShape.h

-	CollisionShapes/btCapsuleShape.h

-	CollisionShapes/btCollisionMargin.h

-	CollisionShapes/btCollisionShape.h

-	CollisionShapes/btCompoundShape.h

-	CollisionShapes/btConcaveShape.h

-	CollisionShapes/btConeShape.h

-	CollisionShapes/btConvexHullShape.h

-	CollisionShapes/btConvexInternalShape.h

-	CollisionShapes/btConvexPointCloudShape.h

-	CollisionShapes/btConvexShape.h

-	CollisionShapes/btConvex2dShape.h

-	CollisionShapes/btConvexTriangleMeshShape.h

-	CollisionShapes/btCylinderShape.h

-	CollisionShapes/btEmptyShape.h

-	CollisionShapes/btHeightfieldTerrainShape.h

-	CollisionShapes/btMaterial.h

-	CollisionShapes/btMinkowskiSumShape.h

-	CollisionShapes/btMultimaterialTriangleMeshShape.h

-	CollisionShapes/btMultiSphereShape.h

-	CollisionShapes/btOptimizedBvh.h

-	CollisionShapes/btPolyhedralConvexShape.h

-	CollisionShapes/btScaledBvhTriangleMeshShape.h

-	CollisionShapes/btShapeHull.h

-	CollisionShapes/btSphereShape.h

-	CollisionShapes/btStaticPlaneShape.h

-	CollisionShapes/btStridingMeshInterface.h

-	CollisionShapes/btTetrahedronShape.h

-	CollisionShapes/btTriangleBuffer.h

-	CollisionShapes/btTriangleCallback.h

-	CollisionShapes/btTriangleIndexVertexArray.h

-	CollisionShapes/btTriangleIndexVertexMaterialArray.h

-	CollisionShapes/btTriangleInfoMap.h

-	CollisionShapes/btTriangleMesh.h

-	CollisionShapes/btTriangleMeshShape.h

-	CollisionShapes/btTriangleShape.h

-	CollisionShapes/btUniformScalingShape.h

-)

-SET(Gimpact_HDRS

-	Gimpact/btBoxCollision.h

-	Gimpact/btClipPolygon.h

-	Gimpact/btContactProcessing.h

-	Gimpact/btGenericPoolAllocator.h

-	Gimpact/btGeometryOperations.h

-	Gimpact/btGImpactBvh.h

-	Gimpact/btGImpactCollisionAlgorithm.h

-	Gimpact/btGImpactMassUtil.h

-	Gimpact/btGImpactQuantizedBvh.h

-	Gimpact/btGImpactShape.h

-	Gimpact/btQuantization.h

-	Gimpact/btTriangleShapeEx.h

-	Gimpact/gim_array.h

-	Gimpact/gim_basic_geometry_operations.h

-	Gimpact/gim_bitset.h

-	Gimpact/gim_box_collision.h

-	Gimpact/gim_box_set.h

-	Gimpact/gim_clip_polygon.h

-	Gimpact/gim_contact.h

-	Gimpact/gim_geom_types.h

-	Gimpact/gim_geometry.h

-	Gimpact/gim_hash_table.h

-	Gimpact/gim_linear_math.h

-	Gimpact/gim_math.h

-	Gimpact/gim_memory.h

-	Gimpact/gim_radixsort.h

-	Gimpact/gim_tri_collision.h

-)

-SET(NarrowPhaseCollision_HDRS

-	NarrowPhaseCollision/btContinuousConvexCollision.h

-	NarrowPhaseCollision/btConvexCast.h

-	NarrowPhaseCollision/btConvexPenetrationDepthSolver.h

-	NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h

-	NarrowPhaseCollision/btGjkConvexCast.h

-	NarrowPhaseCollision/btGjkEpa2.h

-	NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h

-	NarrowPhaseCollision/btGjkPairDetector.h

-	NarrowPhaseCollision/btManifoldPoint.h

-	NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h

-	NarrowPhaseCollision/btPersistentManifold.h

-	NarrowPhaseCollision/btPointCollector.h

-	NarrowPhaseCollision/btRaycastCallback.h

-	NarrowPhaseCollision/btSimplexSolverInterface.h

-	NarrowPhaseCollision/btSubSimplexConvexCast.h

-	NarrowPhaseCollision/btVoronoiSimplexSolver.h

-)

-

-SET(BulletCollision_HDRS

-	${Root_HDRS}

-	${BroadphaseCollision_HDRS}

-	${CollisionDispatch_HDRS}

-	${CollisionShapes_HDRS}

-	${Gimpact_HDRS}

-	${NarrowPhaseCollision_HDRS}

-)

-

-

-ADD_LIBRARY(BulletCollision ${BulletCollision_SRCS} ${BulletCollision_HDRS})

-SET_TARGET_PROPERTIES(BulletCollision PROPERTIES VERSION ${BULLET_VERSION})

-SET_TARGET_PROPERTIES(BulletCollision PROPERTIES SOVERSION ${BULLET_VERSION})

-IF (BUILD_SHARED_LIBS)

-  TARGET_LINK_LIBRARIES(BulletCollision LinearMath)

-ENDIF (BUILD_SHARED_LIBS)

-

-

-IF (INSTALL_LIBS)

-	IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)

-		#INSTALL of other files requires CMake 2.6

-		IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)

-			IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-				INSTALL(TARGETS BulletCollision DESTINATION .)

-			ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-				INSTALL(TARGETS BulletCollision DESTINATION lib${LIB_SUFFIX})

-				INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

-DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)

-				INSTALL(FILES ../btBulletCollisionCommon.h

-DESTINATION ${INCLUDE_INSTALL_DIR}/BulletCollision)

-			ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-		ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)

-		

-		IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-			SET_TARGET_PROPERTIES(BulletCollision PROPERTIES FRAMEWORK true)

-		

-			SET_TARGET_PROPERTIES(BulletCollision PROPERTIES PUBLIC_HEADER ${Root_HDRS})

-			# Have to list out sub-directories manually:

-			SET_PROPERTY(SOURCE ${BroadphaseCollision_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/BroadphaseCollision)

-			SET_PROPERTY(SOURCE ${CollisionDispatch_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/CollisionDispatch)

-			SET_PROPERTY(SOURCE ${CollisionShapes_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/CollisionShapes)

-			SET_PROPERTY(SOURCE ${Gimpact_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/Gimpact)

-			SET_PROPERTY(SOURCE ${NarrowPhaseCollision_HDRS} PROPERTY MACOSX_PACKAGE_LOCATION Headers/NarrowPhaseCollision)

-		

-		ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)

-	ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)

-ENDIF (INSTALL_LIBS)

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/all-wcprops
+++ /dev/null
@@ -1,156 +1,1 @@
-K 25
-svn:wc:ra_dav:version-url
-V 93
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch
-END
-btCollisionWorld.h
-K 25
-svn:wc:ra_dav:version-url
-V 112
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h
-END
-btConvexPlaneCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 127
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
-END
-btCompoundCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 124
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
-END
-btConvex2dConvex2dAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 123
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.h
-END
-btSimulationIslandManager.h
-K 25
-svn:wc:ra_dav:version-url
-V 121
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
-END
-btGhostObject.h
-K 25
-svn:wc:ra_dav:version-url
-V 109
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btGhostObject.h
-END
-btActivatingCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 126
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h
-END
-SphereTriangleDetector.h
-K 25
-svn:wc:ra_dav:version-url
-V 118
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
-END
-btSphereSphereCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 128
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
-END
-btEmptyCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 121
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
-END
-btCollisionObject.h
-K 25
-svn:wc:ra_dav:version-url
-V 113
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btCollisionObject.h
-END
-btSphereBoxCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 125
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
-END
-btCollisionConfiguration.h
-K 25
-svn:wc:ra_dav:version-url
-V 120
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btCollisionConfiguration.h
-END
-btConvexConcaveCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 129
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
-END
-btBoxBoxCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 122
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h
-END
-btInternalEdgeUtility.h
-K 25
-svn:wc:ra_dav:version-url
-V 117
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btInternalEdgeUtility.h
-END
-btDefaultCollisionConfiguration.h
-K 25
-svn:wc:ra_dav:version-url
-V 127
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h
-END
-btManifoldResult.h
-K 25
-svn:wc:ra_dav:version-url
-V 112
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btManifoldResult.h
-END
-btUnionFind.h
-K 25
-svn:wc:ra_dav:version-url
-V 107
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btUnionFind.h
-END
-btCollisionCreateFunc.h
-K 25
-svn:wc:ra_dav:version-url
-V 117
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
-END
-btBoxBoxDetector.h
-K 25
-svn:wc:ra_dav:version-url
-V 112
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btBoxBoxDetector.h
-END
-btConvexConvexAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 119
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
-END
-btSphereTriangleCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 130
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
-END
-btBox2dBox2dCollisionAlgorithm.h
-K 25
-svn:wc:ra_dav:version-url
-V 126
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
-END
-btCollisionDispatcher.h
-K 25
-svn:wc:ra_dav:version-url
-V 117
-/svnroot/irrbullet/!svn/ver/38/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
-END
 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/entries
+++ /dev/null
@@ -1,879 +1,1 @@
-10
 
-dir
-43
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet/trunk/source/bheaders/Bullet/BulletCollision/CollisionDispatch
-https://irrbullet.svn.sourceforge.net/svnroot/irrbullet
-
-
-
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-d286d458-e9d7-44e5-8155-503c4d2c87dc
-
-btCollisionWorld.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-1c0c88b027ef8b62e0992b6b5b3c8081
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-17892
-
-btConvexPlaneCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-98d0554d86887d24b12ea30b6a366872
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3654
-
-btCompoundCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-be38a7dd1ec27fffa9fc397462dfbe28
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3750
-
-btConvex2dConvex2dAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-3ece7562e7d81fad6ae6673389ad3dbe
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4144
-
-btSimulationIslandManager.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-d5464e3f04736d27d7b7501658776563
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2651
-
-btGhostObject.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-dd1970e375cac9a80444a34a1ad85d00
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5811
-
-btActivatingCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-87c813f5b02075f0cd4a21a5b74b2a32
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1689
-
-SphereTriangleDetector.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-b6b0eaf0289ff9de51f6e6cbe806fc18
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2128
-
-btSphereSphereCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-d39209e5e382b412b0c13cd491c4ae1d
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2993
-
-btEmptyCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-f1a006c22ac041d0b23a64bc1cca9b65
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2326
-
-btCollisionObject.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-2b994e345e7ce86741d542619a94a947
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-14910
-
-btSphereBoxCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-138366f49e033ae397624421722e2590
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3342
-
-btCollisionConfiguration.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-bb7f82f31775e633be6b967f5c3c9ac1
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1767
-
-btConvexConcaveCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-0dfa94b4c3b152352624a758b6238f66
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4407
-
-btBoxBoxCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-003e7a6caac6af1a2b5a00bc2b858326
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2784
-
-btInternalEdgeUtility.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-a64c176da5abbe454d56faf70b1d228a
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1830
-
-btDefaultCollisionConfiguration.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-fdb434c5ea06a0d76d068ead77c46aba
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5258
-
-btManifoldResult.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-256182ab4cb82837d3c460861ad0aca9
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3433
-
-btUnionFind.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-7d0fb08d4e9f0cad7f46154514e62679
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3584
-
-btCollisionCreateFunc.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-9b7bf2afa0db37420b894100647ff57d
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1694
-
-btBoxBoxDetector.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-9866275680b5d92c39f2418d288acbde
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-1942
-
-btConvexConvexAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-a0ec49a31a6a3161d078dea1d99e434e
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-4857
-
-btSphereTriangleCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-9db93a54565d58104b10193bae90f253
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-3073
-
-btBox2dBox2dCollisionAlgorithm.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-9c3668ca137c785e0b75f9a6f27f8494
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-2860
-
-btCollisionDispatcher.h
-file
-
-
-
-
-2011-02-26T06:26:36.000000Z
-b24218ae4390cbac9b3b8fd50de4f455
-2011-01-28T17:56:17.468414Z
-38
-skyreign
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-5044
-
-

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/SphereTriangleDetector.h.svn-base
+++ /dev/null
@@ -1,52 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SPHERE_TRIANGLE_DETECTOR_H

-#define SPHERE_TRIANGLE_DETECTOR_H

-

-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"

-

-

-

-class btSphereShape;

-class btTriangleShape;

-

-

-

-/// sphere-triangle to match the btDiscreteCollisionDetectorInterface

-struct SphereTriangleDetector : public btDiscreteCollisionDetectorInterface

-{

-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);

-

-	SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle, btScalar contactBreakingThreshold);

-

-	virtual ~SphereTriangleDetector() {};

-

-	bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar	contactBreakingThreshold);

-

-private:

-

-	

-	bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p );

-	bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal);

-

-	btSphereShape* m_sphere;

-	btTriangleShape* m_triangle;

-	btScalar	m_contactBreakingThreshold;

-	

-};

-#endif //SPHERE_TRIANGLE_DETECTOR_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btActivatingCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,37 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef __BT_ACTIVATING_COLLISION_ALGORITHM_H

-#define __BT_ACTIVATING_COLLISION_ALGORITHM_H

-

-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"

-

-///This class is not enabled yet (work-in-progress) to more aggressively activate objects.

-class btActivatingCollisionAlgorithm : public btCollisionAlgorithm

-{

-//	btCollisionObject* m_colObj0;

-//	btCollisionObject* m_colObj1;

-

-public:

-

-	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci);

-

-	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* colObj0,btCollisionObject* colObj1);

-

-	virtual ~btActivatingCollisionAlgorithm();

-

-};

-#endif //__BT_ACTIVATING_COLLISION_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btBox2dBox2dCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,67 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BOX_2D_BOX_2D__COLLISION_ALGORITHM_H

-#define BOX_2D_BOX_2D__COLLISION_ALGORITHM_H

-

-#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-

-class btPersistentManifold;

-

-///box-box collision detection

-class btBox2dBox2dCollisionAlgorithm : public btActivatingCollisionAlgorithm

-{

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	

-public:

-	btBox2dBox2dCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)

-		: btActivatingCollisionAlgorithm(ci) {}

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	btBox2dBox2dCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);

-

-	virtual ~btBox2dBox2dCollisionAlgorithm();

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		if (m_manifoldPtr && m_ownManifold)

-		{

-			manifoldArray.push_back(m_manifoldPtr);

-		}

-	}

-

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			int bbsize = sizeof(btBox2dBox2dCollisionAlgorithm);

-			void* ptr = ci.m_dispatcher1->allocateCollisionAlgorithm(bbsize);

-			return new(ptr) btBox2dBox2dCollisionAlgorithm(0,ci,body0,body1);

-		}

-	};

-

-};

-

-#endif //BOX_2D_BOX_2D__COLLISION_ALGORITHM_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btBoxBoxCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,67 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BOX_BOX__COLLISION_ALGORITHM_H

-#define BOX_BOX__COLLISION_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-

-class btPersistentManifold;

-

-///box-box collision detection

-class btBoxBoxCollisionAlgorithm : public btActivatingCollisionAlgorithm

-{

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	

-public:

-	btBoxBoxCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)

-		: btActivatingCollisionAlgorithm(ci) {}

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	btBoxBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);

-

-	virtual ~btBoxBoxCollisionAlgorithm();

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		if (m_manifoldPtr && m_ownManifold)

-		{

-			manifoldArray.push_back(m_manifoldPtr);

-		}

-	}

-

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			int bbsize = sizeof(btBoxBoxCollisionAlgorithm);

-			void* ptr = ci.m_dispatcher1->allocateCollisionAlgorithm(bbsize);

-			return new(ptr) btBoxBoxCollisionAlgorithm(0,ci,body0,body1);

-		}

-	};

-

-};

-

-#endif //BOX_BOX__COLLISION_ALGORITHM_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btBoxBoxDetector.h.svn-base
+++ /dev/null
@@ -1,45 +1,1 @@
-/*

- * Box-Box collision detection re-distributed under the ZLib license with permission from Russell L. Smith

- * Original version is from Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.

- * All rights reserved.  Email: russ@q12.org   Web: www.q12.org

-

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-#ifndef BOX_BOX_DETECTOR_H

-#define BOX_BOX_DETECTOR_H

-

-

-class btBoxShape;

-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"

-

-

-/// btBoxBoxDetector wraps the ODE box-box collision detector

-/// re-distributed under the Zlib license with permission from Russell L. Smith

-struct btBoxBoxDetector : public btDiscreteCollisionDetectorInterface

-{

-	btBoxShape* m_box1;

-	btBoxShape* m_box2;

-

-public:

-

-	btBoxBoxDetector(btBoxShape* box1,btBoxShape* box2);

-

-	virtual ~btBoxBoxDetector() {};

-

-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);

-

-};

-

-#endif //BT_BOX_BOX_DETECTOR_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btCollisionConfiguration.h.svn-base
+++ /dev/null
@@ -1,48 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BT_COLLISION_CONFIGURATION

-#define BT_COLLISION_CONFIGURATION

-struct btCollisionAlgorithmCreateFunc;

-

-class btStackAlloc;

-class btPoolAllocator;

-

-///btCollisionConfiguration allows to configure Bullet collision detection

-///stack allocator size, default collision algorithms and persistent manifold pool size

-///@todo: describe the meaning

-class	btCollisionConfiguration

-{

-

-public:

-

-	virtual ~btCollisionConfiguration()

-	{

-	}

-

-	///memory pools

-	virtual btPoolAllocator* getPersistentManifoldPool() = 0;

-

-	virtual btPoolAllocator* getCollisionAlgorithmPool() = 0;

-

-	virtual btStackAlloc*	getStackAllocator() = 0;

-

-	virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) =0;

-

-};

-

-#endif //BT_COLLISION_CONFIGURATION

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btCollisionCreateFunc.h.svn-base
+++ /dev/null
@@ -1,46 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef COLLISION_CREATE_FUNC

-#define COLLISION_CREATE_FUNC

-

-#include "LinearMath/btAlignedObjectArray.h"

-class btCollisionAlgorithm;

-class btCollisionObject;

-

-struct btCollisionAlgorithmConstructionInfo;

-

-///Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm

-struct btCollisionAlgorithmCreateFunc

-{

-	bool m_swapped;

-	

-	btCollisionAlgorithmCreateFunc()

-		:m_swapped(false)

-	{

-	}

-	virtual ~btCollisionAlgorithmCreateFunc(){};

-

-	virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , btCollisionObject* body0,btCollisionObject* body1)

-	{

-		

-		(void)body0;

-		(void)body1;

-		return 0;

-	}

-};

-#endif //COLLISION_CREATE_FUNC

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btCollisionDispatcher.h.svn-base
+++ /dev/null
@@ -1,160 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef COLLISION__DISPATCHER_H

-#define COLLISION__DISPATCHER_H

-

-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"

-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"

-

-#include "BulletCollision/CollisionDispatch/btManifoldResult.h"

-

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-class btIDebugDraw;

-class btOverlappingPairCache;

-class btPoolAllocator;

-class btCollisionConfiguration;

-

-#include "btCollisionCreateFunc.h"

-

-#define USE_DISPATCH_REGISTRY_ARRAY 1

-

-class btCollisionDispatcher;

-///user can override this nearcallback for collision filtering and more finegrained control over collision detection

-typedef void (*btNearCallback)(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);

-

-

-///btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.

-///Time of Impact, Closest Points and Penetration Depth.

-class btCollisionDispatcher : public btDispatcher

-{

-	int		m_dispatcherFlags;

-	

-	btAlignedObjectArray<btPersistentManifold*>	m_manifoldsPtr;

-

-	btManifoldResult	m_defaultManifoldResult;

-

-	btNearCallback		m_nearCallback;

-	

-	btPoolAllocator*	m_collisionAlgorithmPoolAllocator;

-

-	btPoolAllocator*	m_persistentManifoldPoolAllocator;

-

-	btCollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES];

-

-	btCollisionConfiguration*	m_collisionConfiguration;

-

-

-public:

-

-	enum DispatcherFlags

-	{

-		CD_STATIC_STATIC_REPORTED = 1,

-		CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD = 2

-	};

-

-	int	getDispatcherFlags() const

-	{

-		return m_dispatcherFlags;

-	}

-

-	void	setDispatcherFlags(int flags)

-	{

-        (void) flags;

-		m_dispatcherFlags = 0;

-	}

-

-	///registerCollisionCreateFunc allows registration of custom/alternative collision create functions

-	void	registerCollisionCreateFunc(int proxyType0,int proxyType1, btCollisionAlgorithmCreateFunc* createFunc);

-

-	int	getNumManifolds() const

-	{ 

-		return int( m_manifoldsPtr.size());

-	}

-

-	btPersistentManifold**	getInternalManifoldPointer()

-	{

-		return &m_manifoldsPtr[0];

-	}

-

-	 btPersistentManifold* getManifoldByIndexInternal(int index)

-	{

-		return m_manifoldsPtr[index];

-	}

-

-	 const btPersistentManifold* getManifoldByIndexInternal(int index) const

-	{

-		return m_manifoldsPtr[index];

-	}

-

-	btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration);

-

-	virtual ~btCollisionDispatcher();

-

-	virtual btPersistentManifold*	getNewManifold(void* b0,void* b1);

-	

-	virtual void releaseManifold(btPersistentManifold* manifold);

-

-

-	virtual void clearManifold(btPersistentManifold* manifold);

-

-			

-	btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold = 0);

-		

-	virtual bool	needsCollision(btCollisionObject* body0,btCollisionObject* body1);

-	

-	virtual bool	needsResponse(btCollisionObject* body0,btCollisionObject* body1);

-	

-	virtual void	dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher) ;

-

-	void	setNearCallback(btNearCallback	nearCallback)

-	{

-		m_nearCallback = nearCallback; 

-	}

-

-	btNearCallback	getNearCallback() const

-	{

-		return m_nearCallback;

-	}

-

-	//by default, Bullet will use this near callback

-	static void  defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo);

-

-	virtual	void* allocateCollisionAlgorithm(int size);

-

-	virtual	void freeCollisionAlgorithm(void* ptr);

-

-	btCollisionConfiguration*	getCollisionConfiguration()

-	{

-		return m_collisionConfiguration;

-	}

-

-	const btCollisionConfiguration*	getCollisionConfiguration() const

-	{

-		return m_collisionConfiguration;

-	}

-

-	void	setCollisionConfiguration(btCollisionConfiguration* config)

-	{

-		m_collisionConfiguration = config;

-	}

-

-};

-

-#endif //COLLISION__DISPATCHER_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btCollisionObject.h.svn-base
+++ /dev/null
@@ -1,525 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef COLLISION_OBJECT_H

-#define COLLISION_OBJECT_H

-

-#include "LinearMath/btTransform.h"

-

-//island management, m_activationState1

-#define ACTIVE_TAG 1

-#define ISLAND_SLEEPING 2

-#define WANTS_DEACTIVATION 3

-#define DISABLE_DEACTIVATION 4

-#define DISABLE_SIMULATION 5

-

-struct	btBroadphaseProxy;

-class	btCollisionShape;

-struct btCollisionShapeData;

-#include "LinearMath/btMotionState.h"

-#include "LinearMath/btAlignedAllocator.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;

-

-#ifdef BT_USE_DOUBLE_PRECISION

-#define btCollisionObjectData btCollisionObjectDoubleData

-#define btCollisionObjectDataName "btCollisionObjectDoubleData"

-#else

-#define btCollisionObjectData btCollisionObjectFloatData

-#define btCollisionObjectDataName "btCollisionObjectFloatData"

-#endif

-

-

-/// btCollisionObject can be used to manage collision detection objects. 

-/// btCollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy.

-/// They can be added to the btCollisionWorld.

-ATTRIBUTE_ALIGNED16(class)	btCollisionObject

-{

-

-protected:

-

-	btTransform	m_worldTransform;

-

-	///m_interpolationWorldTransform is used for CCD and interpolation

-	///it can be either previous or future (predicted) transform

-	btTransform	m_interpolationWorldTransform;

-	//those two are experimental: just added for bullet time effect, so you can still apply impulses (directly modifying velocities) 

-	//without destroying the continuous interpolated motion (which uses this interpolation velocities)

-	btVector3	m_interpolationLinearVelocity;

-	btVector3	m_interpolationAngularVelocity;

-	

-	btVector3	m_anisotropicFriction;

-	int			m_hasAnisotropicFriction;

-	btScalar	m_contactProcessingThreshold;	

-

-	btBroadphaseProxy*		m_broadphaseHandle;

-	btCollisionShape*		m_collisionShape;

-	///m_extensionPointer is used by some internal low-level Bullet extensions.

-	void*					m_extensionPointer;

-	

-	///m_rootCollisionShape is temporarily used to store the original collision shape

-	///The m_collisionShape might be temporarily replaced by a child collision shape during collision detection purposes

-	///If it is NULL, the m_collisionShape is not temporarily replaced.

-	btCollisionShape*		m_rootCollisionShape;

-

-	int				m_collisionFlags;

-

-	int				m_islandTag1;

-	int				m_companionId;

-

-	int				m_activationState1;

-	btScalar			m_deactivationTime;

-

-	btScalar		m_friction;

-	btScalar		m_restitution;

-

-	///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.

-	///do not assign your own m_internalType unless you write a new dynamics object class.

-	int				m_internalType;

-

-	///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer

-	void*			m_userObjectPointer;

-

-	///time of impact calculation

-	btScalar		m_hitFraction; 

-	

-	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::

-	btScalar		m_ccdSweptSphereRadius;

-

-	/// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold

-	btScalar		m_ccdMotionThreshold;

-	

-	/// If some object should have elaborate collision filtering by sub-classes

-	int			m_checkCollideWith;

-

-	virtual bool	checkCollideWithOverride(btCollisionObject* /* co */)

-	{

-		return true;

-	}

-

-public:

-

-	BT_DECLARE_ALIGNED_ALLOCATOR();

-

-	enum CollisionFlags

-	{

-		CF_STATIC_OBJECT= 1,

-		CF_KINEMATIC_OBJECT= 2,

-		CF_NO_CONTACT_RESPONSE = 4,

-		CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)

-		CF_CHARACTER_OBJECT = 16,

-		CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing

-		CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing

-	};

-

-	enum	CollisionObjectTypes

-	{

-		CO_COLLISION_OBJECT =1,

-		CO_RIGID_BODY=2,

-		///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter

-		///It is useful for collision sensors, explosion objects, character controller etc.

-		CO_GHOST_OBJECT=4,

-		CO_SOFT_BODY=8,

-		CO_HF_FLUID=16,

-		CO_USER_TYPE=32

-	};

-

-	SIMD_FORCE_INLINE bool mergesSimulationIslands() const

-	{

-		///static objects, kinematic and object without contact response don't merge islands

-		return  ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0);

-	}

-

-	const btVector3& getAnisotropicFriction() const

-	{

-		return m_anisotropicFriction;

-	}

-	void	setAnisotropicFriction(const btVector3& anisotropicFriction)

-	{

-		m_anisotropicFriction = anisotropicFriction;

-		m_hasAnisotropicFriction = (anisotropicFriction[0]!=1.f) || (anisotropicFriction[1]!=1.f) || (anisotropicFriction[2]!=1.f);

-	}

-	bool	hasAnisotropicFriction() const

-	{

-		return m_hasAnisotropicFriction!=0;

-	}

-

-	///the constraint solver can discard solving contacts, if the distance is above this threshold. 0 by default.

-	///Note that using contacts with positive distance can improve stability. It increases, however, the chance of colliding with degerate contacts, such as 'interior' triangle edges

-	void	setContactProcessingThreshold( btScalar contactProcessingThreshold)

-	{

-		m_contactProcessingThreshold = contactProcessingThreshold;

-	}

-	btScalar	getContactProcessingThreshold() const

-	{

-		return m_contactProcessingThreshold;

-	}

-

-	SIMD_FORCE_INLINE bool		isStaticObject() const {

-		return (m_collisionFlags & CF_STATIC_OBJECT) != 0;

-	}

-

-	SIMD_FORCE_INLINE bool		isKinematicObject() const

-	{

-		return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;

-	}

-

-	SIMD_FORCE_INLINE bool		isStaticOrKinematicObject() const

-	{

-		return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ;

-	}

-

-	SIMD_FORCE_INLINE bool		hasContactResponse() const {

-		return (m_collisionFlags & CF_NO_CONTACT_RESPONSE)==0;

-	}

-

-	

-	btCollisionObject();

-

-	virtual ~btCollisionObject();

-

-	virtual void	setCollisionShape(btCollisionShape* collisionShape)

-	{

-		m_collisionShape = collisionShape;

-		m_rootCollisionShape = collisionShape;

-	}

-

-	SIMD_FORCE_INLINE const btCollisionShape*	getCollisionShape() const

-	{

-		return m_collisionShape;

-	}

-

-	SIMD_FORCE_INLINE btCollisionShape*	getCollisionShape()

-	{

-		return m_collisionShape;

-	}

-

-	SIMD_FORCE_INLINE const btCollisionShape*	getRootCollisionShape() const

-	{

-		return m_rootCollisionShape;

-	}

-

-	SIMD_FORCE_INLINE btCollisionShape*	getRootCollisionShape()

-	{

-		return m_rootCollisionShape;

-	}

-

-	///Avoid using this internal API call

-	///internalSetTemporaryCollisionShape is used to temporary replace the actual collision shape by a child collision shape.

-	void	internalSetTemporaryCollisionShape(btCollisionShape* collisionShape)

-	{

-		m_collisionShape = collisionShape;

-	}

-

-	///Avoid using this internal API call, the extension pointer is used by some Bullet extensions. 

-	///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.

-	void*		internalGetExtensionPointer() const

-	{

-		return m_extensionPointer;

-	}

-	///Avoid using this internal API call, the extension pointer is used by some Bullet extensions

-	///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.

-	void	internalSetExtensionPointer(void* pointer)

-	{

-		m_extensionPointer = pointer;

-	}

-

-	SIMD_FORCE_INLINE	int	getActivationState() const { return m_activationState1;}

-	

-	void setActivationState(int newState);

-

-	void	setDeactivationTime(btScalar time)

-	{

-		m_deactivationTime = time;

-	}

-	btScalar	getDeactivationTime() const

-	{

-		return m_deactivationTime;

-	}

-

-	void forceActivationState(int newState);

-

-	void	activate(bool forceActivation = false);

-

-	SIMD_FORCE_INLINE bool isActive() const

-	{

-		return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));

-	}

-

-	void	setRestitution(btScalar rest)

-	{

-		m_restitution = rest;

-	}

-	btScalar	getRestitution() const

-	{

-		return m_restitution;

-	}

-	void	setFriction(btScalar frict)

-	{

-		m_friction = frict;

-	}

-	btScalar	getFriction() const

-	{

-		return m_friction;

-	}

-

-	///reserved for Bullet internal usage

-	int	getInternalType() const

-	{

-		return m_internalType;

-	}

-

-	btTransform&	getWorldTransform()

-	{

-		return m_worldTransform;

-	}

-

-	const btTransform&	getWorldTransform() const

-	{

-		return m_worldTransform;

-	}

-

-	void	setWorldTransform(const btTransform& worldTrans)

-	{

-		m_worldTransform = worldTrans;

-	}

-

-

-	SIMD_FORCE_INLINE btBroadphaseProxy*	getBroadphaseHandle()

-	{

-		return m_broadphaseHandle;

-	}

-

-	SIMD_FORCE_INLINE const btBroadphaseProxy*	getBroadphaseHandle() const

-	{

-		return m_broadphaseHandle;

-	}

-

-	void	setBroadphaseHandle(btBroadphaseProxy* handle)

-	{

-		m_broadphaseHandle = handle;

-	}

-

-

-	const btTransform&	getInterpolationWorldTransform() const

-	{

-		return m_interpolationWorldTransform;

-	}

-

-	btTransform&	getInterpolationWorldTransform()

-	{

-		return m_interpolationWorldTransform;

-	}

-

-	void	setInterpolationWorldTransform(const btTransform&	trans)

-	{

-		m_interpolationWorldTransform = trans;

-	}

-

-	void	setInterpolationLinearVelocity(const btVector3& linvel)

-	{

-		m_interpolationLinearVelocity = linvel;

-	}

-

-	void	setInterpolationAngularVelocity(const btVector3& angvel)

-	{

-		m_interpolationAngularVelocity = angvel;

-	}

-

-	const btVector3&	getInterpolationLinearVelocity() const

-	{

-		return m_interpolationLinearVelocity;

-	}

-

-	const btVector3&	getInterpolationAngularVelocity() const

-	{

-		return m_interpolationAngularVelocity;

-	}

-

-	SIMD_FORCE_INLINE int getIslandTag() const

-	{

-		return	m_islandTag1;

-	}

-

-	void	setIslandTag(int tag)

-	{

-		m_islandTag1 = tag;

-	}

-

-	SIMD_FORCE_INLINE int getCompanionId() const

-	{

-		return	m_companionId;

-	}

-

-	void	setCompanionId(int id)

-	{

-		m_companionId = id;

-	}

-

-	SIMD_FORCE_INLINE btScalar			getHitFraction() const

-	{

-		return m_hitFraction; 

-	}

-

-	void	setHitFraction(btScalar hitFraction)

-	{

-		m_hitFraction = hitFraction;

-	}

-

-	

-	SIMD_FORCE_INLINE int	getCollisionFlags() const

-	{

-		return m_collisionFlags;

-	}

-

-	void	setCollisionFlags(int flags)

-	{

-		m_collisionFlags = flags;

-	}

-	

-	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::

-	btScalar			getCcdSweptSphereRadius() const

-	{

-		return m_ccdSweptSphereRadius;

-	}

-

-	///Swept sphere radius (0.0 by default), see btConvexConvexAlgorithm::

-	void	setCcdSweptSphereRadius(btScalar radius)

-	{

-		m_ccdSweptSphereRadius = radius;

-	}

-

-	btScalar 	getCcdMotionThreshold() const

-	{

-		return m_ccdMotionThreshold;

-	}

-

-	btScalar 	getCcdSquareMotionThreshold() const

-	{

-		return m_ccdMotionThreshold*m_ccdMotionThreshold;

-	}

-

-

-

-	/// Don't do continuous collision detection if the motion (in one step) is less then m_ccdMotionThreshold

-	void	setCcdMotionThreshold(btScalar ccdMotionThreshold)

-	{

-		m_ccdMotionThreshold = ccdMotionThreshold;

-	}

-

-	///users can point to their objects, userPointer is not used by Bullet

-	void*	getUserPointer() const

-	{

-		return m_userObjectPointer;

-	}

-	

-	///users can point to their objects, userPointer is not used by Bullet

-	void	setUserPointer(void* userPointer)

-	{

-		m_userObjectPointer = userPointer;

-	}

-

-

-	inline bool checkCollideWith(btCollisionObject* co)

-	{

-		if (m_checkCollideWith)

-			return checkCollideWithOverride(co);

-

-		return true;

-	}

-

-	virtual	int	calculateSerializeBufferSize()	const;

-

-	///fills the dataBuffer and returns the struct name (and 0 on failure)

-	virtual	const char*	serialize(void* dataBuffer, class btSerializer* serializer) const;

-

-	virtual void serializeSingleObject(class btSerializer* serializer) const;

-

-};

-

-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64

-struct	btCollisionObjectDoubleData

-{

-	void					*m_broadphaseHandle;

-	void					*m_collisionShape;

-	btCollisionShapeData	*m_rootCollisionShape;

-	char					*m_name;

-

-	btTransformDoubleData	m_worldTransform;

-	btTransformDoubleData	m_interpolationWorldTransform;

-	btVector3DoubleData		m_interpolationLinearVelocity;

-	btVector3DoubleData		m_interpolationAngularVelocity;

-	btVector3DoubleData		m_anisotropicFriction;

-	double					m_contactProcessingThreshold;	

-	double					m_deactivationTime;

-	double					m_friction;

-	double					m_restitution;

-	double					m_hitFraction; 

-	double					m_ccdSweptSphereRadius;

-	double					m_ccdMotionThreshold;

-

-	int						m_hasAnisotropicFriction;

-	int						m_collisionFlags;

-	int						m_islandTag1;

-	int						m_companionId;

-	int						m_activationState1;

-	int						m_internalType;

-	int						m_checkCollideWith;

-

-	char	m_padding[4];

-};

-

-///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64

-struct	btCollisionObjectFloatData

-{

-	void					*m_broadphaseHandle;

-	void					*m_collisionShape;

-	btCollisionShapeData	*m_rootCollisionShape;

-	char					*m_name;

-

-	btTransformFloatData	m_worldTransform;

-	btTransformFloatData	m_interpolationWorldTransform;

-	btVector3FloatData		m_interpolationLinearVelocity;

-	btVector3FloatData		m_interpolationAngularVelocity;

-	btVector3FloatData		m_anisotropicFriction;

-	float					m_contactProcessingThreshold;	

-	float					m_deactivationTime;

-	float					m_friction;

-	float					m_restitution;

-	float					m_hitFraction; 

-	float					m_ccdSweptSphereRadius;

-	float					m_ccdMotionThreshold;

-

-	int						m_hasAnisotropicFriction;

-	int						m_collisionFlags;

-	int						m_islandTag1;

-	int						m_companionId;

-	int						m_activationState1;

-	int						m_internalType;

-	int						m_checkCollideWith;

-};

-

-

-

-SIMD_FORCE_INLINE	int	btCollisionObject::calculateSerializeBufferSize() const

-{

-	return sizeof(btCollisionObjectData);

-}

-

-

-

-#endif //COLLISION_OBJECT_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btCollisionWorld.h.svn-base
+++ /dev/null
@@ -1,510 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://bulletphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-

-/**

- * @mainpage Bullet Documentation

- *

- * @section intro_sec Introduction

- * Bullet Collision Detection & Physics SDK

- *

- * Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ).

- *

- * The main documentation is Bullet_User_Manual.pdf, included in the source code distribution.

- * There is the Physics Forum for feedback and general Collision Detection and Physics discussions.

- * Please visit http://www.bulletphysics.com

- *

- * @section install_sec Installation

- *

- * @subsection step1 Step 1: Download

- * You can download the Bullet Physics Library from the Google Code repository: http://code.google.com/p/bullet/downloads/list

- *

- * @subsection step2 Step 2: Building

- * Bullet main build system for all platforms is cmake, you can download http://www.cmake.org

- * cmake can autogenerate projectfiles for Microsoft Visual Studio, Apple Xcode, KDevelop and Unix Makefiles.

- * The easiest is to run the CMake cmake-gui graphical user interface and choose the options and generate projectfiles.

- * You can also use cmake in the command-line. Here are some examples for various platforms:

- * cmake . -G "Visual Studio 9 2008"

- * cmake . -G Xcode

- * cmake . -G "Unix Makefiles"

- * Although cmake is recommended, you can also use autotools for UNIX: ./autogen.sh ./configure to create a Makefile and then run make.

- * 

- * @subsection step3 Step 3: Testing demos

- * Try to run and experiment with BasicDemo executable as a starting point.

- * Bullet can be used in several ways, as Full Rigid Body simulation, as Collision Detector Library or Low Level / Snippets like the GJK Closest Point calculation.

- * The Dependencies can be seen in this documentation under Directories

- * 

- * @subsection step4 Step 4: Integrating in your application, full Rigid Body and Soft Body simulation

- * Check out BasicDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform.

- * Check out SoftDemo how to use soft body dynamics, using btSoftRigidDynamicsWorld.

- * @subsection step5 Step 5 : Integrate the Collision Detection Library (without Dynamics and other Extras)

- * Bullet Collision Detection can also be used without the Dynamics/Extras.

- * Check out btCollisionWorld and btCollisionObject, and the CollisionInterfaceDemo.

- * @subsection step6 Step 6 : Use Snippets like the GJK Closest Point calculation.

- * Bullet has been designed in a modular way keeping dependencies to a minimum. The ConvexHullDistance demo demonstrates direct use of btGjkPairDetector.

- *

- * @section copyright Copyright

- * For up-to-data information and copyright and contributors list check out the Bullet_User_Manual.pdf

- * 

- */

- 

- 

-

-#ifndef COLLISION_WORLD_H

-#define COLLISION_WORLD_H

-

-class btStackAlloc;

-class btCollisionShape;

-class btConvexShape;

-class btBroadphaseInterface;

-class btSerializer;

-

-#include "LinearMath/btVector3.h"

-#include "LinearMath/btTransform.h"

-#include "btCollisionObject.h"

-#include "btCollisionDispatcher.h"

-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"

-#include "LinearMath/btAlignedObjectArray.h"

-

-///CollisionWorld is interface and container for the collision detection

-class btCollisionWorld

-{

-

-	

-protected:

-

-	btAlignedObjectArray<btCollisionObject*>	m_collisionObjects;

-	

-	btDispatcher*	m_dispatcher1;

-

-	btDispatcherInfo	m_dispatchInfo;

-

-	btStackAlloc*	m_stackAlloc;

-

-	btBroadphaseInterface*	m_broadphasePairCache;

-

-	btIDebugDraw*	m_debugDrawer;

-

-	///m_forceUpdateAllAabbs can be set to false as an optimization to only update active object AABBs

-	///it is true by default, because it is error-prone (setting the position of static objects wouldn't update their AABB)

-	bool m_forceUpdateAllAabbs;

-

-	void	serializeCollisionObjects(btSerializer* serializer);

-

-public:

-

-	//this constructor doesn't own the dispatcher and paircache/broadphase

-	btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphasePairCache, btCollisionConfiguration* collisionConfiguration);

-

-	virtual ~btCollisionWorld();

-

-	void	setBroadphase(btBroadphaseInterface*	pairCache)

-	{

-		m_broadphasePairCache = pairCache;

-	}

-

-	const btBroadphaseInterface*	getBroadphase() const

-	{

-		return m_broadphasePairCache;

-	}

-

-	btBroadphaseInterface*	getBroadphase()

-	{

-		return m_broadphasePairCache;

-	}

-

-	btOverlappingPairCache*	getPairCache()

-	{

-		return m_broadphasePairCache->getOverlappingPairCache();

-	}

-

-

-	btDispatcher*	getDispatcher()

-	{

-		return m_dispatcher1;

-	}

-

-	const btDispatcher*	getDispatcher() const

-	{

-		return m_dispatcher1;

-	}

-

-	void	updateSingleAabb(btCollisionObject* colObj);

-

-	virtual void	updateAabbs();

-	

-	virtual void	setDebugDrawer(btIDebugDraw*	debugDrawer)

-	{

-			m_debugDrawer = debugDrawer;

-	}

-

-	virtual btIDebugDraw*	getDebugDrawer()

-	{

-		return m_debugDrawer;

-	}

-

-	virtual void	debugDrawWorld();

-

-	virtual void debugDrawObject(const btTransform& worldTransform, const btCollisionShape* shape, const btVector3& color);

-

-

-	///LocalShapeInfo gives extra information for complex shapes

-	///Currently, only btTriangleMeshShape is available, so it just contains triangleIndex and subpart

-	struct	LocalShapeInfo

-	{

-		int	m_shapePart;

-		int	m_triangleIndex;

-		

-		//const btCollisionShape*	m_shapeTemp;

-		//const btTransform*	m_shapeLocalTransform;

-	};

-

-	struct	LocalRayResult

-	{

-		LocalRayResult(btCollisionObject*	collisionObject, 

-			LocalShapeInfo*	localShapeInfo,

-			const btVector3&		hitNormalLocal,

-			btScalar hitFraction)

-		:m_collisionObject(collisionObject),

-		m_localShapeInfo(localShapeInfo),

-		m_hitNormalLocal(hitNormalLocal),

-		m_hitFraction(hitFraction)

-		{

-		}

-

-		btCollisionObject*		m_collisionObject;

-		LocalShapeInfo*			m_localShapeInfo;

-		btVector3				m_hitNormalLocal;

-		btScalar				m_hitFraction;

-

-	};

-

-	///RayResultCallback is used to report new raycast results

-	struct	RayResultCallback

-	{

-		btScalar	m_closestHitFraction;

-		btCollisionObject*		m_collisionObject;

-		short int	m_collisionFilterGroup;

-		short int	m_collisionFilterMask;

-      //@BP Mod - Custom flags, currently used to enable backface culling on tri-meshes, see btRaycastCallback

-      unsigned int m_flags;

-

-		virtual ~RayResultCallback()

-		{

-		}

-		bool	hasHit() const

-		{

-			return (m_collisionObject != 0);

-		}

-

-		RayResultCallback()

-			:m_closestHitFraction(btScalar(1.)),

-			m_collisionObject(0),

-			m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),

-			m_collisionFilterMask(btBroadphaseProxy::AllFilter),

-         //@BP Mod

-         m_flags(0)

-		{

-		}

-

-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const

-		{

-			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;

-			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-			return collides;

-		}

-

-

-		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace) = 0;

-	};

-

-	struct	ClosestRayResultCallback : public RayResultCallback

-	{

-		ClosestRayResultCallback(const btVector3&	rayFromWorld,const btVector3&	rayToWorld)

-		:m_rayFromWorld(rayFromWorld),

-		m_rayToWorld(rayToWorld)

-		{

-		}

-

-		btVector3	m_rayFromWorld;//used to calculate hitPointWorld from hitFraction

-		btVector3	m_rayToWorld;

-

-		btVector3	m_hitNormalWorld;

-		btVector3	m_hitPointWorld;

-			

-		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)

-		{

-			//caller already does the filter on the m_closestHitFraction

-			btAssert(rayResult.m_hitFraction <= m_closestHitFraction);

-			

-			m_closestHitFraction = rayResult.m_hitFraction;

-			m_collisionObject = rayResult.m_collisionObject;

-			if (normalInWorldSpace)

-			{

-				m_hitNormalWorld = rayResult.m_hitNormalLocal;

-			} else

-			{

-				///need to transform normal into worldspace

-				m_hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;

-			}

-			m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);

-			return rayResult.m_hitFraction;

-		}

-	};

-

-	struct	AllHitsRayResultCallback : public RayResultCallback

-	{

-		AllHitsRayResultCallback(const btVector3&	rayFromWorld,const btVector3&	rayToWorld)

-		:m_rayFromWorld(rayFromWorld),

-		m_rayToWorld(rayToWorld)

-		{

-		}

-

-		btAlignedObjectArray<btCollisionObject*>		m_collisionObjects;

-

-		btVector3	m_rayFromWorld;//used to calculate hitPointWorld from hitFraction

-		btVector3	m_rayToWorld;

-

-		btAlignedObjectArray<btVector3>	m_hitNormalWorld;

-		btAlignedObjectArray<btVector3>	m_hitPointWorld;

-		btAlignedObjectArray<btScalar> m_hitFractions;

-			

-		virtual	btScalar	addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace)

-		{

-			m_collisionObject = rayResult.m_collisionObject;

-			m_collisionObjects.push_back(rayResult.m_collisionObject);

-			btVector3 hitNormalWorld;

-			if (normalInWorldSpace)

-			{

-				hitNormalWorld = rayResult.m_hitNormalLocal;

-			} else

-			{

-				///need to transform normal into worldspace

-				hitNormalWorld = m_collisionObject->getWorldTransform().getBasis()*rayResult.m_hitNormalLocal;

-			}

-			m_hitNormalWorld.push_back(hitNormalWorld);

-			btVector3 hitPointWorld;

-			hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);

-			m_hitPointWorld.push_back(hitPointWorld);

-			m_hitFractions.push_back(rayResult.m_hitFraction);

-			return m_closestHitFraction;

-		}

-	};

-

-

-	struct LocalConvexResult

-	{

-		LocalConvexResult(btCollisionObject*	hitCollisionObject, 

-			LocalShapeInfo*	localShapeInfo,

-			const btVector3&		hitNormalLocal,

-			const btVector3&		hitPointLocal,

-			btScalar hitFraction

-			)

-		:m_hitCollisionObject(hitCollisionObject),

-		m_localShapeInfo(localShapeInfo),

-		m_hitNormalLocal(hitNormalLocal),

-		m_hitPointLocal(hitPointLocal),

-		m_hitFraction(hitFraction)

-		{

-		}

-

-		btCollisionObject*		m_hitCollisionObject;

-		LocalShapeInfo*			m_localShapeInfo;

-		btVector3				m_hitNormalLocal;

-		btVector3				m_hitPointLocal;

-		btScalar				m_hitFraction;

-	};

-

-	///RayResultCallback is used to report new raycast results

-	struct	ConvexResultCallback

-	{

-		btScalar	m_closestHitFraction;

-		short int	m_collisionFilterGroup;

-		short int	m_collisionFilterMask;

-		

-		ConvexResultCallback()

-			:m_closestHitFraction(btScalar(1.)),

-			m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),

-			m_collisionFilterMask(btBroadphaseProxy::AllFilter)

-		{

-		}

-

-		virtual ~ConvexResultCallback()

-		{

-		}

-		

-		bool	hasHit() const

-		{

-			return (m_closestHitFraction < btScalar(1.));

-		}

-

-		

-

-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const

-		{

-			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;

-			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-			return collides;

-		}

-

-		virtual	btScalar	addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace) = 0;

-	};

-

-	struct	ClosestConvexResultCallback : public ConvexResultCallback

-	{

-		ClosestConvexResultCallback(const btVector3&	convexFromWorld,const btVector3&	convexToWorld)

-		:m_convexFromWorld(convexFromWorld),

-		m_convexToWorld(convexToWorld),

-		m_hitCollisionObject(0)

-		{

-		}

-

-		btVector3	m_convexFromWorld;//used to calculate hitPointWorld from hitFraction

-		btVector3	m_convexToWorld;

-

-		btVector3	m_hitNormalWorld;

-		btVector3	m_hitPointWorld;

-		btCollisionObject*	m_hitCollisionObject;

-		

-		virtual	btScalar	addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace)

-		{

-//caller already does the filter on the m_closestHitFraction

-			btAssert(convexResult.m_hitFraction <= m_closestHitFraction);

-						

-			m_closestHitFraction = convexResult.m_hitFraction;

-			m_hitCollisionObject = convexResult.m_hitCollisionObject;

-			if (normalInWorldSpace)

-			{

-				m_hitNormalWorld = convexResult.m_hitNormalLocal;

-			} else

-			{

-				///need to transform normal into worldspace

-				m_hitNormalWorld = m_hitCollisionObject->getWorldTransform().getBasis()*convexResult.m_hitNormalLocal;

-			}

-			m_hitPointWorld = convexResult.m_hitPointLocal;

-			return convexResult.m_hitFraction;

-		}

-	};

-

-	///ContactResultCallback is used to report contact points

-	struct	ContactResultCallback

-	{

-		short int	m_collisionFilterGroup;

-		short int	m_collisionFilterMask;

-		

-		ContactResultCallback()

-			:m_collisionFilterGroup(btBroadphaseProxy::DefaultFilter),

-			m_collisionFilterMask(btBroadphaseProxy::AllFilter)

-		{

-		}

-

-		virtual ~ContactResultCallback()

-		{

-		}

-		

-		virtual bool needsCollision(btBroadphaseProxy* proxy0) const

-		{

-			bool collides = (proxy0->m_collisionFilterGroup & m_collisionFilterMask) != 0;

-			collides = collides && (m_collisionFilterGroup & proxy0->m_collisionFilterMask);

-			return collides;

-		}

-

-		virtual	btScalar	addSingleResult(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1) = 0;

-	};

-

-

-

-	int	getNumCollisionObjects() const

-	{

-		return int(m_collisionObjects.size());

-	}

-

-	/// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback

-	/// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.

-	virtual void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; 

-

-	/// convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback

-	/// This allows for several queries: first hit, all hits, any hit, dependent on the value return by the callback.

-	void    convexSweepTest (const btConvexShape* castShape, const btTransform& from, const btTransform& to, ConvexResultCallback& resultCallback,  btScalar allowedCcdPenetration = btScalar(0.)) const;

-

-	///contactTest performs a discrete collision test between colObj against all objects in the btCollisionWorld, and calls the resultCallback.

-	///it reports one or more contact points for every overlapping object (including the one with deepest penetration)

-	void	contactTest(btCollisionObject* colObj, ContactResultCallback& resultCallback);

-

-	///contactTest performs a discrete collision test between two collision objects and calls the resultCallback if overlap if detected.

-	///it reports one or more contact points (including the one with deepest penetration)

-	void	contactPairTest(btCollisionObject* colObjA, btCollisionObject* colObjB, ContactResultCallback& resultCallback);

-

-

-	/// rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest.

-	/// In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape.

-	/// This allows more customization.

-	static void	rayTestSingle(const btTransform& rayFromTrans,const btTransform& rayToTrans,

-					  btCollisionObject* collisionObject,

-					  const btCollisionShape* collisionShape,

-					  const btTransform& colObjWorldTransform,

-					  RayResultCallback& resultCallback);

-

-	/// objectQuerySingle performs a collision detection query and calls the resultCallback. It is used internally by rayTest.

-	static void	objectQuerySingle(const btConvexShape* castShape, const btTransform& rayFromTrans,const btTransform& rayToTrans,

-					  btCollisionObject* collisionObject,

-					  const btCollisionShape* collisionShape,

-					  const btTransform& colObjWorldTransform,

-					  ConvexResultCallback& resultCallback, btScalar	allowedPenetration);

-

-	virtual void	addCollisionObject(btCollisionObject* collisionObject,short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter);

-

-	btCollisionObjectArray& getCollisionObjectArray()

-	{

-		return m_collisionObjects;

-	}

-

-	const btCollisionObjectArray& getCollisionObjectArray() const

-	{

-		return m_collisionObjects;

-	}

-

-

-	virtual void	removeCollisionObject(btCollisionObject* collisionObject);

-

-	virtual void	performDiscreteCollisionDetection();

-

-	btDispatcherInfo& getDispatchInfo()

-	{

-		return m_dispatchInfo;

-	}

-

-	const btDispatcherInfo& getDispatchInfo() const

-	{

-		return m_dispatchInfo;

-	}

-	

-	bool	getForceUpdateAllAabbs() const

-	{

-		return m_forceUpdateAllAabbs;

-	}

-	void setForceUpdateAllAabbs( bool forceUpdateAllAabbs)

-	{

-		m_forceUpdateAllAabbs = forceUpdateAllAabbs;

-	}

-

-	///Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (Bullet/Demos/SerializeDemo)

-	virtual	void	serialize(btSerializer* serializer);

-

-};

-

-

-#endif //COLLISION_WORLD_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btCompoundCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,87 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef COMPOUND_COLLISION_ALGORITHM_H

-#define COMPOUND_COLLISION_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"

-

-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"

-class btDispatcher;

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "btCollisionCreateFunc.h"

-#include "LinearMath/btAlignedObjectArray.h"

-class btDispatcher;

-class btCollisionObject;

-

-/// btCompoundCollisionAlgorithm  supports collision between CompoundCollisionShapes and other collision shapes

-class btCompoundCollisionAlgorithm  : public btActivatingCollisionAlgorithm

-{

-	btAlignedObjectArray<btCollisionAlgorithm*> m_childCollisionAlgorithms;

-	bool m_isSwapped;

-

-	class btPersistentManifold*	m_sharedManifold;

-	bool					m_ownsManifold;

-

-	int	m_compoundShapeRevision;//to keep track of changes, so that childAlgorithm array can be updated

-	

-	void	removeChildAlgorithms();

-	

-	void	preallocateChildAlgorithms(btCollisionObject* body0,btCollisionObject* body1);

-

-public:

-

-	btCompoundCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);

-

-	virtual ~btCompoundCollisionAlgorithm();

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		int i;

-		for (i=0;i<m_childCollisionAlgorithms.size();i++)

-		{

-			if (m_childCollisionAlgorithms[i])

-				m_childCollisionAlgorithms[i]->getAllContactManifolds(manifoldArray);

-		}

-	}

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));

-			return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,false);

-		}

-	};

-

-	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btCompoundCollisionAlgorithm));

-			return new(mem) btCompoundCollisionAlgorithm(ci,body0,body1,true);

-		}

-	};

-

-};

-

-#endif //COMPOUND_COLLISION_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btConvex2dConvex2dAlgorithm.h.svn-base
+++ /dev/null
@@ -1,96 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef CONVEX_2D_CONVEX_2D_ALGORITHM_H

-#define CONVEX_2D_CONVEX_2D_ALGORITHM_H

-

-#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"

-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"

-#include "LinearMath/btTransformUtil.h" //for btConvexSeparatingDistanceUtil

-

-class btConvexPenetrationDepthSolver;

-

-

-///The convex2dConvex2dAlgorithm collision algorithm support 2d collision detection for btConvex2dShape

-///Currently it requires the btMinkowskiPenetrationDepthSolver, it has support for 2d penetration depth computation

-class btConvex2dConvex2dAlgorithm : public btActivatingCollisionAlgorithm

-{

-	btSimplexSolverInterface*		m_simplexSolver;

-	btConvexPenetrationDepthSolver* m_pdSolver;

-

-	

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	bool			m_lowLevelOfDetail;

-	

-	int m_numPerturbationIterations;

-	int m_minimumPointsPerturbationThreshold;

-

-public:

-

-	btConvex2dConvex2dAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);

-

-

-	virtual ~btConvex2dConvex2dAlgorithm();

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		///should we use m_ownManifold to avoid adding duplicates?

-		if (m_manifoldPtr && m_ownManifold)

-			manifoldArray.push_back(m_manifoldPtr);

-	}

-

-

-	void	setLowLevelOfDetail(bool useLowLevel);

-

-

-	const btPersistentManifold*	getManifold()

-	{

-		return m_manifoldPtr;

-	}

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-

-		btConvexPenetrationDepthSolver*		m_pdSolver;

-		btSimplexSolverInterface*			m_simplexSolver;

-		int m_numPerturbationIterations;

-		int m_minimumPointsPerturbationThreshold;

-

-		CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver);

-		

-		virtual ~CreateFunc();

-

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvex2dConvex2dAlgorithm));

-			return new(mem) btConvex2dConvex2dAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);

-		}

-	};

-

-

-};

-

-#endif //CONVEX_2D_CONVEX_2D_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btConvexConcaveCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,117 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef CONVEX_CONCAVE_COLLISION_ALGORITHM_H

-#define CONVEX_CONCAVE_COLLISION_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"

-#include "BulletCollision/CollisionShapes/btTriangleCallback.h"

-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"

-class btDispatcher;

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "btCollisionCreateFunc.h"

-

-///For each triangle in the concave mesh that overlaps with the AABB of a convex (m_convexProxy), processTriangle is called.

-class btConvexTriangleCallback : public btTriangleCallback

-{

-	btCollisionObject* m_convexBody;

-	btCollisionObject* m_triBody;

-

-	btVector3	m_aabbMin;

-	btVector3	m_aabbMax ;

-

-

-	btManifoldResult* m_resultOut;

-	btDispatcher*	m_dispatcher;

-	const btDispatcherInfo* m_dispatchInfoPtr;

-	btScalar m_collisionMarginTriangle;

-	

-public:

-int	m_triangleCount;

-	

-	btPersistentManifold*	m_manifoldPtr;

-

-	btConvexTriangleCallback(btDispatcher* dispatcher,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);

-

-	void	setTimeStepAndCounters(btScalar collisionMarginTriangle,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual ~btConvexTriangleCallback();

-

-	virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex);

-	

-	void clearCache();

-

-	SIMD_FORCE_INLINE const btVector3& getAabbMin() const

-	{

-		return m_aabbMin;

-	}

-	SIMD_FORCE_INLINE const btVector3& getAabbMax() const

-	{

-		return m_aabbMax;

-	}

-

-};

-

-

-

-

-/// btConvexConcaveCollisionAlgorithm  supports collision between convex shapes and (concave) trianges meshes.

-class btConvexConcaveCollisionAlgorithm  : public btActivatingCollisionAlgorithm

-{

-

-	bool	m_isSwapped;

-

-	btConvexTriangleCallback m_btConvexTriangleCallback;

-

-

-

-public:

-

-	btConvexConcaveCollisionAlgorithm( const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool isSwapped);

-

-	virtual ~btConvexConcaveCollisionAlgorithm();

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	btScalar	calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray);

-	

-	void	clearCache();

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm));

-			return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,false);

-		}

-	};

-

-	struct SwappedCreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConcaveCollisionAlgorithm));

-			return new(mem) btConvexConcaveCollisionAlgorithm(ci,body0,body1,true);

-		}

-	};

-

-};

-

-#endif //CONVEX_CONCAVE_COLLISION_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btConvexConvexAlgorithm.h.svn-base
+++ /dev/null
@@ -1,110 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef CONVEX_CONVEX_ALGORITHM_H

-#define CONVEX_CONVEX_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h"

-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.h"

-#include "btCollisionCreateFunc.h"

-#include "btCollisionDispatcher.h"

-#include "LinearMath/btTransformUtil.h" //for btConvexSeparatingDistanceUtil

-

-class btConvexPenetrationDepthSolver;

-

-///Enabling USE_SEPDISTANCE_UTIL2 requires 100% reliable distance computation. However, when using large size ratios GJK can be imprecise

-///so the distance is not conservative. In that case, enabling this USE_SEPDISTANCE_UTIL2 would result in failing/missing collisions.

-///Either improve GJK for large size ratios (testing a 100 units versus a 0.1 unit object) or only enable the util

-///for certain pairs that have a small size ratio

-

-//#define USE_SEPDISTANCE_UTIL2 1

-

-///The convexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations between two convex objects.

-///Multiple contact points are calculated by perturbing the orientation of the smallest object orthogonal to the separating normal.

-///This idea was described by Gino van den Bergen in this forum topic http://www.bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=4&t=288&p=888#p888

-class btConvexConvexAlgorithm : public btActivatingCollisionAlgorithm

-{

-#ifdef USE_SEPDISTANCE_UTIL2

-	btConvexSeparatingDistanceUtil	m_sepDistance;

-#endif

-	btSimplexSolverInterface*		m_simplexSolver;

-	btConvexPenetrationDepthSolver* m_pdSolver;

-

-	

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	bool			m_lowLevelOfDetail;

-	

-	int m_numPerturbationIterations;

-	int m_minimumPointsPerturbationThreshold;

-

-

-	///cache separating vector to speedup collision detection

-	

-

-public:

-

-	btConvexConvexAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1, btSimplexSolverInterface* simplexSolver, btConvexPenetrationDepthSolver* pdSolver, int numPerturbationIterations, int minimumPointsPerturbationThreshold);

-

-

-	virtual ~btConvexConvexAlgorithm();

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		///should we use m_ownManifold to avoid adding duplicates?

-		if (m_manifoldPtr && m_ownManifold)

-			manifoldArray.push_back(m_manifoldPtr);

-	}

-

-

-	void	setLowLevelOfDetail(bool useLowLevel);

-

-

-	const btPersistentManifold*	getManifold()

-	{

-		return m_manifoldPtr;

-	}

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-

-		btConvexPenetrationDepthSolver*		m_pdSolver;

-		btSimplexSolverInterface*			m_simplexSolver;

-		int m_numPerturbationIterations;

-		int m_minimumPointsPerturbationThreshold;

-

-		CreateFunc(btSimplexSolverInterface*			simplexSolver, btConvexPenetrationDepthSolver* pdSolver);

-		

-		virtual ~CreateFunc();

-

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexConvexAlgorithm));

-			return new(mem) btConvexConvexAlgorithm(ci.m_manifold,ci,body0,body1,m_simplexSolver,m_pdSolver,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);

-		}

-	};

-

-

-};

-

-#endif //CONVEX_CONVEX_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btConvexPlaneCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,85 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose,

-including commercial applications, and to alter it and redistribute it freely,

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef CONVEX_PLANE_COLLISION_ALGORITHM_H

-#define CONVEX_PLANE_COLLISION_ALGORITHM_H

-

-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-class btPersistentManifold;

-#include "btCollisionDispatcher.h"

-

-#include "LinearMath/btVector3.h"

-

-/// btSphereBoxCollisionAlgorithm  provides sphere-box collision detection.

-/// Other features are frame-coherency (persistent data) and collision response.

-class btConvexPlaneCollisionAlgorithm : public btCollisionAlgorithm

-{

-	bool		m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	bool		m_isSwapped;

-	int			m_numPerturbationIterations;

-	int			m_minimumPointsPerturbationThreshold;

-

-public:

-

-	btConvexPlaneCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped, int numPerturbationIterations,int minimumPointsPerturbationThreshold);

-

-	virtual ~btConvexPlaneCollisionAlgorithm();

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	void collideSingleContact (const btQuaternion& perturbeRot, btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		if (m_manifoldPtr && m_ownManifold)

-		{

-			manifoldArray.push_back(m_manifoldPtr);

-		}

-	}

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		int	m_numPerturbationIterations;

-		int m_minimumPointsPerturbationThreshold;

-			

-		CreateFunc() 

-			: m_numPerturbationIterations(1),

-			m_minimumPointsPerturbationThreshold(1)

-		{

-		}

-		

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btConvexPlaneCollisionAlgorithm));

-			if (!m_swapped)

-			{

-				return new(mem) btConvexPlaneCollisionAlgorithm(0,ci,body0,body1,false,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);

-			} else

-			{

-				return new(mem) btConvexPlaneCollisionAlgorithm(0,ci,body0,body1,true,m_numPerturbationIterations,m_minimumPointsPerturbationThreshold);

-			}

-		}

-	};

-

-};

-

-#endif //CONVEX_PLANE_COLLISION_ALGORITHM_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btDefaultCollisionConfiguration.h.svn-base
+++ /dev/null
@@ -1,136 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BT_DEFAULT_COLLISION_CONFIGURATION

-#define BT_DEFAULT_COLLISION_CONFIGURATION

-

-#include "btCollisionConfiguration.h"

-class btVoronoiSimplexSolver;

-class btConvexPenetrationDepthSolver;

-

-struct	btDefaultCollisionConstructionInfo

-{

-	btStackAlloc*		m_stackAlloc;

-	btPoolAllocator*	m_persistentManifoldPool;

-	btPoolAllocator*	m_collisionAlgorithmPool;

-	int					m_defaultMaxPersistentManifoldPoolSize;

-	int					m_defaultMaxCollisionAlgorithmPoolSize;

-	int					m_customCollisionAlgorithmMaxElementSize;

-	int					m_defaultStackAllocatorSize;

-	int					m_useEpaPenetrationAlgorithm;

-

-	btDefaultCollisionConstructionInfo()

-		:m_stackAlloc(0),

-		m_persistentManifoldPool(0),

-		m_collisionAlgorithmPool(0),

-		m_defaultMaxPersistentManifoldPoolSize(4096),

-		m_defaultMaxCollisionAlgorithmPoolSize(4096),

-		m_customCollisionAlgorithmMaxElementSize(0),

-		m_defaultStackAllocatorSize(0),

-		m_useEpaPenetrationAlgorithm(true)

-	{

-	}

-};

-

-

-

-///btCollisionConfiguration allows to configure Bullet collision detection

-///stack allocator, pool memory allocators

-///@todo: describe the meaning

-class	btDefaultCollisionConfiguration : public btCollisionConfiguration

-{

-

-protected:

-

-	int	m_persistentManifoldPoolSize;

-	

-	btStackAlloc*	m_stackAlloc;

-	bool	m_ownsStackAllocator;

-

-	btPoolAllocator*	m_persistentManifoldPool;

-	bool	m_ownsPersistentManifoldPool;

-

-

-	btPoolAllocator*	m_collisionAlgorithmPool;

-	bool	m_ownsCollisionAlgorithmPool;

-

-	//default simplex/penetration depth solvers

-	btVoronoiSimplexSolver*	m_simplexSolver;

-	btConvexPenetrationDepthSolver*	m_pdSolver;

-	

-	//default CreationFunctions, filling the m_doubleDispatch table

-	btCollisionAlgorithmCreateFunc*	m_convexConvexCreateFunc;

-	btCollisionAlgorithmCreateFunc*	m_convexConcaveCreateFunc;

-	btCollisionAlgorithmCreateFunc*	m_swappedConvexConcaveCreateFunc;

-	btCollisionAlgorithmCreateFunc*	m_compoundCreateFunc;

-	btCollisionAlgorithmCreateFunc*	m_swappedCompoundCreateFunc;

-	btCollisionAlgorithmCreateFunc* m_emptyCreateFunc;

-	btCollisionAlgorithmCreateFunc* m_sphereSphereCF;

-#ifdef USE_BUGGY_SPHERE_BOX_ALGORITHM

-	btCollisionAlgorithmCreateFunc* m_sphereBoxCF;

-	btCollisionAlgorithmCreateFunc* m_boxSphereCF;

-#endif //USE_BUGGY_SPHERE_BOX_ALGORITHM

-

-	btCollisionAlgorithmCreateFunc* m_boxBoxCF;

-	btCollisionAlgorithmCreateFunc*	m_sphereTriangleCF;

-	btCollisionAlgorithmCreateFunc*	m_triangleSphereCF;

-	btCollisionAlgorithmCreateFunc*	m_planeConvexCF;

-	btCollisionAlgorithmCreateFunc*	m_convexPlaneCF;

-	

-public:

-

-

-	btDefaultCollisionConfiguration(const btDefaultCollisionConstructionInfo& constructionInfo = btDefaultCollisionConstructionInfo());

-

-	virtual ~btDefaultCollisionConfiguration();

-

-		///memory pools

-	virtual btPoolAllocator* getPersistentManifoldPool()

-	{

-		return m_persistentManifoldPool;

-	}

-

-	virtual btPoolAllocator* getCollisionAlgorithmPool()

-	{

-		return m_collisionAlgorithmPool;

-	}

-

-	virtual btStackAlloc*	getStackAllocator()

-	{

-		return m_stackAlloc;

-	}

-

-	virtual	btVoronoiSimplexSolver*	getSimplexSolver()

-	{

-		return m_simplexSolver;

-	}

-

-

-	virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1);

-

-	///Use this method to allow to generate multiple contact points between at once, between two objects using the generic convex-convex algorithm.

-	///By default, this feature is disabled for best performance.

-	///@param numPerturbationIterations controls the number of collision queries. Set it to zero to disable the feature.

-	///@param minimumPointsPerturbationThreshold is the minimum number of points in the contact cache, above which the feature is disabled

-	///3 is a good value for both params, if you want to enable the feature. This is because the default contact cache contains a maximum of 4 points, and one collision query at the unperturbed orientation is performed first.

-	///See Bullet/Demos/CollisionDemo for an example how this feature gathers multiple points.

-	///@todo we could add a per-object setting of those parameters, for level-of-detail collision detection.

-	void	setConvexConvexMultipointIterations(int numPerturbationIterations=3, int minimumPointsPerturbationThreshold = 3);

-

-};

-

-#endif //BT_DEFAULT_COLLISION_CONFIGURATION

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btEmptyCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,55 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef EMPTY_ALGORITH

-#define EMPTY_ALGORITH

-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"

-#include "btCollisionCreateFunc.h"

-#include "btCollisionDispatcher.h"

-

-#define ATTRIBUTE_ALIGNED(a)

-

-///EmptyAlgorithm is a stub for unsupported collision pairs.

-///The dispatcher can dispatch a persistent btEmptyAlgorithm to avoid a search every frame.

-class btEmptyAlgorithm : public btCollisionAlgorithm

-{

-

-public:

-	

-	btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& ci);

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-	}

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			(void)body0;

-			(void)body1;

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btEmptyAlgorithm));

-			return new(mem) btEmptyAlgorithm(ci);

-		}

-	};

-

-} ATTRIBUTE_ALIGNED(16);

-

-#endif //EMPTY_ALGORITH

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btGhostObject.h.svn-base
+++ /dev/null
@@ -1,176 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BT_GHOST_OBJECT_H

-#define BT_GHOST_OBJECT_H

-

-

-#include "btCollisionObject.h"

-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h"

-#include "LinearMath/btAlignedAllocator.h"

-#include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"

-#include "btCollisionWorld.h"

-

-class btConvexShape;

-

-class btDispatcher;

-

-///The btGhostObject can keep track of all objects that are overlapping

-///By default, this overlap is based on the AABB

-///This is useful for creating a character controller, collision sensors/triggers, explosions etc.

-///We plan on adding rayTest and other queries for the btGhostObject

-ATTRIBUTE_ALIGNED16(class) btGhostObject : public btCollisionObject

-{

-protected:

-

-	btAlignedObjectArray<btCollisionObject*> m_overlappingObjects;

-

-public:

-

-	btGhostObject();

-

-	virtual ~btGhostObject();

-

-	void	convexSweepTest(const class btConvexShape* castShape, const btTransform& convexFromWorld, const btTransform& convexToWorld, btCollisionWorld::ConvexResultCallback& resultCallback, btScalar allowedCcdPenetration = 0.f) const;

-

-	void	rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, btCollisionWorld::RayResultCallback& resultCallback) const; 

-

-	///this method is mainly for expert/internal use only.

-	virtual void	addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy=0);

-	///this method is mainly for expert/internal use only.

-	virtual void	removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy=0);

-

-	int	getNumOverlappingObjects() const

-	{

-		return m_overlappingObjects.size();

-	}

-

-	btCollisionObject*	getOverlappingObject(int index)

-	{

-		return m_overlappingObjects[index];

-	}

-

-	const btCollisionObject*	getOverlappingObject(int index) const

-	{

-		return m_overlappingObjects[index];

-	}

-

-	btAlignedObjectArray<btCollisionObject*>&	getOverlappingPairs()

-	{

-		return m_overlappingObjects;

-	}

-

-	const btAlignedObjectArray<btCollisionObject*>	getOverlappingPairs() const

-	{

-		return m_overlappingObjects;

-	}

-

-	//

-	// internal cast

-	//

-

-	static const btGhostObject*	upcast(const btCollisionObject* colObj)

-	{

-		if (colObj->getInternalType()==CO_GHOST_OBJECT)

-			return (const btGhostObject*)colObj;

-		return 0;

-	}

-	static btGhostObject*			upcast(btCollisionObject* colObj)

-	{

-		if (colObj->getInternalType()==CO_GHOST_OBJECT)

-			return (btGhostObject*)colObj;

-		return 0;

-	}

-

-};

-

-class	btPairCachingGhostObject : public btGhostObject

-{

-	btHashedOverlappingPairCache*	m_hashPairCache;

-

-public:

-

-	btPairCachingGhostObject();

-

-	virtual ~btPairCachingGhostObject();

-

-	///this method is mainly for expert/internal use only.

-	virtual void	addOverlappingObjectInternal(btBroadphaseProxy* otherProxy, btBroadphaseProxy* thisProxy=0);

-

-	virtual void	removeOverlappingObjectInternal(btBroadphaseProxy* otherProxy,btDispatcher* dispatcher,btBroadphaseProxy* thisProxy=0);

-

-	btHashedOverlappingPairCache*	getOverlappingPairCache()

-	{

-		return m_hashPairCache;

-	}

-

-};

-

-

-

-///The btGhostPairCallback interfaces and forwards adding and removal of overlapping pairs from the btBroadphaseInterface to btGhostObject.

-class btGhostPairCallback : public btOverlappingPairCallback

-{

-	

-public:

-	btGhostPairCallback()

-	{

-	}

-

-	virtual ~btGhostPairCallback()

-	{

-		

-	}

-

-	virtual btBroadphasePair*	addOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1)

-	{

-		btCollisionObject* colObj0 = (btCollisionObject*) proxy0->m_clientObject;

-		btCollisionObject* colObj1 = (btCollisionObject*) proxy1->m_clientObject;

-		btGhostObject* ghost0 = 		btGhostObject::upcast(colObj0);

-		btGhostObject* ghost1 = 		btGhostObject::upcast(colObj1);

-		if (ghost0)

-			ghost0->addOverlappingObjectInternal(proxy1, proxy0);

-		if (ghost1)

-			ghost1->addOverlappingObjectInternal(proxy0, proxy1);

-		return 0;

-	}

-

-	virtual void*	removeOverlappingPair(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1,btDispatcher* dispatcher)

-	{

-		btCollisionObject* colObj0 = (btCollisionObject*) proxy0->m_clientObject;

-		btCollisionObject* colObj1 = (btCollisionObject*) proxy1->m_clientObject;

-		btGhostObject* ghost0 = 		btGhostObject::upcast(colObj0);

-		btGhostObject* ghost1 = 		btGhostObject::upcast(colObj1);

-		if (ghost0)

-			ghost0->removeOverlappingObjectInternal(proxy1,dispatcher,proxy0);

-		if (ghost1)

-			ghost1->removeOverlappingObjectInternal(proxy0,dispatcher,proxy1);

-		return 0;

-	}

-

-	virtual void	removeOverlappingPairsContainingProxy(btBroadphaseProxy* /*proxy0*/,btDispatcher* /*dispatcher*/)

-	{

-		btAssert(0);

-		//need to keep track of all ghost objects and call them here

-		//m_hashPairCache->removeOverlappingPairsContainingProxy(proxy0,dispatcher);

-	}

-

-	

-

-};

-

-#endif

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btInternalEdgeUtility.h.svn-base
+++ /dev/null
@@ -1,47 +1,1 @@
-

-#ifndef BT_INTERNAL_EDGE_UTILITY_H

-#define BT_INTERNAL_EDGE_UTILITY_H

-

-#include "LinearMath/btHashMap.h"

-#include "LinearMath/btVector3.h"

-

-#include "BulletCollision/CollisionShapes/btTriangleInfoMap.h"

-

-///The btInternalEdgeUtility helps to avoid or reduce artifacts due to wrong collision normals caused by internal edges.

-///See also http://code.google.com/p/bullet/issues/detail?id=27

-

-class btBvhTriangleMeshShape;

-class btCollisionObject;

-class btManifoldPoint;

-class btIDebugDraw;

-

-

-

-enum btInternalEdgeAdjustFlags

-{

-	BT_TRIANGLE_CONVEX_BACKFACE_MODE = 1,

-	BT_TRIANGLE_CONCAVE_DOUBLE_SIDED = 2, //double sided options are experimental, single sided is recommended

-	BT_TRIANGLE_CONVEX_DOUBLE_SIDED = 4

-};

-

-

-///Call btGenerateInternalEdgeInfo to create triangle info, store in the shape 'userInfo'

-void	btGenerateInternalEdgeInfo (btBvhTriangleMeshShape*trimeshShape, btTriangleInfoMap* triangleInfoMap);

-

-

-///Call the btFixMeshNormal to adjust the collision normal, using the triangle info map (generated using btGenerateInternalEdgeInfo)

-///If this info map is missing, or the triangle is not store in this map, nothing will be done

-void	btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject* trimeshColObj0,const btCollisionObject* otherColObj1, int partId0, int index0, int normalAdjustFlags = 0);

-

-///Enable the BT_INTERNAL_EDGE_DEBUG_DRAW define and call btSetDebugDrawer, to get visual info to see if the internal edge utility works properly.

-///If the utility doesn't work properly, you might have to adjust the threshold values in btTriangleInfoMap

-//#define BT_INTERNAL_EDGE_DEBUG_DRAW

-

-#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW

-void	btSetDebugDrawer(btIDebugDraw* debugDrawer);

-#endif //BT_INTERNAL_EDGE_DEBUG_DRAW

-

-

-#endif //BT_INTERNAL_EDGE_UTILITY_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btManifoldResult.h.svn-base
+++ /dev/null
@@ -1,129 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-

-#ifndef MANIFOLD_RESULT_H

-#define MANIFOLD_RESULT_H

-

-class btCollisionObject;

-#include "BulletCollision/NarrowPhaseCollision/btPersistentManifold.h"

-class btManifoldPoint;

-

-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"

-

-#include "LinearMath/btTransform.h"

-

-typedef bool (*ContactAddedCallback)(btManifoldPoint& cp,	const btCollisionObject* colObj0,int partId0,int index0,const btCollisionObject* colObj1,int partId1,int index1);

-extern ContactAddedCallback		gContactAddedCallback;

-

-//#define DEBUG_PART_INDEX 1

-

-

-///btManifoldResult is a helper class to manage  contact results.

-class btManifoldResult : public btDiscreteCollisionDetectorInterface::Result

-{

-protected:

-

-	btPersistentManifold* m_manifoldPtr;

-

-	//we need this for compounds

-	btTransform	m_rootTransA;

-	btTransform	m_rootTransB;

-

-	btCollisionObject* m_body0;

-	btCollisionObject* m_body1;

-	int	m_partId0;

-	int m_partId1;

-	int m_index0;

-	int m_index1;

-	

-

-public:

-

-	btManifoldResult()

-#ifdef DEBUG_PART_INDEX

-		:

-	m_partId0(-1),

-	m_partId1(-1),

-	m_index0(-1),

-	m_index1(-1)

-#endif //DEBUG_PART_INDEX

-	{

-	}

-

-	btManifoldResult(btCollisionObject* body0,btCollisionObject* body1);

-

-	virtual ~btManifoldResult() {};

-

-	void	setPersistentManifold(btPersistentManifold* manifoldPtr)

-	{

-		m_manifoldPtr = manifoldPtr;

-	}

-

-	const btPersistentManifold*	getPersistentManifold() const

-	{

-		return m_manifoldPtr;

-	}

-	btPersistentManifold*	getPersistentManifold()

-	{

-		return m_manifoldPtr;

-	}

-

-	virtual void setShapeIdentifiersA(int partId0,int index0)

-	{

-		m_partId0=partId0;

-		m_index0=index0;

-	}

-

-	virtual void setShapeIdentifiersB(	int partId1,int index1)

-	{

-		m_partId1=partId1;

-		m_index1=index1;

-	}

-

-

-	virtual void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth);

-

-	SIMD_FORCE_INLINE	void refreshContactPoints()

-	{

-		btAssert(m_manifoldPtr);

-		if (!m_manifoldPtr->getNumContacts())

-			return;

-

-		bool isSwapped = m_manifoldPtr->getBody0() != m_body0;

-

-		if (isSwapped)

-		{

-			m_manifoldPtr->refreshContactPoints(m_rootTransB,m_rootTransA);

-		} else

-		{

-			m_manifoldPtr->refreshContactPoints(m_rootTransA,m_rootTransB);

-		}

-	}

-

-	const btCollisionObject* getBody0Internal() const

-	{

-		return m_body0;

-	}

-

-	const btCollisionObject* getBody1Internal() const

-	{

-		return m_body1;

-	}

-	

-};

-

-#endif //MANIFOLD_RESULT_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btSimulationIslandManager.h.svn-base
+++ /dev/null
@@ -1,82 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SIMULATION_ISLAND_MANAGER_H

-#define SIMULATION_ISLAND_MANAGER_H

-

-#include "BulletCollision/CollisionDispatch/btUnionFind.h"

-#include "btCollisionCreateFunc.h"

-#include "LinearMath/btAlignedObjectArray.h"

-#include "btCollisionObject.h"

-

-class btCollisionObject;

-class btCollisionWorld;

-class btDispatcher;

-class btPersistentManifold;

-

-

-///SimulationIslandManager creates and handles simulation islands, using btUnionFind

-class btSimulationIslandManager

-{

-	btUnionFind m_unionFind;

-

-	btAlignedObjectArray<btPersistentManifold*>  m_islandmanifold;

-	btAlignedObjectArray<btCollisionObject* >  m_islandBodies;

-	

-	bool m_splitIslands;

-	

-public:

-	btSimulationIslandManager();

-	virtual ~btSimulationIslandManager();

-

-

-	void initUnionFind(int n);	

-	

-		

-	btUnionFind& getUnionFind() { return m_unionFind;}

-

-	virtual	void	updateActivationState(btCollisionWorld* colWorld,btDispatcher* dispatcher);

-	virtual	void	storeIslandActivationState(btCollisionWorld* world);

-

-

-	void	findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld);

-

-	

-

-	struct	IslandCallback

-	{

-		virtual ~IslandCallback() {};

-

-		virtual	void	ProcessIsland(btCollisionObject** bodies,int numBodies,class btPersistentManifold**	manifolds,int numManifolds, int islandId) = 0;

-	};

-

-	void	buildAndProcessIslands(btDispatcher* dispatcher,btCollisionWorld* collisionWorld, IslandCallback* callback);

-

-	void buildIslands(btDispatcher* dispatcher,btCollisionWorld* colWorld);

-

-	bool getSplitIslands()

-	{

-		return m_splitIslands;

-	}

-	void setSplitIslands(bool doSplitIslands)

-	{

-		m_splitIslands = doSplitIslands;

-	}

-

-};

-

-#endif //SIMULATION_ISLAND_MANAGER_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btSphereBoxCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,76 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SPHERE_BOX_COLLISION_ALGORITHM_H

-#define SPHERE_BOX_COLLISION_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-class btPersistentManifold;

-#include "btCollisionDispatcher.h"

-

-#include "LinearMath/btVector3.h"

-

-/// btSphereBoxCollisionAlgorithm  provides sphere-box collision detection.

-/// Other features are frame-coherency (persistent data) and collision response.

-class btSphereBoxCollisionAlgorithm : public btActivatingCollisionAlgorithm

-{

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	bool	m_isSwapped;

-	

-public:

-

-	btSphereBoxCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* col0,btCollisionObject* col1, bool isSwapped);

-

-	virtual ~btSphereBoxCollisionAlgorithm();

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		if (m_manifoldPtr && m_ownManifold)

-		{

-			manifoldArray.push_back(m_manifoldPtr);

-		}

-	}

-

-	btScalar getSphereDistance( btCollisionObject* boxObj,btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius );

-

-	btScalar getSpherePenetration( btCollisionObject* boxObj, btVector3& v3PointOnBox, btVector3& v3PointOnSphere, const btVector3& v3SphereCenter, btScalar fRadius, const btVector3& aabbMin, const btVector3& aabbMax);

-	

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereBoxCollisionAlgorithm));

-			if (!m_swapped)

-			{

-				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,false);

-			} else

-			{

-				return new(mem) btSphereBoxCollisionAlgorithm(0,ci,body0,body1,true);

-			}

-		}

-	};

-

-};

-

-#endif //SPHERE_BOX_COLLISION_ALGORITHM_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btSphereSphereCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,67 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SPHERE_SPHERE_COLLISION_ALGORITHM_H

-#define SPHERE_SPHERE_COLLISION_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-#include "btCollisionDispatcher.h"

-

-class btPersistentManifold;

-

-/// btSphereSphereCollisionAlgorithm  provides sphere-sphere collision detection.

-/// Other features are frame-coherency (persistent data) and collision response.

-/// Also provides the most basic sample for custom/user btCollisionAlgorithm

-class btSphereSphereCollisionAlgorithm : public btActivatingCollisionAlgorithm

-{

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	

-public:

-	btSphereSphereCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1);

-

-	btSphereSphereCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)

-		: btActivatingCollisionAlgorithm(ci) {}

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		if (m_manifoldPtr && m_ownManifold)

-		{

-			manifoldArray.push_back(m_manifoldPtr);

-		}

-	}

-	

-	virtual ~btSphereSphereCollisionAlgorithm();

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereSphereCollisionAlgorithm));

-			return new(mem) btSphereSphereCollisionAlgorithm(0,ci,body0,body1);

-		}

-	};

-

-};

-

-#endif //SPHERE_SPHERE_COLLISION_ALGORITHM_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btSphereTriangleCollisionAlgorithm.h.svn-base
+++ /dev/null
@@ -1,70 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SPHERE_TRIANGLE_COLLISION_ALGORITHM_H

-#define SPHERE_TRIANGLE_COLLISION_ALGORITHM_H

-

-#include "btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-class btPersistentManifold;

-#include "btCollisionDispatcher.h"

-

-/// btSphereSphereCollisionAlgorithm  provides sphere-sphere collision detection.

-/// Other features are frame-coherency (persistent data) and collision response.

-/// Also provides the most basic sample for custom/user btCollisionAlgorithm

-class btSphereTriangleCollisionAlgorithm : public btActivatingCollisionAlgorithm

-{

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	bool	m_swapped;

-	

-public:

-	btSphereTriangleCollisionAlgorithm(btPersistentManifold* mf,const btCollisionAlgorithmConstructionInfo& ci,btCollisionObject* body0,btCollisionObject* body1,bool swapped);

-

-	btSphereTriangleCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)

-		: btActivatingCollisionAlgorithm(ci) {}

-

-	virtual void processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut);

-

-	virtual	void	getAllContactManifolds(btManifoldArray&	manifoldArray)

-	{

-		if (m_manifoldPtr && m_ownManifold)

-		{

-			manifoldArray.push_back(m_manifoldPtr);

-		}

-	}

-	

-	virtual ~btSphereTriangleCollisionAlgorithm();

-

-	struct CreateFunc :public 	btCollisionAlgorithmCreateFunc

-	{

-		

-		virtual	btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)

-		{

-			

-			void* mem = ci.m_dispatcher1->allocateCollisionAlgorithm(sizeof(btSphereTriangleCollisionAlgorithm));

-

-			return new(mem) btSphereTriangleCollisionAlgorithm(ci.m_manifold,ci,body0,body1,m_swapped);

-		}

-	};

-

-};

-

-#endif //SPHERE_TRIANGLE_COLLISION_ALGORITHM_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/.svn/text-base/btUnionFind.h.svn-base
+++ /dev/null
@@ -1,130 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef UNION_FIND_H

-#define UNION_FIND_H

-

-#include "LinearMath/btAlignedObjectArray.h"

-

-#define USE_PATH_COMPRESSION 1

-

-///see for discussion of static island optimizations by Vroonsh here: http://code.google.com/p/bullet/issues/detail?id=406

-#define STATIC_SIMULATION_ISLAND_OPTIMIZATION 1

-

-struct	btElement

-{

-	int	m_id;

-	int	m_sz;

-};

-

-///UnionFind calculates connected subsets

-// Implements weighted Quick Union with path compression

-// optimization: could use short ints instead of ints (halving memory, would limit the number of rigid bodies to 64k, sounds reasonable)

-class btUnionFind

-  {

-    private:

-		btAlignedObjectArray<btElement>	m_elements;

-

-    public:

-	  

-		btUnionFind();

-		~btUnionFind();

-

-	

-		//this is a special operation, destroying the content of btUnionFind.

-		//it sorts the elements, based on island id, in order to make it easy to iterate over islands

-		void	sortIslands();

-

-	  void	reset(int N);

-

-	  SIMD_FORCE_INLINE int	getNumElements() const

-	  {

-		  return int(m_elements.size());

-	  }

-	  SIMD_FORCE_INLINE bool  isRoot(int x) const

-	  {

-		  return (x == m_elements[x].m_id);

-	  }

-

-	  btElement&	getElement(int index)

-	  {

-		  return m_elements[index];

-	  }

-	  const btElement& getElement(int index) const

-	  {

-		  return m_elements[index];

-	  }

-   

-	  void	allocate(int N);

-	  void	Free();

-

-

-

-

-	  int find(int p, int q)

-		{ 

-			return (find(p) == find(q)); 

-		}

-

-		void unite(int p, int q)

-		{

-			int i = find(p), j = find(q);

-			if (i == j) 

-				return;

-

-#ifndef USE_PATH_COMPRESSION

-			//weighted quick union, this keeps the 'trees' balanced, and keeps performance of unite O( log(n) )

-			if (m_elements[i].m_sz < m_elements[j].m_sz)

-			{ 

-				m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; 

-			}

-			else 

-			{ 

-				m_elements[j].m_id = i; m_elements[i].m_sz += m_elements[j].m_sz; 

-			}

-#else

-			m_elements[i].m_id = j; m_elements[j].m_sz += m_elements[i].m_sz; 

-#endif //USE_PATH_COMPRESSION

-		}

-

-		int find(int x)

-		{ 

-			//btAssert(x < m_N);

-			//btAssert(x >= 0);

-

-			while (x != m_elements[x].m_id) 

-			{

-		//not really a reason not to use path compression, and it flattens the trees/improves find performance dramatically

-	

-		#ifdef USE_PATH_COMPRESSION

-				const btElement* elementPtr = &m_elements[m_elements[x].m_id];

-				m_elements[x].m_id = elementPtr->m_id;

-				x = elementPtr->m_id;			

-		#else//

-				x = m_elements[x].m_id;

-		#endif		

-				//btAssert(x < m_N);

-				//btAssert(x >= 0);

-

-			}

-			return x; 

-		}

-

-

-  };

-

-

-#endif //UNION_FIND_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
+++ /dev/null
@@ -1,52 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef SPHERE_TRIANGLE_DETECTOR_H

-#define SPHERE_TRIANGLE_DETECTOR_H

-

-#include "BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h"

-

-

-

-class btSphereShape;

-class btTriangleShape;

-

-

-

-/// sphere-triangle to match the btDiscreteCollisionDetectorInterface

-struct SphereTriangleDetector : public btDiscreteCollisionDetectorInterface

-{

-	virtual void	getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw,bool swapResults=false);

-

-	SphereTriangleDetector(btSphereShape* sphere,btTriangleShape* triangle, btScalar contactBreakingThreshold);

-

-	virtual ~SphereTriangleDetector() {};

-

-	bool collide(const btVector3& sphereCenter,btVector3 &point, btVector3& resultNormal, btScalar& depth, btScalar &timeOfImpact, btScalar	contactBreakingThreshold);

-

-private:

-

-	

-	bool pointInTriangle(const btVector3 vertices[], const btVector3 &normal, btVector3 *p );

-	bool facecontains(const btVector3 &p,const btVector3* vertices,btVector3& normal);

-

-	btSphereShape* m_sphere;

-	btTriangleShape* m_triangle;

-	btScalar	m_contactBreakingThreshold;

-	

-};

-#endif //SPHERE_TRIANGLE_DETECTOR_H

-

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h
+++ /dev/null
@@ -1,37 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2008 Erwin Coumans  http://bulletphysics.com

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef __BT_ACTIVATING_COLLISION_ALGORITHM_H

-#define __BT_ACTIVATING_COLLISION_ALGORITHM_H

-

-#include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"

-

-///This class is not enabled yet (work-in-progress) to more aggressively activate objects.

-class btActivatingCollisionAlgorithm : public btCollisionAlgorithm

-{

-//	btCollisionObject* m_colObj0;

-//	btCollisionObject* m_colObj1;

-

-public:

-

-	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci);

-

-	btActivatingCollisionAlgorithm (const btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* colObj0,btCollisionObject* colObj1);

-

-	virtual ~btActivatingCollisionAlgorithm();

-

-};

-#endif //__BT_ACTIVATING_COLLISION_ALGORITHM_H

 

--- a/source/bheaders/Bullet/BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
+++ /dev/null
@@ -1,67 +1,1 @@
-/*

-Bullet Continuous Collision Detection and Physics Library

-Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/

-

-This software is provided 'as-is', without any express or implied warranty.

-In no event will the authors be held liable for any damages arising from the use of this software.

-Permission is granted to anyone to use this software for any purpose, 

-including commercial applications, and to alter it and redistribute it freely, 

-subject to the following restrictions:

-

-1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

-2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

-3. This notice may not be removed or altered from any source distribution.

-*/

-

-#ifndef BOX_2D_BOX_2D__COLLISION_ALGORITHM_H

-#define BOX_2D_BOX_2D__COLLISION_ALGORITHM_H

-

-#include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"

-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h"

-#include "BulletCollision/BroadphaseCollision/btDispatcher.h"

-#include "BulletCollision/CollisionDispatch/btCollisionCreateFunc.h"

-

-class btPersistentManifold;

-

-///box-box collision detection

-class btBox2dBox2dCollisionAlgorithm : public btActivatingCollisionAlgorithm

-{

-	bool	m_ownManifold;

-	btPersistentManifold*	m_manifoldPtr;

-	

-public:

-	btBox2dBo