From bbc8c03e530ff3f25718572c435cd2336875c23b Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 19 Jan 2015 18:30:07 +0100 Subject: [PATCH] Added physics type button. --- level.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/level.cc b/level.cc index 2c65496..58da1af 100644 --- a/level.cc +++ b/level.cc @@ -256,12 +256,19 @@ void Level::load() { errorCheck(objectData->FirstChildElement("height")->QueryFloatText(&height)); errorCheck(objectData->FirstChildElement("length")->QueryFloatText(&length)); 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){ - this->physics.addTriangleMeshBody(*object, modelPath, mass, dampningL, dampningA, physicObjects.size()); } else{ printf("XMLError: Not a valid physicType.\n"); + exit(-1); } + if(compositionType == 20){ cameraCenter = object;