|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.Leaf org.j3d.aviatrix3d.Viewpoint
public class Viewpoint
A viewpoint into the scene.
Viewpoints have their own implicit directional light (a headlight) that is controlled separately to the normal in-scenegraph lights. Lights are scoped by default and thus having the viewpoint also have a light following it around is a pain to deal with, you can select on directly on the viewpoint itself. This light is always pointing down the Z axis in the local coordinate system.
In addition to the headlight, a separate ambient light colour may be provided. Although this is provided, note that whether it has any effect is dependent on whether lighting is enabled on the object being rendered.
2D Scenes
Since a 2D scene does not have any form of lighting enabled, this class mostly acts as a placeholder to position where the view is located in a 2D frame of reference. By modifying the pixel transformations above this viewpoint, you can effect a 2D scrolling effect. All the other effects of this node are ignored.
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
Constructor Summary | |
---|---|
Viewpoint()
The default constructor where the headlight is implicitly turned off, and the default light type is directional. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(Viewpoint vp)
Compares this object with the specified object for order. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(Viewpoint vp)
Compares this object with the specified object to check for equivalence. |
Cullable |
getCullableParent()
Get the parent cullable of this instance. |
void |
getGlobalAmbientColor(float[] col)
Retrieve the current colour value from the light. |
Renderable |
getRenderable()
Get the renderable that represents the environment node rendering. |
boolean |
isDirectionalLight()
Get the current state of the headlight type. |
boolean |
isGlobalAmbientLightEnabled()
Get the current state of the global ambient light usage. |
boolean |
isHeadlightEnabled()
Get the current state of the headlight usage. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
void |
postRender(javax.media.opengl.GL gl)
|
void |
render(javax.media.opengl.GL gl)
This method is called to render this node. |
void |
setGlobalAmbientColor(float[] col)
Set the ambient colour to the new value. |
void |
setGlobalAmbientLightEnabled(boolean state)
Turn the global ambient lighting setting on or off. |
void |
setHeadlightEnabled(boolean state)
Turn the local headlight on/off. |
void |
setHeadlightType(boolean state)
Change the style of the headlight between directional and spot types. |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, requestBoundsUpdate, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Viewpoint()
Method Detail |
---|
public Cullable getCullableParent()
getCullableParent
in interface EnvironmentCullable
public Renderable getRenderable()
getRenderable
in interface EnvironmentCullable
public void render(javax.media.opengl.GL gl)
render
in interface ObjectRenderable
gl
- The gl context to draw withpublic void postRender(javax.media.opengl.GL gl)
postRender
in interface ObjectRenderable
protected void markBoundsDirty()
markBoundsDirty
in class Node
public int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public boolean isHeadlightEnabled()
public void setHeadlightEnabled(boolean state) throws InvalidWriteTimingException
state
- true to turn the light on
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void setGlobalAmbientLightEnabled(boolean state) throws InvalidWriteTimingException
state
- true to turn the light on
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic boolean isGlobalAmbientLightEnabled()
public void setGlobalAmbientColor(float[] col) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
col
- The new colour value to use
java.lang.IllegalArgumentException
- The colour value is out of range
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void getGlobalAmbientColor(float[] col)
col
- An array to copy the colour value intopublic boolean isDirectionalLight()
public void setHeadlightType(boolean state) throws InvalidWriteTimingException
state
- true to turn the light to directional, false for spot
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic int compareTo(Viewpoint vp)
vp
- The argument instance to be compared
public boolean equals(Viewpoint vp)
vp
- The viewpoint instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |