All Packages Class Hierarchy This Package Previous Next Index
Class primitives.machines.TwolegsMachine
java.lang.Object
|
+----primitives.machines.Machine
|
+----primitives.machines.TwolegsMachine
- public class TwolegsMachine
- extends Machine
A missleading name for this class. A class originaly used to draw a 2 legs machine
was generelized to manipulate a machine with one anchor and a series of connected
joints starting from the anchor.
- See Also:
- TwoLegDemo, TwoLegSpaceDemo
-
angles
- A list of current angles between adjacent joints.
-
distances
- A list of the machine's rigid bars' lenghts.
-
legs
- Numner of legs in the machine.
-
TwolegsMachine(Dimension, int)
- Initializes a machine with a given number of legs.
-
redraw(Graphics)
- Draws the machine.
-
rotateJoint(int, double)
- Rotates the machine by physically rotating the specified joint.
legs
public int legs
- Numner of legs in the machine.
[should be private]
angles
double angles[]
- A list of current angles between adjacent joints.
Used to preform rotations.
- See Also:
- rotateJoint
distances
double distances[]
- A list of the machine's rigid bars' lenghts.
TwolegsMachine
public TwolegsMachine(Dimension d,
int legs)
- Initializes a machine with a given number of legs.
- Parameters:
- d - the size of the rectangle to draw the machine in.
- legs - the number of legs of the machine.
redraw
public void redraw(Graphics g)
- Draws the machine.
- Parameters:
- g - the grapic context to draw to.
- Overrides:
- redraw in class Machine
- See Also:
- MachineListener
rotateJoint
public void rotateJoint(int leg,
double dalpha)
- Rotates the machine by physically rotating the specified joint.
- Parameters:
- leg - rotate the machine starting from this joint.
- dalpha - the amount in radians to rotate the specified joint.
- See Also:
- rotateJoint
All Packages Class Hierarchy This Package Previous Next Index