MathDraw.h File Reference

Defines functions for drawing common math objects. More...

#include <vector>
#include "Graphics/Color.h"
#include "Math/MathCommon.h"

Functions

void DrawLine (const Line &l, const Color4f &color=Color::Gray, float width=2.0f)
 Draws a Line.
void DrawLineStrip (const std::vector< Point2f > &points, const Color4f &color=Color::Gray, float width=2.0f)
 Draws a sequence of connected Lines.
void DrawLineStrip (const Point2f *points, uint n, const Color4f &color=Color::Gray, float width=2.0f)
 Draws a sequence of connected Lines.
void DrawPoint (const Point2f &p, const Color4f &color=Color::Red, float size=5.0f)
 Draws a Point.
void DrawVector (const Vector2f &v, const Point2f &origin=Point2f(0.0f, 0.0f), const Color4f &color=Color::CornFlowerBlue, float width=2.0f)
 Draws a Vector.
void DrawCircle (const Circle &c, const Color4f &color=Color::Yellow, float width=2.0f)
 Draws a Circle.
void DrawRay (const Ray &r, float len=10.0f, const Color4f &color=Color::Blue, float width=2.0f)
 Draws a Ray.
void DrawAABB (const AABB &aabb, const Color4f &color=Color::Green, float width=2.0f)
 Draws an AABB.
void DrawAABB (const AABB &aabb, const Matrixf &m, const Color4f &color=Color::Green, float width=2.0f)
 Draws an AABB.
void DrawRect (const Rectf &r, bool fill=true, const Color4f &color=Color::Green, float width=2.0f)
 Draws a Rect.
void DrawQuad (const Point2f &center, float w, float h, bool fill=true, const Color4f &color=Color::Green, float width=2.0f)
 Draws a Quad.
void DrawQuad (const Point2f &center, float w, float h, const Matrixf &m, bool fill=true, const Color4f &color=Color::Green, float width=2.0f)
 Draws a Quad.
void DrawTriangle (const Point2f &a, const Point2f &b, const Point2f &c, const Color4f &color)
 Draws a solid Triangle.
void DrawPoly (const std::vector< Point2f > &verts, const Point2f &p=Point2f(0.0f, 0.0f), const Color4f c=Color::Green, float width=2.0f)
 Draws a Polygon.
void DrawPoly (const Point2f *verts, int n, const Matrixf &m, const Color4f c=Color::Green, float width=2.0f)
 Draws a Polygon.
void DrawPoly (const Point2f *verts, int n, const Point2f &p=Point2f(0.0f, 0.0f), const Color4f c=Color::Green, float width=2.0f)
 Draws a Polygon.
void DrawFullscreenQuad (const Color4f &color)
 Draws a Quad that fills the whole screen.

Detailed Description

Defines functions for drawing common math objects.

Author:
Joe Forte
Date:
3/8/2008

Function Documentation

void DrawAABB ( const AABB aabb,
const Matrixf m,
const Color4f color = Color::Green,
float  width = 2.0f 
)

Draws an AABB.

Parameters:
[in] aabb the AABB to draw.
[in] m the transformation to apply to the AABB.
[in] color the color to draw the AABB. Defaults to Green.
[in] width the width of the AABB should be drawn. Defaults to 2.
void DrawAABB ( const AABB aabb,
const Color4f color = Color::Green,
float  width = 2.0f 
)

Draws an AABB.

Parameters:
[in] aabb the AABB to draw.
[in] color the color to draw the AABB. Defaults to Green.
[in] width the width of the AABB should be drawn. Defaults to 2.
void DrawCircle ( const Circle &  c,
const Color4f color = Color::Yellow,
float  width = 2.0f 
)

Draws a Circle.

Parameters:
[in] c the Circle to draw.
[in] color the color to draw the Circle. Defaults to Yellow.
[in] width the width of the Circle should be drawn. Defaults to 2.
void DrawFullscreenQuad ( const Color4f color  ) 

Draws a Quad that fills the whole screen.

Parameters:
[in] color the color to draw the fullscreen Quad.
void DrawLine ( const Line l,
const Color4f color = Color::Gray,
float  width = 2.0f 
)

Draws a Line.

Parameters:
[in] l the Line to draw.
[in] color the color to draw the line. Defaults to Gray.
[in] width the width of the line should be drawn. Defaults to 2.
void DrawLineStrip ( const Point2f points,
uint  n,
const Color4f color = Color::Gray,
float  width = 2.0f 
)

Draws a sequence of connected Lines.

Parameters:
[in] points the points that define the sequence of lines.
[in] n the number of points.
[in] color the color to draw the line. Defaults to Gray.
[in] width the width of the line should be drawn. Defaults to 2.
void DrawLineStrip ( const std::vector< Point2f > &  points,
const Color4f color = Color::Gray,
float  width = 2.0f 
)

Draws a sequence of connected Lines.

Parameters:
[in] points the points that define the sequence of lines.
[in] color the color to draw the line. Defaults to Gray.
[in] width the width of the line should be drawn. Defaults to 2.
void DrawPoint ( const Point2f p,
const Color4f color = Color::Red,
float  size = 5.0f 
)

Draws a Point.

Parameters:
[in] p the Point to draw.
[in] color the color to draw the Point. Defaults to Red.
[in] size the size of the Point should be drawn. Defaults to 5.
void DrawPoly ( const Point2f verts,
int  n,
const Point2f p = Point2f(0.0f, 0.0f),
const Color4f  c = Color::Green,
float  width = 2.0f 
)

Draws a Polygon.

Parameters:
[in] verts the vertices for the polygon where the first and the last vertices are connected.
[in] n the number of vertices.
[in] p the position to draw the polygon. Defaults to the origin.
[in] c the color to draw the polygon.
[in] width the width of the lines used to draw the polygon.
void DrawPoly ( const Point2f verts,
int  n,
const Matrixf m,
const Color4f  c = Color::Green,
float  width = 2.0f 
)

Draws a Polygon.

Parameters:
[in] verts the vertices for the polygon where the first and the last vertices are connected.
[in] n the number of vertices.
[in] m the transformation Matrix to apply to the poly.
[in] c the color to draw the polygon.
[in] width the width of the lines used to draw the polygon.
void DrawPoly ( const std::vector< Point2f > &  verts,
const Point2f p = Point2f(0.0f, 0.0f),
const Color4f  c = Color::Green,
float  width = 2.0f 
)

Draws a Polygon.

Parameters:
[in] verts the vertices for the polygon where the first and the last vertices are connected.
[in] p the position to draw the polygon. Defaults to the origin.
[in] c the color to draw the polygon.
[in] width the width of the lines used to draw the polygon.
void DrawQuad ( const Point2f center,
float  w,
float  h,
const Matrixf m,
bool  fill = true,
const Color4f color = Color::Green,
float  width = 2.0f 
)

Draws a Quad.

Parameters:
[in] center the center position of the Quad to draw.
[in] w the width of the Quad to Draw.
[in] h the height of the Quad to Draw.
[in] m the transformation to apply to the quad.
[in] fill set to true to fill the Quad with the given color. Set to false to only draw the outline of the Quad.
[in] color the color to draw the Quad. Defaults to Green.
[in] width the width of the Rect should be drawn. Defaults to 2. Ignored if fill equals true.
void DrawQuad ( const Point2f center,
float  w,
float  h,
bool  fill = true,
const Color4f color = Color::Green,
float  width = 2.0f 
)

Draws a Quad.

Parameters:
[in] center the center position of the Quad to draw.
[in] w the width of the Quad to Draw.
[in] h the height of the Quad to Draw.
[in] fill set to true to fill the Quad with the given color. Set to false to only draw the outline of the Quad.
[in] color the color to draw the Quad. Defaults to Green.
[in] width the width of the Rect should be drawn. Defaults to 2. Ignored if fill equals true.
void DrawRay ( const Ray r,
float  len = 10.0f,
const Color4f color = Color::Blue,
float  width = 2.0f 
)

Draws a Ray.

Parameters:
[in] r the Ray to draw.
[in] len the length of the ray. Defaults to 10.
[in] color the color to draw the Ray. Defaults to Blue.
[in] width the width of the Ray should be drawn. Defaults to 2.
void DrawRect ( const Rectf r,
bool  fill = true,
const Color4f color = Color::Green,
float  width = 2.0f 
)

Draws a Rect.

Parameters:
[in] r the Rect to draw.
[in] fill set to true to fill the Rect with the given color. Set to false to only draw the outline of the Rect.
[in] color the color to draw the Rect. Defaults to Green.
[in] width the width of the Rect should be drawn. Defaults to 2. Ignored if fill equals true.
void DrawTriangle ( const Point2f a,
const Point2f b,
const Point2f c,
const Color4f color 
)

Draws a solid Triangle.

Parameters:
[in] a the first point.
[in] b the second point.
[in] c the third point.
[in] color the color to draw the Triangle.
void DrawVector ( const Vector2f v,
const Point2f origin = Point2f(0.0f, 0.0f),
const Color4f color = Color::CornFlowerBlue,
float  width = 2.0f 
)

Draws a Vector.

Parameters:
[in] v the Vector to draw.
[in] origin the origin of the coordinate system the vector is in. Defaults to (0,0).
[in] color the color to draw the vector. Defaults to CornFlowerBlue.
[in] width the width of the Vector should be drawn. Defaults to 2.
Generated on Mon Apr 5 19:08:05 2010 for BrickOut |ReDuX| by  doxygen 1.6.3