Add a TriMesh to TriMesh collision demo.
[ode.git] / ode / src / collision_trimesh_disabled.cpp
blob69203a0c1e7f0f37eda9a9d64b24403e9c6b11a3
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 *************************************************************************/
23 #include <ode/collision.h>
24 #include "config.h"
25 #include "matrix.h"
28 #if !dTRIMESH_ENABLED
30 #include "collision_util.h"
31 #include "collision_trimesh_internal.h"
34 static const dMatrix4 identity =
36 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ),
37 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ),
38 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ),
39 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 )
43 typedef dxMeshBase dxDisabledTriMesh_Parent;
44 struct dxDisabledTriMesh:
45 public dxDisabledTriMesh_Parent
47 public:
48 // Functions
49 dxDisabledTriMesh(dxSpace *Space,
50 dTriCallback *Callback, dTriArrayCallback *ArrayCallback, dTriRayCallback *RayCallback):
51 dxDisabledTriMesh_Parent(Space, NULL, Callback, ArrayCallback, RayCallback, false)
55 virtual void computeAABB(); // This is an abstract method in the base class
58 /*virtual */
59 void dxDisabledTriMesh::computeAABB()
61 // Do nothing
65 //////////////////////////////////////////////////////////////////////////
66 // Stub functions for trimesh calls
68 /*extern */
69 dTriMeshDataID dGeomTriMeshDataCreate(void)
71 return NULL;
74 /*extern */
75 void dGeomTriMeshDataDestroy(dTriMeshDataID g)
77 // Do nothing
81 /*extern */
82 void dGeomTriMeshDataSet(dTriMeshDataID g, int data_id, void* in_data)
84 // Do nothing
87 /*extern */
88 void *dGeomTriMeshDataGet(dTriMeshDataID g, int data_id)
90 return NULL;
93 /*extern */
94 void *dGeomTriMeshDataGet2(dTriMeshDataID g, int data_id, sizeint *pout_size/*=NULL*/)
96 if (pout_size != NULL)
98 *pout_size = 0;
101 return NULL;
105 /*extern */
106 void dGeomTriMeshSetLastTransform( dGeomID g, const dMatrix4 last_trans )
108 // Do nothing
111 /*extern */
112 const dReal *dGeomTriMeshGetLastTransform( dGeomID g )
114 return identity;
118 /*extern */
119 dGeomID dCreateTriMesh(dSpaceID space,
120 dTriMeshDataID Data,
121 dTriCallback* Callback,
122 dTriArrayCallback* ArrayCallback,
123 dTriRayCallback* RayCallback)
125 return new dxDisabledTriMesh(space, Callback, ArrayCallback, RayCallback); // Oleh_Derevenko: I'm not sure if a NULL can be returned here -- keep on returning an object for backward compatibility
129 /*extern */
130 void dGeomTriMeshSetData(dGeomID g, dTriMeshDataID Data)
132 // Do nothing
135 /*extern */
136 dTriMeshDataID dGeomTriMeshGetData(dGeomID g)
138 return NULL;
142 /*extern */
143 void dGeomTriMeshDataBuildSingle(dTriMeshDataID g,
144 const void* Vertices, int VertexStride, int VertexCount,
145 const void* Indices, int IndexCount, int TriStride)
147 // Do nothing
150 /*extern */
151 void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g,
152 const void* Vertices, int VertexStride, int VertexCount,
153 const void* Indices, int IndexCount, int TriStride,
154 const void* Normals)
156 // Do nothing
159 /*extern */
160 void dGeomTriMeshDataBuildDouble(dTriMeshDataID g,
161 const void* Vertices, int VertexStride, int VertexCount,
162 const void* Indices, int IndexCount, int TriStride)
164 // Do nothing
167 /*extern */
168 void dGeomTriMeshDataBuildDouble1(dTriMeshDataID g,
169 const void* Vertices, int VertexStride, int VertexCount,
170 const void* Indices, int IndexCount, int TriStride,
171 const void* Normals)
173 // Do nothing
176 /*extern */
177 void dGeomTriMeshDataBuildSimple(dTriMeshDataID g,
178 const dReal* Vertices, int VertexCount,
179 const dTriIndex* Indices, int IndexCount)
181 // Do nothing
184 /*extern */
185 void dGeomTriMeshDataBuildSimple1(dTriMeshDataID g,
186 const dReal* Vertices, int VertexCount,
187 const dTriIndex* Indices, int IndexCount,
188 const int* Normals)
190 // Do nothing
194 /*extern ODE_API */
195 int dGeomTriMeshDataPreprocess(dTriMeshDataID g)
197 // Do nothing
198 return 1;
201 /*extern ODE_API */
202 int dGeomTriMeshDataPreprocess2(dTriMeshDataID g, unsigned int buildRequestFlags, const intptr *requestExtraData/*=NULL | const intptr (*)[dTRIDATAPREPROCESS_BUILD__MAX]*/)
204 // Do nothing
205 return 1;
208 /*extern */
209 void dGeomTriMeshSetCallback(dGeomID g, dTriCallback* Callback)
211 // Do nothing
214 /*extern */
215 dTriCallback* dGeomTriMeshGetCallback(dGeomID g)
217 return NULL;
221 /*extern */
222 void dGeomTriMeshSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback)
224 // Do nothing
227 /*extern */
228 dTriArrayCallback* dGeomTriMeshGetArrayCallback(dGeomID g)
230 return NULL;
234 /*extern */
235 void dGeomTriMeshSetRayCallback(dGeomID g, dTriRayCallback* Callback)
237 // Do nothing
240 /*extern */
241 dTriRayCallback* dGeomTriMeshGetRayCallback(dGeomID g)
243 return NULL;
247 /*extern */
248 void dGeomTriMeshSetTriMergeCallback(dGeomID g, dTriTriMergeCallback* Callback)
250 // Do nothing
253 /*extern */
254 dTriTriMergeCallback* dGeomTriMeshGetTriMergeCallback(dGeomID g)
256 return NULL;
260 /*extern */
261 void dGeomTriMeshEnableTC(dGeomID g, int geomClass, int enable)
263 // Do nothing
266 /*extern */
267 int dGeomTriMeshIsTCEnabled(dGeomID g, int geomClass)
269 return 0;
273 /*extern */
274 void dGeomTriMeshClearTCCache(dGeomID g)
276 // Do nothing
280 /*extern */
281 dTriMeshDataID dGeomTriMeshGetTriMeshDataID(dGeomID g)
283 return NULL;
287 /*extern */
288 int dGeomTriMeshGetTriangleCount (dGeomID g)
290 return 0;
293 /*extern */
294 void dGeomTriMeshDataUpdate(dTriMeshDataID g)
296 // Do nothing
300 #endif // !dTRIMESH_ENABLED