当前位置: 首页>>代码示例>>Java>>正文


Java GImpactMeshShape类代码示例

本文整理汇总了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);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:GImpactCollisionShape.java

示例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);
}
 
开发者ID:unktomi,项目名称:form-follows-function,代码行数:15,代码来源:MovingConcaveDemo.java


注:本文中的com.bulletphysics.extras.gimpact.GImpactMeshShape类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。