|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--md3.md3model.MD3ModelVisitor | +--md3.md3view.MD3GLModelVisitor | +--md3.md3view.MD3GLModelDrawModelVisitor
An MD3GLModel visitor that walks through an MD3GLModel structure and draws all meshes of the current frame of the encountered models on a specified OpenGL canvas. Interpolation is done if necessary, as specified by the interpolationFraction data member of the MD3GLModel class.
MD3GLModel
Constructor Summary | |
MD3GLModelDrawModelVisitor(MD3GLCanvas md3canvas)
Create a new visitor that will draw on the specified OpenGL canvas. |
Method Summary | |
protected void |
drawBoneFrame(MD3BoneFrame bf)
Draw a given bone frame (bounding box) on the canvas. |
protected void |
drawMesh(MD3Mesh mesh,
Vec3[] frame)
Draw a given animation frame of a specified mesh on the canvas. |
protected void |
drawVertexNormals(Vec3[] frame,
int[][] normals)
Draw the given vertex normals of the given vertices on the canvas. |
protected MD3BoneFrame |
interpolateBoneFrame(MD3BoneFrame currBoneFrame,
MD3BoneFrame nextBoneFrame,
float frac)
Interpolate a bone frame between 2 given bone frames. |
protected Vec3[] |
interpolateMeshFrame(Vec3[] currMeshFrame,
Vec3[] nextMeshFrame,
float frac)
Interpolate a mesh animation frame between 2 given mesh animation frames. |
protected float[] |
interpolateTransformation(MD3Tag currFrameTag,
MD3Tag nextFrameTag,
float frac)
Interpolate an OpenGL transformation array between the transformations of 2 given tags. |
protected int[][] |
interpolateVertexNormals(int[][] currNormals,
int[][] nextNormals,
float frac)
Interpolate a set of vertex normals between the 2 given sets. |
void |
visit(MD3GLModel model)
Renders a model on the canvas. |
Methods inherited from class md3.md3view.MD3GLModelVisitor |
visit |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public MD3GLModelDrawModelVisitor(MD3GLCanvas md3canvas)
Create a new visitor that will draw on the specified OpenGL canvas.
md3canvas
- The OpenGL canvas to draw on.Method Detail |
public void visit(MD3GLModel model)
Renders a model on the canvas.
model
- The model to render.protected MD3BoneFrame interpolateBoneFrame(MD3BoneFrame currBoneFrame, MD3BoneFrame nextBoneFrame, float frac)
Interpolate a bone frame between 2 given bone frames.
currBoneFrame
- Start bone frame.nextBoneFrame
- End bone frame.frac
- Interpolation fraction, in [0,1].protected Vec3[] interpolateMeshFrame(Vec3[] currMeshFrame, Vec3[] nextMeshFrame, float frac)
Interpolate a mesh animation frame between 2 given mesh animation frames.
currMeshFrame
- Start mesh animation frame.nextMeshFrame
- End mesh animation frame.frac
- Interpolation fraction, in [0,1].protected int[][] interpolateVertexNormals(int[][] currNormals, int[][] nextNormals, float frac)
Interpolate a set of vertex normals between the 2 given sets.
currNormals
- Start normal set.nextNormals
- End normal set.frac
- Interpolation fraction, in [0,1].protected float[] interpolateTransformation(MD3Tag currFrameTag, MD3Tag nextFrameTag, float frac)
Interpolate an OpenGL transformation array between the transformations of 2 given tags.
currFrameTag
- Tag with start transformation.nextFrameTag
- Tag with end transformation.frac
- Interpolation fraction, in [0,1].protected void drawBoneFrame(MD3BoneFrame bf)
Draw a given bone frame (bounding box) on the canvas.
bf
- The bone frame to draw.protected void drawMesh(MD3Mesh mesh, Vec3[] frame)
Draw a given animation frame of a specified mesh on the canvas.
mesh
- The MD3Mesh that is being rendered.vecs
- The animation frame data to be rendered.protected void drawVertexNormals(Vec3[] frame, int[][] normals)
Draw the given vertex normals of the given vertices on the canvas.
frame
- The animation frame vertex data for wich the normals are drawn.normals
- The vertex normal data.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |