Fixed boats rotation
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user