Browse Source

- merge changes to native bullet

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7481 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
nor..67 14 years ago
parent
commit
aa2c4333f4
1 changed files with 5 additions and 2 deletions
  1. 5 2
      engine/src/bullet/com/jme3/bullet/util/CollisionShapeFactory.java

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

@@ -40,13 +40,13 @@ import com.jme3.bullet.collision.shapes.HullCollisionShape;
 import com.jme3.bullet.collision.shapes.MeshCollisionShape;
 import com.jme3.bullet.collision.shapes.infos.ChildCollisionShape;
 import com.jme3.math.Matrix3f;
-import com.jme3.math.Quaternion;
 import com.jme3.math.Transform;
 import com.jme3.math.Vector3f;
 import com.jme3.scene.Geometry;
 import com.jme3.scene.Mesh;
 import com.jme3.scene.Node;
 import com.jme3.scene.Spatial;
+import com.jme3.terrain.geomipmap.TerrainPatch;
 import com.jme3.terrain.geomipmap.TerrainQuad;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -147,6 +147,9 @@ public class CollisionShapeFactory {
         if (spatial instanceof TerrainQuad) {
             TerrainQuad terrain = (TerrainQuad) spatial;
             return new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale());
+        } else if (spatial instanceof TerrainPatch) {
+            TerrainPatch terrain = (TerrainPatch) spatial;
+            return new HeightfieldCollisionShape(terrain.getHeightmap().array(), terrain.getLocalScale());
         } else if (spatial instanceof Geometry) {
             return createSingleMeshShape((Geometry) spatial, spatial);
         } else if (spatial instanceof Node) {
@@ -226,7 +229,7 @@ public class CollisionShapeFactory {
             return null;
         }
     }
-
+    
     /**
      * This method moves each child shape of a compound shape by the given vector
      * @param vector