jjdh API

jjdh.opengl.meshes.core
Class AbstractMesh

java.lang.Object
  extended by jjdh.opengl.meshes.core.AbstractMesh
All Implemented Interfaces:
Renderable, Mesh
Direct Known Subclasses:
BlendingContainer, Container, DirectMesh, DisplayListMesh, VertexArrayMesh

public abstract class AbstractMesh
extends Object
implements Mesh


Field Summary
protected  Material material
           
protected  float[] position
           
protected  float[] rotation
           
protected  float[] scale
           
 
Constructor Summary
AbstractMesh()
           
 
Method Summary
protected  void applyMaterial(javax.media.opengl.GL gl)
           
protected  void applyPosition(javax.media.opengl.GL gl)
           
protected  void applyRotation(javax.media.opengl.GL gl)
           
protected  void applyScaling(javax.media.opengl.GL gl)
           
 Material getMaterial()
           
 float[] getPosition()
           
 void move(float x, float y, float z)
           
protected abstract  void privateRender(javax.media.opengl.GL gl)
          This method has to be overwritten by subcasses.
 void render(javax.media.opengl.GL gl)
           
 void rotate(float degree, float x, float y, float z)
          This rotates the mesh (relative)
 void setMaterial(Material m)
           
 void setPosition(float x, float y, float z)
           
 void setRotation(float degree, float x, float y, float z)
           
 void setScale(float x, float y, float z)
           
 String toString()
           
protected  void unApplyMaterial(javax.media.opengl.GL gl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jjdh.opengl.meshes.core.Mesh
dispose
 

Field Detail

position

protected float[] position

rotation

protected float[] rotation

scale

protected float[] scale

material

protected Material material
Constructor Detail

AbstractMesh

public AbstractMesh()
Method Detail

render

public final void render(javax.media.opengl.GL gl)
Specified by:
render in interface Renderable
Specified by:
render in interface Mesh

privateRender

protected abstract void privateRender(javax.media.opengl.GL gl)
This method has to be overwritten by subcasses.

Parameters:
gl - a OpenGL obejct

rotate

public final void rotate(float degree,
                         float x,
                         float y,
                         float z)
Description copied from interface: Mesh
This rotates the mesh (relative)

Specified by:
rotate in interface Mesh

move

public final void move(float x,
                       float y,
                       float z)
Specified by:
move in interface Mesh

setPosition

public final void setPosition(float x,
                              float y,
                              float z)
Specified by:
setPosition in interface Mesh

setRotation

public final void setRotation(float degree,
                              float x,
                              float y,
                              float z)
Specified by:
setRotation in interface Mesh

setScale

public void setScale(float x,
                     float y,
                     float z)
Specified by:
setScale in interface Mesh

setMaterial

public void setMaterial(Material m)
Specified by:
setMaterial in interface Mesh

getMaterial

public Material getMaterial()
Specified by:
getMaterial in interface Mesh

applyRotation

protected final void applyRotation(javax.media.opengl.GL gl)

applyPosition

protected final void applyPosition(javax.media.opengl.GL gl)

applyScaling

protected final void applyScaling(javax.media.opengl.GL gl)

getPosition

public float[] getPosition()
Specified by:
getPosition in interface Mesh

applyMaterial

protected final void applyMaterial(javax.media.opengl.GL gl)

unApplyMaterial

protected final void unApplyMaterial(javax.media.opengl.GL gl)

toString

public String toString()
Overrides:
toString in class Object

jjdh API

Copyright © 2006 Jonas Jacobi and Dennis Heidsiek. All Rights Reserved.