org.jrabbit.base.graphics.skins.primitive
Class TriangleSkin

java.lang.Object
  extended by org.jrabbit.base.graphics.skins.primitive.PrimitiveSkin
      extended by org.jrabbit.base.graphics.skins.primitive.TriangleSkin
All Implemented Interfaces:
Renderable, Skin, Dimensioned, Vertexed

public class TriangleSkin
extends PrimitiveSkin

A TriangleSkin renders an contains vertex data for a simple triangle width a width and height of 1. Unfortunately, the default triangle is static and cannot describe every possible triangle (though it can be scaled and rotated to represent any triangle with two sides of equal length). If a fully dynamic triangle needs to be described, a custom skin must be developed.

Author:
Chris Molini

Field Summary
private static float[][] TRIANGLE_VERTICES
          Pre-calculated vertex data describing a triangle with a width and height of 1.
 
Constructor Summary
TriangleSkin()
           
 
Method Summary
 void render()
          TRIANGLE_VERTICES delegates rendering to PrimitivePainter's renderTriangle() method.
 float[][] vertices()
          Accesses geometric data representing a triangle.
 
Methods inherited from class org.jrabbit.base.graphics.skins.primitive.PrimitiveSkin
height, width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIANGLE_VERTICES

private static final float[][] TRIANGLE_VERTICES
Pre-calculated vertex data describing a triangle with a width and height of 1.

Constructor Detail

TriangleSkin

public TriangleSkin()
Method Detail

render

public void render()
TRIANGLE_VERTICES delegates rendering to PrimitivePainter's renderTriangle() method.


vertices

public float[][] vertices()
Accesses geometric data representing a triangle. The described triangle has a width and height of 1.

Returns:
Vertex data approximating a square.