Fixed boats rotation

This commit is contained in:
iDunnoDev
2022-05-30 00:25:14 +01:00
committed by iDunnoDev
parent eeec232821
commit 51afdeecbd
5 changed files with 25 additions and 25 deletions

View File

@ -529,6 +529,7 @@ void TerrainNode::PopulateTerrain(SceneGraphPointer currentSceneGraph, vector<Te
}
float scale = (rand() % 100 * 0.01f) * nodesForPop[nodeIndex].scaleFactor;
float yRotation = rand() % 360;
float xPos = x * _cellSizeX + _terrainStartX;
float yPos = heightValue;
@ -536,7 +537,7 @@ void TerrainNode::PopulateTerrain(SceneGraphPointer currentSceneGraph, vector<Te
wstring nodeName = L"_" + to_wstring(z) + L"_" + to_wstring(x);
shared_ptr<MeshNode> newNode = make_shared<MeshNode>(nodesForPop[nodeIndex].nodeBaseName + nodeName, nodesForPop[nodeIndex].modelName);
newNode->SetWorldTransform(XMMatrixScaling(scale, scale, scale) * XMMatrixTranslation(xPos, yPos, zPos));
newNode->SetWorldTransform(XMMatrixRotationAxis(XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f), yRotation * XM_PI / 180.0f) * XMMatrixScaling(scale, scale, scale) * XMMatrixTranslation(xPos, yPos, zPos));
currentSceneGraph->Add(newNode);
}
}