com.turtle3d.turtle
Class Turtle3DImplementation

java.lang.Object
  extended by com.turtle3d.turtle.Turtle3DCore
      extended by com.turtle3d.turtle.Turtle3DImplementation
All Implemented Interfaces:
Turtle3D

public class Turtle3DImplementation
extends Turtle3DCore
implements Turtle3D


Constructor Summary
Turtle3DImplementation()
           
 
Method Summary
 void forward(float distance)
          Move forward
 int getDepth()
          Depth reached by turtle.
 int getMaximalDepth()
          Maximal depth reached by turtle.
 void pitch(float angle)
          Pitch down/up
 void pop()
          Pop transformation from the stack and make it actual one
 void push()
          Push actual transformation to the stack
 void roll(float angle)
          Roll left/right
 void scale(float x, float y, float z)
          Scale turtle
 void turn(float angle)
          Turn left/right
 
Methods inherited from class com.turtle3d.turtle.Turtle3DCore
getTransformMatrix, setTransformMatrix, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.turtle3d.turtle.Turtle3D
getTransformMatrix, transform
 

Constructor Detail

Turtle3DImplementation

public Turtle3DImplementation()
Method Detail

forward

public void forward(float distance)
Description copied from interface: Turtle3D
Move forward

Specified by:
forward in interface Turtle3D
Parameters:
distance - Distance to move, negative value means backwards

turn

public void turn(float angle)
Description copied from interface: Turtle3D
Turn left/right

Specified by:
turn in interface Turtle3D
Parameters:
angle - Angle in degrees, negative means left

roll

public void roll(float angle)
Description copied from interface: Turtle3D
Roll left/right

Specified by:
roll in interface Turtle3D
Parameters:
angle - Angle in degrees, negative means left

pitch

public void pitch(float angle)
Description copied from interface: Turtle3D
Pitch down/up

Specified by:
pitch in interface Turtle3D
Parameters:
angle - Angle in degrees, negative means down

push

public void push()
Description copied from interface: Turtle3D
Push actual transformation to the stack

Specified by:
push in interface Turtle3D

pop

public void pop()
Description copied from interface: Turtle3D
Pop transformation from the stack and make it actual one

Specified by:
pop in interface Turtle3D

getDepth

public int getDepth()
Description copied from interface: Turtle3D
Depth reached by turtle. Each forward command rises depth by one. Depth is pushed and popped too.

Specified by:
getDepth in interface Turtle3D
Returns:
depth

getMaximalDepth

public int getMaximalDepth()
Description copied from interface: Turtle3D
Maximal depth reached by turtle.

Specified by:
getMaximalDepth in interface Turtle3D
Returns:
Maximal depth reached by turtle

scale

public void scale(float x,
                  float y,
                  float z)
Description copied from interface: Turtle3D
Scale turtle

Specified by:
scale in interface Turtle3D
Parameters:
x - scale axis x
y - scale axis y
z - scale axis z