public final class CompiledScene
extends java.lang.Object
CompiledScene represents a compiled version of a Scene instance.
To compile a Scene into a CompiledScene, use SceneCompiler and its compile(Scene) method.
| Constructor and Description |
|---|
CompiledScene(java.lang.String name,
float[] camera,
float[] point2Fs,
float[] point3Fs,
float[] spheres,
float[] surfaces,
float[] terrains,
float[] textures,
float[] vector3Fs,
int[] boundingVolumeHierarchies,
int[] planes,
int[] primitives,
int[] primitivesEmittingLight,
int[] triangles)
Constructs a new
CompiledScene instance. |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getBoundingVolumeHierarchies()
Returns the array containing all the compiled
BoundingVolumeHierarchy instances. |
float[] |
getCamera()
Returns the array containing the compiled
Camera instance. |
java.lang.String |
getName()
Returns the name of this
CompiledScene instance. |
int[] |
getPlanes()
Returns the array containing all the compiled
Plane instances. |
float[] |
getPoint2Fs()
Returns the array containing all the compiled
Point2F instances. |
float[] |
getPoint3Fs()
Returns the array containing all the compiled
Point3F instances. |
int[] |
getPrimitives()
Returns the array containing all the compiled
Primitive instances. |
int[] |
getPrimitivesEmittingLight()
Returns the array containing all the compiled
Primitive instances that emits light. |
float[] |
getSpheres()
Returns the array containing all the compiled
Sphere instances. |
float[] |
getSurfaces()
Returns the array containing all the compiled
Surface instances. |
float[] |
getTerrains()
Returns the array containing all the compiled
Terrain instances. |
float[] |
getTextures()
Returns the array containing all the compiled
Texture instances. |
int[] |
getTriangles()
Returns the array containing all the compiled
Triangle instances. |
float[] |
getVector3Fs()
Returns the array containing all the compiled
Vector3F instances. |
static CompiledScene |
read(java.io.DataInputStream dataInputStream)
Reads the data provided by
dataInputStream into a CompiledScene instance. |
static CompiledScene |
read(java.io.File file)
Reads the data provided by a file represented by
file into a CompiledScene instance. |
static CompiledScene |
read(java.lang.String filename)
Reads the data provided by a file represented by
filename into a CompiledScene instance. |
void |
write(java.io.DataOutputStream dataOutputStream)
Writes this
CompiledScene instance to dataOutputStream. |
void |
write(java.io.File file)
Writes this
CompiledScene instance to the file represented by file. |
void |
write(java.lang.String filename)
Writes this
CompiledScene instance to the file represented by filename. |
public CompiledScene(java.lang.String name,
float[] camera,
float[] point2Fs,
float[] point3Fs,
float[] spheres,
float[] surfaces,
float[] terrains,
float[] textures,
float[] vector3Fs,
int[] boundingVolumeHierarchies,
int[] planes,
int[] primitives,
int[] primitivesEmittingLight,
int[] triangles)
CompiledScene instance.
If at least one of the parameters are null, a NullPointerException will be thrown.
name - the name of this CompiledScene instancecamera - the array containing the compiled Camera instancepoint2Fs - the array containing all the compiled Point2F instancespoint3Fs - the array containing all the compiled Point3F instancesspheres - the array containing all the compiled Sphere instancessurfaces - the array containing all the compiled Surface instancesterrains - the array containing all the compiled Terrain instancestextures - the array containing all the compiled Texture instancesvector3Fs - the array containing all the compiled Vector3F instancesboundingVolumeHierarchies - the array containing all the compiled BoundingVolumeHierarchy instancesplanes - the array containing all the compiled Plane instancesprimitives - the array containing all the compiled Primitive instancesprimitivesEmittingLight - the array containing all the compiled Primitive instances that emits lighttriangles - the array containing all the compiled Triangle instancesjava.lang.NullPointerException - thrown if, and only if, at least one of the parameters are nullpublic java.lang.String getName()
CompiledScene instance.CompiledScene instancepublic float[] getCamera()
Camera instance.Camera instancepublic float[] getPoint2Fs()
Point2F instances.Point2F instancespublic float[] getPoint3Fs()
Point3F instances.Point3F instancespublic float[] getSpheres()
Sphere instances.Sphere instancespublic float[] getSurfaces()
Surface instances.Surface instancespublic float[] getTerrains()
Terrain instances.Terrain instancespublic float[] getTextures()
Texture instances.Texture instancespublic float[] getVector3Fs()
Vector3F instances.Vector3F instancespublic int[] getBoundingVolumeHierarchies()
BoundingVolumeHierarchy instances.BoundingVolumeHierarchy instancespublic int[] getPlanes()
Plane instances.Plane instancespublic int[] getPrimitives()
Primitive instances.Primitive instancespublic int[] getPrimitivesEmittingLight()
Primitive instances that emits light.Primitive instances that emits lightpublic int[] getTriangles()
Triangle instances.Triangle instancespublic void write(java.io.DataOutputStream dataOutputStream)
CompiledScene instance to dataOutputStream.
If dataOutputStream is null, a NullPointerException will be thrown.
If an I/O error occurs, an UncheckedIOException will be thrown.
dataOutputStream - the DataOutputStream to write tojava.lang.NullPointerException - thrown if, and only if, dataOutputStream is nulljava.io.UncheckedIOException - thrown if, and only if, an I/O error occurspublic void write(java.io.File file)
CompiledScene instance to the file represented by file.
If file is null, a NullPointerException will be thrown.
If an I/O error occurs, an UncheckedIOException will be thrown.
file - a File representation of the file to write tojava.lang.NullPointerException - thrown if, and only if, file is nulljava.io.UncheckedIOException - thrown if, and only if, an I/O error occurspublic void write(java.lang.String filename)
CompiledScene instance to the file represented by filename.
If filename is null, a NullPointerException will be thrown.
If an I/O error occurs, an UncheckedIOException will be thrown.
filename - the filename of the file to write tojava.lang.NullPointerException - thrown if, and only if, filename is nulljava.io.UncheckedIOException - thrown if, and only if, an I/O error occurspublic static CompiledScene read(java.io.DataInputStream dataInputStream)
dataInputStream into a CompiledScene instance.
Returns a new CompiledScene instance.
If dataInputStream is null, a NullPointerException will be thrown.
If an I/O error occurs, an UncheckedIOException will be thrown.
dataInputStream - the DataInputStream to read fromCompiledScene instancejava.lang.NullPointerException - thrown if, and only if, dataInputStream is nulljava.io.UncheckedIOException - thrown if, and only if, an I/O error occurspublic static CompiledScene read(java.io.File file)
file into a CompiledScene instance.
Returns a new CompiledScene instance.
If file is null, a NullPointerException will be thrown.
If an I/O error occurs, an UncheckedIOException will be thrown.
file - a File representation of the file to read fromCompiledScene instancejava.lang.NullPointerException - thrown if, and only if, file is nulljava.io.UncheckedIOException - thrown if, and only if, an I/O error occurspublic static CompiledScene read(java.lang.String filename)
filename into a CompiledScene instance.
Returns a new CompiledScene instance.
If filename is null, a NullPointerException will be thrown.
If an I/O error occurs, an UncheckedIOException will be thrown.
filename - the filename of the file to read fromCompiledScene instancejava.lang.NullPointerException - thrown if, and only if, filename is nulljava.io.UncheckedIOException - thrown if, and only if, an I/O error occurs