- Main Page
- Modules
- Classes
- Files
- Related Pages

- File List
- File Members

# src/drawstuff/drawstuff.h File Reference

`#include "version.h"`

Go to the source code of this file.

## Classes
struct | dsFunctions
| Set of functions to be used as callbacks by the simulation loop. More...
## Defines
#define | DS_API
#define | DS_NONE 0
#define | DS_WOOD 1
#define | dsDrawCappedCylinder dsDrawCapsule
#define | dsDrawCappedCylinderD dsDrawCapsuleD
#define | dsSetCappedCylinderQuality dsSetCapsuleQuality
## Functions
DS_API void | dsSimulationLoop (int argc, char **argv, int window_width, int window_height, struct dsFunctions *fn)
| Does the complete simulation. This function starts running the simulation, and only exits when the simulation is done. Function pointers should be provided for the callbacks.
DS_API void | dsError (char *msg,...)
| exit with error message. This function displays an error message then exit.
DS_API void | dsDebug (char *msg,...)
| exit with error message and core dump. this functions tries to dump core or start the debugger.
DS_API void | dsPrint (char *msg,...)
| print log message
DS_API void | dsSetViewpoint (float xyz[3], float hpr[3])
| Sets the viewpoint.
DS_API void | dsGetViewpoint (float xyz[3], float hpr[3])
| Gets the viewpoint.
DS_API void | dsStop ()
| Stop the simulation loop. Calling this from within dsSimulationLoop() will cause it to exit and return to the caller. it is the same as if the user used the exit command. using this outside the loop will have no effect.
DS_API double | dsElapsedTime ()
| Get the elapsed time (on wall-clock) It returns the nr of seconds since the last call to this function.
DS_API double | dsGetTime ()
| Get the current system time.
DS_API void | dsSleep (int miliseconds)
| Sleep for given time (in miliseconds) It puts process to sleep for given time in miliseconds.
DS_API void | dsSetTexture (int texture_number)
| Toggle the rendering of textures. It changes the way objects are drawn. these changes will apply to all further dsDrawXXX() functions.
DS_API void | dsSetColor (float red, float green, float blue)
| Set the color with which geometry is drawn.
DS_API void | dsSetColorAlpha (float red, float green, float blue, float alpha)
| Set the color and transparency with which geometry is drawn.
DS_API void | dsDrawBox (const float pos[3], const float R[12], const float sides[3])
| Draw a box.
DS_API void | dsDrawSphere (const float pos[3], const float R[12], float radius)
| Draw a sphere.
DS_API void | dsDrawTriangle (const float pos[3], const float R[12], const float *v0, const float *v1, const float *v2, int solid)
| Draw a triangle.
DS_API void | dsDrawCylinder (const float pos[3], const float R[12], float length, float radius)
| Draw a z-aligned cylinder.
DS_API void | dsDrawCapsule (const float pos[3], const float R[12], float length, float radius)
| Draw a z-aligned capsule.
DS_API void | dsDrawLine (const float pos1[3], const float pos2[3])
| Draw a line.
DS_API void | dsDrawConvex (const float pos[3], const float R[12], float *_planes, unsigned int _planecount, float *_points, unsigned int _pointcount, unsigned int *_polygons)
| Draw a convex shape.
DS_API void | dsDrawBoxD (const double pos[3], const double R[12], const double sides[3])
DS_API void | dsDrawSphereD (const double pos[3], const double R[12], const float radius)
DS_API void | dsDrawTriangleD (const double pos[3], const double R[12], const double *v0, const double *v1, const double *v2, int solid)
DS_API void | dsDrawCylinderD (const double pos[3], const double R[12], float length, float radius)
DS_API void | dsDrawCapsuleD (const double pos[3], const double R[12], float length, float radius)
DS_API void | dsDrawLineD (const double pos1[3], const double pos2[3])
DS_API void | dsDrawConvexD (const double pos[3], const double R[12], double *_planes, unsigned int _planecount, double *_points, unsigned int _pointcount, unsigned int *_polygons)
DS_API void | dsSetSphereQuality (int n)
| Set the quality with which curved objects are rendered. Higher numbers are higher quality, but slower to draw. This must be set before the first objects are drawn to be effective. Default sphere quality is 1, default capsule quality is 3.
DS_API void | dsSetCapsuleQuality (int n)

## Define Documentation

#define DS_API

#define DS_NONE 0

#define DS_WOOD 1

#define dsDrawCappedCylinder dsDrawCapsule

#define dsDrawCappedCylinderD dsDrawCapsuleD

#define dsSetCappedCylinderQuality dsSetCapsuleQuality

## Function Documentation

DS_API void dsDrawBoxD | ( | const double | pos[3],
|  | const double | R[12],
|  | const double | sides[3] |
| ) |  |  |

DS_API void dsDrawCapsuleD | ( | const double | pos[3],
|  | const double | R[12],
|  | float | length,
|  | float | radius |
| ) |  |  |

DS_API void dsDrawConvexD | ( | const double | pos[3],
|  | const double | R[12],
|  | double * | _planes,
|  | unsigned int | _planecount,
|  | double * | _points,
|  | unsigned int | _pointcount,
|  | unsigned int * | _polygons |
| ) |  |  |

DS_API void dsDrawCylinderD | ( | const double | pos[3],
|  | const double | R[12],
|  | float | length,
|  | float | radius |
| ) |  |  |

DS_API void dsDrawLineD | ( | const double | pos1[3],
|  | const double | pos2[3] |
| ) |  |  |

DS_API void dsDrawSphereD | ( | const double | pos[3],
|  | const double | R[12],
|  | const float | radius |
| ) |  |  |

DS_API void dsDrawTriangleD | ( | const double | pos[3],
|  | const double | R[12],
|  | const double * | v0,
|  | const double * | v1,
|  | const double * | v2,
|  | int | solid |
| ) |  |  |

DS_API void dsSetCapsuleQuality | ( | int | n | ) |