|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjarp.Character
public class Character
The main avatar definition class: this maintains definitions of both the static and the dynamic aspects of the avatar's skeleton and surface mesh, and provides methods to support rendering of the avatar in its current configuration.
Field Summary | |
---|---|
static int |
EYEL_4CC
|
static int |
EYER_4CC
|
static int |
HEAD_4CC
|
static float |
METRES_TO_INCHES_FLT
Standard avatar height is 1.8m == 70.87". |
static Quaternion |
QUAT_Z_MINUS_PI_BY_2
Quaternion [with components (w,x,y,z)] for a rotation by -PI/2 round the Z-axis. |
static float |
STD_AVATAR_HEIGHT_INCHES
|
static float |
STD_AVATAR_HEIGHT_METRES
|
static float |
STD_MAX_Y_METRES
|
static boolean |
USE_EMBEDDED_TEXTURE
|
static boolean |
V21_IS_VJJ_FORMAT
|
Constructor Summary | |
---|---|
Character(JAInputStream jins)
Constructs this Character using avatar definition data from the given stream, assuming to other context/resources are required (typically used by our main(java.lang.String[]) method
to read an avatar definition). |
|
Character(java.lang.String avurl,
JAInputStream jins)
|
|
Character(java.lang.String avurl,
JAInputStream jins,
java.lang.String rqstversion,
javax.media.opengl.GL2 gl,
javax.media.opengl.glu.gl2.GLUgl2 glu,
JAOptions jopts)
Constructs this Character using avatar definition data from the given stream. |
|
Character(java.lang.String avurl,
JAOptions jopts)
Minimal constructor, without specific avatar definition data. |
Method Summary | |
---|---|
float |
adjustViewYInternal()
Returns the deviation of this character's maximum y-value from the standard one, in the character's internal units -- which are the same as GL units for a character in v3 format. |
void |
buildSkin()
Computes the new mesh data for the current skeleton and morphs, and passes the result to GL for rendering. |
void |
draw(javax.media.opengl.GL2 gl)
Draws this character, using the given GL interface. |
void |
drawNormalsColour(javax.media.opengl.GL2 gl)
Draws the normals colour for this character, using the given GL interface. |
void |
generateFrame()
Generates the mesh-rendering data for the current frame. |
void |
generateFrame(float camX,
float camY,
float camZ)
Update mesh-data (vertex coordinates and normals) based on latest skeleton and morph data. |
AmbientManager |
getAmbientManager()
Returns this character's Ambient motion manager, or null
if there is none. |
Bone |
getBone(int id)
Returns the bone with the given ID. |
CASFrame |
getInitPose()
Returns a frame with standard timestamp and duration values, the initial skeleton pose, and an empty morph set. |
int |
getMeshCount()
Returns the number of meshes for this character. |
Skeleton |
getSkeleton()
Returns this character's skeleton. |
java.lang.String |
getVersion()
Returns the version number string for this character. |
boolean |
hasV3Scaling()
Indicates whether this character uses v3.0-style scaling. |
float |
heightMetres()
Returns this character's height in metres. |
float |
inchesToInternal()
Returns the scale factor needed to convert from inches to the length units used for GL rendering. |
static void |
main(java.lang.String[] args)
Main method converts an avatar file to JARP format. |
float |
maxYMetres()
Returns this character's height above the origin, in metres. |
float |
metresToInternal()
Returns the scale factor needed to convert from metres to the length units used for GL rendering -- for a v3 format avatar this unit equals the character's "intrinsic" length unit, and for a v2 format avatar it equals one inch -- assuming that this character has the standard avatar height, that is, 1.8 metres. |
float |
rootYMetres()
Returns the y-coordinate of this avatar's root bone, in metres. |
void |
save(JAOutputStream jouts)
Writes this Character to the given stream in ARP format v2.2 or later. |
void |
save(JAOutputStream jouts,
java.lang.Boolean forceSep)
|
void |
saveTextureFile()
Saves this avatar's texture image to a file. |
void |
setFrame(CASFrame frame)
Sets a new frame (pose) for this character. |
boolean |
versionIsAtLeast22()
Indicates whether this avatar is in at least v2.2 format. |
static int |
vStringAs3Digits(java.lang.String ver)
Returns the given version string as a 3-digit integer. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean USE_EMBEDDED_TEXTURE
public static final float METRES_TO_INCHES_FLT
public static final float STD_AVATAR_HEIGHT_METRES
public static final float STD_AVATAR_HEIGHT_INCHES
public static final float STD_MAX_Y_METRES
public static int HEAD_4CC
public static int EYER_4CC
public static int EYEL_4CC
public static boolean V21_IS_VJJ_FORMAT
public static final Quaternion QUAT_Z_MINUS_PI_BY_2
Constructor Detail |
---|
public Character(java.lang.String avurl, JAOptions jopts)
public Character(JAInputStream jins) throws java.io.IOException, JAException
main(java.lang.String[])
method
to read an avatar definition).
java.io.IOException
JAException
public Character(java.lang.String avurl, JAInputStream jins) throws java.io.IOException, JAException
java.io.IOException
JAException
public Character(java.lang.String avurl, JAInputStream jins, java.lang.String rqstversion, javax.media.opengl.GL2 gl, javax.media.opengl.glu.gl2.GLUgl2 glu, JAOptions jopts) throws java.io.IOException, JAException
java.io.IOException
JAException
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.io.IOException, JAException
java.io.IOException
JAException
public java.lang.String getVersion()
public boolean versionIsAtLeast22()
public boolean hasV3Scaling()
public float heightMetres()
public float maxYMetres()
public float inchesToInternal()
public float metresToInternal()
public float rootYMetres()
public float adjustViewYInternal()
public int getMeshCount()
public Skeleton getSkeleton()
public Bone getBone(int id)
public void setFrame(CASFrame frame)
public AmbientManager getAmbientManager()
null
if there is none.
public CASFrame getInitPose()
public void save(JAOutputStream jouts) throws java.io.IOException
NB
W.e.f. 2007-04 we have saved only in v2.2 format;
now, 2009-11, we do v3.0 as well -- the choice being dictated by
what we loaded;
and now, 2010-04, we also do v2.1 .
java.io.IOException
public void save(JAOutputStream jouts, java.lang.Boolean forceSep) throws java.io.IOException
java.io.IOException
public void saveTextureFile() throws java.io.IOException
java.io.IOException
public void drawNormalsColour(javax.media.opengl.GL2 gl)
public void draw(javax.media.opengl.GL2 gl)
public void generateFrame() throws JAException
JAException
public void generateFrame(float camX, float camY, float camZ) throws JAException
JAException
public void buildSkin() throws JAException
JAException
public static int vStringAs3Digits(java.lang.String ver)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |