![]() |
C++ SDK Reference
12.5
|
#include <diguyViewPainter.h>
Public Member Functions | |
State-Setting Functions | |
| virtual void | set_line_width (float width) |
| Sets the current width of lines drawn by the painter. More... | |
| virtual void | set_pen_color (float red, float green, float blue, float alpha=1.0f) |
| Sets the color of the default pen. More... | |
| virtual void | set_pen2_color (float red, float green, float blue, float alpha=1.0f) |
| Sets the color of the secondary pen. More... | |
| virtual void | set_brush_color (float red, float green, float blue, float alpha=1.0f) |
| Sets the color of the brush. More... | |
View Functions | |
| virtual void | get_viewport_size (float *width, float *height) |
| Fills out the width and height arguments with the dimensions of the primary 3D view. More... | |
| virtual void | world_to_screen (float world_x, float world_y, float world_z, float *view_x, float *view_y, float *view_z) |
| This function converts a world (x, y, z) coordinate into a view (x, y, z) coordinate. More... | |
3D Draw Functions | |
In all 3D draw functions, if there are edges to be drawn they are drawn with the current pen color as set by set_pen_color(). If there is an area to be filled it will be filled with the current brush color, as set by set_brush_color(). | |
| virtual void | draw_line (float x1, float y1, float z1, float x2, float y2, float z2) |
| Draws a line from (x1, y1, z1) to (x2, y2, z2) using the pen color. More... | |
| virtual void | draw_line_2c (float x1, float y1, float z1, float x2, float y2, float z2) |
| Draws a line from (x1, y1, z1) to (x2, y2, z2) using both of the pen colors. More... | |
| virtual void | draw_sphere (float x, float y, float z, float radius, int draw_edges=1, int draw_fill=1) |
| Draws a sphere with its center at (x, y, z), with radius radius. More... | |
| virtual void | draw_box (float x1, float y1, float z1, float x2, float y2, float z2, int draw_edges=1, int draw_fill=1) |
| Draws an axis aligned bounding box with one corner at (x1, y1, z1), the other at (x2, y2, z2). More... | |
| virtual void | draw_rotated_box (float x1, float y1, float z1, float x2, float y2, float z2, float yaw, float roll, float pitch, float xc, float yc, float zc, int edges=1, int fill=1) |
| Draws a rotated bounding box with one corner at unrotated (x1, y1, z1), and another at unrotated (x2, y2, z2), applying the rotation Euler angles (given in BDI_EULER_ANGLE_ORDER_ZXY order in degrees). More... | |
| virtual void | draw_arrow (float x1, float y1, float z1, float x2, float y2, float z2, float shaft_width=0.02, float arrow_width=0.05, int draw_edges=1, int draw_fill=1) |
| Draws an arrow from (x1, y1, z1) to (x2, y2, z2). More... | |
| virtual void | draw_disc (float x, float y, float z, float radius, int draw_edges=1, int draw_fill=1, int num_sides=12) |
| Draws a disc with its center at (x, y, z), and the given radius. More... | |
| virtual void | draw_circle (float x, float y, float z, float normal_x, float normal_y, float normal_z, float radius, int draw_edges=1, int draw_fill=1, int num_sides=12) |
| Draws a circle at (x, y, z), with normal (normal_x, normal_y, normal_z), and the given radius. More... | |
| virtual void | draw_torus (float x, float y, float z, float inner_radius, float outer_radius, int draw_edges=1, int draw_fill=1, int num_sides=12) |
| Draws a torus at (x, y, z), with normal (normal_x, normal_y, normal_z), and the given radius. More... | |
| virtual void | draw_cylinder (float x, float y, float z, float radius, float height, int draw_edges=1, int draw_fill=1) |
| Draws a Z-axis-up cylinder, with its bottom cap centered at (x1, y1, z). More... | |
| virtual void | draw_wedge (float x, float y, float z, float target_x, float target_y, float target_z, float inner_radius, float width, int draw_edges=1, int draw_fill=1) |
| Draws wedge. More... | |
| virtual void | draw_wedge_with_normal (float x, float y, float z, float target_x, float target_y, float target_z, float nx, float ny, float nz, float inner_radius, float width, int draw_edges=1, int draw_fill=1) |
2D Draw Functions | |
Before 2D drawing functions are called the view must be put into a 2D drawing state by calling begin_2d_text_mode(). | |
| virtual void | begin_2d_text_mode () |
| Puts the OpenGL view matrix into a 2D orthogonal state so that 2D primitives will be drawn in 2D view coordinates rather than in 3D world coordinates. More... | |
| virtual void | end_2d_text_mode () |
| Returns the OpenGL view matrix back into a 3D perspective state. More... | |
| virtual void | draw_text (float screen_x, float screen_y, const char *text) |
| Draws the passed text string at view coordinates (x, y). More... | |
| virtual void | draw_2d_rect (float x0, float y0, float x1, float y1, int draw_edges=1, int draw_fill=1) |
| Draws a 2D rectangle with the given points as the corners. More... | |
| virtual void | draw_private_path_shape (diguyCharacter *diguy_character, int include_waypoints=0) |
Private Functions | |
The functions and variables past this point are for internal use only. No external access to them is expected or necessary. | |
| class | bdiScenarioApp |
| diguyViewPainter () | |
| A protected constructor. More... | |
|
protected |
A protected constructor.
Use the DI-Guy function diguyApp:get_view_painter() to obtain a diguyViewPainter object pointer.
|
virtual |
Sets the current width of lines drawn by the painter.
Callable From:
|
virtual |
Sets the color of the default pen.
Pens typically draw lines and borders around shapes. Color values should be between 0.0 and 1.0.
Callable From:
|
virtual |
Sets the color of the secondary pen.
Color values should be between 0.0 and 1.0.
Callable From:
|
virtual |
Sets the color of the brush.
Brushes are typically used for filling shapes. Color values should be between 0.0 and 1.0.
Callable From:
|
virtual |
Fills out the width and height arguments with the dimensions of the primary 3D view.
Callable From:
|
virtual |
This function converts a world (x, y, z) coordinate into a view (x, y, z) coordinate.
**
If the returned view z value is greater then 1, the returned coordinate is behind the camera.
|
virtual |
Draws a line from (x1, y1, z1) to (x2, y2, z2) using the pen color.
Callable From:
|
virtual |
Draws a line from (x1, y1, z1) to (x2, y2, z2) using both of the pen colors.
The color of the line is interpolated from point 1 to point 2.
Callable From:
|
virtual |
Draws a sphere with its center at (x, y, z), with radius radius.
Callable From:
|
virtual |
Draws an axis aligned bounding box with one corner at (x1, y1, z1), the other at (x2, y2, z2).
Callable From:
|
virtual |
Draws a rotated bounding box with one corner at unrotated (x1, y1, z1), and another at unrotated (x2, y2, z2), applying the rotation Euler angles (given in BDI_EULER_ANGLE_ORDER_ZXY order in degrees).
The box is drawn at center point (xc, yc, zc) in global space, and then rotated.
Callable From:
|
virtual |
Draws an arrow from (x1, y1, z1) to (x2, y2, z2).
Callable From:
|
virtual |
Draws a disc with its center at (x, y, z), and the given radius.
Callable From:
|
virtual |
Draws a circle at (x, y, z), with normal (normal_x, normal_y, normal_z), and the given radius.
Callable From:
|
virtual |
Draws a torus at (x, y, z), with normal (normal_x, normal_y, normal_z), and the given radius.
Callable From:
|
virtual |
Draws a Z-axis-up cylinder, with its bottom cap centered at (x1, y1, z).
The cylinder will have the given radius and height.
Callable From:
|
virtual |
Draws wedge.
Callable From:
|
virtual |
|
virtual |
Puts the OpenGL view matrix into a 2D orthogonal state so that 2D primitives will be drawn in 2D view coordinates rather than in 3D world coordinates.
This call must be balanced by a call to end_2d_text_mode(), or overall drawing will be broken.
Callable From:
|
virtual |
Returns the OpenGL view matrix back into a 3D perspective state.
This call must be balanced by a call to begin_2d_text_mode(), or overall drawing will be broken.
Callable From:
|
virtual |
Draws the passed text string at view coordinates (x, y).
Should only be called inside of a begin_2d_text_mode() and end_2d_text_mode() block.
The text is drawn with the current pen color.
Callable From:
|
virtual |
Draws a 2D rectangle with the given points as the corners.
Should only be called inside of a begin_2d_text_mode() and end_2d_text_mode() block.
The edges are drawn with the current pen color, the fill is drawn with the current brush color.
Callable From:
|
virtual |
|
friend |