Menge
Modular Pedestrian Simulation Framework for Research and Development
|
A ground plane approximation – z = 0, in world space. More...
#include <GLGroundPlane.h>
Public Member Functions | |
GLGroundPlane (float width, float height, float majorDist, int minorCount) | |
Constructor. More... | |
~GLGroundPlane (void) | |
Destructor. | |
void | newContext () |
Updates the OpenGL constructs for the grid when the context changes. | |
float | getWidth () const |
Report the width of the ground plane (extent along world x-axis). More... | |
void | setWidth (float w) |
Sets the width (the extent along the world's x-axis) of the plane. More... | |
float | getHeight () const |
Report the height of the ground plane (extent along world y-axis). More... | |
void | setHeight (float h) |
Sets the height (the extent along the world's y-axis) of the plane. More... | |
float | getMajorDistance () const |
Report the distance between major lines. More... | |
void | setMajorDistance (float dist) |
Sets the distance between major lines. More... | |
int | getMinorCount () const |
Report the number of minor lines between major lines. More... | |
void | setMinorCount (int count) |
Sets the number of minor lines between major lines. More... | |
void | setLineColor (float r, float g, float b) |
Set the main color for the ground's lines. More... | |
void | drawGL (bool select=false) |
Causes the plane to be drawn into the current OpenGL context. More... | |
Public Member Functions inherited from Menge::SceneGraph::GLNode | |
GLNode (GLDagNode *parent=0x0) | |
Constructor. More... | |
virtual | ~GLNode () |
Virtual destructor. | |
void | setVisible (bool state) |
Sets the visible state of the node. More... | |
GLDagNode * | getParent () |
Returns a pointer to the node's parent (possibly NULL). More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Menge::SceneGraph::GLNode | |
void | setParent (GLDagNode *p) |
Assigns this node to a parent GLDagNode. More... | |
Protected Attributes inherited from Menge::SceneGraph::GLNode | |
GLDagNode * | _parent |
The GLDagNode that serves as this node's parent. | |
bool | _visible |
The visibility state of this node. If visible (true) the node and its children will be drawn into the scene, if invisible (false) it will not be drawn. | |
A ground plane approximation – z = 0, in world space.
The ground plane is a rectangular piece, centered on the origin, with user-specified finite extent. It is rendered as a grid of lines with a heavy center line, medium major lines, and light minor lines.
Menge::SceneGraph::GLGroundPlane::GLGroundPlane | ( | float | width, |
float | height, | ||
float | majorDist, | ||
int | minorCount | ||
) |
Constructor.
width | The extent of the plane along the world's x-axis. |
height | The extent of the plane along the world's y-axis. |
majorDist | The distance between major axis lines. |
minorCount | The number of minor lines between major axis lines. |
|
virtual |
Causes the plane to be drawn into the current OpenGL context.
select | Indicates if it is being drawn for selection purposes (true) or visualization (false). |
Implements Menge::SceneGraph::GLNode.
|
inline |
Report the height of the ground plane (extent along world y-axis).
|
inline |
Report the distance between major lines.
|
inline |
Report the number of minor lines between major lines.
|
inline |
Report the width of the ground plane (extent along world x-axis).
void Menge::SceneGraph::GLGroundPlane::setHeight | ( | float | h | ) |
Sets the height (the extent along the world's y-axis) of the plane.
h | The height, in world space units, of the plane. |
void Menge::SceneGraph::GLGroundPlane::setLineColor | ( | float | r, |
float | g, | ||
float | b | ||
) |
Set the main color for the ground's lines.
r | The red component of the color (in the range [0, 1] ). |
g | The green component of the color (in the range [0, 1] ). |
b | The blue component of the color (in the range [0, 1] ). |
void Menge::SceneGraph::GLGroundPlane::setMajorDistance | ( | float | dist | ) |
Sets the distance between major lines.
dist | The distance between major lines on the plane. |
void Menge::SceneGraph::GLGroundPlane::setMinorCount | ( | int | count | ) |
Sets the number of minor lines between major lines.
count | The number of minor lines between major lines. |
void Menge::SceneGraph::GLGroundPlane::setWidth | ( | float | w | ) |
Sets the width (the extent along the world's x-axis) of the plane.
w | The width, in world space units, of the plane. |