16 #include <btBulletCollisionCommon.h>
17 #include <btBulletDynamicsCommon.h>
20 #include <vlutil/vlSmartPointers.h>
21 #include <vlutil/vlFilename.h>
26 #include <osg/NodeVisitor>
31 #include <vlutil/vlSmartPointers.h>
35 #include "vlutil/vlFilename.h"
73 virtual bool init(
const DtFilename filename,
bool displayWarning =
false);
76 virtual bool get(std::istream& stream);
83 unsigned int& characteristics,
int& position,
bool& mappedSubstring);
85 virtual void printResults(
const char* str,
unsigned int characteristics,
const char* additionalInformation = 0);
118 bool valid(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2)
const;
119 bool valid(
const btVector3& vertex)
const;
120 bool valid(
const btScalar& val)
const;
122 bool checkAddTriangle(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
123 bool removeDuplicateVertices =
false);
125 void addTriangle(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
126 bool removeDuplicateVertices =
false);
128 void addTriangleWithSurface(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
129 const DtSurface& surface,
bool removeDuplicateVertices=
false);
131 DtSurface triangleSurface(
unsigned int triangleIndex)
const;
133 const btVector3& max()
const;
134 const btVector3& min()
const;
136 bool isAabbValid()
const;
139 void updateBounds(
const btVector3& val);
143 void initializeSurfaceArray();
147 void syncSurfaceArray();
166 virtual bool buildBvh() = 0;
200 const osg::Matrix& baseTransform,
201 const DtFilename& surfaceCharacterFilename =
"",
203 const std::vector<std::string>& ignoreSurfacesMatching = std::vector<std::string>(),
204 osg::NodeVisitor::TraversalMode traverseMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
210 const osg::Matrix& baseTransform,
212 osg::NodeVisitor::TraversalMode traverseMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN,
221 const osg::Matrix& baseTransform,
222 const DtFilename& surfaceCharacterFilename =
"",
224 const std::vector<std::string>& ignoreSurfacesMatching = std::vector<std::string>(),
225 osg::NodeVisitor::TraversalMode traverseMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN);
230 osg::Matrix& matrix, btMatrix3x3& basisA, btVector3& origin,
bool& scaled);
235 template<
typename T_Node>
240 const osg::Matrix* worldMatrix = NULL,
241 const DtFilename& surfaceCharacterFilename =
"",
243 const std::vector<std::string>& ignoreSurfacesMatching = std::vector<std::string>(),
244 osg::NodeVisitor::TraversalMode traverseMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN)
246 osg::Matrix baseMatrix;
249 baseMatrix = *worldMatrix;
253 node, baseMatrix, surfaceCharacterFilename, flags,
254 ignoreSurfacesMatching, traverseMode);
260 template<
typename T_Node>
265 const DtFilename& surfaceCharacterFilename,
266 const std::vector<std::string>& ignoreSurfacesMatching,
267 osg::NodeVisitor::TraversalMode traverseMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN,
271 node, collObjects, drawMode, NULL,
272 surfaceCharacterFilename, flags, ignoreSurfacesMatching, traverseMode);
278 template<
typename T_Node>
284 const osg::Matrix* worldMatrix = NULL,
285 osg::NodeVisitor::TraversalMode traverseMode = osg::NodeVisitor::TRAVERSE_ALL_CHILDREN,
288 osg::Matrix baseMatrix;
291 baseMatrix = *worldMatrix;