Joint a is class used to connect two Mobile objects together. The Joint class itself is actually never instantiated--instead, one of the following joint subclasses should be used.
- PrismaticJoint for linear sliding joints between links
- RevoluteJoint for rotational joints between links
- FixedJoint for static joints between links
- BallJoint for ball joints between links
- UniversalJoint for ball joints between links
Although the class itself is never instantiated, the class methods described below are often used with the object's subclasses.
The joints supported in breve can be 1, 2 or 3 degrees of freedom (DOF), meaning that they allow motion in 1, 2 or 3 independent directions.
Getting the Objects Connected by a Joint
Setting parameters for joint springs and damping (friction)
Getting and Setting the Velocity of a Joint
Manipulating Joint Strength
- get-force
- get-max-joint-limit-vector
- get-min-joint-limit-vector
- get-strength-hard-limit
- get-strength-limit
- get-torque
- set-joint-limit-vectors
- set-joint-torque-vector
- set-strength-limit
Getting and Setting Joint Position & Orientation
- get-child-link-point
- get-joint-normal
- get-parent-link-point
- set-child-link-point
- set-joint-normal
- set-parent-link-point
- set-relative-rotation
- set-relative-rotation-matrix
Breaking Joints
Automatic Joint Scaling
Breaks this joint--removes the child (and all of the links connected to it) from the body. The child link (and its descendents) are therefore removed from the world and placed in limbo. They may be reconnected later by creating another Joint, or it may be associated with a MultiBody of its own.
The Joint object is not freed—this has been changed from breve 1.7. By calling this method, you break the joint without releasing it such that it can be used again. If you do not with to use the Joint object again, then simply freeing the Joint object will break the joint and delete the object.
Disables automatic joint scaling, if it had previously been enabled using enable-automatic-joint-scaling.
Tracks changes to sizes in the link shapes, and automatically "scales" the joint (more accurately, the link points) such that the resized links will maintain the same relative distance from one another. This feature is likely to be desirable whenever "growth" of MultiBody objects is simulated.
This can be later disabled using disable-automatic-joint-scaling.
Returns the object identified as the "child" ojbect.
Returns the child link point.
Returns the force applied by this joint to maintain the desired relationships of the connected bodies. In other words, the stress force on the joint.
The forces applied to connected bodies are generally equal and opposite, so this value is computed as f1 + -f2, where f1 and f2 are the forces acting on the first and second bodies.
Returns the joint's normal vector.
Returns the scalar velocity of the joint. This is only useful for 1-DOF joints (prismatic and revolute). For higher-DOF joints, use get-joint-velocity-vector.
Returns the vector velocity of the joint. For 1-DOF joints (prismatic, revolute), only the X-component is valid. For 2-DOF joints (universal), both the X- and the Y-components are used. For a ball joint, all three values are provided.
Returns the maximum joint limit vector, if it has been set.
Returns the minimum joint limit vector, if it has been set.
Returns the object identified as the "parent" ojbect.
Returns the child link point.
Returns the "hard" limit of the joint--the maximum torque that you are allowed to put on a single joint.
Returns the user set strength limit of the joint.
Returns the torque applied by this joint to maintain the desired relationships of the connected bodies. In other words, the stress torque on the joint.
The torques applied to connected bodies are generally equal and opposite, so this value is computed as t1 + -t2, where t1 and t2 are the torques acting on the first and second bodies.
Sets the joint's constraint force mixing parameter. See the ODE physics engine documentation for more details.
Dynamically sets the child's link point for this joint. This method can be called over the course of the simulation to change the way the joint works.
If the Joint is not linked, this call has no effect.
Enable this joint's spring to take effect when the rotation is above theMax or below theMin. When the position of the joint is between theMin and theMax, the spring applies no force to the joint. When the position goes out of this range a force is applied according to the strength of the joint (theStrength) and distance to the "natural" range.
To revert to the default behavior of no spring acting on the joint, use the method remove-spring.
Sets the joint's error correction parameter. See the ODE physics engine documentation for more details.
Sets the joint damping--the friction of the joint.
A convenience method for setting joint limits for any kind of joint. For 1-DOF joints (prismatic, revolute) only the X values from the vectors are used. For 2-DOF joints (universal), both X and Y values are used. For 3-DOF joints, all the values are used.
Note that this method is just an alternative to the set-joint-limit methods which exist in all of the joints which support limits.
If this type of joint supports it this method sets the normal vector for the motion for the joint. The precise meaning of the normal vector depends on the exact type of joint. See each joint's link method documentation for more details.
Applies torque on one or more axes. This method can be used when setting the torque of ball or universal joints.
Sets the joint velocity to newVelocity.
Dynamically sets the parent's link point for this joint. This method can be called over the course of the simulation to change the way the joint works.
If the Joint is not linked, this call has no effect.
To avoid undesirable "jumping" behavior, this method should be called before linking the joint.
Sets the relative rotation between the child and parent Link to newRotation. This rotation specifies the rotation of the child link when the joint is "relaxed" or at its natural position.
Changing the relative rotation of the joint fundamentally changes the way the joint works, and should not be used as a "normal" joint motion: the relative rotation may be changed dynamically over the course of the simulation, though it may cause unexpected and unrealistic behavior if the change is not made gradually, or if the bodies involved are in contact with other bodies at the time of the change.
To avoid undesirable "jumping" behavior, this method should be called before linking the joint.
Sets the relative rotation between the child and parent Link to newRotation. This rotation specifies the rotation of the child link when the joint is "relaxed" or at its natural position.
The method set-relative-rotation is somewhat easier to use, since it does not require the actual rotation matrix.
Changing the relative rotation of the joint fundamentally changes the way the joint works, and should not be used as a "normal" joint motion: the relative rotation may be changed dynamically over the course of the simulation, though it may cause unexpected and unrealistic behavior if the change is not made gradually, or if the bodies involved are in contact with other bodies at the time of the change.
Sets the maximum torque to be used by this joint when attempting to attain the target speed.