|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.surface.BaseRenderingProcessor
Base handling to render for a single output device - be it on-screen or off.
Field Summary | |
protected double |
aspectRatio
The current aspect ratio. |
protected java.lang.Integer[] |
availableClips
Stack of the available OGL clip IDs that could be assigned to clips |
protected java.lang.Integer[] |
availableLights
Stack of the available OGL light IDs that could be assigned to lights |
protected float[] |
backgroundMatrix
Matrix for the background rendering |
protected javax.vecmath.Matrix4f |
cameraMatrix
World to local matrix (the camera) matrix |
protected float[] |
clearColor
The current clear colour |
protected IntHashMap |
clipIdMap
Mapping of the object ID to it's used clip ID |
protected Background |
currentBackground
The current background instance |
protected TransformGroup[] |
currentBackgroundPath
Path to the current background |
protected Fog |
currentFog
The current fog instance |
protected TransformGroup[] |
currentFogPath
Path to the current fog |
protected double[] |
currentFrustum
The current frustum paramaters |
protected java.lang.Integer |
currentShaderProgramId
The current program ID for GLSLang shaders. |
protected Viewpoint |
currentViewpoint
The current viewpoint instance |
protected java.awt.Rectangle |
currentViewport
Data describing the current viewport if explicit values used |
protected ViewEnvironment |
defaultEnvironment
The default view environment if none set |
protected DeletableSceneGraphObject[] |
deleteQueue
Queue for holding deleted textures |
protected RenderEffectsProcessor |
effectsProcessor
Pre and Post-render effects processor, if set |
protected boolean |
explicitViewport
Flag indicating whether an explicit viewport is provided or not |
protected float[] |
eyePoint
The eye offset from the normal position |
protected static int |
INITIAL_DELETE_SIZE
Initial size of the deletion queue array |
protected static int |
INITIAL_PATH_DEPTH
Initial depth for the number of transforms above a view,fog or bg |
protected static java.lang.Integer |
INVALID_SHADER
The invalid shader ID |
protected int |
lastClipIdx
index in the availableClips list of the last available |
protected int |
lastLightIdx
index in the availableLights list of the last available |
protected int |
lastShaderInitIdx
The current place to add shader init requestors |
protected int |
lastShaderLogIdx
The current place to add shader log requestors |
protected IntHashMap |
lightIdMap
Mapping of the object ID to it's used light ID |
protected static int |
LIST_START_SIZE
The initial size of the children list |
protected MatrixUtils |
matrixUtils
Matrix utility code for doing inversions |
protected static java.lang.String |
NOT_LIVE_BG_MSG
Message if the node is not live |
protected static java.lang.String |
NOT_LIVE_FOG_MSG
Message if the node is not live |
protected static java.lang.String |
NOT_LIVE_VP_MSG
Message if the node is not live |
protected int |
numDeletions
The number of deletable objects to handle next frame |
protected int |
numRenderables
Number of items in the renderable list |
protected int[] |
operationList
Local storage of the nodes that need to be rendered |
protected boolean |
recalcAspect
Recalculate aspect ratio on resize. |
protected RenderDetails[] |
renderableList
Local storage of the nodes that need to be rendered |
protected boolean |
resetColor
Flag to say that colour needs to be reset this frame |
protected ShaderSceneGraphObject[] |
shaderInitList
The change requestors for data changed sets |
protected static int |
SHADERLIST_START_SIZE
The initial size of the shader init/log lists |
protected ShaderSceneGraphObject[] |
shaderLogList
The change requestors for bounds changed sets |
protected static java.lang.String |
SHARED_BG_MSG
Message when we discover the background is under a shared group/node |
protected static java.lang.String |
SHARED_FOG_MSG
Message when we discover the fog is under a shared group/node |
protected static java.lang.String |
SHARED_VP_MSG
Message when we discover the VP is under a shared group/node |
protected javax.vecmath.Matrix4f |
surfaceMatrix
Combined view and projection matrix |
protected boolean |
terminate
Request that the current drawing terminate immediately. |
protected java.lang.Object |
userData
Generic user data that is assigned to this scene |
protected ViewEnvironment |
viewEnvironment
Current view environment |
protected boolean |
viewEnvironmentChanged
If the view environment or one of it's parameters have changed |
protected float[] |
viewMatrix
Array version of the view matrix in use - direct to OpenGL |
protected boolean |
viewportChanged
If the viewport has changed, update |
protected int |
windowHeight
Current surface height |
protected int |
windowWidth
Current surface width |
Method Summary | |
void |
display(net.java.games.jogl.GLDrawable drawable)
Called by the drawable to perform rendering by the client. |
void |
displayChanged(net.java.games.jogl.GLDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
Called by the drawable when the display mode or the display device associated with the GLDrawable has changed. |
void |
getCenterEyeInSurface(javax.vecmath.Point3f position)
Get the Center Eye position in surface coordinates. |
void |
getPixelLocationInSurface(float x,
float y,
javax.vecmath.Point3f position)
Convert a pixel location to surface coordinates. |
void |
getSurfaceToVWorld(javax.vecmath.Matrix4f matrix)
Get the surface to VWorld transformation matrix. |
void |
halt()
Force a halt of the current processing. |
void |
init(net.java.games.jogl.GLDrawable drawable)
Called by the drawable immediately after the OpenGL context is initialized; the GLContext has already been made current when this method is called. |
void |
queueDeletedObject(DeletableSceneGraphObject obj)
An object has been detected as being deleted (no internal or external references to it left) and it needs to be cleaned up. |
void |
queueShaderRequests(ShaderSceneGraphObject[] initList,
int numInit,
ShaderSceneGraphObject[] logList,
int numLog)
Queue up a collection of shader objects for processing on the next frame. |
protected void |
renderViewpoint(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Render the viewpoint setup. |
void |
reshape(net.java.games.jogl.GLDrawable drawable,
int x,
int y,
int width,
int height)
Called by the drawable when the surface resizes itself. |
void |
setActiveBackground(Background bg)
Set the background path that should be applied to the current surface. |
void |
setActiveFog(Fog fog)
Set the fog that should be applied to the current surface. |
void |
setActiveView(Viewpoint vp)
Set the viewpoint path that should be applied to the current surface. |
void |
setClearColor(float r,
float g,
float b,
float a)
Set the background colour that this surface should be cleared to before the drawing step. |
void |
setDrawableObjects(RenderDetails[] nodes,
int[] renderOps,
int numValid)
Update the list of items to be rendered to the current list. |
void |
setEnvironmentData(RenderEnvironmentData data)
Convenience method to assign up all the environment data. |
void |
setRenderEffects(RenderEffectsProcessor effects,
java.lang.Object data)
Set the rendering effects processor and the associated user data. |
protected void |
setupBackgroundFrustum(net.java.games.jogl.GL gl,
double nearClip,
double farClip,
double fov)
From the current view setup of FoV, near and far clipping distances and the aspectRatio ratio, generate the 6 parameters that describe a view frustum. |
void |
setViewEnvironment(ViewEnvironment env)
Set the view environment that is used to render this surface. |
protected void |
updateProjectionMatrix(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Update the projection matrix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int LIST_START_SIZE
protected static final int INITIAL_PATH_DEPTH
protected static final int INITIAL_DELETE_SIZE
protected static final int SHADERLIST_START_SIZE
protected static final java.lang.Integer INVALID_SHADER
protected static final java.lang.String NOT_LIVE_VP_MSG
protected static final java.lang.String SHARED_VP_MSG
protected static final java.lang.String NOT_LIVE_FOG_MSG
protected static final java.lang.String SHARED_FOG_MSG
protected static final java.lang.String NOT_LIVE_BG_MSG
protected static final java.lang.String SHARED_BG_MSG
protected java.lang.Object userData
protected RenderEffectsProcessor effectsProcessor
protected Viewpoint currentViewpoint
protected Fog currentFog
protected TransformGroup[] currentFogPath
protected Background currentBackground
protected TransformGroup[] currentBackgroundPath
protected float[] clearColor
protected ViewEnvironment viewEnvironment
protected ViewEnvironment defaultEnvironment
protected double[] currentFrustum
protected boolean resetColor
protected RenderDetails[] renderableList
protected int[] operationList
protected int numRenderables
protected double aspectRatio
protected int windowWidth
protected int windowHeight
protected boolean viewEnvironmentChanged
protected boolean viewportChanged
protected DeletableSceneGraphObject[] deleteQueue
protected int numDeletions
protected ShaderSceneGraphObject[] shaderInitList
protected ShaderSceneGraphObject[] shaderLogList
protected int lastShaderInitIdx
protected int lastShaderLogIdx
protected java.lang.Integer currentShaderProgramId
protected java.lang.Integer[] availableLights
protected int lastLightIdx
protected IntHashMap lightIdMap
protected java.lang.Integer[] availableClips
protected int lastClipIdx
protected IntHashMap clipIdMap
protected float[] viewMatrix
protected float[] backgroundMatrix
protected javax.vecmath.Matrix4f cameraMatrix
protected javax.vecmath.Matrix4f surfaceMatrix
protected float[] eyePoint
protected boolean recalcAspect
protected MatrixUtils matrixUtils
protected boolean explicitViewport
protected java.awt.Rectangle currentViewport
protected boolean terminate
Method Detail |
public void init(net.java.games.jogl.GLDrawable drawable)
init
in interface net.java.games.jogl.GLEventListener
drawable
- The display context to render topublic void reshape(net.java.games.jogl.GLDrawable drawable, int x, int y, int width, int height)
reshape
in interface net.java.games.jogl.GLEventListener
drawable
- The display context to render topublic void displayChanged(net.java.games.jogl.GLDrawable drawable, boolean modeChanged, boolean deviceChanged)
displayChanged
in interface net.java.games.jogl.GLEventListener
drawable
- The display context to render topublic void display(net.java.games.jogl.GLDrawable drawable)
display
in interface net.java.games.jogl.GLEventListener
drawable
- The display context to render topublic void halt()
halt
in interface org.j3d.aviatrix3d.surface.Renderer
public void queueDeletedObject(DeletableSceneGraphObject obj)
cleanup()
method called and then the
reference to it should be discarded.
queueDeletedObject
in interface org.j3d.aviatrix3d.surface.Renderer
obj
- The instance to be queued up as no longer being usedpublic void queueShaderRequests(ShaderSceneGraphObject[] initList, int numInit, ShaderSceneGraphObject[] logList, int numLog)
queueShaderRequests
in interface org.j3d.aviatrix3d.surface.Renderer
initList
- The shaders needing initialisationnumInit
- The number of shaders needing initialisationlogList
- The shaders needing log fetchingnumLog
- The number of shaders needing log fetchingpublic void setEnvironmentData(RenderEnvironmentData data) throws java.lang.IllegalArgumentException
setEnvironmentData
in interface org.j3d.aviatrix3d.surface.Renderer
java.lang.IllegalArgumentException
- The path contains a SharedGroup or
the node is not livepublic void setActiveView(Viewpoint vp) throws java.lang.IllegalArgumentException
setActiveView
in interface org.j3d.aviatrix3d.surface.Renderer
vp
- The instance of the active viewpoint to use
java.lang.IllegalArgumentException
- The path contains a SharedGroup or
the node is not livepublic void setActiveFog(Fog fog) throws java.lang.IllegalArgumentException
setActiveFog
in interface org.j3d.aviatrix3d.surface.Renderer
fog
- The instance of the active fog node
java.lang.IllegalArgumentException
- The path contains a SharedGroup or
the node is not livepublic void setActiveBackground(Background bg) throws java.lang.IllegalArgumentException
setActiveBackground
in interface org.j3d.aviatrix3d.surface.Renderer
bg
- The instance of the active background
java.lang.IllegalArgumentException
- The path contains a SharedGroup or
the node is not livepublic void setViewEnvironment(ViewEnvironment env)
setViewEnvironment
in interface org.j3d.aviatrix3d.surface.Renderer
env
- The environment instance to use for the render setuppublic void setRenderEffects(RenderEffectsProcessor effects, java.lang.Object data)
setRenderEffects
in interface org.j3d.aviatrix3d.surface.Renderer
public void setClearColor(float r, float g, float b, float a)
setClearColor
in interface org.j3d.aviatrix3d.surface.Renderer
r
- The red component of the background clear colourg
- The green component of the background clear colourb
- The blue component of the background clear coloura
- The alpha component of the background clear colourpublic void setDrawableObjects(RenderDetails[] nodes, int[] renderOps, int numValid)
setDrawableObjects
in interface org.j3d.aviatrix3d.surface.Renderer
nodes
- The list of nodes in sorted orderrenderOps
- Operation to perform on each nodenumValid
- The number of valid items in the arraypublic void getSurfaceToVWorld(javax.vecmath.Matrix4f matrix)
getSurfaceToVWorld
in interface org.j3d.aviatrix3d.surface.Renderer
matrix
- The matrix to copy into It must be preallocated.public void getPixelLocationInSurface(float x, float y, javax.vecmath.Point3f position)
getPixelLocationInSurface
in interface org.j3d.aviatrix3d.surface.Renderer
x
- The X coordinatey
- The Y coordinateposition
- The converted position. It must be preallocated.public void getCenterEyeInSurface(javax.vecmath.Point3f position)
getCenterEyeInSurface
in interface org.j3d.aviatrix3d.surface.Renderer
position
- The current eye position. It must be preallocated.protected void renderViewpoint(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
gl
- The gl context to draw withglu
- The utility context to draw withprotected void updateProjectionMatrix(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
gl
- The gl context to draw withglu
- The utility context to draw withprotected void setupBackgroundFrustum(net.java.games.jogl.GL gl, double nearClip, double farClip, double fov)
gl
- The OpenGL graphics context to usenearClip
- The distance to the near clip planefarClip
- The distance to the far clip planefov
- The field of view to use
|
Aviatrix3D 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |