torcs - 1.2.2

src/modules/simu/simuv2/SOLID-2.0/include/SOLID/solid.h

Go to the documentation of this file.
00001 /*
00002   SOLID - Software Library for Interference Detection
00003   Copyright (C) 1997-1998  Gino van den Bergen
00004 
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Library General Public
00007   License as published by the Free Software Foundation; either
00008   version 2 of the License, or (at your option) any later version.
00009 
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Library General Public License for more details.
00014 
00015   You should have received a copy of the GNU Library General Public
00016   License along with this library; if not, write to the Free
00017   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 
00019   Please send remarks, questions and bug reports to gino@win.tue.nl,
00020   or write to:
00021                   Gino van den Bergen
00022                   Department of Mathematics and Computing Science
00023                   Eindhoven University of Technology
00024                   P.O. Box 513, 5600 MB Eindhoven, The Netherlands
00025 */
00026 
00027 #ifndef _SOLID_H_
00028 #define _SOLID_H_
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 typedef double DtScalar;
00035 typedef DtScalar DtVector[3];
00036 typedef unsigned int DtIndex;
00037 typedef unsigned int DtCount;
00038 
00039 typedef void *DtObjectRef;
00040 typedef void *DtShapeRef;
00041 
00042 typedef enum DtPolyType {
00043   DT_SIMPLEX,
00044   DT_POLYGON,
00045   DT_POLYHEDRON
00046 } DtPolyType;
00047 
00048 typedef enum DtResponseType { 
00049   DT_NO_RESPONSE,
00050   DT_SIMPLE_RESPONSE,
00051   DT_SMART_RESPONSE,
00052   DT_WITNESSED_RESPONSE
00053 } DtResponseType;
00054 
00055 typedef struct DtCollData {
00056   DtVector point1;
00057   DtVector point2;
00058   DtVector normal;
00059 } DtCollData;
00060 
00061 typedef void (*DtResponse)(
00062   void *client_data,
00063   DtObjectRef object1,
00064   DtObjectRef object2,
00065   const DtCollData *coll_data);
00066 
00067 
00068 
00069 /* Shape definition */
00070 
00071 extern DtShapeRef dtBox(DtScalar x, DtScalar y, DtScalar z);
00072 extern DtShapeRef dtCone(DtScalar radius, DtScalar height);
00073 extern DtShapeRef dtCylinder(DtScalar radius, DtScalar height);
00074 extern DtShapeRef dtSphere(DtScalar radius);
00075 
00076 extern DtShapeRef dtNewComplexShape();
00077 extern void dtEndComplexShape();
00078 
00079 extern void dtBegin(DtPolyType type);
00080 extern void dtEnd();
00081 
00082 extern void dtVertex(DtScalar x, DtScalar y, DtScalar z);
00083 extern void dtVertexBase(const void *base);
00084 extern void dtVertexIndex(DtIndex index);
00085 extern void dtVertexIndices(DtPolyType type, DtCount count, 
00086                             const DtIndex *indices);
00087 extern void dtVertexRange(DtPolyType type, DtIndex first, DtCount count); 
00088 
00089 extern void dtChangeVertexBase(DtShapeRef shape, const void *base);
00090 
00091 extern void dtDeleteShape(DtShapeRef shape);
00092 
00093 
00094 /* Object  */
00095 
00096 extern void dtCreateObject(DtObjectRef object, DtShapeRef shape); 
00097 extern void dtDeleteObject(DtObjectRef object);
00098 extern void dtSelectObject(DtObjectRef object);
00099 
00100 extern void dtLoadIdentity();
00101 
00102 extern void dtLoadMatrixf(const float *m);
00103 extern void dtLoadMatrixd(const double *m);
00104 
00105 extern void dtMultMatrixf(const float *m);
00106 extern void dtMultMatrixd(const double *m);
00107 
00108 extern void dtTranslate(DtScalar x, DtScalar y, DtScalar z);
00109 extern void dtRotate(DtScalar x, DtScalar y, DtScalar z, DtScalar w);
00110 extern void dtScale(DtScalar x, DtScalar y, DtScalar z);
00111 
00112 
00113 /* Response */
00114 
00115 extern void dtSetDefaultResponse(DtResponse response, DtResponseType type, 
00116                                  void *client_data);
00117 
00118 extern void dtClearDefaultResponse();
00119 
00120 extern void dtSetObjectResponse(DtObjectRef object, DtResponse response, 
00121                                 DtResponseType type, void *client_data);
00122 extern void dtClearObjectResponse(DtObjectRef object);
00123 extern void dtResetObjectResponse(DtObjectRef object);
00124 
00125 extern void dtSetPairResponse(DtObjectRef object1, DtObjectRef object2, 
00126                               DtResponse response, DtResponseType type, 
00127                               void *client_data);
00128 extern void dtClearPairResponse(DtObjectRef object1, DtObjectRef object2);
00129 extern void dtResetPairResponse(DtObjectRef object1, DtObjectRef object2);
00130 
00131 
00132 /* Global */
00133 
00134 extern DtCount dtTest();
00135 extern void dtProceed();
00136 
00137 extern void dtEnableCaching();
00138 extern void dtDisableCaching();
00139 
00140 extern void dtSetTolerance(DtScalar tol);
00141 
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145 
00146 #endif

Generated at Thu Feb 26 21:52:31 2004 for torcs by doxygen 1.3.3 written by Dimitri van Heesch, © 1997-1999
TORCS © Eric Espié 1999, 2002.