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/SpuGatheringCollisionDispatcher.h"
|
||||||
#include "BulletMultiThreaded/SequentialThreadSupport.h"
|
#include "BulletMultiThreaded/SequentialThreadSupport.h"
|
||||||
#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
||||||
|
#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -221,7 +221,7 @@ void BenchmarkDemo::clientMoveAndDisplay()
|
|||||||
///step the simulation
|
///step the simulation
|
||||||
if (m_dynamicsWorld)
|
if (m_dynamicsWorld)
|
||||||
{
|
{
|
||||||
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
|
m_dynamicsWorld->stepSimulation(btScalar(1./60.));
|
||||||
//optional but useful: debug drawing
|
//optional but useful: debug drawing
|
||||||
m_dynamicsWorld->debugDrawWorld();
|
m_dynamicsWorld->debugDrawWorld();
|
||||||
}
|
}
|
||||||
@@ -300,7 +300,10 @@ void BenchmarkDemo::initPhysics()
|
|||||||
|
|
||||||
m_solver = sol;
|
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));
|
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ int main(int argc,char** argv)
|
|||||||
{
|
{
|
||||||
GLDebugDrawer gDebugDrawer;
|
GLDebugDrawer gDebugDrawer;
|
||||||
|
|
||||||
// BenchmarkDemo1 benchmarkDemo;
|
BenchmarkDemo1 benchmarkDemo;
|
||||||
BenchmarkDemo2 benchmarkDemo;
|
// BenchmarkDemo2 benchmarkDemo;
|
||||||
// BenchmarkDemo3 benchmarkDemo;
|
// BenchmarkDemo3 benchmarkDemo;
|
||||||
// BenchmarkDemo4 benchmarkDemo;
|
// BenchmarkDemo4 benchmarkDemo;
|
||||||
// BenchmarkDemo5 benchmarkDemo;
|
// BenchmarkDemo5 benchmarkDemo;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void CharacterDemo::initPhysics()
|
|||||||
///only collide with static for now (no interaction with dynamic objects)
|
///only collide with static for now (no interaction with dynamic objects)
|
||||||
m_dynamicsWorld->addCollisionObject(m_ghostObject,btBroadphaseProxy::CharacterFilter, btBroadphaseProxy::StaticFilter|btBroadphaseProxy::DefaultFilter);
|
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);
|
virtual void keyboardCallback(unsigned char key, int x, int y);
|
||||||
|
|
||||||
///Demo functions
|
///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;
|
//m_debugMode |= btIDebugDraw::DBG_DrawWireframe;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1834,7 +1838,7 @@ void ConcaveDemo::keyboardCallback(unsigned char key, int x, int y)
|
|||||||
|
|
||||||
case '.':
|
case '.':
|
||||||
{
|
{
|
||||||
shootTrimesh(getCameraTargetPosition());
|
shootTrimesh(getCameraPosition(),getCameraTargetPosition());
|
||||||
break;
|
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)
|
if (m_dynamicsWorld)
|
||||||
@@ -1870,16 +1874,15 @@ void ConcaveDemo::shootTrimesh(const btVector3& destination)
|
|||||||
float mass = 4.f;
|
float mass = 4.f;
|
||||||
btTransform startTransform;
|
btTransform startTransform;
|
||||||
startTransform.setIdentity();
|
startTransform.setIdentity();
|
||||||
btVector3 camPos = getCameraPosition();
|
startTransform.setOrigin(startPosition);
|
||||||
startTransform.setOrigin(camPos);
|
|
||||||
|
|
||||||
btRigidBody* body = this->localCreateRigidBody(mass, startTransform,m_trimeshShape);
|
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.normalize();
|
||||||
linVel*=m_ShootBoxInitialSpeed*0.25;
|
linVel*=m_ShootBoxInitialSpeed*0.25;
|
||||||
|
|
||||||
body->getWorldTransform().setOrigin(camPos);
|
body->getWorldTransform().setOrigin(startPosition);
|
||||||
body->getWorldTransform().setRotation(btQuaternion(0,0,0,1));
|
body->getWorldTransform().setRotation(btQuaternion(0,0,0,1));
|
||||||
body->setLinearVelocity(linVel);
|
body->setLinearVelocity(linVel);
|
||||||
body->setAngularVelocity(btVector3(0,0,0));
|
body->setAngularVelocity(btVector3(0,0,0));
|
||||||
|
|||||||
Reference in New Issue
Block a user