updated Bullet_User_Manual.pdf
minor cosmetic changes in some demos
This commit is contained in:
Binary file not shown.
@@ -29,7 +29,7 @@ subject to the following restrictions:
|
||||
#include "BulletMultiThreaded/SpuGatheringCollisionDispatcher.h"
|
||||
#include "BulletMultiThreaded/SequentialThreadSupport.h"
|
||||
#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
||||
|
||||
#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
|
||||
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ void BenchmarkDemo::clientMoveAndDisplay()
|
||||
///step the simulation
|
||||
if (m_dynamicsWorld)
|
||||
{
|
||||
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
|
||||
m_dynamicsWorld->stepSimulation(btScalar(1./60.));
|
||||
//optional but useful: debug drawing
|
||||
m_dynamicsWorld->debugDrawWorld();
|
||||
}
|
||||
@@ -300,7 +300,10 @@ void BenchmarkDemo::initPhysics()
|
||||
|
||||
m_solver = sol;
|
||||
|
||||
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration);
|
||||
btDiscreteDynamicsWorld* dynamicsWorld;
|
||||
m_dynamicsWorld = dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration);
|
||||
dynamicsWorld->getSimulationIslandManager()->setSplitIslands(false);
|
||||
|
||||
|
||||
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ int main(int argc,char** argv)
|
||||
{
|
||||
GLDebugDrawer gDebugDrawer;
|
||||
|
||||
// BenchmarkDemo1 benchmarkDemo;
|
||||
BenchmarkDemo2 benchmarkDemo;
|
||||
BenchmarkDemo1 benchmarkDemo;
|
||||
// BenchmarkDemo2 benchmarkDemo;
|
||||
// BenchmarkDemo3 benchmarkDemo;
|
||||
// BenchmarkDemo4 benchmarkDemo;
|
||||
// BenchmarkDemo5 benchmarkDemo;
|
||||
|
||||
@@ -139,7 +139,7 @@ void CharacterDemo::initPhysics()
|
||||
///only collide with static for now (no interaction with dynamic objects)
|
||||
m_dynamicsWorld->addCollisionObject(m_ghostObject,btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter);
|
||||
|
||||
m_dynamicsWorld->addCharacter(m_character);
|
||||
m_dynamicsWorld->addAction(m_character);
|
||||
|
||||
|
||||
///////////////
|
||||
|
||||
@@ -39,7 +39,7 @@ class ConcaveDemo : public DemoApplication
|
||||
virtual void keyboardCallback(unsigned char key, int x, int y);
|
||||
|
||||
///Demo functions
|
||||
void shootTrimesh(const btVector3& destination);
|
||||
void shootTrimesh(const btVector3& startPosition,const btVector3& destination);
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -1717,6 +1717,10 @@ void ConcaveDemo::initPhysics()
|
||||
}
|
||||
}
|
||||
|
||||
shootTrimesh(btVector3(0,10,0),btVector3(0,0,0));
|
||||
|
||||
shootTrimesh(btVector3(0,20,0),btVector3(0,10,0));
|
||||
|
||||
//m_debugMode |= btIDebugDraw::DBG_DrawWireframe;
|
||||
|
||||
}
|
||||
@@ -1834,7 +1838,7 @@ void ConcaveDemo::keyboardCallback(unsigned char key, int x, int y)
|
||||
|
||||
case '.':
|
||||
{
|
||||
shootTrimesh(getCameraTargetPosition());
|
||||
shootTrimesh(getCameraPosition(),getCameraTargetPosition());
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1862,7 +1866,7 @@ void ConcaveDemo::keyboardCallback(unsigned char key, int x, int y)
|
||||
}
|
||||
|
||||
|
||||
void ConcaveDemo::shootTrimesh(const btVector3& destination)
|
||||
void ConcaveDemo::shootTrimesh(const btVector3& startPosition,const btVector3& destination)
|
||||
{
|
||||
|
||||
if (m_dynamicsWorld)
|
||||
@@ -1870,16 +1874,15 @@ void ConcaveDemo::shootTrimesh(const btVector3& destination)
|
||||
float mass = 4.f;
|
||||
btTransform startTransform;
|
||||
startTransform.setIdentity();
|
||||
btVector3 camPos = getCameraPosition();
|
||||
startTransform.setOrigin(camPos);
|
||||
startTransform.setOrigin(startPosition);
|
||||
|
||||
btRigidBody* body = this->localCreateRigidBody(mass, startTransform,m_trimeshShape);
|
||||
|
||||
btVector3 linVel(destination[0]-camPos[0],destination[1]-camPos[1],destination[2]-camPos[2]);
|
||||
btVector3 linVel(destination[0]-startPosition[0],destination[1]-startPosition[1],destination[2]-startPosition[2]);
|
||||
linVel.normalize();
|
||||
linVel*=m_ShootBoxInitialSpeed*0.25;
|
||||
|
||||
body->getWorldTransform().setOrigin(camPos);
|
||||
body->getWorldTransform().setOrigin(startPosition);
|
||||
body->getWorldTransform().setRotation(btQuaternion(0,0,0,1));
|
||||
body->setLinearVelocity(linVel);
|
||||
body->setAngularVelocity(btVector3(0,0,0));
|
||||
|
||||
Reference in New Issue
Block a user