Added physics type button.
This commit is contained in:
parent
bd75820471
commit
bbc8c03e53
9
level.cc
9
level.cc
@ -256,13 +256,20 @@ void Level::load() {
|
|||||||
errorCheck(objectData->FirstChildElement("height")->QueryFloatText(&height));
|
errorCheck(objectData->FirstChildElement("height")->QueryFloatText(&height));
|
||||||
errorCheck(objectData->FirstChildElement("length")->QueryFloatText(&length));
|
errorCheck(objectData->FirstChildElement("length")->QueryFloatText(&length));
|
||||||
this->physics.addBox(width, height, length, *object, mass, dampningL, dampningA, physicObjects.size());
|
this->physics.addBox(width, height, length, *object, mass, dampningL, dampningA, physicObjects.size());
|
||||||
|
}else if (physicType.compare("Button") == 0){
|
||||||
|
float width, height, length;
|
||||||
|
errorCheck(objectData->FirstChildElement("width")->QueryFloatText(&width));
|
||||||
|
errorCheck(objectData->FirstChildElement("height")->QueryFloatText(&height));
|
||||||
|
errorCheck(objectData->FirstChildElement("length")->QueryFloatText(&length));
|
||||||
|
this->physics.addButton(width, height, length, *object, mass, dampningL, dampningA, physicObjects.size());
|
||||||
}else if (physicType.compare("TriangleMesh") == 0){
|
}else if (physicType.compare("TriangleMesh") == 0){
|
||||||
|
|
||||||
this->physics.addTriangleMeshBody(*object, modelPath, mass, dampningL, dampningA, physicObjects.size());
|
this->physics.addTriangleMeshBody(*object, modelPath, mass, dampningL, dampningA, physicObjects.size());
|
||||||
} else{
|
} else{
|
||||||
printf("XMLError: Not a valid physicType.\n");
|
printf("XMLError: Not a valid physicType.\n");
|
||||||
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(compositionType == 20){
|
if(compositionType == 20){
|
||||||
cameraCenter = object;
|
cameraCenter = object;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user