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:
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
ConstructorDescriptionPoint2PointJoint
(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f pivotInA, Vector3f pivotInB) Instantiate a double-ended Point2PointJoint.Point2PointJoint
(PhysicsRigidBody rigidBodyA, Vector3f pivotInA) Instantiate a single-ended Point2PointJoint where the constraint is already satisfied.Point2PointJoint
(PhysicsRigidBody rigidBodyA, Vector3f pivotInA, Vector3f pivotInWorld) Instantiate a single-ended Point2PointJoint where the constraint might not be satisfied yet. -
Method Summary
Modifier and TypeMethodDescriptionfloat
Return the joint's damping ratio.float
Return the joint's impulse clamp.getPivotInA
(Vector3f storeResult) Locate the pivot in A's scaled local coordinates.getPivotInB
(Vector3f storeResult) Locate the pivot in B's scaled local coordinates.float
getTau()
Return the joint's tau value.void
setDamping
(float value) Alter the joint's damping.void
setImpulseClamp
(float value) Alter the joint's impulse clamp.void
setPivotInA
(Vector3f location) Alter the pivot location in A's scaled local coordinates.void
setPivotInB
(Vector3f location) Alter the pivot location in B's scaled local coordinates.void
setTau
(float value) Alter the joint's tau value.Methods inherited from class com.jme3.bullet.joints.Constraint
getAppliedImpulse, getBodyA, getBodyB, getBreakingImpulseThreshold, getConstraintType, getOverrideIterations, getPivot, getPivotA, getPivotB, isCollisionBetweenLinkedBodies, isEnabled, isFeedback, overrideIterations, setBreakingImpulseThreshold, setCollisionBetweenLinkedBodies, setEnabled, setFeedback
Methods inherited from class com.jme3.bullet.joints.PhysicsJoint
countEnds, destroy, findEnd, findOtherBody, getBody, getPhysicsSpace, 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
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
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, Vector3f pivotInA, 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
-
getPivotInA
Locate the pivot in A's scaled local coordinates.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- the pivot location (either storeResult or a new vector, not null)
-
getPivotInB
Locate the pivot in B's scaled local coordinates.- Parameters:
storeResult
- storage for the result (modified if not null)- Returns:
- the pivot location (either storeResult or a new vector, not null)
-
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)
-
setPivotInA
Alter the pivot location in A's scaled local coordinates.- Overrides:
setPivotInA
in classConstraint
- Parameters:
location
- the desired location (not null, unaffected)
-
setPivotInB
Alter the pivot location in B's scaled local coordinates. Unlike Minie, Libbulletjme implements this method for both single-ended and double-ended joints.- Overrides:
setPivotInB
in classConstraint
- Parameters:
location
- the desired location (not null, unaffected)
-