These pages are auto-generated from self-documenting comments embedded in class files.
For more information on breve and steve, refer to the breve homepage.

## Joint : BallJoint

This class is included as part of the file Joint.tz.
To use this class in a simulation, include the line "@use Joint."

### Class description:

> This subclass of Joint is used to link two Link objects together using a ball joint.

> A BallJoint has three degrees of freedom. It can tilt "up-and-down" and "side-to-side", and can "twist". Your neck is basically a ball joint--your head tilt up-and-down, side-to-side, and can twist (although not all the way around--if your head turns all the way around, please consult the user manual for repair).

> This joint uses a scheme of 3 Euler angles to represent the relative rotation between two objects. The Z-axis of rotation is automatically derived from the parent link point, meaning that the Z-axis rotation is always a "twist" relative to the link point. The X-axis of rotation is specified by the user with the normal argument. The Y-axis is automatically derived from the other two.

> Because of a limitation of the physics engine, the Y-axis rotation is limited to a range of approximately +/- 80 degrees of rotation.

> If versions of breve prior to 2.3, there was no normal argument because the axes of rotation were automatically defined. The argument is therefore optional for backwards compatibility only, and should always be specified when writing new code.

### Class methods:

> - get-joint-angles
> - link
> - set-joint-limits
> - set-joint-velocity

`get-joint-angles`

> Returns a vector indicating how the angle of this joint is from its natural position (which corresponds to a values of 0 on all axes).

`link with-parent-point parentPoint (vector) with-child-point childPoint (vector) to-child childLink (object) parent parentLink = 0 (object) with-normal normal = (1, 0, 0) (vector) use-current-relative-rotation currentRotation = 0 (int)`

> Creates a ball (rotation on three axes) joint between parentLink and childLink. The joint will be lcoated at parentPoint on the parent's body, and at childPoint on the child's body.

> If parentLink is the value 0, then the joint will be attached to a fixed point in the world, specified with parentPoint.

`set-joint-limits a1-min min1 (double) a1-max max1 (double) a2-min min2 (double) a2-max max2 (double) a3-min min3 (double) a3-max max3 (double)`

> Sets the minimum and maximum allowed rotations (in radians) for this joint on all three of the joint's axes.

`set-joint-velocity to rotationalVelocity (vector)`

> Sets the desired joint velocity to rotationalVelocity. As a ball joint allows rotation on three axes, rotationalVelocity is a vector.

Documentation created Thu Jul 3 18:18:12 2008