14 #include <btBulletCollisionCommon.h>
18 #include <matrix/vlVector.h>
21 #include <tbb/spin_rw_mutex.h>
26 #include <boost/optional.hpp>
27 #include <boost/shared_ptr.hpp>
28 #include <boost/enable_shared_from_this.hpp>
30 #include <LinearMath/btTransform.h>
31 #include <LinearMath/btMatrix3x3.h>
43 #define LONG_FUDGE_FACTOR 1e-6
44 #define SETNORTH(u,n) (u).setNorth((n))
45 #define SETEAST(u,e) (u).setEast((e))
46 #define SETUP(u,upp) (u).setUp((upp))
52 :
public boost::enable_shared_from_this<DtCollisionObjectInterface>
55 typedef std::vector< boost::shared_ptr<makVrv::DtDynamicTerrainFeature> >
DynamicFeatures;
61 virtual boost::shared_ptr<btCollisionShape> bulletCollisionShape()
const = 0;
64 virtual const btTransform& worldTransform()
const = 0;
68 virtual bool buildBvh() = 0;
70 virtual bool isBvhBuilt()
const = 0;
73 virtual bool enabled()
const = 0;
76 virtual unsigned int numberOfTriangles()
const = 0;
79 virtual double radius()
const = 0;
82 virtual DtSurface triangleSurface(
unsigned int triangleIndex)
const = 0;
94 const DtDegMinSec& refLatitude,
95 const DtDegMinSec& refLongitude,
97 DtUtmReferencePoint* refPoint,
99 bool setUseDynamicSceneOrigin =
false,
100 double dynamicSceneOriginDeadband = 0.0,
101 double scaleFactor = 0.9996);
108 const DtDegMinSec& refLongitude,
int standardOffsets,
long zone,
109 bool setUseDynamicSceneOrigin,
double dynamicSceneOriginDeadband,
110 double scaleFactor, DtUtmReferencePoint* refPoint);;
157 :
public btCollisionWorld::RayResultCallback
163 explicit RayResultRecord(btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace);
168 const btVector3& rayFromWorld,
const btVector3& rayToWorld)
const;
170 boost::shared_ptr<const DtCollisionObjectInterface>
object;
181 virtual bool needsCollision(btBroadphaseProxy* proxy0)
const override;
198 virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace);
210 virtual btScalar addSingleResult(
211 btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace);
224 virtual btScalar addSingleResult(
225 btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace);
232 const DtVector& rayDirectionNonNormalized,
238 void getBasisAndOrigin(osg::Matrix& matrix, btMatrix3x3& basisA, btVector3&
origin, osg::Vec3d& scale,
bool& scaled);
Only records whether there was a hit or not, bails out of future calculations once it finds one...
Definition: bulletUtil.h:217
const double & x() const
Definition: point.h:188
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
DtBoost::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords. This is useful for followi...
Definition: vrfChordIntersectRecordList.h:31
bool myDataAvailable
Definition: bulletUtil.h:187
btScalar intersectionTime
Definition: bulletUtil.h:171
void getBasisAndOrigin(osg::Matrix &matrix, btMatrix3x3 &basisA, btVector3 &origin, osg::Vec3d &scale, bool &scaled)
void init2RefLatLon(const DtDegMinSec &refLatitude, const DtDegMinSec &refLongitude, int standardOffsets, long zone, bool setUseDynamicSceneOrigin, double dynamicSceneOriginDeadband, double scaleFactor, DtUtmReferencePoint *refPoint)
voidpf uLong int origin
Definition: ioapi.h:42
btVector3 DtVector2btVector3(const DtVector &v)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:118
bool DT_DLL_vantageTerrainImplementation shapeSphereVolumetricIntersect(const Coordinate_System &, const DtLocalVertexList &shape, const DtSphere &sphere)
Note that this function treats the shape as if it is in two dimensions (all tests ignore height for t...
bool dataAvailable() const
Definition: bulletUtil.h:183
boost::optional< RayResultRecord > myResult
Definition: bulletUtil.h:213
bool DT_DLL_vantageTerrainImplementation sphereSphereVolumetricIntersect(const DtSphere &sphere1, const DtSphere &sphere2)
Overwriting the makTerrain toolkit function to support UTM in the southern hemisphere so that the ref...
Definition: bulletUtil.h:90
Definition: surface.h:181
boost::optional< btTransform > normalTransform
Definition: bulletUtil.h:173
boost::shared_ptr< const DtCollisionObjectInterface > object
Definition: bulletUtil.h:170
int triangleIndex
Definition: bulletUtil.h:174
bool DT_DLL_vantageTerrainImplementation DtIntersectRaySphere2(const DtPoint &rayStartPoint, const DtVector &rayDirectionNonNormalized, const DtSphere &sphere, double &t)
Almost the same function DtIntersectRaySphere in makTerrainToolkit But removing a few lines of code s...
std::vector< boost::shared_ptr< makVrv::DtDynamicTerrainFeature > > DynamicFeatures
Definition: bulletUtil.h:55
Only records the closest hit.
Definition: bulletUtil.h:204
Definition: coordSystem.h:54
DtPoint btVector32DtPoint(const btVector3 &v)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:119
Definition: serializableUtmCS.h:22
DtVector btVector32DtVector(const btVector3 &v)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:120
DtSerializableUtmCS_ext(const DtDegMinSec &refLatitude, const DtDegMinSec &refLongitude, int standardOffsets, DtUtmReferencePoint *refPoint, long zone=0, bool setUseDynamicSceneOrigin=false, double dynamicSceneOriginDeadband=0.0, double scaleFactor=0.9996)
The DtCoordinateSystem is used to manage the current coordinate system of the scene.
Definition: DtCoordinateSystem.h:40
const double & y() const
Definition: point.h:198
Definition: bulletUtil.h:51
Definition: vrfChordIntersectionRecord.h:19
const DtIntersectionRecord::DtIntersectionType myIrtFlag
Definition: bulletUtil.h:186
Base class for bullet callbacks which implements needsCollision.
Definition: bulletUtil.h:156
Extended version of bullet's RayResultCallback which records all the hits along the ray instead of on...
Definition: bulletUtil.h:192
bool DT_DLL_vantageTerrainImplementation geometrySphereVolumetricIntersect(const Coordinate_System &, DtTerrainPagingGeometryPtr geometry, const DtSphere &sphere)
Holds hit results so that data we need from them can be computed after mutex has been released...
Definition: bulletUtil.h:161
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
btVector3 normal
Definition: bulletUtil.h:172
bool DT_DLL_vantageTerrainImplementation btVectorIsZero(const btVector3 &v)
Utilities for using Bullet in MAK products.
bool DT_DLL_vantageTerrainImplementation chordSphereVolumetricIntersect(const DtChord &chord, const DtSphere &sphere)
const double & z() const
Definition: point.h:208
std::vector< RayResultRecord > myRecords
Definition: bulletUtil.h:200
Coordinate_System * createVrfCoordinateSystem(const makVrv::DtCoordinateSystem &coodSysIn)
class DtLocalVertexList:
Definition: localVertexList.h:20
btVector3 DtPoint2btVector3(const DtPoint &p)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:117
virtual ~DtSerializableUtmCS_ext()
Destructor.
std::list< boost::shared_ptr< btCollisionObject > > DtCollisionObjectList
Definition: bulletUtil.h:49
DtUtmReferencePoint * myUtemRefPoint
Definition: bulletUtil.h:110
virtual bool needsCollision(btBroadphaseProxy *proxy0) const override
Builds BVH and checks to see if object is enabled.
DtIntersectionType
Definition: intersectionRecord.h:41
virtual long zone() const