edu.byu.phun.body
Class Eye

java.lang.Object
  extended by edu.byu.phun.PropertyContainer
      extended by edu.byu.phun.Obj3D
          extended by edu.byu.phun.GroupObj
              extended by edu.byu.phun.body.Eye

public class Eye
extends GroupObj

This is a spherical eyeball centered at the origin with a radius of 1.0. The color of the iris can be changed. The default is brown.


Constructor Summary
Eye()
          Creates a new eyeball of radius 1.0 centered at the origin.
 
Method Summary
 Color getEyeColor()
          Returns the color of the iris of the eye.
 double getRotLeftRight()
          Get the left/right rotation angle.
 double getRotUpDown()
          Get the up and down angle of rotation
 void setEyeColor(Color newColor)
          Sets the color of the iris of the.
 void setEyeColor(double red, double green, double blue)
          Sets the color of the iris of the eye.
 void setRotLeftRight(double degrees)
          This will rotate the eye left and right.
 void setRotUpDown(double degrees)
          This will rotate the eye up and down.
 
Methods inherited from class edu.byu.phun.GroupObj
addPart, getPart, getPart, nParts, partNames, removePart, removePart, setColor, setPart
 
Methods inherited from class edu.byu.phun.Obj3D
getBounds, getColor, getLocation, getName, getRotX, getRotY, getRotZ, getScaleX, getScaleY, getScaleZ, getShininess, setColor, setLocation, setLocation, setName, setRotX, setRotY, setRotZ, setScale, setScale, setScaleX, setScaleY, setScaleZ, setShininess, toString
 
Methods inherited from class edu.byu.phun.PropertyContainer
getPropertyC, getPropertyD, getPropertyP, getPropertyS, propertyIsColor, propertyIsDouble, propertyIsPoint, propertyIsSettable, propertyIsString, propertyNames, setProperty, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Eye

public Eye()
Creates a new eyeball of radius 1.0 centered at the origin.

Method Detail

getEyeColor

public Color getEyeColor()
Returns the color of the iris of the eye.

Returns:
the color of the iris.

setEyeColor

public void setEyeColor(double red,
                        double green,
                        double blue)
Sets the color of the iris of the eye.

Parameters:
red - the red component. 0.0 to 1.0
green - the green component. 0.0 to 1.0
blue - the blue component. 0.0 to 1.0

setEyeColor

public void setEyeColor(Color newColor)
Sets the color of the iris of the.

Parameters:
newColor - the new iris color.

setRotUpDown

public void setRotUpDown(double degrees)
This will rotate the eye up and down. Up is positive and down is negative. Zero is straight ahead.

Parameters:
degrees - number of degrees to rotate eye. Suggested that it stays between 20 and -20.

getRotUpDown

public double getRotUpDown()
Get the up and down angle of rotation

Returns:
the up/down rotation angle
See Also:
setRotUpDown(double)

setRotLeftRight

public void setRotLeftRight(double degrees)
This will rotate the eye left and right. When looking at the eye from the front rotating the eye to your right is positive and to your left is negative. Zero is straight ahead.

Parameters:
degrees - number of degrees to rotate eye. Suggested that it stays between 20 and -20.

getRotLeftRight

public double getRotLeftRight()
Get the left/right rotation angle.

Returns:
the left/right rotation angle.
See Also:
setRotLeftRight(double)