com.bulletphysics.collision.shapes
Class TriangleIndexVertexArray

java.lang.Object
  extended by com.bulletphysics.collision.shapes.StridingMeshInterface
      extended by com.bulletphysics.collision.shapes.TriangleIndexVertexArray

public class TriangleIndexVertexArray
extends StridingMeshInterface


Field Summary
protected  java.util.List<IndexedMesh> indexedMeshes
           
 
Fields inherited from class com.bulletphysics.collision.shapes.StridingMeshInterface
scaling
 
Constructor Summary
TriangleIndexVertexArray()
           
TriangleIndexVertexArray(int numTriangles, java.nio.ByteBuffer triangleIndexBase, int triangleIndexStride, int numVertices, java.nio.ByteBuffer vertexBase, int vertexStride)
          Just to be backwards compatible.
 
Method Summary
 void addIndexedMesh(IndexedMesh mesh)
           
 void addIndexedMesh(IndexedMesh mesh, ScalarType indexType)
           
 java.util.List<IndexedMesh> getIndexedMeshArray()
           
 void getLockedReadOnlyVertexIndexBase(VertexData data, int subpart)
           
 void getLockedVertexIndexBase(VertexData data, int subpart)
          Get read and write access to a subpart of a triangle mesh.
 int getNumSubParts()
          getNumSubParts returns the number of seperate subparts.
 void preallocateIndices(int numindices)
           
 void preallocateVertices(int numverts)
           
 void unLockReadOnlyVertexBase(int subpart)
           
 void unLockVertexBase(int subpart)
          unLockVertexBase finishes the access to a subpart of the triangle mesh.
 
Methods inherited from class com.bulletphysics.collision.shapes.StridingMeshInterface
calculateAabbBruteForce, getScaling, internalProcessAllTriangles, setScaling
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexedMeshes

protected java.util.List<IndexedMesh> indexedMeshes
Constructor Detail

TriangleIndexVertexArray

public TriangleIndexVertexArray()

TriangleIndexVertexArray

public TriangleIndexVertexArray(int numTriangles,
                                java.nio.ByteBuffer triangleIndexBase,
                                int triangleIndexStride,
                                int numVertices,
                                java.nio.ByteBuffer vertexBase,
                                int vertexStride)
Just to be backwards compatible.

Method Detail

addIndexedMesh

public void addIndexedMesh(IndexedMesh mesh)

addIndexedMesh

public void addIndexedMesh(IndexedMesh mesh,
                           ScalarType indexType)

getLockedVertexIndexBase

public void getLockedVertexIndexBase(VertexData data,
                                     int subpart)
Description copied from class: StridingMeshInterface
Get read and write access to a subpart of a triangle mesh. This subpart has a continuous array of vertices and indices. In this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support. Make a call to unLockVertexBase when the read and write access is finished.

Specified by:
getLockedVertexIndexBase in class StridingMeshInterface

getLockedReadOnlyVertexIndexBase

public void getLockedReadOnlyVertexIndexBase(VertexData data,
                                             int subpart)
Specified by:
getLockedReadOnlyVertexIndexBase in class StridingMeshInterface

unLockVertexBase

public void unLockVertexBase(int subpart)
unLockVertexBase finishes the access to a subpart of the triangle mesh. Make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished.

Specified by:
unLockVertexBase in class StridingMeshInterface

unLockReadOnlyVertexBase

public void unLockReadOnlyVertexBase(int subpart)
Specified by:
unLockReadOnlyVertexBase in class StridingMeshInterface

getNumSubParts

public int getNumSubParts()
getNumSubParts returns the number of seperate subparts. Each subpart has a continuous array of vertices and indices.

Specified by:
getNumSubParts in class StridingMeshInterface

getIndexedMeshArray

public java.util.List<IndexedMesh> getIndexedMeshArray()

preallocateVertices

public void preallocateVertices(int numverts)
Specified by:
preallocateVertices in class StridingMeshInterface

preallocateIndices

public void preallocateIndices(int numindices)
Specified by:
preallocateIndices in class StridingMeshInterface