Fix braces convention

This commit is contained in:
Bálint Hodossy
2023-12-04 14:00:24 +00:00
parent 8ec1e4e2b8
commit f5a2879f9d
@@ -24,7 +24,6 @@ namespace Mujoco
[Serializable] [Serializable]
public class MjHeightFieldShape : IMjShape public class MjHeightFieldShape : IMjShape
{ {
public Terrain terrain; public Terrain terrain;
[Tooltip("The path, relative to Application.dataPath, where the heightmap data will be save in PNG format.")] [Tooltip("The path, relative to Application.dataPath, where the heightmap data will be save in PNG format.")]
@@ -35,21 +34,18 @@ public class MjHeightFieldShape : IMjShape
public int HeightMapHeight => terrain.terrainData.heightmapTexture.height; public int HeightMapHeight => terrain.terrainData.heightmapTexture.height;
public Vector3 HeightMapScale => terrain.terrainData.heightmapScale; public Vector3 HeightMapScale => terrain.terrainData.heightmapScale;
public void ToMjcf(XmlElement mjcf, Transform transform) public void ToMjcf(XmlElement mjcf, Transform transform){
{
ExportHeightMap(); ExportHeightMap();
var scene = MjScene.Instance; var scene = MjScene.Instance;
var assetName = scene.GenerationContext.AddHeightFieldAsset(this); var assetName = scene.GenerationContext.AddHeightFieldAsset(this);
mjcf.SetAttribute("hfield", assetName); mjcf.SetAttribute("hfield", assetName);
} }
public void FromMjcf(XmlElement mjcf) public void FromMjcf(XmlElement mjcf){
{
} }
public void ExportHeightMap() public void ExportHeightMap(){
{
RenderTexture.active = terrain.terrainData.heightmapTexture; RenderTexture.active = terrain.terrainData.heightmapTexture;
Texture2D texture = new Texture2D(RenderTexture.active.width, RenderTexture.active.height); Texture2D texture = new Texture2D(RenderTexture.active.width, RenderTexture.active.height);
texture.ReadPixels(new Rect(0, 0, RenderTexture.active.width, RenderTexture.active.height), 0, 0); texture.ReadPixels(new Rect(0, 0, RenderTexture.active.width, RenderTexture.active.height), 0, 0);
@@ -58,18 +54,15 @@ public class MjHeightFieldShape : IMjShape
} }
public Vector4 GetChangeStamp() public Vector4 GetChangeStamp(){
{
return Vector4.one; return Vector4.one;
} }
public Tuple<Vector3[], int[]> BuildMesh() public Tuple<Vector3[], int[]> BuildMesh(){
{
return Tuple.Create(new Vector3[]{}, new int[]{}); return Tuple.Create(new Vector3[]{}, new int[]{});
} }
public void DebugDraw(Transform transform) public void DebugDraw(Transform transform){
{
} }
} }
} }