|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.motorola.iden.micro3d.Object3D | +--com.motorola.iden.micro3d.Figure
Figure
contains and manages model data. The Micro3D engine
supports .mbac data files that are used to store polygon-based model data.
Method Summary | |
static Figure |
createFigure(byte[] data,
int offset,
int length)
Creates a Figure which is decoded from the data stored in
the specified byte array at the specified offset and length. |
static Figure |
createFigure(java.lang.String name)
Creates a Figure from the data obtained from the named
resource. |
int |
getActionIndex()
Returns the index of the action this Figure is using
for animation. |
ActionTable |
getActionTable()
Returns the ActionTable this Figure is using or
null if no ActionTable has been set associated
with this Figure .
|
int |
getFrameIndex()
Returns the frame index value this Figure is using for animation.
|
int |
getNumberOfPatterns()
Returns the number of external appearance states for a Figure .
|
int |
getPattern()
Returns the pattern index this Figure is set to.
|
void |
setActionTable(ActionTable actionTable)
Sets the ActionTable for this Figure to use.
|
void |
setPattern(int pattern)
Modifies the appearance of the figure by setting the pattern used during rendering. |
void |
setPosture(int actionIndex,
int frameIndex)
Sets the posture for the Figure .
|
Methods inherited from class com.motorola.iden.micro3d.Object3D |
getLayout, getSphereTexture, getTexture, setLayout, setSphereTexture, setTexture |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Figure createFigure(byte[] data, int offset, int length) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.lang.ArrayIndexOutOfBoundsException, java.io.IOException
Figure
which is decoded from the data stored in
the specified byte array at the specified offset and length. The data
must be in the format supported by the implementation (.mbac).
The offset
and length
parameters specify
a range of data within the data
byte array. The
offset
parameter specifies the offset into the array of the
first data byte to be used. It must therefore lie within the range
[0..(data.length-1)]. The length
parameter specifies the
number of data bytes to be used. It must be a positive integer and it must
not cause the range to extend beyond the end of the array. That is, it
must be true that offset + length <= data.length.
This method is intended for use when loading figure data from a variety
of sources, such as from persistent storage or from the network.
data
- the array of figure data in .mbac format.offset
- the offset of the start of the data in the array.length
- the length of the data in the array.java.lang.ArrayIndexOutOfBoundsException
- if offset and length specify an
invalid range.java.lang.IllegalArgumentException
- if the array does not contain valid
figure data.java.io.IOException
- if the data contained cannot be decoded.java.lang.NullPointerException
- if the data array is null
.public static Figure createFigure(java.lang.String name) throws java.io.IOException, java.lang.NullPointerException
Figure
from the data obtained from the named
resource. The specified parameter must name a valid resource file
containing the .mbac data.name
- the name of the resource containing the animation data in the
supported .mbac format.java.io.IOException
- if the resource does not exist, the data cannot be
loaded, or the figure data cannot be decoded.java.lang.NullPointerException
- if the resource name is null
.public ActionTable getActionTable()
ActionTable
this Figure
is using or
null
if no ActionTable
has been set associated
with this Figure
.
ActionTable
used for this Figure
or
null
if no ActionTable
is associated with this
Figure
.public void setActionTable(ActionTable actionTable)
ActionTable
for this Figure
to use.
If the ActionTable
is null
the Figure
will have its action and frame indices set to 0.
actionTable
- the ActionTable
to use with this
Figure
.public int getActionIndex()
Figure
is using
for animation. This method returns 0 if no ActionTable
is
associated with this Figure
.
ActionTable
; returns
0 is no ActionTable
is associated with this Figure
.public int getFrameIndex()
Figure
is using for animation.
If no ActionTable
is set it returns the default value of 0.
ActionTable
.public void setPosture(int actionIndex, int frameIndex) throws java.lang.IllegalArgumentException
Figure
.
The posture is obtained from the ActionTable
associated with
this Figure
and the specified frame and action indices.
The actionIndex value specified must be equal to or greater than 0 and less
than the number of actions returned by getNumberOfActions()
for the ActionTable
associated with this Figure
.
The frameIndex
value should be at least 0 and less than the
number of frames returned by getNumberOfFrames(int)
for the
ActionTable
associated with this Figure
and the
index value actionIndex
. If the frameIndex
value
is less than 0 it will be adjusted to 0. If the frameIndex
value is grater than the maximum number or frames it will be adjusted to
the maximum frame number.
actionIndex
- the index to the desired action within the
ActionTable
.frameIndex
- the index of the frame for the action specified.java.lang.IllegalArgumentException
- if an invalid action index is specified or
if there is no action table associated with the figure.public int getNumberOfPatterns()
Figure
.
Figure
.public int getPattern()
Figure
is set to.
Figure
is set to.public void setPattern(int pattern)
figure.setPattern(0)
is a face without eyes or a mouth.figure.setPattern(1<<0)
is a face with eyes closed.figure.setPattern(1<<1)
is a face with eyes open.figure.setPattern(1<<2)
is a face with a closed mouth.figure.setPattern(1<<3)
is a face with an open mouth.figure.setPattern((1<<0) | (1<<3))
is a face with closed eyes
and an open mouth.
Note: For figure.setPattern((1<<0) | (1<<1))
a face with both closed
and open eyes will be rendered.
pattern
- the pattern index to set the Figure
to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |