2022-01-21 11:26:22 -06:00
|
|
|
#include "3dphysics.h"
|
2021-11-30 21:29:18 -06:00
|
|
|
|
|
|
|
/*
|
|
|
|
btDefaultCollisionConfiguration *collisionConfig {
|
|
|
|
NULL};
|
|
|
|
btCollisionDispatcher *dispatcher {
|
|
|
|
NULL};
|
|
|
|
btBroadphaseInterface *overlappingPairCache {
|
|
|
|
NULL};
|
|
|
|
btSequentialImpulseConstraintSolver *solver {
|
|
|
|
NULL};
|
|
|
|
btDiscreteDynamicsWorld *dynamicsWorld {
|
|
|
|
NULL};
|
|
|
|
btRigidBody *worldFloor {
|
|
|
|
NULL};
|
|
|
|
|
|
|
|
void btUpdate()
|
|
|
|
{
|
|
|
|
// dynamicsWorld->stepSimulation(deltaT);
|
|
|
|
}
|
|
|
|
|
|
|
|
void btInit()
|
|
|
|
{
|
|
|
|
// collisionConfig = new btDefaultCollisionConfiguration();
|
|
|
|
// dispatcher = new btCollisionDispatcher(collisionConfig);
|
|
|
|
// overlappingPairCache = new btDbvtBroadphase();
|
|
|
|
// solver = new btSequentialImpulseConstraintSolver;
|
|
|
|
// dynamicsWorld = new btDiscreteDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfig);
|
|
|
|
// dynamicsWorld->setGravity(btVector3(0.f, -9.8f, 0.f));
|
|
|
|
// btDebugDrawer = new BulletDebugDrawer_OpenGL();
|
|
|
|
// dynamicsWorld->setDebugDrawer(btDebugDrawer);
|
|
|
|
|
|
|
|
|
|
|
|
//btDebugDrawer->setDebugMode(btIDebugDraw::DBG_DrawWireframe | btIDebugDraw::DBG_DrawAabb);
|
|
|
|
// Add camera and plane to world
|
|
|
|
// dynamicsWorld->addRigidBody(camera.body);
|
|
|
|
// camera.body->setGravity(btVector3(0.f, 0.f, 0.f));
|
|
|
|
|
|
|
|
// Create and add plane
|
|
|
|
// btStaticPlaneShape* floorShape = new btStaticPlaneShape(btVector3(0.f, 1.f, 0.f), 0.f);
|
|
|
|
// btDefaultMotionState* motionState = new btDefaultMotionState();
|
|
|
|
// btVector3 bodyInertia;
|
|
|
|
// btRigidBody::btRigidBodyConstructionInfo bodyCI = btRigidBody::btRigidBodyConstructionInfo(0.f, motionState, floorShape, bodyInertia);
|
|
|
|
// worldFloor = new btRigidBody(bodyCI);
|
|
|
|
// dynamicsWorld->addRigidBody(worldFloor);
|
|
|
|
}
|
|
|
|
*/
|