Merge branch 'master' of https://github.com/Faerbit/swp
Conflicts: Levels/ObjectSetups/Level1.xml
This commit is contained in:
commit
e2c3be7d5d
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 594 B |
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
Levels/ObjectSetups/Level^.png
Normal file
BIN
Levels/ObjectSetups/Level^.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 75 B |
Binary file not shown.
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Binary file not shown.
6
level.cc
6
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<int> objectIdentifier = std::vector<int>(4);
|
||||
|
@ -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);
|
||||
@ -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);
|
||||
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user