Entity now can be linked to a mesh.
Only support cube generated from code no light no nothing
This commit is contained in:
+2
-2
@@ -152,13 +152,13 @@ void JulietApplication::Init(NonNullPtr<Arena>)
|
||||
{
|
||||
for (int col = 0; col < kGridSize; ++col)
|
||||
{
|
||||
MeshID cube = AddCube();
|
||||
MeshAssetID cubeAsset = GetCubePrimitiveMeshAssetID();
|
||||
float x = static_cast<float>(col) * kSpacing - kOffset;
|
||||
float y = static_cast<float>(row) * kSpacing - kOffset;
|
||||
|
||||
float seed = static_cast<float>(row * kGridSize + col);
|
||||
Matrix rotation = MatrixRotation(seed * 0.73f, seed * 1.17f, seed * 0.53f);
|
||||
SetMeshTransform(cube, MatrixTranslation(x, y, 0.0f) * rotation);
|
||||
CreateMeshInstance(cubeAsset, 0, MatrixTranslation(x, y, 0.0f) * rotation);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user