public class Camera extends java.lang.Object implements RenderObject
CameraLens
objects which compute the actual projection.Constructor and Description |
---|
Camera(CameraLens lens) |
Modifier and Type | Method and Description |
---|---|
Ray |
getRay(float x,
float y,
int imageWidth,
int imageHeight,
double lensX,
double lensY,
float time)
Generate a ray passing though the specified point on the image plane.
|
float |
getTime(float time)
Computes actual time from a time sample in the interval [0,1).
|
boolean |
update(ParameterList pl,
SunflowAPI api)
Update this object given a list of parameters.
|
public Camera(CameraLens lens)
public boolean update(ParameterList pl, SunflowAPI api)
RenderObject
update
in interface RenderObject
pl
- list of parameters to read fromapi
- reference to the current scenetrue
if the update is succesfull,
false
otherwisepublic float getTime(float time)
time
- public Ray getRay(float x, float y, int imageWidth, int imageHeight, double lensX, double lensY, float time)
null
for invalid arguments or for pixels which
don't project to anything.x
- x pixel coordinatey
- y pixel coordinateimageWidth
- width of the image in pixelsimageHeight
- height of the image in pixelslensX
- a random variable in [0,1) to be used for DOF samplinglensY
- a random variable in [0,1) to be used for DOF samplingtime
- a random variable in [0,1) to be used for motion blur
samplingnull