WebGLGraphics Class
A set of functions used by the webGL renderer to draw the primitive graphics data
Item Index
Methods
- buildCircle static
- buildLine static
- buildPoly static
- buildRectangle static
- buildRoundedRectangle static
- quadraticBezierCurve static
- renderGraphics static
- updateGraphics static
Methods
buildCircle
-
graphicsData
-
webGLData
Builds a circle to draw
Parameters:
-
graphicsData
GraphicsThe graphics object to draw
-
webGLData
Object
buildLine
-
graphicsData
-
webGLData
Builds a line to draw
Parameters:
-
graphicsData
GraphicsThe graphics object containing all the necessary properties
-
webGLData
Object
buildPoly
-
graphicsData
-
webGLData
Builds a complex polygon to draw
Parameters:
-
graphicsData
GraphicsThe graphics object containing all the necessary properties
-
webGLData
Object
buildRectangle
-
graphicsData
-
webGLData
Builds a rectangle to draw
Parameters:
-
graphicsData
GraphicsThe graphics object containing all the necessary properties
-
webGLData
Object
buildRoundedRectangle
-
graphicsData
-
webGLData
Builds a rounded rectangle to draw
Parameters:
-
graphicsData
GraphicsThe graphics object containing all the necessary properties
-
webGLData
Object
quadraticBezierCurve
-
fromX
-
fromY
-
cpX
-
cpY
-
toX
-
toY
Calcul the points for a quadratic bezier curve. (helper function..) Based on : https://stackoverflow.com/questions/785097/how-do-i-implement-a-bezier-curve-in-c
Parameters:
-
fromX
NumberOrigin point x
-
fromY
NumberOrigin point x
-
cpX
NumberControl point x
-
cpY
NumberControl point y
-
toX
NumberDestination point x
-
toY
NumberDestination point y
Returns:
renderGraphics
-
graphics
-
renderSession
Renders the graphics object
Parameters:
-
graphics
Graphics -
renderSession
Object
updateGraphics
-
graphicsData
-
gl
Updates the graphics object
Parameters:
-
graphicsData
GraphicsThe graphics object to update
-
gl
WebGLContextthe current WebGL drawing context