VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bulletUtil.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 #include <btBulletCollisionCommon.h>
15 #include <geometry/point.h>
17 #include <matrix/vlVector.h>
18 #include <list>
19 #include <geometry/surface.h>
21 #include "tbb/spin_rw_mutex.h"
22 #include <boost/optional.hpp>
23 
24 class DtChord;
25 class DtSphere;
26 class DtLocalVertexList;
29 class Coordinate_System;
30 
32 
33 inline btVector3 DtPoint2btVector3(const DtPoint& p) { return btVector3(p.x(), p.y(), p.z()); }
34 inline btVector3 DtVector2btVector3(const DtVector& v) { return btVector3(v.x(), v.y(), v.z()); }
35 inline DtPoint btVector32DtPoint(const btVector3& v) { return DtPoint(v.x(), v.y(), v.z()); }
36 inline DtVector btVector32DtVector(const btVector3& v) { return DtVector(v.x(), v.y(), v.z()); }
39 
44  const DtChord& chord,
45  const DtSphere& sphere);
46 
50  const DtSphere& sphere1,
51  const DtSphere& sphere2);
52 
59  const Coordinate_System&,
60  const DtLocalVertexList& shape,
61  const DtSphere& sphere);
62 
67  const Coordinate_System&,
69  const DtSphere& sphere);
70 
73  : public btCollisionWorld::RayResultCallback
74 {
78  {
79  explicit RayResultRecord(btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace);
80 
84  const btVector3& rayFromWorld, const btVector3& rayToWorld) const;
85 
86  boost::shared_ptr<const DtCollisionObjectInterface> object;
87  btScalar intersectionTime;
88  btVector3 normal;
89  boost::optional<btTransform> normalTransform;
91  };
92 
94  DtIntersectionRecord::DtIntersectionType irtFlag, short int filterMask);
95 
97  virtual bool needsCollision(btBroadphaseProxy* proxy0) const;
98 
99 protected:
101 };
102 
107 {
109  DtIntersectionRecord::DtIntersectionType irtFlag, short int filterMask);
110 
111  virtual btScalar addSingleResult(btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace);
112 
113  std::vector<RayResultRecord> myRecords;
114 };
115 
119 {
121  DtIntersectionRecord::DtIntersectionType irtFlag, short int filterMask);
122 
123  virtual btScalar addSingleResult(
124  btCollisionWorld::LocalRayResult& rayResult,bool normalInWorldSpace);
125 
126  boost::optional<RayResultRecord> myResult;
127 };
128 
132 {
133  explicit DtIntersectionExistsCallback(short int filterMask);
134 
135  virtual bool needsCollision(btBroadphaseProxy* proxy0) const;
136 
137  virtual btScalar addSingleResult(
138  btCollisionWorld::LocalRayResult& rayResult, bool normalInWorldSpace);
139 };
140 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)