16 #include <btBulletCollisionCommon.h>
19 #include <vlutil/vlSmartPointers.h>
20 #include <vlutil/vlFilename.h>
21 #include <geometry/surface.h>
29 #include <vlutil/vlSmartPointers.h>
33 #include "vlutil/vlFilename.h"
36 class Coordinate_System;
71 virtual bool init(
const DtFilename filename,
bool displayWarning =
false);
74 virtual bool get(std::istream& stream);
81 unsigned int& characteristics,
int& position);
83 virtual void printResults(
const char* str,
unsigned int characteristics,
const char* additionalInformation = 0);
115 bool valid(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2)
const;
116 bool valid(
const btVector3& vertex)
const;
117 bool valid(
const btScalar& val)
const;
119 bool checkAddTriangle(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
120 bool removeDuplicateVertices =
false);
122 void addTriangle(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
123 bool removeDuplicateVertices =
false);
125 void addTriangleWithSurface(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
126 const DtSurface& surface,
bool removeDuplicateVertices=
false);
128 DtSurface triangleSurface(
unsigned int triangleIndex)
const;
130 const btVector3& max()
const;
131 const btVector3& min()
const;
133 bool isAabbValid()
const;
136 void updateBounds(
const btVector3& val);
140 void initializeSurfaceArray();
144 void syncSurfaceArray();
163 virtual bool buildBvh() = 0;
186 const osg::Matrix& baseTransform,
187 const DtFilename& surfaceCharacterFilename =
"",
188 bool treatPagedLODAsLOD =
false,
189 bool checkGeodesForSurfaces =
false,
190 const std::vector<std::string>& ignoreSurfacesMatching = std::vector<std::string>());
196 const osg::Matrix& baseTransform,
197 const DtSurface& surface);
205 const osg::Matrix& baseTransform,
206 const DtFilename& surfaceCharacterFilename =
"",
207 bool treatPagedLODAsLOD =
false,
208 bool checkGeodesForSurfaces =
false,
209 const std::vector<std::string>& ignoreSurfacesMatching = std::vector<std::string>());
214 osg::Matrix& matrix, btMatrix3x3& basisA, btVector3& origin,
bool& scaled);
219 template<
typename T_Node>
224 const osg::Matrix* worldMatrix = NULL,
225 const DtFilename& surfaceCharacterFilename =
"",
226 bool treatPagedLODAsLOD =
false,
227 bool checkGeodesForSurfaces =
false,
228 const std::vector<std::string>& ignoreSurfacesMatching = std::vector<std::string>())
230 osg::Matrix baseMatrix;
233 baseMatrix = *worldMatrix;
237 node, baseMatrix, surfaceCharacterFilename, treatPagedLODAsLOD, checkGeodesForSurfaces,
238 ignoreSurfacesMatching);
244 template<
typename T_Node>
249 const DtFilename& surfaceCharacterFilename,
250 const std::vector<std::string>& ignoreSurfacesMatching)
253 node, collObjects, drawMode, NULL,
254 surfaceCharacterFilename,
false,
false, ignoreSurfacesMatching);
260 template<
typename T_Node>
265 const DtSurface& surface,
266 const osg::Matrix* worldMatrix = NULL)
268 osg::Matrix baseMatrix;
271 baseMatrix = *worldMatrix;