Tried to adjust box.
This commit is contained in:
parent
e099c231c7
commit
9fd8ae5cd8
@ -18,7 +18,7 @@
|
|||||||
<yOffset>1.0</yOffset>
|
<yOffset>1.0</yOffset>
|
||||||
<zOffset>2.0</zOffset>
|
<zOffset>2.0</zOffset>
|
||||||
<scale>1.5</scale>
|
<scale>1.5</scale>
|
||||||
<mass>0.0</mass>
|
<mass>25.0</mass>
|
||||||
</object>
|
</object>
|
||||||
</composition>
|
</composition>
|
||||||
|
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<yOffset>0.0</yOffset>
|
<yOffset>0.0</yOffset>
|
||||||
<zOffset>0.0</zOffset>
|
<zOffset>0.0</zOffset>
|
||||||
<scale>1.0</scale>
|
<scale>1.0</scale>
|
||||||
<mass>2.0</mass>
|
<mass>0.0</mass>
|
||||||
</object>
|
</object>
|
||||||
</composition>
|
</composition>
|
||||||
|
|
||||||
@ -128,7 +128,7 @@
|
|||||||
<shininess>2.0</shininess>
|
<shininess>2.0</shininess>
|
||||||
<physicType>Box</physicType>
|
<physicType>Box</physicType>
|
||||||
<width>5.0</width>
|
<width>5.0</width>
|
||||||
<height>1.0</height>
|
<height>6.0</height>
|
||||||
<length>1.8</length>
|
<length>1.8</length>
|
||||||
</objectData>
|
</objectData>
|
||||||
|
|
||||||
|
13
level.cc
13
level.cc
@ -2,7 +2,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
using namespace tinyxml2;
|
using namespace tinyxml2;
|
||||||
|
|
||||||
|
//dowadiddydiddydumdiddydo
|
||||||
Level::Level(std::string levelNum){
|
Level::Level(std::string levelNum){
|
||||||
this->levelNum = levelNum;
|
this->levelNum = levelNum;
|
||||||
this->terrain = Terrain(levelNum);
|
this->terrain = Terrain(levelNum);
|
||||||
@ -11,14 +11,14 @@ Level::Level(std::string levelNum){
|
|||||||
|
|
||||||
Level::Level() {
|
Level::Level() {
|
||||||
}
|
}
|
||||||
|
//there she was just walking down the street singing
|
||||||
Level::~Level() {
|
Level::~Level() {
|
||||||
for(unsigned int i = 0; i<objects.size(); i++) {
|
for(unsigned int i = 0; i<objects.size(); i++) {
|
||||||
delete(objects.at(i));
|
delete(objects.at(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//dowadiddydiddydumdiddydoo!
|
||||||
void Level::errorCheck(XMLError error){
|
void Level::errorCheck(XMLError error){
|
||||||
if (error) {
|
if (error) {
|
||||||
printf("XMLError: ");
|
printf("XMLError: ");
|
||||||
@ -221,8 +221,7 @@ void Level::load() {
|
|||||||
errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA));
|
errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA));
|
||||||
std::string bulletModelPath = modelPath.substr(0, modelPath.length()-3);
|
std::string bulletModelPath = modelPath.substr(0, modelPath.length()-3);
|
||||||
bulletModelPath += "bullet";
|
bulletModelPath += "bullet";
|
||||||
//this->physics.addRigidBodyFromFile(*object, mass, dampningL, dampningA, bulletModelPath, physicObjects.size());
|
this->physics.addTriangleMeshBody(*object,modelPath,mass,0.5,0.5,physicObjects.size());
|
||||||
this->physics.addBox(1, 1, 1, *object, mass, physicObjects.size());
|
|
||||||
} else{
|
} else{
|
||||||
printf("XMLError: Not a valid physicType.\n");
|
printf("XMLError: Not a valid physicType.\n");
|
||||||
}
|
}
|
||||||
@ -305,7 +304,7 @@ void Level::load() {
|
|||||||
//add player (//TODO remove this as soon as we have a levelSetup with a player)
|
//add player (//TODO remove this as soon as we have a levelSetup with a player)
|
||||||
Model marbleModel = Model("marbleSmooth.obj", 0.75f);
|
Model marbleModel = Model("marbleSmooth.obj", 0.75f);
|
||||||
Material marbleMaterial = Material("Marbletexture.png", 0.1f, 0.5f, 0.5f, 3.0f);
|
Material marbleMaterial = Material("Marbletexture.png", 0.1f, 0.5f, 0.5f, 3.0f);
|
||||||
Object* object = new Object(marbleModel, marbleMaterial, glm::vec3(2.0f, 10.0f, 2.0f),
|
Object* object = new Object(marbleModel, marbleMaterial, glm::vec3(2.0f, 20.0f, 2.0f),
|
||||||
glm::vec3(0.0f, 0.0f, 0.0f));
|
glm::vec3(0.0f, 0.0f, 0.0f));
|
||||||
objects.push_back(object);
|
objects.push_back(object);
|
||||||
physicObjects.push_back(object);
|
physicObjects.push_back(object);
|
||||||
@ -335,7 +334,7 @@ void Level::update(float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPre
|
|||||||
camera.updateRotation(mouseDelta/100.0f);
|
camera.updateRotation(mouseDelta/100.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float str = 20;
|
float str = 30;
|
||||||
|
|
||||||
if(wPressed){
|
if(wPressed){
|
||||||
physics.rollForward(camera.getVector(),str);
|
physics.rollForward(camera.getVector(),str);
|
||||||
|
Loading…
Reference in New Issue
Block a user