Merge from trunk
authorAndre Susano Pinto <andresusanopinto@gmail.com>
Fri, 19 Sep 2008 14:15:36 +0000 (14:15 +0000)
committerAndre Susano Pinto <andresusanopinto@gmail.com>
Fri, 19 Sep 2008 14:15:36 +0000 (14:15 +0000)
(The last time there was some files missing due to failed connection to svn server while merging.. thats why this stuff of reverting last merge and redoing it)

svn merge -r 16231:16608 https://svn.blender.org/svnroot/bf-blender/trunk/blender

777 files changed:
CMake/macros.cmake
CMakeLists.txt
SConstruct
blenderplayer/CMakeLists.txt
config/darwin-config.py
config/linux2-config.py
config/linuxcross-config.py
config/openbsd3-config.py
config/sunos5-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
extern/bullet2/CMakeLists.txt
extern/bullet2/Makefile
extern/bullet2/make/msvc_7_0/Bullet_vc7.vcproj
extern/bullet2/readme.txt
extern/bullet2/src/Bullet-C-Api.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btAxisSweep3.cpp
extern/bullet2/src/BulletCollision/BroadphaseCollision/btAxisSweep3.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseInterface.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btDispatcher.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btMultiSapBroadphase.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.h
extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCallback.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp
extern/bullet2/src/BulletCollision/BroadphaseCollision/btSimpleBroadphase.h
extern/bullet2/src/BulletCollision/CMakeLists.txt
extern/bullet2/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/SphereTriangleDetector.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btBoxBoxDetector.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionConfiguration.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionCreateFunc.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionDispatcher.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btManifoldResult.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btManifoldResult.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btSimulationIslandManager.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h
extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btUnionFind.h
extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btBoxShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btCapsuleShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btConcaveShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btConeShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexInternalShape.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexTriangleMeshShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btEmptyShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btEmptyShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btMaterial.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btMinkowskiSumShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btOptimizedBvh.h
extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btShapeHull.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btShapeHull.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btSphereShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btSphereShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btStaticPlaneShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btStaticPlaneShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btStridingMeshInterface.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btStridingMeshInterface.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTetrahedronShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleBuffer.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleBuffer.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleCallback.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleIndexVertexArray.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleMesh.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleMesh.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleMeshShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleMeshShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btTriangleShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btUniformScalingShape.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/CollisionShapes/btUniformScalingShape.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btConvexCast.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btConvexPenetrationDepthSolver.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btDiscreteCollisionDetectorInterface.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkConvexCast.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkEpa.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp [new file with mode: 0644]
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkEpa2.h [new file with mode: 0644]
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btSimplexSolverInterface.h
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp
extern/bullet2/src/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
extern/bullet2/src/BulletDynamics/CMakeLists.txt
extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btConeTwistConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btContactConstraint.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btContactConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btContactSolverInfo.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btHingeConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btJacobianEntry.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.cpp [new file with mode: 0644]
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSliderConstraint.h [new file with mode: 0644]
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverBody.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSolverConstraint.h
extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.cpp
extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h
extern/bullet2/src/BulletDynamics/Dynamics/Bullet-C-API.cpp
extern/bullet2/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.cpp [new file with mode: 0644]
extern/bullet2/src/BulletDynamics/Dynamics/btContinuousDynamicsWorld.h [new file with mode: 0644]
extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
extern/bullet2/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h
extern/bullet2/src/BulletDynamics/Dynamics/btDynamicsWorld.h
extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.cpp
extern/bullet2/src/BulletDynamics/Dynamics/btRigidBody.h
extern/bullet2/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp
extern/bullet2/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.h
extern/bullet2/src/BulletDynamics/Vehicle/btRaycastVehicle.cpp
extern/bullet2/src/BulletDynamics/Vehicle/btRaycastVehicle.h
extern/bullet2/src/BulletDynamics/Vehicle/btVehicleRaycaster.h
extern/bullet2/src/BulletDynamics/Vehicle/btWheelInfo.h
extern/bullet2/src/BulletSoftBody/CMakeLists.txt [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBody.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBody.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftRigidDynamicsWorld.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSoftSoftCollisionAlgorithm.h [new file with mode: 0644]
extern/bullet2/src/BulletSoftBody/btSparseSDF.h [new file with mode: 0644]
extern/bullet2/src/CMakeLists.txt
extern/bullet2/src/LinearMath/CMakeLists.txt
extern/bullet2/src/LinearMath/btAabbUtil2.h
extern/bullet2/src/LinearMath/btAlignedAllocator.cpp
extern/bullet2/src/LinearMath/btAlignedAllocator.h
extern/bullet2/src/LinearMath/btAlignedObjectArray.h
extern/bullet2/src/LinearMath/btConvexHull.cpp [new file with mode: 0644]
extern/bullet2/src/LinearMath/btConvexHull.h [new file with mode: 0644]
extern/bullet2/src/LinearMath/btDefaultMotionState.h
extern/bullet2/src/LinearMath/btGeometryUtil.cpp
extern/bullet2/src/LinearMath/btGeometryUtil.h
extern/bullet2/src/LinearMath/btHashMap.h [new file with mode: 0644]
extern/bullet2/src/LinearMath/btIDebugDraw.h
extern/bullet2/src/LinearMath/btMatrix3x3.h
extern/bullet2/src/LinearMath/btMinMax.h
extern/bullet2/src/LinearMath/btMotionState.h
extern/bullet2/src/LinearMath/btPoolAllocator.h [new file with mode: 0644]
extern/bullet2/src/LinearMath/btQuadWord.h
extern/bullet2/src/LinearMath/btQuaternion.h
extern/bullet2/src/LinearMath/btQuickprof.cpp
extern/bullet2/src/LinearMath/btQuickprof.h
extern/bullet2/src/LinearMath/btScalar.h
extern/bullet2/src/LinearMath/btStackAlloc.h
extern/bullet2/src/LinearMath/btTransform.h
extern/bullet2/src/LinearMath/btTransformUtil.h
extern/bullet2/src/LinearMath/btVector3.h
extern/bullet2/src/Makefile
extern/bullet2/src/SConscript
extern/bullet2/src/btBulletCollisionCommon.h
extern/bullet2/src/btBulletDynamicsCommon.h
extern/glew/SConscript
extern/glew/include/GL/glew.h
extern/glew/src/glew.c
intern/SoundSystem/SoundDefines.h
intern/SoundSystem/openal/SND_OpenALDevice.cpp
intern/ghost/GHOST_ISystem.h
intern/ghost/GHOST_Types.h
intern/ghost/intern/GHOST_SystemCarbon.cpp
intern/ghost/intern/GHOST_SystemCarbon.h
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemWin32.h
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
intern/ghost/intern/GHOST_WindowWin32.cpp
intern/ghost/intern/GHOST_WindowX11.cpp
intern/ghost/intern/GHOST_WindowX11.h
intern/guardedalloc/MEM_guardedalloc.h
intern/guardedalloc/intern/mallocn.c
intern/iksolver/CMakeLists.txt
intern/iksolver/SConscript
intern/memutil/MEM_Allocator.h
intern/memutil/MEM_CacheLimiter.h
intern/memutil/intern/MEM_CacheLimiterC-Api.cpp
intern/moto/include/GEN_Map.h
intern/moto/include/MT_Matrix4x4.h
intern/moto/include/MT_Matrix4x4.inl
intern/opennl/superlu/BLO_sys_types.h
projectfiles_vc7/blender/BPY_python/BPY_python.vcproj
projectfiles_vc7/blender/blender.sln
projectfiles_vc7/blender/blender.vcproj
projectfiles_vc7/blender/blenkernel/BKE_blenkernel.vcproj
projectfiles_vc7/blender/gpu/BL_gpu.vcproj [new file with mode: 0644]
projectfiles_vc7/blender/nodes/nodes.vcproj
projectfiles_vc7/blender/radiosity/BRA_radiosity.vcproj
projectfiles_vc7/blender/src/BL_src.vcproj
projectfiles_vc7/gameengine/blenderhook/KX_blenderhook.vcproj
projectfiles_vc7/gameengine/converter/KX_converter.vcproj
projectfiles_vc7/gameengine/expression/EXP_expressions.vcproj
projectfiles_vc7/gameengine/gamelogic/SCA_GameLogic.vcproj
projectfiles_vc7/gameengine/gameplayer/ghost/GP_ghost.vcproj
projectfiles_vc7/gameengine/ketsji/KX_ketsji.vcproj
projectfiles_vc7/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj
projectfiles_vc7/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj
release/datafiles/blenderbuttons
release/scripts/bpymodules/BPyTextPlugin.py [new file with mode: 0644]
release/scripts/export_obj.py
release/scripts/import_obj.py
release/scripts/mesh_cleanup.py
release/scripts/object_find.py
release/scripts/scripttemplate_gamelogic.py [new file with mode: 0644]
release/scripts/scripttemplate_gamelogic_basic.py [new file with mode: 0644]
release/scripts/scripttemplate_text_plugin.py [new file with mode: 0644]
release/scripts/sysinfo.py
release/scripts/textplugin_functiondocs.py [new file with mode: 0644]
release/scripts/textplugin_imports.py [new file with mode: 0644]
release/scripts/textplugin_membersuggest.py [new file with mode: 0644]
release/scripts/textplugin_outliner.py [new file with mode: 0644]
release/scripts/textplugin_suggest.py [new file with mode: 0644]
release/scripts/textplugin_templates.py [new file with mode: 0644]
source/Makefile
source/blender/CMakeLists.txt
source/blender/Makefile
source/blender/SConscript
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/BKE_action.h
source/blender/blenkernel/BKE_bad_level_calls.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/BKE_global.h
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_suggestions.h [new file with mode: 0644]
source/blender/blenkernel/BKE_text.h
source/blender/blenkernel/BKE_texture.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/bad_level_call_stubs/stubs.c
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/Makefile
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/blender.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/exotic.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/suggestions.c [new file with mode: 0644]
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/BLI_kdopbvh.h
source/blender/blenlib/SConscript
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/util.c
source/blender/blenloader/BLO_readfile.h
source/blender/blenloader/BLO_sys_types.h
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/gpu/CMakeLists.txt [new file with mode: 0644]
source/blender/gpu/GPU_draw.h [new file with mode: 0644]
source/blender/gpu/GPU_extensions.h [new file with mode: 0644]
source/blender/gpu/GPU_material.h [new file with mode: 0644]
source/blender/gpu/Makefile [new file with mode: 0644]
source/blender/gpu/SConscript [new file with mode: 0644]
source/blender/gpu/intern/Makefile [new file with mode: 0644]
source/blender/gpu/intern/gpu_codegen.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_codegen.h [new file with mode: 0644]
source/blender/gpu/intern/gpu_draw.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_extensions.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_material.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_shader_material.glsl [new file with mode: 0644]
source/blender/gpu/intern/gpu_shader_material.glsl.c [new file with mode: 0644]
source/blender/gpu/intern/gpu_shader_vertex.glsl [new file with mode: 0644]
source/blender/gpu/intern/gpu_shader_vertex.glsl.c [new file with mode: 0644]
source/blender/imbuf/intern/bmp.c
source/blender/imbuf/intern/dds/ColorBlock.cpp
source/blender/imbuf/intern/dds/ColorBlock.h
source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
source/blender/imbuf/intern/dds/DirectDrawSurface.h
source/blender/imbuf/intern/dds/dds_api.cpp
source/blender/include/BDR_drawmesh.h
source/blender/include/BDR_drawobject.h
source/blender/include/BDR_gpencil.h
source/blender/include/BDR_imagepaint.h
source/blender/include/BIF_drawseq.h
source/blender/include/BIF_drawtext.h
source/blender/include/BIF_editaction.h
source/blender/include/BIF_editarmature.h
source/blender/include/BIF_editview.h
source/blender/include/BIF_gl.h
source/blender/include/BIF_glutil.h
source/blender/include/BIF_keyframing.h [new file with mode: 0644]
source/blender/include/BIF_keyval.h
source/blender/include/BIF_meshlaplacian.h
source/blender/include/BIF_meshtools.h
source/blender/include/BIF_resources.h
source/blender/include/BIF_space.h
source/blender/include/BSE_drawipo.h
source/blender/include/BSE_drawview.h
source/blender/include/BSE_editipo.h
source/blender/include/blendef.h
source/blender/include/transform.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_actuator_types.h
source/blender/makesdna/DNA_brush_types.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesdna/DNA_group_types.h
source/blender/makesdna/DNA_image_types.h
source/blender/makesdna/DNA_ipo_types.h
source/blender/makesdna/DNA_lamp_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_particle_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_sensor_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_text_types.h
source/blender/makesdna/DNA_texture_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesdna/DNA_world_types.h
source/blender/nodes/CMakeLists.txt
source/blender/nodes/SConscript
source/blender/nodes/intern/CMP_nodes/CMP_tonemap.c
source/blender/nodes/intern/CMP_nodes/Makefile
source/blender/nodes/intern/Makefile
source/blender/nodes/intern/SHD_nodes/Makefile
source/blender/nodes/intern/SHD_nodes/SHD_camera.c
source/blender/nodes/intern/SHD_nodes/SHD_curves.c
source/blender/nodes/intern/SHD_nodes/SHD_geom.c
source/blender/nodes/intern/SHD_nodes/SHD_hueSatVal.c
source/blender/nodes/intern/SHD_nodes/SHD_invert.c
source/blender/nodes/intern/SHD_nodes/SHD_mapping.c
source/blender/nodes/intern/SHD_nodes/SHD_material.c
source/blender/nodes/intern/SHD_nodes/SHD_math.c
source/blender/nodes/intern/SHD_nodes/SHD_mixRgb.c
source/blender/nodes/intern/SHD_nodes/SHD_normal.c
source/blender/nodes/intern/SHD_nodes/SHD_output.c
source/blender/nodes/intern/SHD_nodes/SHD_rgb.c
source/blender/nodes/intern/SHD_nodes/SHD_sepcombRGB.c
source/blender/nodes/intern/SHD_nodes/SHD_squeeze.c
source/blender/nodes/intern/SHD_nodes/SHD_texture.c
source/blender/nodes/intern/SHD_nodes/SHD_valToRgb.c
source/blender/nodes/intern/SHD_nodes/SHD_value.c
source/blender/nodes/intern/SHD_nodes/SHD_vectMath.c
source/blender/nodes/intern/SHD_util.h
source/blender/python/BPY_extern.h
source/blender/python/BPY_interface.c
source/blender/python/BPY_menus.c
source/blender/python/BPY_menus.h
source/blender/python/CMakeLists.txt
source/blender/python/SConscript
source/blender/python/api2_2x/BGL.h
source/blender/python/api2_2x/Blender.c
source/blender/python/api2_2x/Camera.c
source/blender/python/api2_2x/Constraint.c
source/blender/python/api2_2x/Draw.c
source/blender/python/api2_2x/Group.c
source/blender/python/api2_2x/Image.c
source/blender/python/api2_2x/Ipo.c
source/blender/python/api2_2x/Ipocurve.c
source/blender/python/api2_2x/Ipocurve.h
source/blender/python/api2_2x/Lamp.c
source/blender/python/api2_2x/MTex.c
source/blender/python/api2_2x/MTex.h
source/blender/python/api2_2x/Makefile
source/blender/python/api2_2x/Material.c
source/blender/python/api2_2x/Mathutils.c
source/blender/python/api2_2x/Mathutils.h
source/blender/python/api2_2x/Mesh.c
source/blender/python/api2_2x/Modifier.c
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/Particle.c
source/blender/python/api2_2x/Pose.c
source/blender/python/api2_2x/Text.c
source/blender/python/api2_2x/Text.h
source/blender/python/api2_2x/Texture.c
source/blender/python/api2_2x/Window.c
source/blender/python/api2_2x/World.c
source/blender/python/api2_2x/bpy_data.c
source/blender/python/api2_2x/doc/Draw.py
source/blender/python/api2_2x/doc/Group.py
source/blender/python/api2_2x/doc/Lamp.py
source/blender/python/api2_2x/doc/Material.py
source/blender/python/api2_2x/doc/Mesh.py
source/blender/python/api2_2x/doc/Modifier.py
source/blender/python/api2_2x/doc/Text.py
source/blender/python/api2_2x/doc/Texture.py
source/blender/python/api2_2x/doc/World.py
source/blender/python/api2_2x/gen_utils.h
source/blender/python/api2_2x/sceneRender.c
source/blender/python/api2_2x/sceneSequence.c
source/blender/radiosity/CMakeLists.txt
source/blender/radiosity/SConscript
source/blender/radiosity/intern/source/Makefile
source/blender/readblenfile/intern/BLO_readblenfile.c
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/renderdatabase.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/zbuf.c
source/blender/src/CMakeLists.txt
source/blender/src/Makefile
source/blender/src/SConscript
source/blender/src/blenderbuttons.c
source/blender/src/buttons_editing.c
source/blender/src/buttons_logic.c
source/blender/src/buttons_object.c
source/blender/src/buttons_scene.c
source/blender/src/buttons_shading.c
source/blender/src/drawaction.c
source/blender/src/drawarmature.c
source/blender/src/drawgpencil.c
source/blender/src/drawimage.c
source/blender/src/drawipo.c
source/blender/src/drawmesh.c
source/blender/src/drawobject.c
source/blender/src/drawseq.c
source/blender/src/drawtext.c
source/blender/src/drawview.c
source/blender/src/editaction.c
source/blender/src/editarmature.c
source/blender/src/editdeform.c
source/blender/src/editface.c
source/blender/src/editipo.c
source/blender/src/editipo_lib.c
source/blender/src/editipo_mods.c
source/blender/src/editkey.c
source/blender/src/editlattice.c
source/blender/src/editmesh.c
source/blender/src/editmesh_add.c
source/blender/src/editmesh_lib.c
source/blender/src/editmesh_loop.c
source/blender/src/editmesh_mods.c
source/blender/src/editmesh_tools.c
source/blender/src/editmode_undo.c
source/blender/src/editnode.c
source/blender/src/editobject.c
source/blender/src/editscreen.c
source/blender/src/editsound.c
source/blender/src/editview.c
source/blender/src/filesel.c
source/blender/src/glutil.c
source/blender/src/gpencil.c
source/blender/src/header_image.c
source/blender/src/header_info.c
source/blender/src/header_ipo.c
source/blender/src/header_node.c
source/blender/src/header_text.c
source/blender/src/header_view3d.c
source/blender/src/headerbuttons.c
source/blender/src/imagepaint.c
source/blender/src/keyframing.c [new file with mode: 0644]
source/blender/src/keyval.c
source/blender/src/meshlaplacian.c
source/blender/src/meshtools.c
source/blender/src/mywindow.c
source/blender/src/outliner.c
source/blender/src/playanim.c
source/blender/src/poselib.c
source/blender/src/poseobject.c
source/blender/src/previewrender.c
source/blender/src/renderwin.c
source/blender/src/resources.c
source/blender/src/sculptmode.c
source/blender/src/seqaudio.c
source/blender/src/sequence.c
source/blender/src/space.c
source/blender/src/toets.c
source/blender/src/toolbox.c
source/blender/src/transform_conversions.c
source/blender/src/transform_generics.c
source/blender/src/transform_numinput.c
source/blender/src/transform_orientations.c
source/blender/src/transform_snap.c
source/blender/src/usiblender.c
source/blender/src/verse_image.c
source/blender/src/view.c
source/blender/yafray/intern/export_File.cpp
source/blender/yafray/intern/export_Plugin.cpp
source/creator/CMakeLists.txt
source/creator/Makefile
source/creator/SConscript
source/creator/creator.c
source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
source/gameengine/BlenderRoutines/CMakeLists.txt
source/gameengine/BlenderRoutines/KX_BlenderGL.cpp
source/gameengine/BlenderRoutines/KX_BlenderGL.h
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp
source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h
source/gameengine/BlenderRoutines/Makefile
source/gameengine/BlenderRoutines/SConscript
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_DeformableGameObject.cpp
source/gameengine/Converter/BL_MeshDeformer.cpp
source/gameengine/Converter/BL_MeshDeformer.h
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Converter/BL_ShapeDeformer.cpp
source/gameengine/Converter/BL_ShapeDeformer.h
source/gameengine/Converter/BL_SkinDeformer.cpp
source/gameengine/Converter/BL_SkinDeformer.h
source/gameengine/Converter/BL_SkinMeshObject.cpp
source/gameengine/Converter/BL_SkinMeshObject.h
source/gameengine/Converter/CMakeLists.txt
source/gameengine/Converter/KX_BlenderSceneConverter.cpp
source/gameengine/Converter/KX_BlenderSceneConverter.h
source/gameengine/Converter/KX_ConvertActuators.cpp
source/gameengine/Converter/KX_ConvertSensors.cpp
source/gameengine/Converter/KX_ConvertSensors.h
source/gameengine/Converter/Makefile
source/gameengine/Converter/SConscript
source/gameengine/Expressions/Makefile
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/Value.cpp
source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
source/gameengine/GameLogic/Joystick/SCA_Joystick.h
source/gameengine/GameLogic/Joystick/SCA_JoystickDefines.h
source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
source/gameengine/GameLogic/Makefile
source/gameengine/GameLogic/SCA_2DFilterActuator.cpp
source/gameengine/GameLogic/SCA_IController.cpp
source/gameengine/GameLogic/SCA_ILogicBrick.cpp
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_JoystickManager.cpp
source/gameengine/GameLogic/SCA_JoystickManager.h
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.h
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_LogicManager.cpp
source/gameengine/GameLogic/SCA_LogicManager.h
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_PythonController.h
source/gameengine/GamePlayer/CMakeLists.txt
source/gameengine/GamePlayer/common/CMakeLists.txt
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
source/gameengine/GamePlayer/common/GPC_RenderTools.h
source/gameengine/GamePlayer/common/Makefile
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/common/unix/GPU_PolygonMaterial.h
source/gameengine/GamePlayer/ghost/CMakeLists.txt
source/gameengine/GamePlayer/ghost/GPG_Application.cpp
source/gameengine/GamePlayer/ghost/GPG_Application.h
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/GamePlayer/ghost/Makefile
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/BL_BlenderShader.cpp
source/gameengine/Ketsji/BL_BlenderShader.h
source/gameengine/Ketsji/BL_Material.h
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/BL_Shader.h
source/gameengine/Ketsji/CMakeLists.txt
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
source/gameengine/Ketsji/KX_BlenderMaterial.cpp
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.h
source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Ketsji/KX_GameActuator.cpp
source/gameengine/Ketsji/KX_GameActuator.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_IPO_SGController.cpp
source/gameengine/Ketsji/KX_ISceneConverter.h
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_KetsjiEngine.h
source/gameengine/Ketsji/KX_Light.cpp
source/gameengine/Ketsji/KX_Light.h
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MeshProxy.h
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
source/gameengine/Ketsji/KX_PolyProxy.cpp [new file with mode: 0644]
source/gameengine/Ketsji/KX_PolyProxy.h [new file with mode: 0644]
source/gameengine/Ketsji/KX_PolygonMaterial.cpp
source/gameengine/Ketsji/KX_PolygonMaterial.h
source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/KX_PythonInit.h
source/gameengine/Ketsji/KX_RayCast.cpp
source/gameengine/Ketsji/KX_RayCast.h
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_RaySensor.h
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Ketsji/KX_SoundActuator.cpp
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_VehicleWrapper.cpp
source/gameengine/Ketsji/KX_VertexProxy.cpp
source/gameengine/Ketsji/KX_VisibilityActuator.cpp
source/gameengine/Ketsji/KX_VisibilityActuator.h
source/gameengine/Ketsji/Makefile
source/gameengine/Ketsji/SConscript
source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
source/gameengine/Physics/BlOde/OdePhysicsEnvironment.h
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h
source/gameengine/Physics/Bullet/Makefile
source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.cpp
source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h
source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h
source/gameengine/PyDoc/GameKeys.py
source/gameengine/PyDoc/GameLogic.py
source/gameengine/PyDoc/KX_GameObject.py
source/gameengine/PyDoc/KX_MeshProxy.py
source/gameengine/PyDoc/KX_ObjectActuator.py
source/gameengine/PyDoc/KX_PolyProxy.py [new file with mode: 0644]
source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py
source/gameengine/PyDoc/KX_SCA_ReplaceMeshActuator.py
source/gameengine/PyDoc/KX_TrackToActuator.py
source/gameengine/PyDoc/Rasterizer.py
source/gameengine/PyDoc/SCA_DelaySensor.py
source/gameengine/PyDoc/SCA_ISensor.py
source/gameengine/Rasterizer/Makefile
source/gameengine/Rasterizer/RAS_BucketManager.cpp
source/gameengine/Rasterizer/RAS_BucketManager.h
source/gameengine/Rasterizer/RAS_FramingManager.h
source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp
source/gameengine/Rasterizer/RAS_IPolygonMaterial.h
source/gameengine/Rasterizer/RAS_IRasterizer.h
source/gameengine/Rasterizer/RAS_IRenderTools.cpp
source/gameengine/Rasterizer/RAS_IRenderTools.h
source/gameengine/Rasterizer/RAS_MaterialBucket.cpp
source/gameengine/Rasterizer/RAS_MaterialBucket.h
source/gameengine/Rasterizer/RAS_MeshObject.cpp
source/gameengine/Rasterizer/RAS_MeshObject.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
source/gameengine/Rasterizer/RAS_Polygon.cpp
source/gameengine/Rasterizer/RAS_Polygon.h
source/gameengine/Rasterizer/RAS_TexVert.cpp
source/gameengine/Rasterizer/RAS_TexVert.h
source/gameengine/Rasterizer/SConscript
source/kernel/gen_system/GEN_Map.h
source/nan_definitions.mk
tools/Blender.py
tools/btools.py

index 6b6837d..95799a2 100644 (file)
@@ -38,6 +38,10 @@ MACRO(BLENDERLIB
 ENDMACRO(BLENDERLIB)
 
 MACRO(SETUP_LIBDIRS)
+  # see "cmake --help-policy CMP0003"
+  if(COMMAND cmake_policy)
+    CMAKE_POLICY(SET CMP0003 NEW)
+  endif(COMMAND cmake_policy)
   LINK_DIRECTORIES(${PYTHON_LIBPATH} ${SDL_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${ICONV_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH})
   IF(WITH_INTERNATIONAL)
     LINK_DIRECTORIES(${GETTEXT_LIBPATH})
index 5b86ca8..4c1b863 100644 (file)
@@ -64,6 +64,7 @@ OPTION(WITH_OPENEXR           "Enable OpenEXR Support (http://www.openexr.com)"       ON)
 OPTION(WITH_FFMPEG             "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)"   OFF)
 OPTION(WITH_OPENAL             "Enable OpenAL Support (http://www.openal.org)"         ON)
 OPTION(WITH_OPENMP             "Enable OpenMP (has to be supported by the compiler)"   OFF)
+OPTION(WITH_WEBPLUGIN          "Enable Web Plugin (Mozilla-Unix only)"                 OFF)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
   MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
@@ -248,7 +249,11 @@ IF(WIN32)
   
   SET(GETTEXT ${LIBDIR}/gettext)
   SET(GETTEXT_INC ${GETTEXT}/include)
-  SET(GETTEXT_LIB gnu_gettext)
+  IF(CMAKE_CL_64)
+       SET(GETTEXT_LIB gettextlib)
+  ELSE(CMAKE_CL_64)
+       SET(GETTEXT_LIB gnu_gettext)
+  ENDIF(CMAKE_CL_64)
   SET(GETTEXT_LIBPATH ${GETTEXT}/lib)
 
   SET(FREETYPE ${LIBDIR}/freetype)
@@ -279,7 +284,12 @@ IF(WIN32)
   SET(FFMPEG_LIB avcodec-51 avformat-52 avdevice-52 avutil-49 swscale-0)
   SET(FFMPEG_LIBPATH ${FFMPEG}/lib)
 
+  IF(CMAKE_CL_64)
+  SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 )
+  ELSE(CMAKE_CL_64)
   SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm)
+  ENDIF(CMAKE_CL_64)
+  
   IF(WITH_OPENAL)
     SET(LLIBS ${LLIBS} dxguid)
   ENDIF(WITH_OPENAL)
@@ -317,7 +327,7 @@ IF(WIN32)
   SET(WINTAB_INC ${LIBDIR}/wintab/include) 
 
   IF(CMAKE_CL_64)
-  SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib;MSVCRT.lib ")
+  SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ")
   ELSE(CMAKE_CL_64)
   SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ")
   ENDIF(CMAKE_CL_64)
@@ -447,6 +457,13 @@ SUBDIRS(
 # Blender Application
 SUBDIRS(source/creator)
 
+#-----------------------------------------------------------------------------
+# Blender WebPlugin
+IF(WITH_WEBPLUGIN) 
+  SET(MOZILLA_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path")
+  SET(WITH_PLAYER ON)
+ENDIF(WITH_WEBPLUGIN)
+
 #-----------------------------------------------------------------------------
 # Blender Player
 IF(WITH_PLAYER)
index 4c3bbf8..96b8c23 100644 (file)
@@ -241,6 +241,13 @@ if len(B.quickdebug) > 0 and printdebug != 0:
     for l in B.quickdebug:
         print "\t" + l
 
+# remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
+if env['WITH_BF_STATICCXX']:
+    if 'stdc++' in env['LLIBS']:
+        env['LLIBS'] = env['LLIBS'].replace('stdc++', ' ')
+    else:
+        print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
+
 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
 if 'blenderplayer' in B.targets:
     env['WITH_BF_PLAYER'] = True
@@ -248,6 +255,31 @@ if 'blenderplayer' in B.targets:
 if 'blendernogame' in B.targets:
     env['WITH_BF_GAMEENGINE'] = False
 
+if 'blenderlite' in B.targets:
+    env['WITH_BF_GAMEENGINE'] = False
+    env['WITH_BF_OPENAL'] = False
+    env['WITH_BF_OPENEXR'] = False
+    env['WITH_BF_ICONV'] = False
+    env['WITH_BF_INTERNATIONAL'] = False
+    env['WITH_BF_OPENJPEG'] = False
+    env['WITH_BF_FFMPEG'] = False
+    env['WITH_BF_QUICKTIME'] = False
+    env['WITH_BF_YAFRAY'] = False
+    env['WITH_BF_REDCODE'] = False
+    env['WITH_BF_FTGL'] = False
+    env['WITH_BF_DDS'] = False
+    env['WITH_BF_ZLIB'] = False
+    env['WITH_BF_SDL'] = False
+    env['WITH_BF_JPEG'] = False
+    env['WITH_BF_PNG'] = False
+    env['WITH_BF_ODE'] = False
+    env['WITH_BF_BULLET'] = False
+    env['WITH_BF_BINRELOC'] = False
+    env['BF_BUILDINFO'] = False
+    env['BF_NO_ELBEEM'] = True
+    
+
+
 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
 #B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
 B.root_build_dir = env['BF_BUILDDIR']
@@ -488,6 +520,10 @@ if not env['WITH_BF_GAMEENGINE']:
     blendernogame = env.Alias('blendernogame', B.program_list)
     Depends(blendernogame,installtarget)
 
+if 'blenderlite' in B.targets:
+       blenderlite = env.Alias('blenderlite', B.program_list)
+       Depends(blenderlite,installtarget)
+
 Depends(nsiscmd, allinstall)
 
 Default(B.program_list)
index d906395..9786b7e 100644 (file)
@@ -86,10 +86,12 @@ IF(UNIX)
     bf_oglrasterizer 
     bf_expressions 
     bf_scenegraph 
+       bf_IK
     bf_moto 
     bf_soundsystem 
     bf_kernel 
     bf_nodes
+       bf_gpu
     bf_imbuf
     bf_avi 
     kx_network 
index 8fd6c32..0eb275d 100644 (file)
@@ -87,10 +87,18 @@ if MAC_PROC == 'powerpc':
        BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
 else :
        BF_OPENAL = LIBDIR + '/openal'
-       
+
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
@@ -102,10 +110,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '${LCGDIR}/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
@@ -143,7 +154,6 @@ BF_FTGL_LIB = 'extern_ftgl'
 
 WITH_BF_GAMEENGINE='true'
 WITH_BF_PLAYER='true'
-WITH_BF_GLEXT= '1'
 
 WITH_BF_ODE = 'false'
 BF_ODE = LIBDIR + '/ode'
index fe43253..cd7e665 100644 (file)
@@ -6,18 +6,28 @@ BF_VERSE_INCLUDE = "#extern/verse/dist"
 
 BF_PYTHON = '/usr'
 BF_PYTHON_VERSION = '2.5'
+WITH_BF_STATICPYTHON = 'false'
 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
+BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}.a'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = '/usr'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
 # some distros have a separate libalut
 # if you get linker complaints, you need to uncomment the line below
 # BF_OPENAL_LIB = 'openal alut'  
+# BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
+
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr' #$(shell sdl-config --prefix)
@@ -28,14 +38,17 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '/usr'
 # when compiling with your own openexr lib you might need to set...
 # BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
 
 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 # BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 
+
 WITH_BF_DDS = 'true'
 
 WITH_BF_JPEG = 'true'
index e6c4e87..9d58512 100644 (file)
@@ -14,10 +14,18 @@ BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal_static'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = LIBDIR + '/sdl'
@@ -34,10 +42,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = ' Half IlmImf Iex '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index f7f2549..5ef3d90 100644 (file)
@@ -9,10 +9,12 @@ BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config'
 
 WITH_BF_OPENAL = 'false'
+# WITH_BF_STATICOPENAL = 'false'
 #BF_OPENAL = LIBDIR + '/openal'
 #BF_OPENAL_INC = '${BF_OPENAL}/include'
 #BF_OPENAL_LIB = 'openal'
 #BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
@@ -24,9 +26,12 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'false'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '/usr/local'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index b3ca0e2..bfb1513 100644 (file)
@@ -9,10 +9,18 @@ BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_
 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = '/usr/local'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 BF_OPENAL_LIB = 'openal'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
@@ -24,10 +32,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '/usr/local'
 BF_OPENEXR_INC = ['${BF_OPENEXR}/include', '${BF_OPENEXR}/include/OpenEXR' ]
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index d9fd6ce..4ff93bf 100644 (file)
@@ -12,10 +12,13 @@ BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'dxguid openal_static'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_FFMPEG = 'false'
 BF_FFMPEG_LIB = 'avformat swscale avcodec avutil xvidcore x264'
@@ -37,10 +40,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = ' Half IlmImf Iex '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index 02e5dbb..063d146 100644 (file)
@@ -19,10 +19,18 @@ BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
 BF_OPENAL_LIB = 'dxguid openal_static'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
+# TODO - are these useful on win32?
+# BF_CXX = '/usr'
+# WITH_BF_STATICCXX = 'false'
+# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
 WITH_BF_ICONV = 'true'
 BF_ICONV = LIBDIR + '/iconv'
@@ -45,10 +53,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = LIBDIR + '/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/IlmImf ${BF_OPENEXR}/include/Iex ${BF_OPENEXR}/include/Imath '
 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib_msvc'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index c5495fd..e28e811 100644 (file)
@@ -35,6 +35,7 @@ FILE(GLOB SRC
   src/BulletDynamics/ConstraintSolver/*.cpp
   src/BulletDynamics/Vehicle/*.cpp
   src/BulletDynamics/Dynamics/*.cpp
+  src/BulletSoftBody/*.cpp
 )
 
 ADD_DEFINITIONS(-D_LIB)
index e05d441..d26289c 100644 (file)
@@ -40,7 +40,8 @@ BulletCollision/NarrowPhaseCollision \
 BulletCollision//CollisionDispatch \
 BulletDynamics/ConstraintSolver \
 BulletDynamics/Vehicle \
-BulletDynamics/Dynamics
+BulletDynamics/Dynamics \
+BulletSoftBody
 
 include nan_subdirs.mk
 
index 6de2fd3..be4f781 100644 (file)
@@ -58,9 +58,11 @@ IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet2\include\BulletDynamics\C
 IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet2\include\BulletDynamics\Dynamics MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletDynamics\Dynamics
 IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet2\include\BulletDynamics\Vehicle MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletDynamics\Vehicle
 IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet2\include\LinearMath MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\LinearMath
+IF NOT EXIST ..\..\..\..\..\build\msvc_7\extern\bullet2\include\BulletSoftBody MKDIR ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletSoftBody
 
 XCOPY /Y ..\..\src\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include
 XCOPY /Y ..\..\src\LinearMath\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\LinearMath
+XCOPY /Y ..\..\src\BulletSoftBody\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletSoftBody
 XCOPY /Y ..\..\src\BulletCollision\BroadphaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletCollision\BroadphaseCollision
 XCOPY /Y ..\..\src\BulletCollision\NarrowPhaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletCollision\NarrowPhaseCollision
 XCOPY /Y ..\..\src\BulletCollision\NarrowPhaseCollision\*.h ..\..\..\..\..\build\msvc_7\extern\bullet\include\BulletCollision\NarrowPhaseCollision
@@ -394,12 +396,24 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSequentialImpulseConstraintSolver.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSliderConstraint.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSliderConstraint.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSolve2LinearConstraint.cpp">
                                        </File>
                                        <File
                                                RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSolve2LinearConstraint.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSolverBody.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btSolverConstraint.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletDynamics\ConstraintSolver\btTypedConstraint.cpp">
                                        </File>
@@ -410,6 +424,12 @@ ECHO Done
                                <Filter
                                        Name="Dynamics"
                                        Filter="">
+                                       <File
+                                               RelativePath="..\..\src\BulletDynamics\Dynamics\btContinuousDynamicsWorld.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletDynamics\Dynamics\btContinuousDynamicsWorld.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletDynamics\Dynamics\btDiscreteDynamicsWorld.cpp">
                                        </File>
@@ -482,18 +502,45 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btCollisionAlgorithm.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btDbvt.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btDbvt.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btDbvtBroadphase.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btDbvtBroadphase.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btDispatcher.cpp">
                                        </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btDispatcher.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btMultiSapBroadphase.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btMultiSapBroadphase.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btOverlappingPairCache.cpp">
                                        </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btOverlappingPairCache.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btOverlappingPairCallback.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btQuantizedBvh.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btQuantizedBvh.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\BroadphaseCollision\btSimpleBroadphase.cpp">
                                        </File>
@@ -534,6 +581,12 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\NarrowPhaseCollision\btGjkEpa.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\NarrowPhaseCollision\btGjkEpa2.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\NarrowPhaseCollision\btGjkEpa2.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\NarrowPhaseCollision\btGjkEpaPenetrationDepthSolver.cpp">
                                        </File>
@@ -589,6 +642,21 @@ ECHO Done
                                <Filter
                                        Name="CollisionDispatch"
                                        Filter="">
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btBoxBoxCollisionAlgorithm.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btBoxBoxCollisionAlgorithm.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btBoxBoxDetector.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btBoxBoxDetector.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btCollisionConfiguration.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionDispatch\btCollisionCreateFunc.h">
                                        </File>
@@ -628,6 +696,18 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionDispatch\btConvexConvexAlgorithm.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btConvexPlaneCollisionAlgorithm.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btConvexPlaneCollisionAlgorithm.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btDefaultCollisionConfiguration.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionDispatch\btDefaultCollisionConfiguration.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionDispatch\btEmptyCollisionAlgorithm.cpp">
                                        </File>
@@ -731,6 +811,12 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btConvexHullShape.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btConvexInternalShape.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btConvexInternalShape.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btConvexShape.cpp">
                                        </File>
@@ -761,12 +847,21 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btHeightfieldTerrainShape.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btMaterial.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btMinkowskiSumShape.cpp">
                                        </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btMinkowskiSumShape.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btMultimaterialTriangleMeshShape.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btMultimaterialTriangleMeshShape.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btMultiSphereShape.cpp">
                                        </File>
@@ -785,6 +880,18 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btPolyhedralConvexShape.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btScaledBvhTriangleMeshShape.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btScaledBvhTriangleMeshShape.h">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btShapeHull.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btShapeHull.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btSphereShape.cpp">
                                        </File>
@@ -827,6 +934,12 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btTriangleIndexVertexArray.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btTriangleIndexVertexMaterialArray.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btTriangleIndexVertexMaterialArray.h">
+                                       </File>
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btTriangleMesh.cpp">
                                        </File>
@@ -842,6 +955,12 @@ ECHO Done
                                        <File
                                                RelativePath="..\..\src\BulletCollision\CollisionShapes\btTriangleShape.h">
                                        </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btUniformScalingShape.cpp">
+                                       </File>
+                                       <File
+                                               RelativePath="..\..\src\BulletCollision\CollisionShapes\btUniformScalingShape.h">
+                                       </File>
                                </Filter>
                        </Filter>
                        <Filter
@@ -859,6 +978,12 @@ ECHO Done
                                <File
                                        RelativePath="..\..\src\LinearMath\btAlignedObjectArray.h">
                                </File>
+                               <File
+                                       RelativePath="..\..\src\LinearMath\btConvexHull.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\LinearMath\btConvexHull.h">
+                               </File>
                                <File
                                        RelativePath="..\..\src\LinearMath\btDefaultMotionState.h">
                                </File>
@@ -868,6 +993,9 @@ ECHO Done
                                <File
                                        RelativePath="..\..\src\LinearMath\btGeometryUtil.h">
                                </File>
+                               <File
+                                       RelativePath="..\..\src\LinearMath\btHashMap.h">
+                               </File>
                                <File
                                        RelativePath="..\..\src\LinearMath\btIDebugDraw.h">
                                </File>
@@ -886,6 +1014,9 @@ ECHO Done
                                <File
                                        RelativePath="..\..\src\LinearMath\btPoint3.h">
                                </File>
+                               <File
+                                       RelativePath="..\..\src\LinearMath\btPoolAllocator.h">
+                               </File>
                                <File
                                        RelativePath="..\..\src\LinearMath\btQuadWord.h">
                                </File>
@@ -904,9 +1035,6 @@ ECHO Done
                                <File
                                        RelativePath="..\..\src\LinearMath\btScalar.h">
                                </File>
-                               <File
-                                       RelativePath="..\..\src\LinearMath\btSimdMinMax.h">
-                               </File>
                                <File
                                        RelativePath="..\..\src\LinearMath\btStackAlloc.h">
                                </File>
@@ -920,6 +1048,58 @@ ECHO Done
                                        RelativePath="..\..\src\LinearMath\btVector3.h">
                                </File>
                        </Filter>
+                       <Filter
+                               Name="BulletSoftBody"
+                               Filter="">
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBody.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBody.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyConcaveCollisionAlgorithm.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyConcaveCollisionAlgorithm.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyHelpers.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyHelpers.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyInternals.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyRigidBodyCollisionConfiguration.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftBodyRigidBodyCollisionConfiguration.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftRigidCollisionAlgorithm.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftRigidCollisionAlgorithm.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftRigidDynamicsWorld.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftRigidDynamicsWorld.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftSoftCollisionAlgorithm.cpp">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSoftSoftCollisionAlgorithm.h">
+                               </File>
+                               <File
+                                       RelativePath="..\..\src\BulletSoftBody\btSparseSDF.h">
+                               </File>
+                       </Filter>
                </Filter>
        </Files>
        <Globals>
index 4d1a4c1..02430cb 100644 (file)
@@ -1,3 +1,8 @@
+***
+Apply bullet_compound_raycast.patch if not already applied in Bullet source
+This patch is needed to return correct raycast results on compound shape.
+/ben
+
 
 *** These files in extern/bullet2 are NOT part of the Blender build yet ***
 
index 078dcae..8074aed 100644 (file)
@@ -23,15 +23,153 @@ subject to the following restrictions:
 #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
 
-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]);
+/*     Particular physics SDK */
+       PL_DECLARE_HANDLE(plPhysicsSdkHandle);
+
+/*     Dynamics world, belonging to some physics SDK */
+       PL_DECLARE_HANDLE(plDynamicsWorldHandle);
+
+/* Rigid Body that can be part of a Dynamics World */  
+       PL_DECLARE_HANDLE(plRigidBodyHandle);
+
+/*     Collision Shape/Geometry, property of a Rigid Body */
+       PL_DECLARE_HANDLE(plCollisionShapeHandle);
+
+/* Constraint for Rigid Bodies */
+       PL_DECLARE_HANDLE(plConstraintHandle);
+
+/* Triangle Mesh interface */
+       PL_DECLARE_HANDLE(plMeshInterfaceHandle);
+
+/* Broadphase Scene/Proxy Handles */
+       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);
+
+       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
 
index be4a115..d7eea33 100644 (file)
 
 #include <assert.h>
 
-#ifdef DEBUG_BROADPHASE
-#include <stdio.h>
-void btAxisSweep3::debugPrintAxis(int axis, bool checkCardinality)
+btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned short int maxHandles, btOverlappingPairCache* pairCache)
+:btAxisSweep3Internal<unsigned short int>(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache)
 {
-       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)
-               assert(numEdges == m_numHandles*2+1);
-}
-#endif //DEBUG_BROADPHASE
-
-
-btBroadphaseProxy*     btAxisSweep3::createProxy(  const btVector3& min,  const btVector3& max,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask)
-{
-               (void)shapeType;
-               BP_FP_INT_TYPE handleId = addHandle(min,max, userPtr,collisionFilterGroup,collisionFilterMask);
-               
-               Handle* handle = getHandle(handleId);
-                               
-               return handle;
-}
-
-void   btAxisSweep3::destroyProxy(btBroadphaseProxy* proxy)
-{
-       Handle* handle = static_cast<Handle*>(proxy);
-       removeHandle(handle->m_handleId);
-}
-
-void   btAxisSweep3::setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax)
-{
-       Handle* handle = static_cast<Handle*>(proxy);
-       updateHandle(handle->m_handleId,aabbMin,aabbMax);
-
-}
-
-
-
-
-
-
-btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, int maxHandles)
-:btOverlappingPairCache()
-{
-       m_invalidPair = 0;
-       //assert(bounds.HasVolume());
-
        // 1 handle is reserved as sentinel
-       btAssert(maxHandles > 1 && maxHandles < BP_MAX_HANDLES);
-
-       // init bounds
-       m_worldAabbMin = worldAabbMin;
-       m_worldAabbMax = worldAabbMax;
-
-       btVector3 aabbSize = m_worldAabbMax - m_worldAabbMin;
-
-       BP_FP_INT_TYPE  maxInt = BP_HANDLE_SENTINEL;
-
-       m_quantize = btVector3(btScalar(maxInt),btScalar(maxInt),btScalar(maxInt)) / aabbSize;
-
-       // allocate handles buffer 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(i + 1);
-               m_pHandles[maxHandles - 1].SetNextFree(0);
-       }
-
-       {
-       // allocate edge buffers
-       for (int i = 0; i < 3; i++)
-               m_pEdges[i] = new 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 = BP_HANDLE_SENTINEL;
-               m_pEdges[axis][1].m_handle = 0;
-#ifdef DEBUG_BROADPHASE
-               debugPrintAxis(axis);
-#endif //DEBUG_BROADPHASE
-
-       }
-
-}
-
-btAxisSweep3::~btAxisSweep3()
-{
-       
-       for (int i = 2; i >= 0; i--)
-               delete[] m_pEdges[i];
-       delete[] m_pHandles;
-}
-
-void btAxisSweep3::quantize(BP_FP_INT_TYPE* out, const btPoint3& point, int isMax) const
-{
-       btPoint3 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() & BP_HANDLE_MASK) | isMax);
-       out[1] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getY() & BP_HANDLE_MASK) | isMax);
-       out[2] = (BP_FP_INT_TYPE)(((BP_FP_INT_TYPE)v.getZ() & BP_HANDLE_MASK) | isMax);
-       
-}
-
-
-
-BP_FP_INT_TYPE btAxisSweep3::allocHandle()
-{
-       assert(m_firstFreeHandle);
-
-       BP_FP_INT_TYPE handle = m_firstFreeHandle;
-       m_firstFreeHandle = getHandle(handle)->GetNextFree();
-       m_numHandles++;
-
-       return handle;
-}
-
-void btAxisSweep3::freeHandle(BP_FP_INT_TYPE handle)
-{
-       assert(handle > 0 && handle < m_maxHandles);
-
-       getHandle(handle)->SetNextFree(m_firstFreeHandle);
-       m_firstFreeHandle = handle;
-
-       m_numHandles--;
-}
-
-
-
-BP_FP_INT_TYPE btAxisSweep3::addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask)
-{
-       // 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();
-       assert(handle!= 0xcdcd);
-
-       Handle* pHandle = getHandle(handle);
-       
-       pHandle->m_handleId = handle;
-       //pHandle->m_pOverlaps = 0;
-       pHandle->m_clientObject = pOwner;
-       pHandle->m_collisionFilterGroup = collisionFilterGroup;
-       pHandle->m_collisionFilterMask = collisionFilterMask;
-
-       // compute current limit of edge arrays
-       BP_FP_INT_TYPE limit = 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] = limit - 1;
-               pHandle->m_maxEdges[axis] = limit;
-       }
-
-       // now sort the new edges to their correct position
-       sortMinDown(0, pHandle->m_minEdges[0], false);
-       sortMaxDown(0, pHandle->m_maxEdges[0], false);
-       sortMinDown(1, pHandle->m_minEdges[1], false);
-       sortMaxDown(1, pHandle->m_maxEdges[1], false);
-       sortMinDown(2, pHandle->m_minEdges[2], true);
-       sortMaxDown(2, pHandle->m_maxEdges[2], true);
-
-
-       return handle;
-}
-
-
-void btAxisSweep3::removeHandle(BP_FP_INT_TYPE handle)
-{
-       
-       Handle* pHandle = getHandle(handle);
-
-       //explicitly remove the pairs containing the proxy
-       //we could do it also in the sortMinUp (passing true)
-       //todo: compare performance
-       removeOverlappingPairsContainingProxy(pHandle);
-
-
-       // compute current limit of edge arrays
-       int limit = 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 = BP_HANDLE_SENTINEL;
-
-               sortMaxUp(axis,max,false);
-
-
-               BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];
-               pEdges[i].m_pos = BP_HANDLE_SENTINEL;
-
-
-               sortMinUp(axis,i,false);
-
-               pEdges[limit-1].m_handle = 0;
-               pEdges[limit-1].m_pos = BP_HANDLE_SENTINEL;
-               
-#ifdef DEBUG_BROADPHASE
-                       debugPrintAxis(axis,false);
-#endif //DEBUG_BROADPHASE
-
-
-       }
-
-
-       // free the handle
-       freeHandle(handle);
-
-       
-}
-
-extern int gOverlappingPairs;
-
-
-void   btAxisSweep3::refreshOverlappingPairs()
-{
-
-}
-void   btAxisSweep3::processAllOverlappingPairs(btOverlapCallback* callback)
-{
-
-       //perform a sort, to find duplicates and to sort 'invalid' pairs to the end
-       m_overlappingPairArray.heapSort(btBroadphasePairSortPredicate());
-
-       //remove the 'invalid' ones
-#ifdef USE_POPBACK_REMOVAL
-       while (m_invalidPair>0)
-       {
-               m_invalidPair--;
-               m_overlappingPairArray.pop_back();
-       }
-#else  
-       m_overlappingPairArray.resize(m_overlappingPairArray.size() - m_invalidPair);
-       m_invalidPair = 0;
-#endif
-
-       
-       int i;
-
-       btBroadphasePair previousPair;
-       previousPair.m_pProxy0 = 0;
-       previousPair.m_pProxy1 = 0;
-       previousPair.m_algorithm = 0;
-       
-       
-       for (i=0;i<m_overlappingPairArray.size();i++)
-       {
-       
-               btBroadphasePair& pair = m_overlappingPairArray[i];
-
-               bool isDuplicate = (pair == previousPair);
-
-               previousPair = pair;
-
-               bool needsRemoval = false;
-
-               if (!isDuplicate)
-               {
-                       bool hasOverlap = testOverlap(pair.m_pProxy0,pair.m_pProxy1);
-
-                       if (hasOverlap)
-                       {
-                               needsRemoval = callback->processOverlap(pair);
-                       } else
-                       {
-                               needsRemoval = true;
-                       }
-               } else
-               {
-                       //remove duplicate
-                       needsRemoval = true;
-                       //should have no algorithm
-                       btAssert(!pair.m_algorithm);
-               }
-               
-               if (needsRemoval)
-               {
-                       cleanOverlappingPair(pair);
-
-       //              m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1);
-       //              m_overlappingPairArray.pop_back();
-                       pair.m_pProxy0 = 0;
-                       pair.m_pProxy1 = 0;
-                       m_invalidPair++;
-                       gOverlappingPairs--;
-               } 
-               
-       }
-}
-
-
-bool btAxisSweep3::testOverlap(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;
-}
-
-bool btAxisSweep3::testOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB)
-{
-       //optimization 1: check the array index (memory address), instead of the m_pos
-
-       for (int axis = 0; axis < 3; axis++)
-       { 
-               if (axis != ignoreAxis)
-               {
-                       if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] || 
-                               pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis]) 
-                       { 
-                               return false; 
-                       } 
-               }
-       } 
-
-       //optimization 2: only 2 axis need to be tested (conflicts with 'delayed removal' optimization)
-
-       /*for (int axis = 0; axis < 3; axis++)
-       {
-               if (m_pEdges[axis][pHandleA->m_maxEdges[axis]].m_pos < m_pEdges[axis][pHandleB->m_minEdges[axis]].m_pos ||
-                       m_pEdges[axis][pHandleB->m_maxEdges[axis]].m_pos < m_pEdges[axis][pHandleA->m_minEdges[axis]].m_pos)
-               {
-                       return false;
-               }
-       }
-       */
-
-       return true;
-}
-
-void btAxisSweep3::updateHandle(BP_FP_INT_TYPE handle, const btPoint3& aabbMin,const btPoint3& aabbMax)
-{
-//     assert(bounds.IsFinite());
-       //assert(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);
-
-               if (dmax > 0)
-                       sortMaxUp(axis, emax);
-
-               // shrink (only removes overlaps)
-               if (dmin > 0)
-                       sortMinUp(axis, emin);
-
-               if (dmax < 0)
-                       sortMaxDown(axis, emax);
-
-#ifdef DEBUG_BROADPHASE
-       debugPrintAxis(axis);
-#endif //DEBUG_BROADPHASE
-       }
-
-       
-}
-
-
-
-
-// sorting a min edge downwards can only ever *add* overlaps
-void btAxisSweep3::sortMinDown(int axis, BP_FP_INT_TYPE edge, 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
-                       if (updateOverlaps && testOverlap(axis,pHandleEdge, pHandlePrev))
-                       {
-                               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
-void btAxisSweep3::sortMinUp(int axis, BP_FP_INT_TYPE edge, 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())
-               {
-                       // if next edge is maximum remove any overlap between the two handles
-                       if (updateOverlaps)
-                       {
-                               /*
-                               Handle* handle0 = getHandle(pEdge->m_handle);
-                               Handle* handle1 = getHandle(pNext->m_handle);
-                               btBroadphasePair tmpPair(*handle0,*handle1);
-                               removeOverlappingPair(tmpPair);
-                               */
-
-                       }
-
-                       // 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++;
-       }
-
+       btAssert(maxHandles > 1 && maxHandles < 32767);
 
 }
 
-// sorting a max edge downwards can only ever *remove* overlaps
-void btAxisSweep3::sortMaxDown(int axis, BP_FP_INT_TYPE edge, 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
-                       if (updateOverlaps)
-                       {
-                               //this is done during the overlappingpairarray iteration/narrowphase collision
-                               /*
-                               Handle* handle0 = getHandle(pEdge->m_handle);
-                               Handle* handle1 = getHandle(pPrev->m_handle);
-                               btBroadphasePair* pair = findPair(handle0,handle1);
-                               //assert(pair);
-
-                               if (pair)
-                               {
-                                       removeOverlappingPair(*pair);
-                               }
-                               */
-
-                       }
-
-                       // 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
-void btAxisSweep3::sortMaxUp(int axis, BP_FP_INT_TYPE edge, bool updateOverlaps)
+bt32BitAxisSweep3::bt32BitAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned int maxHandles , btOverlappingPairCache* pairCache )
+:btAxisSweep3Internal<unsigned int>(worldAabbMin,worldAabbMax,0xfffffffe,0x7fffffff,maxHandles,pairCache)
 {
-       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())
-               {
-                       // if next edge is a minimum check the bounds and add an overlap if necessary
-                       if (updateOverlaps && testOverlap(axis, pHandleEdge, pHandleNext))
-                       {
-                               Handle* handle0 = getHandle(pEdge->m_handle);
-                               Handle* handle1 = getHandle(pNext->m_handle);
-                               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++;
-       }
-       
+       // 1 handle is reserved as sentinel
+       btAssert(maxHandles > 1 && maxHandles < 2147483647);
 }
index 57bbb36..d0ad09a 100644 (file)
 #ifndef AXIS_SWEEP_3_H
 #define AXIS_SWEEP_3_H
 
-#include "../../LinearMath/btPoint3.h"
-#include "../../LinearMath/btVector3.h"
+#include "LinearMath/btPoint3.h"
+#include "LinearMath/btVector3.h"
 #include "btOverlappingPairCache.h"
+#include "btBroadphaseInterface.h"
 #include "btBroadphaseProxy.h"
-
-
-//Enable BP_USE_FIXEDPOINT_INT_32 if you need more then 32767 objects
-//#define BP_USE_FIXEDPOINT_INT_32 1
-
-#ifdef BP_USE_FIXEDPOINT_INT_32
-       #define BP_FP_INT_TYPE unsigned int
-       #define BP_MAX_HANDLES 1500000 //arbitrary maximum number of handles
-       #define BP_HANDLE_SENTINEL 0x7fffffff
-       #define BP_HANDLE_MASK  0xfffffffe
-#else
-       #define BP_FP_INT_TYPE unsigned short int
-       #define BP_MAX_HANDLES 32767
-       #define BP_HANDLE_SENTINEL 0xffff
-       #define BP_HANDLE_MASK  0xfffe
-#endif //BP_USE_FIXEDPOINT_INT_32
+#include "btOverlappingPairCallback.h"
 
 //#define DEBUG_BROADPHASE 1
+#define USE_OVERLAP_TEST_ON_REMOVES 1
 
-/// 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 integer coordinates instead of floats.
-/// The testOverlap check is optimized to check the array index, rather then the actual AABB coordinates/pos
-class btAxisSweep3 : public btOverlappingPairCache
+/// 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:
        
@@ -57,47 +49,57 @@ 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 m_pos & 1;}
+               BP_FP_INT_TYPE IsMax() const {return static_cast<BP_FP_INT_TYPE>(m_pos & 1);}
        };
 
 public:
-       class Handle : public btBroadphaseProxy
+       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_handleId;
+//             BP_FP_INT_TYPE m_uniqueId;
                BP_FP_INT_TYPE m_pad;
                
                //void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject
        
-               inline void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}
-               inline BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];}
+               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
 
        
-private:
+protected:
        btPoint3 m_worldAabbMin;                                                // overall system bounds
        btPoint3 m_worldAabbMax;                                                // overall system bounds
 
        btVector3 m_quantize;                                           // scaling factor for quantization
 
        BP_FP_INT_TYPE m_numHandles;                                            // number of active handles
-       int m_maxHandles;                                               // max number of 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;
+       int     m_invalidPair;
 
        // allocation/deallocation
        BP_FP_INT_TYPE allocHandle();
        void freeHandle(BP_FP_INT_TYPE handle);
        
 
-       bool testOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB);
+       bool testOverlap2D(const Handle* pHandleA, const Handle* pHandleB,int axis0,int axis1);
 
 #ifdef DEBUG_BROADPHASE
        void debugPrintAxis(int axis,bool checkCardinality=true);
@@ -108,29 +110,803 @@ private:
 
        void quantize(BP_FP_INT_TYPE* out, const btPoint3& point, int isMax) const;
 
-       void sortMinDown(int axis, BP_FP_INT_TYPE edge, bool updateOverlaps = true);
-       void sortMinUp(int axis, BP_FP_INT_TYPE edge, bool updateOverlaps = true);
-       void sortMaxDown(int axis, BP_FP_INT_TYPE edge, bool updateOverlaps = true);
-       void sortMaxUp(int axis, BP_FP_INT_TYPE edge, bool updateOverlaps = true);
+       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:
-       btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, int maxHandles = 16384);
-       virtual ~btAxisSweep3();
 
-       virtual void    refreshOverlappingPairs();
+       btAxisSweep3Internal(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles = 16384, btOverlappingPairCache* pairCache=0);
+
+       virtual ~btAxisSweep3Internal();
+
+       BP_FP_INT_TYPE getNumHandles() const
+       {
+               return m_numHandles;
+       }
+
+       virtual void    calculateOverlappingPairs(btDispatcher* dispatcher);
        
-       BP_FP_INT_TYPE addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask);
-       void removeHandle(BP_FP_INT_TYPE handle);
-       void updateHandle(BP_FP_INT_TYPE handle, const btPoint3& aabbMin,const btPoint3& aabbMax);
-       inline Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}
+       BP_FP_INT_TYPE addHandle(const btPoint3& aabbMin,const btPoint3& 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 btPoint3& aabbMin,const btPoint3& aabbMax,btDispatcher* dispatcher);
+       SIMD_FORCE_INLINE Handle* getHandle(BP_FP_INT_TYPE index) const {return m_pHandles + index;}
 
        void    processAllOverlappingPairs(btOverlapCallback* callback);
 
        //Broadphase Interface
-       virtual btBroadphaseProxy*      createProxy(  const btVector3& min,  const btVector3& max,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask);
-       virtual void    destroyProxy(btBroadphaseProxy* proxy);
-       virtual void    setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax);
-       bool testOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* 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    destroyProxy(btBroadphaseProxy* proxy,btDispatcher* dispatcher);
+       virtual void    setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax,btDispatcher* dispatcher);
+       
+       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)
+               assert(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);
+                               
+               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);
+       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);
+       updateHandle(static_cast<BP_FP_INT_TYPE>(handle->m_uniqueId), aabbMin, aabbMax,dispatcher);
+
+}
+
+
+
+
+
+template <typename BP_FP_INT_TYPE>
+btAxisSweep3Internal<BP_FP_INT_TYPE>::btAxisSweep3Internal(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel,BP_FP_INT_TYPE userMaxHandles, btOverlappingPairCache* pairCache )
+:m_bpHandleMask(handleMask),
+m_handleSentinel(handleSentinel),
+m_pairCache(pairCache),
+m_userPairCallback(0),
+m_ownsPairCache(false),
+m_invalidPair(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;
+       }
+
+       //assert(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()
+{
+       
+       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 btPoint3& point, int isMax) const
+{
+       btPoint3 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);
+       
+}
+
+
+template <typename BP_FP_INT_TYPE>
+BP_FP_INT_TYPE btAxisSweep3Internal<BP_FP_INT_TYPE>::allocHandle()
+{
+       assert(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)
+{
+       assert(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 btPoint3& aabbMin,const btPoint3& 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);
+
+       
+}
+
+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)
+                       {
+                               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 btPoint3& aabbMin,const btPoint3& aabbMax,btDispatcher* dispatcher)
+{
+//     assert(bounds.IsFinite());
+       //assert(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 btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned short int maxHandles = 16384, btOverlappingPairCache* pairCache = 0);
+
+};
+
+/// 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 btPoint3& worldAabbMin,const btPoint3& worldAabbMax, unsigned int maxHandles = 1500000, btOverlappingPairCache* pairCache = 0);
 
 };
 
index b6ace03..200ac36 100644 (file)
@@ -20,20 +20,34 @@ subject to the following restrictions:
 
 struct btDispatcherInfo;
 class btDispatcher;
-struct btBroadphaseProxy;
-#include "../../LinearMath/btVector3.h"
+#include "btBroadphaseProxy.h"
+class btOverlappingPairCache;
 
-///BroadphaseInterface for aabb-overlapping object pairs
+#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& min,  const btVector3& max,int shapeType,void* userPtr, short int collisionFilterGroup,short int collisionFilterMask) =0;
-       virtual void    destroyProxy(btBroadphaseProxy* proxy)=0;
-       virtual void    setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax)=0;
-       virtual void    cleanProxyFromPairs(btBroadphaseProxy* proxy)=0;
+       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;
        
+       ///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;
+
+       virtual void    printStats() = 0;
 
 };
 
index 40d9748..e0bb67f 100644 (file)
@@ -16,7 +16,8 @@ subject to the following restrictions:
 #ifndef BROADPHASE_PROXY_H
 #define BROADPHASE_PROXY_H
 
-#include "../../LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
+#include "LinearMath/btScalar.h" //for SIMD_FORCE_INLINE
+#include "LinearMath/btAlignedAllocator.h"
 
 
 /// btDispatcher uses these types
@@ -38,6 +39,7 @@ IMPLICIT_CONVEX_SHAPES_START_HERE,
        CONE_SHAPE_PROXYTYPE,
        CONVEX_SHAPE_PROXYTYPE,
        CYLINDER_SHAPE_PROXYTYPE,
+       UNIFORM_SCALING_SHAPE_PROXYTYPE,
        MINKOWSKI_SUM_SHAPE_PROXYTYPE,
        MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
 //concave shapes
@@ -50,6 +52,8 @@ CONCAVE_SHAPES_START_HERE,
        TERRAIN_SHAPE_PROXYTYPE,
 ///Used for GIMPACT Trimesh integration
        GIMPACT_SHAPE_PROXYTYPE,
+///Multimaterial mesh
+    MULTIMATERIAL_TRIANGLE_MESH_PROXYTYPE,
        
        EMPTY_SHAPE_PROXYTYPE,
        STATIC_PLANE_PROXYTYPE,
@@ -57,13 +61,18 @@ CONCAVE_SHAPES_END_HERE,
 
        COMPOUND_SHAPE_PROXYTYPE,
 
+       SOFTBODY_SHAPE_PROXYTYPE,
+
        MAX_BROADPHASE_COLLISION_TYPES
 };
 
 
-///btBroadphaseProxy
-struct btBroadphaseProxy
+///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
@@ -73,44 +82,60 @@ struct btBroadphaseProxy
                KinematicFilter = 4,
                DebrisFilter = 8,
                        SensorTrigger = 16,
-               AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger
+               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.
+
+       SIMD_FORCE_INLINE int getUid() const
+       {
+               return m_uniqueId;
+       }
+
        //used for memory pools
-       btBroadphaseProxy() :m_clientObject(0){}
+       btBroadphaseProxy() :m_clientObject(0),m_multiSapParentProxy(0)
+       {
+       }
 
-       btBroadphaseProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask)
+       btBroadphaseProxy(void* userPtr,short int collisionFilterGroup, short int collisionFilterMask,void* multiSapParentProxy=0)
                :m_clientObject(userPtr),
                m_collisionFilterGroup(collisionFilterGroup),
                m_collisionFilterMask(collisionFilterMask)
        {
+               m_multiSapParentProxy = multiSapParentProxy;
        }
 
-       static inline bool isPolyhedral(int proxyType)
+       
+
+       static SIMD_FORCE_INLINE bool isPolyhedral(int proxyType)
        {
                return (proxyType  < IMPLICIT_CONVEX_SHAPES_START_HERE);
        }
 
-       static inline bool      isConvex(int proxyType)
+       static SIMD_FORCE_INLINE bool   isConvex(int proxyType)
        {
                return (proxyType < CONCAVE_SHAPES_START_HERE);
        }
 
-       static inline bool      isConcave(int proxyType)
+       static SIMD_FORCE_INLINE bool   isConcave(int proxyType)
        {
                return ((proxyType > CONCAVE_SHAPES_START_HERE) &&
                        (proxyType < CONCAVE_SHAPES_END_HERE));
        }
-       static inline bool      isCompound(int proxyType)
+       static SIMD_FORCE_INLINE bool   isCompound(int proxyType)
        {
                return (proxyType == COMPOUND_SHAPE_PROXYTYPE);
        }
-       static inline bool isInfinite(int proxyType)
+       static SIMD_FORCE_INLINE bool isInfinite(int proxyType)
        {
                return (proxyType == STATIC_PLANE_PROXYTYPE);
        }
@@ -124,8 +149,9 @@ struct btBroadphaseProxy;
 
 
 
-/// contains a pair of aabb-overlapping objects
-struct btBroadphasePair
+///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 ()
                :
@@ -136,6 +162,8 @@ struct btBroadphasePair
        {
        }
 
+BT_DECLARE_ALIGNED_ALLOCATOR();
+
        btBroadphasePair(const btBroadphasePair& other)
                :               m_pProxy0(other.m_pProxy0),
                                m_pProxy1(other.m_pProxy1),
@@ -181,6 +209,7 @@ SIMD_FORCE_INLINE bool operator<(const btBroadphasePair& a, const btBroadphasePa
 */
 
 
+
 class btBroadphasePairSortPredicate
 {
        public:
index 2ad0c86..c95d1be 100644 (file)
@@ -18,6 +18,6 @@ subject to the following restrictions:
 
 btCollisionAlgorithm::btCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo& ci)
 {
-       m_dispatcher = ci.m_dispatcher;
+       m_dispatcher = ci.m_dispatcher1;
 }
 
index 55cec38..1618ad9 100644 (file)
@@ -16,7 +16,8 @@ subject to the following restrictions:
 #ifndef COLLISION_ALGORITHM_H
 #define COLLISION_ALGORITHM_H
 
-#include "../../LinearMath/btScalar.h"
+#include "LinearMath/btScalar.h"
+#include "LinearMath/btAlignedObjectArray.h"
 
 struct btBroadphaseProxy;
 class btDispatcher;
@@ -25,21 +26,22 @@ class btCollisionObject;
 struct btDispatcherInfo;
 class  btPersistentManifold;
 
+typedef btAlignedObjectArray<btPersistentManifold*>    btManifoldArray;
 
 struct btCollisionAlgorithmConstructionInfo
 {
        btCollisionAlgorithmConstructionInfo()
-               :m_dispatcher(0),
+               :m_dispatcher1(0),
                m_manifold(0)
        {
        }
        btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)
-               :m_dispatcher(dispatcher)
+               :m_dispatcher1(dispatcher)
        {
                (void)temp;
        }
 
-       btDispatcher*   m_dispatcher;
+       btDispatcher*   m_dispatcher1;
        btPersistentManifold*   m_manifold;
 
        int     getDispatcherId();
@@ -71,6 +73,7 @@ public:
 
        virtual btScalar calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut) = 0;
 
+       virtual void    getAllContactManifolds(btManifoldArray& manifoldArray) = 0;
 };
 
 
diff --git a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.cpp b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvt.cpp
new file mode 100644 (file)
index 0000000..7c41c8d
--- /dev/null
@@ -0,0 +1,1289 @@
+/*
+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.
+*/
+///btDbvt implementation by Nathanael Presson
+
+#include "btDbvt.h"
+
+//
+typedef btAlignedObjectArray<btDbvtNode*>                      tNodeArray;
+typedef btAlignedObjectArray<const btDbvtNode*>        tConstNodeArray;
+
+//
+struct btDbvtNodeEnumerator : btDbvt::ICollide
+{
+tConstNodeArray        nodes;
+void Process(const btDbvtNode* n) { nodes.push_back(n); }
+};
+
+//
+static DBVT_INLINE int                 indexof(const btDbvtNode* node)
+{
+return(node->parent->childs[1]==node);
+}
+
+//
+static DBVT_INLINE btDbvtVolume        merge(  const btDbvtVolume& a,
+                                                                               const btDbvtVolume& b)
+{
+#if DBVT_MERGE_IMPL==DBVT_IMPL_SSE
+DBVT_ALIGN char locals[sizeof(btDbvtAabbMm)];
+btDbvtVolume&  res=*(btDbvtVolume*)locals;
+#else
+btDbvtVolume   res;
+#endif
+Merge(a,b,res);
+return(res);
+}
+
+// volume+edge lengths
+static DBVT_INLINE btScalar            size(const btDbvtVolume& a)
+{
+const btVector3        edges=a.Lengths();
+return(        edges.x()*edges.y()*edges.z()+
+               edges.x()+edges.y()+edges.z());
+}
+
+//
+static void                                            getmaxdepth(const btDbvtNode* node,int depth,int& maxdepth)
+{
+if(node->isinternal())
+       {
+       getmaxdepth(node->childs[0],depth+1,maxdepth);
+       getmaxdepth(node->childs[0],depth+1,maxdepth);
+       } else maxdepth=btMax(maxdepth,depth);
+}
+
+//
+static DBVT_INLINE void                        deletenode(     btDbvt* pdbvt,
+                                                                                       btDbvtNode* node)
+{
+btAlignedFree(pdbvt->m_free);
+pdbvt->m_free=node;
+}
+       
+//
+static void                                            recursedeletenode(      btDbvt* pdbvt,
+                                                                                                       btDbvtNode* node)
+{
+if(!node->isleaf())
+       {
+       recursedeletenode(pdbvt,node->childs[0]);
+       recursedeletenode(pdbvt,node->childs[1]);
+       }
+if(node==pdbvt->m_root) pdbvt->m_root=0;
+deletenode(pdbvt,node);
+}
+
+//
+static DBVT_INLINE btDbvtNode* createnode(     btDbvt* pdbvt,
+                                                                                       btDbvtNode* parent,
+                                                                                       void* data)
+{
+btDbvtNode*    node;
+if(pdbvt->m_free)
+       { node=pdbvt->m_free;pdbvt->m_free=0; }
+       else
+       { node=new(btAlignedAlloc(sizeof(btDbvtNode),16)) btDbvtNode(); }
+node->parent   =       parent;
+node->data             =       data;
+node->childs[1]        =       0;
+return(node);
+}
+
+//
+static DBVT_INLINE btDbvtNode* createnode(     btDbvt* pdbvt,
+                                                                                       btDbvtNode* parent,
+                                                                                       const btDbvtVolume& volume,
+                                                                                       void* data)
+{
+btDbvtNode*    node=createnode(pdbvt,parent,data);
+node->volume=volume;
+return(node);
+}
+
+//
+static DBVT_INLINE btDbvtNode* createnode(     btDbvt* pdbvt,
+                                                                                       btDbvtNode* parent,
+                                                                                       const btDbvtVolume& volume0,
+                                                                                       const btDbvtVolume& volume1,
+                                                                                       void* data)
+{
+btDbvtNode*    node=createnode(pdbvt,parent,data);
+Merge(volume0,volume1,node->volume);
+return(node);
+}
+
+//
+static void                                            insertleaf(     btDbvt* pdbvt,
+                                                                                       btDbvtNode* root,
+                                                                                       btDbvtNode* leaf)
+{
+if(!pdbvt->m_root)
+       {
+       pdbvt->m_root   =       leaf;
+       leaf->parent    =       0;
+       }
+       else
+       {
+       if(!root->isleaf())
+               {
+               do      {
+                       root=root->childs[Select(       leaf->volume,
+                                                                               root->childs[0]->volume,
+                                                                               root->childs[1]->volume)];
+                       } while(!root->isleaf());
+               }
+       btDbvtNode*     prev=root->parent;
+       btDbvtNode*     node=createnode(pdbvt,prev,leaf->volume,root->volume,0);
+       if(prev)
+               {
+               prev->childs[indexof(root)]     =       node;
+               node->childs[0]                         =       root;root->parent=node;
+               node->childs[1]                         =       leaf;leaf->parent=node;
+               do      {
+                       if(!prev->volume.Contain(node->volume))
+                               Merge(prev->childs[0]->volume,prev->childs[1]->volume,prev->volume);
+                               else
+                               break;
+                       node=prev;
+                       } while(0!=(prev=node->parent));
+               }
+               else
+               {
+               node->childs[0] =       root;root->parent=node;
+               node->childs[1] =       leaf;leaf->parent=node;
+               pdbvt->m_root   =       node;
+               }
+       }
+}
+       
+//
+static btDbvtNode*                             removeleaf(     btDbvt* pdbvt,
+                                                                                       btDbvtNode* leaf)
+{
+if(leaf==pdbvt->m_root)
+       {
+       pdbvt->m_root=0;
+       return(0);
+       }
+       else
+       {
+       btDbvtNode*     parent=leaf->parent;
+       btDbvtNode*     prev=parent->parent;
+       btDbvtNode*     sibling=parent->childs[1-indexof(leaf)];                        
+       if(prev)
+               {
+               prev->childs[indexof(parent)]=sibling;
+               sibling->parent=prev;
+               deletenode(pdbvt,parent);
+               while(prev)
+                       {
+                       const btDbvtVolume      pb=prev->volume;
+                       Merge(prev->childs[0]->volume,prev->childs[1]->volume,prev->volume);
+                       if(NotEqual(pb,prev->volume))
+                               {
+                               prev=prev->parent;
+                               } else break;
+                       }
+               return(prev?prev:pdbvt->m_root);
+