public class Torch
extends Actor
Constructor and Description |
---|
Torch(double power,
Location loc,
int height)
Creates a spot light source of given intensity above the given location.
|
Modifier and Type | Method and Description |
---|---|
Location |
getInitialLoc()
Returns the initial location of the torch actor.
|
double |
getIntensity(Location target)
Returns the light intensity at given location using the 1 / r^2
law.
|
void |
setHeight(int height)
Sets the height of the torch (z-coordinate).
|
void |
setPixelLocation(int x,
int y)
Sets the torch to given pixel location.
|
public Torch(double power, Location loc, int height)
power
- the intensity of the source (arbitrary units)loc
- the initial locaction (x-, y-coordinates) of the sourceheight
- the initial height above the robot moving surface (z-coordinate, in pixels)public double getIntensity(Location target)
target
- the location where to report the intensitypublic Location getInitialLoc()
public void setPixelLocation(int x, int y)
x
- the new pixel x-coordinatey
- the new pixel y-coordinatepublic void setHeight(int height)
height
- the new height above the robot moving surface