- merge changes to native bullet

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7481 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 9853bd266d
commit aa2c4333f4
  1. 5
      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.MeshCollisionShape;
import com.jme3.bullet.collision.shapes.infos.ChildCollisionShape; import com.jme3.bullet.collision.shapes.infos.ChildCollisionShape;
import com.jme3.math.Matrix3f; import com.jme3.math.Matrix3f;
import com.jme3.math.Quaternion;
import com.jme3.math.Transform; import com.jme3.math.Transform;
import com.jme3.math.Vector3f; import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry; import com.jme3.scene.Geometry;
import com.jme3.scene.Mesh; import com.jme3.scene.Mesh;
import com.jme3.scene.Node; import com.jme3.scene.Node;
import com.jme3.scene.Spatial; import com.jme3.scene.Spatial;
import com.jme3.terrain.geomipmap.TerrainPatch;
import com.jme3.terrain.geomipmap.TerrainQuad; import com.jme3.terrain.geomipmap.TerrainQuad;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
@ -147,6 +147,9 @@ public class CollisionShapeFactory {
if (spatial instanceof TerrainQuad) { if (spatial instanceof TerrainQuad) {
TerrainQuad terrain = (TerrainQuad) spatial; TerrainQuad terrain = (TerrainQuad) spatial;
return new HeightfieldCollisionShape(terrain.getHeightMap(), terrain.getLocalScale()); 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) { } else if (spatial instanceof Geometry) {
return createSingleMeshShape((Geometry) spatial, spatial); return createSingleMeshShape((Geometry) spatial, spatial);
} else if (spatial instanceof Node) { } else if (spatial instanceof Node) {

Loading…
Cancel
Save