Changeset 2877 for code/trunk/src/bullet/BulletCollision/CollisionDispatch
- Timestamp:
- Mar 31, 2009, 2:41:24 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/bullet/BulletCollision/CollisionDispatch/btCollisionWorld.h
r2876 r2877 5 5 This software is provided 'as-is', without any express or implied warranty. 6 6 In no event will the authors be held liable for any damages arising from the use of this software. 7 Permission is granted to anyone to use this software for any purpose, 8 including commercial applications, and to alter it and redistribute it freely, 7 Permission is granted to anyone to use this software for any purpose, 8 including commercial applications, and to alter it and redistribute it freely, 9 9 subject to the following restrictions: 10 10 … … 33 33 * Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8. 34 34 * The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version). 35 * 35 * 36 36 * Under other platforms, like Linux or Mac OS-X, Bullet can be build using either using make, cmake, http://www.cmake.org , or jam, http://www.perforce.com/jam/jam.html . cmake can autogenerate Xcode, KDevelop, MSVC and other build systems. just run cmake . in the root of Bullet. 37 37 * So if you are not using MSVC or cmake, you can run ./autogen.sh ./configure to create both Makefile and Jamfile and then run make or jam. 38 38 * Jam is a build system that can build the library, demos and also autogenerate the MSVC Project Files. 39 39 * If you don't have jam installed, you can make jam from the included jam-2.5 sources, or download jam from ftp://ftp.perforce.com/jam 40 * 40 * 41 41 * @subsection step3 Step 3: Testing demos 42 42 * Try to run and experiment with BasicDemo executable as a starting point. 43 43 * Bullet can be used in several ways, as Full Rigid Body simulation, as Collision Detector Library or Low Level / Snippets like the GJK Closest Point calculation. 44 44 * The Dependencies can be seen in this documentation under Directories 45 * 45 * 46 46 * @subsection step4 Step 4: Integrating in your application, full Rigid Body and Soft Body simulation 47 47 * Check out BasicDemo how to create a btDynamicsWorld, btRigidBody and btCollisionShape, Stepping the simulation and synchronizing your graphics object transform. … … 57 57 * Special thanks to all visitors of the Bullet Physics forum, and in particular above contributors, John McCutchan, Nathanael Presson, Dave Eberle, Dirk Gregorius, Erin Catto, Dave Eberle, Adam Moravanszky, 58 58 * Pierre Terdiman, Kenny Erleben, Russell Smith, Oliver Strunk, Jan Paul van Waveren, Marten Svanfeldt. 59 * 59 * 60 60 */ 61 61 62 62 63 64 63 65 64 66 #ifndef COLLISION_WORLD_H … … 81 83 82 84 85 83 86 protected: 84 87 85 88 btAlignedObjectArray<btCollisionObject*> m_collisionObjects; 86 89 90 87 91 btDispatcher* m_dispatcher1; 88 92 … … 96 100 97 101 102 98 103 public: 99 104 … … 137 142 138 143 144 139 145 virtual void setDebugDrawer(btIDebugDraw* debugDrawer) 140 146 { … … 155 161 int m_triangleIndex; 156 162 163 157 164 //const btCollisionShape* m_shapeTemp; 158 165 //const btTransform* m_shapeLocalTransform; … … 161 168 struct LocalRayResult 162 169 { 163 LocalRayResult(btCollisionObject* collisionObject, 170 LocalRayResult(btCollisionObject* collisionObject, 164 171 LocalShapeInfo* localShapeInfo, 165 172 const btVector3& hitNormalLocal, … … 228 235 btVector3 m_hitPointWorld; 229 236 237 230 238 virtual btScalar addSingleResult(LocalRayResult& rayResult,bool normalInWorldSpace) 231 239 { … … 233 241 btAssert(rayResult.m_hitFraction <= m_closestHitFraction); 234 242 243 235 244 m_closestHitFraction = rayResult.m_hitFraction; 236 245 m_collisionObject = rayResult.m_collisionObject; … … 251 260 struct LocalConvexResult 252 261 { 253 LocalConvexResult(btCollisionObject* hitCollisionObject, 262 LocalConvexResult(btCollisionObject* hitCollisionObject, 254 263 LocalShapeInfo* localShapeInfo, 255 264 const btVector3& hitNormalLocal, … … 279 288 short int m_collisionFilterMask; 280 289 290 281 291 ConvexResultCallback() 282 292 :m_closestHitFraction(btScalar(1.)), … … 290 300 } 291 301 302 292 303 bool hasHit() const 293 304 { … … 296 307 297 308 309 298 310 299 311 virtual bool needsCollision(btBroadphaseProxy* proxy0) const … … 323 335 btCollisionObject* m_hitCollisionObject; 324 336 337 325 338 virtual btScalar addSingleResult(LocalConvexResult& convexResult,bool normalInWorldSpace) 326 339 { … … 328 341 btAssert(convexResult.m_hitFraction <= m_closestHitFraction); 329 342 343 330 344 m_closestHitFraction = convexResult.m_hitFraction; 331 345 m_hitCollisionObject = convexResult.m_hitCollisionObject; … … 350 364 /// rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback 351 365 /// This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback. 352 void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; 366 void rayTest(const btVector3& rayFromWorld, const btVector3& rayToWorld, RayResultCallback& resultCallback) const; 353 367 354 368 // convexTest performs a swept convex cast on all objects in the btCollisionWorld, and calls the resultCallback
Note: See TracChangeset
for help on using the changeset viewer.