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>
24 #include <ode/matrix.h>
29 #include "collision_util.h"
30 #include "collision_trimesh_internal.h"
32 dxTriMesh::dxTriMesh(dSpaceID Space
, dTriMeshDataID Data
) : dxGeom(Space
, 1){ type
= dTriMeshClass
; }
33 dxTriMesh::~dxTriMesh(){}
35 int dxTriMesh::AABBTest(dxGeom
* g
, dReal aabb
[6]) { return 0; }
36 void dxTriMesh::computeAABB() { dSetZero (aabb
,6); }
38 static dMatrix4 identity
[] = {
39 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ),
40 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ),
41 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ),
42 REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ), REAL( 0.0 ) };
44 // Stub functions for trimesh calls
46 dTriMeshDataID
dGeomTriMeshDataCreate(void) { return 0; }
47 void dGeomTriMeshDataDestroy(dTriMeshDataID g
) {}
49 void dGeomTriMeshDataSet(dTriMeshDataID g
, int data_id
, void* in_data
) {}
50 void* dGeomTriMeshDataGet(dTriMeshDataID g
, int data_id
) { return 0; }
52 ODE_API
void dGeomTriMeshSetLastTransform( dGeomID g
, dMatrix4 last_trans
) {}
53 ODE_API dReal
* dGeomTriMeshGetLastTransform( dGeomID g
) { return (dReal
*)identity
; }
55 dGeomID
dCreateTriMesh(dSpaceID space
,
57 dTriCallback
* Callback
,
58 dTriArrayCallback
* ArrayCallback
,
59 dTriRayCallback
* RayCallback
)
61 dxTriMesh
* Geom
= new dxTriMesh(space
, Data
);
62 Geom
->Callback
= Callback
;
63 Geom
->ArrayCallback
= ArrayCallback
;
64 Geom
->RayCallback
= RayCallback
;
69 void dGeomTriMeshSetData(dGeomID g
, dTriMeshDataID Data
) {}
70 dTriMeshDataID
dGeomTriMeshGetData(dGeomID g
) { return 0; }
73 void dGeomTriMeshDataBuildSingle(dTriMeshDataID g
,
74 const void* Vertices
, int VertexStride
, int VertexCount
,
75 const void* Indices
, int IndexCount
, int TriStride
) { }
77 void dGeomTriMeshDataBuildSingle1(dTriMeshDataID g
,
78 const void* Vertices
, int VertexStride
, int VertexCount
,
79 const void* Indices
, int IndexCount
, int TriStride
,
80 const void* Normals
) { }
82 void dGeomTriMeshDataBuildDouble(dTriMeshDataID g
,
83 const void* Vertices
, int VertexStride
, int VertexCount
,
84 const void* Indices
, int IndexCount
, int TriStride
) { }
86 void dGeomTriMeshDataBuildDouble1(dTriMeshDataID g
,
87 const void* Vertices
, int VertexStride
, int VertexCount
,
88 const void* Indices
, int IndexCount
, int TriStride
,
89 const void* Normals
) { }
91 void dGeomTriMeshDataBuildSimple(dTriMeshDataID g
,
92 const dReal
* Vertices
, int VertexCount
,
93 const dTriIndex
* Indices
, int IndexCount
) { }
95 void dGeomTriMeshDataBuildSimple1(dTriMeshDataID g
,
96 const dReal
* Vertices
, int VertexCount
,
97 const dTriIndex
* Indices
, int IndexCount
,
98 const int* Normals
) { }
100 void dGeomTriMeshDataPreprocess(dTriMeshDataID g
) { }
102 void dGeomTriMeshDataGetBuffer(dTriMeshDataID g
, unsigned char** buf
, int* bufLen
) { *buf
= NULL
; *bufLen
=0; }
103 void dGeomTriMeshDataSetBuffer(dTriMeshDataID g
, unsigned char* buf
) {}
105 void dGeomTriMeshSetCallback(dGeomID g
, dTriCallback
* Callback
) { }
106 dTriCallback
* dGeomTriMeshGetCallback(dGeomID g
) { return 0; }
108 void dGeomTriMeshSetArrayCallback(dGeomID g
, dTriArrayCallback
* ArrayCallback
) { }
109 dTriArrayCallback
* dGeomTriMeshGetArrayCallback(dGeomID g
) { return 0; }
111 void dGeomTriMeshSetRayCallback(dGeomID g
, dTriRayCallback
* Callback
) { }
112 dTriRayCallback
* dGeomTriMeshGetRayCallback(dGeomID g
) { return 0; }
115 void dGeomTriMeshEnableTC(dGeomID g
, int geomClass
, int enable
) {}
116 int dGeomTriMeshIsTCEnabled(dGeomID g
, int geomClass
) { return 0; }
117 void dGeomTriMeshClearTCCache(dGeomID g
) {}
119 dTriMeshDataID
dGeomTriMeshGetTriMeshDataID(dGeomID g
) { return 0; }
121 int dGeomTriMeshGetTriangleCount (dGeomID g
) { return 0; }
122 void dGeomTriMeshDataUpdate(dTriMeshDataID g
) {}
124 #endif // !dTRIMESH_ENABLED