Package com.jme3.bullet.joints
Class Point2PointJoint
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.PhysicsJoint
com.jme3.bullet.joints.Constraint
com.jme3.bullet.joints.Point2PointJoint
- All Implemented Interfaces:
com.jme3.export.Savable
,com.jme3.util.clone.JmeCloneable
,Cloneable
,Comparable<NativePhysicsObject>
A 3 degree-of-freedom joint based on Bullet's btPoint2PointConstraint.
From the Bullet manual:
Point to point constraint limits the translation so that the local pivot
points of 2 rigid bodies match in worldspace. A chain of rigid bodies can be
connected using this constraint.
-
Field Summary
Fields inherited from class com.jme3.bullet.joints.Constraint
logger15, pivotA, pivotB
Fields inherited from class com.jme3.bullet.joints.PhysicsJoint
logger
Fields inherited from class com.jme3.bullet.NativePhysicsObject
loggerN
-
Constructor Summary
ModifierConstructorDescriptionprotected
No-argument constructor needed by SavableClassUtil.Point2PointJoint
(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInB) Instantiate a double-ended Point2PointJoint.Point2PointJoint
(PhysicsRigidBody rigidBodyA, com.jme3.math.Vector3f pivotInA) Instantiate a single-ended Point2PointJoint where the constraint is already satisfied.Point2PointJoint
(PhysicsRigidBody rigidBodyA, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInWorld) Instantiate a single-ended Point2PointJoint where the constraint might not be satisfied yet. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cloneFields
(com.jme3.util.clone.Cloner cloner, Object original) Callback fromCloner
to convert this shallow-cloned joint into a deep-cloned one, using the specified Cloner and original to resolve copied fields.float
Return the joint's damping ratio.float
Return the joint's impulse clamp.float
getTau()
Return the joint's tau value.void
read
(com.jme3.export.JmeImporter importer) De-serialize this joint from the specified importer, for example when loading from a J3O file.void
setDamping
(float value) Alter the joint's damping.void
setImpulseClamp
(float value) Alter the joint's impulse clamp.void
setPivotInA
(com.jme3.math.Vector3f location) Alter the pivot location in A's scaled local coordinates.void
setPivotInB
(com.jme3.math.Vector3f location) Alter the pivot location in B's scaled local coordinates.void
setTau
(float value) Alter the joint's tau value.void
write
(com.jme3.export.JmeExporter exporter) Serialize this joint to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.bullet.joints.Constraint
copyConstraintProperties, getAppliedImpulse, getBodyA, getBodyB, getBreakingImpulseThreshold, getConstraintType, getOverrideIterations, getPivot, getPivotA, getPivotB, isCollisionBetweenLinkedBodies, isEnabled, isFeedback, overrideIterations, readConstraintProperties, setBreakingImpulseThreshold, setCollisionBetweenLinkedBodies, setEnabled, setFeedback
Methods inherited from class com.jme3.bullet.joints.PhysicsJoint
countEnds, destroy, findEnd, findOtherBody, getBody, getPhysicsSpace, jmeClone, setBodyA, setBodyB, setNativeId, setPhysicsSpace, toString
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
-
Point2PointJoint
protected Point2PointJoint()No-argument constructor needed by SavableClassUtil. -
Point2PointJoint
Instantiate a single-ended Point2PointJoint where the constraint is already satisfied.To be effective, the joint must be added to the body's PhysicsSpace and the body must be dynamic.
- Parameters:
rigidBodyA
- the body to constrain (not null, alias created)pivotInA
- the pivot location in the body's scaled local coordinates (not null, unaffected)
-
Point2PointJoint
public Point2PointJoint(PhysicsRigidBody rigidBodyA, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInWorld) Instantiate a single-ended Point2PointJoint where the constraint might not be satisfied yet.To be effective, the joint must be added to the body's PhysicsSpace and the body must be dynamic.
- Parameters:
rigidBodyA
- the body to constrain (not null, alias created)pivotInA
- the pivot location in A's scaled local coordinates (not null, unaffected)pivotInWorld
- the pivot location in physics-space coordinates (not null, unaffected)
-
Point2PointJoint
public Point2PointJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInB) Instantiate a double-ended Point2PointJoint.To be effective, the joint must be added to the PhysicsSpace of both bodies. Also, the bodies must be distinct and at least one of them must be dynamic.
- Parameters:
rigidBodyA
- the body for the A end (not null, alias created)rigidBodyB
- the body for the B end (not null, alias created)pivotInA
- the pivot location in A's scaled local coordinates (not null, unaffected)pivotInB
- the pivot location in B's scaled local coordinates (not null, unaffected)
-
-
Method Details
-
getDamping
public float getDamping()Return the joint's damping ratio.- Returns:
- the viscous damping ratio (0→no damping, 1→critically damped)
-
getImpulseClamp
public float getImpulseClamp()Return the joint's impulse clamp.- Returns:
- the clamp value
-
getTau
public float getTau()Return the joint's tau value.- Returns:
- the tau value
-
setDamping
public void setDamping(float value) Alter the joint's damping.- Parameters:
value
- the desired viscous damping ratio (0→no damping, 1→critically damped, default=1)
-
setImpulseClamp
public void setImpulseClamp(float value) Alter the joint's impulse clamp.- Parameters:
value
- the desired impulse clamp value (default=0)
-
setTau
public void setTau(float value) Alter the joint's tau value.- Parameters:
value
- the desired tau value (default=0.3)
-
cloneFields
Callback fromCloner
to convert this shallow-cloned joint 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 classConstraint
- Parameters:
cloner
- the Cloner that's cloning this joint (not null)original
- the instance from which this joint was shallow-cloned (not null, unaffected)
-
read
De-serialize this joint from the specified importer, for example when loading from a J3O file.- Specified by:
read
in interfacecom.jme3.export.Savable
- Overrides:
read
in classConstraint
- Parameters:
importer
- (not null)- Throws:
IOException
- from the importer
-
setPivotInA
public void setPivotInA(com.jme3.math.Vector3f location) Alter the pivot location in A's scaled local coordinates.- Overrides:
setPivotInA
in classConstraint
- Parameters:
location
- the desired location (not null, unaffected)
-
setPivotInB
public void setPivotInB(com.jme3.math.Vector3f location) Alter the pivot location in B's scaled local coordinates.- Overrides:
setPivotInB
in classConstraint
- Parameters:
location
- the desired location (not null, unaffected)
-
write
Serialize this joint to the specified exporter, for example when saving to a J3O file.- Specified by:
write
in interfacecom.jme3.export.Savable
- Overrides:
write
in classConstraint
- Parameters:
exporter
- (not null)- Throws:
IOException
- from the exporter
-