ODE  0.13.1
 All Data Structures Functions Variables Typedefs Enumerations Groups
collision_space.h
1 /*************************************************************************
2  * *
3  * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. *
4  * All rights reserved. Email: russ@q12.org Web: www.q12.org *
5  * *
6  * This library is free software; you can redistribute it and/or *
7  * modify it under the terms of EITHER: *
8  * (1) The GNU Lesser General Public License as published by the Free *
9  * Software Foundation; either version 2.1 of the License, or (at *
10  * your option) any later version. The text of the GNU Lesser *
11  * General Public License is included with this library in the *
12  * file LICENSE.TXT. *
13  * (2) The BSD-style license that is included with this library in *
14  * the file LICENSE-BSD.TXT. *
15  * *
16  * This library is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
19  * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
20  * *
21  *************************************************************************/
22 
23 #ifndef _ODE_COLLISION_SPACE_H_
24 #define _ODE_COLLISION_SPACE_H_
25 
26 #include <ode/common.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 struct dContactGeom;
33 
49 typedef void dNearCallback (void *data, dGeomID o1, dGeomID o2);
50 
51 
52 ODE_API dSpaceID dSimpleSpaceCreate (dSpaceID space);
53 ODE_API dSpaceID dHashSpaceCreate (dSpaceID space);
54 ODE_API dSpaceID dQuadTreeSpaceCreate (dSpaceID space, const dVector3 Center, const dVector3 Extents, int Depth);
55 
56 
57 /* SAP */
58 /* Order XZY or ZXY usually works best, if your Y is up. */
59 #define dSAP_AXES_XYZ ((0)|(1<<2)|(2<<4))
60 #define dSAP_AXES_XZY ((0)|(2<<2)|(1<<4))
61 #define dSAP_AXES_YXZ ((1)|(0<<2)|(2<<4))
62 #define dSAP_AXES_YZX ((1)|(2<<2)|(0<<4))
63 #define dSAP_AXES_ZXY ((2)|(0<<2)|(1<<4))
64 #define dSAP_AXES_ZYX ((2)|(1<<2)|(0<<4))
65 
66 ODE_API dSpaceID dSweepAndPruneSpaceCreate( dSpaceID space, int axisorder );
67 
68 
69 
70 ODE_API void dSpaceDestroy (dSpaceID);
71 
72 ODE_API void dHashSpaceSetLevels (dSpaceID space, int minlevel, int maxlevel);
73 ODE_API void dHashSpaceGetLevels (dSpaceID space, int *minlevel, int *maxlevel);
74 
75 ODE_API void dSpaceSetCleanup (dSpaceID space, int mode);
76 ODE_API int dSpaceGetCleanup (dSpaceID space);
77 
100 ODE_API void dSpaceSetSublevel (dSpaceID space, int sublevel);
101 
114 ODE_API int dSpaceGetSublevel (dSpaceID space);
115 
116 
133 ODE_API void dSpaceSetManualCleanup (dSpaceID space, int mode);
134 
147 ODE_API int dSpaceGetManualCleanup (dSpaceID space);
148 
149 ODE_API void dSpaceAdd (dSpaceID, dGeomID);
150 ODE_API void dSpaceRemove (dSpaceID, dGeomID);
151 ODE_API int dSpaceQuery (dSpaceID, dGeomID);
152 ODE_API void dSpaceClean (dSpaceID);
153 ODE_API int dSpaceGetNumGeoms (dSpaceID);
154 ODE_API dGeomID dSpaceGetGeom (dSpaceID, int i);
155 
176 ODE_API int dSpaceGetClass(dSpaceID space);
177 
178 #ifdef __cplusplus
179 }
180 #endif
181 
182 #endif
int dSpaceGetClass(dSpaceID space)
Given a space, this returns its class.
int dSpaceGetSublevel(dSpaceID space)
Gets sublevel value of a space.
Describe the contact point between two geoms.
Definition: contact.h:88
void dSpaceSetManualCleanup(dSpaceID space, int mode)
Sets manual cleanup flag for a space.
void dNearCallback(void *data, dGeomID o1, dGeomID o2)
User callback for geom-geom collision testing.
Definition: collision_space.h:49
void dSpaceSetSublevel(dSpaceID space, int sublevel)
Sets sublevel value for a space.
int dSpaceGetManualCleanup(dSpaceID space)
Get manual cleanup flag of a space.