2
0
Эх сурвалжийг харах

- fix TerrainPatch method signature to not break old projects, deprecate getHeightmap, add new getHeightMap

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8737 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..om 14 жил өмнө
parent
commit
197bba7fe8

+ 2 - 2
engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java

@@ -130,7 +130,7 @@ public class CollisionShapeFactory {
                 }
                 TerrainPatch terrain = (TerrainPatch) spatial;
                 Transform trans = getTransform(spatial, realRootNode);
-                shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightmap(), terrain.getLocalScale()),
+                shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()),
                         trans.getTranslation(),
                         trans.getRotation().toRotationMatrix());
             }
@@ -175,7 +175,7 @@ public class CollisionShapeFactory {
             return new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale());
         } else if (spatial instanceof TerrainPatch) {
             TerrainPatch terrain = (TerrainPatch) spatial;
-            return new HeightfieldCollisionShape(terrain.getHeightmap(), terrain.getLocalScale());
+            return new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale());
         } else if (spatial instanceof Geometry) {
             return createSingleMeshShape((Geometry) spatial, spatial);
         } else if (spatial instanceof Node) {

+ 2 - 2
engine/src/jbullet/com/jme3/bullet/util/CollisionShapeFactory.java

@@ -130,7 +130,7 @@ public class CollisionShapeFactory {
                 }
                 TerrainPatch terrain = (TerrainPatch) spatial;
                 Transform trans = getTransform(spatial, realRootNode);
-                shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightmap(), terrain.getLocalScale()),
+                shape.addChildShape(new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()),
                         trans.getTranslation(),
                         trans.getRotation().toRotationMatrix());
             }
@@ -175,7 +175,7 @@ public class CollisionShapeFactory {
             return new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale());
         } else if (spatial instanceof TerrainPatch) {
             TerrainPatch terrain = (TerrainPatch) spatial;
-            return new HeightfieldCollisionShape(terrain.getHeightmap(), terrain.getLocalScale());
+            return new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale());
         } else if (spatial instanceof Geometry) {
             return createSingleMeshShape((Geometry) spatial, spatial);
         } else if (spatial instanceof Node) {

+ 6 - 1
engine/src/terrain/com/jme3/terrain/geomipmap/TerrainPatch.java

@@ -213,7 +213,12 @@ public class TerrainPatch extends Geometry {
         return lodEntropy;
     }
 
-    public float[] getHeightmap() {
+    @Deprecated
+    public FloatBuffer getHeightmap() {
+        return BufferUtils.createFloatBuffer(geomap.getHeightData());
+    }
+    
+    public float[] getHeightMap() {
         return geomap.getHeightData();
     }
 

+ 4 - 4
engine/src/terrain/com/jme3/terrain/geomipmap/TerrainQuad.java

@@ -1796,13 +1796,13 @@ public class TerrainQuad extends Node implements Terrain {
             if (getChild(0) instanceof TerrainPatch) {
                 for (Spatial s : getChildren()) {
                     if ( ((TerrainPatch)s).getQuadrant() == 1)
-                        ul = ((TerrainPatch)s).getHeightmap();
+                        ul = ((TerrainPatch)s).getHeightMap();
                     else if(((TerrainPatch) s).getQuadrant() == 2)
-                        bl = ((TerrainPatch)s).getHeightmap();
+                        bl = ((TerrainPatch)s).getHeightMap();
                     else if(((TerrainPatch) s).getQuadrant() == 3)
-                        ur = ((TerrainPatch)s).getHeightmap();
+                        ur = ((TerrainPatch)s).getHeightMap();
                     else if(((TerrainPatch) s).getQuadrant() == 4)
-                        br = ((TerrainPatch)s).getHeightmap();
+                        br = ((TerrainPatch)s).getHeightMap();
                 }
             }
             else {