Added ignoreHeightmap option to compositions in Compositions.xml.
This commit is contained in:
parent
02a9cd7559
commit
147ae17789
@ -1,6 +1,7 @@
|
|||||||
<!-- Marble -->
|
<!-- Marble -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>20</typeID>
|
<typeID>20</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>marbleSmooth.obj</modelPath>
|
<modelPath>marbleSmooth.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
@ -14,6 +15,7 @@
|
|||||||
<!-- Block -->
|
<!-- Block -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>40</typeID>
|
<typeID>40</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>block.obj</modelPath>
|
<modelPath>block.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
@ -27,6 +29,7 @@
|
|||||||
<!-- Column -->
|
<!-- Column -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>60</typeID>
|
<typeID>60</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>column.obj</modelPath>
|
<modelPath>column.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
@ -40,6 +43,7 @@
|
|||||||
<!-- Torch with Lightsource -->
|
<!-- Torch with Lightsource -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>80</typeID>
|
<typeID>80</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>torch.obj</modelPath>
|
<modelPath>torch.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
@ -62,6 +66,7 @@
|
|||||||
<!-- Lightsource -->
|
<!-- Lightsource -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>85</typeID>
|
<typeID>85</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<light>
|
<light>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
<yOffset>1</yOffset>
|
<yOffset>1</yOffset>
|
||||||
@ -76,6 +81,7 @@
|
|||||||
<!-- Block on 2 Pillars -->
|
<!-- Block on 2 Pillars -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>100</typeID>
|
<typeID>100</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>column.obj</modelPath>
|
<modelPath>column.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
@ -105,6 +111,7 @@
|
|||||||
<!-- Switch -->
|
<!-- Switch -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>120</typeID>
|
<typeID>120</typeID>
|
||||||
|
<ignoreHeightmap>false</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>switch_inner.obj</modelPath>
|
<modelPath>switch_inner.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
@ -123,13 +130,14 @@
|
|||||||
</object>
|
</object>
|
||||||
</composition>
|
</composition>
|
||||||
|
|
||||||
<!-- Static Block -->
|
<!-- Bridge Block -->
|
||||||
<composition>
|
<composition>
|
||||||
<typeID>140</typeID>
|
<typeID>140</typeID>
|
||||||
|
<ignoreHeightmap>true</ignoreHeightmap>
|
||||||
<object>
|
<object>
|
||||||
<modelPath>block.obj</modelPath>
|
<modelPath>block.obj</modelPath>
|
||||||
<xOffset>0.0</xOffset>
|
<xOffset>0.0</xOffset>
|
||||||
<yOffset>10.0</yOffset>
|
<yOffset>20.0</yOffset>
|
||||||
<zOffset>2.0</zOffset>
|
<zOffset>2.0</zOffset>
|
||||||
<scale>1.5</scale>
|
<scale>1.5</scale>
|
||||||
<mass>0.0</mass>
|
<mass>0.0</mass>
|
||||||
|
11
level.cc
11
level.cc
@ -207,10 +207,13 @@ void Level::load() {
|
|||||||
errorCheck(thisComposition->FirstChildElement("xRot")->QueryFloatText(&compRot[0]));
|
errorCheck(thisComposition->FirstChildElement("xRot")->QueryFloatText(&compRot[0]));
|
||||||
errorCheck(thisComposition->FirstChildElement("yRot")->QueryFloatText(&compRot[1]));
|
errorCheck(thisComposition->FirstChildElement("yRot")->QueryFloatText(&compRot[1]));
|
||||||
errorCheck(thisComposition->FirstChildElement("zRot")->QueryFloatText(&compRot[2]));
|
errorCheck(thisComposition->FirstChildElement("zRot")->QueryFloatText(&compRot[2]));
|
||||||
glm::vec3 compPos = glm::vec3(compXPos,
|
bool ignoreHeightmap;
|
||||||
compYOffset+terrain.getHeightmap()[int(compXPos-0.5+0.5*terrain.getHeightmapHeight())]
|
errorCheck(composition->FirstChildElement("ignoreHeightmap")->QueryBoolText(&ignoreHeightmap));
|
||||||
[int(compZPos-0.5+0.5*terrain.getHeightmapWidth())],
|
if (!ignoreHeightmap){
|
||||||
compZPos);
|
compYOffset = compYOffset+terrain.getHeightmap()[int(compXPos-0.5+0.5*terrain.getHeightmapHeight())]
|
||||||
|
[int(compZPos-0.5+0.5*terrain.getHeightmapWidth())];
|
||||||
|
}
|
||||||
|
glm::vec3 compPos = glm::vec3(compXPos, compYOffset, compZPos);
|
||||||
objectOffset = objectOffset * compScale;
|
objectOffset = objectOffset * compScale;
|
||||||
glm::vec4 rotatedObjectOffset = glm::rotate(compRot.x, glm::vec3(1.0f, 0.0f, 0.0f))
|
glm::vec4 rotatedObjectOffset = glm::rotate(compRot.x, glm::vec3(1.0f, 0.0f, 0.0f))
|
||||||
* glm::rotate(compRot.y, glm::vec3(0.0f, 1.0f, 0.0f))
|
* glm::rotate(compRot.y, glm::vec3(0.0f, 1.0f, 0.0f))
|
||||||
|
Loading…
Reference in New Issue
Block a user