13 #include <BulletCollision/CollisionDispatch/btCollisionObject.h>
14 #include <BulletCollision/CollisionShapes/btBvhTriangleMeshShape.h>
15 #include <BulletCollision/CollisionShapes/btTriangleMesh.h>
17 #include <boost/shared_ptr.hpp>
18 #include <boost/enable_shared_from_this.hpp>
20 #include <tbb/spin_mutex.h>
32 bool valid(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2)
const;
33 bool valid(
const btVector3& vertex)
const;
34 bool valid(
const btScalar& val)
const;
36 bool checkAddTriangle(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
37 bool removeDuplicateVertices =
false);
39 void addTriangle(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
40 bool removeDuplicateVertices =
false);
42 void addTriangleWithSurface(
const btVector3& vertex0,
const btVector3& vertex1,
const btVector3& vertex2,
43 const DtSurface& surface,
bool removeDuplicateVertices =
false);
45 DtSurface triangleSurface(
unsigned int triangleIndex)
const;
47 const btVector3& max()
const;
48 const btVector3& min()
const;
50 bool isAabbValid()
const;
52 double maxDistance()
const;
55 void updateBounds(
const btVector3& val);
59 void initializeSurfaceArray();
63 void syncSurfaceArray();
78 ,
public boost::enable_shared_from_this<DtBvhTriangleMeshShape>
81 typedef boost::shared_ptr<DtBvhTriangleMeshShape>
Ptr;
85 bool useQuantization =
true,
bool buildBvhNow =
false,
86 bool filterTransparentPolygons =
false);
95 int getNumTriangles()
const;
113 void setCollisionShape(btCollisionShape* shape);
virtual double radius() const =0
Returns the maximum distance of all points from the origin of this object.
bool myUseSurfaceArray
When this is false, mySurfaceTypes is empty, and all triangles are considered to have "Unspecified" a...
Definition: bvhTriangleMeshShape.h:69
virtual DtSurface triangleSurface(unsigned int triangleIndex) const =0
Return the surface of a triangle at a given index.
A version of btTriangleMesh that also holds soil type for each polygon.
Definition: bvhTriangleMeshShape.h:26
virtual bool enabled() const =0
Intersections will ignore this object if this returns true.
Definition: surface.h:179
DtBvhTriangleMeshShape::Ptr myShape
Definition: bvhTriangleMeshShape.h:129
Definition: bvhTriangleMeshShape.h:76
std::vector< boost::shared_ptr< makVrv::DtDynamicTerrainFeature > > DynamicFeatures
Definition: osgToBullet.h:67
virtual bool buildBvh()=0
Build the bvh with mutex locked. Call as many times as you like, will only build once.
double myMaxPointDistanceSq
Definition: bvhTriangleMeshShape.h:73
virtual unsigned int numberOfTriangles() const =0
Return number of triangles in this object (ignores instancing).
btVector3 myMin
Definition: bvhTriangleMeshShape.h:71
boost::shared_ptr< DtBvhTriangleMeshShape > Ptr
Definition: bvhTriangleMeshShape.h:81
int myTrianglesCount
Definition: bvhTriangleMeshShape.h:103
btVector3 myMax
Definition: bvhTriangleMeshShape.h:72
tbb::spin_mutex Mutex
Definition: bvhTriangleMeshShape.h:98
Definition: bvhTriangleMeshShape.h:106
virtual boost::shared_ptr< btCollisionShape > bulletCollisionShape() const =0
Access the underlying bullet collision shape.
Mutex myMutex
Definition: bvhTriangleMeshShape.h:100
Definition: osgToBullet.h:63
virtual DynamicFeatures dynamicFeatures() const =0
Return all the dynamic features which contain this object.
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
DtTriangleMeshWithSoil * myMesh
Definition: bvhTriangleMeshShape.h:101
virtual const btTransform & worldTransform() const =0
Access the world transform of the collision object.
btAlignedObjectArray< DtSurface > mySurfaceTypes
Definition: bvhTriangleMeshShape.h:70