From c1c0cc28811d52dea9194ee005c00f1eadbf472c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=BCndgens?= Date: Fri, 23 Jan 2015 16:51:09 +0100 Subject: [PATCH] Rotate parameter for physics.add should now be false if the object has a positionConstraint. --- level.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/level.cc b/level.cc index 4195642..1dcee99 100644 --- a/level.cc +++ b/level.cc @@ -254,7 +254,8 @@ void Level::load() { float mass; errorCheck(xmlObject->FirstChildElement("mass")->QueryFloatText(&mass)); float dampningL, dampningA; - bool rotate = true; + XMLElement* constraint = thisComposition->FirstChildElement("positionConstraint"); + bool rotate = (constraint == NULL); errorCheck(objectData->FirstChildElement("dampningL")->QueryFloatText(&dampningL)); errorCheck(objectData->FirstChildElement("dampningA")->QueryFloatText(&dampningA)); if (physicType.compare("Player") == 0){ @@ -417,7 +418,7 @@ void Level::load() { XMLElement* positionConstraint = composition->FirstChildElement("positionConstraint"); for(; positionConstraint; positionConstraint=positionConstraint->NextSiblingElement("positionConstraint")){ float xPos, yPos, zPos, strength; - int objectNum, idGreen, idBlue, objectIndex; + int objectNum=0, idGreen=0, idBlue=0, objectIndex=0; errorCheck(positionConstraint->FirstChildElement("xPosition")->QueryFloatText(&xPos)); errorCheck(positionConstraint->FirstChildElement("yPosition")->QueryFloatText(&yPos)); errorCheck(positionConstraint->FirstChildElement("zPosition")->QueryFloatText(&zPos));