aboutsummaryrefslogtreecommitdiff
path: root/src/shared/phys/physcommon.cpp
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2018-03-09 23:55:49 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2018-03-09 23:55:49 -0500
commit2831e232b886c5e3b0791ea5192f9e5194e6abf3 (patch)
tree4fb9309d18f388673b7a21b8f0e927727006f585 /src/shared/phys/physcommon.cpp
parent35b7c646fd7f80b64c1ef49b6d81f9df9bc1b940 (diff)
downloadbrokengine-2831e232b886c5e3b0791ea5192f9e5194e6abf3.tar.gz
brokengine-2831e232b886c5e3b0791ea5192f9e5194e6abf3.tar.bz2
brokengine-2831e232b886c5e3b0791ea5192f9e5194e6abf3.zip
Added IGUIImages
Added the ability to display itextures on the gui
Diffstat (limited to 'src/shared/phys/physcommon.cpp')
-rw-r--r--src/shared/phys/physcommon.cpp8
1 files changed, 5 insertions, 3 deletions
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<btRigidBody *>::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<double> delta = now-t1;
- double steps = delta.count() * 100;
+ double steps = delta.count() * 10;
UpdatePhysics(steps,f);
t1 = now;
}