improve BasicDemo, better mouse handling, add colors to drawing
This commit is contained in:
@@ -39,7 +39,7 @@ void BasicDemoPhysicsSetup::initPhysics()
|
||||
|
||||
{
|
||||
btScalar mass(0.);
|
||||
createRigidBody(mass,groundTransform,groundShape);
|
||||
createRigidBody(mass,groundTransform,groundShape, btVector4(0,0,1,1));
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ btBoxShape* BasicDemoPhysicsSetup::createBoxShape(const btVector3& halfExtents)
|
||||
return box;
|
||||
}
|
||||
|
||||
btRigidBody* BasicDemoPhysicsSetup::createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape)
|
||||
btRigidBody* BasicDemoPhysicsSetup::createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape, const btVector4& color)
|
||||
{
|
||||
btAssert((!shape || shape->getShapeType() != INVALID_SHAPE_PROXYTYPE));
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ class btDiscreteDynamicsWorld;
|
||||
class btTransform;
|
||||
class btVector3;
|
||||
class btBoxShape;
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
|
||||
@@ -31,7 +32,7 @@ struct BasicDemoPhysicsSetup
|
||||
|
||||
virtual void stepSimulation(float deltaTime);
|
||||
|
||||
virtual btRigidBody* createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape);
|
||||
virtual btRigidBody* createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape, const btVector4& color=btVector4(1,0,0,1));
|
||||
|
||||
virtual btBoxShape* createBoxShape(const btVector3& halfExtents);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user