com.jme3.bullet.collision.shapes
Class HeightfieldCollisionShape
java.lang.Object
com.jme3.bullet.collision.shapes.CollisionShape
com.jme3.bullet.collision.shapes.HeightfieldCollisionShape
- All Implemented Interfaces:
- Savable
public class HeightfieldCollisionShape
- extends CollisionShape
Uses Bullet Physics Heightfield terrain collision system. This is MUCH faster
than using a regular mesh.
There are a couple tricks though:
-No rotation or translation is supported.
-The collision bbox must be centered around 0,0,0 with the height above and below the y-axis being
equal on either side. If not, the whole collision box is shifted vertically and things don't collide
as they should.
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
heightStickWidth
protected int heightStickWidth
heightStickLength
protected int heightStickLength
heightfieldData
protected float[] heightfieldData
heightScale
protected float heightScale
minHeight
protected float minHeight
maxHeight
protected float maxHeight
upAxis
protected int upAxis
flipQuadEdges
protected boolean flipQuadEdges
bbuf
protected java.nio.ByteBuffer bbuf
HeightfieldCollisionShape
public HeightfieldCollisionShape()
HeightfieldCollisionShape
public HeightfieldCollisionShape(float[] heightmap)
HeightfieldCollisionShape
public HeightfieldCollisionShape(float[] heightmap,
Vector3f scale)
createCollisionHeightfield
protected void createCollisionHeightfield(float[] heightmap,
Vector3f worldScale)
createShape
protected void createShape()
createJmeMesh
public Mesh createJmeMesh()
write
public void write(JmeExporter ex)
throws java.io.IOException
- Specified by:
write
in interface Savable
- Overrides:
write
in class CollisionShape
- Throws:
java.io.IOException
read
public void read(JmeImporter im)
throws java.io.IOException
- Specified by:
read
in interface Savable
- Overrides:
read
in class CollisionShape
- Throws:
java.io.IOException