1 /*************************************************************************
3 * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. *
4 * All rights reserved. Email: russ@q12.org Web: www.q12.org *
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 *
13 * (2) The BSD-style license that is included with this library in *
14 * the file LICENSE-BSD.TXT. *
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. *
21 *************************************************************************/
23 #include <ode/collision.h>
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
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
59 void dxDisabledTriMesh::computeAABB()
65 //////////////////////////////////////////////////////////////////////////
66 // Stub functions for trimesh calls
69 dTriMeshDataID
dGeomTriMeshDataCreate(void)
75 void dGeomTriMeshDataDestroy(dTriMeshDataID g
)
82 void dGeomTriMeshDataSet(dTriMeshDataID g
, int data_id
, void* in_data
)
88 void *dGeomTriMeshDataGet(dTriMeshDataID g
, int data_id
)
94 void *dGeomTriMeshDataGet2(dTriMeshDataID g
, int data_id
, sizeint
*pout_size
/*=NULL*/)
96 if (pout_size
!= NULL
)
106 void dGeomTriMeshSetLastTransform( dGeomID g
, const dMatrix4 last_trans
)
112 const dReal
*dGeomTriMeshGetLastTransform( dGeomID g
)
119 dGeomID
dCreateTriMesh(dSpaceID space
,
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
130 void dGeomTriMeshSetData(dGeomID g
, dTriMeshDataID Data
)
136 dTriMeshDataID
dGeomTriMeshGetData(dGeomID g
)
143 void dGeomTriMeshDataBuildSingle(dTriMeshDataID g
,
144 const void* Vertices
, int VertexStride
, int VertexCount
,
145 const void* Indices
, int IndexCount
, int TriStride
)
151 void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g
,
152 const void* Vertices
, int VertexStride
, int VertexCount
,
153 const void* Indices
, int IndexCount
, int TriStride
,
160 void dGeomTriMeshDataBuildDouble(dTriMeshDataID g
,
161 const void* Vertices
, int VertexStride
, int VertexCount
,
162 const void* Indices
, int IndexCount
, int TriStride
)
168 void dGeomTriMeshDataBuildDouble1(dTriMeshDataID g
,
169 const void* Vertices
, int VertexStride
, int VertexCount
,
170 const void* Indices
, int IndexCount
, int TriStride
,
177 void dGeomTriMeshDataBuildSimple(dTriMeshDataID g
,
178 const dReal
* Vertices
, int VertexCount
,
179 const dTriIndex
* Indices
, int IndexCount
)
185 void dGeomTriMeshDataBuildSimple1(dTriMeshDataID g
,
186 const dReal
* Vertices
, int VertexCount
,
187 const dTriIndex
* Indices
, int IndexCount
,
195 int dGeomTriMeshDataPreprocess(dTriMeshDataID g
)
202 int dGeomTriMeshDataPreprocess2(dTriMeshDataID g
, unsigned int buildRequestFlags
, const intptr
*requestExtraData
/*=NULL | const intptr (*)[dTRIDATAPREPROCESS_BUILD__MAX]*/)
209 void dGeomTriMeshSetCallback(dGeomID g
, dTriCallback
* Callback
)
215 dTriCallback
* dGeomTriMeshGetCallback(dGeomID g
)
222 void dGeomTriMeshSetArrayCallback(dGeomID g
, dTriArrayCallback
* ArrayCallback
)
228 dTriArrayCallback
* dGeomTriMeshGetArrayCallback(dGeomID g
)
235 void dGeomTriMeshSetRayCallback(dGeomID g
, dTriRayCallback
* Callback
)
241 dTriRayCallback
* dGeomTriMeshGetRayCallback(dGeomID g
)
248 void dGeomTriMeshSetTriMergeCallback(dGeomID g
, dTriTriMergeCallback
* Callback
)
254 dTriTriMergeCallback
* dGeomTriMeshGetTriMergeCallback(dGeomID g
)
261 void dGeomTriMeshEnableTC(dGeomID g
, int geomClass
, int enable
)
267 int dGeomTriMeshIsTCEnabled(dGeomID g
, int geomClass
)
274 void dGeomTriMeshClearTCCache(dGeomID g
)
281 dTriMeshDataID
dGeomTriMeshGetTriMeshDataID(dGeomID g
)
288 int dGeomTriMeshGetTriangleCount (dGeomID g
)
294 void dGeomTriMeshDataUpdate(dTriMeshDataID g
)
300 #endif // !dTRIMESH_ENABLED