Package com.jme3.bullet.joints
Class ConeJoint
java.lang.Object
com.jme3.bullet.NativePhysicsObject
com.jme3.bullet.joints.PhysicsJoint
com.jme3.bullet.joints.Constraint
com.jme3.bullet.joints.ConeJoint
- 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 btConeTwistConstraint.
 
 From the Bullet manual:
 To create ragdolls, the cone twist constraint is very useful for limbs like
 the upper arm. It is a special point to point constraint that adds cone and
 twist axis limits. The x-axis serves as twist axis.
- 
Field SummaryFieldsFields inherited from class com.jme3.bullet.joints.Constraintlogger15, pivotA, pivotBFields inherited from class com.jme3.bullet.joints.PhysicsJointloggerFields inherited from class com.jme3.bullet.NativePhysicsObjectloggerN
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedNo-argument constructor needed by SavableClassUtil.ConeJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInB) Instantiate a double-ended ConeJoint.ConeJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInB, com.jme3.math.Matrix3f rotInA, com.jme3.math.Matrix3f rotInB) Instantiate a double-ended ConeJoint.ConeJoint(PhysicsRigidBody rigidBodyA, com.jme3.math.Vector3f pivotInA, com.jme3.math.Matrix3f rotInA) Instantiate a single-ended ConeJoint with its pivot at the physics-space origin.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcloneFields(com.jme3.util.clone.Cloner cloner, Object original) Callback fromClonerto convert this shallow-cloned joint into a deep-cloned one, using the specified Cloner and original to resolve copied fields.com.jme3.math.TransformgetFrameTransform(JointEnd end, com.jme3.math.Transform storeResult) Copy the joint's frame transform relative to the specified end.floatReturn the span of the first swing axis.floatReturn the span of the 2nd swing axis.floatReturn the span of the twist (local X) axis.booleanTest whether this joint is angular-only.voidread(com.jme3.export.JmeImporter importer) De-serialize this joint from the specified importer, for example when loading from a J3O file.voidsetAngularOnly(boolean value) Alter whether this joint is angular-only.voidsetLimit(float swingSpan1, float swingSpan2, float twistSpan) Alter the angular limits for this joint.voidwrite(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.ConstraintcopyConstraintProperties, getAppliedImpulse, getBodyA, getBodyB, getBreakingImpulseThreshold, getConstraintType, getOverrideIterations, getPivot, getPivotA, getPivotB, isCollisionBetweenLinkedBodies, isEnabled, isFeedback, overrideIterations, readConstraintProperties, setBreakingImpulseThreshold, setCollisionBetweenLinkedBodies, setEnabled, setFeedback, setPivotInA, setPivotInBMethods inherited from class com.jme3.bullet.joints.PhysicsJointcountEnds, destroy, findEnd, findOtherBody, getBody, getPhysicsSpace, jmeClone, setBodyA, setBodyB, setNativeId, setPhysicsSpace, toStringMethods inherited from class com.jme3.bullet.NativePhysicsObjectcompareTo, countTrackers, dumpTrackers, equals, freeUnusedObjects, hasAssignedNativeObject, hashCode, nativeId, reassignNativeId, setNativeIdNotTracked, unassignNativeObject
- 
Field Details- 
logger2message logger for this class
 
- 
- 
Constructor Details- 
ConeJointprotected ConeJoint()No-argument constructor needed by SavableClassUtil.
- 
ConeJointpublic ConeJoint(PhysicsRigidBody rigidBodyA, com.jme3.math.Vector3f pivotInA, com.jme3.math.Matrix3f rotInA) Instantiate a single-ended ConeJoint with its pivot at the physics-space origin.To be effective, the joint must be added to the PhysicsSpace of the body 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)
- rotInA- the joint orientation in A's local coordinates (rotation matrix, unaffected)
 
- 
ConeJointpublic ConeJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInB) Instantiate a double-ended ConeJoint.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)
 
- 
ConeJointpublic ConeJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, com.jme3.math.Vector3f pivotInA, com.jme3.math.Vector3f pivotInB, com.jme3.math.Matrix3f rotInA, com.jme3.math.Matrix3f rotInB) Instantiate a double-ended ConeJoint.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)
- rotInA- the joint orientation in A's local coordinates (rotation matrix, unaffected)
- rotInB- the joint orientation in B's local coordinates (rotation matrix, unaffected)
 
 
- 
- 
Method Details- 
getFrameTransformCopy the joint's frame transform relative to the specified end.- Parameters:
- end- which end (not null)
- storeResult- storage for the result (modified if not null)
- Returns:
- the transform of the constraint space relative to the end
 
- 
getSwingSpan1public float getSwingSpan1()Return the span of the first swing axis.- Returns:
- the span (in radians)
 
- 
getSwingSpan2public float getSwingSpan2()Return the span of the 2nd swing axis.- Returns:
- the span (in radians)
 
- 
getTwistSpanpublic float getTwistSpan()Return the span of the twist (local X) axis.- Returns:
- the span (in radians)
 
- 
isAngularOnlypublic boolean isAngularOnly()Test whether this joint is angular-only.- Returns:
- true if angular only, otherwise false
 
- 
setAngularOnlypublic void setAngularOnly(boolean value) Alter whether this joint is angular-only.- Parameters:
- value- the desired setting (default=false)
 
- 
setLimitpublic void setLimit(float swingSpan1, float swingSpan2, float twistSpan) Alter the angular limits for this joint.- Parameters:
- swingSpan1- the desired span of the first swing axis (in radians)
- swingSpan2- the desired span of the 2nd swing axis (in radians)
- twistSpan- the desired span of the twist (local X) axis (in radians)
 
- 
cloneFieldsCallback fromClonerto convert this shallow-cloned joint into a deep-cloned one, using the specified Cloner and original to resolve copied fields.- Specified by:
- cloneFieldsin interface- com.jme3.util.clone.JmeCloneable
- Overrides:
- cloneFieldsin class- Constraint
- Parameters:
- cloner- the Cloner that's cloning this joint (not null)
- original- the instance from which this joint was shallow-cloned (not null, unaffected)
 
- 
readDe-serialize this joint from the specified importer, for example when loading from a J3O file.- Specified by:
- readin interface- com.jme3.export.Savable
- Overrides:
- readin class- Constraint
- Parameters:
- importer- (not null)
- Throws:
- IOException- from the importer
 
- 
writeSerialize this joint to the specified exporter, for example when saving to a J3O file.- Specified by:
- writein interface- com.jme3.export.Savable
- Overrides:
- writein class- Constraint
- Parameters:
- exporter- (not null)
- Throws:
- IOException- from the exporter
 
 
-