From 2831e232b886c5e3b0791ea5192f9e5194e6abf3 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Fri, 9 Mar 2018 23:55:49 -0500 Subject: Added IGUIImages Added the ability to display itextures on the gui --- src/shared/phys/physcommon.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/shared/phys/physcommon.cpp') diff --git a/src/shared/phys/physcommon.cpp b/src/shared/phys/physcommon.cpp index c15274d..4f506bb 100644 --- a/src/shared/phys/physcommon.cpp +++ b/src/shared/phys/physcommon.cpp @@ -32,7 +32,7 @@ btCollisionDispatcher* Dispatcher; btSequentialImpulseConstraintSolver* Solver; void phys_genesis(){ - BroadPhase = new btAxisSweep3(btVector3(-1000, -1000, -1000), btVector3(1000, 1000, 1000)); + BroadPhase = new btAxisSweep3(btVector3(-1000,-1000,-1000),btVector3(1000,1000,1000)); printf("Broadphase\n"); CollisionConfiguration = new btDefaultCollisionConfiguration(); printf("Collision config\n"); @@ -42,6 +42,8 @@ void phys_genesis(){ printf("Solver\n"); World = new btDiscreteDynamicsWorld(Dispatcher, BroadPhase, Solver, CollisionConfiguration); printf("Physics world init ok.\n"); + World->setGravity(btVector3(0,-10,0)); + printf("Created physics world: %p\n",World); } void phys_shutdown(void(*f)(btRigidBody*)){ @@ -65,7 +67,7 @@ void phys_shutdown(void(*f)(btRigidBody*)){ // Runs the physics simulation. // - TDeltaTime tells the simulation how much time has passed since the last frame so the simulation can run independently of the frame rate. Optionally pass in an argument that will be called on every rigidbody in the world void UpdatePhysics(double TDeltaTime, void(*f)(btRigidBody*)) { - World->stepSimulation(TDeltaTime * 0.02f, 60); + World->stepSimulation(TDeltaTime * 0.2f, 60); if(f){ // Relay the object's orientation to irrlicht for(std::list::iterator it = Objects.begin(); it != Objects.end(); ++it) { @@ -78,7 +80,7 @@ high_resolution_clock::time_point t1 = high_resolution_clock::now(); void gameloop_phys(void(*f)(btRigidBody*)){ high_resolution_clock::time_point now = high_resolution_clock::now(); duration delta = now-t1; - double steps = delta.count() * 100; + double steps = delta.count() * 10; UpdatePhysics(steps,f); t1 = now; } -- cgit v1.2.3-70-g09d2