update build for btConvex2dShape functionality
use btDbvtBroadphase in HelloWorld demo, it is the recommended broadphase
This commit is contained in:
@@ -23,8 +23,8 @@ subject to the following restrictions:
|
||||
#include "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.h"
|
||||
|
||||
///create 125 (5x5x5) dynamic object
|
||||
#define ARRAY_SIZE_X 1
|
||||
#define ARRAY_SIZE_Y 2
|
||||
#define ARRAY_SIZE_X 15
|
||||
#define ARRAY_SIZE_Y 15
|
||||
#define ARRAY_SIZE_Z 1
|
||||
|
||||
//maximum number of objects (and allow user to shoot additional boxes)
|
||||
@@ -218,7 +218,7 @@ void Box2dDemo::initPhysics()
|
||||
btRigidBody::btRigidBodyConstructionInfo rbInfo(0,0,0);
|
||||
switch (j%3)
|
||||
{
|
||||
#if 0
|
||||
#if 1
|
||||
case 0:
|
||||
rbInfo = btRigidBody::btRigidBodyConstructionInfo(mass,myMotionState,colShape,localInertia);
|
||||
break;
|
||||
@@ -227,7 +227,7 @@ void Box2dDemo::initPhysics()
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
rbInfo = btRigidBody::btRigidBodyConstructionInfo(mass,myMotionState,colShape3,localInertia);
|
||||
rbInfo = btRigidBody::btRigidBodyConstructionInfo(mass,myMotionState,colShape2,localInertia);
|
||||
}
|
||||
btRigidBody* body = new btRigidBody(rbInfo);
|
||||
//body->setContactProcessingThreshold(colShape->getContactBreakingThreshold());
|
||||
@@ -239,8 +239,8 @@ void Box2dDemo::initPhysics()
|
||||
body->setActivationState(ISLAND_SLEEPING);
|
||||
|
||||
|
||||
y += -0.8*deltaY;
|
||||
//y += deltaY;
|
||||
// y += -0.8*deltaY;
|
||||
y += deltaY;
|
||||
}
|
||||
|
||||
x += deltaX;
|
||||
|
||||
@@ -22,11 +22,7 @@ OpenGLSupport BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY
|
||||
ADD_EXECUTABLE(AppBox2dDemo
|
||||
main.cpp
|
||||
Box2dDemo.cpp
|
||||
btBox2dBox2dCollisionAlgorithm.h
|
||||
Box2dDemo.h
|
||||
btBox2dShape.cpp
|
||||
btBox2dBox2dCollisionAlgorithm.cpp
|
||||
btBox2dShape.h
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -30,12 +30,8 @@ int main(int argc, char** argv)
|
||||
///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
|
||||
btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
|
||||
|
||||
///the maximum size of the collision world. Make sure objects stay within these boundaries
|
||||
///Don't make the world AABB size too large, it will harm simulation quality and performance
|
||||
btVector3 worldAabbMin(-10000,-10000,-10000);
|
||||
btVector3 worldAabbMax(10000,10000,10000);
|
||||
int maxProxies = 1024;
|
||||
btAxisSweep3* overlappingPairCache = new btAxisSweep3(worldAabbMin,worldAabbMax,maxProxies);
|
||||
///btDbvtBroadphase is a good general purpose broadphase. You can also try out btAxis3Sweep.
|
||||
btBroadphaseInterface* overlappingPairCache = new btDbvtBroadphase();
|
||||
|
||||
///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
|
||||
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
|
||||
@@ -173,3 +169,4 @@ int main(int argc, char** argv)
|
||||
collisionShapes.clear();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -655,16 +655,16 @@ void VehicleDemo::updateCamera()
|
||||
}
|
||||
m_cameraPosition -= correctionFactor*camToObject;
|
||||
|
||||
//update OpenGL camera settings
|
||||
glFrustum(-1.0, 1.0, -1.0, 1.0, 1.0, 10000.0);
|
||||
btScalar aspect = m_glutScreenWidth / (btScalar)m_glutScreenHeight;
|
||||
glFrustum (-aspect, aspect, -1.0, 1.0, 1.0, 10000.0);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
gluLookAt(m_cameraPosition[0],m_cameraPosition[1],m_cameraPosition[2],
|
||||
m_cameraTargetPosition[0],m_cameraTargetPosition[1], m_cameraTargetPosition[2],
|
||||
m_cameraUp.getX(),m_cameraUp.getY(),m_cameraUp.getZ());
|
||||
|
||||
m_cameraTargetPosition[0],m_cameraTargetPosition[1], m_cameraTargetPosition[2],
|
||||
m_cameraUp.getX(),m_cameraUp.getY(),m_cameraUp.getZ());
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ SET(BulletCollision_SRCS
|
||||
BroadphaseCollision/btSimpleBroadphase.cpp
|
||||
CollisionDispatch/btActivatingCollisionAlgorithm.cpp
|
||||
CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp
|
||||
CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp
|
||||
CollisionDispatch/btBoxBoxDetector.cpp
|
||||
CollisionDispatch/btCollisionDispatcher.cpp
|
||||
CollisionDispatch/btCollisionObject.cpp
|
||||
@@ -21,6 +22,7 @@ SET(BulletCollision_SRCS
|
||||
CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp
|
||||
CollisionDispatch/btConvexConvexAlgorithm.cpp
|
||||
CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp
|
||||
CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp
|
||||
CollisionDispatch/btDefaultCollisionConfiguration.cpp
|
||||
CollisionDispatch/btEmptyCollisionAlgorithm.cpp
|
||||
CollisionDispatch/btGhostObject.cpp
|
||||
@@ -32,6 +34,7 @@ SET(BulletCollision_SRCS
|
||||
CollisionDispatch/btUnionFind.cpp
|
||||
CollisionDispatch/SphereTriangleDetector.cpp
|
||||
CollisionShapes/btBoxShape.cpp
|
||||
CollisionShapes/btBox2dShape.cpp
|
||||
CollisionShapes/btBvhTriangleMeshShape.cpp
|
||||
CollisionShapes/btCapsuleShape.cpp
|
||||
CollisionShapes/btCollisionShape.cpp
|
||||
@@ -42,6 +45,7 @@ SET(BulletCollision_SRCS
|
||||
CollisionShapes/btConvexInternalShape.cpp
|
||||
CollisionShapes/btConvexPointCloudShape.cpp
|
||||
CollisionShapes/btConvexShape.cpp
|
||||
CollisionShapes/btConvex2dShape.cpp
|
||||
CollisionShapes/btConvexTriangleMeshShape.cpp
|
||||
CollisionShapes/btCylinderShape.cpp
|
||||
CollisionShapes/btEmptyShape.cpp
|
||||
@@ -108,6 +112,7 @@ SET(BroadphaseCollision_HDRS
|
||||
SET(CollisionDispatch_HDRS
|
||||
CollisionDispatch/btActivatingCollisionAlgorithm.h
|
||||
CollisionDispatch/btBoxBoxCollisionAlgorithm.h
|
||||
CollisionDispatch/btBox2dBox2dCollisionAlgorithm.h
|
||||
CollisionDispatch/btBoxBoxDetector.h
|
||||
CollisionDispatch/btCollisionConfiguration.h
|
||||
CollisionDispatch/btCollisionCreateFunc.h
|
||||
@@ -117,6 +122,7 @@ SET(CollisionDispatch_HDRS
|
||||
CollisionDispatch/btCompoundCollisionAlgorithm.h
|
||||
CollisionDispatch/btConvexConcaveCollisionAlgorithm.h
|
||||
CollisionDispatch/btConvexConvexAlgorithm.h
|
||||
CollisionDispatch/btConvex2dConvex2dAlgorithm.h
|
||||
CollisionDispatch/btConvexPlaneCollisionAlgorithm.h
|
||||
CollisionDispatch/btDefaultCollisionConfiguration.h
|
||||
CollisionDispatch/btEmptyCollisionAlgorithm.h
|
||||
@@ -131,6 +137,7 @@ SET(CollisionDispatch_HDRS
|
||||
)
|
||||
SET(CollisionShapes_HDRS
|
||||
CollisionShapes/btBoxShape.h
|
||||
CollisionShapes/btBox2dShape.h
|
||||
CollisionShapes/btBvhTriangleMeshShape.h
|
||||
CollisionShapes/btCapsuleShape.h
|
||||
CollisionShapes/btCollisionMargin.h
|
||||
@@ -142,6 +149,7 @@ SET(CollisionShapes_HDRS
|
||||
CollisionShapes/btConvexInternalShape.h
|
||||
CollisionShapes/btConvexPointCloudShape.h
|
||||
CollisionShapes/btConvexShape.h
|
||||
CollisionShapes/btConvex2dShape.h
|
||||
CollisionShapes/btConvexTriangleMeshShape.h
|
||||
CollisionShapes/btCylinderShape.h
|
||||
CollisionShapes/btEmptyShape.h
|
||||
|
||||
Reference in New Issue
Block a user