prosperon/source/engine/3dphysics.c

48 lines
1.6 KiB
C
Raw Normal View History

2021-11-30 21:29:18 -06:00
#include <3dphysics.h>
/*
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);
}
*/