Package com.jme3.bullet.collision.shapes
Class MinkowskiSum
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.collision.shapes.CollisionShape
com.jme3.bullet.collision.shapes.ConvexShape
com.jme3.bullet.collision.shapes.MinkowskiSum
- All Implemented Interfaces:
Comparable<NativePhysicsObject>
A convex collision shape to represent the Minkowki sum of 2 convex shapes,
based on Bullet's
btMinkowskiSumShape.-
Field Summary
FieldsFields inherited from class com.jme3.bullet.collision.shapes.ConvexShape
loggerXFields inherited from class com.jme3.bullet.collision.shapes.CollisionShape
enableContactFilter, logger, margin, scaleFields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN -
Constructor Summary
ConstructorsConstructorDescriptionMinkowskiSum(ConvexShape shapeA, ConvexShape shapeB) Instantiate the Minkowki sum of the specified shapes. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest whether the specified scale factors can be applied to this shape.floatReturn the collision margin of this shape.Access the first base shape.Access the 2nd base shape.voidsetMargin(float margin) Alter the collision margin of this shape.Methods inherited from class com.jme3.bullet.collision.shapes.ConvexShape
isConcave, isConvex, scaledVolume, toHullShape, toSplittableShapeMethods inherited from class com.jme3.bullet.collision.shapes.CollisionShape
aabbCenter, boundingBox, boundingBox, canSplit, getDefaultMargin, getScale, getScaleDp, getShapeType, getShapeType, isContactFilterEnabled, isInfinite, isNonMoving, isPolyhedral, maxRadius, nativeMargin, recalculateAabb, setContactFilterEnabled, setDefaultMargin, setNativeId, setScale, setScale, setUserIndex, setUserIndex2, 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
-
MinkowskiSum
Instantiate the Minkowki sum of the specified shapes.- Parameters:
shapeA- the first base shape (not null, convex, alias created)shapeB- the 2nd base shape (not null, convex, alias created)
-
-
Method Details
-
getShapeA
Access the first base shape.- Returns:
- the pre-existing shape (not null)
-
getShapeB
Access the 2nd base shape.- Returns:
- the pre-existing shape (not null)
-
canScale
Test whether the specified scale factors can be applied to this shape. For MinkowskiSum shapes, scaling must be unity.- Overrides:
canScalein classCollisionShape- Parameters:
scale- the desired scale factor for each local axis (may be null, unaffected)- Returns:
- true if applicable, otherwise false
-
getMargin
public float getMargin()Return the collision margin of this shape.- Overrides:
getMarginin classCollisionShape- Returns:
- the margin thickness (in physics-space units, ≥0)
-
setMargin
public void setMargin(float margin) Alter the collision margin of this shape. This feature is disabled for MinkowskiSum shapes. The margin of a MinkowskiSum is simply the sum of the (native) margins of the base shapes.- Overrides:
setMarginin classCollisionShape- Parameters:
margin- the desired margin thickness (in physics-space units)
-