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
Fields inherited from class com.jme3.bullet.collision.shapes.ConvexShape
loggerX
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
ConstructorDescriptionMinkowskiSum
(ConvexShape shapeA, ConvexShape shapeB) Instantiate the Minkowki sum of the specified shapes. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test whether the specified scale factors can be applied to this shape.float
Return the collision margin of this shape.Access the first base shape.Access the 2nd base shape.void
setMargin
(float margin) Alter the collision margin of this shape.Methods inherited from class com.jme3.bullet.collision.shapes.ConvexShape
isConcave, isConvex, scaledVolume, toHullShape, toSplittableShape
Methods 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, userIndex2
Methods 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:
canScale
in 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:
getMargin
in 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:
setMargin
in classCollisionShape
- Parameters:
margin
- the desired margin thickness (in physics-space units)
-