Skip to content

Commit

Permalink
Migration
Browse files Browse the repository at this point in the history
  • Loading branch information
zameran committed Apr 27, 2020
1 parent 3400ab8 commit 95fd4de
Show file tree
Hide file tree
Showing 11 changed files with 1,435 additions and 909 deletions.
17 changes: 12 additions & 5 deletions Assets/Project/SpaceEngine/Code/BodyRotator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 61,34 @@ private void Start()
private void Update()
{
var terrainNodes = BodyComponent.TerrainNodes;

var euler = RotationAxis * (RotationSpeed * Time.deltaTime);

if (Rotator == null)
{
for (var terrainNodeIndex = 0; terrainNodeIndex < terrainNodes.Count; terrainNodeIndex )
{
var terrainNode = terrainNodes[terrainNodeIndex];

// NOTE : Maybe full matrices recalculations needed via TerrainQuadRoot.CalculateMatrices(...)
terrainNode.transform.Rotate(RotationAxis * RotationSpeed * Time.deltaTime); // NOTE : Perform our transformation action...
terrainNode.TerrainQuadRoot.UpdateMatrices(); // NOTE : Recalculate and update critical variables, required for proper rendering.
terrainNode.transform.Rotate(euler);
terrainNode.RotateNode(euler);
// NOTE : Perform our transformation action...
terrainNode.TerrainQuadRoot.UpdateMatrices();
// NOTE : Recalculate and update critical variables, required for proper rendering.
}
}
else
{
Rotator.transform.Rotate(RotationAxis * RotationSpeed * Time.deltaTime); // NOTE : Perform our transformation action...
Rotator.transform.Rotate(euler);
// NOTE : Perform our transformation action...

for (var terrainNodeIndex = 0; terrainNodeIndex < terrainNodes.Count; terrainNodeIndex )
{
var terrainNode = terrainNodes[terrainNodeIndex];

terrainNode.TerrainQuadRoot.UpdateMatrices(); // NOTE : Recalculate and update critical variables, required for proper rendering.
terrainNode.RotateNode(euler);
terrainNode.TerrainQuadRoot.UpdateMatrices();
// NOTE : Recalculate and update critical variables, required for proper rendering.
}
}
}
Expand Down
17 changes: 17 additions & 0 deletions Assets/Project/SpaceEngine/Code/Core/Terrain/TerrainNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 238,23 @@ public override void InitNode()
}
}

public void RotateNode(Vector3d euler)
{
var faces = new Vector3d[]
{
new Vector3d(0, 0, 0),
new Vector3d(90, 0, 0),
new Vector3d(90, 90, 0),
new Vector3d(90, 180, 0),
new Vector3d(90, 270, 0),
new Vector3d(0, 180, 180)
};

if (Face - 1 >= 0 && Face - 1 < 6) { FaceToLocal = Matrix4x4d.Rotate(faces[Face - 1] euler); }

UpdateNode();
}

public override void UpdateNode()
{
TerrainMaterial.renderQueue = (int)ParentBody.RenderQueue ParentBody.RenderQueueOffset;
Expand Down
10 changes: 5 additions & 5 deletions Assets/Project/SpaceEngine/Code/Debug/DebugGUIHardwareInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 307,12 @@ public static void Get()
var supports = SystemInfo.SupportsTextureFormat(format);

// NOTE : Workaround around unity's shit...
if ((format == TextureFormat.ASTC_RGB_4x4 ||
format == TextureFormat.ASTC_RGB_5x5 ||
format == TextureFormat.ASTC_RGB_6x6 ||
format == TextureFormat.ASTC_RGB_8x8 ||
if ((format == TextureFormat.ASTC_4x4 ||
format == TextureFormat.ASTC_5x5 ||
format == TextureFormat.ASTC_6x6 ||
format == TextureFormat.ASTC_8x8 ||
format == TextureFormat.ASTC_10x10 ||
format == TextureFormat.ASTC_RGB_12x12) && TextureFormats.ContainsKey(format))
format == TextureFormat.ASTC_12x12) && TextureFormats.ContainsKey(format))
{

}
Expand Down
Loading

0 comments on commit 95fd4de

Please sign in to comment.