simworldobjects
Class SimLightSensor

java.lang.Object
  |
  +--simworldobjects.SimSensor
        |
        +--simworldobjects.SimLightSensor
All Implemented Interfaces:
SimObject

public class SimLightSensor
extends SimSensor

Simulates a light sensor

Author:
Graham Ritchie

Constructor Summary
SimLightSensor(SimRCX r, double xOffset, double zOffset)
          Sets up a light sensor on the given SimRCX, and positions it at the the appropriate offset from the robot's position.
 
Method Summary
 int getValue()
          Returns the current brightness of the world at this sensor's position
 double getXOffset()
          Returns the offset from the owning SimRCX's x coordinate
 double getZOffset()
          Returns the offset from the owning SimRCX's y coordinate
 
Methods inherited from class simworldobjects.SimSensor
getActualBearingVelocityXY, getActualBearingVelocityXZ, getActualBearingXY, getActualBearingXZ, getActualVelocity, getDesiredBearingVelocityXY, getDesiredBearingVelocityXZ, getDesiredVelocity, getHeight, getLength, getType, getWidth, getXCoord, getYCoord, getZCoord, initSimSensor, setActualBearingVelocityXY, setActualBearingVelocityXZ, setActualBearingXY, setActualBearingXZ, setActualVelocity, setDesiredBearingVelocityXY, setDesiredBearingVelocityXZ, setDesiredVelocity, setXCoord, setYCoord, setZCoord
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimLightSensor

public SimLightSensor(SimRCX r,
                      double xOffset,
                      double zOffset)
Sets up a light sensor on the given SimRCX, and positions it at the the appropriate offset from the robot's position.
Parameters:
r - the SimRCX owner of this sensor
xOffset - the offest from the SimRCX's x position
zOffset - the offest from the SimRCX's z position
Method Detail

getValue

public int getValue()
Returns the current brightness of the world at this sensor's position
Overrides:
getValue in class SimSensor
Returns:
the light level as an int

getXOffset

public double getXOffset()
Returns the offset from the owning SimRCX's x coordinate
Returns:
the x offset

getZOffset

public double getZOffset()
Returns the offset from the owning SimRCX's y coordinate
Returns:
the y offset