Search in sources :

Example 1 with ConvexHullShape

use of com.bulletphysics.collision.shapes.ConvexHullShape in project jmonkeyengine by jMonkeyEngine.

the class HullCollisionShape method createShape.

protected void createShape(float[] points) {
    ObjectArrayList<Vector3f> pointList = new ObjectArrayList<Vector3f>();
    for (int i = 0; i < points.length; i += 3) {
        pointList.add(new Vector3f(points[i], points[i + 1], points[i + 2]));
    }
    cShape = new ConvexHullShape(pointList);
    cShape.setLocalScaling(Converter.convert(getScale()));
    cShape.setMargin(margin);
}
Also used : ObjectArrayList(com.bulletphysics.util.ObjectArrayList) Vector3f(javax.vecmath.Vector3f) ConvexHullShape(com.bulletphysics.collision.shapes.ConvexHullShape)

Aggregations

ConvexHullShape (com.bulletphysics.collision.shapes.ConvexHullShape)1 ObjectArrayList (com.bulletphysics.util.ObjectArrayList)1 Vector3f (javax.vecmath.Vector3f)1