public final class DynamicCompiledScene
extends java.lang.Object
DynamicCompiledScene represents a dynamic and compiled version of a Scene instance.
The difference between a DynamicCompiledScene and a CompiledScene, is that the structures of the former are dynamic, whereas the structures of the latter are static.
A DynamicCompiledScene allows you to add new and update or remove existing structures. A structure may only be removed when no other structure is referencing it. When a new structure has been added, or an existing updated, pruning can be
performed to automatically remove structures that are not referenced. To perform pruning, call prune().
| Constructor and Description |
|---|
DynamicCompiledScene()
Constructs a new
DynamicCompiledScene instance. |
| Modifier and Type | Method and Description |
|---|---|
int |
add(Point2F point2F)
Adds
point2F to this DynamicCompiledScene instance. |
int |
add(Point3F point3F)
Adds
point3F to this DynamicCompiledScene instance. |
int |
add(Surface surface)
Adds
surface to this DynamicCompiledScene instance. |
int |
add(Texture texture)
Adds
texture to this DynamicCompiledScene instance. |
int |
add(Vector3F vector3F)
Adds
vector3F to this DynamicCompiledScene instance. |
int |
indexOf(Point2F point2F)
Returns the index of
point2F, or -1 if it does not exist. |
int |
indexOf(Point3F point3F)
Returns the index of
point3F, or -1 if it does not exist. |
int |
indexOf(Surface surface)
Returns the index of
surface, or -1 if it does not exist. |
int |
indexOf(Texture texture)
Returns the index of
texture, or -1 if it does not exist. |
int |
indexOf(Vector3F vector3F)
Returns the index of
vector3F, or -1 if it does not exist. |
void |
prune()
Prunes the structures of this
DynamicCompiledScene instance. |
int |
referencesTo(Point2F point2F)
Returns the number of references to
point2F. |
int |
referencesTo(Point3F point3F)
Returns the number of references to
point3F. |
int |
referencesTo(Surface surface)
Returns the number of references to
surface. |
int |
referencesTo(Texture texture)
Returns the number of references to
texture. |
int |
referencesTo(Vector3F vector3F)
Returns the number of references to
vector3F. |
int |
remove(Point2F point2F)
Removes
point2F from this DynamicCompiledScene instance, if it exists. |
int |
remove(Point3F point3F)
Removes
point3F from this DynamicCompiledScene instance, if it exists. |
int |
remove(Surface surface)
Removes
surface from this DynamicCompiledScene instance, if it exists. |
int |
remove(Texture texture)
Removes
texture from this DynamicCompiledScene instance, if it exists. |
int |
remove(Vector3F vector3F)
Removes
vector3F from this DynamicCompiledScene instance, if it exists. |
public DynamicCompiledScene()
DynamicCompiledScene instance.public int add(Point2F point2F)
point2F to this DynamicCompiledScene instance.
Returns the index of point2F.
If point2F is null, a NullPointerException will be thrown.
point2F - the Point2F to addpoint2Fjava.lang.NullPointerException - thrown if, and only if, point2F is nullpublic int add(Point3F point3F)
point3F to this DynamicCompiledScene instance.
Returns the index of point3F.
If point3F is null, a NullPointerException will be thrown.
point3F - the Point3F to addpoint3Fjava.lang.NullPointerException - thrown if, and only if, point3F is nullpublic int add(Surface surface)
surface to this DynamicCompiledScene instance.
Returns the index of surface.
If surface is null, a NullPointerException will be thrown.
surface - the Surface to addsurfacejava.lang.NullPointerException - thrown if, and only if, surface is nullpublic int add(Texture texture)
texture to this DynamicCompiledScene instance.
Returns the index of texture.
If texture is null, a NullPointerException will be thrown.
texture - the Texture to addtexturejava.lang.NullPointerException - thrown if, and only if, texture is nullpublic int add(Vector3F vector3F)
vector3F to this DynamicCompiledScene instance.
Returns the index of vector3F.
If vector3F is null, a NullPointerException will be thrown.
vector3F - the Vector3F to addvector3Fjava.lang.NullPointerException - thrown if, and only if, vector3F is nullpublic int indexOf(Point2F point2F)
point2F, or -1 if it does not exist.
If point2F is null, a NullPointerException will be thrown.
point2F - the Point2F to checkpoint2F, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, point2F is nullpublic int indexOf(Point3F point3F)
point3F, or -1 if it does not exist.
If point3F is null, a NullPointerException will be thrown.
point3F - the Point3F to checkpoint3F, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, point3F is nullpublic int indexOf(Surface surface)
surface, or -1 if it does not exist.
If surface is null, a NullPointerException will be thrown.
surface - the Surface to checksurface, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, surface is nullpublic int indexOf(Texture texture)
texture, or -1 if it does not exist.
If texture is null, a NullPointerException will be thrown.
texture - the Texture to checktexture, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, texture is nullpublic int indexOf(Vector3F vector3F)
vector3F, or -1 if it does not exist.
If vector3F is null, a NullPointerException will be thrown.
vector3F - the Vector3F to checkvector3F, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, vector3F is nullpublic int referencesTo(Point2F point2F)
point2F.
If point2F is null, a NullPointerException will be thrown.
point2F - a Point2Fpoint2Fjava.lang.NullPointerException - thrown if, and only if, point2F is nullpublic int referencesTo(Point3F point3F)
point3F.
If point3F is null, a NullPointerException will be thrown.
point3F - a Point3Fpoint3Fjava.lang.NullPointerException - thrown if, and only if, point3F is nullpublic int referencesTo(Surface surface)
surface.
If surface is null, a NullPointerException will be thrown.
surface - a Surfacesurfacejava.lang.NullPointerException - thrown if, and only if, surface is nullpublic int referencesTo(Texture texture)
texture.
If texture is null, a NullPointerException will be thrown.
texture - a Texturetexturejava.lang.NullPointerException - thrown if, and only if, texture is nullpublic int referencesTo(Vector3F vector3F)
vector3F.
If vector3F is null, a NullPointerException will be thrown.
vector3F - a Vector3Fvector3Fjava.lang.NullPointerException - thrown if, and only if, vector3F is nullpublic int remove(Point2F point2F)
point2F from this DynamicCompiledScene instance, if it exists.
Returns the index of point2F, or -1 if it does not exist.
If point2F is null, a NullPointerException will be thrown.
point2F - the Point3F to removepoint2F, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, point2F is nullpublic int remove(Point3F point3F)
point3F from this DynamicCompiledScene instance, if it exists.
Returns the index of point3F, or -1 if it does not exist.
If point3F is null, a NullPointerException will be thrown.
point3F - the Point3F to removepoint3F, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, point3F is nullpublic int remove(Surface surface)
surface from this DynamicCompiledScene instance, if it exists.
Returns the index of surface, or -1 if it does not exist.
If surface is null, a NullPointerException will be thrown.
surface - the Surface to removesurface, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, surface is nullpublic int remove(Texture texture)
texture from this DynamicCompiledScene instance, if it exists.
Returns the index of texture, or -1 if it does not exist.
If texture is null, a NullPointerException will be thrown.
texture - the Texture to removetexture, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, texture is nullpublic int remove(Vector3F vector3F)
vector3F from this DynamicCompiledScene instance, if it exists.
Returns the index of vector3F, or -1 if it does not exist.
If vector3F is null, a NullPointerException will be thrown.
vector3F - the Vector3F to removevector3F, or -1 if it does not existjava.lang.NullPointerException - thrown if, and only if, vector3F is nullpublic void prune()
DynamicCompiledScene instance.
The pruning process consists of removing structures that are currently not referenced from other structures.
Some structures cannot be referenced from other structures, so these will not be pruned.
In some cases, a flag has been associated with a given structure, indicating that the structure should be exempt from pruning. These structures are usually materials or textures that can be switched between.