diff --git a/Levels/ObjectSetups/Compositions.xml b/Levels/ObjectSetups/Compositions.xml index d94a01c..7792f76 100644 --- a/Levels/ObjectSetups/Compositions.xml +++ b/Levels/ObjectSetups/Compositions.xml @@ -151,6 +151,17 @@ switch_outer.obj 0.0 -1 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 1.0 + + + switch_outerBox + 0.0 + -1 1.105 0.0 0.0 @@ -159,7 +170,7 @@ 0.0 - switch_outer.obj + switch_outerBox 0.0 -1 -1.105 @@ -170,7 +181,7 @@ 0.0 - switch_outer.obj + switch_outerBox 1.105 -1 0.0 @@ -181,7 +192,7 @@ 0.0 - switch_outer.obj + switch_outerBox -1.105 -1 0.0 @@ -192,7 +203,7 @@ 0.0 - switch_outer.obj + switch_outerBox 0.0 -2.105 0.0 @@ -525,18 +536,24 @@ - switch_outer.obj - switchTextureOuter.png - 0.1 - 0.6 - 0.4 - 2.0 + switch_outerBox Box 2.54 2.54 0.33 0.555 0.5 + false + + + + switch_outer.obj + switchTextureOuter.png + 0.1 + 0.6 + 0.4 + 2.0 + None true diff --git a/loader.cc b/loader.cc index c1f58dc..42afd88 100644 --- a/loader.cc +++ b/loader.cc @@ -192,17 +192,18 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa errorCheck(xmlObject->FirstChildElement("mass")->QueryFloatText(&mass)); XMLElement* constraint = thisComposition->FirstChildElement("positionConstraint"); bool rotate = (constraint == NULL); - float dampningL, dampningA; - errorCheck(objectData->FirstChildElement("dampningL")->QueryFloatText(&dampningL)); - errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA)); if (physicType.compare("Player") == 0){ - float radius; + float radius, dampningL, dampningA; + errorCheck(objectData->FirstChildElement("dampningL")->QueryFloatText(&dampningL)); + errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA)); errorCheck(objectData->FirstChildElement("radius")->QueryFloatText(&radius)); radius *= objectScale*compScale; level->addPhysicsObject(object); level->getPhysics()->addPlayer(friction, radius, *object, mass, dampningL, dampningA, level->getPhysicsObjectsVectorSize()); }else if (physicType.compare("Box") == 0){ - float width, height, length; + float width, height, length, dampningL, dampningA; + errorCheck(objectData->FirstChildElement("dampningL")->QueryFloatText(&dampningL)); + errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA)); errorCheck(objectData->FirstChildElement("width")->QueryFloatText(&width)); errorCheck(objectData->FirstChildElement("height")->QueryFloatText(&height)); errorCheck(objectData->FirstChildElement("length")->QueryFloatText(&length)); @@ -212,7 +213,9 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa level->addPhysicsObject(object); level->getPhysics()->addBox(width, height, length, *object, mass, dampningL, dampningA, level->getPhysicsObjectsVectorSize(), rotate); }else if (physicType.compare("Button") == 0){ - float width, height, length; + float width, height, length, dampningL, dampningA; + errorCheck(objectData->FirstChildElement("dampningL")->QueryFloatText(&dampningL)); + errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA)); errorCheck(objectData->FirstChildElement("width")->QueryFloatText(&width)); errorCheck(objectData->FirstChildElement("height")->QueryFloatText(&height)); errorCheck(objectData->FirstChildElement("length")->QueryFloatText(&length)); @@ -222,6 +225,9 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa level->addPhysicsObject(object); level->getPhysics()->addButton(width, height, length, *object, mass, dampningL, dampningA, level->getPhysicsObjectsVectorSize(), rotate); }else if (physicType.compare("TriangleMesh") == 0){ + float dampningL, dampningA; + errorCheck(objectData->FirstChildElement("dampningL")->QueryFloatText(&dampningL)); + errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA)); level->addPhysicsObject(object); level->getPhysics()->addTriangleMeshBody(*object, modelPath, mass, dampningL, dampningA, level->getPhysicsObjectsVectorSize(), objectScale*compScale, rotate); }else if (physicType.compare("None") == 0){