Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.eside.flingbox.graphics
Class RenderPolygon

    java.lang.Object
      edu.eside.flingbox.graphics.RenderBody
          edu.eside.flingbox.graphics.RenderPolygon

    public class RenderPolygon

extends RenderBody

`RenderPolygon` handles functions to render `Polygon` into OpenGL's space. Translation and rotation values should be set in `AtomicBody` and calculated by physic engine. This should only be instantiate by `Polygon`.

Constructor Summary
`RenderPolygon(Vector2D[] points)` Default constructor of PolygonRender.

Method Summary
`boolean` | `onRender(GL10 gl)` Renderizes Polygon into gl
`void` | `setColor(float r, float g, float b, float alpha)` Sets color of the polygon
`void` | `setPosition(Vector2D position, float rotation)` Sets object's position to render

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RenderPolygon

    public RenderPolygon(Vector2D[] points)

  Default constructor of PolygonRender. initializes values needed by OpenGL.

  Parameters:
    `points` - Polygon's points, with centroid at 0,0

Method Detail

### setColor

    public void setColor(float r,
                         float g,
                         float b,
                         float alpha)

  Sets color of the polygon

  Parameters:
    `r` - Red channel [0, 1]
    `g` - Green channel [0, 1]
    `b` - Blue channel [0, 1]
    `alpha` - Alpha channel, sets object's transparency, 0 for transparent 1 for opaque.

### setPosition

    public void setPosition(Vector2D position,
                            float rotation)

  Sets object's position to render

  Parameters:
    `position` - Point to current position
    `rotation` - Rotation angle in radiants

### onRender

    public boolean onRender(GL10 gl)

  Renderizes Polygon into gl

  Specified by:
    `onRender` in class `RenderBody`
  Parameters:
    `gl` - OpenGL's space
  Returns:
    true if render consumed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD