|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.eside.flingbox.graphics.RenderBody
edu.eside.flingbox.graphics.RenderPolygon
public class RenderPolygon
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 |
---|
public RenderPolygon(Vector2D[] points)
points
- Polygon's points, with centroid at 0,0Method Detail |
---|
public void setColor(float r, float g, float b, float alpha)
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.public void setPosition(Vector2D position, float rotation)
position
- Point to current positionrotation
- Rotation angle in radiantspublic boolean onRender(GL10 gl)
onRender
in class RenderBody
gl
- OpenGL's space
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |