perform GrahamScanConvexHull2D around an arbitrary oriented 2D plane in 3D, to fix some convex hull face merging problems
add compound shape support to BulletXmlWorldImporter and fix some compile issue under Debian (hopefully) object picking change in the demos: create a ball-socket picking constraint when holding shift while mouse dragging, otherwise a fixed (6dof) constraint add assert in constraint solver, when both objects have their inertia tensor rows set to zero btPolyhedralContactClipping: add edge-edge contact point in findSeparatingAxis (similar to the default GJK case)
This commit is contained in:
@@ -28,15 +28,24 @@ subject to the following restrictions:
|
||||
#include <stdio.h> //printf debugging
|
||||
|
||||
|
||||
|
||||
#include "GLDebugDrawer.h"
|
||||
GLDebugDrawer gDebugDrawer;
|
||||
|
||||
|
||||
void BulletXmlImportDemo::initPhysics()
|
||||
{
|
||||
setTexturing(true);
|
||||
setTexturing(true);
|
||||
setShadows(true);
|
||||
|
||||
setCameraDistance(btScalar(30.));
|
||||
|
||||
|
||||
setupEmptyDynamicsWorld();
|
||||
|
||||
|
||||
m_dynamicsWorld->setDebugDrawer(&gDebugDrawer);
|
||||
|
||||
|
||||
btBulletXmlWorldImporter* importer = new btBulletXmlWorldImporter(m_dynamicsWorld);
|
||||
importer->loadFile("bullet_basic.xml");
|
||||
// importer->loadFile("bulletser.xml");
|
||||
@@ -54,6 +63,8 @@ void BulletXmlImportDemo::clientMoveAndDisplay()
|
||||
///step the simulation
|
||||
if (m_dynamicsWorld)
|
||||
{
|
||||
|
||||
|
||||
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
|
||||
m_dynamicsWorld->debugDrawWorld();
|
||||
}
|
||||
@@ -90,6 +101,7 @@ void BulletXmlImportDemo::setupEmptyDynamicsWorld()
|
||||
|
||||
///use the default collision dispatcher. For parallel processing you can use a diffent dispatcher (see Extras/BulletMultiThreaded)
|
||||
m_dispatcher = new btCollisionDispatcher(m_collisionConfiguration);
|
||||
|
||||
btGImpactCollisionAlgorithm::registerAlgorithm(m_dispatcher);
|
||||
|
||||
m_broadphase = new btDbvtBroadphase();
|
||||
@@ -101,7 +113,7 @@ void BulletXmlImportDemo::setupEmptyDynamicsWorld()
|
||||
|
||||
//btGImpactCollisionAlgorithm::registerAlgorithm((btCollisionDispatcher*)m_dynamicsWorld->getDispatcher());
|
||||
|
||||
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +127,11 @@ BulletXmlImportDemo::~BulletXmlImportDemo()
|
||||
exitPhysics();
|
||||
}
|
||||
|
||||
|
||||
void BulletXmlImportDemo::clientResetScene()
|
||||
{
|
||||
exitPhysics();
|
||||
initPhysics();
|
||||
}
|
||||
|
||||
|
||||
void BulletXmlImportDemo::exitPhysics()
|
||||
|
||||
@@ -55,9 +55,13 @@ class BulletXmlImportDemo : public PlatformDemoApplication
|
||||
|
||||
BulletXmlImportDemo()
|
||||
{
|
||||
//m_idle=true;
|
||||
setCameraDistance(btScalar(30.));
|
||||
}
|
||||
virtual ~BulletXmlImportDemo();
|
||||
|
||||
virtual void clientResetScene();
|
||||
|
||||
void initPhysics();
|
||||
|
||||
void setupEmptyDynamicsWorld();
|
||||
|
||||
@@ -11,9 +11,6 @@ SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut)
|
||||
# You shouldn't have to modify anything below this line
|
||||
########################################################
|
||||
|
||||
IF(BUILD_AMD_OPENCL_DEMOS)
|
||||
SUBDIRS(AMD)
|
||||
ENDIF()
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||
|
||||
@@ -15,12 +15,11 @@ subject to the following restrictions:
|
||||
|
||||
#include "BulletXmlImportDemo.h"
|
||||
#include "GlutStuff.h"
|
||||
#include "GLDebugDrawer.h"
|
||||
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
#include "LinearMath/btHashMap.h"
|
||||
|
||||
|
||||
|
||||
#ifdef USE_AMD_OPENCL
|
||||
|
||||
|
||||
@@ -84,7 +83,7 @@ bool initCL( void* glCtx, void* glDC )
|
||||
|
||||
int main(int argc,char** argv)
|
||||
{
|
||||
GLDebugDrawer gDebugDrawer;
|
||||
|
||||
#ifdef USE_AMD_OPENCL
|
||||
|
||||
bool initialized = initCL(0,0);
|
||||
@@ -94,8 +93,7 @@ int main(int argc,char** argv)
|
||||
|
||||
BulletXmlImportDemo serializeDemo;
|
||||
serializeDemo.initPhysics();
|
||||
serializeDemo.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer);
|
||||
|
||||
|
||||
|
||||
#ifdef CHECK_MEMORY_LEAKS
|
||||
serializeDemo.exitPhysics();
|
||||
|
||||
Reference in New Issue
Block a user