Package com.jme3.bullet.collision.shapes
Class ConvexShape
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.collision.shapes.CollisionShape
com.jme3.bullet.collision.shapes.ConvexShape
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
,Comparable<NativePhysicsObject>
- Direct Known Subclasses:
Box2dShape
,BoxCollisionShape
,CapsuleCollisionShape
,ConeCollisionShape
,ConicalFrustum
,Convex2dShape
,CustomConvexShape
,CylinderCollisionShape
,HullCollisionShape
,MinkowskiSum
,MultiSphere
,SimplexCollisionShape
,SphereCollisionShape
,SphericalSegment
The abstract base class for convex collision shapes based on Bullet's
btConvexShape
.
Subclasses include BoxCollisionShape
and
CapsuleCollisionShape
.
-
Field Summary
Fields inherited from class com.jme3.bullet.collision.shapes.CollisionShape
enableContactFilter, logger, margin, scale
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
ModifierConstructorDescriptionprotected
Instantiate a collision shape with no tracker and no assigned native object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether this shape has concave type.boolean
isConvex()
Test whether this shape has convex type.float
Estimate the volume of this shape, including scale and margin.Approximate this shape with a HullCollisionShape.Approximate this shape with a splittable shape.Methods inherited from class com.jme3.bullet.collision.shapes.CollisionShape
aabbCenter, aabbScaledVolume, boundingBox, boundingBox, canScale, canSplit, cloneFields, copyShapeProperties, getDefaultMargin, getMargin, getScale, getScaleDp, getShapeType, getShapeType, isContactFilterEnabled, isInfinite, isNonMoving, isPolyhedral, jmeClone, maxRadius, nativeMargin, read, readShapeProperties, recalculateAabb, setContactFilterEnabled, setDefaultMargin, setMargin, setNativeId, setScale, setScale, setUserIndex, setUserIndex2, toString, updateScale, userIndex, userIndex2, write
Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObject
-
Field Details
-
loggerX
message logger for this class
-
-
Constructor Details
-
ConvexShape
protected ConvexShape()Instantiate a collision shape with no tracker and no assigned native object.This no-arg constructor was made explicit to avoid javadoc warnings from JDK 18+.
-
-
Method Details
-
toHullShape
Approximate this shape with a HullCollisionShape. Meant to be overridden.- Returns:
- a new shape
-
isConcave
public boolean isConcave()Test whether this shape has concave type. In Bullet, "concave" is a property of types of shapes. Specific instances of those types might actually be "convex" in the mathematical sense of the word.- Overrides:
isConcave
in classCollisionShape
- Returns:
- false
-
isConvex
public boolean isConvex()Test whether this shape has convex type. In Bullet, "convex" is a property of types of shapes. Specific instances of non-convex types might still be "convex" in the mathematical sense of the word.- Overrides:
isConvex
in classCollisionShape
- Returns:
- true
-
scaledVolume
public float scaledVolume()Estimate the volume of this shape, including scale and margin.- Overrides:
scaledVolume
in classCollisionShape
- Returns:
- the volume (in physics-space units cubed, ≥0)
-
toSplittableShape
Approximate this shape with a splittable shape.- Overrides:
toSplittableShape
in classCollisionShape
- Returns:
- a new splittable shape
-