public class View
extends java.lang.Object
implements javax.media.opengl.GLEventListener
Modifier and Type | Field and Description |
---|---|
static float[] |
BG_RGB_STD |
static int |
CAM_NONE |
static int |
CAM_PANNING |
static int |
CAM_PANNING_H |
static int |
CAM_PANNING_V |
static int |
CAM_ROTATING |
static int |
CAM_ZOOMING |
Constructor and Description |
---|
View(AvatarEventHandler aehdlr,
JAOptions jopts,
JACanvasEmbedder embedder)
Constructor -- creates the GLCanvas, but defers the rest of
the work until the init() event.
|
Modifier and Type | Method and Description |
---|---|
void |
awaitAvatarAvailable()
Synchronously awaits establishment of an avatar if necessary.
|
java.lang.String |
currentAvatar()
Return name of current avatar.
|
void |
display(javax.media.opengl.GLAutoDrawable gld)
JOGL
EventListener method: renders the current state of
this avatar view's character onto its GLCanvas -- which
is identical to the given drawable. |
void |
displayChanged(javax.media.opengl.GLAutoDrawable gld,
boolean modeChanged,
boolean deviceChanged)
JOGL
EventListener method: accepts notification of the
given changes to the characteristics of the display supporting
this avatar view's OpenGL canvas. |
void |
dispose(javax.media.opengl.GLAutoDrawable gld) |
AmbientManager |
getAmbientManager()
Returns the ambient motion manager for this view's current character
if there is one, and if there is a rest pose frame for the character,
or
null otherwise. |
void |
getCamClipPlanes(float[] clipnf) |
void |
getCamFacing(float[] facexyz) |
float |
getCamFOV() |
void |
getCamLocation(float[] locxyz) |
void |
getCamUp(float[] upxyz) |
int |
getHeight()
Returns the height of this view's GL canvas.
|
int |
getWidth()
Returns the width of this view's GL canvas.
|
void |
handleDoIdleAmbientChange()
Responds to a change in the idle ambient scale option setting,
starting or stopping idle ambient motion if appropriate.
|
void |
init(javax.media.opengl.GLAutoDrawable gld)
JOGL
EventListener method: initialises the newly established
GL drawing context for this avatar view. |
void |
onLeftMouseDown(int x,
int y) |
void |
onMouseMove(int x,
int y) |
void |
onMouseUp() |
void |
onRightMouseDown(int x,
int y) |
void |
playAndGrabOneFrame(CASFrame FRAME,
int F,
byte[] pixels,
boolean dolog)
Generates and plays one frame, given the frame data, its index number,
taking a copy of the resulting frame image, and returning that image.
|
void |
playOneFrame(CASFrame FRAME,
int F)
Generates and plays one frame, often but not necessarily as part
of an animation sequence, given the frame data and its index number.
|
void |
playOneFrame(CASFrame FRAME,
int F,
float SPEED_UP,
boolean T_DISPLAY)
Generates and plays one frame, often but not necessarily as part
of an animation sequence, given the frame data, its index number,
the current speed-up factor (for use in performance statistics
collection), with running performance data logging output controlled
by the given flag.
|
void |
playOneFrameWithStableAmbient(CASFrame FRAME,
int F)
Generates and plays one frame, given the frame data and index number,
with no change in the ambient adjustment (if any).
|
void |
playOneIdleFrame(CASFrame FRAME)
Generates and plays the given frame, assumed to be part of an idle
(non-animating) sequence, and hence not to have an ambient
adjustment applied to it before processing.
|
void |
requestSwitchAvatar(AvatarDefinitionAccess avdef)
Requests that this view initiates a switch to the use of the avatar
with the given given definition, by loading this view's character
from the definition;
the definition may be
null , which is interpreted as
a request to unload the current avatar. |
void |
resetAmbientClock()
If the current avatar has an ambient manager, this method resets
that manager's clock.
|
void |
reshape(javax.media.opengl.GLAutoDrawable gld,
int x,
int y,
int w,
int h)
JOGL
EventListener method: accepts notification of the
given changes to the location and/or dimensions of this avatar view's
OpenGL canvas. |
void |
saveAvatarIfRequested()
Checks whether the conditions for the saving of a newly
loaded avatar definition or of its texture are satisifed,
and if so performs the appropriate save operations.
|
void |
setCamClipPlanes(float znear,
float zfar) |
void |
setCamExternal(javax.swing.event.MouseInputListener extmil) |
void |
setCamFacing(float[] facingxyz) |
void |
setCamFacing(float x,
float y,
float z) |
void |
setCamFOV(float fov) |
void |
setCamInternal() |
void |
setCamLocation(float[] locxyz) |
void |
setCamLocation(float x,
float y,
float z) |
void |
setCamUp(float[] upxyz) |
void |
setCamUp(float x,
float y,
float z) |
void |
setPlayerStats(JAPlayerStats ps)
Sets the player performance statistics gatherer for this avatar view.
|
void |
setRenderMode(int mode) |
void |
startAnimation()
Registers the start of a new animation, that is, the performance
of a sequence of (frame generation and) frame display operations.
|
void |
startAnimationForVideo(boolean log,
int width,
int height)
Registers the start of a new animation, performed for video
generation, with the given logging flag setting, and using the given
width and height values for the video images.
|
void |
stopAnimation()
Registers the completion of an animation sequence.
|
void |
stopAnimationForVideo()
Registers the completion of an animation sequence for video generation.
|
void |
terminateView()
Performs final termination for this avatar view, assuming that
an earlier call has been made to #terminateViewDisplay().
|
ThreadCompletionChecker |
terminateViewDisplay()
Terminates the display for this avatar view, and returns the
completion checker for this view's display scheduler thread.
|
public static final int CAM_NONE
public static final int CAM_ROTATING
public static final int CAM_ZOOMING
public static final int CAM_PANNING
public static final int CAM_PANNING_V
public static final int CAM_PANNING_H
public static final float[] BG_RGB_STD
public View(AvatarEventHandler aehdlr, JAOptions jopts, JACanvasEmbedder embedder)
public int getWidth()
public int getHeight()
public void awaitAvatarAvailable() throws java.lang.InterruptedException
java.lang.InterruptedException
public ThreadCompletionChecker terminateViewDisplay()
public void terminateView()
public void requestSwitchAvatar(AvatarDefinitionAccess avdef)
null
, which is interpreted as
a request to unload the current avatar.public AmbientManager getAmbientManager()
null
otherwise.public void handleDoIdleAmbientChange()
public void init(javax.media.opengl.GLAutoDrawable gld)
EventListener
method: initialises the newly established
GL drawing context for this avatar view.init
in interface javax.media.opengl.GLEventListener
public void display(javax.media.opengl.GLAutoDrawable gld)
EventListener
method: renders the current state of
this avatar view's character onto its GLCanvas
-- which
is identical to the given drawable.display
in interface javax.media.opengl.GLEventListener
public void reshape(javax.media.opengl.GLAutoDrawable gld, int x, int y, int w, int h)
EventListener
method: accepts notification of the
given changes to the location and/or dimensions of this avatar view's
OpenGL canvas.reshape
in interface javax.media.opengl.GLEventListener
public void displayChanged(javax.media.opengl.GLAutoDrawable gld, boolean modeChanged, boolean deviceChanged)
EventListener
method: accepts notification of the
given changes to the characteristics of the display supporting
this avatar view's OpenGL canvas.
JOGL2: NO LONGER IN EventListener.public void dispose(javax.media.opengl.GLAutoDrawable gld)
dispose
in interface javax.media.opengl.GLEventListener
public void setRenderMode(int mode)
public java.lang.String currentAvatar()
public void saveAvatarIfRequested()
public void setPlayerStats(JAPlayerStats ps)
public void startAnimation()
public void stopAnimation()
public void startAnimationForVideo(boolean log, int width, int height)
public void stopAnimationForVideo()
public void resetAmbientClock()
public void playOneFrameWithStableAmbient(CASFrame FRAME, int F) throws java.lang.InterruptedException, JAException
java.lang.InterruptedException
JAException
public void playOneFrame(CASFrame FRAME, int F) throws java.lang.InterruptedException, JAException
java.lang.InterruptedException
JAException
public void playOneFrame(CASFrame FRAME, int F, float SPEED_UP, boolean T_DISPLAY) throws java.lang.InterruptedException, JAException
java.lang.InterruptedException
JAException
public void playOneIdleFrame(CASFrame FRAME) throws java.lang.InterruptedException, JAException
java.lang.InterruptedException
JAException
public void playAndGrabOneFrame(CASFrame FRAME, int F, byte[] pixels, boolean dolog) throws java.lang.InterruptedException, JAException
java.lang.InterruptedException
JAException
public void setCamInternal()
public void setCamExternal(javax.swing.event.MouseInputListener extmil)
public void onLeftMouseDown(int x, int y)
public void onRightMouseDown(int x, int y)
public void onMouseMove(int x, int y)
public void onMouseUp()
public void setCamLocation(float[] locxyz)
public void setCamLocation(float x, float y, float z)
public void setCamFacing(float[] facingxyz)
public void setCamFacing(float x, float y, float z)
public void setCamUp(float[] upxyz)
public void setCamUp(float x, float y, float z)
public void setCamClipPlanes(float znear, float zfar)
public void setCamFOV(float fov)
public void getCamLocation(float[] locxyz)
public void getCamFacing(float[] facexyz)
public void getCamUp(float[] upxyz)
public void getCamClipPlanes(float[] clipnf)
public float getCamFOV()