Search in sources :

Example 1 with GImpactMeshShape

use of com.bulletphysics.extras.gimpact.GImpactMeshShape in project jmonkeyengine by jMonkeyEngine.

the class GImpactCollisionShape method createShape.

protected void createShape() {
    bulletMesh = new IndexedMesh();
    bulletMesh.numVertices = numVertices;
    bulletMesh.numTriangles = numTriangles;
    bulletMesh.vertexStride = vertexStride;
    bulletMesh.triangleIndexStride = triangleIndexStride;
    bulletMesh.triangleIndexBase = triangleIndexBase;
    bulletMesh.vertexBase = vertexBase;
    bulletMesh.triangleIndexBase = triangleIndexBase;
    TriangleIndexVertexArray tiv = new TriangleIndexVertexArray(numTriangles, triangleIndexBase, triangleIndexStride, numVertices, vertexBase, vertexStride);
    cShape = new GImpactMeshShape(tiv);
    cShape.setLocalScaling(Converter.convert(worldScale));
    ((GImpactMeshShape) cShape).updateBound();
    cShape.setLocalScaling(Converter.convert(getScale()));
    cShape.setMargin(margin);
}
Also used : GImpactMeshShape(com.bulletphysics.extras.gimpact.GImpactMeshShape) TriangleIndexVertexArray(com.bulletphysics.collision.shapes.TriangleIndexVertexArray) IndexedMesh(com.bulletphysics.collision.shapes.IndexedMesh)

Aggregations

IndexedMesh (com.bulletphysics.collision.shapes.IndexedMesh)1 TriangleIndexVertexArray (com.bulletphysics.collision.shapes.TriangleIndexVertexArray)1 GImpactMeshShape (com.bulletphysics.extras.gimpact.GImpactMeshShape)1