jjdh API

jjdh.opengl.engine.buffers
Class NormalGenerator

java.lang.Object
  extended by jjdh.opengl.engine.buffers.NormalGenerator

public class NormalGenerator
extends Object


Field Summary
protected  boolean isActive
          Indicates if this generator should be uesed or not
protected  HashMap<Integer,Vector3D> normals
           
protected  VertexBuffer vertices
           
 
Constructor Summary
NormalGenerator()
           
 
Method Summary
protected  Vector3D calculateNormal(int i0, int i1, int i2)
          Calculates the Normal of the given Triangle.
 NormalBuffer getResult()
           
protected  void init()
           
 boolean isActive()
           
 void putNormal(int i0, int i1, int i2)
          Adds the Normal of the given Triangle.
 void putNormal(int i0, int i1, int i2, int i3)
          Adds the Normal of the given Quad.
 void setActive(boolean enable)
           
 void setVertexBuffer(VertexBuffer vertexBuffer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isActive

protected boolean isActive
Indicates if this generator should be uesed or not


vertices

protected VertexBuffer vertices

normals

protected HashMap<Integer,Vector3D> normals
Constructor Detail

NormalGenerator

public NormalGenerator()
Method Detail

setActive

public void setActive(boolean enable)

isActive

public boolean isActive()

setVertexBuffer

public void setVertexBuffer(VertexBuffer vertexBuffer)

init

protected void init()

putNormal

public void putNormal(int i0,
                      int i1,
                      int i2)
Adds the Normal of the given Triangle.

Parameters:
i0 - the index of the first Vertex of the Triangle
i1 - the index of the second Vertex of the Triangle
i2 - the index of the third Vertex of the Triangle

putNormal

public void putNormal(int i0,
                      int i1,
                      int i2,
                      int i3)
Adds the Normal of the given Quad.

Parameters:
i0 - the index of the first Vertex of the Quad
i1 - the index of the second Vertex of the Quad
i2 - the index of the third Vertex of the Quad
i3 - the index of the forth Vertex of the Quad

calculateNormal

protected Vector3D calculateNormal(int i0,
                                   int i1,
                                   int i2)
Calculates the Normal of the given Triangle.

Parameters:
i0 - the index of the first Vertex of the Triangle
i1 - the index of the second Vertex of the Triangle
i2 - the index of the third Vertex of the Triangle

getResult

public NormalBuffer getResult()

jjdh API

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