本文整理汇总了Java中com.bulletphysics.extras.gimpact.GImpactMeshShape类的典型用法代码示例。如果您正苦于以下问题:Java GImpactMeshShape类的具体用法?Java GImpactMeshShape怎么用?Java GImpactMeshShape使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GImpactMeshShape类属于com.bulletphysics.extras.gimpact包,在下文中一共展示了GImpactMeshShape类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createShape
import com.bulletphysics.extras.gimpact.GImpactMeshShape; //导入依赖的package包/类
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);
}
示例2: initGImpactCollision
import com.bulletphysics.extras.gimpact.GImpactMeshShape; //导入依赖的package包/类
public void initGImpactCollision() {
// create trimesh
TriangleIndexVertexArray indexVertexArrays = new TriangleIndexVertexArray(
Bunny.NUM_TRIANGLES, Bunny.getIndexBuffer(), 4 * 3,
Bunny.NUM_VERTICES, Bunny.getVertexBuffer(), 4 * 3);
GImpactMeshShape trimesh = new GImpactMeshShape(indexVertexArrays);
trimesh.setLocalScaling(new Vector3f(4f, 4f, 4f));
trimesh.updateBound();
trimeshShape = trimesh;
// register algorithm
GImpactCollisionAlgorithm.registerAlgorithm(dispatcher);
}