Package com.jme3.bullet.collision.shapes
Class GImpactCollisionShape
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.collision.shapes.CollisionShape
com.jme3.bullet.collision.shapes.GImpactCollisionShape
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
A mesh collisions shape based on Bullet's
btGImpactMeshShape.
Collisions between GImpactCollisionShape and
PlaneCollisionShape objects are never detected.
-
Field Summary
FieldsFields inherited from class com.jme3.bullet.collision.shapes.CollisionShape
enableContactFilter, logger, margin, scaleFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Constructor Summary
ConstructorsConstructorDescriptionGImpactCollisionShape(CompoundMesh mesh, Vector3f offset) Instantiate a shape based on the specified CompoundMesh and offset.GImpactCollisionShape(IndexedMesh... submeshes) Instantiate a shape based on the specified native mesh(es). -
Method Summary
Modifier and TypeMethodDescriptionbooleancanSplit()Test whether the shape can be split by an arbitrary plane.intCount how many triangles are in the mesh.intCount how many vertices are in the mesh.intCount how many submeshes are in the mesh.getSubmesh(int index) Access the specified submesh.protected voidRecalculate this shape's bounding box if necessary.voidAlter the scale factors of this shape.Attempt to divide this shape into 2 shapes.Methods inherited from class com.jme3.bullet.collision.shapes.CollisionShape
aabbCenter, boundingBox, boundingBox, canScale, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isConcave, isContactFilterEnabled, isConvex, isInfinite, isNonMoving, isPolyhedral, maxRadius, nativeMargin, scaledVolume, setContactFilterEnabled, setDefaultMargin, setMargin, setNativeId, setScale, setUserIndex, setUserIndex2, toSplittableShape, toString, updateScale, userIndex, userIndex2Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObject
-
Field Details
-
logger2
message logger for this class
-
-
Constructor Details
-
GImpactCollisionShape
Instantiate a shape based on the specified CompoundMesh and offset.- Parameters:
mesh- the mesh on which to base the shape (not null, must contain at least one triangle, unaffected)offset- the offset to add to the vertex positions (not null, unaffected)
-
GImpactCollisionShape
Instantiate a shape based on the specified native mesh(es).- Parameters:
submeshes- the mesh(es) on which to base the shape (not null, must contain at least one triangle)
-
-
Method Details
-
countMeshTriangles
public int countMeshTriangles()Count how many triangles are in the mesh.- Returns:
- the count (≥0)
-
countMeshVertices
public int countMeshVertices()Count how many vertices are in the mesh.- Returns:
- the count (≥0)
-
countSubmeshes
public int countSubmeshes()Count how many submeshes are in the mesh.- Returns:
- the count (≥0)
-
getSubmesh
Access the specified submesh.- Parameters:
index- the index of the desired submesh (in the order the submeshes were added, ≥0)- Returns:
- the pre-existing instance (not null)
-
split
Attempt to divide this shape into 2 shapes.- Parameters:
splittingTriangle- to define the splitting plane (in shape coordinates, not null, unaffected)- Returns:
- a pair of children, the first child generated by the plane's minus side and the 2nd child generated by its plus side; either child may be null, indicating an empty shape
-
canSplit
public boolean canSplit()Test whether the shape can be split by an arbitrary plane.- Overrides:
canSplitin classCollisionShape- Returns:
- true
-
recalculateAabb
protected void recalculateAabb()Recalculate this shape's bounding box if necessary.- Overrides:
recalculateAabbin classCollisionShape
-
setScale
Alter the scale factors of this shape.Note that if the shape is shared (between collision objects and/or compound shapes) changes can have unintended consequences.
- Overrides:
setScalein classCollisionShape- Parameters:
scale- the desired scale factor for each local axis (not null, no negative component, unaffected, default=(1,1,1))
-