Data Structures | |
struct | dsFunctions |
Set of functions to be used as callbacks by the simulation loop. More... | |
Functions | |
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. | |
void | dsError (char *msg,...) |
exit with error message. | |
void | dsDebug (char *msg,...) |
exit with error message and core dump. | |
void | dsPrint (char *msg,...) |
print log message | |
void | dsSetViewpoint (float xyz[3], float hpr[3]) |
Sets the viewpoint. | |
void | dsGetViewpoint (float xyz[3], float hpr[3]) |
Gets the viewpoint. | |
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. | |
double | dsElapsedTime () |
Get the elapsed time (on wall-clock)
It returns the nr of seconds since the last call to this function. | |
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. | |
void | dsSetColor (float red, float green, float blue) |
Set the color with which geometry is drawn. | |
void | dsSetColorAlpha (float red, float green, float blue, float alpha) |
Set the color and transparency with which geometry is drawn. | |
void | dsDrawBox (const float pos[3], const float R[12], const float sides[3]) |
Draw a box. | |
void | dsDrawSphere (const float pos[3], const float R[12], float radius) |
Draw a sphere. | |
void | dsDrawTriangle (const float pos[3], const float R[12], const float *v0, const float *v1, const float *v2, int solid) |
Draw a triangle. | |
void | dsDrawCylinder (const float pos[3], const float R[12], float length, float radius) |
Draw a z-aligned cylinder. | |
void | dsDrawCapsule (const float pos[3], const float R[12], float length, float radius) |
Draw a z-aligned capsule. | |
void | dsDrawLine (const float pos1[3], const float pos2[3]) |
Draw a line. | |
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. | |
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. |
The user is able to click+drag in the main window to move the camera: left button - pan and tilt. right button - forward and sideways. left + right button (or middle button) - sideways and up.
|
exit with error message and core dump. this functions tries to dump core or start the debugger.
|
|
Draw a box.
|
|
Draw a sphere.
|
|
Draw a triangle.
|
|
exit with error message. This function displays an error message then exit.
|
|
Gets the viewpoint.
|
|
print log message
|
|
Set the color with which geometry is drawn.
|
|
Set the color and transparency with which geometry is drawn.
|
|
Toggle the rendering of textures. It changes the way objects are drawn. these changes will apply to all further dsDrawXXX() functions.
|
|
Sets the viewpoint.
|
|
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.
|