Package com.jme3.bullet.objects
Class MultiBodyCollider
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.collision.PhysicsCollisionObject
com.jme3.bullet.objects.MultiBodyCollider
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
,Comparable<NativePhysicsObject>
A collision object for a link or base in a MultiBody, based on Bullet's
btMultiBodyLinkCollider.
-
Field Summary
Fields inherited from class com.jme3.bullet.collision.PhysicsCollisionObject
COLLISION_GROUP_01, COLLISION_GROUP_02, COLLISION_GROUP_03, COLLISION_GROUP_04, COLLISION_GROUP_05, COLLISION_GROUP_06, COLLISION_GROUP_07, COLLISION_GROUP_08, COLLISION_GROUP_09, COLLISION_GROUP_10, COLLISION_GROUP_11, COLLISION_GROUP_12, COLLISION_GROUP_13, COLLISION_GROUP_14, COLLISION_GROUP_15, COLLISION_GROUP_16, COLLISION_GROUP_NONE, logger
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
ModifierConstructorDescriptionprotected
No-argument constructor needed by SavableClassUtil.MultiBodyCollider
(MultiBody multiBody, int linkIndex) Instantiate a collider for the indexed link in the specified MultiBody. -
Method Summary
Modifier and TypeMethodDescriptionvoid
attachShape
(CollisionShape shape) Attach the specified collision shape to this collider.void
cloneFields
(com.jme3.util.clone.Cloner cloner, Object original) Callback fromCloner
to convert this shallow-cloned object into a deep-cloned one, using the specified Cloner and original to resolve copied fields.Access the MultiBody that contains this collider.int
Determine the index of the corresponding MultiBodyLink.float
mass()
Determine the mass of this collider.void
read
(com.jme3.export.JmeImporter importer) De-serialize this object from the specified importer, for example when loading from a J3O file.void
setPhysicsLocation
(com.jme3.math.Vector3f location) Directly alter the location of this collider's center.void
setPhysicsLocationDp
(com.simsilica.mathd.Vec3d location) Directly alter the location of this collider's center.void
setPhysicsRotation
(com.jme3.math.Matrix3f orientation) Directly alter this collider's orientation.void
setPhysicsRotationDp
(com.simsilica.mathd.Matrix3d orientation) Directly alter this collider's orientation.void
write
(com.jme3.export.JmeExporter exporter) Serialize this object to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.collision.PhysicsCollisionObject
activate, addCollideWithGroup, addToIgnoreList, attachCollisionShape, boundingBox, clearIgnoreList, cloneIgnoreList, collisionFlags, copyPcoProperties, countIgnored, debugMeshInitListener, debugMeshNormals, debugMeshResolution, debugNumSides, finalizeNative, findInstance, getActivationState, getAnisotropicFriction, getApplicationData, getCcdMotionThreshold, getCcdSquareMotionThreshold, getCcdSweptSphereRadius, getCollideWithGroups, getCollisionGroup, getCollisionShape, getCollisionSpace, getContactDamping, getContactProcessingThreshold, getContactStiffness, getDeactivationTime, getDebugMaterial, getFriction, getInternalType, getPhysicsLocation, getPhysicsLocation, getPhysicsLocationDp, getPhysicsRotation, getPhysicsRotationDp, getPhysicsRotationMatrix, getPhysicsRotationMatrixDp, getRestitution, getRollingFriction, getScale, getSpinningFriction, getTransform, getUserObject, hasAnisotropicFriction, ignores, initUserPointer, isActive, isContactResponse, isInWorld, isStatic, jmeClone, listIgnoredPcos, proxyGroup, proxyMask, readPcoProperties, removeCollideWithGroup, removeFromIgnoreList, setActivationState, setAnisotropicFriction, setApplicationData, setCcdMotionThreshold, setCcdSweptSphereRadius, setCollideWithGroups, setCollisionFlags, setCollisionGroup, setCollisionShape, setContactDamping, setContactProcessingThreshold, setContactStiffness, setDeactivationTime, setDebugMaterial, setDebugMeshInitListener, setDebugMeshNormals, setDebugMeshResolution, setDebugNumSides, setFriction, setIgnoreList, setLocationAndBasis, setRestitution, setRollingFriction, setSpinningFriction, setUserIndex, setUserIndex2, setUserIndex3, setUserObject, spaceId, toString, userIndex, userIndex2, userIndex3
Methods inherited from class com.jme3.bullet.NativePhysicsObject
compareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeId, setNativeIdNotTracked, unassignNativeObject
-
Field Details
-
logger2
message logger for this class
-
-
Constructor Details
-
MultiBodyCollider
protected MultiBodyCollider()No-argument constructor needed by SavableClassUtil. -
MultiBodyCollider
Instantiate a collider for the indexed link in the specified MultiBody. Used internally.- Parameters:
multiBody
- (not null, alias created)linkIndex
- the link index, or -1 for the base
-
-
Method Details
-
attachShape
Attach the specified collision shape to this collider. Used internally.- Parameters:
shape
- the shape to attach (not null, alias created)
-
getMultiBody
Access the MultiBody that contains this collider.- Returns:
- the pre-existing instance (not null)
-
linkIndex
public int linkIndex()Determine the index of the corresponding MultiBodyLink.- Returns:
- the index (≥0) or -1 if this is the base collider
-
mass
public float mass()Determine the mass of this collider.- Returns:
- the mass (>0)
-
setPhysicsLocation
public void setPhysicsLocation(com.jme3.math.Vector3f location) Directly alter the location of this collider's center.- Parameters:
location
- the desired location (in physics-space coordinates, not null, finite, unaffected)
-
setPhysicsLocationDp
public void setPhysicsLocationDp(com.simsilica.mathd.Vec3d location) Directly alter the location of this collider's center.- Parameters:
location
- the desired location (in physics-space coordinates, not null, unaffected)
-
setPhysicsRotation
public void setPhysicsRotation(com.jme3.math.Matrix3f orientation) Directly alter this collider's orientation.- Parameters:
orientation
- the desired orientation (a rotation matrix in physics-space coordinates, not null, unaffected)
-
setPhysicsRotationDp
public void setPhysicsRotationDp(com.simsilica.mathd.Matrix3d orientation) Directly alter this collider's orientation.- Parameters:
orientation
- the desired orientation (a rotation matrix in physics-space coordinates, not null, unaffected)
-
cloneFields
Callback fromCloner
to convert this shallow-cloned object into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
cloneFields
in interfacecom.jme3.util.clone.JmeCloneable
- Overrides:
cloneFields
in classPhysicsCollisionObject
- Parameters:
cloner
- the Cloner that's cloning this object (not null)original
- the instance from which this object was shallow-cloned (not null, unaffected)
-
read
De-serialize this object from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfacecom.jme3.export.Savable
- Overrides:
read
in classPhysicsCollisionObject
- Parameters:
importer
- (not null)- Throws:
IOException
- from the importer
-
write
Serialize this object to the specified exporter, for example when saving to a J3O file.- Specified by:
write
in interfacecom.jme3.export.Savable
- Overrides:
write
in classPhysicsCollisionObject
- Parameters:
exporter
- (not null)- Throws:
IOException
- from the exporter
-