From 2edbb196c29938f45f6a531e0afff0f5c00aae70 Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 19 Jan 2015 15:24:44 +0100 Subject: [PATCH 1/3] added trimesh back to collision --- physics.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics.cc b/physics.cc index e34f005..70d68e3 100644 --- a/physics.cc +++ b/physics.cc @@ -148,7 +148,7 @@ void Physics::addPlayer(float friction, float rad, Entity entity, float mass, fl btRigidBody::btRigidBodyConstructionInfo info(mass,motion,sphere,inertia); - info.m_friction = friction; + info.m_friction = friction*2; info.m_restitution = 0.0f; playerBall = new btRigidBody(info); @@ -229,7 +229,7 @@ void Physics::addTriangleMeshBody(Entity entity, std::string path, float mass, f bodies.push_back(body); - world->addRigidBody(body); + world->addRigidBody(body,COL_OBJECTS, objectsPhysicsCollision); if(bodies.size() != indice) @@ -366,7 +366,7 @@ void Physics::addCamera(float rad, float distance) cameraBody->setDamping(0.9f,1.0f); - world->addRigidBody(cameraBody); + world->addRigidBody(cameraBody,COL_OBJECTS, objectsPhysicsCollision); cameraBody->setSleepingThresholds(0,0); From bcdbb2534ceca27cea956b9f339ea12e096c6a6a Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 19 Jan 2015 15:33:44 +0100 Subject: [PATCH 2/3] small changes to trimesh scaling --- Levels/ObjectSetups/Level1.xml | 33 --------------------------------- physics.cc | 2 +- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/Levels/ObjectSetups/Level1.xml b/Levels/ObjectSetups/Level1.xml index 2beeb34..b0876d3 100644 --- a/Levels/ObjectSetups/Level1.xml +++ b/Levels/ObjectSetups/Level1.xml @@ -13779,40 +13779,7 @@ 0.0 0.0 false -<<<<<<< HEAD 81.500000 -======= - 212.500000 - 3.0 - -222.500000 - 1 - 67 - 40 - - - - 0 - 0 - 0 - - - - - 1.0 - false - 0 - - - 0 - 0 - 0 - - - - - 1.0 - 0.0 - 0.0 - 0.0 - false - 210.500000 ->>>>>>> 12ee9a4ac5b8c3350e8afc3b6b251992020790e2 0.0 -244.500000 1 diff --git a/physics.cc b/physics.cc index 70d68e3..c93c7aa 100644 --- a/physics.cc +++ b/physics.cc @@ -212,7 +212,7 @@ void Physics::addTriangleMeshBody(Entity entity, std::string path, float mass, f } btBvhTriangleMeshShape* shape = new btBvhTriangleMeshShape(triMesh,true); - shape->setLocalScaling(btVector3(0.5f,0.5f,0.5f)); + shape->setLocalScaling(btVector3(1.5,1.5,1.5)); btDefaultMotionState* motion = new btDefaultMotionState(btTransform(btQuaternion(0,0,0,1),btVector3(entity.getPosition().x,entity.getPosition().y,entity.getPosition().z))); btVector3 inertia(0,0,0); From 4c71dbfbeac7536f12d88dfe1b87fca59e5c9451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Mon, 19 Jan 2015 15:55:03 +0100 Subject: [PATCH 3/3] Added rotation in Compompositions.xml. --- Levels/ObjectSetups/Compositions.xml | 42 ++++++++++++++++++++++++++++ level.cc | 6 +++- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/Levels/ObjectSetups/Compositions.xml b/Levels/ObjectSetups/Compositions.xml index 9bf6deb..e133071 100644 --- a/Levels/ObjectSetups/Compositions.xml +++ b/Levels/ObjectSetups/Compositions.xml @@ -7,6 +7,9 @@ 0.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.0 8.0 @@ -21,6 +24,9 @@ 0.0 1.0 0.0 + 0.0 + 0.0 + 0.0 1.5 25.0 @@ -35,6 +41,9 @@ 0.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.0 0.0 @@ -49,6 +58,9 @@ 0.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.0 0.0 @@ -87,6 +99,9 @@ 0.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -95,6 +110,9 @@ 2.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -103,6 +121,9 @@ 1.0 3.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -117,6 +138,9 @@ 0.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.0 1.0 @@ -125,6 +149,9 @@ 0.0 0.0 0.0 + 0.0 + 0.0 + 0.0 1.0 0.0 @@ -139,6 +166,9 @@ 0.0 20.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -153,6 +183,9 @@ 0.0 20.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -161,6 +194,9 @@ 0.0 18.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -169,6 +205,9 @@ 0.0 15.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 @@ -177,6 +216,9 @@ 0.0 12.0 0.0 + 0.0 + 0.0 + 0.0 1.5 0.0 diff --git a/level.cc b/level.cc index 97e1ad7..d6b90ca 100644 --- a/level.cc +++ b/level.cc @@ -221,7 +221,11 @@ void Level::load() { * glm::rotate(compRot.z, glm::vec3(0.0f, 0.0f, 1.0f)) * glm::vec4(objectOffset, 0); glm::vec3 objectPosition = compPos + glm::vec3(rotatedObjectOffset.x,rotatedObjectOffset.y,rotatedObjectOffset.z); - Object* object = new Object(model, material, objectPosition, compRot); + glm::vec3 objectRot; + errorCheck(xmlObject->FirstChildElement("xRot")->QueryFloatText(&objectRot[0])); + errorCheck(xmlObject->FirstChildElement("yRot")->QueryFloatText(&objectRot[1])); + errorCheck(xmlObject->FirstChildElement("zRot")->QueryFloatText(&objectRot[2])); + Object* object = new Object(model, material, objectPosition, compRot+objectRot); objects.push_back(object); //create an identifier for this object std::vector objectIdentifier = std::vector(4);