14 #include <btBulletCollisionCommon.h>
18 #include <matrix/vlVector.h>
21 #include <tbb/spin_rw_mutex.h>
26 #include <boost/optional.hpp>
28 #include <LinearMath/btTransform.h>
29 #include <LinearMath/btMatrix3x3.h>
41 #define LONG_FUDGE_FACTOR 1e-6
42 #define SETNORTH(u,n) (u).setNorth((n))
43 #define SETEAST(u,e) (u).setEast((e))
44 #define SETUP(u,upp) (u).setUp((upp))
50 :
public std::enable_shared_from_this<DtCollisionObjectInterface>
53 typedef std::vector< std::shared_ptr<makVrv::DtDynamicTerrainFeature> >
DynamicFeatures;
59 virtual std::shared_ptr<btCollisionShape> bulletCollisionShape()
const = 0;
62 virtual const btTransform& worldTransform()
const = 0;
66 virtual bool buildBvh() = 0;
68 virtual bool isBvhBuilt()
const = 0;
71 virtual bool enabled()
const = 0;
74 virtual unsigned int numberOfTriangles()
const = 0;
77 virtual double radius()
const = 0;
80 virtual DtSurface triangleSurface(
unsigned int triangleIndex)
const = 0;
92 const DtDegMinSec& refLatitude,
93 const DtDegMinSec& refLongitude,
95 DtUtmReferencePoint* refPoint,
97 bool setUseDynamicSceneOrigin =
false,
98 double dynamicSceneOriginDeadband = 0.0,
99 double scaleFactor = 0.9996);
107 const DtDegMinSec& refLongitude,
int standardOffsets,
long zone,
108 bool setUseDynamicSceneOrigin,
double dynamicSceneOriginDeadband,
109 double scaleFactor, DtUtmReferencePoint* refPoint);;
159 :
public btCollisionWorld::RayResultCallback
165 explicit RayResultRecord(btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace);
170 const btVector3& rayFromWorld,
const btVector3& rayToWorld)
const;
172 std::shared_ptr<const DtCollisionObjectInterface>
object;
183 virtual bool needsCollision(btBroadphaseProxy* proxy0)
const override;
200 virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace)
override;
212 virtual btScalar addSingleResult(
213 btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace)
override;
224 virtual bool needsCollision(btBroadphaseProxy* proxy0)
const override;
226 virtual btScalar addSingleResult(
227 btCollisionWorld::LocalRayResult& rayResult,
bool normalInWorldSpace)
override;
234 const DtVector& rayDirectionNonNormalized,
240 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:219
const double & x() const
Definition: point.h:188
std::vector< std::shared_ptr< makVrv::DtDynamicTerrainFeature > > DynamicFeatures
Definition: bulletUtil.h:53
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords. This is useful for followi...
Definition: vrfChordIntersectRecordList.h:31
bool myDataAvailable
Definition: bulletUtil.h:189
btScalar intersectionTime
Definition: bulletUtil.h:173
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:117
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:185
boost::optional< RayResultRecord > myResult
Definition: bulletUtil.h:215
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:88
Definition: surface.h:181
boost::optional< btTransform > normalTransform
Definition: bulletUtil.h:175
int triangleIndex
Definition: bulletUtil.h:176
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...
Only records the closest hit.
Definition: bulletUtil.h:206
Definition: coordSystem.h:54
DtDcm DT_DLL_vantageTerrainImplementation btMatrix2DtDcm(const btMatrix3x3 &m)
Utilities for using Bullet in MAK products.
std::shared_ptr< DtTerrainPagingGeometry > DtTerrainPagingGeometryPtr
Definition: terrainPagingGeometry.h:46
DtPoint btVector32DtPoint(const btVector3 &v)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:118
Definition: serializableUtmCS.h:22
DtVector btVector32DtVector(const btVector3 &v)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:119
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:49
Definition: vrfChordIntersectionRecord.h:19
const DtIntersectionRecord::DtIntersectionType myIrtFlag
Definition: bulletUtil.h:188
Base class for bullet callbacks which implements needsCollision.
Definition: bulletUtil.h:158
Extended version of bullet's RayResultCallback which records all the hits along the ray instead of on...
Definition: bulletUtil.h:194
bool DT_DLL_vantageTerrainImplementation geometrySphereVolumetricIntersect(const Coordinate_System &, DtTerrainPagingGeometryPtr geometry, const DtSphere &sphere)
std::list< std::shared_ptr< btCollisionObject > > DtCollisionObjectList
Definition: bulletUtil.h:47
Holds hit results so that data we need from them can be computed after mutex has been released...
Definition: bulletUtil.h:163
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
virtual ~DtSerializableUtmCS_ext() override
Destructor.
btVector3 normal
Definition: bulletUtil.h:174
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:202
Coordinate_System * createVrfCoordinateSystem(const makVrv::DtCoordinateSystem &coodSysIn)
class DtLocalVertexList:
Definition: localVertexList.h:20
std::shared_ptr< const DtCollisionObjectInterface > object
Definition: bulletUtil.h:172
btVector3 DtPoint2btVector3(const DtPoint &p)
Utilities for using Bullet in MAK products.
Definition: bulletUtil.h:116
DtUtmReferencePoint * myUtemRefPoint
Definition: bulletUtil.h:109
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