public class Instance extends java.lang.Object implements RenderObject
Geometry
into the scene. This class
maps object space to world space and maintains a list of shaders and
modifiers attached to the surface.Constructor and Description |
---|
Instance() |
Modifier and Type | Method and Description |
---|---|
static Instance |
createTemporary(PrimitiveList primitives,
Matrix4 transform,
Shader shader) |
BoundingBox |
getBounds()
Get the world space bounding box for this instance.
|
Modifier |
getModifier(int i)
Get a modifier for the instance's list.
|
Shader |
getShader(int i)
Get a shader for the instance's list.
|
boolean |
hasGeometry(Geometry g)
Checks to see if this instance is relative to the specified geometry.
|
void |
prepareShadingState(ShadingState state)
Prepare the shading state for shader invocation.
|
void |
removeModifier(Modifier m)
Remove the specified modifier from the instance's list if it is being
used.
|
void |
removeShader(Shader s)
Remove the specified shader from the instance's list if it is being used.
|
boolean |
update(ParameterList pl,
SunflowAPI api)
Update this object given a list of parameters.
|
void |
updateBounds()
Recompute world space bounding box of this instance.
|
public static Instance createTemporary(PrimitiveList primitives, Matrix4 transform, Shader shader)
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 void updateBounds()
public boolean hasGeometry(Geometry g)
g
- geometry to check againsttrue
if the instanced geometry is equals to g,
false
otherwisepublic void removeShader(Shader s)
s
- shader to removepublic void removeModifier(Modifier m)
m
- modifier to removepublic BoundingBox getBounds()
public void prepareShadingState(ShadingState state)
state
- shading state to be preparedpublic Shader getShader(int i)
i
- index into the shader listnull
if the input is invalidpublic Modifier getModifier(int i)
i
- index into the modifier listnull
if the input is
invalid