|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectScene
public class Scene
A class that contains all information necessary to render a scene, including objects in the scene, lights in the scene, viewport dimensions, and global scene properties.
Field Summary | |
---|---|
static float |
DEFAULT_MIN_RAY_WEIGHT
|
static int |
DEFAULT_RECURSION_DEPTH
|
static double |
EPSILON
|
Constructor Summary | |
---|---|
Scene()
Constructs the default (empty) scene. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Returns a copy of the object. |
Air |
getAir()
Returns the medium rays travel through when not in an object. |
javax.vecmath.Color3f |
getAmbientLight()
Returns the ambient light in the scene. |
Camera |
getCamera()
Returns the scene's camera. |
int |
getHeight()
Returns the height of the viewport in pixels. |
java.util.ArrayList<Light> |
getLights()
Returns the lights in the scene. |
float |
getMinimumRayWeight()
Returns the minimum weight of a ray. |
int |
getRecursionDepth()
Returns the maximum recursion depth of a traced ray. |
java.util.ArrayList<Shape> |
getShapes()
Returns the shapes in the scene. |
java.awt.Dimension |
getViewportDimensions()
Returns the dimensions of the viewport in pixels. |
int |
getWidth()
Returns the width of the viewport in pixels. |
boolean |
LoadScene(java.io.File file)
Loads a scene from the specified file. |
boolean |
LoadScene(java.lang.String data)
Loads a scene from a string containing the scene data. |
void |
reset()
Resets the scene back to the default (empty) state. |
void |
setAir(Air air)
Sets the medium rays travel through when not inside an object. |
void |
setMinimumRayWeight(float minWeight)
Sets the minimum weight of a ray. |
void |
setRecursionDepth(int depth)
Sets the maximum recursion depth of a traced ray. |
void |
setViewportDimensions(int width,
int height,
float aspectRatio)
Sets the dimensions of the viewport. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_RECURSION_DEPTH
public static final double EPSILON
public static final float DEFAULT_MIN_RAY_WEIGHT
Constructor Detail |
---|
public Scene()
Method Detail |
---|
public java.lang.Object clone()
CloneableEx
clone
in interface CloneableEx
clone
in class java.lang.Object
public void reset()
public boolean LoadScene(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException
file
- The file containing scene data.
true
if the scene was loaded properly, otherwise false
.
java.io.FileNotFoundException
java.io.IOException
public boolean LoadScene(java.lang.String data)
data
- The string containing the scene data.
true
if the scene was loaded properly, otherwise false
.public java.util.ArrayList<Shape> getShapes()
public java.util.ArrayList<Light> getLights()
public javax.vecmath.Color3f getAmbientLight()
public Camera getCamera()
public java.awt.Dimension getViewportDimensions()
public void setViewportDimensions(int width, int height, float aspectRatio)
aspectRatio
is non-zero the dimension with the greatest value
is used to determine the other dimensions aspect correct value.
Otherwise, if both dimensions are non-zero the viewport dimensions are
set to those values.
Using negative values for any parameter is undefined.
width
- The width of the viewport in pixels.height
- The height of the viewport in pixels.aspectRatio
- The aspect ratio of the viewport.public int getWidth()
public int getHeight()
public void setRecursionDepth(int depth)
depth
- The number of recursions a ray will traverse.public int getRecursionDepth()
public void setMinimumRayWeight(float minWeight)
minWeight
- The minimum ray weight.public float getMinimumRayWeight()
public void setAir(Air air)
air
- The air to set.public Air getAir()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |