Bullet Collision Detection & Physics Library: Bullet Documentation

  • Main Page
  • Namespaces
  • Classes
  • Files
  • Directories

Bullet Documentation

Introduction

Bullet Collision Detection & Physics SDK

Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ).

There is the Physics Forum for Feedback and General Collision Detection and Physics discussions. Please visit http://www.continuousphysics.com/Bullet/phpBB2/index.php

Installation

Step 1: Download

You can download the Bullet Physics Library from our website: http://www.continuousphysics.com/Bullet/

Step 2: Building

Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8. The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version).

Under other platforms, like Linux or Mac OS-X, Bullet can be build using jam, http://www.perforce.com/jam/jam.html . Jam is a build system that can build the library, demos and also autogenerate the MSVC Project Files. So if you are not using MSVC, you can run configure and jam . 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/pub/jam/

Step 3: Testing demos

Try to run and experiment with CcdPhysicsDemo executable as a starting point. 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. The Dependencies can be seen in this documentation under Directories

Step 4: Integrating in your application, Full Rigid Body Simulation

Check out CcdPhysicsDemo how to create a CcdPhysicsEnvironment , CollisionShape and RigidBody, Stepping the simulation and synchronizing your derived version of the PHY_IMotionState class.

Step 5 : Integrate the Collision Detection Library (without Dynamics and other Extras)

Bullet Collision Detection can also be used without the Dynamics/Extras. Check out CollisionWorld and CollisionObject, and the CollisionInterfaceDemo. Also in Extras/test_BulletOde.cpp there is a sample Collision Detection integration with Open Dynamics Engine, ODE, http://www.ode.org

Step 6 : Use Snippets like the GJK Closest Point calculation.

Bullet has been designed in a modular way keeping dependencies to a minimum. The ConvexHullDistance demo demonstrates direct use of GjkPairDetector.

Copyright

Copyright (C) 2005-2006 Erwin Coumans, some contributions Copyright Gino van den Bergen, Christer Ericson, Simon Hobbs, Ricardo Padrela, F Richter(res), Stephane Redon Special thanks to all visitors of the Bullet Physics forum, and in particular above contributors, Dave Eberle, Dirk Gregorius, Erin Catto, Dave Eberle, Adam Moravanszky, Pierre Terdiman, Kenny Erleben, Russell Smith, Oliver Strunk, Jan Paul van Waveren.
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AabbUtil2.h File Reference

  • Files
  • Directories
  • File List
  • File Members
LinearMath

AabbUtil2.h File Reference

#include "SimdVector3.h"

Include dependency graph for AabbUtil2.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | SimdMin(a, b) ((a < b ? a : b))
#define | SimdMax(a, b) ((a > b ? a : b))

Functions

SIMD_FORCE_INLINE bool | TestAabbAgainstAabb2 (const SimdVector3 &aabbMin1, const SimdVector3 &aabbMax1, const SimdVector3 &aabbMin2, const SimdVector3 &aabbMax2)
conservative test for overlap between two aabbs
SIMD_FORCE_INLINE bool | TestTriangleAgainstAabb2 (const SimdVector3 *vertices, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)
conservative test for overlap between triangle and aabb

Define Documentation

#define SimdMax | ( | a,
 |  | b | ) | ((a > b ? a : b))

Definition at line 23 of file AabbUtil2.h.

Referenced by TestTriangleAgainstAabb2().

#define SimdMin | ( | a,
 |  | b | ) | ((a < b ? a : b))

Definition at line 22 of file AabbUtil2.h.

Referenced by Epa::CalcPenDepth(), and TestTriangleAgainstAabb2().

Function Documentation

SIMD_FORCE_INLINE bool TestAabbAgainstAabb2 | ( | const SimdVector3 & | aabbMin1,
 |  | const SimdVector3 & | aabbMax1,
 |  | const SimdVector3 & | aabbMin2,
 |  | const SimdVector3 & | aabbMax2
 | ) |

conservative test for overlap between two aabbs

Definition at line 27 of file AabbUtil2.h.

Referenced by CollisionWorld::RayTest(), OptimizedBvh::WalkStacklessTree(), and OptimizedBvh::WalkTree().

SIMD_FORCE_INLINE bool TestTriangleAgainstAabb2 | ( | const SimdVector3 * | vertices,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) |

conservative test for overlap between triangle and aabb

Definition at line 38 of file AabbUtil2.h.

References SimdMax, and SimdMin.

Referenced by TriangleMeshShape::ProcessAllTriangles().

Generated on Wed May 24 13:58:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AabbUtil2.h Source File

  • File Members
LinearMath

AabbUtil2.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef AABB_UTIL2
00018 #define AABB_UTIL2
00019
00020 #include "SimdVector3.h"
00021
00022 #define SimdMin(a,b) ((a < b ? a : b))
00023 #define SimdMax(a,b) ((a > b ? a : b))
00024
00025
00027 SIMD_FORCE_INLINE bool TestAabbAgainstAabb2(const SimdVector3 &aabbMin1, const SimdVector3 &aabbMax1,
00028                                                                 const SimdVector3 &aabbMin2, const SimdVector3 &aabbMax2)
00029 {
00030         bool overlap = true;
00031         overlap = (aabbMin1[0] > aabbMax2[0] || aabbMax1[0] < aabbMin2[0]) ? false : overlap;
00032         overlap = (aabbMin1[2] > aabbMax2[2] || aabbMax1[2] < aabbMin2[2]) ? false : overlap;
00033         overlap = (aabbMin1[1] > aabbMax2[1] || aabbMax1[1] < aabbMin2[1]) ? false : overlap;
00034         return overlap;
00035 }
00036
00038 SIMD_FORCE_INLINE bool TestTriangleAgainstAabb2(const SimdVector3 *vertices,
00039                                                                         const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)
00040 {
00041         const SimdVector3 &p1 = vertices[0];
00042         const SimdVector3 &p2 = vertices[1];
00043         const SimdVector3 &p3 = vertices[2];
00044
00045         if (SimdMin(SimdMin(p1[0], p2[0]), p3[0]) > aabbMax[0]) return false;
00046         if (SimdMax(SimdMax(p1[0], p2[0]), p3[0]) < aabbMin[0]) return false;
00047
00048         if (SimdMin(SimdMin(p1[2], p2[2]), p3[2]) > aabbMax[2]) return false;
00049         if (SimdMax(SimdMax(p1[2], p2[2]), p3[2]) < aabbMin[2]) return false;
00050
00051         if (SimdMin(SimdMin(p1[1], p2[1]), p3[1]) > aabbMax[1]) return false;
00052         if (SimdMax(SimdMax(p1[1], p2[1]), p3[1]) < aabbMin[1]) return false;
00053         return true;
00054 }
00055
00056 #endif
00057
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3.cpp File Reference

Bullet » BroadphaseCollision

AxisSweep3.cpp File Reference

#include "AxisSweep3.h"
#include <assert.h>

Include dependency graph for AxisSweep3.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3.cpp Source File

Bullet » BroadphaseCollision

AxisSweep3.cpp

Go to the documentation of this file.
00001
00002 //Bullet Continuous Collision Detection and Physics Library
00003 //Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005
00006 //
00007 // AxisSweep3
00008 //
00009 // Copyright (c) 2006 Simon Hobbs
00010 //
00011 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00012 //
00013 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00014 //
00015 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00016 //
00017 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00018 //
00019 // 3. This notice may not be removed or altered from any source distribution.
00020 #include "AxisSweep3.h"
00021
00022 #include <assert.h>
00023
00024 BroadphaseProxy*        AxisSweep3::CreateProxy(  const SimdVector3& min,  const SimdVector3& max,int shapeType,void* userPtr )
00025 {
00026                 unsigned short handleId = AddHandle(min,max, userPtr);
00027
00028                 Handle* handle = GetHandle(handleId);
00029                 return handle;
00030 }
00031
00032 void    AxisSweep3::DestroyProxy(BroadphaseProxy* proxy)
00033 {
00034         Handle* handle = static_cast<Handle*>(proxy);
00035         RemoveHandle(handle->m_handleId);
00036 }
00037
00038 void    AxisSweep3::SetAabb(BroadphaseProxy* proxy,const SimdVector3& aabbMin,const SimdVector3& aabbMax)
00039 {
00040         Handle* handle = static_cast<Handle*>(proxy);
00041         UpdateHandle(handle->m_handleId,aabbMin,aabbMax);
00042 }
00043
00044
00045
00046
00047
00048
00049 AxisSweep3::AxisSweep3(const SimdPoint3& worldAabbMin,const SimdPoint3& worldAabbMax, int maxHandles, int maxOverlaps)
00050 {
00051         //assert(bounds.HasVolume());
00052
00053         // 1 handle is reserved as sentinel
00054         assert(maxHandles > 1 && maxHandles < 32767);
00055
00056         // doesn't need this limit right now, but I may want to use unsigned short indexes into overlaps array
00057         assert(maxOverlaps > 0 && maxOverlaps < 65536);
00058
00059         // init bounds
00060         m_worldAabbMin = worldAabbMin;
00061         m_worldAabbMax = worldAabbMax;
00062
00063         SimdVector3 aabbSize = m_worldAabbMax - m_worldAabbMin;
00064
00065         m_quantize = SimdVector3(65535.0f,65535.0f,65535.0f) / aabbSize;
00066
00067         // allocate handles buffer and put all handles on free list
00068         m_pHandles = new Handle[maxHandles];
00069         m_maxHandles = maxHandles;
00070         m_numHandles = 0;
00071
00072         // handle 0 is reserved as the null index, and is also used as the sentinel
00073         m_firstFreeHandle = 1;
00074         {
00075                 for (int i = m_firstFreeHandle; i < maxHandles; i++)
00076                         m_pHandles[i].SetNextFree(i + 1);
00077                 m_pHandles[maxHandles - 1].SetNextFree(0);
00078         }
00079
00080         {
00081         // allocate edge buffers
00082         for (int i = 0; i < 3; i++)
00083                 m_pEdges[i] = new Edge[maxHandles * 2];
00084         }
00085         //removed overlap management
00086
00087         // make boundary sentinels
00088
00089         m_pHandles[0].m_clientObject = 0;
00090
00091         for (int axis = 0; axis < 3; axis++)
00092         {
00093                 m_pHandles[0].m_minEdges[axis] = 0;
00094                 m_pHandles[0].m_maxEdges[axis] = 1;
00095
00096                 m_pEdges[axis][0].m_pos = 0;
00097                 m_pEdges[axis][0].m_handle = 0;
00098                 m_pEdges[axis][1].m_pos = 0xffff;
00099                 m_pEdges[axis][1].m_handle = 0;
00100         }
00101 }
00102
00103 AxisSweep3::~AxisSweep3()
00104 {
00105
00106         for (int i = 2; i >= 0; i--)
00107                 delete[] m_pEdges[i];
00108         delete[] m_pHandles;
00109 }
00110
00111 void AxisSweep3::Quantize(unsigned short* out, const SimdPoint3& point, int isMax) const
00112 {
00113         SimdPoint3 clampedPoint(point);
00114         /*
00115         if (isMax)
00116                 clampedPoint += SimdVector3(10,10,10);
00117         else
00118         {
00119                 clampedPoint -= SimdVector3(10,10,10);
00120         }
00121         */
00122
00123
00124         clampedPoint.setMax(m_worldAabbMin);
00125         clampedPoint.setMin(m_worldAabbMax);
00126
00127         SimdVector3 v = (clampedPoint - m_worldAabbMin) * m_quantize;
00128         out[0] = (unsigned short)(((int)v.getX() & 0xfffc) | isMax);
00129         out[1] = (unsigned short)(((int)v.getY() & 0xfffc) | isMax);
00130         out[2] = (unsigned short)(((int)v.getZ() & 0xfffc) | isMax);
00131
00132 }
00133
00134
00135
00136 unsigned short AxisSweep3::AllocHandle()
00137 {
00138         assert(m_firstFreeHandle);
00139
00140         unsigned short handle = m_firstFreeHandle;
00141         m_firstFreeHandle = GetHandle(handle)->GetNextFree();
00142         m_numHandles++;
00143
00144         return handle;
00145 }
00146
00147 void AxisSweep3::FreeHandle(unsigned short handle)
00148 {
00149         assert(handle > 0 && handle < m_maxHandles);
00150
00151         GetHandle(handle)->SetNextFree(m_firstFreeHandle);
00152         m_firstFreeHandle = handle;
00153
00154         m_numHandles--;
00155 }
00156
00157
00158
00159 unsigned short AxisSweep3::AddHandle(const SimdPoint3& aabbMin,const SimdPoint3& aabbMax, void* pOwner)
00160 {
00161         // quantize the bounds
00162         unsigned short min[3], max[3];
00163         Quantize(min, aabbMin, 0);
00164         Quantize(max, aabbMax, 1);
00165
00166         // allocate a handle
00167         unsigned short handle = AllocHandle();
00168         assert(handle!= 0xcdcd);
00169
00170         Handle* pHandle = GetHandle(handle);
00171
00172
00173         pHandle->m_handleId = handle;
00174         //pHandle->m_pOverlaps = 0;
00175         pHandle->m_clientObject = pOwner;
00176
00177         // compute current limit of edge arrays
00178         int limit = m_numHandles * 2;
00179
00180         // insert new edges just inside the max boundary edge
00181         for (int axis = 0; axis < 3; axis++)
00182         {
00183                 m_pHandles[0].m_maxEdges[axis] += 2;
00184
00185                 m_pEdges[axis][limit + 1] = m_pEdges[axis][limit - 1];
00186
00187                 m_pEdges[axis][limit - 1].m_pos = min[axis];
00188                 m_pEdges[axis][limit - 1].m_handle = handle;
00189
00190                 m_pEdges[axis][limit].m_pos = max[axis];
00191                 m_pEdges[axis][limit].m_handle = handle;
00192
00193                 pHandle->m_minEdges[axis] = limit - 1;
00194                 pHandle->m_maxEdges[axis] = limit;
00195         }
00196
00197         // now sort the new edges to their correct position
00198         SortMinDown(0, pHandle->m_minEdges[0], false);
00199         SortMaxDown(0, pHandle->m_maxEdges[0], false);
00200         SortMinDown(1, pHandle->m_minEdges[1], false);
00201         SortMaxDown(1, pHandle->m_maxEdges[1], false);
00202         SortMinDown(2, pHandle->m_minEdges[2], true);
00203         SortMaxDown(2, pHandle->m_maxEdges[2], true);
00204
00205         //PrintAxis(1);
00206
00207         return handle;
00208 }
00209
00210
00211 void AxisSweep3::RemoveHandle(unsigned short handle)
00212 {
00213         Handle* pHandle = GetHandle(handle);
00214
00215         RemoveOverlappingPairsContainingProxy(pHandle);
00216
00217
00218         // compute current limit of edge arrays
00219         int limit = m_numHandles * 2;
00220         int axis;
00221
00222         for (axis = 0;axis<3;axis++)
00223         {
00224                 Edge* pEdges = m_pEdges[axis];
00225                 int maxEdge= pHandle->m_maxEdges[axis];
00226                 pEdges[maxEdge].m_pos = 0xffff;
00227                 int minEdge = pHandle->m_minEdges[axis];
00228                 pEdges[minEdge].m_pos = 0xffff;
00229         }
00230
00231         // remove the edges by sorting them up to the end of the list
00232         for ( axis = 0; axis < 3; axis++)
00233         {
00234                 Edge* pEdges = m_pEdges[axis];
00235                 int max = pHandle->m_maxEdges[axis];
00236                 pEdges[max].m_pos = 0xffff;
00237
00238                 SortMaxUp(axis,max,false);
00239
00240                 int i = pHandle->m_minEdges[axis];
00241                 pEdges[i].m_pos = 0xffff;
00242
00243                 SortMinUp(axis,i,false);
00244
00245                 pEdges[limit-1].m_handle = 0;
00246                 pEdges[limit-1].m_pos = 0xffff;
00247
00248         }
00249
00250         // free the handle
00251         FreeHandle(handle);
00252
00253
00254 }
00255
00256 bool AxisSweep3::TestOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB)
00257 {
00258         //optimization 1: check the array index (memory address), instead of the m_pos
00259
00260         for (int axis = 0; axis < 3; axis++)
00261         {
00262                 if (axis != ignoreAxis)
00263                 {
00264                         if (pHandleA->m_maxEdges[axis] < pHandleB->m_minEdges[axis] ||
00265                                 pHandleB->m_maxEdges[axis] < pHandleA->m_minEdges[axis])
00266                         {
00267                                 return false;
00268                         }
00269                 }
00270         }
00271
00272         //optimization 2: only 2 axis need to be tested
00273
00274         /*for (int axis = 0; axis < 3; axis++)
00275         {
00276                 if (m_pEdges[axis][pHandleA->m_maxEdges[axis]].m_pos < m_pEdges[axis][pHandleB->m_minEdges[axis]].m_pos ||
00277                         m_pEdges[axis][pHandleB->m_maxEdges[axis]].m_pos < m_pEdges[axis][pHandleA->m_minEdges[axis]].m_pos)
00278                 {
00279                         return false;
00280                 }
00281         }
00282         */
00283
00284         return true;
00285 }
00286
00287 void AxisSweep3::UpdateHandle(unsigned short handle, const SimdPoint3& aabbMin,const SimdPoint3& aabbMax)
00288 {
00289 //      assert(bounds.IsFinite());
00290         //assert(bounds.HasVolume());
00291
00292         Handle* pHandle = GetHandle(handle);
00293
00294         // quantize the new bounds
00295         unsigned short min[3], max[3];
00296         Quantize(min, aabbMin, 0);
00297         Quantize(max, aabbMax, 1);
00298
00299         // update changed edges
00300         for (int axis = 0; axis < 3; axis++)
00301         {
00302                 unsigned short emin = pHandle->m_minEdges[axis];
00303                 unsigned short emax = pHandle->m_maxEdges[axis];
00304
00305                 int dmin = (int)min[axis] - (int)m_pEdges[axis][emin].m_pos;
00306                 int dmax = (int)max[axis] - (int)m_pEdges[axis][emax].m_pos;
00307
00308                 m_pEdges[axis][emin].m_pos = min[axis];
00309                 m_pEdges[axis][emax].m_pos = max[axis];
00310
00311                 // expand (only adds overlaps)
00312                 if (dmin < 0)
00313                         SortMinDown(axis, emin);
00314
00315                 if (dmax > 0)
00316                         SortMaxUp(axis, emax);
00317
00318                 // shrink (only removes overlaps)
00319                 if (dmin > 0)
00320                         SortMinUp(axis, emin);
00321
00322                 if (dmax < 0)
00323                         SortMaxDown(axis, emax);
00324         }
00325
00326         //PrintAxis(1);
00327 }
00328
00329 // sorting a min edge downwards can only ever *add* overlaps
00330 void AxisSweep3::SortMinDown(int axis, unsigned short edge, bool updateOverlaps)
00331 {
00332         Edge* pEdge = m_pEdges[axis] + edge;
00333         Edge* pPrev = pEdge - 1;
00334         Handle* pHandleEdge = GetHandle(pEdge->m_handle);
00335
00336         while (pEdge->m_pos < pPrev->m_pos)
00337         {
00338                 Handle* pHandlePrev = GetHandle(pPrev->m_handle);
00339
00340                 if (pPrev->IsMax())
00341                 {
00342                         // if previous edge is a maximum check the bounds and add an overlap if necessary
00343                         if (updateOverlaps && TestOverlap(axis,pHandleEdge, pHandlePrev))
00344                         {
00345                                 AddOverlappingPair(pHandleEdge,pHandlePrev);
00346
00347                                 //AddOverlap(pEdge->m_handle, pPrev->m_handle);
00348
00349                         }
00350
00351                         // update edge reference in other handle
00352                         pHandlePrev->m_maxEdges[axis]++;
00353                 }
00354                 else
00355                         pHandlePrev->m_minEdges[axis]++;
00356
00357                 pHandleEdge->m_minEdges[axis]--;
00358
00359                 // swap the edges
00360                 Edge swap = *pEdge;
00361                 *pEdge = *pPrev;
00362                 *pPrev = swap;
00363
00364                 // decrement
00365                 pEdge--;
00366                 pPrev--;
00367         }
00368 }
00369
00370 // sorting a min edge upwards can only ever *remove* overlaps
00371 void AxisSweep3::SortMinUp(int axis, unsigned short edge, bool updateOverlaps)
00372 {
00373         Edge* pEdge = m_pEdges[axis] + edge;
00374         Edge* pNext = pEdge + 1;
00375         Handle* pHandleEdge = GetHandle(pEdge->m_handle);
00376
00377         while (pEdge->m_pos > pNext->m_pos)
00378         {
00379                 Handle* pHandleNext = GetHandle(pNext->m_handle);
00380
00381                 if (pNext->IsMax())
00382                 {
00383                         // if next edge is maximum remove any overlap between the two handles
00384                         if (updateOverlaps)
00385                         {
00386                                 Handle* handle0 = GetHandle(pEdge->m_handle);
00387                                 Handle* handle1 = GetHandle(pNext->m_handle);
00388                                 BroadphasePair* pair = FindPair(handle0,handle1);
00389                                 //assert(pair);
00390                                 if (pair)
00391                                 {
00392                                         RemoveOverlappingPair(*pair);
00393                                 }
00394                         }
00395
00396                         // update edge reference in other handle
00397                         pHandleNext->m_maxEdges[axis]--;
00398                 }
00399                 else
00400                         pHandleNext->m_minEdges[axis]--;
00401
00402                 pHandleEdge->m_minEdges[axis]++;
00403
00404                 // swap the edges
00405                 Edge swap = *pEdge;
00406                 *pEdge = *pNext;
00407                 *pNext = swap;
00408
00409                 // increment
00410                 pEdge++;
00411                 pNext++;
00412         }
00413 }
00414
00415 // sorting a max edge downwards can only ever *remove* overlaps
00416 void AxisSweep3::SortMaxDown(int axis, unsigned short edge, bool updateOverlaps)
00417 {
00418         Edge* pEdge = m_pEdges[axis] + edge;
00419         Edge* pPrev = pEdge - 1;
00420         Handle* pHandleEdge = GetHandle(pEdge->m_handle);
00421
00422         while (pEdge->m_pos < pPrev->m_pos)
00423         {
00424                 Handle* pHandlePrev = GetHandle(pPrev->m_handle);
00425
00426                 if (!pPrev->IsMax())
00427                 {
00428                         // if previous edge was a minimum remove any overlap between the two handles
00429                         if (updateOverlaps)
00430                         {
00431                                 Handle* handle0 = GetHandle(pEdge->m_handle);
00432                                 Handle* handle1 = GetHandle(pPrev->m_handle);
00433                                 BroadphasePair* pair = FindPair(handle0,handle1);
00434                                 //assert(pair);
00435
00436                                 if (pair)
00437                                 {
00438                                         RemoveOverlappingPair(*pair);
00439                                 }
00440                         }
00441
00442                         // update edge reference in other handle
00443                         pHandlePrev->m_minEdges[axis]++;;
00444                 }
00445                 else
00446                         pHandlePrev->m_maxEdges[axis]++;
00447
00448                 pHandleEdge->m_maxEdges[axis]--;
00449
00450                 // swap the edges
00451                 Edge swap = *pEdge;
00452                 *pEdge = *pPrev;
00453                 *pPrev = swap;
00454
00455                 // decrement
00456                 pEdge--;
00457                 pPrev--;
00458         }
00459 }
00460
00461 // sorting a max edge upwards can only ever *add* overlaps
00462 void AxisSweep3::SortMaxUp(int axis, unsigned short edge, bool updateOverlaps)
00463 {
00464         Edge* pEdge = m_pEdges[axis] + edge;
00465         Edge* pNext = pEdge + 1;
00466         Handle* pHandleEdge = GetHandle(pEdge->m_handle);
00467
00468         while (pEdge->m_pos > pNext->m_pos)
00469         {
00470                 Handle* pHandleNext = GetHandle(pNext->m_handle);
00471
00472                 if (!pNext->IsMax())
00473                 {
00474                         // if next edge is a minimum check the bounds and add an overlap if necessary
00475                         if (updateOverlaps && TestOverlap(axis, pHandleEdge, pHandleNext))
00476                         {
00477                                 Handle* handle0 = GetHandle(pEdge->m_handle);
00478                                 Handle* handle1 = GetHandle(pNext->m_handle);
00479                                 AddOverlappingPair(handle0,handle1);
00480                         }
00481
00482                         // update edge reference in other handle
00483                         pHandleNext->m_minEdges[axis]--;
00484                 }
00485                 else
00486                         pHandleNext->m_maxEdges[axis]--;
00487
00488                 pHandleEdge->m_maxEdges[axis]++;
00489
00490                 // swap the edges
00491                 Edge swap = *pEdge;
00492                 *pEdge = *pNext;
00493                 *pNext = swap;
00494
00495                 // increment
00496                 pEdge++;
00497                 pNext++;
00498         }
00499 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3.h File Reference

Bullet » BroadphaseCollision

AxisSweep3.h File Reference

#include "SimdPoint3.h"
#include "SimdVector3.h"
#include "SimpleBroadphase.h"
#include "BroadphaseProxy.h"

Include dependency graph for AxisSweep3.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | AxisSweep3
AxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase. More...
class | AxisSweep3::Edge
class | AxisSweep3::Handle

Generated on Wed May 24 13:58:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3.h Source File

Bullet » BroadphaseCollision

AxisSweep3.h

Go to the documentation of this file.
00001 //Bullet Continuous Collision Detection and Physics Library
00002 //Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 //
00005 // AxisSweep3.h
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018
00019 #ifndef AXIS_SWEEP_3_H
00020 #define AXIS_SWEEP_3_H
00021
00022 #include "SimdPoint3.h"
00023 #include "SimdVector3.h"
00024 #include "SimpleBroadphase.h"
00025 #include "BroadphaseProxy.h"
00026
00030 class AxisSweep3 : public SimpleBroadphase
00031 {
00032
00033 public:
00034
00035
00036         class Edge
00037         {
00038         public:
00039                 unsigned short m_pos;                   // low bit is min/max
00040                 unsigned short m_handle;
00041
00042                 unsigned short IsMax() const {return m_pos & 1;}
00043         };
00044
00045 public:
00046         class Handle : public BroadphaseProxy
00047         {
00048         public:
00049
00050                 // indexes into the edge arrays
00051                 unsigned short m_minEdges[3], m_maxEdges[3];            // 6 * 2 = 12
00052                 unsigned short m_handleId;
00053                 unsigned short m_pad;
00054
00055                 //void* m_pOwner; this is now in BroadphaseProxy.m_clientObject
00056
00057                 inline void SetNextFree(unsigned short next) {m_minEdges[0] = next;}
00058                 inline unsigned short GetNextFree() const {return m_minEdges[0];}
00059         };              // 24 bytes + 24 for Edge structures = 44 bytes total per entry
00060
00061
00062 private:
00063         SimdPoint3 m_worldAabbMin;                                              // overall system bounds
00064         SimdPoint3 m_worldAabbMax;                                              // overall system bounds
00065
00066         SimdVector3 m_quantize;                                         // scaling factor for quantization
00067
00068         int m_numHandles;                                               // number of active handles
00069         int m_maxHandles;                                               // max number of handles
00070         Handle* m_pHandles;                                             // handles pool
00071         unsigned short m_firstFreeHandle;               // free handles list
00072
00073         Edge* m_pEdges[3];                                              // edge arrays for the 3 axes (each array has m_maxHandles * 2 + 2 sentinel entries)
00074
00075
00076         // allocation/deallocation
00077         unsigned short AllocHandle();
00078         void FreeHandle(unsigned short handle);
00079
00080
00081         bool TestOverlap(int ignoreAxis,const Handle* pHandleA, const Handle* pHandleB);
00082
00083         //Overlap* AddOverlap(unsigned short handleA, unsigned short handleB);
00084         //void RemoveOverlap(unsigned short handleA, unsigned short handleB);
00085
00086         void Quantize(unsigned short* out, const SimdPoint3& point, int isMax) const;
00087
00088         void SortMinDown(int axis, unsigned short edge, bool updateOverlaps = true);
00089         void SortMinUp(int axis, unsigned short edge, bool updateOverlaps = true);
00090         void SortMaxDown(int axis, unsigned short edge, bool updateOverlaps = true);
00091         void SortMaxUp(int axis, unsigned short edge, bool updateOverlaps = true);
00092
00093 public:
00094         AxisSweep3(const SimdPoint3& worldAabbMin,const SimdPoint3& worldAabbMax, int maxHandles = 1024, int maxOverlaps = 8192);
00095         virtual ~AxisSweep3();
00096
00097         virtual void    RefreshOverlappingPairs()
00098         {
00099                 //this is replace by sweep and prune
00100         }
00101
00102         unsigned short AddHandle(const SimdPoint3& aabbMin,const SimdPoint3& aabbMax, void* pOwner);
00103         void RemoveHandle(unsigned short handle);
00104         void UpdateHandle(unsigned short handle, const SimdPoint3& aabbMin,const SimdPoint3& aabbMax);
00105         inline Handle* GetHandle(unsigned short index) const {return m_pHandles + index;}
00106
00107
00108         //Broadphase Interface
00109         virtual BroadphaseProxy*        CreateProxy(  const SimdVector3& min,  const SimdVector3& max,int shapeType,void* userPtr );
00110         virtual void    DestroyProxy(BroadphaseProxy* proxy);
00111         virtual void    SetAabb(BroadphaseProxy* proxy,const SimdVector3& aabbMin,const SimdVector3& aabbMax);
00112
00113 };
00114
00115 #endif //AXIS_SWEEP_3_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BoxShape.cpp File Reference

Bullet » CollisionShapes

BoxShape.cpp File Reference

#include "BoxShape.h"

Include dependency graph for BoxShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BoxShape.cpp Source File

Bullet » CollisionShapes

BoxShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "BoxShape.h"
00017
00018 SimdVector3 BoxShape::GetHalfExtents() const
00019 {
00020         return m_boxHalfExtents1 * m_localScaling;
00021 }
00022 //{
00023
00024
00025 void BoxShape::GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
00026 {
00027         SimdVector3 halfExtents = GetHalfExtents();
00028
00029         SimdMatrix3x3 abs_b = t.getBasis().absolute();
00030         SimdPoint3 center = t.getOrigin();
00031         SimdVector3 extent = SimdVector3(abs_b[0].dot(halfExtents),
00032                    abs_b[1].dot(halfExtents),
00033                   abs_b[2].dot(halfExtents));
00034         extent += SimdVector3(GetMargin(),GetMargin(),GetMargin());
00035
00036         aabbMin = center - extent;
00037         aabbMax = center + extent;
00038
00039
00040 }
00041
00042
00043 void    BoxShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00044 {
00045         //float margin = 0.f;
00046         SimdVector3 halfExtents = GetHalfExtents();
00047
00048         SimdScalar lx=2.f*(halfExtents.x());
00049         SimdScalar ly=2.f*(halfExtents.y());
00050         SimdScalar lz=2.f*(halfExtents.z());
00051
00052         inertia[0] = mass/(12.0f) * (ly*ly + lz*lz);
00053         inertia[1] = mass/(12.0f) * (lx*lx + lz*lz);
00054         inertia[2] = mass/(12.0f) * (lx*lx + ly*ly);
00055
00056
00057 }
00058
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BoxShape.h File Reference

Bullet » CollisionShapes

BoxShape.h File Reference

#include "PolyhedralConvexShape.h"
#include "CollisionShapes/CollisionMargin.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "SimdPoint3.h"
#include "SimdMinMax.h"

Include dependency graph for BoxShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BoxShape
BoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box. More...

Generated on Wed May 24 13:58:42 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BoxShape.h Source File

Bullet » CollisionShapes

BoxShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef OBB_BOX_MINKOWSKI_H
00017 #define OBB_BOX_MINKOWSKI_H
00018
00019 #include "PolyhedralConvexShape.h"
00020 #include "CollisionShapes/CollisionMargin.h"
00021 #include "BroadphaseCollision/BroadphaseProxy.h"
00022 #include "SimdPoint3.h"
00023 #include "SimdMinMax.h"
00024
00026 class BoxShape: public PolyhedralConvexShape
00027 {
00028
00029         SimdVector3     m_boxHalfExtents1;
00030
00031
00032 public:
00033
00034         virtual ~BoxShape()
00035         {
00036
00037         }
00038
00039         SimdVector3 GetHalfExtents() const;
00040         //{ return m_boxHalfExtents1 * m_localScaling;}
00041         //const SimdVector3& GetHalfExtents() const{ return m_boxHalfExtents1;}
00042
00043
00044
00045         virtual int     GetShapeType() const { return BOX_SHAPE_PROXYTYPE;}
00046
00047         virtual SimdVector3     LocalGetSupportingVertex(const SimdVector3& vec) const
00048         {
00049
00050                 SimdVector3 halfExtents = GetHalfExtents();
00051                 SimdVector3 margin(GetMargin(),GetMargin(),GetMargin());
00052                 halfExtents -= margin;
00053
00054                 SimdVector3 supVertex;
00055                 supVertex = SimdPoint3(vec.x() < SimdScalar(0.0f) ? -halfExtents.x() : halfExtents.x(),
00056                      vec.y() < SimdScalar(0.0f) ? -halfExtents.y() : halfExtents.y(),
00057                      vec.z() < SimdScalar(0.0f) ? -halfExtents.z() : halfExtents.z());
00058
00059                 if ( GetMargin()!=0.f )
00060                 {
00061                         SimdVector3 vecnorm = vec;
00062                         if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
00063                         {
00064                                 vecnorm.setValue(-1.f,-1.f,-1.f);
00065                         }
00066                         vecnorm.normalize();
00067                         supVertex+= GetMargin() * vecnorm;
00068                 }
00069                 return supVertex;
00070         }
00071
00072         virtual inline SimdVector3      LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00073         {
00074                 SimdVector3 halfExtents = GetHalfExtents();
00075                 SimdVector3 margin(GetMargin(),GetMargin(),GetMargin());
00076                 halfExtents -= margin;
00077
00078                 return SimdVector3(vec.x() < SimdScalar(0.0f) ? -halfExtents.x() : halfExtents.x(),
00079                     vec.y() < SimdScalar(0.0f) ? -halfExtents.y() : halfExtents.y(),
00080                     vec.z() < SimdScalar(0.0f) ? -halfExtents.z() : halfExtents.z());
00081         }
00082
00083         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00084         {
00085                 SimdVector3 halfExtents = GetHalfExtents();
00086                 SimdVector3 margin(GetMargin(),GetMargin(),GetMargin());
00087                 halfExtents -= margin;
00088
00089
00090                 for (int i=0;i<numVectors;i++)
00091                 {
00092                         const SimdVector3& vec = vectors[i];
00093                         supportVerticesOut[i].setValue(vec.x() < SimdScalar(0.0f) ? -halfExtents.x() : halfExtents.x(),
00094                     vec.y() < SimdScalar(0.0f) ? -halfExtents.y() : halfExtents.y(),
00095                     vec.z() < SimdScalar(0.0f) ? -halfExtents.z() : halfExtents.z());
00096                 }
00097
00098         }
00099
00100
00101         BoxShape( const SimdVector3& boxHalfExtents) :  m_boxHalfExtents1(boxHalfExtents){};
00102
00103         virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
00104
00105
00106
00107         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00108
00109         virtual void GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i ) const
00110         {
00111                 //this plane might not be aligned...
00112                 SimdVector4 plane ;
00113                 GetPlaneEquation(plane,i);
00114                 planeNormal = SimdVector3(plane.getX(),plane.getY(),plane.getZ());
00115                 planeSupport = LocalGetSupportingVertex(-planeNormal);
00116         }
00117
00118
00119         virtual int GetNumPlanes() const
00120         {
00121                 return 6;
00122         }
00123
00124         virtual int     GetNumVertices() const
00125         {
00126                 return 8;
00127         }
00128
00129         virtual int GetNumEdges() const
00130         {
00131                 return 12;
00132         }
00133
00134
00135         virtual void GetVertex(int i,SimdVector3& vtx) const
00136         {
00137                 SimdVector3 halfExtents = GetHalfExtents();
00138
00139                 vtx = SimdVector3(
00140                                 halfExtents.x() * (1-(i&1)) - halfExtents.x() * (i&1),
00141                                 halfExtents.y() * (1-((i&2)>>1)) - halfExtents.y() * ((i&2)>>1),
00142                                 halfExtents.z() * (1-((i&4)>>2)) - halfExtents.z() * ((i&4)>>2));
00143         }
00144
00145
00146         virtual void    GetPlaneEquation(SimdVector4& plane,int i) const
00147         {
00148                 SimdVector3 halfExtents = GetHalfExtents();
00149
00150                 switch (i)
00151                 {
00152                 case 0:
00153                         plane.setValue(1.f,0.f,0.f);
00154                         plane[3] = -halfExtents.x();
00155                         break;
00156                 case 1:
00157                         plane.setValue(-1.f,0.f,0.f);
00158                         plane[3] = -halfExtents.x();
00159                         break;
00160                 case 2:
00161                         plane.setValue(0.f,1.f,0.f);
00162                         plane[3] = -halfExtents.y();
00163                         break;
00164                 case 3:
00165                         plane.setValue(0.f,-1.f,0.f);
00166                         plane[3] = -halfExtents.y();
00167                         break;
00168                 case 4:
00169                         plane.setValue(0.f,0.f,1.f);
00170                         plane[3] = -halfExtents.z();
00171                         break;
00172                 case 5:
00173                         plane.setValue(0.f,0.f,-1.f);
00174                         plane[3] = -halfExtents.z();
00175                         break;
00176                 default:
00177                         assert(0);
00178                 }
00179         }
00180
00181
00182         virtual void GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const
00183         //virtual void GetEdge(int i,Edge& edge) const
00184         {
00185                 int edgeVert0 = 0;
00186                 int edgeVert1 = 0;
00187
00188                 switch (i)
00189                 {
00190                 case 0:
00191                                 edgeVert0 = 0;
00192                                 edgeVert1 = 1;
00193                         break;
00194                 case 1:
00195                                 edgeVert0 = 0;
00196                                 edgeVert1 = 2;
00197                         break;
00198                 case 2:
00199                         edgeVert0 = 1;
00200                         edgeVert1 = 3;
00201
00202                         break;
00203                 case 3:
00204                         edgeVert0 = 2;
00205                         edgeVert1 = 3;
00206                         break;
00207                 case 4:
00208                         edgeVert0 = 0;
00209                         edgeVert1 = 4;
00210                         break;
00211                 case 5:
00212                         edgeVert0 = 1;
00213                         edgeVert1 = 5;
00214
00215                         break;
00216                 case 6:
00217                         edgeVert0 = 2;
00218                         edgeVert1 = 6;
00219                         break;
00220                 case 7:
00221                         edgeVert0 = 3;
00222                         edgeVert1 = 7;
00223                         break;
00224                 case 8:
00225                         edgeVert0 = 4;
00226                         edgeVert1 = 5;
00227                         break;
00228                 case 9:
00229                         edgeVert0 = 4;
00230                         edgeVert1 = 6;
00231                         break;
00232                 case 10:
00233                         edgeVert0 = 5;
00234                         edgeVert1 = 7;
00235                         break;
00236                 case 11:
00237                         edgeVert0 = 6;
00238                         edgeVert1 = 7;
00239                         break;
00240                 default:
00241                         ASSERT(0);
00242
00243                 }
00244
00245                 GetVertex(edgeVert0,pa );
00246                 GetVertex(edgeVert1,pb );
00247         }
00248
00249
00250
00251
00252
00253         virtual bool IsInside(const SimdPoint3& pt,SimdScalar tolerance) const
00254         {
00255                 SimdVector3 halfExtents = GetHalfExtents();
00256
00257                 //SimdScalar minDist = 2*tolerance;
00258
00259                 bool result =   (pt.x() <= (halfExtents.x()+tolerance)) &&
00260                                                 (pt.x() >= (-halfExtents.x()-tolerance)) &&
00261                                                 (pt.y() <= (halfExtents.y()+tolerance)) &&
00262                                                 (pt.y() >= (-halfExtents.y()-tolerance)) &&
00263                                                 (pt.z() <= (halfExtents.z()+tolerance)) &&
00264                                                 (pt.z() >= (-halfExtents.z()-tolerance));
00265
00266                 return result;
00267         }
00268
00269
00270         //debugging
00271         virtual char*   GetName()const
00272         {
00273                 return "Box";
00274         }
00275
00276
00277 };
00278
00279 #endif //OBB_BOX_MINKOWSKI_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseInterface.h File Reference

Bullet » BroadphaseCollision

BroadphaseInterface.h File Reference

#include "SimdVector3.h"

Include dependency graph for BroadphaseInterface.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BroadphaseInterface
BroadphaseInterface for aabb-overlapping object pairs. More...

Generated on Wed May 24 13:58:42 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseInterface.h Source File

Bullet » BroadphaseCollision

BroadphaseInterface.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef         BROADPHASE_INTERFACE_H
00017 #define         BROADPHASE_INTERFACE_H
00018
00019
00020
00021 struct DispatcherInfo;
00022 class Dispatcher;
00023 struct BroadphaseProxy;
00024 #include "SimdVector3.h"
00025
00027 class BroadphaseInterface
00028 {
00029 public:
00030         virtual ~BroadphaseInterface() {}
00031
00032         virtual BroadphaseProxy*        CreateProxy(  const SimdVector3& min,  const SimdVector3& max,int shapeType,void* userPtr ) =0;
00033         virtual void    DestroyProxy(BroadphaseProxy* proxy)=0;
00034         virtual void    SetAabb(BroadphaseProxy* proxy,const SimdVector3& aabbMin,const SimdVector3& aabbMax)=0;
00035         virtual void    CleanProxyFromPairs(BroadphaseProxy* proxy)=0;
00036         virtual void    DispatchAllCollisionPairs(Dispatcher&   dispatcher,DispatcherInfo& dispatchInfo)=0;
00037
00038 };
00039
00040 #endif //BROADPHASE_INTERFACE_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseProxy.cpp File Reference

Bullet » BroadphaseCollision

BroadphaseProxy.cpp File Reference

#include "BroadphaseProxy.h"

Include dependency graph for BroadphaseProxy.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:42 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseProxy.cpp Source File

Bullet » BroadphaseCollision

BroadphaseProxy.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "BroadphaseProxy.h"
00017
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseProxy.h File Reference

Bullet » BroadphaseCollision

BroadphaseProxy.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | BroadphaseProxy
BroadphaseProxy. More...
struct | BroadphasePair
contains a pair of aabb-overlapping objects More...

Defines

#define | SIMPLE_MAX_ALGORITHMS 2

Enumerations

enum BroadphaseNativeTypes {
BOX_SHAPE_PROXYTYPE,
TRIANGLE_SHAPE_PROXYTYPE,
TETRAHEDRAL_SHAPE_PROXYTYPE,
CONVEX_HULL_SHAPE_PROXYTYPE,
IMPLICIT_CONVEX_SHAPES_START_HERE,
SPHERE_SHAPE_PROXYTYPE,
MULTI_SPHERE_SHAPE_PROXYTYPE,
CONE_SHAPE_PROXYTYPE,
CONVEX_SHAPE_PROXYTYPE,
CYLINDER_SHAPE_PROXYTYPE,
MINKOWSKI_SUM_SHAPE_PROXYTYPE,
MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
CONCAVE_SHAPES_START_HERE,
TRIANGLE_MESH_SHAPE_PROXYTYPE,
EMPTY_SHAPE_PROXYTYPE,
MAX_BROADPHASE_COLLISION_TYPES
}
Dispatcher uses these types IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave to facilitate type checking. More...

Define Documentation

#define SIMPLE_MAX_ALGORITHMS 2

Definition at line 71 of file BroadphaseProxy.h.

Referenced by SimpleBroadphase::AddOverlappingPair(), BroadphasePair::BroadphasePair(), and SimpleBroadphase::CleanOverlappingPair().

Enumeration Type Documentation

enum BroadphaseNativeTypes

Dispatcher uses these types IMPORTANT NOTE:The types are ordered polyhedral, implicit convex and concave to facilitate type checking.

Enumerator:
BOX_SHAPE_PROXYTYPE
TRIANGLE_SHAPE_PROXYTYPE
TETRAHEDRAL_SHAPE_PROXYTYPE
CONVEX_HULL_SHAPE_PROXYTYPE
IMPLICIT_CONVEX_SHAPES_START_HERE
SPHERE_SHAPE_PROXYTYPE
MULTI_SPHERE_SHAPE_PROXYTYPE
CONE_SHAPE_PROXYTYPE
CONVEX_SHAPE_PROXYTYPE
CYLINDER_SHAPE_PROXYTYPE
MINKOWSKI_SUM_SHAPE_PROXYTYPE
MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE
CONCAVE_SHAPES_START_HERE
TRIANGLE_MESH_SHAPE_PROXYTYPE
EMPTY_SHAPE_PROXYTYPE
MAX_BROADPHASE_COLLISION_TYPES

Definition at line 24 of file BroadphaseProxy.h.

Generated on Wed May 24 13:58:43 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseProxy.h Source File

Bullet » BroadphaseCollision

BroadphaseProxy.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef BROADPHASE_PROXY_H
00017 #define BROADPHASE_PROXY_H
00018
00019
00020
00024 enum BroadphaseNativeTypes
00025 {
00026 // polyhedral convex shapes
00027         BOX_SHAPE_PROXYTYPE,
00028         TRIANGLE_SHAPE_PROXYTYPE,
00029         TETRAHEDRAL_SHAPE_PROXYTYPE,
00030         CONVEX_HULL_SHAPE_PROXYTYPE,
00031 //implicit convex shapes
00032 IMPLICIT_CONVEX_SHAPES_START_HERE,
00033         SPHERE_SHAPE_PROXYTYPE,
00034         MULTI_SPHERE_SHAPE_PROXYTYPE,
00035         CONE_SHAPE_PROXYTYPE,
00036         CONVEX_SHAPE_PROXYTYPE,
00037         CYLINDER_SHAPE_PROXYTYPE,
00038         MINKOWSKI_SUM_SHAPE_PROXYTYPE,
00039         MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE,
00040 //concave shapes
00041 CONCAVE_SHAPES_START_HERE,
00042         //keep all the convex shapetype below here, for the check IsConvexShape in broadphase proxy!
00043         TRIANGLE_MESH_SHAPE_PROXYTYPE,
00044         EMPTY_SHAPE_PROXYTYPE,
00045
00046         MAX_BROADPHASE_COLLISION_TYPES
00047 };
00048
00049
00051 struct BroadphaseProxy
00052 {
00053
00054         //Usually the client CollisionObject or Rigidbody class
00055         void*   m_clientObject;
00056
00057
00058         BroadphaseProxy() :m_clientObject(0){}
00059         BroadphaseProxy(int shapeType,void* userPtr)
00060                 :m_clientObject(userPtr)
00061                 //m_clientObjectType(shapeType)
00062         {
00063         }
00064
00065 };
00066
00067 class CollisionAlgorithm;
00068
00069 struct BroadphaseProxy;
00070
00071 #define SIMPLE_MAX_ALGORITHMS 2
00072
00074 struct BroadphasePair
00075 {
00076         BroadphasePair ()
00077                 :
00078         m_pProxy0(0),
00079                 m_pProxy1(0)
00080         {
00081                 for (int i=0;i<SIMPLE_MAX_ALGORITHMS;i++)
00082                 {
00083                         m_algorithms[i] = 0;
00084                 }
00085         }
00086
00087         BroadphasePair(const BroadphasePair& other)
00088                 :               m_pProxy0(other.m_pProxy0),
00089                                 m_pProxy1(other.m_pProxy1)
00090         {
00091                 for (int i=0;i<SIMPLE_MAX_ALGORITHMS;i++)
00092                 {
00093                         m_algorithms[i] = other.m_algorithms[i];
00094                 }
00095         }
00096         BroadphasePair(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1)
00097                 :
00098                 m_pProxy0(&proxy0),
00099                 m_pProxy1(&proxy1)
00100         {
00101                 for (int i=0;i<SIMPLE_MAX_ALGORITHMS;i++)
00102         {
00103                         m_algorithms[i] = 0;
00104                 }
00105
00106         }
00107
00108
00109         BroadphaseProxy* m_pProxy0;
00110         BroadphaseProxy* m_pProxy1;
00111
00112         mutable CollisionAlgorithm* m_algorithms[SIMPLE_MAX_ALGORITHMS];
00113 };
00114
00115 #endif //BROADPHASE_PROXY_H
00116
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_AlgebraicPolynomialSolver.cpp File Reference

Bullet » NarrowPhaseCollision

BU_AlgebraicPolynomialSolver.cpp File Reference

#include "BU_AlgebraicPolynomialSolver.h"
#include <math.h>
#include <SimdMinMax.h>

Include dependency graph for BU_AlgebraicPolynomialSolver.cpp:

Go to the source code of this file.

Defines

#define cubic_rt(x)

Define Documentation

#define cubic_rt ( x )

Value:

((x) > 0.0f ? SimdPow((SimdScalar)(x), 0.333333333333333333333333f) : \
  ((x) < 0.0f ? -SimdPow((SimdScalar)-(x), 0.333333333333333333333333f) : 0.0f))

Definition at line 60 of file BU_AlgebraicPolynomialSolver.cpp.

Referenced by BU_AlgebraicPolynomialSolver::Solve3Cubic().

Generated on Wed May 24 13:58:43 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_AlgebraicPolynomialSolver.cpp Source File

Bullet » NarrowPhaseCollision

BU_AlgebraicPolynomialSolver.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "BU_AlgebraicPolynomialSolver.h"
00018 #include <math.h>
00019 #include <SimdMinMax.h>
00020
00021 int BU_AlgebraicPolynomialSolver::Solve2Quadratic(SimdScalar p, SimdScalar q)
00022 {
00023
00024         SimdScalar basic_h_local;
00025         SimdScalar basic_h_local_delta;
00026
00027         basic_h_local       = p * 0.5f;
00028    basic_h_local_delta = basic_h_local * basic_h_local - q;
00029    if (basic_h_local_delta > 0.0f)  {
00030       basic_h_local_delta = SimdSqrt(basic_h_local_delta);
00031       m_roots[0]  = - basic_h_local + basic_h_local_delta;
00032       m_roots[1]  = - basic_h_local - basic_h_local_delta;
00033       return 2;
00034    }
00035    else if (SimdGreaterEqual(basic_h_local_delta, SIMD_EPSILON)) {
00036       m_roots[0]  = - basic_h_local;
00037       return 1;
00038    }
00039    else {
00040       return 0;
00041    }
00042  }
00043
00044
00045 int BU_AlgebraicPolynomialSolver::Solve2QuadraticFull(SimdScalar a,SimdScalar b, SimdScalar c)
00046 {
00047     SimdScalar radical = b * b - 4.0f * a * c;
00048     if(radical >= 0.f)
00049     {
00050         SimdScalar sqrtRadical = SimdSqrt(radical);
00051         SimdScalar idenom = 1.0f/(2.0f * a);
00052         m_roots[0]=(-b + sqrtRadical) * idenom;
00053         m_roots[1]=(-b - sqrtRadical) * idenom;
00054                 return 2;
00055         }
00056         return 0;
00057 }
00058
00059
00060 #define cubic_rt(x) \
00061  ((x) > 0.0f ? SimdPow((SimdScalar)(x), 0.333333333333333333333333f) : \
00062   ((x) < 0.0f ? -SimdPow((SimdScalar)-(x), 0.333333333333333333333333f) : 0.0f))
00063
00064
00065
00066 /*                                                                           */
00067 /* this function solves the following cubic equation:                        */
00068 /*                                                                           */
00069 /*              3          2                                                */
00070 /*      lead * x   +  a * x   +  b * x  +  c  =  0.                          */
00071 /*                                                                           */
00072 /* it returns the number of different roots found, and stores the roots in   */
00073 /* roots[0,2]. it returns -1 for a degenerate equation 0 = 0.                */
00074 /*                                                                           */
00075 int BU_AlgebraicPolynomialSolver::Solve3Cubic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c)
00076 {
00077    SimdScalar p, q, r;
00078    SimdScalar delta, u, phi;
00079    SimdScalar dummy;
00080
00081    if (lead != 1.0) {
00082       /*                                                                     */
00083       /* transform into normal form: x^3 + a x^2 + b x + c = 0               */
00084       /*                                                                     */
00085       if (SimdEqual(lead, SIMD_EPSILON)) {
00086          /*                                                                  */
00087          /* we have  a x^2 + b x + c = 0                                     */
00088          /*                                                                  */
00089          if (SimdEqual(a, SIMD_EPSILON)) {
00090             /*                                                               */
00091             /* we have  b x + c = 0                                          */
00092             /*                                                               */
00093             if (SimdEqual(b, SIMD_EPSILON)) {
00094                if (SimdEqual(c, SIMD_EPSILON)) {
00095                   return -1;
00096                }
00097                else {
00098                   return 0;
00099                }
00100             }
00101             else {
00102                m_roots[0] = -c / b;
00103                return 1;
00104             }
00105          }
00106          else {
00107             p = c / a;
00108             q = b / a;
00109             return Solve2QuadraticFull(a,b,c);
00110          }
00111       }
00112       else {
00113          a = a / lead;
00114          b = b / lead;
00115          c = c / lead;
00116       }
00117    }
00118
00119    /*                                                                        */
00120    /* we substitute  x = y - a / 3  in order to eliminate the quadric term.  */
00121    /* we get   x^3 + p x + q = 0                                             */
00122    /*                                                                        */
00123    a /= 3.0f;
00124    u  = a * a;
00125    p  = b / 3.0f - u;
00126    q  = a * (2.0f * u - b) + c;
00127
00128    /*                                                                        */
00129    /* now use Cardano's formula                                              */
00130    /*                                                                        */
00131    if (SimdEqual(p, SIMD_EPSILON)) {
00132       if (SimdEqual(q, SIMD_EPSILON)) {
00133          /*                                                                  */
00134          /* one triple root                                                  */
00135          /*                                                                  */
00136          m_roots[0] = -a;
00137          return 1;
00138       }
00139       else {
00140          /*                                                                  */
00141          /* one real and two complex roots                                   */
00142          /*                                                                  */
00143          m_roots[0] = cubic_rt(-q) - a;
00144          return 1;
00145       }
00146    }
00147
00148    q /= 2.0f;
00149    delta = p * p * p + q * q;
00150    if (delta > 0.0f) {
00151       /*                                                                     */
00152       /* one real and two complex roots. note that  v = -p / u.              */
00153       /*                                                                     */
00154       u = -q + SimdSqrt(delta);
00155       u = cubic_rt(u);
00156       m_roots[0] = u - p / u - a;
00157       return 1;
00158    }
00159    else if (delta < 0.0) {
00160       /*                                                                     */
00161       /* Casus irreducibilis: we have three real roots                       */
00162       /*                                                                     */
00163       r        = SimdSqrt(-p);
00164       p       *= -r;
00165       r       *= 2.0;
00166       phi      = SimdAcos(-q / p) / 3.0f;
00167       dummy    = SIMD_2_PI / 3.0f;
00168       m_roots[0] = r * SimdCos(phi) - a;
00169       m_roots[1] = r * SimdCos(phi + dummy) - a;
00170       m_roots[2] = r * SimdCos(phi - dummy) - a;
00171       return 3;
00172    }
00173    else {
00174       /*                                                                     */
00175       /* one single and one SimdScalar root                                      */
00176       /*                                                                     */
00177       r = cubic_rt(-q);
00178       m_roots[0] = 2.0f * r - a;
00179       m_roots[1] = -r - a;
00180       return 2;
00181    }
00182 }
00183
00184
00185 /*                                                                           */
00186 /* this function solves the following quartic equation:                      */
00187 /*                                                                           */
00188 /*             4           3          2                                      */
00189 /*     lead * x   +  a *  x   +  b * x   +  c * x  +  d = 0.                 */
00190 /*                                                                           */
00191 /* it returns the number of different roots found, and stores the roots in   */
00192 /* roots[0,3]. it returns -1 for a degenerate equation 0 = 0.                */
00193 /*                                                                           */
00194 int BU_AlgebraicPolynomialSolver::Solve4Quartic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d)
00195 {
00196    SimdScalar p, q ,r;
00197    SimdScalar u, v, w;
00198    int i, num_roots, num_tmp;
00199    //SimdScalar tmp[2];
00200
00201    if (lead != 1.0) {
00202       /*                                                                     */
00203       /* transform into normal form: x^4 + a x^3 + b x^2 + c x + d = 0       */
00204       /*                                                                     */
00205       if (SimdEqual(lead, SIMD_EPSILON)) {
00206          /*                                                                  */
00207          /* we have  a x^3 + b x^2 + c x + d = 0                             */
00208          /*                                                                  */
00209          if (SimdEqual(a, SIMD_EPSILON)) {
00210             /*                                                               */
00211             /* we have  b x^2 + c x + d = 0                                  */
00212             /*                                                               */
00213             if (SimdEqual(b, SIMD_EPSILON)) {
00214                /*                                                            */
00215                /* we have  c x + d = 0                                       */
00216                /*                                                            */
00217                if (SimdEqual(c, SIMD_EPSILON)) {
00218                   if (SimdEqual(d, SIMD_EPSILON)) {
00219                      return -1;
00220                   }
00221                   else {
00222                      return 0;
00223                   }
00224                }
00225                else {
00226                   m_roots[0] = -d / c;
00227                   return 1;
00228                }
00229             }
00230             else {
00231                p = c / b;
00232                q = d / b;
00233                return Solve2QuadraticFull(b,c,d);
00234
00235             }
00236          }
00237          else {
00238             return Solve3Cubic(1.0, b / a, c / a, d / a);
00239          }
00240       }
00241       else {
00242          a = a / lead;
00243          b = b / lead;
00244          c = c / lead;
00245          d = d / lead;
00246       }
00247    }
00248
00249    /*                                                                        */
00250    /* we substitute  x = y - a / 4  in order to eliminate the cubic term.    */
00251    /* we get:  y^4 + p y^2 + q y + r = 0.                                    */
00252    /*                                                                        */
00253    a /= 4.0f;
00254    p  = b - 6.0f * a * a;
00255    q  = a * (8.0f * a * a - 2.0f * b) + c;
00256    r  = a * (a * (b - 3.f * a * a) - c) + d;
00257    if (SimdEqual(q, SIMD_EPSILON)) {
00258       /*                                                                     */
00259       /* biquadratic equation:  y^4 + p y^2 + r = 0.                         */
00260       /*                                                                     */
00261       num_roots = Solve2Quadratic(p, r);
00262       if (num_roots > 0) {
00263          if (m_roots[0] > 0.0f) {
00264             if (num_roots > 1)  {
00265                if ((m_roots[1] > 0.0f)  &&  (m_roots[1] != m_roots[0])) {
00266                   u        = SimdSqrt(m_roots[1]);
00267                   m_roots[2] =  u - a;
00268                   m_roots[3] = -u - a;
00269                   u        = SimdSqrt(m_roots[0]);
00270                   m_roots[0] =  u - a;
00271                   m_roots[1] = -u - a;
00272                   return 4;
00273                }
00274                else {
00275                   u        = SimdSqrt(m_roots[0]);
00276                   m_roots[0] =  u - a;
00277                   m_roots[1] = -u - a;
00278                   return 2;
00279                }
00280             }
00281             else {
00282                u        = SimdSqrt(m_roots[0]);
00283                m_roots[0] =  u - a;
00284                m_roots[1] = -u - a;
00285                return 2;
00286             }
00287          }
00288       }
00289       return 0;
00290    }
00291    else if (SimdEqual(r, SIMD_EPSILON)) {
00292       /*                                                                     */
00293       /* no absolute term:  y (y^3 + p y + q) = 0.                           */
00294       /*                                                                     */
00295       num_roots = Solve3Cubic(1.0, 0.0, p, q);
00296       for (i = 0;  i < num_roots;  ++i)  m_roots[i] -= a;
00297       if (num_roots != -1) {
00298          m_roots[num_roots] = -a;
00299          ++num_roots;
00300       }
00301       else {
00302          m_roots[0]  = -a;
00303          num_roots = 1;;
00304       }
00305       return num_roots;
00306    }
00307    else {
00308       /*                                                                     */
00309       /* we solve the resolvent cubic equation                               */
00310       /*                                                                     */
00311       num_roots = Solve3Cubic(1.0f, -0.5f * p, -r, 0.5f * r * p - 0.125f * q * q);
00312       if (num_roots == -1) {
00313          num_roots = 1;
00314          m_roots[0]  = 0.0f;
00315       }
00316
00317       /*                                                                     */
00318       /* build two quadric equations                                         */
00319       /*                                                                     */
00320       w = m_roots[0];
00321       u = w * w - r;
00322       v = 2.0f * w - p;
00323
00324       if (SimdEqual(u, SIMD_EPSILON))
00325          u = 0.0;
00326       else if (u > 0.0f)
00327          u = SimdSqrt(u);
00328       else
00329          return 0;
00330
00331       if (SimdEqual(v, SIMD_EPSILON))
00332          v = 0.0;
00333       else if (v > 0.0f)
00334          v = SimdSqrt(v);
00335       else
00336          return 0;
00337
00338       if (q < 0.0f)  v = -v;
00339       w -= u;
00340       num_roots=Solve2Quadratic(v, w);
00341       for (i = 0;  i < num_roots;  ++i)
00342           {
00343                   m_roots[i] -= a;
00344           }
00345       w += 2.0f *u;
00346           SimdScalar tmp[2];
00347           tmp[0] = m_roots[0];
00348           tmp[1] = m_roots[1];
00349
00350       num_tmp = Solve2Quadratic(-v, w);
00351       for (i = 0;  i < num_tmp;  ++i)
00352           {
00353                  m_roots[i + num_roots] = tmp[i] - a;
00354                  m_roots[i]=tmp[i];
00355           }
00356
00357       return  (num_tmp + num_roots);
00358    }
00359 }
00360
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_AlgebraicPolynomialSolver.h File Reference

Bullet » NarrowPhaseCollision

BU_AlgebraicPolynomialSolver.h File Reference

#include "BU_PolynomialSolverInterface.h"

Include dependency graph for BU_AlgebraicPolynomialSolver.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_AlgebraicPolynomialSolver
BU_AlgebraicPolynomialSolver implements polynomial root finding by analytically solving algebraic equations. More...

Generated on Wed May 24 13:58:44 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_AlgebraicPolynomialSolver.h Source File

Bullet » NarrowPhaseCollision

BU_AlgebraicPolynomialSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BU_ALGEBRAIC_POLYNOMIAL_SOLVER_H
00018 #define BU_ALGEBRAIC_POLYNOMIAL_SOLVER_H
00019
00020 #include "BU_PolynomialSolverInterface.h"
00021
00024 class BU_AlgebraicPolynomialSolver : public BUM_PolynomialSolverInterface
00025 {
00026 public:
00027         BU_AlgebraicPolynomialSolver() {};
00028
00029         int Solve2Quadratic(SimdScalar p, SimdScalar q);
00030         int Solve2QuadraticFull(SimdScalar a,SimdScalar b, SimdScalar c);
00031         int     Solve3Cubic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c);
00032         int Solve4Quartic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d);
00033
00034
00035         SimdScalar GetRoot(int i) const
00036         {
00037                 return m_roots[i];
00038         }
00039
00040 private:
00041         SimdScalar      m_roots[4];
00042
00043 };
00044
00045 #endif //BU_ALGEBRAIC_POLYNOMIAL_SOLVER_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Collidable.cpp File Reference

Bullet » NarrowPhaseCollision

BU_Collidable.cpp File Reference

#include "BU_Collidable.h"
#include "CollisionShapes/CollisionShape.h"
#include <SimdTransform.h>
#include "BU_MotionStateInterface.h"

Include dependency graph for BU_Collidable.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:44 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Collidable.cpp Source File

Bullet » NarrowPhaseCollision

BU_Collidable.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "BU_Collidable.h"
00018 #include "CollisionShapes/CollisionShape.h"
00019 #include <SimdTransform.h>
00020 #include "BU_MotionStateInterface.h"
00021
00022 BU_Collidable::BU_Collidable(BU_MotionStateInterface& motion,PolyhedralConvexShape& shape,void* userPointer )
00023 :m_motionState(motion),m_shape(shape),m_userPointer(userPointer)
00024 {
00025 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Collidable.h File Reference

Bullet » NarrowPhaseCollision

BU_Collidable.h File Reference

#include <SimdPoint3.h>

Include dependency graph for BU_Collidable.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_Collidable

Generated on Wed May 24 13:58:44 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Collidable.h Source File

Bullet » NarrowPhaseCollision

BU_Collidable.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BU_COLLIDABLE
00018 #define BU_COLLIDABLE
00019
00020
00021 class PolyhedralConvexShape;
00022 class BU_MotionStateInterface;
00023 #include <SimdPoint3.h>
00024
00025 class BU_Collidable
00026 {
00027 public:
00028         BU_Collidable(BU_MotionStateInterface& motion,PolyhedralConvexShape& shape, void* userPointer);
00029
00030         void*           GetUserPointer() const
00031         {
00032                 return m_userPointer;
00033         }
00034
00035         BU_MotionStateInterface&        GetMotionState()
00036         {
00037                 return m_motionState;
00038         }
00039         inline const BU_MotionStateInterface&   GetMotionState() const
00040         {
00041                 return m_motionState;
00042         }
00043
00044         inline const PolyhedralConvexShape&     GetShape() const
00045         {
00046                 return m_shape;
00047         };
00048
00049
00050 private:
00051         BU_MotionStateInterface& m_motionState;
00052         PolyhedralConvexShape&  m_shape;
00053         void*           m_userPointer;
00054
00055 };
00056
00057 #endif //BU_COLLIDABLE
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_CollisionPair.cpp File Reference

Bullet » NarrowPhaseCollision

BU_CollisionPair.cpp File Reference

#include "BU_CollisionPair.h"
#include "NarrowPhaseCollision/BU_VertexPoly.h"
#include "NarrowPhaseCollision/BU_EdgeEdge.h"
#include "BU_Collidable.h"
#include "BU_MotionStateInterface.h"
#include "CollisionShapes/PolyhedralConvexShape.h"
#include <SimdMinMax.h>
#include "SimdTransformUtil.h"

Include dependency graph for BU_CollisionPair.cpp:

Go to the source code of this file.

Defines

#define | EDGEEDGE
#define | VERTEXFACE

Define Documentation

#define EDGEEDGE

#define VERTEXFACE

Generated on Wed May 24 13:58:45 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_CollisionPair.cpp Source File

Bullet » NarrowPhaseCollision

BU_CollisionPair.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #include "BU_CollisionPair.h"
00019 #include "NarrowPhaseCollision/BU_VertexPoly.h"
00020 #include "NarrowPhaseCollision/BU_EdgeEdge.h"
00021 #include "BU_Collidable.h"
00022
00023
00024 #include "BU_MotionStateInterface.h"
00025 #include "CollisionShapes/PolyhedralConvexShape.h"
00026 #include <SimdMinMax.h>
00027 #include "SimdTransformUtil.h"
00028
00029
00030
00031 BU_CollisionPair::BU_CollisionPair(const PolyhedralConvexShape* convexA,const PolyhedralConvexShape* convexB,SimdScalar tolerance)
00032 : m_convexA(convexA),m_convexB(convexB),m_screwing(SimdVector3(0,0,0),SimdVector3(0,0,0)),
00033 m_tolerance(tolerance)
00034 {
00035
00036 }
00037
00038 // if there exists a time-of-impact between any feature_pair (edgeA,edgeB),
00039 // (vertexA,faceB) or (vertexB,faceA) in [0..1], report true and smallest time
00040
00041
00042 /*
00043 bool BU_CollisionPair::GetTimeOfImpact(const SimdVector3& linearMotionA,const SimdQuaternion& angularMotionA,const SimdVector3& linearMotionB,const SimdQuaternion& angularMotionB, SimdScalar& toi,SimdTransform& impactTransA,SimdTransform& impactTransB)
00044
00045 */
00046
00047 bool BU_CollisionPair::calcTimeOfImpact(
00048                                         const SimdTransform& fromA,
00049                                         const SimdTransform& toA,
00050                                         const SimdTransform& fromB,
00051                                         const SimdTransform& toB,
00052                                         CastResult& result)
00053 {
00054
00055
00056
00057
00058         SimdVector3 linvelA,angvelA;
00059         SimdVector3 linvelB,angvelB;
00060
00061         SimdTransformUtil::CalculateVelocity(fromA,toA,1.f,linvelA,angvelA);
00062         SimdTransformUtil::CalculateVelocity(fromB,toB,1.f,linvelB,angvelB);
00063
00064
00065         SimdVector3 linearMotionA = toA.getOrigin() - fromA.getOrigin();
00066         SimdQuaternion angularMotionA(0,0,0,1.f);
00067         SimdVector3 linearMotionB = toB.getOrigin() - fromB.getOrigin();
00068         SimdQuaternion angularMotionB(0,0,0,1);
00069
00070
00071
00072         result.m_fraction = 1.f;
00073
00074         SimdTransform impactTransA;
00075         SimdTransform impactTransB;
00076
00077         int index=0;
00078
00079         SimdScalar toiUnscaled=result.m_fraction;
00080         const SimdScalar toiUnscaledLimit = result.m_fraction;
00081
00082         SimdTransform a2w;
00083         a2w = fromA;
00084         SimdTransform b2w = fromB;
00085
00086 /* debugging code
00087         {
00088                 const int numvertsB = m_convexB->GetNumVertices();
00089                 for (int v=0;v<numvertsB;v++)
00090                 {
00091                         SimdPoint3 pt;
00092                         m_convexB->GetVertex(v,pt);
00093                         pt = b2w * pt;
00094                         char buf[1000];
00095
00096                         if (pt.y() < 0.)
00097                         {
00098                                 sprintf(buf,"PRE ERROR (%d) %.20E %.20E %.20E!!!!!!!!!\n",v,pt.x(),pt.y(),pt.z());
00099                                 if (debugFile)
00100                                         fwrite(buf,1,strlen(buf),debugFile);
00101                         } else
00102                         {
00103                                 sprintf(buf,"PRE %d = %.20E,%.20E,%.20E\n",v,pt.x(),pt.y(),pt.z());
00104                                 if (debugFile)
00105                                         fwrite(buf,1,strlen(buf),debugFile);
00106
00107                         }
00108                 }
00109         }
00110 */
00111
00112
00113         SimdTransform b2wp = b2w;
00114
00115         b2wp.setOrigin(b2w.getOrigin() + linearMotionB);
00116         b2wp.setRotation( b2w.getRotation() + angularMotionB);
00117
00118         impactTransB = b2wp;
00119
00120         SimdTransform a2wp;
00121         a2wp.setOrigin(a2w.getOrigin()+ linearMotionA);
00122         a2wp.setRotation(a2w.getRotation()+angularMotionA);
00123
00124         impactTransA = a2wp;
00125
00126         SimdTransform a2winv;
00127         a2winv = a2w.inverse();
00128
00129         SimdTransform b2wpinv;
00130         b2wpinv = b2wp.inverse();
00131
00132         SimdTransform b2winv;
00133         b2winv = b2w.inverse();
00134
00135         SimdTransform a2wpinv;
00136         a2wpinv = a2wp.inverse();
00137
00138                 //Redon's version with concatenated transforms
00139
00140         SimdTransform relative;
00141
00142         relative = b2w * b2wpinv * a2wp * a2winv;
00143
00144         //relative = a2winv * a2wp  * b2wpinv * b2w;
00145
00146         SimdQuaternion qrel;
00147         relative.getBasis().getRotation(qrel);
00148
00149         SimdVector3 linvel = relative.getOrigin();
00150
00151         if (linvel.length() < SCREWEPSILON)
00152         {
00153                 linvel.setValue(0.,0.,0.);
00154         }
00155         SimdVector3 angvel;
00156         angvel[0] = 2.f * SimdAsin (qrel[0]);
00157         angvel[1] = 2.f * SimdAsin (qrel[1]);
00158         angvel[2] = 2.f * SimdAsin (qrel[2]);
00159
00160         if (angvel.length() < SCREWEPSILON)
00161         {
00162                 angvel.setValue(0.f,0.f,0.f);
00163         }
00164
00165         //Redon's version with concatenated transforms
00166         m_screwing = BU_Screwing(linvel,angvel);
00167
00168         SimdTransform w2s;
00169         m_screwing.LocalMatrix(w2s);
00170
00171         SimdTransform s2w;
00172         s2w = w2s.inverse();
00173
00174         //impactTransA = a2w;
00175         //impactTransB = b2w;
00176
00177         bool hit = false;
00178
00179         if (SimdFuzzyZero(m_screwing.GetS()) && SimdFuzzyZero(m_screwing.GetW()))
00180         {
00181                 //W = 0 , S = 0 , no collision
00182                 //toi = 0;
00183         /*
00184                 {
00185                         const int numvertsB = m_convexB->GetNumVertices();
00186                         for (int v=0;v<numvertsB;v++)
00187                         {
00188                                 SimdPoint3 pt;
00189                                 m_convexB->GetVertex(v,pt);
00190                                 pt = impactTransB * pt;
00191                                 char buf[1000];
00192
00193                                 if (pt.y() < 0.)
00194                                 {
00195                                         sprintf(buf,"EARLY POST ERROR (%d) %.20E,%.20E,%.20E!!!!!!!!!\n",v,pt.x(),pt.y(),pt.z());
00196                                         if (debugFile)
00197                                                 fwrite(buf,1,strlen(buf),debugFile);
00198                                 }
00199                                 else
00200                                 {
00201                                         sprintf(buf,"EARLY POST %d = %.20E,%.20E,%.20E\n",v,pt.x(),pt.y(),pt.z());
00202                                         if (debugFile)
00203                                                 fwrite(buf,1,strlen(buf),debugFile);
00204                                 }
00205                         }
00206                 }
00207         */
00208
00209                 return false;//don't continue moving within epsilon
00210         }
00211
00212 #define EDGEEDGE
00213 #ifdef EDGEEDGE
00214
00215         BU_EdgeEdge edgeEdge;
00216
00217         //for all edged in A check agains all edges in B
00218         for (int ea = 0;ea < m_convexA->GetNumEdges();ea++)
00219         {
00220                 SimdPoint3 pA0,pA1;
00221
00222                 m_convexA->GetEdge(ea,pA0,pA1);
00223
00224                 pA0= a2w * pA0;//in world space
00225                 pA0 = w2s * pA0;//in screwing space
00226
00227                 pA1= a2w * pA1;//in world space
00228                 pA1 = w2s * pA1;//in screwing space
00229
00230                 int numedgesB = m_convexB->GetNumEdges();
00231                 for (int eb = 0; eb < numedgesB;eb++)
00232                 {
00233                         {
00234                                 SimdPoint3 pB0,pB1;
00235                                 m_convexB->GetEdge(eb,pB0,pB1);
00236
00237                                 pB0= b2w * pB0;//in world space
00238                                 pB0 = w2s * pB0;//in screwing space
00239
00240                                 pB1= b2w * pB1;//in world space
00241                                 pB1 = w2s * pB1;//in screwing space
00242
00243
00244                                 SimdScalar lambda,mu;
00245
00246                                 toiUnscaled = 1.;
00247
00248                                 SimdVector3 edgeDirA(pA1-pA0);
00249                                 SimdVector3 edgeDirB(pB1-pB0);
00250
00251                                 if (edgeEdge.GetTimeOfImpact(m_screwing,pA0,edgeDirA,pB0,edgeDirB,toiUnscaled,lambda,mu))
00252                                 {
00253                                         //printf("edgeedge potential hit\n");
00254                                         if (toiUnscaled>=0)
00255                                         {
00256                                                 if (toiUnscaled < toiUnscaledLimit)
00257                                                 {
00258
00259                                                         //inside check is already done by checking the mu and gamma !
00260
00261                                                         SimdPoint3 vtx  = pA0+lambda * (pA1-pA0);
00262                                                         SimdPoint3 hitpt = m_screwing.InBetweenPosition(vtx,toiUnscaled);
00263
00264                                                         SimdPoint3 hitptWorld =   s2w * hitpt;
00265                                                         {
00266
00267                                                                 if (toiUnscaled < result.m_fraction)
00268                                                                         result.m_fraction = toiUnscaled;
00269
00270                                                                 hit = true;
00271
00272                                                                 SimdVector3 hitNormal = edgeDirB.cross(edgeDirA);
00273
00274                                                                 hitNormal = m_screwing.InBetweenVector(hitNormal,toiUnscaled);
00275
00276
00277                                                                 hitNormal.normalize();
00278
00279                                                                 //an approximated normal can be calculated by taking the cross product of both edges
00280                                                                 //take care of the sign !
00281
00282                                                                 SimdVector3 hitNormalWorld = s2w.getBasis() * hitNormal ;
00283
00284                                                                 SimdScalar dist = m_screwing.GetU().dot(hitNormalWorld);
00285                                                                 if (dist > 0)
00286                                                                         hitNormalWorld *= -1;
00287
00288                                                                 //todo: this is the wrong point, because b2winv is still at begin of motion
00289                                                                 // not at time-of-impact location!
00290                                                                 //bhitpt = b2winv * hitptWorld;
00291
00292 //                                                              m_manifold.SetContactPoint(BUM_FeatureEdgeEdge,index,ea,eb,hitptWorld,hitNormalWorld);
00293                                                         }
00294
00295                                                 }
00296                                         }
00297                                 }
00298                         }
00299
00300                         index++;
00301                 }
00302         };
00303 #endif //EDGEEDGE
00304
00305 #define VERTEXFACE
00306 #ifdef VERTEXFACE
00307
00308         // for all vertices in A, for each face in B,do vertex-face
00309         {
00310                 const int numvertsA = m_convexA->GetNumVertices();
00311                 for (int v=0;v<numvertsA;v++)
00312                 //int v=3;
00313
00314                 {
00315                         SimdPoint3 vtx;
00316                         m_convexA->GetVertex(v,vtx);
00317
00318                         vtx = a2w * vtx;//in world space
00319                         vtx = w2s * vtx;//in screwing space
00320
00321                         const int numplanesB = m_convexB->GetNumPlanes();
00322
00323                         for (int p = 0 ; p < numplanesB; p++)
00324                         //int p=2;
00325                         {
00326
00327                                 {
00328
00329                                         SimdVector3 planeNorm;
00330                                         SimdPoint3 planeSupport;
00331
00332                                         m_convexB->GetPlane(planeNorm,planeSupport,p);
00333
00334
00335                                         planeSupport = b2w * planeSupport;//transform to world space
00336                                         SimdVector3 planeNormWorld =  b2w.getBasis() * planeNorm;
00337
00338                                         planeSupport =  w2s * planeSupport  ; //transform to screwing space
00339                                         planeNorm =  w2s.getBasis() * planeNormWorld;
00340
00341                                         planeNorm.normalize();
00342
00343                                         SimdScalar d = planeSupport.dot(planeNorm);
00344
00345                                         SimdVector4 planeEq(planeNorm[0],planeNorm[1],planeNorm[2],d);
00346
00347                                         BU_VertexPoly vtxApolyB;
00348
00349                                         toiUnscaled = 1.;
00350
00351                                         if ((p==2) && (v==6))
00352                                         {
00353 //                                              printf("%f toiUnscaled\n",toiUnscaled);
00354
00355                                         }
00356                                         if (vtxApolyB.GetTimeOfImpact(m_screwing,vtx,planeEq,toiUnscaled,false))
00357                                         {
00358
00359
00360
00361
00362                                                 if (toiUnscaled >= 0. )
00363                                                 {
00364                                                         //not only collect the first point, get every contactpoint, later we have to check the
00365                                                         //manifold properly!
00366
00367                                                         if (toiUnscaled <= toiUnscaledLimit)
00368                                                         {
00369         //                                                      printf("toiUnscaled %f\n",toiUnscaled );
00370
00371                                                                 SimdPoint3 hitpt = m_screwing.InBetweenPosition(vtx,toiUnscaled);
00372                                                                 SimdVector3 hitNormal = m_screwing.InBetweenVector(planeNorm ,toiUnscaled);
00373
00374                                                                 SimdVector3 hitNormalWorld = s2w.getBasis() * hitNormal ;
00375                                                                 SimdPoint3 hitptWorld = s2w * hitpt;
00376
00377
00378                                                                 hitpt = b2winv * hitptWorld;
00379                                                                 //vertex has to be 'within' the facet's boundary
00380                                                                 if (m_convexB->IsInside(hitpt,m_tolerance))
00381                                                                 {
00382 //                                                                      m_manifold.SetContactPoint(BUM_FeatureVertexFace, index,v,p,hitptWorld,hitNormalWorld);
00383
00384                                                                         if (toiUnscaled < result.m_fraction)
00385                                                                                 result.m_fraction= toiUnscaled;
00386                                                                         hit = true;
00387
00388                                                                 }
00389                                                         }
00390                                                 }
00391                                         }
00392
00393                                 }
00394
00395                                 index++;
00396                         }
00397                 }
00398         }
00399
00400         //
00401         // for all vertices in B, for each face in A,do vertex-face
00402         //copy and pasted from all verts A -> all planes B so potential typos!
00403         //todo: make this into one method with a kind of 'swapped' logic
00404         //
00405         {
00406                 const int numvertsB = m_convexB->GetNumVertices();
00407                 for (int v=0;v<numvertsB;v++)
00408                 //int v=0;
00409
00410                 {
00411                         SimdPoint3 vtx;
00412                         m_convexB->GetVertex(v,vtx);
00413
00414                         vtx = b2w * vtx;//in world space
00415 /*
00416
00417                         char buf[1000];
00418
00419                         if (vtx.y() < 0.)
00420                         {
00421                                 sprintf(buf,"ERROR !!!!!!!!!\n",v,vtx.x(),vtx.y(),vtx.z());
00422                                 if (debugFile)
00423                                         fwrite(buf,1,strlen(buf),debugFile);
00424                         }
00425                         sprintf(buf,"vertexWorld(%d) = (%.20E,%.20E,%.20E)\n",v,vtx.x(),vtx.y(),vtx.z());
00426                         if (debugFile)
00427                                 fwrite(buf,1,strlen(buf),debugFile);
00428
00429 */
00430                         vtx = w2s * vtx;//in screwing space
00431
00432                         const int numplanesA = m_convexA->GetNumPlanes();
00433
00434                         for (int p = 0 ; p < numplanesA; p++)
00435                         //int p=2;
00436                         {
00437
00438                                 {
00439                                         SimdVector3 planeNorm;
00440                                         SimdPoint3 planeSupport;
00441
00442                                         m_convexA->GetPlane(planeNorm,planeSupport,p);
00443
00444
00445                                         planeSupport = a2w * planeSupport;//transform to world space
00446                                         SimdVector3 planeNormWorld =  a2w.getBasis() * planeNorm;
00447
00448                                         planeSupport =  w2s * planeSupport  ; //transform to screwing space
00449                                         planeNorm =  w2s.getBasis() * planeNormWorld;
00450
00451                                         planeNorm.normalize();
00452
00453                                         SimdScalar d = planeSupport.dot(planeNorm);
00454
00455                                         SimdVector4 planeEq(planeNorm[0],planeNorm[1],planeNorm[2],d);
00456
00457                                         BU_VertexPoly vtxBpolyA;
00458
00459                                         toiUnscaled = 1.;
00460
00461                                         if (vtxBpolyA.GetTimeOfImpact(m_screwing,vtx,planeEq,toiUnscaled,true))
00462                                         {
00463                                                 if (toiUnscaled>=0.)
00464                                                 {
00465                                                         if (toiUnscaled < toiUnscaledLimit)
00466                                                         {
00467                                                                 SimdPoint3 hitpt = m_screwing.InBetweenPosition( vtx , -toiUnscaled);
00468                                                                 SimdVector3 hitNormal = m_screwing.InBetweenVector(-planeNorm ,-toiUnscaled);
00469                                                                 //SimdScalar len =  hitNormal.length()-1;
00470
00471                                                                 //assert( SimdFuzzyZero(len) );
00472
00473
00474                                                                 SimdVector3 hitNormalWorld = s2w.getBasis() * hitNormal ;
00475                                                                 SimdPoint3 hitptWorld = s2w * hitpt;
00476                                                                 hitpt = a2winv * hitptWorld;
00477
00478
00479                                                                 //vertex has to be 'within' the facet's boundary
00480                                                                 if (m_convexA->IsInside(hitpt,m_tolerance))
00481                                                                 {
00482
00483 //                                                                      m_manifold.SetContactPoint(BUM_FeatureFaceVertex,index,p,v,hitptWorld,hitNormalWorld);
00484                                                                         if (toiUnscaled <result.m_fraction)
00485                                                                                 result.m_fraction = toiUnscaled;
00486                                                                         hit = true;
00487                                                                 }
00488                                                         }
00489
00490                                                 }
00491
00492                                         }
00493                                         }
00494
00495                         }
00496
00497                         index++;
00498                 }
00499         }
00500
00501
00502 #endif// VERTEXFACE
00503
00504         //the manifold now consists of all points/normals generated by feature-pairs that have a time-of-impact within this frame
00505         //in addition there are contact points from previous frames
00506         //we have to cleanup the manifold, using an additional epsilon/tolerance
00507         //as long as the distance from the contactpoint (in worldspace) to both objects is within this epsilon we keep the point
00508         //else throw it away
00509
00510
00511         if (hit)
00512         {
00513
00514                 //try to avoid numerical drift on close contact
00515
00516                 if (result.m_fraction < 0.00001)
00517                 {
00518 //                      printf("toiUnscaledMin< 0.00001\n");
00519                         impactTransA = a2w;
00520                         impactTransB = b2w;
00521
00522                 } else
00523                 {
00524
00525                         //SimdScalar vel = linearMotionB.length();
00526
00527                         //todo: check this margin
00528                         result.m_fraction *= 0.99f;
00529
00530                         //move B to new position
00531                         impactTransB.setOrigin(b2w.getOrigin()+ result.m_fraction*linearMotionB);
00532                         SimdQuaternion ornB = b2w.getRotation()+angularMotionB*result.m_fraction;
00533                         ornB.normalize();
00534                         impactTransB.setRotation(ornB);
00535
00536                         //now transform A
00537                         SimdTransform a2s,a2b;
00538                         a2s.mult( w2s , a2w);
00539                         a2s= m_screwing.InBetweenTransform(a2s,result.m_fraction);
00540                         a2s.multInverseLeft(w2s,a2s);
00541                         a2b.multInverseLeft(b2w, a2s);
00542
00543                         //transform by motion B
00544                         impactTransA.mult(impactTransB, a2b);
00545                         //normalize rotation
00546                         SimdQuaternion orn;
00547                         impactTransA.getBasis().getRotation(orn);
00548                         orn.normalize();
00549                         impactTransA.setBasis(SimdMatrix3x3(orn));
00550                 }
00551         }
00552
00553 /*
00554         {
00555                 const int numvertsB = m_convexB->GetNumVertices();
00556                 for (int v=0;v<numvertsB;v++)
00557                 {
00558                         SimdPoint3 pt;
00559                         m_convexB->GetVertex(v,pt);
00560                         pt = impactTransB * pt;
00561                         char buf[1000];
00562
00563                         if (pt.y() < 0.)
00564                         {
00565                                 sprintf(buf,"POST ERROR (%d) %.20E,%.20E,%.20E!!!!!!!!!\n",v,pt.x(),pt.y(),pt.z());
00566                                 if (debugFile)
00567                                         fwrite(buf,1,strlen(buf),debugFile);
00568                         }
00569                         else
00570                         {
00571                                 sprintf(buf,"POST %d = %.20E,%.20E,%.20E\n",v,pt.x(),pt.y(),pt.z());
00572                                 if (debugFile)
00573                                         fwrite(buf,1,strlen(buf),debugFile);
00574                         }
00575                 }
00576         }
00577 */
00578         return hit;
00579 }
00580
00581
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_CollisionPair.h File Reference

Bullet » NarrowPhaseCollision

BU_CollisionPair.h File Reference

#include <NarrowPhaseCollision/BU_Screwing.h>
#include <NarrowPhaseCollision/ConvexCast.h>
#include <SimdQuaternion.h>

Include dependency graph for BU_CollisionPair.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_CollisionPair
BU_CollisionPair implements collision algorithm for algebraic time of impact calculation of feature based shapes. More...

Generated on Wed May 24 13:58:45 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_CollisionPair.h Source File

Bullet » NarrowPhaseCollision

BU_CollisionPair.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BU_COLLISIONPAIR
00018 #define BU_COLLISIONPAIR
00019
00020 #include <NarrowPhaseCollision/BU_Screwing.h>
00021 #include <NarrowPhaseCollision/ConvexCast.h>
00022
00023
00024 #include <SimdQuaternion.h>
00025
00026 class PolyhedralConvexShape;
00027
00028
00030 class BU_CollisionPair : public ConvexCast
00031 {
00032
00033 public:
00034         BU_CollisionPair(const PolyhedralConvexShape* convexA,const PolyhedralConvexShape* convexB,SimdScalar tolerance=0.2f);
00035         //toi
00036
00037         virtual bool    calcTimeOfImpact(
00038                                         const SimdTransform& fromA,
00039                                         const SimdTransform& toA,
00040                                         const SimdTransform& fromB,
00041                                         const SimdTransform& toB,
00042                                         CastResult& result);
00043
00044
00045
00046
00047 private:
00048         const PolyhedralConvexShape*    m_convexA;
00049         const PolyhedralConvexShape*    m_convexB;
00050         BU_Screwing     m_screwing;
00051         SimdScalar      m_tolerance;
00052
00053 };
00054 #endif //BU_COLLISIONPAIR
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_EdgeEdge.cpp File Reference

Bullet » NarrowPhaseCollision

BU_EdgeEdge.cpp File Reference

#include "BU_EdgeEdge.h"
#include "BU_Screwing.h"
#include <SimdPoint3.h>
#include "BU_AlgebraicPolynomialSolver.h"

Include dependency graph for BU_EdgeEdge.cpp:

Go to the source code of this file.

Defines

#define | USE_ALGEBRAIC
#define | BU_Polynomial BU_AlgebraicPolynomialSolver

Define Documentation

#define BU_Polynomial BU_AlgebraicPolynomialSolver

Definition at line 27 of file BU_EdgeEdge.cpp.

Referenced by BU_VertexPoly::GetTimeOfImpact(), and BU_EdgeEdge::GetTimeOfImpactGeneralCase().

#define USE_ALGEBRAIC

Definition at line 25 of file BU_EdgeEdge.cpp.

Generated on Wed May 24 13:58:46 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_EdgeEdge.cpp Source File

Bullet » NarrowPhaseCollision

BU_EdgeEdge.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "BU_EdgeEdge.h"
00018 #include "BU_Screwing.h"
00019 #include <SimdPoint3.h>
00020 #include <SimdPoint3.h>
00021
00022 //#include "BU_IntervalArithmeticPolynomialSolver.h"
00023 #include "BU_AlgebraicPolynomialSolver.h"
00024
00025 #define USE_ALGEBRAIC
00026 #ifdef USE_ALGEBRAIC
00027 #define BU_Polynomial BU_AlgebraicPolynomialSolver
00028 #else
00029 #define BU_Polynomial BU_IntervalArithmeticPolynomialSolver
00030 #endif
00031
00032 BU_EdgeEdge::BU_EdgeEdge()
00033 {
00034 }
00035
00036
00037 bool BU_EdgeEdge::GetTimeOfImpact(
00038                                                                   const BU_Screwing& screwAB,
00039                                                                   const SimdPoint3& a,//edge in object A
00040                                                                   const SimdVector3& u,
00041                                                                   const SimdPoint3& c,//edge in object B
00042                                                                   const SimdVector3& v,
00043                                                                   SimdScalar &minTime,
00044                                                                   SimdScalar &lambda1,
00045                                                                   SimdScalar& mu1
00046
00047                                                                   )
00048 {
00049         bool hit=false;
00050
00051         SimdScalar lambda;
00052         SimdScalar mu;
00053
00054         const SimdScalar w=screwAB.GetW();
00055         const SimdScalar s=screwAB.GetS();
00056
00057         if (SimdFuzzyZero(s) &&
00058                 SimdFuzzyZero(w))
00059         {
00060                 //no motion, no collision
00061                 return false;
00062         }
00063
00064         if (SimdFuzzyZero(w) )
00065         {
00066                 //pure translation W=0, S <> 0
00067                 //no trig, f(t)=t
00068                 SimdScalar det = u.y()*v.x()-u.x()*v.y();
00069                 if (!SimdFuzzyZero(det))
00070                 {
00071                         lambda = (a.x()*v.y() - c.x() * v.y() - v.x() * a.y() + v.x() * c.y()) / det;
00072                         mu = (u.y() * a.x() - u.y() * c.x() - u.x() * a.y() + u.x() * c.y()) / det;
00073
00074                         if (mu >=0 && mu <= 1 && lambda >= 0 && lambda <= 1)
00075                         {
00076                                 // single potential collision is
00077                                 SimdScalar t = (c.z()-a.z()+mu*v.z()-lambda*u.z())/s;
00078                                 //if this is on the edge, and time t within [0..1] report hit
00079                                 if (t>=0 && t <= minTime)
00080                                 {
00081                                         hit = true;
00082                                         lambda1 = lambda;
00083                                         mu1 = mu;
00084                                         minTime=t;
00085                                 }
00086                         }
00087
00088                 } else
00089                 {
00090                         //parallel case, not yet
00091                 }
00092         } else
00093         {
00094                 if (SimdFuzzyZero(s) )
00095                 {
00096                         if (SimdFuzzyZero(u.z()) )
00097                         {
00098                                 if (SimdFuzzyZero(v.z()) )
00099                                 {
00100                                         //u.z()=0,v.z()=0
00101                                         if (SimdFuzzyZero(a.z()-c.z()))
00102                                         {
00103                                                 //printf("NOT YET planar problem, 4 vertex=edge cases\n");
00104
00105                                         } else
00106                                         {
00107                                                 //printf("parallel but distinct planes, no collision\n");
00108                                                 return false;
00109                                         }
00110
00111                                 } else
00112                                 {
00113                                         SimdScalar mu = (a.z() - c.z())/v.z();
00114                                         if (0<=mu && mu <= 1)
00115                                         {
00116                                         //      printf("NOT YET//u.z()=0,v.z()<>0\n");
00117                                         } else
00118                                         {
00119                                                 return false;
00120                                         }
00121
00122                                 }
00123                         } else
00124                         {
00125                                 //u.z()<>0
00126
00127                                 if (SimdFuzzyZero(v.z()) )
00128                                 {
00129                                         //printf("u.z()<>0,v.z()=0\n");
00130                                         lambda =  (c.z() - a.z())/u.z();
00131                                         if (0<=lambda && lambda <= 1)
00132                                         {
00133                                                 //printf("u.z()<>0,v.z()=0\n");
00134                                                 SimdPoint3 rotPt(a.x()+lambda * u.x(), a.y()+lambda * u.y(),0.f);
00135                                                 SimdScalar r2 = rotPt.length2();//px*px + py*py;
00136
00137                                                 //either y=a*x+b, or x = a*x+b...
00138                                                 //depends on whether value v.x() is zero or not
00139                                                 SimdScalar aa;
00140                                                 SimdScalar bb;
00141
00142                                                 if (SimdFuzzyZero(v.x()))
00143                                                 {
00144                                                         aa = v.x()/v.y();
00145                                                         bb= c.x()+  (-c.y() /v.y()) *v.x();
00146                                                 } else
00147                                                 {
00148                                                         //line is c+mu*v;
00149                                                         //x = c.x()+mu*v.x();
00150                                                         //mu = ((x-c.x())/v.x());
00151                                                         //y = c.y()+((x-c.x())/v.x())*v.y();
00152                                                         //y = c.y()+  (-c.x() /v.x()) *v.y() + (x /v.x())   *v.y();
00153                                                         //y = a*x+b,where a = v.y()/v.x(), b= c.y()+  (-c.x() /v.x()) *v.y();
00154                                                         aa = v.y()/v.x();
00155                                                         bb= c.y()+  (-c.x() /v.x()) *v.y();
00156                                                 }
00157
00158                                                 SimdScalar disc = aa*aa*r2 + r2 - bb*bb;
00159                                                 if (disc <0)
00160                                                 {
00161                                                         //edge doesn't intersect the circle (motion of the vertex)
00162                                                         return false;
00163                                                 }
00164                                                 SimdScalar rad = SimdSqrt(r2);
00165
00166                                                 if (SimdFuzzyZero(disc))
00167                                                 {
00168                                                         SimdPoint3 intersectPt;
00169
00170                                                         SimdScalar mu;
00171                                                         //intersectionPoint edge with circle;
00172                                                         if (SimdFuzzyZero(v.x()))
00173                                                         {
00174                                                                 intersectPt.setY( (-2*aa*bb)/(2*(aa*aa+1)));
00175                                                                 intersectPt.setX( aa*intersectPt.y()+bb );
00176                                                                 mu = ((intersectPt.y()-c.y())/v.y());
00177                                                         } else
00178                                                         {
00179                                                                 intersectPt.setX((-2*aa*bb)/(2*(aa*aa+1)));
00180                                                                 intersectPt.setY(aa*intersectPt.x()+bb);
00181                                                                 mu = ((intersectPt.getX()-c.getX())/v.getX());
00182
00183                                                         }
00184
00185                                                         if (0 <= mu && mu <= 1)
00186                                                         {
00187                                                                 hit = Calc2DRotationPointPoint(rotPt,rad,screwAB.GetW(),intersectPt,minTime);
00188                                                         }
00189                                                         //only one solution
00190                                                 } else
00191                                                 {
00192                                                         //two points...
00193                                                         //intersectionPoint edge with circle;
00194                                                         SimdPoint3 intersectPt;
00195                                                         //intersectionPoint edge with circle;
00196                                                         if (SimdFuzzyZero(v.x()))
00197                                                         {
00198                                                                 SimdScalar mu;
00199
00200                                                                 intersectPt.setY((-2.f*aa*bb+2.f*SimdSqrt(disc))/(2.f*(aa*aa+1.f)));
00201                                                                 intersectPt.setX(aa*intersectPt.y()+bb);
00202                                                                 mu = ((intersectPt.getY()-c.getY())/v.getY());
00203                                                                 if (0.f <= mu && mu <= 1.f)
00204                                                                 {
00205                                                                         hit = Calc2DRotationPointPoint(rotPt,rad,screwAB.GetW(),intersectPt,minTime);
00206                                                                 }
00207                                                                 intersectPt.setY((-2.f*aa*bb-2.f*SimdSqrt(disc))/(2.f*(aa*aa+1.f)));
00208                                                                 intersectPt.setX(aa*intersectPt.y()+bb);
00209                                                                 mu = ((intersectPt.getY()-c.getY())/v.getY());
00210                                                                 if (0 <= mu && mu <= 1)
00211                                                                 {
00212                                                                         hit = hit || Calc2DRotationPointPoint(rotPt,rad,screwAB.GetW(),intersectPt,minTime);
00213                                                                 }
00214
00215                                                         } else
00216                                                         {
00217                                                                 SimdScalar mu;
00218
00219                                                                 intersectPt.setX((-2.f*aa*bb+2.f*SimdSqrt(disc))/(2*(aa*aa+1.f)));
00220                                                                 intersectPt.setY(aa*intersectPt.x()+bb);
00221                                                                 mu = ((intersectPt.getX()-c.getX())/v.getX());
00222                                                                 if (0 <= mu && mu <= 1)
00223                                                                 {
00224                                                                         hit = Calc2DRotationPointPoint(rotPt,rad,screwAB.GetW(),intersectPt,minTime);
00225                                                                 }
00226                                                                 intersectPt.setX((-2.f*aa*bb-2.f*SimdSqrt(disc))/(2.f*(aa*aa+1.f)));
00227                                                                 intersectPt.setY(aa*intersectPt.x()+bb);
00228                                                                 mu = ((intersectPt.getX()-c.getX())/v.getX());
00229                                                                 if (0.f <= mu && mu <= 1.f)
00230                                                                 {
00231                                                                         hit = hit || Calc2DRotationPointPoint(rotPt,rad,screwAB.GetW(),intersectPt,minTime);
00232                                                                 }
00233                                                         }
00234                                                 }
00235
00236
00237
00238                                                 //int k=0;
00239
00240                                         } else
00241                                         {
00242                                                 return false;
00243                                         }
00244
00245
00246                                 } else
00247                                 {
00248                                         //u.z()<>0,v.z()<>0
00249                                         //printf("general case with s=0\n");
00250                                         hit = GetTimeOfImpactGeneralCase(screwAB,a,u,c,v,minTime,lambda,mu);
00251                                         if (hit)
00252                                         {
00253                                                 lambda1 = lambda;
00254                                                 mu1 = mu;
00255
00256                                         }
00257                                 }
00258                         }
00259
00260                 } else
00261                 {
00262                         //printf("general case, W<>0,S<>0\n");
00263                         hit = GetTimeOfImpactGeneralCase(screwAB,a,u,c,v,minTime,lambda,mu);
00264                         if (hit)
00265                         {
00266                                 lambda1 = lambda;
00267                                 mu1 = mu;
00268                         }
00269
00270                 }
00271
00272
00273                 //W <> 0,pure rotation
00274         }
00275
00276         return hit;
00277 }
00278
00279
00280 bool BU_EdgeEdge::GetTimeOfImpactGeneralCase(
00281                                                                                          const BU_Screwing& screwAB,
00282                                                                                          const SimdPoint3& a,//edge in object A
00283                                                                                          const SimdVector3& u,
00284                                                                                          const SimdPoint3& c,//edge in object B
00285                                                                                          const SimdVector3& v,
00286                                                                                          SimdScalar &minTime,
00287                                                                                          SimdScalar &lambda,
00288                                                                                          SimdScalar& mu
00289
00290                                                                                          )
00291 {
00292         bool hit = false;
00293
00294         SimdScalar coefs[4]={0.f,0.f,0.f,0.f};
00295         BU_Polynomial polynomialSolver;
00296         int numroots = 0;
00297
00298         //SimdScalar eps=1e-15f;
00299         //SimdScalar eps2=1e-20f;
00300         SimdScalar s=screwAB.GetS();
00301         SimdScalar w = screwAB.GetW();
00302
00303         SimdScalar ax = a.x();
00304         SimdScalar ay = a.y();
00305         SimdScalar az = a.z();
00306         SimdScalar cx = c.x();
00307         SimdScalar cy = c.y();
00308         SimdScalar cz = c.z();
00309         SimdScalar vx = v.x();
00310         SimdScalar vy = v.y();
00311         SimdScalar vz = v.z();
00312         SimdScalar ux = u.x();
00313         SimdScalar uy = u.y();
00314         SimdScalar uz = u.z();
00315
00316
00317         if (!SimdFuzzyZero(v.z()))
00318         {
00319
00320                 //Maple Autogenerated C code
00321                 SimdScalar t1,t2,t3,t4,t7,t8,t10;
00322                 SimdScalar t13,t14,t15,t16,t17,t18,t19,t20;
00323                 SimdScalar t21,t22,t23,t24,t25,t26,t27,t28,t29,t30;
00324                 SimdScalar t31,t32,t33,t34,t35,t36,t39,t40;
00325                 SimdScalar t41,t43,t48;
00326                 SimdScalar t63;
00327
00328                 SimdScalar aa,bb,cc,dd;//the coefficients
00329
00330                 t1 = v.y()*s;      t2 = t1*u.x();
00331                 t3 = v.x()*s;
00332                 t4 = t3*u.y();
00333                 t7 = SimdTan(w/2.0f);
00334                 t8 = 1.0f/t7;
00335                 t10 = 1.0f/v.z();
00336                 aa = (t2-t4)*t8*t10;
00337                 t13 = a.x()*t7;
00338                 t14 = u.z()*v.y();
00339                 t15 = t13*t14;
00340                 t16 = u.x()*v.z();
00341                 t17 = a.y()*t7;
00342                 t18 = t16*t17;
00343                 t19 = u.y()*v.z();
00344                 t20 = t13*t19;
00345                 t21 = v.y()*u.x();
00346                 t22 = c.z()*t7;
00347                 t23 = t21*t22;
00348                 t24 = v.x()*a.z();
00349                 t25 = t7*u.y();
00350                 t26 = t24*t25;
00351                 t27 = c.y()*t7;
00352                 t28 = t16*t27;
00353                 t29 = a.z()*t7;
00354                 t30 = t21*t29;
00355                 t31 = u.z()*v.x();
00356                 t32 = t31*t27;
00357                 t33 = t31*t17;
00358                 t34 = c.x()*t7;
00359                 t35 = t34*t19;
00360                 t36 = t34*t14;
00361                 t39 = v.x()*c.z();
00362                 t40 = t39*t25;
00363                 t41 = 2.0f*t1*u.y()-t15+t18-t20-t23-t26+t28+t30+t32+t33-t35-t36+2.0f*t3*u.x()+t40;
00364                 bb = t41*t8*t10;
00365                 t43 = t7*u.x();
00366                 t48 = u.y()*v.y();
00367                 cc = (-2.0f*t39*t43+2.0f*t24*t43+t4-2.0f*t48*t22+2.0f*t34*t16-2.0f*t31*t13-t2
00368                         -2.0f*t17*t14+2.0f*t19*t27+2.0f*t48*t29)*t8*t10;
00369                 t63 = -t36+t26+t32-t40+t23+t35-t20+t18-t28-t33+t15-t30;
00370                 dd = t63*t8*t10;
00371
00372                 coefs[0]=aa;
00373                 coefs[1]=bb;
00374                 coefs[2]=cc;
00375                 coefs[3]=dd;
00376
00377         } else
00378         {
00379
00380                 SimdScalar t1,t2,t3,t4,t7,t8,t10;
00381                 SimdScalar t13,t14,t15,t16,t17,t18,t19,t20;
00382                 SimdScalar t21,t22,t23,t24,t25,t26,t27,t28,t29,t30;
00383                 SimdScalar t31,t32,t33,t34,t35,t36,t37,t38,t57;
00384                 SimdScalar p1,p2,p3,p4;
00385
00386           t1 = uy*s;
00387       t2 = t1*vx;
00388       t3 = ux*s;
00389       t4 = t3*vy;
00390       t7 = SimdTan(w/2.0f);
00391       t8 = 1/t7;
00392       t10 = 1/uz;
00393       t13 = ux*az;
00394       t14 = t7*vy;
00395       t15 = t13*t14;
00396       t16 = ax*t7;
00397       t17 = uy*vz;
00398       t18 = t16*t17;
00399       t19 = cx*t7;
00400       t20 = t19*t17;
00401       t21 = vy*uz;
00402       t22 = t19*t21;
00403       t23 = ay*t7;
00404       t24 = vx*uz;
00405       t25 = t23*t24;
00406       t26 = uy*cz;
00407       t27 = t7*vx;
00408       t28 = t26*t27;
00409       t29 = t16*t21;
00410       t30 = cy*t7;
00411       t31 = ux*vz;
00412       t32 = t30*t31;
00413       t33 = ux*cz;
00414       t34 = t33*t14;
00415       t35 = t23*t31;
00416       t36 = t30*t24;
00417       t37 = uy*az;
00418       t38 = t37*t27;
00419
00420           p4 = (-t2+t4)*t8*t10;
00421       p3 = 2.0f*t1*vy+t15-t18-t20-t22+t25+t28-t29+t32-t34+t35+t36-t38+2.0f*t3*vx;
00422       p2 = -2.0f*t33*t27-2.0f*t26*t14-2.0f*t23*t21+2.0f*t37*t14+2.0f*t30*t17+2.0f*t13
00423 *t27+t2-t4+2.0f*t19*t31-2.0f*t16*t24;
00424       t57 = -t22+t29+t36-t25-t32+t34+t35-t28-t15+t20-t18+t38;
00425       p1 = t57*t8*t10;
00426
00427         coefs[0] = p4;
00428         coefs[1] = p3;
00429         coefs[2] = p2;
00430         coefs[1] = p1;
00431
00432         }
00433
00434         numroots = polynomialSolver.Solve3Cubic(coefs[0],coefs[1],coefs[2],coefs[3]);
00435
00436         for (int i=0;i<numroots;i++)
00437         {
00438                 //SimdScalar tau = roots[i];//polynomialSolver.GetRoot(i);
00439                 SimdScalar tau = polynomialSolver.GetRoot(i);
00440
00441                 //check whether mu and lambda are in range [0..1]
00442
00443                 if (!SimdFuzzyZero(v.z()))
00444                 {
00445                         SimdScalar A1=(ux-ux*tau*tau-2.f*tau*uy)-((1.f+tau*tau)*vx*uz/vz);
00446                         SimdScalar B1=((1.f+tau*tau)*(cx*SimdTan(1.f/2.f*w)*vz+
00447                                 vx*az*SimdTan(1.f/2.f*w)-vx*cz*SimdTan(1.f/2.f*w)+
00448                                 vx*s*tau)/SimdTan(1.f/2.f*w)/vz)-(ax-ax*tau*tau-2.f*tau*ay);
00449                         lambda = B1/A1;
00450
00451                         mu = (a.z()-c.z()+lambda*u.z()+(s*tau)/(SimdTan(w/2.f)))/v.z();
00452
00453
00454                         //double check in original equation
00455
00456                         SimdScalar lhs = (a.x()+lambda*u.x())
00457                                 *((1.f-tau*tau)/(1.f+tau*tau))-
00458                                 (a.y()+lambda*u.y())*((2.f*tau)/(1.f+tau*tau));
00459
00460                         lhs = lambda*((ux-ux*tau*tau-2.f*tau*uy)-((1.f+tau*tau)*vx*uz/vz));
00461
00462                         SimdScalar rhs = c.x()+mu*v.x();
00463
00464                         rhs = ((1.f+tau*tau)*(cx*SimdTan(1.f/2.f*w)*vz+vx*az*SimdTan(1.f/2.f*w)-
00465                                 vx*cz*SimdTan(1.f/2.f*w)+vx*s*tau)/(SimdTan(1.f/2.f*w)*vz))-
00466
00467                                 (ax-ax*tau*tau-2.f*tau*ay);
00468
00469                         /*SimdScalar res = coefs[0]*tau*tau*tau+
00470                                 coefs[1]*tau*tau+
00471                                 coefs[2]*tau+
00472                                 coefs[3];*/
00473
00474                         //lhs should be rhs !
00475
00476                         if (0.<= mu && mu <=1 && 0.<=lambda && lambda <= 1)
00477                         {
00478
00479                         } else
00480                         {
00481                                 //skip this solution, not really touching
00482                                 continue;
00483                         }
00484
00485                 }
00486
00487                 SimdScalar t = 2.f*SimdAtan(tau)/screwAB.GetW();
00488                 //tau = tan (wt/2) so 2*atan (tau)/w
00489                 if (t>=0.f && t<minTime)
00490                 {
00491 #ifdef STATS_EDGE_EDGE
00492                         printf(" ax = %12.12f\n ay = %12.12f\n az = %12.12f\n",a.x(),a.y(),a.z());
00493                         printf(" ux = %12.12f\n uy = %12.12f\n uz = %12.12f\n",u.x(),u.y(),u.z());
00494                         printf(" cx = %12.12f\n cy = %12.12f\n cz = %12.12f\n",c.x(),c.y(),c.z());
00495                         printf(" vx = %12.12f\n vy = %12.12f\n vz = %12.12f\n",v.x(),v.y(),v.z());
00496                         printf(" s  = %12.12f\n w  = %12.12f\n",       s,     w);
00497
00498                         printf(" tau = %12.12f \n lambda = %12.12f \n mu = %f\n",tau,lambda,mu);
00499                         printf(" ---------------------------------------------\n");
00500
00501 #endif
00502
00503                         //      v,u,a,c,s,w
00504
00505                         //      BU_IntervalArithmeticPolynomialSolver iaSolver;
00506                         //      int numroots2 = iaSolver.Solve3Cubic(coefs[0],coefs[1],coefs[2],coefs[3]);
00507
00508                         minTime = t;
00509                         hit = true;
00510                 }
00511         }
00512
00513         return hit;
00514 }
00515
00516
00517 //C -S
00518 //S C
00519
00520 bool BU_EdgeEdge::Calc2DRotationPointPoint(const SimdPoint3& rotPt, SimdScalar rotRadius, SimdScalar rotW,const SimdPoint3& intersectPt,SimdScalar& minTime)
00521 {
00522         bool hit = false;
00523
00524         // now calculate the planeEquation for the vertex motion,
00525         // and check if the intersectionpoint is at the positive side
00526         SimdPoint3 rotPt1(SimdCos(rotW)*rotPt.x()-SimdSin(rotW)*rotPt.y(),
00527         SimdSin(rotW)*rotPt.x()+SimdCos(rotW)*rotPt.y(),
00528         0.f);
00529
00530         SimdVector3 rotVec = rotPt1-rotPt;
00531
00532         SimdVector3 planeNormal( -rotVec.y() , rotVec.x() ,0.f);
00533
00534         //SimdPoint3 pt(a.x(),a.y());//for sake of readability,could write dot directly
00535         SimdScalar planeD = planeNormal.dot(rotPt1);
00536
00537         SimdScalar dist = (planeNormal.dot(intersectPt)-planeD);
00538         hit = (dist >= -0.001);
00539
00540         //if (hit)
00541         {
00542                 //              minTime = 0;
00543                 //calculate the time of impact, using the fact of
00544                 //toi = alpha / screwAB.getW();
00545                 // cos (alpha) = adjacent/hypothenuse;
00546                 //adjacent = dotproduct(ipedge,point);
00547                 //hypothenuse = sqrt(r2);
00548                 SimdScalar adjacent = intersectPt.dot(rotPt)/rotRadius;
00549                 SimdScalar hypo = rotRadius;
00550                 SimdScalar alpha = SimdAcos(adjacent/hypo);
00551                 SimdScalar t = alpha / rotW;
00552                 if (t >= 0 && t < minTime)
00553                 {
00554                         hit = true;
00555                         minTime = t;
00556                 } else
00557                 {
00558                         hit = false;
00559                 }
00560
00561         }
00562         return hit;
00563 }
00564
00565 bool BU_EdgeEdge::GetTimeOfImpactVertexEdge(
00566                                                                                         const BU_Screwing& screwAB,
00567                                                                                         const SimdPoint3& a,//edge in object A
00568                                                                                         const SimdVector3& u,
00569                                                                                         const SimdPoint3& c,//edge in object B
00570                                                                                         const SimdVector3& v,
00571                                                                                         SimdScalar &minTime,
00572                                                                                         SimdScalar &lamda,
00573                                                                                         SimdScalar& mu
00574
00575                                                                                         )
00576 {
00577         return false;
00578 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_EdgeEdge.h File Reference

Bullet » NarrowPhaseCollision

BU_EdgeEdge.h File Reference

#include <SimdTransform.h>
#include <SimdPoint3.h>
#include <SimdVector3.h>
#include <SimdScalar.h>

Include dependency graph for BU_EdgeEdge.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_EdgeEdge
BU_EdgeEdge implements algebraic time of impact calculation between two (angular + linear) moving edges. More...

Generated on Wed May 24 13:58:46 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_EdgeEdge.h Source File

Bullet » NarrowPhaseCollision

BU_EdgeEdge.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BU_EDGEEDGE
00018 #define BU_EDGEEDGE
00019
00020 class BU_Screwing;
00021 #include <SimdTransform.h>
00022 #include <SimdPoint3.h>
00023 #include <SimdVector3.h>
00024
00025 //class BUM_Point2;
00026
00027 #include <SimdScalar.h>
00028
00030 class BU_EdgeEdge
00031 {
00032 public:
00033
00034
00035         BU_EdgeEdge();
00036         bool GetTimeOfImpact(
00037                 const BU_Screwing& screwAB,
00038                 const SimdPoint3& a,//edge in object A
00039                 const SimdVector3& u,
00040                 const SimdPoint3& c,//edge in object B
00041                 const SimdVector3& v,
00042                 SimdScalar &minTime,
00043                 SimdScalar &lamda,
00044                 SimdScalar& mu
00045                 );
00046 private:
00047
00048         bool Calc2DRotationPointPoint(const SimdPoint3& rotPt, SimdScalar rotRadius, SimdScalar rotW,const SimdPoint3& intersectPt,SimdScalar& minTime);
00049         bool GetTimeOfImpactGeneralCase(
00050                 const BU_Screwing& screwAB,
00051                 const SimdPoint3& a,//edge in object A
00052                 const SimdVector3& u,
00053                 const SimdPoint3& c,//edge in object B
00054                 const SimdVector3& v,
00055                 SimdScalar &minTime,
00056                 SimdScalar &lamda,
00057                 SimdScalar& mu
00058
00059                 );
00060
00061
00062         bool GetTimeOfImpactVertexEdge(
00063                 const BU_Screwing& screwAB,
00064                 const SimdPoint3& a,//edge in object A
00065                 const SimdVector3& u,
00066                 const SimdPoint3& c,//edge in object B
00067                 const SimdVector3& v,
00068                 SimdScalar &minTime,
00069                 SimdScalar &lamda,
00070                 SimdScalar& mu
00071
00072                 );
00073
00074 };
00075
00076 #endif //BU_EDGEEDGE
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint.cpp File Reference

BulletDynamics » Dynamics

BU_Joint.cpp File Reference

#include "BU_Joint.h"

Include dependency graph for BU_Joint.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:46 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint.cpp Source File

BulletDynamics » Dynamics

BU_Joint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "BU_Joint.h"
00017
00018 BU_Joint::BU_Joint()
00019 {
00020
00021 }
00022 BU_Joint::~BU_Joint()
00023 {
00024
00025 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint.h File Reference

BulletDynamics » Dynamics

BU_Joint.h File Reference

#include "SimdScalar.h"

Include dependency graph for BU_Joint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | BU_ContactJointNode
class | BU_Joint
struct | BU_Joint::Info1
struct | BU_Joint::Info2

Typedefs

typedef SimdScalar | dVector3 [4]

Typedef Documentation

typedef SimdScalar dVector3[4]

Definition at line 27 of file BU_Joint.h.

Generated on Wed May 24 13:58:47 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint.h Source File

BulletDynamics » Dynamics

BU_Joint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef BU_Joint_H
00017 #define BU_Joint_H
00018
00019 class RigidBody;
00020 class BU_Joint;
00021 #include "SimdScalar.h"
00022
00023 struct BU_ContactJointNode {
00024   BU_Joint *joint;              // pointer to enclosing BU_Joint object
00025   RigidBody*body;                       // *other* body this joint is connected to
00026 };
00027 typedef SimdScalar dVector3[4];
00028
00029
00030 class BU_Joint  {
00031
00032 public:
00033         // naming convention: the "first" body this is connected to is node[0].body,
00034   // and the "second" body is node[1].body. if this joint is only connected
00035   // to one body then the second body is 0.
00036
00037   // info returned by getInfo1 function. the constraint dimension is m (<=6).
00038   // i.e. that is the total number of rows in the jacobian. `nub' is the
00039   // number of unbounded variables (which have lo,hi = -/+ infinity).
00040
00041   BU_Joint();
00042   virtual ~BU_Joint();
00043
00044
00045   struct Info1 {
00046     int m,nub;
00047   };
00048
00049   // info returned by getInfo2 function
00050
00051   struct Info2 {
00052     // integrator parameters: frames per second (1/stepsize), default error
00053     // reduction parameter (0..1).
00054     SimdScalar fps,erp;
00055
00056     // for the first and second body, pointers to two (linear and angular)
00057     // n*3 jacobian sub matrices, stored by rows. these matrices will have
00058     // been initialized to 0 on entry. if the second body is zero then the
00059     // J2xx pointers may be 0.
00060     SimdScalar *J1l,*J1a,*J2l,*J2a;
00061
00062     // elements to jump from one row to the next in J's
00063     int rowskip;
00064
00065     // right hand sides of the equation J*v = c + cfm * lambda. cfm is the
00066     // "constraint force mixing" vector. c is set to zero on entry, cfm is
00067     // set to a constant value (typically very small or zero) value on entry.
00068     SimdScalar *c,*cfm;
00069
00070     // lo and hi limits for variables (set to -/+ infinity on entry).
00071     SimdScalar *lo,*hi;
00072
00073     // findex vector for variables. see the LCP solver interface for a
00074     // description of what this does. this is set to -1 on entry.
00075     // note that the returned indexes are relative to the first index of
00076     // the constraint.
00077     int *findex;
00078   };
00079
00080   // virtual function table: size of the joint structure, function pointers.
00081   // we do it this way instead of using C++ virtual functions because
00082   // sometimes we need to allocate joints ourself within a memory pool.
00083
00084   virtual void GetInfo1 (Info1 *info)=0;
00085   virtual void GetInfo2 (Info2 *info)=0;
00086
00087   int flags;                    // dJOINT_xxx flags
00088   BU_ContactJointNode node[2];          // connections to bodies. node[1].body can be 0
00089    SimdScalar lambda[6];                // lambda generated by last step
00090 };
00091
00092
00093 #endif //BU_Joint_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_MotionStateInterface.h File Reference

Bullet » NarrowPhaseCollision

BU_MotionStateInterface.h File Reference

#include <SimdTransform.h>
#include <SimdPoint3.h>
#include <SimdQuaternion.h>

Include dependency graph for BU_MotionStateInterface.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_MotionStateInterface

Generated on Wed May 24 13:58:47 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_MotionStateInterface.h Source File

Bullet » NarrowPhaseCollision

BU_MotionStateInterface.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BU_MOTIONSTATE
00018 #define BU_MOTIONSTATE
00019
00020
00021 #include <SimdTransform.h>
00022 #include <SimdPoint3.h>
00023 #include <SimdQuaternion.h>
00024
00025 class BU_MotionStateInterface
00026 {
00027 public:
00028         virtual ~BU_MotionStateInterface(){};
00029
00030         virtual void    SetTransform(const SimdTransform& trans) = 0;
00031         virtual void    GetTransform(SimdTransform& trans) const = 0;
00032
00033         virtual void    SetPosition(const SimdPoint3& position) = 0;
00034         virtual void    GetPosition(SimdPoint3& position) const = 0;
00035
00036         virtual void    SetOrientation(const SimdQuaternion& orientation) = 0;
00037         virtual void    GetOrientation(SimdQuaternion& orientation) const = 0;
00038
00039         virtual void    SetBasis(const SimdMatrix3x3& basis) = 0;
00040         virtual void    GetBasis(SimdMatrix3x3& basis) const = 0;
00041
00042         virtual void    SetLinearVelocity(const SimdVector3& linvel) = 0;
00043         virtual void    GetLinearVelocity(SimdVector3& linvel) const = 0;
00044
00045         virtual void    GetAngularVelocity(SimdVector3& angvel) const = 0;
00046         virtual void    SetAngularVelocity(const SimdVector3& angvel) = 0;
00047
00048 };
00049
00050 #endif //BU_MOTIONSTATE
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_PolynomialSolverInterface.h File Reference

Bullet » NarrowPhaseCollision

BU_PolynomialSolverInterface.h File Reference

#include <SimdScalar.h>

Include dependency graph for BU_PolynomialSolverInterface.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BUM_PolynomialSolverInterface

Generated on Wed May 24 13:58:48 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_PolynomialSolverInterface.h Source File

Bullet » NarrowPhaseCollision

BU_PolynomialSolverInterface.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 #ifndef BUM_POLYNOMIAL_SOLVER_INTERFACE
00016 #define BUM_POLYNOMIAL_SOLVER_INTERFACE
00017
00018 #include <SimdScalar.h>
00019 //
00020 //BUM_PolynomialSolverInterface is interface class for polynomial root finding.
00021 //The number of roots is returned as a result, query GetRoot to get the actual solution.
00022 //
00023 class BUM_PolynomialSolverInterface
00024 {
00025 public:
00026         virtual ~BUM_PolynomialSolverInterface() {};
00027
00028
00029 //      virtual int Solve2QuadraticFull(SimdScalar a,SimdScalar b, SimdScalar c) = 0;
00030
00031         virtual int     Solve3Cubic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c) = 0;
00032
00033         virtual int Solve4Quartic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d) = 0;
00034
00035         virtual SimdScalar GetRoot(int i) const = 0;
00036
00037 };
00038
00039 #endif //BUM_POLYNOMIAL_SOLVER_INTERFACE
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Screwing.cpp File Reference

Bullet » NarrowPhaseCollision

BU_Screwing.cpp File Reference

#include "BU_Screwing.h"

Include dependency graph for BU_Screwing.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:48 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Screwing.cpp Source File

Bullet » NarrowPhaseCollision

BU_Screwing.cpp

Go to the documentation of this file.
00001
00002 /*
00003 Bullet Continuous Collision Detection and Physics Library
00004 Copyright (c) 2003-2006 Stephane Redon / Erwin Coumans  http://continuousphysics.com/Bullet/
00005
00006 This software is provided 'as-is', without any express or implied warranty.
00007 In no event will the authors be held liable for any damages arising from the use of this software.
00008 Permission is granted to anyone to use this software for any purpose,
00009 including commercial applications, and to alter it and redistribute it freely,
00010 subject to the following restrictions:
00011
00012 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00014 3. This notice may not be removed or altered from any source distribution.
00015 */
00016
00017
00018 #include "BU_Screwing.h"
00019
00020
00021 BU_Screwing::BU_Screwing(const SimdVector3& relLinVel,const SimdVector3& relAngVel) {
00022
00023
00024         const SimdScalar dx=relLinVel[0];
00025         const SimdScalar dy=relLinVel[1];
00026         const SimdScalar dz=relLinVel[2];
00027         const SimdScalar wx=relAngVel[0];
00028         const SimdScalar wy=relAngVel[1];
00029         const SimdScalar wz=relAngVel[2];
00030
00031         // Compute the screwing parameters :
00032         // w : total amount of rotation
00033         // s : total amount of translation
00034         // u : vector along the screwing axis (||u||=1)
00035         // o : point on the screwing axis
00036
00037         m_w=SimdSqrt(wx*wx+wy*wy+wz*wz);
00038         //if (!w) {
00039         if (fabs(m_w)<SCREWEPSILON ) {
00040
00041                 assert(m_w == 0.f);
00042
00043                 m_w=0.;
00044                 m_s=SimdSqrt(dx*dx+dy*dy+dz*dz);
00045                 if (fabs(m_s)<SCREWEPSILON ) {
00046                         assert(m_s == 0.);
00047
00048                         m_s=0.;
00049                         m_u=SimdPoint3(0.,0.,1.);
00050                         m_o=SimdPoint3(0.,0.,0.);
00051                 }
00052                 else {
00053                         float t=1.f/m_s;
00054                         m_u=SimdPoint3(dx*t,dy*t,dz*t);
00055                         m_o=SimdPoint3(0.f,0.f,0.f);
00056                 }
00057         }
00058         else { // there is some rotation
00059
00060                 // we compute u
00061
00062                 float v(1.f/m_w);
00063                 m_u=SimdPoint3(wx*v,wy*v,wz*v); // normalization
00064
00065                 // decomposition of the translation along u and one orthogonal vector
00066
00067                 SimdPoint3 t(dx,dy,dz);
00068                 m_s=t.dot(m_u); // component along u
00069                 if (fabs(m_s)<SCREWEPSILON)
00070                 {
00071                         //printf("m_s component along u < SCREWEPSILION\n");
00072                         m_s=0.f;
00073                 }
00074                 SimdPoint3 n1(t-(m_s*m_u)); // the remaining part (which is orthogonal to u)
00075
00076                 // now we have to compute o
00077
00078                 //SimdScalar len = n1.length2();
00079                 //(len >= BUM_EPSILON2) {
00080                 if (n1[0] || n1[1] || n1[2]) { // n1 is not the zero vector
00081                         n1.normalize();
00082                         SimdVector3 n1orth=m_u.cross(n1);
00083
00084                         float n2x=SimdCos(0.5f*m_w);
00085                         float n2y=SimdSin(0.5f*m_w);
00086
00087                         m_o=0.5f*t.dot(n1)*(n1+n2x/n2y*n1orth);
00088                 }
00089                 else
00090                 {
00091                         m_o=SimdPoint3(0.f,0.f,0.f);
00092                 }
00093
00094         }
00095
00096 }
00097
00098 //Then, I need to compute Pa, the matrix from the reference (global) frame to
00099 //the screwing frame :
00100
00101
00102 void BU_Screwing::LocalMatrix(SimdTransform &t) const {
00103 //So the whole computations do this : align the Oz axis along the
00104 //      screwing axis (thanks to u), and then find two others orthogonal axes to
00105 //      complete the basis.
00106
00107                 if ((m_u[0]>SCREWEPSILON)||(m_u[0]<-SCREWEPSILON)||(m_u[1]>SCREWEPSILON)||(m_u[1]<-SCREWEPSILON))
00108                 {
00109                         // to avoid numerical problems
00110                         float n=SimdSqrt(m_u[0]*m_u[0]+m_u[1]*m_u[1]);
00111                         float invn=1.0f/n;
00112                         SimdMatrix3x3 mat;
00113
00114                         mat[0][0]=-m_u[1]*invn;
00115                         mat[0][1]=m_u[0]*invn;
00116                         mat[0][2]=0.f;
00117
00118                         mat[1][0]=-m_u[0]*invn*m_u[2];
00119                         mat[1][1]=-m_u[1]*invn*m_u[2];
00120                         mat[1][2]=n;
00121
00122                         mat[2][0]=m_u[0];
00123                         mat[2][1]=m_u[1];
00124                         mat[2][2]=m_u[2];
00125
00126                         t.setOrigin(SimdPoint3(
00127                                   m_o[0]*m_u[1]*invn-m_o[1]*m_u[0]*invn,
00128                                 -(m_o[0]*mat[1][0]+m_o[1]*mat[1][1]+m_o[2]*n),
00129                                 -(m_o[0]*m_u[0]+m_o[1]*m_u[1]+m_o[2]*m_u[2])));
00130
00131                         t.setBasis(mat);
00132
00133                 }
00134                 else {
00135
00136                         SimdMatrix3x3 m;
00137
00138                         m[0][0]=1.;
00139                         m[1][0]=0.;
00140                         m[2][0]=0.;
00141
00142                         m[0][1]=0.f;
00143                         m[1][1]=float(SimdSign(m_u[2]));
00144                         m[2][1]=0.f;
00145
00146                         m[0][2]=0.f;
00147                         m[1][2]=0.f;
00148                         m[2][2]=float(SimdSign(m_u[2]));
00149
00150                         t.setOrigin(SimdPoint3(
00151                                         -m_o[0],
00152                                         -SimdSign(m_u[2])*m_o[1],
00153                                         -SimdSign(m_u[2])*m_o[2]
00154                                 ));
00155                         t.setBasis(m);
00156
00157                 }
00158 }
00159
00160 //gives interpolated transform for time in [0..1] in screwing frame
00161 SimdTransform   BU_Screwing::InBetweenTransform(const SimdTransform& tr,SimdScalar t) const
00162 {
00163         SimdPoint3 org = tr.getOrigin();
00164
00165         SimdPoint3 neworg (
00166         org.x()*SimdCos(m_w*t)-org.y()*SimdSin(m_w*t),
00167         org.x()*SimdSin(m_w*t)+org.y()*SimdCos(m_w*t),
00168         org.z()+m_s*CalculateF(t));
00169
00170         SimdTransform newtr;
00171         newtr.setOrigin(neworg);
00172         SimdMatrix3x3 basis = tr.getBasis();
00173         SimdMatrix3x3 basisorg = tr.getBasis();
00174
00175         SimdQuaternion rot(SimdVector3(0.,0.,1.),m_w*t);
00176         SimdQuaternion tmpOrn;
00177         tr.getBasis().getRotation(tmpOrn);
00178         rot = rot *  tmpOrn;
00179
00180         //to avoid numerical drift, normalize quaternion
00181         rot.normalize();
00182         newtr.setBasis(SimdMatrix3x3(rot));
00183         return newtr;
00184
00185 }
00186
00187
00188 SimdScalar BU_Screwing::CalculateF(SimdScalar t) const
00189 {
00190         SimdScalar result;
00191         if (!m_w)
00192         {
00193                 result = t;
00194         } else
00195         {
00196                 result = ( SimdTan((m_w*t)/2.f) / SimdTan(m_w/2.f));
00197         }
00198         return result;
00199 }
00200
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Screwing.h File Reference

Bullet » NarrowPhaseCollision

BU_Screwing.h File Reference

#include <SimdVector3.h>
#include <SimdPoint3.h>
#include <SimdTransform.h>

Include dependency graph for BU_Screwing.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | BU_Screwing
BU_Screwing implements screwing motion interpolation. More...

Defines

#define | SCREWEPSILON 0.00001f

Define Documentation

#define SCREWEPSILON 0.00001f

Definition at line 26 of file BU_Screwing.h.

Referenced by BU_Screwing::BU_Screwing(), BU_CollisionPair::calcTimeOfImpact(), and BU_Screwing::LocalMatrix().

Generated on Wed May 24 13:58:48 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Screwing.h Source File

Bullet » NarrowPhaseCollision

BU_Screwing.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef B_SCREWING_H
00018 #define B_SCREWING_H
00019
00020
00021 #include <SimdVector3.h>
00022 #include <SimdPoint3.h>
00023 #include <SimdTransform.h>
00024
00025
00026 #define SCREWEPSILON 0.00001f
00027
00029 class BU_Screwing
00030 {
00031 public:
00032
00033
00034         BU_Screwing(const SimdVector3& relLinVel,const SimdVector3& relAngVel);
00035
00036         ~BU_Screwing() {
00037         };
00038
00039         SimdScalar CalculateF(SimdScalar t) const;
00040         //gives interpolated position for time in [0..1] in screwing frame
00041
00042         inline SimdPoint3       InBetweenPosition(const SimdPoint3& pt,SimdScalar t) const
00043         {
00044                 return SimdPoint3(
00045                 pt.x()*SimdCos(m_w*t)-pt.y()*SimdSin(m_w*t),
00046                 pt.x()*SimdSin(m_w*t)+pt.y()*SimdCos(m_w*t),
00047                 pt.z()+m_s*CalculateF(t));
00048         }
00049
00050         inline SimdVector3      InBetweenVector(const SimdVector3& vec,SimdScalar t) const
00051         {
00052                 return SimdVector3(
00053                 vec.x()*SimdCos(m_w*t)-vec.y()*SimdSin(m_w*t),
00054                 vec.x()*SimdSin(m_w*t)+vec.y()*SimdCos(m_w*t),
00055                 vec.z());
00056         }
00057
00058         //gives interpolated transform for time in [0..1] in screwing frame
00059         SimdTransform   InBetweenTransform(const SimdTransform& tr,SimdScalar t) const;
00060
00061
00062         //gives matrix from global frame into screwing frame
00063         void    LocalMatrix(SimdTransform &t) const;
00064
00065         inline const SimdVector3& GetU() const {        return m_u;}
00066         inline const SimdVector3& GetO() const {return m_o;}
00067         inline const SimdScalar GetS() const{ return m_s;}
00068         inline const SimdScalar GetW() const { return m_w;}
00069
00070 private:
00071         float           m_w;
00072         float           m_s;
00073         SimdVector3 m_u;
00074         SimdVector3     m_o;
00075 };
00076
00077 #endif //B_SCREWING_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_StaticMotionState.h File Reference

Bullet » NarrowPhaseCollision

BU_StaticMotionState.h File Reference

#include <CollisionShapes/BU_MotionStateInterface.h>

Include dependency graph for BU_StaticMotionState.h:

Go to the source code of this file.

Classes

class BU_StaticMotionState

Generated on Wed May 24 13:58:49 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_StaticMotionState.h Source File

Bullet » NarrowPhaseCollision

BU_StaticMotionState.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BU_STATIC_MOTIONSTATE
00018 #define BU_STATIC_MOTIONSTATE
00019
00020
00021 #include <CollisionShapes/BU_MotionStateInterface.h>
00022
00023 class BU_StaticMotionState :public BU_MotionStateInterface
00024 {
00025 public:
00026         virtual ~BU_StaticMotionState(){};
00027
00028         virtual void    SetTransform(const SimdTransform& trans)
00029         {
00030                 m_trans = trans;
00031         }
00032         virtual void    GetTransform(SimdTransform& trans) const
00033         {
00034                 trans = m_trans;
00035         }
00036         virtual void    SetPosition(const SimdPoint3& position)
00037         {
00038                 m_trans.setOrigin( position );
00039         }
00040         virtual void    GetPosition(SimdPoint3& position) const
00041         {
00042                 position = m_trans.getOrigin();
00043         }
00044
00045         virtual void    SetOrientation(const SimdQuaternion& orientation)
00046         {
00047                 m_trans.setRotation( orientation);
00048         }
00049         virtual void    GetOrientation(SimdQuaternion& orientation) const
00050         {
00051                 orientation = m_trans.getRotation();
00052         }
00053
00054         virtual void    SetBasis(const SimdMatrix3x3& basis)
00055         {
00056                 m_trans.setBasis( basis);
00057         }
00058         virtual void    GetBasis(SimdMatrix3x3& basis) const
00059         {
00060                 basis = m_trans.getBasis();
00061         }
00062
00063         virtual void    SetLinearVelocity(const SimdVector3& linvel)
00064         {
00065                 m_linearVelocity = linvel;
00066         }
00067         virtual void    GetLinearVelocity(SimdVector3& linvel) const
00068         {
00069                 linvel = m_linearVelocity;
00070         }
00071
00072         virtual void    SetAngularVelocity(const SimdVector3& angvel)
00073         {
00074                 m_angularVelocity = angvel;
00075         }
00076         virtual void    GetAngularVelocity(SimdVector3& angvel) const
00077         {
00078                 angvel = m_angularVelocity;
00079         }
00080
00081
00082
00083 protected:
00084
00085         SimdTransform   m_trans;
00086         SimdVector3             m_angularVelocity;
00087         SimdVector3             m_linearVelocity;
00088
00089 };
00090
00091 #endif //BU_STATIC_MOTIONSTATE
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_VertexPoly.cpp File Reference

Bullet » NarrowPhaseCollision

BU_VertexPoly.cpp File Reference

#include "BU_VertexPoly.h"
#include "BU_Screwing.h"
#include <SimdTransform.h>
#include <SimdPoint3.h>
#include <SimdVector3.h>
#include "BU_AlgebraicPolynomialSolver.h"

Include dependency graph for BU_VertexPoly.cpp:

Go to the source code of this file.

Defines

#define | USE_ALGEBRAIC
#define | BU_Polynomial BU_AlgebraicPolynomialSolver

Functions

bool | TestFuzzyZero (SimdScalar x)

Define Documentation

#define BU_Polynomial BU_AlgebraicPolynomialSolver

Definition at line 27 of file BU_VertexPoly.cpp.

#define USE_ALGEBRAIC

Definition at line 24 of file BU_VertexPoly.cpp.

Function Documentation

bool TestFuzzyZero ( SimdScalar x ) [inline]

Definition at line 33 of file BU_VertexPoly.cpp.

References SimdFabs().

Referenced by BU_VertexPoly::GetTimeOfImpact().

Generated on Wed May 24 13:58:49 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_VertexPoly.cpp Source File

Bullet » NarrowPhaseCollision

BU_VertexPoly.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #include "BU_VertexPoly.h"
00019 #include "BU_Screwing.h"
00020 #include <SimdTransform.h>
00021 #include <SimdPoint3.h>
00022 #include <SimdVector3.h>
00023
00024 #define USE_ALGEBRAIC
00025 #ifdef USE_ALGEBRAIC
00026         #include "BU_AlgebraicPolynomialSolver.h"
00027         #define BU_Polynomial BU_AlgebraicPolynomialSolver
00028 #else
00029         #include "BU_IntervalArithmeticPolynomialSolver.h"
00030         #define BU_Polynomial BU_IntervalArithmeticPolynomialSolver
00031 #endif
00032
00033 inline bool      TestFuzzyZero(SimdScalar x) { return SimdFabs(x) < 0.0001f; }
00034
00035
00036 BU_VertexPoly::BU_VertexPoly()
00037 {
00038
00039 }
00040 //return true if a collision will occur between [0..1]
00041 //false otherwise. If true, minTime contains the time of impact
00042 bool BU_VertexPoly::GetTimeOfImpact(
00043                 const BU_Screwing& screwAB,
00044                 const SimdPoint3& a,
00045                 const SimdVector4& planeEq,
00046                 SimdScalar &minTime,bool swapAB)
00047 {
00048
00049         bool hit = false;
00050
00051         // precondition: s=0 and w= 0 is catched by caller!
00052         if (TestFuzzyZero(screwAB.GetS()) &&
00053                 TestFuzzyZero(screwAB.GetW()))
00054         {
00055                 return false;
00056         }
00057
00058
00059         //case w<>0 and s<> 0
00060         const SimdScalar w=screwAB.GetW();
00061         const SimdScalar s=screwAB.GetS();
00062
00063         SimdScalar coefs[4];
00064         const SimdScalar p=planeEq[0];
00065         const SimdScalar q=planeEq[1];
00066         const SimdScalar r=planeEq[2];
00067         const SimdScalar d=planeEq[3];
00068
00069         const SimdVector3 norm(p,q,r);
00070         BU_Polynomial polynomialSolver;
00071         int numroots = 0;
00072
00073         //SimdScalar eps=1e-80f;
00074         //SimdScalar eps2=1e-100f;
00075
00076         if (TestFuzzyZero(screwAB.GetS()) )
00077         {
00078                 //S = 0 , W <> 0
00079
00080                 //ax^3+bx^2+cx+d=0
00081                 coefs[0]=0.;
00082                 coefs[1]=(-p*a.x()-q*a.y()+r*a.z()-d);
00083                 coefs[2]=-2*p*a.y()+2*q*a.x();
00084                 coefs[3]=p*a.x()+q*a.y()+r*a.z()-d;
00085
00086 //              numroots = polynomialSolver.Solve3Cubic(coefs[0],coefs[1],coefs[2],coefs[3]);
00087                 numroots = polynomialSolver.Solve2QuadraticFull(coefs[1],coefs[2],coefs[3]);
00088
00089         } else
00090         {
00091                 if (TestFuzzyZero(screwAB.GetW()))
00092                 {
00093                         // W = 0 , S <> 0
00094                         //pax+qay+r(az+st)=d
00095
00096                         SimdScalar dist = (d - a.dot(norm));
00097
00098                         if (TestFuzzyZero(r))
00099                         {
00100                                 if (TestFuzzyZero(dist))
00101                                 {
00102                                         // no hit
00103                                 } else
00104                                 {
00105                                         // todo a a' might hit sides of polygon T
00106                                         //printf("unhandled case, w=0,s<>0,r<>0, a a' might hit sides of polygon T \n");
00107                                 }
00108
00109                         } else
00110                         {
00111                                 SimdScalar etoi = (dist)/(r*screwAB.GetS());
00112                                 if (swapAB)
00113                                         etoi *= -1;
00114
00115                                 if (etoi >= 0. && etoi <= minTime)
00116                                 {
00117                                         minTime = etoi;
00118                                         hit = true;
00119                                 }
00120                         }
00121
00122                 } else
00123                 {
00124                                 //ax^3+bx^2+cx+d=0
00125
00126                                 //degenerate coefficients mess things up :(
00127                                 SimdScalar ietsje = (r*s)/SimdTan(w/2.f);
00128                                 if (ietsje*ietsje < 0.01f)
00129                                         ietsje = 0.f;
00130
00131                                 coefs[0]=ietsje;//(r*s)/tan(w/2.);
00132                                 coefs[1]=(-p*a.x()-q*a.y()+r*a.z()-d);
00133                                 coefs[2]=-2.f*p*a.y()+2.f*q*a.x()+ietsje;//((r*s)/(tan(w/2.)));
00134                                 coefs[3]=p*a.x()+q*a.y()+r*a.z()-d;
00135
00136                                 numroots = polynomialSolver.Solve3Cubic(coefs[0],coefs[1],coefs[2],coefs[3]);
00137                 }
00138         }
00139
00140
00141         for (int i=0;i<numroots;i++)
00142         {
00143                 SimdScalar tau = polynomialSolver.GetRoot(i);
00144
00145                 SimdScalar t = 2.f*SimdAtan(tau)/w;
00146                 //tau = tan (wt/2) so 2*atan (tau)/w
00147                 if (swapAB)
00148                 {
00149                         t *= -1.;
00150                 }
00151                 if (t>=0 && t<minTime)
00152                 {
00153                         minTime = t;
00154                         hit = true;
00155                 }
00156         }
00157
00158         return hit;
00159 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_VertexPoly.h File Reference

Bullet » NarrowPhaseCollision

BU_VertexPoly.h File Reference

#include <SimdTransform.h>
#include <SimdPoint3.h>
#include <SimdScalar.h>

Include dependency graph for BU_VertexPoly.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_VertexPoly
BU_VertexPoly implements algebraic time of impact calculation between vertex and a plane. More...

Generated on Wed May 24 13:58:49 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_VertexPoly.h Source File

Bullet » NarrowPhaseCollision

BU_VertexPoly.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef VERTEX_POLY_H
00018 #define VERTEX_POLY_H
00019
00020
00021 class BU_Screwing;
00022 #include <SimdTransform.h>
00023 #include <SimdPoint3.h>
00024 #include <SimdScalar.h>
00025
00027 class BU_VertexPoly
00028 {
00029 public:
00030         BU_VertexPoly();
00031         bool GetTimeOfImpact(
00032                 const BU_Screwing& screwAB,
00033                 const SimdPoint3& vtx,
00034                 const SimdVector4& planeEq,
00035                 SimdScalar &minTime,
00036                 bool swapAB);
00037
00038 private:
00039
00040         //cached data (frame coherency etc.) here
00041
00042 };
00043 #endif //VERTEX_POLY_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BvhTriangleMeshShape.cpp File Reference

Bullet » CollisionShapes

BvhTriangleMeshShape.cpp File Reference

#include "CollisionShapes/BvhTriangleMeshShape.h"
#include "CollisionShapes/OptimizedBvh.h"

Include dependency graph for BvhTriangleMeshShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BvhTriangleMeshShape.cpp Source File

Bullet » CollisionShapes

BvhTriangleMeshShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 //#define DISABLE_BVH
00017
00018
00019 #include "CollisionShapes/BvhTriangleMeshShape.h"
00020 #include "CollisionShapes/OptimizedBvh.h"
00021
00024 BvhTriangleMeshShape::BvhTriangleMeshShape(StridingMeshInterface* meshInterface)
00025 :TriangleMeshShape(meshInterface)
00026 {
00027         //construct bvh from meshInterface
00028 #ifndef DISABLE_BVH
00029
00030         m_bvh = new OptimizedBvh();
00031         m_bvh->Build(meshInterface);
00032
00033 #endif //DISABLE_BVH
00034
00035 }
00036
00037 BvhTriangleMeshShape::~BvhTriangleMeshShape()
00038 {
00039         delete m_bvh;
00040 }
00041
00042 //perform bvh tree traversal and report overlapping triangles to 'callback'
00043 void    BvhTriangleMeshShape::ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00044 {
00045
00046 #ifdef DISABLE_BVH
00047         //brute force traverse all triangles
00048         TriangleMeshShape::ProcessAllTriangles(callback,aabbMin,aabbMax);
00049 #else
00050
00051         //first get all the nodes
00052
00053
00054         struct  MyNodeOverlapCallback : public NodeOverlapCallback
00055         {
00056                 StridingMeshInterface*  m_meshInterface;
00057                 TriangleCallback*               m_callback;
00058                 SimdVector3                             m_triangle[3];
00059
00060
00061                 MyNodeOverlapCallback(TriangleCallback* callback,StridingMeshInterface* meshInterface)
00062                         :m_meshInterface(meshInterface),
00063                         m_callback(callback)
00064                 {
00065                 }
00066
00067                 virtual void ProcessNode(const OptimizedBvhNode* node)
00068                 {
00069                         const unsigned char *vertexbase;
00070                         int numverts;
00071                         PHY_ScalarType type;
00072                         int stride;
00073                         const unsigned char *indexbase;
00074                         int indexstride;
00075                         int numfaces;
00076                         PHY_ScalarType indicestype;
00077
00078
00079                         m_meshInterface->getLockedReadOnlyVertexIndexBase(
00080                                 &vertexbase,
00081                                 numverts,
00082                                 type,
00083                                 stride,
00084                                 &indexbase,
00085                                 indexstride,
00086                                 numfaces,
00087                                 indicestype,
00088                                 node->m_subPart);
00089
00090                         int* gfxbase = (int*)(indexbase+node->m_triangleIndex*indexstride);
00091
00092                         const SimdVector3& meshScaling = m_meshInterface->getScaling();
00093                         for (int j=2;j>=0;j--)
00094                         {
00095
00096                                 int graphicsindex = gfxbase[j];
00097 #ifdef DEBUG_TRIANGLE_MESH
00098                                 printf("%d ,",graphicsindex);
00099 #endif //DEBUG_TRIANGLE_MESH
00100                                 float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
00101
00102                                 m_triangle[j] = SimdVector3(
00103                                         graphicsbase[0]*meshScaling.getX(),
00104                                         graphicsbase[1]*meshScaling.getY(),
00105                                         graphicsbase[2]*meshScaling.getZ());
00106 #ifdef DEBUG_TRIANGLE_MESH
00107                                 printf("triangle vertices:%f,%f,%f\n",triangle[j].x(),triangle[j].y(),triangle[j].z());
00108 #endif //DEBUG_TRIANGLE_MESH
00109                         }
00110
00111                         m_callback->ProcessTriangle(m_triangle,node->m_subPart,node->m_triangleIndex);
00112                         m_meshInterface->unLockReadOnlyVertexBase(node->m_subPart);
00113                 }
00114
00115         };
00116
00117         MyNodeOverlapCallback   myNodeCallback(callback,m_meshInterface);
00118
00119         m_bvh->ReportAabbOverlappingNodex(&myNodeCallback,aabbMin,aabbMax);
00120
00121
00122 #endif//DISABLE_BVH
00123
00124
00125 }
00126
00127
00128 void    BvhTriangleMeshShape::setLocalScaling(const SimdVector3& scaling)
00129 {
00130         if ((getLocalScaling() -scaling).length2() > SIMD_EPSILON)
00131         {
00132                 TriangleMeshShape::setLocalScaling(scaling);
00133                 delete m_bvh;
00134                 m_bvh = new OptimizedBvh();
00135                 m_bvh->Build(m_meshInterface);
00136                 //rebuild the bvh...
00137         }
00138 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BvhTriangleMeshShape.h File Reference

Bullet » CollisionShapes

BvhTriangleMeshShape.h File Reference

#include "CollisionShapes/TriangleMeshShape.h"
#include "CollisionShapes/OptimizedBvh.h"

Include dependency graph for BvhTriangleMeshShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BvhTriangleMeshShape
Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. More...

Generated on Wed May 24 13:58:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BvhTriangleMeshShape.h Source File

Bullet » CollisionShapes

BvhTriangleMeshShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef BVH_TRIANGLE_MESH_SHAPE_H
00017 #define BVH_TRIANGLE_MESH_SHAPE_H
00018
00019 #include "CollisionShapes/TriangleMeshShape.h"
00020 #include "CollisionShapes/OptimizedBvh.h"
00021
00024 class BvhTriangleMeshShape : public TriangleMeshShape
00025 {
00026
00027         OptimizedBvh*   m_bvh;
00028
00029
00030 public:
00031         BvhTriangleMeshShape(StridingMeshInterface* meshInterface);
00032
00033         virtual ~BvhTriangleMeshShape();
00034
00035
00036         /*
00037         virtual int     GetShapeType() const
00038         {
00039                 return TRIANGLE_MESH_SHAPE_PROXYTYPE;
00040         }
00041         */
00042
00043
00044
00045         virtual void    ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00046
00047
00048         //debugging
00049         virtual char*   GetName()const {return "BVHTRIANGLEMESH";}
00050
00051
00052         virtual void    setLocalScaling(const SimdVector3& scaling);
00053
00054
00055
00056 };
00057
00058 #endif //BVH_TRIANGLE_MESH_SHAPE_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsController.cpp File Reference

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsController.cpp File Reference

#include "CcdPhysicsController.h"
#include "Dynamics/RigidBody.h"
#include "PHY_IMotionState.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "BroadphaseCollision/BroadphaseInterface.h"
#include "CollisionShapes/ConvexShape.h"
#include "CcdPhysicsEnvironment.h"
#include "SimdTransformUtil.h"
#include "CollisionShapes/SphereShape.h"
#include "CollisionShapes/ConeShape.h"
#include "Dynamics/MassProps.h"

Include dependency graph for CcdPhysicsController.cpp:

Go to the source code of this file.

Variables

float | gDeactivationTime = 2.f
todo: fill all the empty CcdPhysicsController methods, hook them up to the RigidBody class
bool | gDisableDeactivation = false
float | gLinearSleepingTreshold = 0.8f
float | gAngularSleepingTreshold = 1.0f
SimdVector3 | startVel (0, 0, 0)

Variable Documentation

float gAngularSleepingTreshold = 1.0f

Definition at line 38 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::setDeactivationAngularTreshold(), and CcdPhysicsController::UpdateDeactivation().

float gDeactivationTime = 2.f

todo: fill all the empty CcdPhysicsController methods, hook them up to the RigidBody class

Definition at line 34 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::setDeactivationTime(), and CcdPhysicsController::wantsSleeping().

bool gDisableDeactivation = false

Definition at line 35 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), and CcdPhysicsController::wantsSleeping().

float gLinearSleepingTreshold = 0.8f

Definition at line 37 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::setDeactivationLinearTreshold(), and CcdPhysicsController::UpdateDeactivation().

SimdVector3 startVel(0, 0, 0)

Referenced by CcdPhysicsController::CcdPhysicsController().

Generated on Wed May 24 13:58:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsController.cpp Source File

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsController.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "CcdPhysicsController.h"
00017
00018 #include "Dynamics/RigidBody.h"
00019 #include "PHY_IMotionState.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h"
00021 #include "BroadphaseCollision/BroadphaseInterface.h"
00022 #include "CollisionShapes/ConvexShape.h"
00023 #include "CcdPhysicsEnvironment.h"
00024 #include "SimdTransformUtil.h"
00025
00026 #include "CollisionShapes/SphereShape.h"
00027 #include "CollisionShapes/ConeShape.h"
00028
00029 class BP_Proxy;
00030
00032
00033 //'temporarily' global variables
00034 float   gDeactivationTime = 2.f;
00035 bool    gDisableDeactivation = false;
00036
00037 float gLinearSleepingTreshold = 0.8f;
00038 float gAngularSleepingTreshold = 1.0f;
00039
00040 #include "Dynamics/MassProps.h"
00041
00042 SimdVector3 startVel(0,0,0);//-10000);
00043 CcdPhysicsController::CcdPhysicsController (const CcdConstructionInfo& ci)
00044 :m_cci(ci)
00045 {
00046         m_collisionDelay = 0;
00047         m_newClientInfo = 0;
00048
00049         m_MotionState = ci.m_MotionState;
00050
00051
00052
00053         CreateRigidbody();
00054
00055
00056
00057         #ifdef WIN32
00058         if (m_body->getInvMass())
00059                 m_body->setLinearVelocity(startVel);
00060         #endif
00061
00062 }
00063
00064 SimdTransform   CcdPhysicsController::GetTransformFromMotionState(PHY_IMotionState* motionState)
00065 {
00066         SimdTransform trans;
00067         float tmp[3];
00068         motionState->getWorldPosition(tmp[0],tmp[1],tmp[2]);
00069         trans.setOrigin(SimdVector3(tmp[0],tmp[1],tmp[2]));
00070
00071         SimdQuaternion orn;
00072         motionState->getWorldOrientation(orn[0],orn[1],orn[2],orn[3]);
00073         trans.setRotation(orn);
00074         return trans;
00075
00076 }
00077
00078 void CcdPhysicsController::CreateRigidbody()
00079 {
00080
00081         SimdTransform trans = GetTransformFromMotionState(m_cci.m_MotionState);
00082
00083         MassProps mp(m_cci.m_mass, m_cci.m_localInertiaTensor);
00084
00085         m_body = new RigidBody(mp,0,0,m_cci.m_friction,m_cci.m_restitution);
00086         m_body->m_collisionShape = m_cci.m_collisionShape;
00087
00088
00089         //
00090         // init the rigidbody properly
00091         //
00092
00093         m_body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor);
00094         //setMassProps this also sets collisionFlags
00095         m_body->m_collisionFlags = m_cci.m_collisionFlags;
00096
00097         m_body->setGravity( m_cci.m_gravity);
00098         m_body->setDamping(m_cci.m_linearDamping, m_cci.m_angularDamping);
00099         m_body->setCenterOfMassTransform( trans );
00100
00101
00102 }
00103
00104 CcdPhysicsController::~CcdPhysicsController()
00105 {
00106         //will be reference counted, due to sharing
00107         m_cci.m_physicsEnv->removeCcdPhysicsController(this);
00108         delete m_MotionState;
00109         delete m_body;
00110 }
00111
00115 bool            CcdPhysicsController::SynchronizeMotionStates(float time)
00116 {
00117         //sync non-static to motionstate, and static from motionstate (todo: add kinematic etc.)
00118
00119         if (!m_body->IsStatic())
00120         {
00121                 const SimdVector3& worldPos = m_body->getCenterOfMassPosition();
00122                 m_MotionState->setWorldPosition(worldPos[0],worldPos[1],worldPos[2]);
00123
00124                 const SimdQuaternion& worldquat = m_body->getOrientation();
00125                 m_MotionState->setWorldOrientation(worldquat[0],worldquat[1],worldquat[2],worldquat[3]);
00126
00127                 m_MotionState->calculateWorldTransformations();
00128
00129                 float scale[3];
00130                 m_MotionState->getWorldScaling(scale[0],scale[1],scale[2]);
00131                 SimdVector3 scaling(scale[0],scale[1],scale[2]);
00132                 GetCollisionShape()->setLocalScaling(scaling);
00133         } else
00134         {
00135                 SimdVector3 worldPos;
00136                 SimdQuaternion worldquat;
00137
00138                 m_MotionState->getWorldPosition(worldPos[0],worldPos[1],worldPos[2]);
00139                 m_MotionState->getWorldOrientation(worldquat[0],worldquat[1],worldquat[2],worldquat[3]);
00140                 SimdTransform oldTrans = m_body->getCenterOfMassTransform();
00141                 SimdTransform newTrans(worldquat,worldPos);
00142
00143                 m_body->setCenterOfMassTransform(newTrans);
00144                 //need to keep track of previous position for friction effects...
00145
00146                 m_MotionState->calculateWorldTransformations();
00147
00148                 float scale[3];
00149                 m_MotionState->getWorldScaling(scale[0],scale[1],scale[2]);
00150                 SimdVector3 scaling(scale[0],scale[1],scale[2]);
00151                 GetCollisionShape()->setLocalScaling(scaling);
00152         }
00153         return true;
00154
00155 }
00156
00161 void            CcdPhysicsController::WriteMotionStateToDynamics(bool nondynaonly)
00162 {
00163
00164 }
00165 void            CcdPhysicsController::WriteDynamicsToMotionState()
00166 {
00167 }
00168                 // controller replication
00169 void            CcdPhysicsController::PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl)
00170 {
00171         m_MotionState = motionstate;
00172
00173
00174
00175         m_body = 0;
00176         CreateRigidbody();
00177
00178         m_cci.m_physicsEnv->addCcdPhysicsController(this);
00179
00180
00181 /*      SM_Object* dynaparent=0;
00182         SumoPhysicsController* sumoparentctrl = (SumoPhysicsController* )parentctrl;
00183
00184         if (sumoparentctrl)
00185         {
00186                 dynaparent = sumoparentctrl->GetSumoObject();
00187         }
00188
00189         SM_Object* orgsumoobject = m_sumoObj;
00190
00191
00192         m_sumoObj       =       new SM_Object(
00193                 orgsumoobject->getShapeHandle(),
00194                 orgsumoobject->getMaterialProps(),
00195                 orgsumoobject->getShapeProps(),
00196                 dynaparent);
00197
00198         m_sumoObj->setRigidBody(orgsumoobject->isRigidBody());
00199
00200         m_sumoObj->setMargin(orgsumoobject->getMargin());
00201         m_sumoObj->setPosition(orgsumoobject->getPosition());
00202         m_sumoObj->setOrientation(orgsumoobject->getOrientation());
00203         //if it is a dyna, register for a callback
00204         m_sumoObj->registerCallback(*this);
00205
00206         m_sumoScene->add(* (m_sumoObj));
00207         */
00208
00209
00210
00211 }
00212
00213                 // kinematic methods
00214 void            CcdPhysicsController::RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local)
00215 {
00216         if (m_body)
00217         {
00218                 m_body->activate();
00219
00220                 SimdVector3 dloc(dlocX,dlocY,dlocZ);
00221                 SimdTransform xform = m_body->getCenterOfMassTransform();
00222
00223                 if (local)
00224                 {
00225                         dloc = xform.getBasis()*dloc;
00226                 }
00227
00228                 xform.setOrigin(xform.getOrigin() + dloc);
00229                 m_body->setCenterOfMassTransform(xform);
00230         }
00231
00232 }
00233
00234 void            CcdPhysicsController::RelativeRotate(const float rotval[9],bool local)
00235 {
00236         if (m_body )
00237         {
00238                 m_body->activate();
00239
00240                 SimdMatrix3x3 drotmat(  rotval[0],rotval[1],rotval[2],
00241                                                                 rotval[4],rotval[5],rotval[6],
00242                                                                 rotval[8],rotval[9],rotval[10]);
00243
00244
00245                 SimdMatrix3x3 currentOrn;
00246                 GetWorldOrientation(currentOrn);
00247
00248                 SimdTransform xform = m_body->getCenterOfMassTransform();
00249
00250                 xform.setBasis(xform.getBasis()*(local ?
00251                 drotmat : (currentOrn.inverse() * drotmat * currentOrn)));
00252
00253                 m_body->setCenterOfMassTransform(xform);
00254         }
00255
00256 }
00257
00258 void CcdPhysicsController::GetWorldOrientation(SimdMatrix3x3& mat)
00259 {
00260         float orn[4];
00261         m_MotionState->getWorldOrientation(orn[0],orn[1],orn[2],orn[3]);
00262         SimdQuaternion quat(orn[0],orn[1],orn[2],orn[3]);
00263         mat.setRotation(quat);
00264 }
00265
00266 void            CcdPhysicsController::getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal)
00267 {
00268         SimdQuaternion q = m_body->getCenterOfMassTransform().getRotation();
00269         quatImag0 = q[0];
00270         quatImag1 = q[1];
00271         quatImag2 = q[2];
00272         quatReal = q[3];
00273 }
00274 void            CcdPhysicsController::setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal)
00275 {
00276         m_body->activate();
00277
00278         SimdTransform xform  = m_body->getCenterOfMassTransform();
00279         xform.setRotation(SimdQuaternion(quatImag0,quatImag1,quatImag2,quatReal));
00280         m_body->setCenterOfMassTransform(xform);
00281
00282 }
00283
00284 void            CcdPhysicsController::setPosition(float posX,float posY,float posZ)
00285 {
00286         m_body->activate();
00287
00288         SimdTransform xform  = m_body->getCenterOfMassTransform();
00289         xform.setOrigin(SimdVector3(posX,posY,posZ));
00290         m_body->setCenterOfMassTransform(xform);
00291
00292 }
00293 void            CcdPhysicsController::resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ)
00294 {
00295 }
00296
00297 void            CcdPhysicsController::getPosition(PHY__Vector3& pos) const
00298 {
00299         const SimdTransform& xform = m_body->getCenterOfMassTransform();
00300         pos[0] = xform.getOrigin().x();
00301         pos[1] = xform.getOrigin().y();
00302         pos[2] = xform.getOrigin().z();
00303 }
00304
00305 void            CcdPhysicsController::setScaling(float scaleX,float scaleY,float scaleZ)
00306 {
00307         if (!SimdFuzzyZero(m_cci.m_scaling.x()-scaleX) ||
00308                 !SimdFuzzyZero(m_cci.m_scaling.y()-scaleY) ||
00309                 !SimdFuzzyZero(m_cci.m_scaling.z()-scaleZ))
00310         {
00311                 m_cci.m_scaling = SimdVector3(scaleX,scaleY,scaleZ);
00312
00313                 if (m_body && m_body->GetCollisionShape())
00314                 {
00315                         m_body->GetCollisionShape()->setLocalScaling(m_cci.m_scaling);
00316                         m_body->GetCollisionShape()->CalculateLocalInertia(m_cci.m_mass, m_cci.m_localInertiaTensor);
00317                         m_body->setMassProps(m_cci.m_mass, m_cci.m_localInertiaTensor * m_cci.m_inertiaFactor);
00318                 }
00319         }
00320 }
00321
00322                 // physics methods
00323 void            CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local)
00324 {
00325         SimdVector3 torque(torqueX,torqueY,torqueZ);
00326         SimdTransform xform = m_body->getCenterOfMassTransform();
00327         if (local)
00328         {
00329                 torque  = xform.getBasis()*torque;
00330         }
00331         m_body->applyTorque(torque);
00332 }
00333
00334 void            CcdPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bool local)
00335 {
00336         SimdVector3 force(forceX,forceY,forceZ);
00337         SimdTransform xform = m_body->getCenterOfMassTransform();
00338         if (local)
00339         {
00340                 force   = xform.getBasis()*force;
00341         }
00342         m_body->applyCentralForce(force);
00343 }
00344 void            CcdPhysicsController::SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local)
00345 {
00346         SimdVector3 angvel(ang_velX,ang_velY,ang_velZ);
00347         if (angvel.length2() > (SIMD_EPSILON*SIMD_EPSILON))
00348         {
00349                 m_body->activate();
00350         }
00351
00352         {
00353                 SimdTransform xform = m_body->getCenterOfMassTransform();
00354                 if (local)
00355                 {
00356                         angvel  = xform.getBasis()*angvel;
00357                 }
00358
00359                 m_body->setAngularVelocity(angvel);
00360         }
00361
00362 }
00363 void            CcdPhysicsController::SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local)
00364 {
00365
00366         SimdVector3 linVel(lin_velX,lin_velY,lin_velZ);
00367         if (linVel.length2() > (SIMD_EPSILON*SIMD_EPSILON))
00368         {
00369                 m_body->activate();
00370         }
00371
00372         {
00373                 SimdTransform xform = m_body->getCenterOfMassTransform();
00374                 if (local)
00375                 {
00376                         linVel  = xform.getBasis()*linVel;
00377                 }
00378                 m_body->setLinearVelocity(linVel);
00379         }
00380 }
00381 void            CcdPhysicsController::applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ)
00382 {
00383         SimdVector3 impulse(impulseX,impulseY,impulseZ);
00384
00385         if (impulse.length2() > (SIMD_EPSILON*SIMD_EPSILON))
00386         {
00387                 m_body->activate();
00388
00389                 SimdVector3 pos(attachX,attachY,attachZ);
00390
00391                 m_body->activate();
00392
00393                 m_body->applyImpulse(impulse,pos);
00394         }
00395
00396 }
00397 void            CcdPhysicsController::SetActive(bool active)
00398 {
00399 }
00400                 // reading out information from physics
00401 void            CcdPhysicsController::GetLinearVelocity(float& linvX,float& linvY,float& linvZ)
00402 {
00403         const SimdVector3& linvel = this->m_body->getLinearVelocity();
00404         linvX = linvel.x();
00405         linvY = linvel.y();
00406         linvZ = linvel.z();
00407
00408 }
00409
00410 void            CcdPhysicsController::GetAngularVelocity(float& angVelX,float& angVelY,float& angVelZ)
00411 {
00412         const SimdVector3& angvel= m_body->getAngularVelocity();
00413         angVelX = angvel.x();
00414         angVelY = angvel.y();
00415         angVelZ = angvel.z();
00416 }
00417
00418 void            CcdPhysicsController::GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ)
00419 {
00420         SimdVector3 pos(posX,posY,posZ);
00421         SimdVector3 rel_pos = pos-m_body->getCenterOfMassPosition();
00422         SimdVector3 linvel = m_body->getVelocityInLocalPoint(rel_pos);
00423         linvX = linvel.x();
00424         linvY = linvel.y();
00425         linvZ = linvel.z();
00426 }
00427 void            CcdPhysicsController::getReactionForce(float& forceX,float& forceY,float& forceZ)
00428 {
00429 }
00430
00431                 // dyna's that are rigidbody are free in orientation, dyna's with non-rigidbody are restricted
00432 void            CcdPhysicsController::setRigidBody(bool rigid)
00433 {
00434         if (!rigid)
00435         {
00436                 //fake it for now
00437                 SimdVector3 inertia = m_body->getInvInertiaDiagLocal();
00438                 inertia[1] = 0.f;
00439                 m_body->setInvInertiaDiagLocal(inertia);
00440                 m_body->updateInertiaTensor();
00441         }
00442 }
00443
00444                 // clientinfo for raycasts for example
00445 void*           CcdPhysicsController::getNewClientInfo()
00446 {
00447         return m_newClientInfo;
00448 }
00449 void            CcdPhysicsController::setNewClientInfo(void* clientinfo)
00450 {
00451         m_newClientInfo = clientinfo;
00452 }
00453
00454
00455 void    CcdPhysicsController::UpdateDeactivation(float timeStep)
00456 {
00457         if ( (m_body->GetActivationState() == ISLAND_SLEEPING) || (m_body->GetActivationState() == DISABLE_DEACTIVATION))
00458                 return;
00459
00460         if ((m_body->getLinearVelocity().length2() < gLinearSleepingTreshold*gLinearSleepingTreshold) &&
00461                 (m_body->getAngularVelocity().length2() < gAngularSleepingTreshold*gAngularSleepingTreshold))
00462         {
00463                 m_body->m_deactivationTime += timeStep;
00464         } else
00465         {
00466                 m_body->m_deactivationTime=0.f;
00467                 m_body->SetActivationState(0);
00468         }
00469
00470 }
00471
00472 bool CcdPhysicsController::wantsSleeping()
00473 {
00474
00475         if (m_body->GetActivationState() == DISABLE_DEACTIVATION)
00476                 return false;
00477
00478         //disable deactivation
00479         if (gDisableDeactivation || (gDeactivationTime == 0.f))
00480                 return false;
00481
00482         if ( (m_body->GetActivationState() == ISLAND_SLEEPING) || (m_body->GetActivationState() == WANTS_DEACTIVATION))
00483                 return true;
00484
00485         if (m_body->m_deactivationTime> gDeactivationTime)
00486         {
00487                 return true;
00488         }
00489         return false;
00490 }
00491
00492 PHY_IPhysicsController* CcdPhysicsController::GetReplica()
00493 {
00494         //very experimental, shape sharing is not implemented yet.
00495         //just support SphereShape/ConeShape for now
00496
00497         CcdConstructionInfo cinfo = m_cci;
00498         if (cinfo.m_collisionShape)
00499         {
00500                 switch (cinfo.m_collisionShape->GetShapeType())
00501                 {
00502                 case SPHERE_SHAPE_PROXYTYPE:
00503                         {
00504                                 SphereShape* orgShape = (SphereShape*)cinfo.m_collisionShape;
00505                                 cinfo.m_collisionShape = new SphereShape(*orgShape);
00506                                 break;
00507                         }
00508
00509                         case CONE_SHAPE_PROXYTYPE:
00510                         {
00511                                 ConeShape* orgShape = (ConeShape*)cinfo.m_collisionShape;
00512                                 cinfo.m_collisionShape = new ConeShape(*orgShape);
00513                                 break;
00514                         }
00515
00516
00517                 default:
00518                         {
00519                                 return 0;
00520                         }
00521                 }
00522         }
00523
00524         cinfo.m_MotionState = new DefaultMotionState();
00525
00526         CcdPhysicsController* replica = new CcdPhysicsController(cinfo);
00527         return replica;
00528 }
00529
00534
00535 DefaultMotionState::DefaultMotionState()
00536 {
00537         m_worldTransform.setIdentity();
00538 }
00539
00540
00541 DefaultMotionState::~DefaultMotionState()
00542 {
00543
00544 }
00545
00546 void    DefaultMotionState::getWorldPosition(float& posX,float& posY,float& posZ)
00547 {
00548         posX = m_worldTransform.getOrigin().x();
00549         posY = m_worldTransform.getOrigin().y();
00550         posZ = m_worldTransform.getOrigin().z();
00551 }
00552
00553 void    DefaultMotionState::getWorldScaling(float& scaleX,float& scaleY,float& scaleZ)
00554 {
00555         scaleX = 1.;
00556         scaleY = 1.;
00557         scaleZ = 1.;
00558 }
00559
00560 void    DefaultMotionState::getWorldOrientation(float& quatIma0,float& quatIma1,float& quatIma2,float& quatReal)
00561 {
00562         quatIma0 = m_worldTransform.getRotation().x();
00563         quatIma1 = m_worldTransform.getRotation().y();
00564         quatIma2 = m_worldTransform.getRotation().z();
00565         quatReal = m_worldTransform.getRotation()[3];
00566 }
00567
00568 void    DefaultMotionState::setWorldPosition(float posX,float posY,float posZ)
00569 {
00570         SimdPoint3 pos(posX,posY,posZ);
00571         m_worldTransform.setOrigin( pos );
00572 }
00573
00574 void    DefaultMotionState::setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal)
00575 {
00576         SimdQuaternion orn(quatIma0,quatIma1,quatIma2,quatReal);
00577         m_worldTransform.setRotation( orn );
00578 }
00579
00580 void    DefaultMotionState::calculateWorldTransformations()
00581 {
00582
00583 }
00584
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsController.h File Reference

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsController.h File Reference

#include "PHY_IPhysicsController.h"
#include "SimdVector3.h"
#include "SimdScalar.h"
#include "SimdMatrix3x3.h"
#include "SimdTransform.h"
#include "Dynamics/RigidBody.h"
#include "PHY_IMotionState.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for CcdPhysicsController.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | CcdConstructionInfo
class | CcdPhysicsController
CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution. More...
class | DefaultMotionState
DefaultMotionState implements standard motionstate, using SimdTransform. More...

Variables

float | gDeactivationTime
todo: fill all the empty CcdPhysicsController methods, hook them up to the RigidBody class
float | gLinearSleepingTreshold
float | gAngularSleepingTreshold
bool | gDisableDeactivation

Variable Documentation

float gAngularSleepingTreshold

Definition at line 38 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::setDeactivationAngularTreshold(), and CcdPhysicsController::UpdateDeactivation().

float gDeactivationTime

todo: fill all the empty CcdPhysicsController methods, hook them up to the RigidBody class

Definition at line 34 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::setDeactivationTime(), and CcdPhysicsController::wantsSleeping().

bool gDisableDeactivation

Definition at line 35 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), and CcdPhysicsController::wantsSleeping().

float gLinearSleepingTreshold

Definition at line 37 of file CcdPhysicsController.cpp.

Referenced by CcdPhysicsEnvironment::setDeactivationLinearTreshold(), and CcdPhysicsController::UpdateDeactivation().

Generated on Wed May 24 13:58:51 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsController.h Source File

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsController.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef BULLET2_PHYSICSCONTROLLER_H
00018 #define BULLET2_PHYSICSCONTROLLER_H
00019
00020 #include "PHY_IPhysicsController.h"
00021
00024 #include "SimdVector3.h"
00025 #include "SimdScalar.h"
00026 #include "SimdMatrix3x3.h"
00027 #include "SimdTransform.h"
00028 #include "Dynamics/RigidBody.h"
00029
00030 #include "PHY_IMotionState.h"
00031
00032 #include "BroadphaseCollision/BroadphaseProxy.h" //for CollisionShape access
00033 class CollisionShape;
00034
00035 extern float gDeactivationTime;
00036 extern float gLinearSleepingTreshold;
00037 extern float gAngularSleepingTreshold;
00038 extern bool gDisableDeactivation;
00039 class CcdPhysicsEnvironment;
00040
00041
00042 struct CcdConstructionInfo
00043 {
00044         CcdConstructionInfo()
00045                 : m_gravity(0,0,0),
00046                 m_mass(0.f),
00047                 m_restitution(0.1f),
00048                 m_friction(0.5f),
00049                 m_linearDamping(0.1f),
00050                 m_angularDamping(0.1f),
00051                 m_MotionState(0),
00052                 m_physicsEnv(0),
00053                 m_inertiaFactor(1.f),
00054                 m_scaling(1.f,1.f,1.f),
00055                 m_collisionFlags(0)
00056         {
00057         }
00058
00059         SimdVector3     m_localInertiaTensor;
00060         SimdVector3     m_gravity;
00061         SimdVector3     m_scaling;
00062         SimdScalar      m_mass;
00063         SimdScalar      m_restitution;
00064         SimdScalar      m_friction;
00065         SimdScalar      m_linearDamping;
00066         SimdScalar      m_angularDamping;
00067         int                     m_collisionFlags;
00068
00069         CollisionShape*                 m_collisionShape;
00070         class   PHY_IMotionState*                       m_MotionState;
00071
00072         CcdPhysicsEnvironment*  m_physicsEnv; //needed for self-replication
00073         float   m_inertiaFactor;//tweak the inertia (hooked up to Blender 'formfactor'
00074 };
00075
00076
00077 class RigidBody;
00078
00080 class CcdPhysicsController : public PHY_IPhysicsController
00081 {
00082         RigidBody* m_body;
00083         class   PHY_IMotionState*                       m_MotionState;
00084
00085
00086         void*           m_newClientInfo;
00087
00088         CcdConstructionInfo     m_cci;//needed for replication
00089         void GetWorldOrientation(SimdMatrix3x3& mat);
00090
00091         void CreateRigidbody();
00092
00093         public:
00094
00095                 int                             m_collisionDelay;
00096
00097
00098                 CcdPhysicsController (const CcdConstructionInfo& ci);
00099
00100                 virtual ~CcdPhysicsController();
00101
00102
00103                 RigidBody* GetRigidBody() { return m_body;}
00104
00105                 CollisionShape* GetCollisionShape() {
00106                         return m_body->GetCollisionShape();
00107                 }
00109                 // PHY_IPhysicsController interface
00111
00112
00116                 virtual bool            SynchronizeMotionStates(float time);
00121                 virtual void            WriteMotionStateToDynamics(bool nondynaonly);
00122                 virtual void            WriteDynamicsToMotionState();
00123                 // controller replication
00124                 virtual void            PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl);
00125
00126                 // kinematic methods
00127                 virtual void            RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local);
00128                 virtual void            RelativeRotate(const float drot[9],bool local);
00129                 virtual void            getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal);
00130                 virtual void            setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal);
00131                 virtual void            setPosition(float posX,float posY,float posZ);
00132                 virtual void            getPosition(PHY__Vector3&       pos) const;
00133
00134                 virtual void            setScaling(float scaleX,float scaleY,float scaleZ);
00135
00136                 // physics methods
00137                 virtual void            ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local);
00138                 virtual void            ApplyForce(float forceX,float forceY,float forceZ,bool local);
00139                 virtual void            SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local);
00140                 virtual void            SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local);
00141                 virtual void            applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ);
00142                 virtual void            SetActive(bool active);
00143
00144                 // reading out information from physics
00145                 virtual void            GetLinearVelocity(float& linvX,float& linvY,float& linvZ);
00146                 virtual void            GetAngularVelocity(float& angVelX,float& angVelY,float& angVelZ);
00147                 virtual void            GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ);
00148                 virtual void            getReactionForce(float& forceX,float& forceY,float& forceZ);
00149
00150                 // dyna's that are rigidbody are free in orientation, dyna's with non-rigidbody are restricted
00151                 virtual void            setRigidBody(bool rigid);
00152
00153
00154                 virtual void            resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ);
00155
00156                 // clientinfo for raycasts for example
00157                 virtual void*                           getNewClientInfo();
00158                 virtual void                            setNewClientInfo(void* clientinfo);
00159                 virtual PHY_IPhysicsController* GetReplica();
00160
00161
00162                 virtual void    calcXform() {} ;
00163                 virtual void SetMargin(float margin) {};
00164                 virtual float GetMargin() const {return 0.f;};
00165
00166
00167                 bool    wantsSleeping();
00168
00169                 void    UpdateDeactivation(float timeStep);
00170
00171                 static SimdTransform    GetTransformFromMotionState(PHY_IMotionState* motionState);
00172
00173                 void    SetAabb(const SimdVector3& aabbMin,const SimdVector3& aabbMax);
00174
00175
00176                 class   PHY_IMotionState*                       GetMotionState()
00177                 {
00178                         return m_MotionState;
00179                 }
00180
00181                 const class     PHY_IMotionState*                       GetMotionState() const
00182                 {
00183                         return m_MotionState;
00184                 }
00185
00186
00187 };
00188
00189
00190
00191
00193 class   DefaultMotionState : public PHY_IMotionState
00194
00195 {
00196         public:
00197                 DefaultMotionState();
00198
00199                 virtual ~DefaultMotionState();
00200
00201                 virtual void    getWorldPosition(float& posX,float& posY,float& posZ);
00202                 virtual void    getWorldScaling(float& scaleX,float& scaleY,float& scaleZ);
00203                 virtual void    getWorldOrientation(float& quatIma0,float& quatIma1,float& quatIma2,float& quatReal);
00204
00205                 virtual void    setWorldPosition(float posX,float posY,float posZ);
00206                 virtual void    setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal);
00207
00208                 virtual void    calculateWorldTransformations();
00209
00210                 SimdTransform   m_worldTransform;
00211
00212 };
00213
00214
00215 #endif //BULLET2_PHYSICSCONTROLLER_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsEnvironment.cpp File Reference

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsEnvironment.cpp File Reference

#include "CcdPhysicsEnvironment.h"
#include "CcdPhysicsController.h"
#include <algorithm>
#include "SimdTransform.h"
#include "Dynamics/RigidBody.h"
#include "BroadphaseCollision/BroadphaseInterface.h"
#include "BroadphaseCollision/SimpleBroadphase.h"
#include "BroadphaseCollision/AxisSweep3.h"
#include "CollisionDispatch/CollisionWorld.h"
#include "CollisionShapes/ConvexShape.h"
#include "CollisionShapes/ConeShape.h"
#include "BroadphaseCollision/Dispatcher.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "CollisionShapes/TriangleMeshShape.h"
#include "ConstraintSolver/OdeConstraintSolver.h"
#include "ConstraintSolver/SimpleConstraintSolver.h"
#include "quickprof.h"
#include "IDebugDraw.h"
#include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
#include "NarrowPhaseCollision/SubSimplexConvexCast.h"
#include "NarrowPhaseCollision/GjkConvexCast.h"
#include "NarrowPhaseCollision/ContinuousConvexCollision.h"
#include "CollisionDispatch/CollisionDispatcher.h"
#include "PHY_IMotionState.h"
#include "CollisionDispatch/EmptyCollisionAlgorithm.h"
#include "CollisionDispatch/UnionFind.h"
#include "CollisionShapes/SphereShape.h"
#include "AabbUtil2.h"
#include "ConstraintSolver/ConstraintSolver.h"
#include "ConstraintSolver/Point2PointConstraint.h"
#include "ConstraintSolver/HingeConstraint.h"
#include "ConstraintSolver/ContactConstraint.h"
#include <stdio.h>

Include dependency graph for CcdPhysicsEnvironment.cpp:

Go to the source code of this file.

Classes

struct | FilterClosestRayResultCallback

Functions

static void | DrawAabb (IDebugDraw *debugDrawer, const SimdVector3 &from, const SimdVector3 &to, const SimdVector3 &color)

Variables

bool | useIslands = true
static int | gConstraintUid = 1

Function Documentation

static void DrawAabb | ( | IDebugDraw * | debugDrawer,
 |  | const SimdVector3 & | from,
 |  | const SimdVector3 & | to,
 |  | const SimdVector3 & | color
 | ) | [static]

Definition at line 289 of file CcdPhysicsEnvironment.cpp.

References IDebugDraw::DrawLine().

Referenced by CcdPhysicsEnvironment::UpdateAabbs().

Variable Documentation

int gConstraintUid = 1 [static]

Definition at line 1136 of file CcdPhysicsEnvironment.cpp.

bool useIslands = true

Definition at line 64 of file CcdPhysicsEnvironment.cpp.

Generated on Wed May 24 13:58:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsEnvironment.cpp Source File

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsEnvironment.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018
00019 #include "CcdPhysicsEnvironment.h"
00020 #include "CcdPhysicsController.h"
00021
00022 #include <algorithm>
00023 #include "SimdTransform.h"
00024 #include "Dynamics/RigidBody.h"
00025 #include "BroadphaseCollision/BroadphaseInterface.h"
00026 #include "BroadphaseCollision/SimpleBroadphase.h"
00027 #include "BroadphaseCollision/AxisSweep3.h"
00028
00029 #include "CollisionDispatch/CollisionWorld.h"
00030
00031 #include "CollisionShapes/ConvexShape.h"
00032 #include "CollisionShapes/ConeShape.h"
00033
00034
00035
00036 #include "BroadphaseCollision/Dispatcher.h"
00037 #include "NarrowPhaseCollision/PersistentManifold.h"
00038 #include "CollisionShapes/TriangleMeshShape.h"
00039 #include "ConstraintSolver/OdeConstraintSolver.h"
00040 #include "ConstraintSolver/SimpleConstraintSolver.h"
00041
00042
00043 //profiling/timings
00044 #include "quickprof.h"
00045
00046
00047 #include "IDebugDraw.h"
00048
00049 #include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
00050 #include "NarrowPhaseCollision/SubSimplexConvexCast.h"
00051 #include "NarrowPhaseCollision/GjkConvexCast.h"
00052 #include "NarrowPhaseCollision/ContinuousConvexCollision.h"
00053
00054
00055 #include "CollisionDispatch/CollisionDispatcher.h"
00056 #include "PHY_IMotionState.h"
00057
00058 #include "CollisionDispatch/EmptyCollisionAlgorithm.h"
00059 #include "CollisionDispatch/UnionFind.h"
00060
00061
00062 #include "CollisionShapes/SphereShape.h"
00063
00064 bool useIslands = true;
00065
00066 #ifdef NEW_BULLET_VEHICLE_SUPPORT
00067 #include "Vehicle/RaycastVehicle.h"
00068 #include "Vehicle/VehicleRaycaster.h"
00069
00070 #include "Vehicle/WheelInfo.h"
00071 #include "PHY_IVehicle.h"
00072 RaycastVehicle::VehicleTuning   gTuning;
00073
00074 #endif //NEW_BULLET_VEHICLE_SUPPORT
00075 #include "AabbUtil2.h"
00076
00077 #include "ConstraintSolver/ConstraintSolver.h"
00078 #include "ConstraintSolver/Point2PointConstraint.h"
00079 #include "ConstraintSolver/HingeConstraint.h"
00080
00081
00082 //#include "BroadphaseCollision/QueryDispatcher.h"
00083 //#include "BroadphaseCollision/QueryBox.h"
00084 //todo: change this to allow dynamic registration of types!
00085
00086 #ifdef WIN32
00087 void DrawRasterizerLine(const float* from,const float* to,int color);
00088 #endif
00089
00090
00091 #include "ConstraintSolver/ContactConstraint.h"
00092
00093
00094 #include <stdio.h>
00095
00096 #ifdef NEW_BULLET_VEHICLE_SUPPORT
00097 class WrapperVehicle : public PHY_IVehicle
00098 {
00099
00100         RaycastVehicle* m_vehicle;
00101         PHY_IPhysicsController* m_chassis;
00102
00103 public:
00104
00105         WrapperVehicle(RaycastVehicle* vehicle,PHY_IPhysicsController* chassis)
00106                 :m_vehicle(vehicle),
00107                 m_chassis(chassis)
00108         {
00109         }
00110
00111         RaycastVehicle* GetVehicle()
00112         {
00113                 return m_vehicle;
00114         }
00115
00116         PHY_IPhysicsController* GetChassis()
00117         {
00118                 return m_chassis;
00119         }
00120
00121         virtual void    AddWheel(
00122                 PHY_IMotionState*       motionState,
00123                 PHY__Vector3    connectionPoint,
00124                 PHY__Vector3    downDirection,
00125                 PHY__Vector3    axleDirection,
00126                 float   suspensionRestLength,
00127                 float wheelRadius,
00128                 bool hasSteering
00129                 )
00130         {
00131                 SimdVector3 connectionPointCS0(connectionPoint[0],connectionPoint[1],connectionPoint[2]);
00132                 SimdVector3 wheelDirectionCS0(downDirection[0],downDirection[1],downDirection[2]);
00133                 SimdVector3 wheelAxle(axleDirection[0],axleDirection[1],axleDirection[2]);
00134
00135
00136                 WheelInfo& info = m_vehicle->AddWheel(connectionPointCS0,wheelDirectionCS0,wheelAxle,
00137                         suspensionRestLength,wheelRadius,gTuning,hasSteering);
00138                 info.m_clientInfo = motionState;
00139
00140         }
00141
00142         void    SyncWheels()
00143         {
00144                 int numWheels = GetNumWheels();
00145                 int i;
00146                 for (i=0;i<numWheels;i++)
00147                 {
00148                         WheelInfo& info = m_vehicle->GetWheelInfo(i);
00149                         PHY_IMotionState* motionState = (PHY_IMotionState*)info.m_clientInfo ;
00150                         m_vehicle->UpdateWheelTransform(i);
00151                         SimdTransform trans = m_vehicle->GetWheelTransformWS(i);
00152                         SimdQuaternion orn = trans.getRotation();
00153                         const SimdVector3& pos = trans.getOrigin();
00154                         motionState->setWorldOrientation(orn.x(),orn.y(),orn.z(),orn[3]);
00155                         motionState->setWorldPosition(pos.x(),pos.y(),pos.z());
00156
00157                 }
00158         }
00159
00160         virtual int             GetNumWheels() const
00161         {
00162                 return m_vehicle->GetNumWheels();
00163         }
00164
00165         virtual void    GetWheelPosition(int wheelIndex,float& posX,float& posY,float& posZ) const
00166         {
00167                 SimdTransform   trans = m_vehicle->GetWheelTransformWS(wheelIndex);
00168                 posX = trans.getOrigin().x();
00169                 posY = trans.getOrigin().y();
00170                 posZ = trans.getOrigin().z();
00171         }
00172         virtual void    GetWheelOrientationQuaternion(int wheelIndex,float& quatX,float& quatY,float& quatZ,float& quatW) const
00173         {
00174                 SimdTransform   trans = m_vehicle->GetWheelTransformWS(wheelIndex);
00175                 SimdQuaternion quat = trans.getRotation();
00176                 SimdMatrix3x3 orn2(quat);
00177
00178                 quatX = trans.getRotation().x();
00179                 quatY = trans.getRotation().y();
00180                 quatZ = trans.getRotation().z();
00181                 quatW = trans.getRotation()[3];
00182
00183
00184                 //printf("test");
00185
00186
00187         }
00188
00189         virtual float   GetWheelRotation(int wheelIndex) const
00190         {
00191                 float rotation = 0.f;
00192
00193                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00194                 {
00195                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00196                         rotation = info.m_rotation;
00197                 }
00198                 return rotation;
00199
00200         }
00201
00202
00203
00204         virtual int     GetUserConstraintId() const
00205         {
00206                 return m_vehicle->GetUserConstraintId();
00207         }
00208
00209         virtual int     GetUserConstraintType() const
00210         {
00211                 return m_vehicle->GetUserConstraintType();
00212         }
00213
00214         virtual void    SetSteeringValue(float steering,int wheelIndex)
00215         {
00216                 m_vehicle->SetSteeringValue(steering,wheelIndex);
00217         }
00218
00219         virtual void    ApplyEngineForce(float force,int wheelIndex)
00220         {
00221                 m_vehicle->ApplyEngineForce(force,wheelIndex);
00222         }
00223
00224         virtual void    ApplyBraking(float braking,int wheelIndex)
00225         {
00226                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00227                 {
00228                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00229                         info.m_brake = braking;
00230                 }
00231         }
00232
00233         virtual void    SetWheelFriction(float friction,int wheelIndex)
00234         {
00235                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00236                 {
00237                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00238                         info.m_frictionSlip = friction;
00239                 }
00240
00241         }
00242
00243         virtual void    SetSuspensionStiffness(float suspensionStiffness,int wheelIndex)
00244         {
00245                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00246                 {
00247                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00248                         info.m_suspensionStiffness = suspensionStiffness;
00249
00250                 }
00251         }
00252
00253         virtual void    SetSuspensionDamping(float suspensionDamping,int wheelIndex)
00254         {
00255                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00256                 {
00257                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00258                         info.m_wheelsDampingRelaxation = suspensionDamping;
00259                 }
00260         }
00261
00262         virtual void    SetSuspensionCompression(float suspensionCompression,int wheelIndex)
00263         {
00264                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00265                 {
00266                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00267                         info.m_wheelsDampingCompression = suspensionCompression;
00268                 }
00269         }
00270
00271
00272
00273         virtual void    SetRollInfluence(float rollInfluence,int wheelIndex)
00274         {
00275                 if ((wheelIndex>=0) && (wheelIndex< m_vehicle->GetNumWheels()))
00276                 {
00277                         WheelInfo& info = m_vehicle->GetWheelInfo(wheelIndex);
00278                         info.m_rollInfluence = rollInfluence;
00279                 }
00280         }
00281
00282
00283
00284 };
00285 #endif //NEW_BULLET_VEHICLE_SUPPORT
00286
00287
00288
00289 static void DrawAabb(IDebugDraw* debugDrawer,const SimdVector3& from,const SimdVector3& to,const SimdVector3& color)
00290 {
00291         SimdVector3 halfExtents = (to-from)* 0.5f;
00292         SimdVector3 center = (to+from) *0.5f;
00293         int i,j;
00294
00295         SimdVector3 edgecoord(1.f,1.f,1.f),pa,pb;
00296         for (i=0;i<4;i++)
00297         {
00298                 for (j=0;j<3;j++)
00299                 {
00300                         pa = SimdVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
00301                                 edgecoord[2]*halfExtents[2]);
00302                         pa+=center;
00303
00304                         int othercoord = j%3;
00305                         edgecoord[othercoord]*=-1.f;
00306                         pb = SimdVector3(edgecoord[0]*halfExtents[0], edgecoord[1]*halfExtents[1],
00307                                 edgecoord[2]*halfExtents[2]);
00308                         pb+=center;
00309
00310                         debugDrawer->DrawLine(pa,pb,color);
00311                 }
00312                 edgecoord = SimdVector3(-1.f,-1.f,-1.f);
00313                 if (i<3)
00314                         edgecoord[i]*=-1.f;
00315         }
00316
00317
00318 }
00319
00320
00321
00322
00323
00324
00325 CcdPhysicsEnvironment::CcdPhysicsEnvironment(CollisionDispatcher* dispatcher,BroadphaseInterface* broadphase)
00326 :m_scalingPropagated(false),
00327 m_numIterations(10),
00328 m_numTimeSubSteps(1),
00329 m_ccdMode(0),
00330 m_solverType(-1),
00331 m_profileTimings(0),
00332 m_enableSatCollisionDetection(false)
00333 {
00334
00335         for (int i=0;i<PHY_NUM_RESPONSE;i++)
00336         {
00337                 m_triggerCallbacks[i] = 0;
00338         }
00339         if (!dispatcher)
00340                 dispatcher = new CollisionDispatcher();
00341
00342
00343         if(!broadphase)
00344         {
00345
00346                 //todo: calculate/let user specify this world sizes
00347                 SimdVector3 worldMin(-10000,-10000,-10000);
00348                 SimdVector3 worldMax(10000,10000,10000);
00349
00350                 broadphase = new AxisSweep3(worldMin,worldMax);
00351
00352                 //broadphase = new SimpleBroadphase();
00353         }
00354
00355
00356         setSolverType(1);//issues with quickstep and memory allocations
00357
00358         m_collisionWorld = new CollisionWorld(dispatcher,broadphase);
00359
00360         m_debugDrawer = 0;
00361         m_gravity = SimdVector3(0.f,-10.f,0.f);
00362
00363
00364 }
00365
00366 void    CcdPhysicsEnvironment::addCcdPhysicsController(CcdPhysicsController* ctrl)
00367 {
00368         RigidBody* body = ctrl->GetRigidBody();
00369
00370         //this m_userPointer is just used for triggers, see CallbackTriggers
00371         body->m_userPointer = ctrl;
00372
00373         body->setGravity( m_gravity );
00374         m_controllers.push_back(ctrl);
00375
00376         m_collisionWorld->AddCollisionObject(body);
00377
00378         assert(body->m_broadphaseHandle);
00379
00380         BroadphaseInterface* scene =  GetBroadphase();
00381
00382
00383         CollisionShape* shapeinterface = ctrl->GetCollisionShape();
00384
00385         assert(shapeinterface);
00386
00387         const SimdTransform& t = ctrl->GetRigidBody()->getCenterOfMassTransform();
00388
00389
00390         SimdPoint3 minAabb,maxAabb;
00391
00392         shapeinterface->GetAabb(t,minAabb,maxAabb);
00393
00394         float timeStep = 0.02f;
00395
00396
00397         //extent it with the motion
00398
00399         SimdVector3 linMotion = body->getLinearVelocity()*timeStep;
00400
00401         float maxAabbx = maxAabb.getX();
00402         float maxAabby = maxAabb.getY();
00403         float maxAabbz = maxAabb.getZ();
00404         float minAabbx = minAabb.getX();
00405         float minAabby = minAabb.getY();
00406         float minAabbz = minAabb.getZ();
00407
00408         if (linMotion.x() > 0.f)
00409                 maxAabbx += linMotion.x();
00410         else
00411                 minAabbx += linMotion.x();
00412         if (linMotion.y() > 0.f)
00413                 maxAabby += linMotion.y();
00414         else
00415                 minAabby += linMotion.y();
00416         if (linMotion.z() > 0.f)
00417                 maxAabbz += linMotion.z();
00418         else
00419                 minAabbz += linMotion.z();
00420
00421
00422         minAabb = SimdVector3(minAabbx,minAabby,minAabbz);
00423         maxAabb = SimdVector3(maxAabbx,maxAabby,maxAabbz);
00424
00425
00426
00427
00428 }
00429
00430 void    CcdPhysicsEnvironment::removeCcdPhysicsController(CcdPhysicsController* ctrl)
00431 {
00432
00433         //also remove constraint
00434
00435         {
00436                 std::vector<TypedConstraint*>::iterator i;
00437
00438                 for (i=m_constraints.begin();
00439                         !(i==m_constraints.end()); i++)
00440                 {
00441                         TypedConstraint* constraint = (*i);
00442                         if  ((&constraint->GetRigidBodyA() == ctrl->GetRigidBody() ||
00443                                 (&constraint->GetRigidBodyB() == ctrl->GetRigidBody())))
00444                         {
00445                                 removeConstraint(constraint->GetUserConstraintId());
00446                                 //only 1 constraint per constroller
00447                                 break;
00448                         }
00449                 }
00450         }
00451
00452         {
00453                 std::vector<TypedConstraint*>::iterator i;
00454
00455                 for (i=m_constraints.begin();
00456                         !(i==m_constraints.end()); i++)
00457                 {
00458                         TypedConstraint* constraint = (*i);
00459                         if  ((&constraint->GetRigidBodyA() == ctrl->GetRigidBody() ||
00460                                 (&constraint->GetRigidBodyB() == ctrl->GetRigidBody())))
00461                         {
00462                                 removeConstraint(constraint->GetUserConstraintId());
00463                                 //only 1 constraint per constroller
00464                                 break;
00465                         }
00466                 }
00467         }
00468
00469
00470         m_collisionWorld->RemoveCollisionObject(ctrl->GetRigidBody());
00471
00472
00473         {
00474                 std::vector<CcdPhysicsController*>::iterator i =
00475                         std::find(m_controllers.begin(), m_controllers.end(), ctrl);
00476                 if (!(i == m_controllers.end()))
00477                 {
00478                         std::swap(*i, m_controllers.back());
00479                         m_controllers.pop_back();
00480                 }
00481         }
00482
00483         //remove it from the triggers
00484         {
00485                 std::vector<CcdPhysicsController*>::iterator i =
00486                         std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl);
00487                 if (!(i == m_triggerControllers.end()))
00488                 {
00489                         std::swap(*i, m_triggerControllers.back());
00490                         m_triggerControllers.pop_back();
00491                 }
00492         }
00493
00494
00495 }
00496
00497
00498 void    CcdPhysicsEnvironment::beginFrame()
00499 {
00500
00501 }
00502
00503
00504 bool    CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
00505 {
00506         //printf("proceedDeltaTime\n");
00507
00508
00509 #ifdef USE_QUICKPROF
00510         //toggle Profiler
00511         if ( m_debugDrawer->GetDebugMode() & IDebugDraw::DBG_ProfileTimings)
00512         {
00513                 if (!m_profileTimings)
00514                 {
00515                         m_profileTimings = 1;
00516                         // To disable profiling, simply comment out the following line.
00517                         static int counter = 0;
00518
00519                         char filename[128];
00520                         sprintf(filename,"quickprof_bullet_timings%i.csv",counter++);
00521                         Profiler::init(filename, Profiler::BLOCK_CYCLE_SECONDS);//BLOCK_TOTAL_MICROSECONDS
00522
00523                 }
00524         } else
00525         {
00526                 if (m_profileTimings)
00527                 {
00528                         m_profileTimings = 0;
00529                         Profiler::destroy();
00530                 }
00531         }
00532 #endif //USE_QUICKPROF
00533
00534
00535
00536         if (!SimdFuzzyZero(timeStep))
00537         {
00538
00539                 {
00540                         //do the kinematic calculation here, over the full timestep
00541                         std::vector<CcdPhysicsController*>::iterator i;
00542                         for (i=m_controllers.begin();
00543                                                 !(i==m_controllers.end()); i++)
00544                         {
00545
00546                                                 CcdPhysicsController* ctrl = *i;
00547
00548                                                 SimdTransform predictedTrans;
00549                                                 RigidBody* body = ctrl->GetRigidBody();
00550                                                 if (body->GetActivationState() != ISLAND_SLEEPING)
00551                                                 {
00552
00553                                                         if (body->IsStatic())
00554                                                         {
00555                                                                 //to calculate velocities next frame
00556                                                                 body->saveKinematicState(timeStep);
00557                                                         }
00558                                                 }
00559                         }
00560                 }
00561
00562
00563                 int i;
00564                 float subTimeStep = timeStep / float(m_numTimeSubSteps);
00565
00566                 for (i=0;i<this->m_numTimeSubSteps;i++)
00567                 {
00568                         proceedDeltaTimeOneStep(subTimeStep);
00569                 }
00570         } else
00571         {
00572                 //todo: interpolate
00573         }
00574
00575         return true;
00576 }
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00591 bool    CcdPhysicsEnvironment::proceedDeltaTimeOneStep(float timeStep)
00592 {
00593
00594
00595         //printf("CcdPhysicsEnvironment::proceedDeltaTime\n");
00596
00597         if (SimdFuzzyZero(timeStep))
00598                 return true;
00599
00600         if (m_debugDrawer)
00601         {
00602                 gDisableDeactivation = (m_debugDrawer->GetDebugMode() & IDebugDraw::DBG_NoDeactivation);
00603         }
00604
00605
00606 #ifdef USE_QUICKPROF
00607         Profiler::beginBlock("SyncMotionStates");
00608 #endif //USE_QUICKPROF
00609
00610
00611         //this is needed because scaling is not known in advance, and scaling has to propagate to the shape
00612         if (!m_scalingPropagated)
00613         {
00614                 SyncMotionStates(timeStep);
00615                 m_scalingPropagated = true;
00616         }
00617
00618
00619 #ifdef USE_QUICKPROF
00620         Profiler::endBlock("SyncMotionStates");
00621
00622         Profiler::beginBlock("predictIntegratedTransform");
00623 #endif //USE_QUICKPROF
00624
00625         {
00626                 //              std::vector<CcdPhysicsController*>::iterator i;
00627
00628
00629
00630                 int k;
00631                 for (k=0;k<GetNumControllers();k++)
00632                 {
00633                         CcdPhysicsController* ctrl = m_controllers[k];
00634                         //              SimdTransform predictedTrans;
00635                         RigidBody* body = ctrl->GetRigidBody();
00636                         if (body->GetActivationState() != ISLAND_SLEEPING)
00637                         {
00638                                 if (!body->IsStatic())
00639                                 {
00640                                         body->applyForces( timeStep);
00641                                         body->integrateVelocities( timeStep);
00642                                         body->predictIntegratedTransform(timeStep,body->m_interpolationWorldTransform);
00643                                 }
00644                         }
00645
00646                 }
00647         }
00648
00649 #ifdef USE_QUICKPROF
00650         Profiler::endBlock("predictIntegratedTransform");
00651 #endif //USE_QUICKPROF
00652
00653         BroadphaseInterface*    scene = GetBroadphase();
00654
00655
00656         //
00657         // collision detection (?)
00658         //
00659
00660
00661 #ifdef USE_QUICKPROF
00662         Profiler::beginBlock("DispatchAllCollisionPairs");
00663 #endif //USE_QUICKPROF
00664
00665
00666         int numsubstep = m_numIterations;
00667
00668
00669         DispatcherInfo dispatchInfo;
00670         dispatchInfo.m_timeStep = timeStep;
00671         dispatchInfo.m_stepCount = 0;
00672         dispatchInfo.m_enableSatConvex = m_enableSatCollisionDetection;
00673
00674         scene->DispatchAllCollisionPairs(*GetDispatcher(),dispatchInfo);
00675
00676
00677 #ifdef USE_QUICKPROF
00678         Profiler::endBlock("DispatchAllCollisionPairs");
00679 #endif //USE_QUICKPROF
00680
00681
00682         int numRigidBodies = m_controllers.size();
00683
00684         m_collisionWorld->UpdateActivationState();
00685
00686
00687
00688         //contacts
00689 #ifdef USE_QUICKPROF
00690         Profiler::beginBlock("SolveConstraint");
00691 #endif //USE_QUICKPROF
00692
00693
00694         //solve the regular constraints (point 2 point, hinge, etc)
00695
00696         for (int g=0;g<numsubstep;g++)
00697         {
00698                 //
00699                 // constraint solving
00700                 //
00701
00702
00703                 int i;
00704                 int numConstraints = m_constraints.size();
00705
00706                 //point to point constraints
00707                 for (i=0;i< numConstraints ; i++ )
00708                 {
00709                         TypedConstraint* constraint = m_constraints[i];
00710
00711                         constraint->BuildJacobian();
00712                         constraint->SolveConstraint( timeStep );
00713
00714                 }
00715
00716
00717         }
00718
00719 #ifdef USE_QUICKPROF
00720         Profiler::endBlock("SolveConstraint");
00721 #endif //USE_QUICKPROF
00722
00723         //solve the vehicles
00724
00725 #ifdef NEW_BULLET_VEHICLE_SUPPORT
00726         //vehicles
00727         int numVehicles = m_wrapperVehicles.size();
00728         for (int i=0;i<numVehicles;i++)
00729         {
00730                 WrapperVehicle* wrapperVehicle = m_wrapperVehicles[i];
00731                 RaycastVehicle* vehicle = wrapperVehicle->GetVehicle();
00732                 vehicle->UpdateVehicle( timeStep);
00733         }
00734 #endif //NEW_BULLET_VEHICLE_SUPPORT
00735
00736
00737         struct InplaceSolverIslandCallback : public CollisionDispatcher::IslandCallback
00738         {
00739
00740                 ContactSolverInfo& m_solverInfo;
00741                 ConstraintSolver*       m_solver;
00742                 IDebugDraw*     m_debugDrawer;
00743
00744                 InplaceSolverIslandCallback(
00745                         ContactSolverInfo& solverInfo,
00746                         ConstraintSolver*       solver,
00747                         IDebugDraw*     debugDrawer)
00748                         :m_solverInfo(solverInfo),
00749                         m_solver(solver),
00750                         m_debugDrawer(debugDrawer)
00751                 {
00752
00753                 }
00754
00755                 virtual void    ProcessIsland(PersistentManifold**      manifolds,int numManifolds)
00756                 {
00757                         m_solver->SolveGroup( manifolds, numManifolds,m_solverInfo,m_debugDrawer);
00758                 }
00759
00760         };
00761
00762
00763         m_solverInfo.m_friction = 0.9f;
00764         m_solverInfo.m_numIterations = m_numIterations;
00765         m_solverInfo.m_timeStep = timeStep;
00766         m_solverInfo.m_restitution = 0.f;//m_restitution;
00767
00768         InplaceSolverIslandCallback     solverCallback(
00769                 m_solverInfo,
00770                 m_solver,
00771                 m_debugDrawer);
00772
00773 #ifdef USE_QUICKPROF
00774         Profiler::beginBlock("BuildAndProcessIslands");
00775 #endif //USE_QUICKPROF
00776
00778         GetDispatcher()->BuildAndProcessIslands(numRigidBodies,&solverCallback);
00779
00780 #ifdef USE_QUICKPROF
00781         Profiler::endBlock("BuildAndProcessIslands");
00782
00783         Profiler::beginBlock("CallbackTriggers");
00784 #endif //USE_QUICKPROF
00785
00786         CallbackTriggers();
00787
00788 #ifdef USE_QUICKPROF
00789         Profiler::endBlock("CallbackTriggers");
00790
00791
00792         Profiler::beginBlock("proceedToTransform");
00793
00794 #endif //USE_QUICKPROF
00795         {
00796
00797
00798
00799                 {
00800
00801
00802
00803                         UpdateAabbs(timeStep);
00804
00805
00806                         float toi = 1.f;
00807
00808
00809
00810                         if (m_ccdMode == 3)
00811                         {
00812                                 DispatcherInfo dispatchInfo;
00813                                 dispatchInfo.m_timeStep = timeStep;
00814                                 dispatchInfo.m_stepCount = 0;
00815                                 dispatchInfo.m_dispatchFunc = DispatcherInfo::DISPATCH_CONTINUOUS;
00816
00817                                 scene->DispatchAllCollisionPairs( *GetDispatcher(),dispatchInfo);
00818                                 toi = dispatchInfo.m_timeOfImpact;
00819
00820                         }
00821
00822
00823
00824                         //
00825                         // integrating solution
00826                         //
00827
00828                         {
00829
00830                                 std::vector<CcdPhysicsController*>::iterator i;
00831
00832                                 for (i=m_controllers.begin();
00833                                         !(i==m_controllers.end()); i++)
00834                                 {
00835
00836                                         CcdPhysicsController* ctrl = *i;
00837
00838                                         SimdTransform predictedTrans;
00839                                         RigidBody* body = ctrl->GetRigidBody();
00840                                         if (body->GetActivationState() != ISLAND_SLEEPING)
00841                                         {
00842
00843                                                 if (!body->IsStatic())
00844                                                 {
00845                                                         body->predictIntegratedTransform(timeStep*      toi, predictedTrans);
00846                                                         body->proceedToTransform( predictedTrans);
00847                                                 }
00848
00849                                         }
00850                                 }
00851
00852                         }
00853
00854
00855
00856
00857
00858                         //
00859                         // disable sleeping physics objects
00860                         //
00861
00862                         std::vector<CcdPhysicsController*> m_sleepingControllers;
00863
00864                         std::vector<CcdPhysicsController*>::iterator i;
00865
00866                         for (i=m_controllers.begin();
00867                                 !(i==m_controllers.end()); i++)
00868                         {
00869                                 CcdPhysicsController* ctrl = (*i);
00870                                 RigidBody* body = ctrl->GetRigidBody();
00871
00872                                 ctrl->UpdateDeactivation(timeStep);
00873
00874
00875                                 if (ctrl->wantsSleeping())
00876                                 {
00877                                         if (body->GetActivationState() == ACTIVE_TAG)
00878                                                 body->SetActivationState( WANTS_DEACTIVATION );
00879                                 } else
00880                                 {
00881                                         if (body->GetActivationState() != DISABLE_DEACTIVATION)
00882                                                 body->SetActivationState( ACTIVE_TAG );
00883                                 }
00884
00885                                 if (useIslands)
00886                                 {
00887                                         if (body->GetActivationState() == ISLAND_SLEEPING)
00888                                         {
00889                                                 m_sleepingControllers.push_back(ctrl);
00890                                         }
00891                                 } else
00892                                 {
00893                                         if (ctrl->wantsSleeping())
00894                                         {
00895                                                 m_sleepingControllers.push_back(ctrl);
00896                                         }
00897                                 }
00898                         }
00899
00900
00901
00902
00903                 }
00904
00905
00906 #ifdef USE_QUICKPROF
00907                 Profiler::endBlock("proceedToTransform");
00908
00909                 Profiler::beginBlock("SyncMotionStates");
00910 #endif //USE_QUICKPROF
00911
00912                 SyncMotionStates(timeStep);
00913
00914 #ifdef USE_QUICKPROF
00915                 Profiler::endBlock("SyncMotionStates");
00916
00917                 Profiler::endProfilingCycle();
00918 #endif //USE_QUICKPROF
00919
00920
00921 #ifdef NEW_BULLET_VEHICLE_SUPPORT
00922                 //sync wheels for vehicles
00923                 int numVehicles = m_wrapperVehicles.size();
00924                 for (int i=0;i<numVehicles;i++)
00925                 {
00926                         WrapperVehicle* wrapperVehicle = m_wrapperVehicles[i];
00927
00928                         wrapperVehicle->SyncWheels();
00929                 }
00930 #endif //NEW_BULLET_VEHICLE_SUPPORT
00931         }
00932
00933         return true;
00934 }
00935
00936 void            CcdPhysicsEnvironment::setDebugMode(int debugMode)
00937 {
00938         if (m_debugDrawer){
00939                 m_debugDrawer->SetDebugMode(debugMode);
00940         }
00941 }
00942
00943 void            CcdPhysicsEnvironment::setNumIterations(int numIter)
00944 {
00945         m_numIterations = numIter;
00946 }
00947 void            CcdPhysicsEnvironment::setDeactivationTime(float dTime)
00948 {
00949         gDeactivationTime = dTime;
00950 }
00951 void            CcdPhysicsEnvironment::setDeactivationLinearTreshold(float linTresh)
00952 {
00953         gLinearSleepingTreshold = linTresh;
00954 }
00955 void            CcdPhysicsEnvironment::setDeactivationAngularTreshold(float angTresh)
00956 {
00957         gAngularSleepingTreshold = angTresh;
00958 }
00959 void            CcdPhysicsEnvironment::setContactBreakingTreshold(float contactBreakingTreshold)
00960 {
00961         gContactBreakingTreshold = contactBreakingTreshold;
00962
00963 }
00964
00965
00966 void            CcdPhysicsEnvironment::setCcdMode(int ccdMode)
00967 {
00968         m_ccdMode = ccdMode;
00969 }
00970
00971
00972 void            CcdPhysicsEnvironment::setSolverSorConstant(float sor)
00973 {
00974         m_solverInfo.m_sor = sor;
00975 }
00976
00977 void            CcdPhysicsEnvironment::setSolverTau(float tau)
00978 {
00979         m_solverInfo.m_tau = tau;
00980 }
00981 void            CcdPhysicsEnvironment::setSolverDamping(float damping)
00982 {
00983         m_solverInfo.m_damping = damping;
00984 }
00985
00986
00987 void            CcdPhysicsEnvironment::setLinearAirDamping(float damping)
00988 {
00989         gLinearAirDamping = damping;
00990 }
00991
00992 void            CcdPhysicsEnvironment::setUseEpa(bool epa)
00993 {
00994         gUseEpa = epa;
00995 }
00996
00997 void            CcdPhysicsEnvironment::setSolverType(int solverType)
00998 {
00999
01000         switch (solverType)
01001         {
01002         case 1:
01003                 {
01004                         if (m_solverType != solverType)
01005                         {
01006
01007                                 m_solver = new SimpleConstraintSolver();
01008
01009                                 break;
01010                         }
01011                 }
01012
01013         case 0:
01014         default:
01015                 if (m_solverType != solverType)
01016                 {
01017                         m_solver = new OdeConstraintSolver();
01018
01019                         break;
01020                 }
01021
01022         };
01023
01024         m_solverType = solverType ;
01025 }
01026
01027
01028
01029
01030
01031 void    CcdPhysicsEnvironment::SyncMotionStates(float timeStep)
01032 {
01033         std::vector<CcdPhysicsController*>::iterator i;
01034
01035         //
01036         // synchronize the physics and graphics transformations
01037         //
01038
01039         for (i=m_controllers.begin();
01040                 !(i==m_controllers.end()); i++)
01041         {
01042                 CcdPhysicsController* ctrl = (*i);
01043                 ctrl->SynchronizeMotionStates(timeStep);
01044
01045         }
01046
01047 }
01048 void            CcdPhysicsEnvironment::setGravity(float x,float y,float z)
01049 {
01050         m_gravity = SimdVector3(x,y,z);
01051
01052         std::vector<CcdPhysicsController*>::iterator i;
01053
01054         //todo: review this gravity stuff
01055         for (i=m_controllers.begin();
01056                 !(i==m_controllers.end()); i++)
01057         {
01058
01059                 CcdPhysicsController* ctrl = (*i);
01060                 ctrl->GetRigidBody()->setGravity(m_gravity);
01061
01062         }
01063 }
01064
01065
01066 #ifdef NEW_BULLET_VEHICLE_SUPPORT
01067
01068 class DefaultVehicleRaycaster : public VehicleRaycaster
01069 {
01070         CcdPhysicsEnvironment* m_physEnv;
01071         PHY_IPhysicsController* m_chassis;
01072
01073 public:
01074         DefaultVehicleRaycaster(CcdPhysicsEnvironment* physEnv,PHY_IPhysicsController* chassis):
01075           m_physEnv(physEnv),
01076                   m_chassis(chassis)
01077           {
01078           }
01079
01080           /*    struct VehicleRaycasterResult
01081           {
01082           VehicleRaycasterResult() :m_distFraction(-1.f){};
01083           SimdVector3   m_hitPointInWorld;
01084           SimdVector3   m_hitNormalInWorld;
01085           SimdScalar    m_distFraction;
01086           };
01087           */
01088           virtual void* CastRay(const SimdVector3& from,const SimdVector3& to, VehicleRaycasterResult& result)
01089           {
01090
01091
01092                   float hit[3];
01093                   float normal[3];
01094
01095                   PHY_IPhysicsController*       ignore = m_chassis;
01096                   void* hitObject = m_physEnv->rayTest(ignore,from.x(),from.y(),from.z(),to.x(),to.y(),to.z(),hit[0],hit[1],hit[2],normal[0],normal[1],normal[2]);
01097                   if (hitObject)
01098                   {
01099                           result.m_hitPointInWorld[0] = hit[0];
01100                           result.m_hitPointInWorld[1] = hit[1];
01101                           result.m_hitPointInWorld[2] = hit[2];
01102                           result.m_hitNormalInWorld[0] = normal[0];
01103                           result.m_hitNormalInWorld[1] = normal[1];
01104                           result.m_hitNormalInWorld[2] = normal[2];
01105                           result.m_hitNormalInWorld.normalize();
01106                           //calc fraction? or put it in the interface?
01107                           //calc for now
01108
01109                           result.m_distFraction = (result.m_hitPointInWorld-from).length() / (to-from).length();
01110                           //some safety for 'explosion' due to sudden penetration of the full 'ray'
01111                           /*                    if (result.m_distFraction<0.1)
01112                           {
01113                           printf("Vehicle Raycast: avoided instability due to penetration. Consider moving the connection points deeper inside vehicle chassis");
01114                           result.m_distFraction = 1.f;
01115                           hitObject = 0;
01116                           }
01117                           */
01118
01119                           /*                    if (result.m_distFraction>1.)
01120                           {
01121                           printf("Vehicle Raycast: avoided instability 1Consider moving the connection points deeper inside vehicle chassis");
01122                           result.m_distFraction = 1.f;
01123                           hitObject = 0;
01124                           }
01125                           */
01126
01127
01128
01129                   }
01130                   //?
01131                   return hitObject;
01132           }
01133 };
01134 #endif //NEW_BULLET_VEHICLE_SUPPORT
01135
01136 static int gConstraintUid = 1;
01137
01138 int                     CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl0,class PHY_IPhysicsController* ctrl1,PHY_ConstraintType type,
01139                                                                                                         float pivotX,float pivotY,float pivotZ,
01140                                                                                                         float axisX,float axisY,float axisZ)
01141 {
01142
01143
01144         CcdPhysicsController* c0 = (CcdPhysicsController*)ctrl0;
01145         CcdPhysicsController* c1 = (CcdPhysicsController*)ctrl1;
01146
01147         RigidBody* rb0 = c0 ? c0->GetRigidBody() : 0;
01148         RigidBody* rb1 = c1 ? c1->GetRigidBody() : 0;
01149
01150         ASSERT(rb0);
01151
01152         SimdVector3 pivotInA(pivotX,pivotY,pivotZ);
01153         SimdVector3 pivotInB = rb1 ? rb1->getCenterOfMassTransform().inverse()(rb0->getCenterOfMassTransform()(pivotInA)) : pivotInA;
01154         SimdVector3 axisInA(axisX,axisY,axisZ);
01155         SimdVector3 axisInB = rb1 ?
01156                 (rb1->getCenterOfMassTransform().getBasis().inverse()*(rb0->getCenterOfMassTransform().getBasis() * -axisInA)) :
01157         rb0->getCenterOfMassTransform().getBasis() * -axisInA;
01158
01159         bool angularOnly = false;
01160
01161         switch (type)
01162         {
01163         case PHY_POINT2POINT_CONSTRAINT:
01164                 {
01165
01166                         Point2PointConstraint* p2p = 0;
01167
01168                         if (rb1)
01169                         {
01170                                 p2p = new Point2PointConstraint(*rb0,
01171                                         *rb1,pivotInA,pivotInB);
01172                         } else
01173                         {
01174                                 p2p = new Point2PointConstraint(*rb0,
01175                                         pivotInA);
01176                         }
01177
01178                         m_constraints.push_back(p2p);
01179                         p2p->SetUserConstraintId(gConstraintUid++);
01180                         p2p->SetUserConstraintType(type);
01181                         //64 bit systems can't cast pointer to int. could use size_t instead.
01182                         return p2p->GetUserConstraintId();
01183
01184                         break;
01185                 }
01186
01187         case PHY_ANGULAR_CONSTRAINT:
01188                 angularOnly = true;
01189
01190         case PHY_LINEHINGE_CONSTRAINT:
01191                 {
01192                         HingeConstraint* hinge = 0;
01193
01194                         if (rb1)
01195                         {
01196                                 hinge = new HingeConstraint(
01197                                         *rb0,
01198                                         *rb1,pivotInA,pivotInB,axisInA,axisInB);
01199
01200
01201                         } else
01202                         {
01203                                 hinge = new HingeConstraint(*rb0,
01204                                         pivotInA,axisInA);
01205
01206                         }
01207                         hinge->setAngularOnly(angularOnly);
01208
01209                         m_constraints.push_back(hinge);
01210                         hinge->SetUserConstraintId(gConstraintUid++);
01211                         hinge->SetUserConstraintType(type);
01212                         //64 bit systems can't cast pointer to int. could use size_t instead.
01213                         return hinge->GetUserConstraintId();
01214                         break;
01215                 }
01216 #ifdef NEW_BULLET_VEHICLE_SUPPORT
01217
01218         case PHY_VEHICLE_CONSTRAINT:
01219                 {
01220                         RaycastVehicle::VehicleTuning* tuning = new RaycastVehicle::VehicleTuning();
01221                         RigidBody* chassis = rb0;
01222                         DefaultVehicleRaycaster* raycaster = new DefaultVehicleRaycaster(this,ctrl0);
01223                         RaycastVehicle* vehicle = new RaycastVehicle(*tuning,chassis,raycaster);
01224                         WrapperVehicle* wrapperVehicle = new WrapperVehicle(vehicle,ctrl0);
01225                         m_wrapperVehicles.push_back(wrapperVehicle);
01226                         vehicle->SetUserConstraintId(gConstraintUid++);
01227                         vehicle->SetUserConstraintType(type);
01228                         return vehicle->GetUserConstraintId();
01229
01230                         break;
01231                 };
01232 #endif //NEW_BULLET_VEHICLE_SUPPORT
01233
01234         default:
01235                 {
01236                 }
01237         };
01238
01239         //RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB
01240
01241         return 0;
01242
01243 }
01244
01245 void            CcdPhysicsEnvironment::removeConstraint(int     constraintId)
01246 {
01247         std::vector<TypedConstraint*>::iterator i;
01248
01249         for (i=m_constraints.begin();
01250                 !(i==m_constraints.end()); i++)
01251         {
01252                 TypedConstraint* constraint = (*i);
01253                 if (constraint->GetUserConstraintId() == constraintId)
01254                 {
01255                         std::swap(*i, m_constraints.back());
01256                         m_constraints.pop_back();
01257                         break;
01258                 }
01259         }
01260
01261 }
01262
01263
01264         struct  FilterClosestRayResultCallback : public CollisionWorld::ClosestRayResultCallback
01265         {
01266                 PHY_IPhysicsController* m_ignoreClient;
01267
01268                 FilterClosestRayResultCallback (PHY_IPhysicsController* ignoreClient,const SimdVector3& rayFrom,const SimdVector3& rayTo)
01269                         : CollisionWorld::ClosestRayResultCallback(rayFrom,rayTo),
01270                         m_ignoreClient(ignoreClient)
01271                 {
01272
01273                 }
01274
01275                 virtual ~FilterClosestRayResultCallback()
01276                 {
01277                 }
01278
01279                 virtual float   AddSingleResult(const CollisionWorld::LocalRayResult& rayResult)
01280                 {
01281                         CcdPhysicsController* curHit = static_cast<CcdPhysicsController*>(rayResult.m_collisionObject->m_userPointer);
01282                         //ignore client...
01283                         if (curHit != m_ignoreClient)
01284                         {
01285                                 //if valid
01286                                 return ClosestRayResultCallback::AddSingleResult(rayResult);
01287                         }
01288                         return m_closestHitFraction;
01289                 }
01290
01291         };
01292
01293 PHY_IPhysicsController* CcdPhysicsEnvironment::rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
01294                                                                                                            float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)
01295 {
01296
01297
01298         float minFraction = 1.f;
01299
01300         SimdVector3 rayFrom(fromX,fromY,fromZ);
01301         SimdVector3 rayTo(toX,toY,toZ);
01302
01303         SimdVector3     hitPointWorld,normalWorld;
01304
01305         //Either Ray Cast with or without filtering
01306
01307         //CollisionWorld::ClosestRayResultCallback rayCallback(rayFrom,rayTo);
01308         FilterClosestRayResultCallback   rayCallback(ignoreClient,rayFrom,rayTo);
01309
01310
01311         PHY_IPhysicsController* nearestHit = 0;
01312
01313         m_collisionWorld->RayTest(rayFrom,rayTo,rayCallback);
01314         if (rayCallback.HasHit())
01315         {
01316                 nearestHit = static_cast<CcdPhysicsController*>(rayCallback.m_collisionObject->m_userPointer);
01317                 hitX =  rayCallback.m_hitPointWorld.getX();
01318                 hitY =  rayCallback.m_hitPointWorld.getY();
01319                 hitZ =  rayCallback.m_hitPointWorld.getZ();
01320
01321                 normalX = rayCallback.m_hitNormalWorld.getX();
01322                 normalY = rayCallback.m_hitNormalWorld.getY();
01323                 normalZ = rayCallback.m_hitNormalWorld.getZ();
01324
01325         }
01326
01327
01328         return nearestHit;
01329 }
01330
01331
01332
01333 int     CcdPhysicsEnvironment::getNumContactPoints()
01334 {
01335         return 0;
01336 }
01337
01338 void CcdPhysicsEnvironment::getContactPoint(int i,float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)
01339 {
01340
01341 }
01342
01343
01344
01345
01346 BroadphaseInterface*    CcdPhysicsEnvironment::GetBroadphase()
01347 {
01348         return m_collisionWorld->GetBroadphase();
01349 }
01350
01351
01352
01353 const CollisionDispatcher* CcdPhysicsEnvironment::GetDispatcher() const
01354 {
01355         return m_collisionWorld->GetDispatcher();
01356 }
01357
01358 CollisionDispatcher* CcdPhysicsEnvironment::GetDispatcher()
01359 {
01360         return m_collisionWorld->GetDispatcher();
01361 }
01362
01363 CcdPhysicsEnvironment::~CcdPhysicsEnvironment()
01364 {
01365
01366 #ifdef NEW_BULLET_VEHICLE_SUPPORT
01367         m_wrapperVehicles.clear();
01368 #endif //NEW_BULLET_VEHICLE_SUPPORT
01369
01370         //m_broadphase->DestroyScene();
01371         //delete broadphase ? release reference on broadphase ?
01372
01373         //first delete scene, then dispatcher, because pairs have to release manifolds on the dispatcher
01374         //delete m_dispatcher;
01375         delete m_collisionWorld;
01376
01377 }
01378
01379
01380 int     CcdPhysicsEnvironment::GetNumControllers()
01381 {
01382         return m_controllers.size();
01383 }
01384
01385
01386 CcdPhysicsController* CcdPhysicsEnvironment::GetPhysicsController( int index)
01387 {
01388         return m_controllers[index];
01389 }
01390
01391
01392 int     CcdPhysicsEnvironment::GetNumManifolds() const
01393 {
01394         return GetDispatcher()->GetNumManifolds();
01395 }
01396
01397 const PersistentManifold*       CcdPhysicsEnvironment::GetManifold(int index) const
01398 {
01399         return GetDispatcher()->GetManifoldByIndexInternal(index);
01400 }
01401
01402 TypedConstraint*        CcdPhysicsEnvironment::getConstraintById(int constraintId)
01403 {
01404         int numConstraint = m_constraints.size();
01405         int i;
01406         for (i=0;i<numConstraint;i++)
01407         {
01408                 TypedConstraint* constraint = m_constraints[i];
01409                 if (constraint->GetUserConstraintId()==constraintId)
01410                 {
01411                         return constraint;
01412                 }
01413         }
01414         return 0;
01415 }
01416
01417
01418 void CcdPhysicsEnvironment::addSensor(PHY_IPhysicsController* ctrl)
01419 {
01420
01421         CcdPhysicsController* ctrl1 = (CcdPhysicsController* )ctrl;
01422         std::vector<CcdPhysicsController*>::iterator i =
01423                 std::find(m_controllers.begin(), m_controllers.end(), ctrl);
01424         if ((i == m_controllers.end()))
01425         {
01426                 addCcdPhysicsController(ctrl1);
01427         }
01428
01429         requestCollisionCallback(ctrl);
01430         //printf("addSensor\n");
01431 }
01432
01433 void CcdPhysicsEnvironment::removeCollisionCallback(PHY_IPhysicsController* ctrl)
01434 {
01435         std::vector<CcdPhysicsController*>::iterator i =
01436                 std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl);
01437         if (!(i == m_triggerControllers.end()))
01438         {
01439                 std::swap(*i, m_triggerControllers.back());
01440                 m_triggerControllers.pop_back();
01441         }
01442 }
01443
01444
01445 void CcdPhysicsEnvironment::removeSensor(PHY_IPhysicsController* ctrl)
01446 {
01447         removeCollisionCallback(ctrl);
01448         //printf("removeSensor\n");
01449 }
01450 void CcdPhysicsEnvironment::addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)
01451 {
01452         /*      printf("addTouchCallback\n(response class = %i)\n",response_class);
01453
01454         //map PHY_ convention into SM_ convention
01455         switch (response_class)
01456         {
01457         case    PHY_FH_RESPONSE:
01458         printf("PHY_FH_RESPONSE\n");
01459         break;
01460         case PHY_SENSOR_RESPONSE:
01461         printf("PHY_SENSOR_RESPONSE\n");
01462         break;
01463         case PHY_CAMERA_RESPONSE:
01464         printf("PHY_CAMERA_RESPONSE\n");
01465         break;
01466         case PHY_OBJECT_RESPONSE:
01467         printf("PHY_OBJECT_RESPONSE\n");
01468         break;
01469         case PHY_STATIC_RESPONSE:
01470         printf("PHY_STATIC_RESPONSE\n");
01471         break;
01472         default:
01473         assert(0);
01474         return;
01475         }
01476         */
01477
01478         m_triggerCallbacks[response_class] = callback;
01479         m_triggerCallbacksUserPtrs[response_class] = user;
01480
01481 }
01482 void CcdPhysicsEnvironment::requestCollisionCallback(PHY_IPhysicsController* ctrl)
01483 {
01484         CcdPhysicsController* ccdCtrl = static_cast<CcdPhysicsController*>(ctrl);
01485
01486         //printf("requestCollisionCallback\n");
01487         m_triggerControllers.push_back(ccdCtrl);
01488 }
01489
01490
01491 void    CcdPhysicsEnvironment::CallbackTriggers()
01492 {
01493         CcdPhysicsController* ctrl0=0,*ctrl1=0;
01494
01495         if (m_triggerCallbacks[PHY_OBJECT_RESPONSE])
01496         {
01497                 //walk over all overlapping pairs, and if one of the involved bodies is registered for trigger callback, perform callback
01498                 int numManifolds = m_collisionWorld->GetDispatcher()->GetNumManifolds();
01499                 for (int i=0;i<numManifolds;i++)
01500                 {
01501                         PersistentManifold* manifold = m_collisionWorld->GetDispatcher()->GetManifoldByIndexInternal(i);
01502                         int numContacts = manifold->GetNumContacts();
01503                         if (numContacts)
01504                         {
01505                                 RigidBody* obj0 = static_cast<RigidBody* >(manifold->GetBody0());
01506                                 RigidBody* obj1 = static_cast<RigidBody* >(manifold->GetBody1());
01507
01508                                 //m_userPointer is set in 'addPhysicsController
01509                                 CcdPhysicsController* ctrl0 = static_cast<CcdPhysicsController*>(obj0->m_userPointer);
01510                                 CcdPhysicsController* ctrl1 = static_cast<CcdPhysicsController*>(obj1->m_userPointer);
01511
01512                                 std::vector<CcdPhysicsController*>::iterator i =
01513                                         std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl0);
01514                                 if (i == m_triggerControllers.end())
01515                                 {
01516                                         i = std::find(m_triggerControllers.begin(), m_triggerControllers.end(), ctrl1);
01517                                 }
01518
01519                                 if (!(i == m_triggerControllers.end()))
01520                                 {
01521                                         m_triggerCallbacks[PHY_OBJECT_RESPONSE](m_triggerCallbacksUserPtrs[PHY_OBJECT_RESPONSE],
01522                                                 ctrl0,ctrl1,0);
01523                                 }
01524                         }
01525                 }
01526
01527
01528
01529         }
01530
01531 }
01532
01533
01534
01535
01536
01537
01538 #ifdef NEW_BULLET_VEHICLE_SUPPORT
01539
01540 //complex constraint for vehicles
01541 PHY_IVehicle*   CcdPhysicsEnvironment::getVehicleConstraint(int constraintId)
01542 {
01543         int i;
01544
01545         int numVehicles = m_wrapperVehicles.size();
01546         for (i=0;i<numVehicles;i++)
01547         {
01548                 WrapperVehicle* wrapperVehicle = m_wrapperVehicles[i];
01549                 if (wrapperVehicle->GetVehicle()->GetUserConstraintId() == constraintId)
01550                         return wrapperVehicle;
01551         }
01552
01553         return 0;
01554 }
01555
01556 #endif //NEW_BULLET_VEHICLE_SUPPORT
01557
01558
01559
01560 void    CcdPhysicsEnvironment::UpdateAabbs(float        timeStep)
01561 {
01562         std::vector<CcdPhysicsController*>::iterator i;
01563         BroadphaseInterface* scene =  GetBroadphase();
01564
01565         //
01566                         // update aabbs, only for moving objects (!)
01567                         //
01568                         for (i=m_controllers.begin();
01569                                 !(i==m_controllers.end()); i++)
01570                         {
01571                                 CcdPhysicsController* ctrl = (*i);
01572                                 RigidBody* body = ctrl->GetRigidBody();
01573
01574
01575                                 SimdPoint3 minAabb,maxAabb;
01576                                 CollisionShape* shapeinterface = ctrl->GetCollisionShape();
01577
01578
01579
01580                                 shapeinterface->CalculateTemporalAabb(body->getCenterOfMassTransform(),
01581                                         body->getLinearVelocity(),
01582                                         //body->getAngularVelocity(),
01583                                         SimdVector3(0.f,0.f,0.f),//no angular effect for now //body->getAngularVelocity(),
01584                                         timeStep,minAabb,maxAabb);
01585
01586
01587                                 SimdVector3 manifoldExtraExtents(gContactBreakingTreshold,gContactBreakingTreshold,gContactBreakingTreshold);
01588                                 minAabb -= manifoldExtraExtents;
01589                                 maxAabb += manifoldExtraExtents;
01590
01591                                 BroadphaseProxy* bp = body->m_broadphaseHandle;
01592                                 if (bp)
01593                                 {
01594
01595                                         SimdVector3 color (1,1,0);
01596
01597                                         if (m_debugDrawer)
01598                                         {
01599                                                 //draw aabb
01600                                                 switch (body->GetActivationState())
01601                                                 {
01602                                                 case ISLAND_SLEEPING:
01603                                                         {
01604                                                                 color.setValue(1,1,1);
01605                                                                 break;
01606                                                         }
01607                                                 case WANTS_DEACTIVATION:
01608                                                         {
01609                                                                 color.setValue(0,0,1);
01610                                                                 break;
01611                                                         }
01612                                                 case ACTIVE_TAG:
01613                                                         {
01614                                                                 break;
01615                                                         }
01616                                                 case DISABLE_DEACTIVATION:
01617                                                         {
01618                                                                 color.setValue(1,0,1);
01619                                                         };
01620
01621                                                 };
01622
01623                                                 if (m_debugDrawer->GetDebugMode() & IDebugDraw::DBG_DrawAabb)
01624                                                 {
01625                                                         DrawAabb(m_debugDrawer,minAabb,maxAabb,color);
01626                                                 }
01627                                         }
01628
01629                                         scene->SetAabb(bp,minAabb,maxAabb);
01630
01631
01632
01633                                 }
01634                         }
01635 }
01636
01637 PHY_IPhysicsController* CcdPhysicsEnvironment::CreateSphereController(float radius,const PHY__Vector3& position)
01638 {
01639
01640         CcdConstructionInfo     cinfo;
01641         cinfo.m_collisionShape = new SphereShape(radius);
01642         cinfo.m_MotionState = 0;
01643         cinfo.m_physicsEnv = this;
01644         cinfo.m_collisionFlags |= CollisionObject::noContactResponse;
01645         DefaultMotionState* motionState = new DefaultMotionState();
01646         cinfo.m_MotionState = motionState;
01647         motionState->m_worldTransform.setIdentity();
01648         motionState->m_worldTransform.setOrigin(SimdVector3(position[0],position[1],position[2]));
01649
01650         CcdPhysicsController* sphereController = new CcdPhysicsController(cinfo);
01651
01652
01653         return sphereController;
01654 }
01655
01656
01657 PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float coneradius,float coneheight)
01658 {
01659         CcdConstructionInfo     cinfo;
01660         cinfo.m_collisionShape = new ConeShape(coneradius,coneheight);
01661         cinfo.m_MotionState = 0;
01662         cinfo.m_physicsEnv = this;
01663         DefaultMotionState* motionState = new DefaultMotionState();
01664         cinfo.m_MotionState = motionState;
01665         motionState->m_worldTransform.setIdentity();
01666 //      motionState->m_worldTransform.setOrigin(SimdVector3(position[0],position[1],position[2]));
01667
01668         CcdPhysicsController* sphereController = new CcdPhysicsController(cinfo);
01669
01670
01671         return sphereController;
01672 }
01673
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsEnvironment.h File Reference

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsEnvironment.h File Reference

#include "PHY_IPhysicsEnvironment.h"
#include <vector>
#include "SimdVector3.h"
#include "ConstraintSolver/ContactSolverInfo.h"

Include dependency graph for CcdPhysicsEnvironment.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class CcdPhysicsEnvironment
CcdPhysicsEnvironment is experimental mainloop for physics simulation using optional continuous collision detection. More...

Generated on Wed May 24 13:58:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsEnvironment.h Source File

Extras » PhysicsInterface » CcdPhysics

CcdPhysicsEnvironment.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CCDPHYSICSENVIRONMENT
00017 #define CCDPHYSICSENVIRONMENT
00018
00019 #include "PHY_IPhysicsEnvironment.h"
00020 #include <vector>
00021 class CcdPhysicsController;
00022 #include "SimdVector3.h"
00023
00024
00025
00026 class TypedConstraint;
00027
00028 class CollisionDispatcher;
00029 class Dispatcher;
00030 //#include "BroadphaseInterface.h"
00031
00032 //switch on/off new vehicle support
00033 //#define NEW_BULLET_VEHICLE_SUPPORT 1
00034
00035 #include "ConstraintSolver/ContactSolverInfo.h"
00036
00037 class WrapperVehicle;
00038 class PersistentManifold;
00039 class BroadphaseInterface;
00040 class IDebugDraw;
00041
00046 class CcdPhysicsEnvironment : public PHY_IPhysicsEnvironment
00047 {
00048         SimdVector3 m_gravity;
00049
00050         IDebugDraw*     m_debugDrawer;
00051         //solver iterations
00052         int     m_numIterations;
00053
00054         //timestep subdivisions
00055         int     m_numTimeSubSteps;
00056         int     m_ccdMode;
00057         int     m_solverType;
00058         int     m_profileTimings;
00059         bool m_enableSatCollisionDetection;
00060
00061         ContactSolverInfo       m_solverInfo;
00062
00063
00064         public:
00065                 CcdPhysicsEnvironment(CollisionDispatcher* dispatcher=0, BroadphaseInterface* broadphase=0);
00066
00067                 virtual         ~CcdPhysicsEnvironment();
00068
00070                 //PHY_IPhysicsEnvironment interface
00072
00074
00075                 virtual void setDebugDrawer(IDebugDraw* debugDrawer)
00076                 {
00077                         m_debugDrawer = debugDrawer;
00078                 }
00079
00080                 virtual void            setNumIterations(int numIter);
00081                 virtual void            setNumTimeSubSteps(int numTimeSubSteps)
00082                 {
00083                         m_numTimeSubSteps = numTimeSubSteps;
00084                 }
00085                 virtual void            setDeactivationTime(float dTime);
00086                 virtual void            setDeactivationLinearTreshold(float linTresh) ;
00087                 virtual void            setDeactivationAngularTreshold(float angTresh) ;
00088                 virtual void            setContactBreakingTreshold(float contactBreakingTreshold) ;
00089                 virtual void            setCcdMode(int ccdMode);
00090                 virtual void            setSolverType(int solverType);
00091                 virtual void            setSolverSorConstant(float sor);
00092                 virtual void            setSolverTau(float tau);
00093                 virtual void            setSolverDamping(float damping);
00094                 virtual void            setLinearAirDamping(float damping);
00095                 virtual void            setUseEpa(bool epa) ;
00096
00097                 virtual void            beginFrame();
00098                 virtual void            endFrame() {};
00100                 virtual bool            proceedDeltaTime(double curTime,float timeStep);
00101                 bool                            proceedDeltaTimeOneStep(float timeStep);
00102
00103                 virtual void            setFixedTimeStep(bool useFixedTimeStep,float fixedTimeStep){};
00104                 //returns 0.f if no fixed timestep is used
00105
00106                 virtual float           getFixedTimeStep(){ return 0.f;};
00107
00108                 virtual void            setDebugMode(int debugMode);
00109
00110                 virtual void            setGravity(float x,float y,float z);
00111
00112                 virtual int                     createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
00113                         float pivotX,float pivotY,float pivotZ,
00114                         float axisX,float axisY,float axisZ);
00115             virtual void                removeConstraint(int    constraintid);
00116
00117
00118                 virtual void    CallbackTriggers();
00119
00120
00121 #ifdef NEW_BULLET_VEHICLE_SUPPORT
00122                 //complex constraint for vehicles
00123                 virtual PHY_IVehicle*   getVehicleConstraint(int constraintId);
00124 #else
00125                 virtual class PHY_IVehicle*     getVehicleConstraint(int constraintId)
00126                 {
00127                         return 0;
00128                 }
00129 #endif //NEW_BULLET_VEHICLE_SUPPORT
00130
00131                 TypedConstraint*        getConstraintById(int constraintId);
00132
00133                 virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
00134                                                                                 float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
00135
00136
00137                 //Methods for gamelogic collision/physics callbacks
00138                 virtual void addSensor(PHY_IPhysicsController* ctrl);
00139                 virtual void removeSensor(PHY_IPhysicsController* ctrl);
00140                 virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user);
00141                 virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl);
00142                 virtual void removeCollisionCallback(PHY_IPhysicsController* ctrl);
00143
00144                 virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position);
00145                 virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight);
00146
00147
00148                 virtual int     getNumContactPoints();
00149
00150                 virtual void getContactPoint(int i,float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ);
00151
00153                 //CcdPhysicsEnvironment interface
00155
00156                 void    addCcdPhysicsController(CcdPhysicsController* ctrl);
00157
00158                 void    removeCcdPhysicsController(CcdPhysicsController* ctrl);
00159
00160                 BroadphaseInterface*    GetBroadphase();
00161
00162                 CollisionDispatcher* GetDispatcher();
00163
00164                 const CollisionDispatcher* GetDispatcher() const;
00165
00166                 bool    IsSatCollisionDetectionEnabled() const
00167                 {
00168                         return m_enableSatCollisionDetection;
00169                 }
00170
00171                 void    EnableSatCollisionDetection(bool enableSat)
00172                 {
00173                         m_enableSatCollisionDetection = enableSat;
00174                 }
00175
00176                 void    UpdateAabbs(float       timeStep);
00177
00178                 int     GetNumControllers();
00179
00180                 CcdPhysicsController* GetPhysicsController( int index);
00181
00182                 int     GetNumManifolds() const;
00183
00184                 const PersistentManifold*       GetManifold(int index) const;
00185
00186                 std::vector<TypedConstraint*> m_constraints;
00187
00188         private:
00189
00190
00191                 void    SyncMotionStates(float timeStep);
00192
00193                 std::vector<CcdPhysicsController*> m_controllers;
00194
00195                 std::vector<CcdPhysicsController*> m_triggerControllers;
00196
00197                 PHY_ResponseCallback    m_triggerCallbacks[PHY_NUM_RESPONSE];
00198                 void*                   m_triggerCallbacksUserPtrs[PHY_NUM_RESPONSE];
00199
00200                 std::vector<WrapperVehicle*>    m_wrapperVehicles;
00201
00202                 class CollisionWorld*   m_collisionWorld;
00203
00204                 class ConstraintSolver* m_solver;
00205
00206                 bool    m_scalingPropagated;
00207
00208
00209 };
00210
00211 #endif //CCDPHYSICSENVIRONMENT
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithm.cpp File Reference

Bullet » BroadphaseCollision

CollisionAlgorithm.cpp File Reference

#include "CollisionAlgorithm.h"
#include "Dispatcher.h"

Include dependency graph for CollisionAlgorithm.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithm.cpp Source File

Bullet » BroadphaseCollision

CollisionAlgorithm.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "CollisionAlgorithm.h"
00017 #include "Dispatcher.h"
00018
00019 CollisionAlgorithm::CollisionAlgorithm(const CollisionAlgorithmConstructionInfo& ci)
00020 {
00021         m_dispatcher = ci.m_dispatcher;
00022 }
00023
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithm.h File Reference

Bullet » BroadphaseCollision

CollisionAlgorithm.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | CollisionAlgorithmConstructionInfo
class | CollisionAlgorithm
CollisionAlgorithm is an collision interface that is compatible with the Broadphase and Dispatcher. More...

Generated on Wed May 24 13:58:53 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithm.h Source File

Bullet » BroadphaseCollision

CollisionAlgorithm.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef COLLISION_ALGORITHM_H
00017 #define COLLISION_ALGORITHM_H
00018
00019 struct BroadphaseProxy;
00020 class Dispatcher;
00021
00022 struct CollisionAlgorithmConstructionInfo
00023 {
00024         CollisionAlgorithmConstructionInfo()
00025                 :m_dispatcher(0)
00026         {
00027         }
00028         CollisionAlgorithmConstructionInfo(Dispatcher* dispatcher,int temp)
00029                 :m_dispatcher(dispatcher)
00030         {
00031         }
00032
00033         Dispatcher*     m_dispatcher;
00034
00035         int     GetDispatcherId();
00036
00037 };
00038
00039
00042 class CollisionAlgorithm
00043 {
00044
00045 protected:
00046
00047         Dispatcher*     m_dispatcher;
00048
00049 protected:
00050         int     GetDispatcherId();
00051
00052 public:
00053
00054         CollisionAlgorithm() {};
00055
00056         CollisionAlgorithm(const CollisionAlgorithmConstructionInfo& ci);
00057
00058         virtual ~CollisionAlgorithm() {};
00059
00060         virtual void ProcessCollision (BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const struct DispatcherInfo& dispatchInfo) = 0;
00061
00062         virtual float CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const struct DispatcherInfo& dispatchInfo) = 0;
00063
00064 };
00065
00066
00067 #endif //COLLISION_ALGORITHM_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionDispatcher.cpp File Reference

Bullet » CollisionDispatch

CollisionDispatcher.cpp File Reference

#include "CollisionDispatcher.h"
#include "BroadphaseCollision/CollisionAlgorithm.h"
#include "CollisionDispatch/ConvexConvexAlgorithm.h"
#include "CollisionDispatch/EmptyCollisionAlgorithm.h"
#include "CollisionDispatch/ConvexConcaveCollisionAlgorithm.h"
#include "CollisionShapes/CollisionShape.h"
#include "CollisionDispatch/CollisionObject.h"
#include <algorithm>

Include dependency graph for CollisionDispatcher.cpp:

Go to the source code of this file.

Variables

int gNumManifold = 0

Variable Documentation

int gNumManifold = 0

Definition at line 28 of file CollisionDispatcher.cpp.

Referenced by CollisionDispatcher::GetNewManifold(), and CollisionDispatcher::ReleaseManifold().

Generated on Wed May 24 13:58:53 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionDispatcher.cpp Source File

Bullet » CollisionDispatch

CollisionDispatcher.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "CollisionDispatcher.h"
00018
00019
00020 #include "BroadphaseCollision/CollisionAlgorithm.h"
00021 #include "CollisionDispatch/ConvexConvexAlgorithm.h"
00022 #include "CollisionDispatch/EmptyCollisionAlgorithm.h"
00023 #include "CollisionDispatch/ConvexConcaveCollisionAlgorithm.h"
00024 #include "CollisionShapes/CollisionShape.h"
00025 #include "CollisionDispatch/CollisionObject.h"
00026 #include <algorithm>
00027
00028 int gNumManifold = 0;
00029
00030 void CollisionDispatcher::FindUnions()
00031 {
00032         if (m_useIslands)
00033         {
00034                 for (int i=0;i<GetNumManifolds();i++)
00035                 {
00036                         const PersistentManifold* manifold = this->GetManifoldByIndexInternal(i);
00037                         //static objects (invmass 0.f) don't merge !
00038
00039                          const  CollisionObject* colObj0 = static_cast<const CollisionObject*>(manifold->GetBody0());
00040                          const  CollisionObject* colObj1 = static_cast<const CollisionObject*>(manifold->GetBody1());
00041
00042                          if (colObj0 && colObj1 && NeedsResponse(*colObj0,*colObj1))
00043                          {
00044                                 if (((colObj0) && ((colObj0)->mergesSimulationIslands())) &&
00045                                         ((colObj1) && ((colObj1)->mergesSimulationIslands())))
00046                                 {
00047
00048                                         m_unionFind.unite((colObj0)->m_islandTag1,
00049                                                 (colObj1)->m_islandTag1);
00050                                 }
00051                          }
00052
00053
00054                 }
00055         }
00056
00057 }
00058
00059
00060
00061 CollisionDispatcher::CollisionDispatcher ():
00062         m_useIslands(true),
00063                 m_defaultManifoldResult(0,0,0),
00064                 m_count(0)
00065 {
00066         int i;
00067
00068         for (i=0;i<MAX_BROADPHASE_COLLISION_TYPES;i++)
00069         {
00070                 for (int j=0;j<MAX_BROADPHASE_COLLISION_TYPES;j++)
00071                 {
00072                         m_doubleDispatch[i][j] = 0;
00073                 }
00074         }
00075
00076
00077 };
00078
00079 PersistentManifold*     CollisionDispatcher::GetNewManifold(void* b0,void* b1)
00080 {
00081         gNumManifold++;
00082         //printf("GetNewManifoldResult: gNumManifold %d\n",gNumManifold);
00083
00084         CollisionObject* body0 = (CollisionObject*)b0;
00085         CollisionObject* body1 = (CollisionObject*)b1;
00086
00087         PersistentManifold* manifold = new PersistentManifold (body0,body1);
00088         m_manifoldsPtr.push_back(manifold);
00089
00090         return manifold;
00091 }
00092
00093 void CollisionDispatcher::ClearManifold(PersistentManifold* manifold)
00094 {
00095         manifold->ClearManifold();
00096 }
00097
00098
00099 void CollisionDispatcher::ReleaseManifold(PersistentManifold* manifold)
00100 {
00101
00102         gNumManifold--;
00103
00104         //printf("ReleaseManifold: gNumManifold %d\n",gNumManifold);
00105
00106         ClearManifold(manifold);
00107
00108         std::vector<PersistentManifold*>::iterator i =
00109                 std::find(m_manifoldsPtr.begin(), m_manifoldsPtr.end(), manifold);
00110         if (!(i == m_manifoldsPtr.end()))
00111         {
00112                 std::swap(*i, m_manifoldsPtr.back());
00113                 m_manifoldsPtr.pop_back();
00114                 delete manifold;
00115
00116         }
00117
00118
00119 }
00120
00121
00122 //
00123 // todo: this is random access, it can be walked 'cache friendly'!
00124 //
00125 void CollisionDispatcher::BuildAndProcessIslands(int numBodies, IslandCallback* callback)
00126 {
00127         for (int islandId=0;islandId<numBodies;islandId++)
00128         {
00129
00130                 std::vector<PersistentManifold*>  islandmanifold;
00131
00132                 //int numSleeping = 0;
00133
00134                 bool allSleeping = true;
00135
00136                 for (int i=0;i<GetNumManifolds();i++)
00137                 {
00138                          PersistentManifold* manifold = this->GetManifoldByIndexInternal(i);
00139
00140                          //filtering for response
00141
00142                          CollisionObject* colObj0 = static_cast<CollisionObject*>(manifold->GetBody0());
00143                          CollisionObject* colObj1 = static_cast<CollisionObject*>(manifold->GetBody1());
00144
00145
00146
00147                          {
00148                                 if (((colObj0) && (colObj0)->m_islandTag1 == (islandId)) ||
00149                                         ((colObj1) && (colObj1)->m_islandTag1 == (islandId)))
00150                                 {
00151
00152                                         if (((colObj0) && (colObj0)->GetActivationState()== ACTIVE_TAG) ||
00153                                                 ((colObj1) && (colObj1)->GetActivationState() == ACTIVE_TAG))
00154                                         {
00155                                                 allSleeping = false;
00156                                         }
00157                                         if (((colObj0) && (colObj0)->GetActivationState()== DISABLE_DEACTIVATION) ||
00158                                                 ((colObj1) && (colObj1)->GetActivationState() == DISABLE_DEACTIVATION))
00159                                         {
00160                                                 allSleeping = false;
00161                                         }
00162
00163                                         if (NeedsResponse(*colObj0,*colObj1))
00164                                                 islandmanifold.push_back(manifold);
00165                                 }
00166                          }
00167                 }
00168                 if (allSleeping)
00169                 {
00170                         //tag all as 'ISLAND_SLEEPING'
00171                         for (size_t i=0;i<islandmanifold.size();i++)
00172                         {
00173                                 PersistentManifold* manifold = islandmanifold[i];
00174
00175                                 CollisionObject* colObj0 = static_cast<CollisionObject*>(manifold->GetBody0());
00176                                 CollisionObject* colObj1 = static_cast<CollisionObject*>(manifold->GetBody1());
00177
00178                                 if ((colObj0))
00179                                 {
00180                                         (colObj0)->SetActivationState( ISLAND_SLEEPING );
00181                                 }
00182                                 if ((colObj1))
00183                                 {
00184                                         (colObj1)->SetActivationState( ISLAND_SLEEPING);
00185                                 }
00186
00187                         }
00188                 } else
00189                 {
00190
00191                         //tag all as 'ISLAND_SLEEPING'
00192                         for (size_t i=0;i<islandmanifold.size();i++)
00193                         {
00194                                  PersistentManifold* manifold = islandmanifold[i];
00195                                  CollisionObject* body0 = (CollisionObject*)manifold->GetBody0();
00196                                  CollisionObject* body1 = (CollisionObject*)manifold->GetBody1();
00197
00198                                 if (body0)
00199                                 {
00200                                         if ( body0->GetActivationState() == ISLAND_SLEEPING)
00201                                         {
00202                                                 body0->SetActivationState( WANTS_DEACTIVATION);
00203                                         }
00204                                 }
00205                                 if (body1)
00206                                 {
00207                                         if ( body1->GetActivationState() == ISLAND_SLEEPING)
00208                                         {
00209                                                 body1->SetActivationState(WANTS_DEACTIVATION);
00210                                         }
00211                                 }
00212
00213                         }
00214
00215                         if (islandmanifold.size())
00216                         {
00217                                 callback->ProcessIsland(&islandmanifold[0],islandmanifold.size());
00218                         }
00219
00220                 }
00221         }
00222 }
00223
00224
00225
00226 CollisionAlgorithm* CollisionDispatcher::InternalFindAlgorithm(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1)
00227 {
00228         m_count++;
00229         CollisionObject* body0 = (CollisionObject*)proxy0.m_clientObject;
00230         CollisionObject* body1 = (CollisionObject*)proxy1.m_clientObject;
00231
00232         CollisionAlgorithmConstructionInfo ci;
00233         ci.m_dispatcher = this;
00234
00235         if (body0->m_collisionShape->IsConvex() && body1->m_collisionShape->IsConvex() )
00236         {
00237                 return new ConvexConvexAlgorithm(0,ci,&proxy0,&proxy1);
00238         }
00239
00240         if (body0->m_collisionShape->IsConvex() && body1->m_collisionShape->IsConcave())
00241         {
00242                 return new ConvexConcaveCollisionAlgorithm(ci,&proxy0,&proxy1);
00243         }
00244
00245         if (body1->m_collisionShape->IsConvex() && body0->m_collisionShape->IsConcave())
00246         {
00247                 return new ConvexConcaveCollisionAlgorithm(ci,&proxy1,&proxy0);
00248         }
00249
00250         //failed to find an algorithm
00251         return new EmptyAlgorithm(ci);
00252
00253 }
00254
00255 bool    CollisionDispatcher::NeedsResponse(const  CollisionObject& colObj0,const CollisionObject& colObj1)
00256 {
00257         //here you can do filtering
00258         bool hasResponse =
00259                 (!(colObj0.m_collisionFlags & CollisionObject::noContactResponse)) &&
00260                 (!(colObj1.m_collisionFlags & CollisionObject::noContactResponse));
00261         return hasResponse;
00262 }
00263
00264 bool    CollisionDispatcher::NeedsCollision(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1)
00265 {
00266
00267         CollisionObject* body0 = (CollisionObject*)proxy0.m_clientObject;
00268         CollisionObject* body1 = (CollisionObject*)proxy1.m_clientObject;
00269
00270         assert(body0);
00271         assert(body1);
00272
00273         bool needsCollision = true;
00274
00275         if ((body0->m_collisionFlags & CollisionObject::isStatic) &&
00276                 (body1->m_collisionFlags & CollisionObject::isStatic))
00277                 needsCollision = false;
00278
00279         if ((body0->GetActivationState() == 2) &&(body1->GetActivationState() == 2))
00280                 needsCollision = false;
00281
00282         return needsCollision ;
00283
00284 }
00285
00287 ManifoldResult* CollisionDispatcher::GetNewManifoldResult(CollisionObject* obj0,CollisionObject* obj1,PersistentManifold* manifold)
00288 {
00289
00290
00291         //in-place, this prevents parallel dispatching, but just adding a list would fix that.
00292         ManifoldResult* manifoldResult = new (&m_defaultManifoldResult) ManifoldResult(obj0,obj1,manifold);
00293         return manifoldResult;
00294 }
00295
00297 void    CollisionDispatcher::ReleaseManifoldResult(ManifoldResult*)
00298 {
00299
00300 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionDispatcher.h File Reference

Bullet » CollisionDispatch

CollisionDispatcher.h File Reference

#include "BroadphaseCollision/Dispatcher.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "CollisionDispatch/UnionFind.h"
#include "CollisionDispatch/ManifoldResult.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include <vector>

Include dependency graph for CollisionDispatcher.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | CollisionAlgorithmCreateFunc
class | CollisionDispatcher
CollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs. More...
struct | CollisionDispatcher::IslandCallback

Generated on Wed May 24 13:58:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionDispatcher.h Source File

Bullet » CollisionDispatch

CollisionDispatcher.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef COLLISION__DISPATCHER_H
00017 #define COLLISION__DISPATCHER_H
00018
00019 #include "BroadphaseCollision/Dispatcher.h"
00020 #include "NarrowPhaseCollision/PersistentManifold.h"
00021 #include "CollisionDispatch/UnionFind.h"
00022 #include "CollisionDispatch/ManifoldResult.h"
00023
00024 #include "BroadphaseCollision/BroadphaseProxy.h"
00025 #include <vector>
00026
00027 class IDebugDraw;
00028
00029
00030
00031
00032 struct CollisionAlgorithmCreateFunc
00033 {
00034         bool m_swapped;
00035
00036         CollisionAlgorithmCreateFunc()
00037                 :m_swapped(false)
00038         {
00039         }
00040         virtual ~CollisionAlgorithmCreateFunc(){};
00041
00042         virtual CollisionAlgorithm* CreateCollisionAlgorithm(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1)
00043         {
00044                 return 0;
00045         }
00046 };
00047
00048
00051 class CollisionDispatcher : public Dispatcher
00052 {
00053
00054         std::vector<PersistentManifold*>        m_manifoldsPtr;
00055
00056         UnionFind m_unionFind;
00057
00058         bool m_useIslands;
00059
00060         ManifoldResult  m_defaultManifoldResult;
00061
00062         CollisionAlgorithmCreateFunc* m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES];
00063
00064 public:
00065
00066         UnionFind& GetUnionFind() { return m_unionFind;}
00067
00068         struct  IslandCallback
00069         {
00070                 virtual ~IslandCallback() {};
00071
00072                 virtual void    ProcessIsland(PersistentManifold**      manifolds,int numManifolds) = 0;
00073         };
00074
00075
00076         int     GetNumManifolds() const
00077         {
00078                 return m_manifoldsPtr.size();
00079         }
00080
00081          PersistentManifold* GetManifoldByIndexInternal(int index)
00082         {
00083                 return m_manifoldsPtr[index];
00084         }
00085
00086          const PersistentManifold* GetManifoldByIndexInternal(int index) const
00087         {
00088                 return m_manifoldsPtr[index];
00089         }
00090
00091         void InitUnionFind(int n)
00092         {
00093                 if (m_useIslands)
00094                         m_unionFind.reset(n);
00095         }
00096
00097         void FindUnions();
00098
00099         int m_count;
00100
00101         CollisionDispatcher ();
00102         virtual ~CollisionDispatcher() {};
00103
00104         virtual PersistentManifold*     GetNewManifold(void* b0,void* b1);
00105
00106         virtual void ReleaseManifold(PersistentManifold* manifold);
00107
00108
00109         virtual void BuildAndProcessIslands(int numBodies, IslandCallback* callback);
00110
00112         virtual ManifoldResult* GetNewManifoldResult(CollisionObject* obj0,CollisionObject* obj1,PersistentManifold* manifold);
00113
00115         virtual void    ReleaseManifoldResult(ManifoldResult*);
00116
00117         virtual void ClearManifold(PersistentManifold* manifold);
00118
00119
00120         CollisionAlgorithm* FindAlgorithm(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1)
00121         {
00122                 CollisionAlgorithm* algo = InternalFindAlgorithm(proxy0,proxy1);
00123                 return algo;
00124         }
00125
00126         CollisionAlgorithm* InternalFindAlgorithm(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1);
00127
00128         virtual bool    NeedsCollision(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1);
00129
00130         virtual bool    NeedsResponse(const CollisionObject& colObj0,const CollisionObject& colObj1);
00131
00132         virtual int GetUniqueId() { return RIGIDBODY_DISPATCHER;}
00133
00134
00135
00136 };
00137
00138 #endif //COLLISION__DISPATCHER_H
00139
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionMargin.h File Reference

Bullet » CollisionShapes

CollisionShapes/CollisionMargin.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define CONVEX_DISTANCE_MARGIN 0.04f

Define Documentation

#define CONVEX_DISTANCE_MARGIN 0.04f

Definition at line 21 of file CollisionShapes/CollisionMargin.h.

Referenced by MultiSphereShape::CalculateLocalInertia().

Generated on Wed May 24 13:58:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionMargin.h Source File

Bullet » CollisionShapes

CollisionShapes/CollisionMargin.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef COLLISION_MARGIN_H
00017 #define COLLISION_MARGIN_H
00018
00019 //used by Gjk and some other algorithms
00020
00021 #define CONVEX_DISTANCE_MARGIN 0.04f// 0.1f//;//0.01f
00022
00023
00024
00025 #endif //COLLISION_MARGIN_H
00026
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionMargin.h File Reference

Bullet » NarrowPhaseCollision

NarrowPhaseCollision/CollisionMargin.h File Reference

Go to the source code of this file.

Defines

#define CONVEX_DISTANCE_MARGIN 0.04f

Define Documentation

#define CONVEX_DISTANCE_MARGIN 0.04f

Definition at line 21 of file NarrowPhaseCollision/CollisionMargin.h.

Generated on Wed May 24 13:58:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionMargin.h Source File

Bullet » NarrowPhaseCollision

NarrowPhaseCollision/CollisionMargin.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef COLLISION_MARGIN_H
00017 #define COLLISION_MARGIN_H
00018
00019 //used by Gjk and some other algorithms
00020
00021 #define CONVEX_DISTANCE_MARGIN 0.04f// 0.1f//;//0.01f
00022
00023
00024
00025 #endif //COLLISION_MARGIN_H
00026
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionObject.cpp File Reference

Bullet » CollisionDispatch

CollisionObject.cpp File Reference

#include "CollisionObject.h"

Include dependency graph for CollisionObject.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionObject.cpp Source File

Bullet » CollisionDispatch

CollisionObject.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "CollisionObject.h"
00017
00018 CollisionObject::CollisionObject()
00019         :       m_collisionFlags(0),
00020                 m_activationState1(1),
00021                 m_deactivationTime(0.f),
00022                 m_broadphaseHandle(0),
00023                 m_collisionShape(0),
00024                 m_hitFraction(1.f),
00025                 m_ccdSweptShereRadius(0.f),
00026                 m_ccdSquareMotionTreshold(0.f)
00027 {
00028
00029 }
00030
00031
00032 void CollisionObject::SetActivationState(int newState)
00033 {
00034         if (m_activationState1 != DISABLE_DEACTIVATION)
00035                 m_activationState1 = newState;
00036 }
00037
00038 void CollisionObject::ForceActivationState(int newState)
00039 {
00040         m_activationState1 = newState;
00041 }
00042
00043 void CollisionObject::activate()
00044 {
00045         if (!(m_collisionFlags & isStatic))
00046         {
00047                 SetActivationState(1);
00048                 m_deactivationTime = 0.f;
00049         }
00050 }
00051
00052 bool CollisionObject::mergesSimulationIslands() const
00053 {
00054         return ( !(m_collisionFlags & isStatic));
00055 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionObject.h File Reference

Bullet » CollisionDispatch

CollisionObject.h File Reference

#include "SimdTransform.h"

Include dependency graph for CollisionObject.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | CollisionObject
CollisionObject can be used to manage collision detection objects. More...

Defines

#define | ACTIVE_TAG 1
#define | ISLAND_SLEEPING 2
#define | WANTS_DEACTIVATION 3
#define | DISABLE_DEACTIVATION 4

Define Documentation

#define ACTIVE_TAG 1

Definition at line 22 of file CollisionObject.h.

Referenced by CollisionDispatcher::BuildAndProcessIslands(), and CcdPhysicsEnvironment::UpdateAabbs().

#define DISABLE_DEACTIVATION 4

Definition at line 25 of file CollisionObject.h.

Referenced by CollisionDispatcher::BuildAndProcessIslands(), CollisionObject::SetActivationState(), CcdPhysicsEnvironment::UpdateAabbs(), CcdPhysicsController::UpdateDeactivation(), and CcdPhysicsController::wantsSleeping().

#define ISLAND_SLEEPING 2

Definition at line 23 of file CollisionObject.h.

Referenced by CollisionDispatcher::BuildAndProcessIslands(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), CcdPhysicsController::UpdateDeactivation(), and CcdPhysicsController::wantsSleeping().

#define WANTS_DEACTIVATION 3

Definition at line 24 of file CollisionObject.h.

Referenced by CcdPhysicsEnvironment::UpdateAabbs(), and CcdPhysicsController::wantsSleeping().

Generated on Wed May 24 13:58:55 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionObject.h Source File

Bullet » CollisionDispatch

CollisionObject.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef COLLISION_OBJECT_H
00017 #define COLLISION_OBJECT_H
00018
00019 #include "SimdTransform.h"
00020
00021 //island management, m_activationState1
00022 #define ACTIVE_TAG 1
00023 #define ISLAND_SLEEPING 2
00024 #define WANTS_DEACTIVATION 3
00025 #define DISABLE_DEACTIVATION 4
00026
00027 struct  BroadphaseProxy;
00028 class   CollisionShape;
00029
00033 struct  CollisionObject
00034 {
00035         SimdTransform   m_worldTransform;
00036
00037         //m_interpolationWorldTransform is used for CCD and interpolation
00038         //it can be either previous or future (predicted) transform
00039         SimdTransform   m_interpolationWorldTransform;
00040
00041         enum CollisionFlags
00042         {
00043                 isStatic = 1,
00044                 noContactResponse = 2,
00045
00046         };
00047
00048         int                             m_collisionFlags;
00049
00050         int                             m_islandTag1;
00051         int                             m_activationState1;
00052         float                   m_deactivationTime;
00053
00054         BroadphaseProxy*        m_broadphaseHandle;
00055         CollisionShape*         m_collisionShape;
00056
00057         void*                   m_userPointer;//not use by Bullet internally
00058
00060         float                   m_hitFraction;
00061
00063         float                   m_ccdSweptShereRadius;
00064
00066         float                   m_ccdSquareMotionTreshold;
00067
00068         bool                    mergesSimulationIslands() const;
00069
00070         inline bool             IsStatic() const {
00071                 return m_collisionFlags & isStatic;
00072         }
00073
00074         inline bool             HasContactResponse() {
00075                 return !(m_collisionFlags & noContactResponse);
00076         }
00077
00078
00079
00080
00081         CollisionObject();
00082
00083
00084         void    SetCollisionShape(CollisionShape* collisionShape)
00085         {
00086                 m_collisionShape = collisionShape;
00087         }
00088
00089         int     GetActivationState() const { return m_activationState1;}
00090
00091         void SetActivationState(int newState);
00092
00093         void ForceActivationState(int newState);
00094
00095         void    activate();
00096
00097
00098
00099 };
00100
00101 #endif //COLLISION_OBJECT_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionShape.cpp File Reference

Bullet » CollisionShapes

CollisionShape.cpp File Reference

#include "CollisionShapes/CollisionShape.h"

Include dependency graph for CollisionShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:55 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionShape.cpp Source File

Bullet » CollisionShapes

CollisionShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "CollisionShapes/CollisionShape.h"
00017
00018 void    CollisionShape::GetBoundingSphere(SimdVector3& center,SimdScalar& radius) const
00019 {
00020         SimdTransform tr;
00021         tr.setIdentity();
00022         SimdVector3 aabbMin,aabbMax;
00023
00024         GetAabb(tr,aabbMin,aabbMax);
00025
00026         radius = (aabbMax-aabbMin).length()*0.5f;
00027         center = (aabbMin+aabbMax)*0.5f;
00028 }
00029
00030 float   CollisionShape::GetAngularMotionDisc() const
00031 {
00032         SimdVector3     center;
00033         float disc;
00034         GetBoundingSphere(center,disc);
00035         disc += (center).length();
00036         return disc;
00037 }
00038
00039 void CollisionShape::CalculateTemporalAabb(const SimdTransform& curTrans,const SimdVector3& linvel,const SimdVector3& angvel,SimdScalar timeStep, SimdVector3& temporalAabbMin,SimdVector3& temporalAabbMax)
00040 {
00041         //start with static aabb
00042         GetAabb(curTrans,temporalAabbMin,temporalAabbMax);
00043
00044         float temporalAabbMaxx = temporalAabbMax.getX();
00045         float temporalAabbMaxy = temporalAabbMax.getY();
00046         float temporalAabbMaxz = temporalAabbMax.getZ();
00047         float temporalAabbMinx = temporalAabbMin.getX();
00048         float temporalAabbMiny = temporalAabbMin.getY();
00049         float temporalAabbMinz = temporalAabbMin.getZ();
00050
00051         // add linear motion
00052         SimdVector3 linMotion = linvel*timeStep;
00053         //todo: simd would have a vector max/min operation, instead of per-element access
00054         if (linMotion.x() > 0.f)
00055                 temporalAabbMaxx += linMotion.x();
00056         else
00057                 temporalAabbMinx += linMotion.x();
00058         if (linMotion.y() > 0.f)
00059                 temporalAabbMaxy += linMotion.y();
00060         else
00061                 temporalAabbMiny += linMotion.y();
00062         if (linMotion.z() > 0.f)
00063                 temporalAabbMaxz += linMotion.z();
00064         else
00065                 temporalAabbMinz += linMotion.z();
00066
00067         //add conservative angular motion
00068         SimdScalar angularMotion = angvel.length() * GetAngularMotionDisc() * timeStep;
00069         SimdVector3 angularMotion3d(angularMotion,angularMotion,angularMotion);
00070         temporalAabbMin = SimdVector3(temporalAabbMinx,temporalAabbMiny,temporalAabbMinz);
00071         temporalAabbMax = SimdVector3(temporalAabbMaxx,temporalAabbMaxy,temporalAabbMaxz);
00072
00073         temporalAabbMin -= angularMotion3d;
00074         temporalAabbMax += angularMotion3d;
00075 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionShape.h File Reference

Bullet » CollisionShapes

CollisionShape.h File Reference

#include "SimdTransform.h"
#include "SimdVector3.h"
#include <SimdMatrix3x3.h>
#include "SimdPoint3.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for CollisionShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class CollisionShape
CollisionShape provides generic interface for collidable objects. More...

Generated on Wed May 24 13:58:56 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionShape.h Source File

Bullet » CollisionShapes

CollisionShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef COLLISION_SHAPE_H
00017 #define COLLISION_SHAPE_H
00018
00019 #include "SimdTransform.h"
00020 #include "SimdVector3.h"
00021 #include <SimdMatrix3x3.h>
00022 #include "SimdPoint3.h"
00023 #include "BroadphaseCollision/BroadphaseProxy.h" //for the shape types
00024
00026 class CollisionShape
00027 {
00028
00029 public:
00030
00031         CollisionShape()
00032         :m_tempDebug(0)
00033         {
00034         }
00035         virtual ~CollisionShape()
00036         {
00037         }
00038
00039         virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const =0;
00040
00041         virtual void    GetBoundingSphere(SimdVector3& center,SimdScalar& radius) const;
00042
00043         virtual float   GetAngularMotionDisc() const;
00044
00045         virtual int             GetShapeType() const=0;
00046
00049         void CalculateTemporalAabb(const SimdTransform& curTrans,const SimdVector3& linvel,const SimdVector3& angvel,SimdScalar timeStep, SimdVector3& temporalAabbMin,SimdVector3& temporalAabbMax);
00050
00051         bool    IsPolyhedral() const
00052         {
00053                 return (GetShapeType() < IMPLICIT_CONVEX_SHAPES_START_HERE);
00054         }
00055
00056         bool    IsConvex() const
00057         {
00058                 return (GetShapeType() < CONCAVE_SHAPES_START_HERE);
00059         }
00060         bool    IsConcave() const
00061         {
00062                 return (GetShapeType() > CONCAVE_SHAPES_START_HERE);
00063         }
00064
00065
00066         virtual void    setLocalScaling(const SimdVector3& scaling) =0;
00067         virtual const SimdVector3& getLocalScaling() const =0;
00068
00069         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia) = 0;
00070
00071 //debugging support
00072         virtual char*   GetName()const =0 ;
00073         const char* GetExtraDebugInfo() const { return m_tempDebug;}
00074         void  SetExtraDebugInfo(const char* extraDebugInfo) { m_tempDebug = extraDebugInfo;}
00075         const char * m_tempDebug;
00076 //endif debugging support
00077
00078         virtual void    SetMargin(float margin) = 0;
00079         virtual float   GetMargin() const = 0;
00080
00081 };
00082
00083 #endif //COLLISION_SHAPE_H
00084
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld.cpp File Reference

Bullet » CollisionDispatch

CollisionWorld.cpp File Reference

#include "CollisionWorld.h"
#include "CollisionDispatcher.h"
#include "CollisionDispatch/CollisionObject.h"
#include "CollisionShapes/CollisionShape.h"
#include "CollisionShapes/SphereShape.h"
#include "CollisionShapes/TriangleMeshShape.h"
#include "NarrowPhaseCollision/RaycastCallback.h"
#include "NarrowPhaseCollision/SubSimplexConvexCast.h"
#include "BroadphaseCollision/BroadphaseInterface.h"
#include "AabbUtil2.h"
#include <algorithm>

Include dependency graph for CollisionWorld.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:58:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld.cpp Source File

Bullet » CollisionDispatch

CollisionWorld.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "CollisionWorld.h"
00017 #include "CollisionDispatcher.h"
00018 #include "CollisionDispatch/CollisionObject.h"
00019 #include "CollisionShapes/CollisionShape.h"
00020 #include "CollisionShapes/SphereShape.h" //for raycasting
00021 #include "CollisionShapes/TriangleMeshShape.h" //for raycasting
00022 #include "NarrowPhaseCollision/RaycastCallback.h"
00023
00024 #include "NarrowPhaseCollision/SubSimplexConvexCast.h"
00025 #include "BroadphaseCollision/BroadphaseInterface.h"
00026 #include "AabbUtil2.h"
00027
00028 #include <algorithm>
00029
00030 CollisionWorld::~CollisionWorld()
00031 {
00032         //clean up remaining objects
00033         std::vector<CollisionObject*>::iterator i;
00034
00035         int index = 0;
00036         for (i=m_collisionObjects.begin();
00037         !(i==m_collisionObjects.end()); i++)
00038
00039         {
00040                 CollisionObject* collisionObject= (*i);
00041
00042                 BroadphaseProxy* bp = collisionObject->m_broadphaseHandle;
00043                 if (bp)
00044                 {
00045                         //
00046                         // only clear the cached algorithms
00047                         //
00048                         GetBroadphase()->CleanProxyFromPairs(bp);
00049                         GetBroadphase()->DestroyProxy(bp);
00050                 }
00051         }
00052
00053 }
00054
00055 void    CollisionWorld::UpdateActivationState()
00056 {
00057         m_dispatcher->InitUnionFind(m_collisionObjects.size());
00058
00059         // put the index into m_controllers into m_tag
00060         {
00061                 std::vector<CollisionObject*>::iterator i;
00062
00063                 int index = 0;
00064                 for (i=m_collisionObjects.begin();
00065                 !(i==m_collisionObjects.end()); i++)
00066                 {
00067
00068                         CollisionObject*        collisionObject= (*i);
00069                         collisionObject->m_islandTag1 = index;
00070                         collisionObject->m_hitFraction = 1.f;
00071                         index++;
00072
00073                 }
00074         }
00075         // do the union find
00076
00077         m_dispatcher->FindUnions();
00078
00079         // put the islandId ('find' value) into m_tag
00080         {
00081                 UnionFind& unionFind = m_dispatcher->GetUnionFind();
00082
00083                 std::vector<CollisionObject*>::iterator i;
00084
00085                 int index = 0;
00086                 for (i=m_collisionObjects.begin();
00087                 !(i==m_collisionObjects.end()); i++)
00088                 {
00089                         CollisionObject* collisionObject= (*i);
00090
00091                         if (collisionObject->mergesSimulationIslands())
00092                         {
00093                                 collisionObject->m_islandTag1 = unionFind.find(index);
00094                         } else
00095                         {
00096                                 collisionObject->m_islandTag1 = -1;
00097                         }
00098                         index++;
00099                 }
00100         }
00101
00102 }
00103
00104
00105
00106
00107
00108 void    CollisionWorld::AddCollisionObject(CollisionObject* collisionObject)
00109 {
00110                 m_collisionObjects.push_back(collisionObject);
00111
00112                 //calculate new AABB
00113                 SimdTransform trans = collisionObject->m_worldTransform;
00114
00115                 SimdVector3     minAabb;
00116                 SimdVector3     maxAabb;
00117                 collisionObject->m_collisionShape->GetAabb(trans,minAabb,maxAabb);
00118
00119                 int type = collisionObject->m_collisionShape->GetShapeType();
00120                 collisionObject->m_broadphaseHandle = GetBroadphase()->CreateProxy(
00121                         minAabb,
00122                         maxAabb,
00123                         type,
00124                         collisionObject
00125                         );
00126
00127
00128
00129
00130 }
00131
00132 void    CollisionWorld::PerformDiscreteCollisionDetection()
00133 {
00134         DispatcherInfo  dispatchInfo;
00135         dispatchInfo.m_timeStep = 0.f;
00136         dispatchInfo.m_stepCount = 0;
00137
00138         //update aabb (of all moved objects)
00139
00140         SimdVector3 aabbMin,aabbMax;
00141         for (size_t i=0;i<m_collisionObjects.size();i++)
00142         {
00143                 m_collisionObjects[i]->m_collisionShape->GetAabb(m_collisionObjects[i]->m_worldTransform,aabbMin,aabbMax);
00144                 m_broadphase->SetAabb(m_collisionObjects[i]->m_broadphaseHandle,aabbMin,aabbMax);
00145         }
00146
00147         m_broadphase->DispatchAllCollisionPairs(*GetDispatcher(),dispatchInfo);
00148 }
00149
00150
00151 void    CollisionWorld::RemoveCollisionObject(CollisionObject* collisionObject)
00152 {
00153
00154
00155         //bool removeFromBroadphase = false;
00156
00157         {
00158
00159                 BroadphaseProxy* bp = collisionObject->m_broadphaseHandle;
00160                 if (bp)
00161                 {
00162                         //
00163                         // only clear the cached algorithms
00164                         //
00165                         GetBroadphase()->CleanProxyFromPairs(bp);
00166                         GetBroadphase()->DestroyProxy(bp);
00167                 }
00168         }
00169
00170
00171         std::vector<CollisionObject*>::iterator i =     std::find(m_collisionObjects.begin(), m_collisionObjects.end(), collisionObject);
00172
00173         if (!(i == m_collisionObjects.end()))
00174                 {
00175                         std::swap(*i, m_collisionObjects.back());
00176                         m_collisionObjects.pop_back();
00177                 }
00178 }
00179
00180
00181
00182 void    CollisionWorld::RayTest(const SimdVector3& rayFromWorld, const SimdVector3& rayToWorld, RayResultCallback& resultCallback)
00183 {
00184
00185
00186         SimdTransform   rayFromTrans,rayToTrans;
00187         rayFromTrans.setIdentity();
00188         rayFromTrans.setOrigin(rayFromWorld);
00189         rayToTrans.setIdentity();
00190
00191         rayToTrans.setOrigin(rayToWorld);
00192
00193         //do culling based on aabb (rayFrom/rayTo)
00194         SimdVector3 rayAabbMin = rayFromWorld;
00195         SimdVector3 rayAabbMax = rayFromWorld;
00196         rayAabbMin.setMin(rayToWorld);
00197         rayAabbMax.setMax(rayToWorld);
00198
00199         SphereShape pointShape(0.0f);
00200
00203
00204         std::vector<CollisionObject*>::iterator iter;
00205
00206         for (iter=m_collisionObjects.begin();
00207         !(iter==m_collisionObjects.end()); iter++)
00208         {
00209
00210                 CollisionObject*        collisionObject= (*iter);
00211
00212                 //RigidcollisionObject* collisionObject = ctrl->GetRigidcollisionObject();
00213                 SimdVector3 collisionObjectAabbMin,collisionObjectAabbMax;
00214                 collisionObject->m_collisionShape->GetAabb(collisionObject->m_worldTransform,collisionObjectAabbMin,collisionObjectAabbMax);
00215
00216                 //check aabb overlap
00217
00218                 if (TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,collisionObjectAabbMin,collisionObjectAabbMax))
00219                 {
00220                         if (collisionObject->m_collisionShape->IsConvex())
00221                         {
00222                                 ConvexCast::CastResult castResult;
00223                                 castResult.m_fraction = 1.f;//??
00224
00225                                 ConvexShape* convexShape = (ConvexShape*) collisionObject->m_collisionShape;
00226                                 VoronoiSimplexSolver    simplexSolver;
00227                                 SubsimplexConvexCast convexCaster(&pointShape,convexShape,&simplexSolver);
00228                                 //GjkConvexCast convexCaster(&pointShape,convexShape,&simplexSolver);
00229                                 //ContinuousConvexCollision convexCaster(&pointShape,convexShape,&simplexSolver,0);
00230
00231                                 if (convexCaster.calcTimeOfImpact(rayFromTrans,rayToTrans,collisionObject->m_worldTransform,collisionObject->m_worldTransform,castResult))
00232                                 {
00233                                         //add hit
00234                                         if (castResult.m_normal.length2() > 0.0001f)
00235                                         {
00236                                                 castResult.m_normal.normalize();
00237                                                 if (castResult.m_fraction < resultCallback.m_closestHitFraction)
00238                                                 {
00239
00240
00241                                                         CollisionWorld::LocalRayResult localRayResult
00242                                                                 (
00243                                                                         collisionObject,
00244                                                                         0,
00245                                                                         castResult.m_normal,
00246                                                                         castResult.m_fraction
00247                                                                 );
00248
00249                                                         resultCallback.AddSingleResult(localRayResult);
00250
00251                                                 }
00252                                         }
00253                                 }
00254                         }
00255                         else
00256                         {
00257
00258                                 if (collisionObject->m_collisionShape->IsConcave())
00259                                         {
00260
00261                                                 TriangleMeshShape* triangleMesh = (TriangleMeshShape*)collisionObject->m_collisionShape;
00262
00263                                                 SimdTransform worldTocollisionObject = collisionObject->m_worldTransform.inverse();
00264
00265                                                 SimdVector3 rayFromLocal = worldTocollisionObject * rayFromTrans.getOrigin();
00266                                                 SimdVector3 rayToLocal = worldTocollisionObject * rayToTrans.getOrigin();
00267
00268                                                 //ConvexCast::CastResult
00269
00270                                                 struct BridgeTriangleRaycastCallback : public TriangleRaycastCallback
00271                                                 {
00272                                                         RayResultCallback* m_resultCallback;
00273                                                         CollisionObject*        m_collisionObject;
00274                                                         TriangleMeshShape*      m_triangleMesh;
00275
00276                                                         BridgeTriangleRaycastCallback( const SimdVector3& from,const SimdVector3& to,
00277                                                                 RayResultCallback* resultCallback, CollisionObject* collisionObject,TriangleMeshShape*  triangleMesh):
00278                                                                 TriangleRaycastCallback(from,to),
00279                                                                         m_resultCallback(resultCallback),
00280                                                                         m_collisionObject(collisionObject),
00281                                                                         m_triangleMesh(triangleMesh)
00282                                                                 {
00283                                                                 }
00284
00285
00286                                                         virtual float ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex )
00287                                                         {
00288                                                                 CollisionWorld::LocalShapeInfo  shapeInfo;
00289                                                                 shapeInfo.m_shapePart = partId;
00290                                                                 shapeInfo.m_triangleIndex = triangleIndex;
00291
00292                                                                 CollisionWorld::LocalRayResult rayResult
00293                                                                 (m_collisionObject,
00294                                                                         &shapeInfo,
00295                                                                         hitNormalLocal,
00296                                                                         hitFraction);
00297
00298                                                                 return m_resultCallback->AddSingleResult(rayResult);
00299
00300
00301                                                         }
00302
00303                                                 };
00304
00305
00306                                                 BridgeTriangleRaycastCallback   rcb(rayFromLocal,rayToLocal,&resultCallback,collisionObject,triangleMesh);
00307                                                 rcb.m_hitFraction = resultCallback.m_closestHitFraction;
00308
00309                                                 SimdVector3 rayAabbMinLocal = rayFromLocal;
00310                                                 rayAabbMinLocal.setMin(rayToLocal);
00311                                                 SimdVector3 rayAabbMaxLocal = rayFromLocal;
00312                                                 rayAabbMaxLocal.setMax(rayToLocal);
00313
00314                                                 triangleMesh->ProcessAllTriangles(&rcb,rayAabbMinLocal,rayAabbMaxLocal);
00315
00316                                         }
00317
00318
00319                         }
00320                 }
00321         }
00322
00323 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld.h File Reference

Bullet » CollisionDispatch

CollisionWorld.h File Reference

#include "SimdVector3.h"
#include "SimdTransform.h"
#include "CollisionObject.h"
#include <vector>

Include dependency graph for CollisionWorld.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | CollisionWorld
CollisionWorld is interface and container for the collision detection. More...
struct | CollisionWorld::LocalShapeInfo
LocalShapeInfo gives extra information for complex shapes Currently, only TriangleMeshShape is available, so it just contains triangleIndex and subpart. More...
struct | CollisionWorld::LocalRayResult
struct | CollisionWorld::RayResultCallback
RayResultCallback is used to report new raycast results. More...
struct | CollisionWorld::ClosestRayResultCallback

Generated on Wed May 24 13:58:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld.h Source File

Bullet » CollisionDispatch

CollisionWorld.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00060 #ifndef COLLISION_WORLD_H
00061 #define COLLISION_WORLD_H
00062
00063
00064 class CollisionShape;
00065 class CollisionDispatcher;
00066 class BroadphaseInterface;
00067 #include "SimdVector3.h"
00068 #include "SimdTransform.h"
00069 #include "CollisionObject.h"
00070
00071 #include <vector>
00072
00074 class CollisionWorld
00075 {
00076
00077
00078
00079         std::vector<CollisionObject*>   m_collisionObjects;
00080
00081         CollisionDispatcher*    m_dispatcher;
00082
00083         BroadphaseInterface*    m_broadphase;
00084
00085 public:
00086
00087         CollisionWorld(CollisionDispatcher* dispatcher,BroadphaseInterface* broadphase)
00088                 :m_dispatcher(dispatcher),
00089                 m_broadphase(broadphase)
00090         {
00091
00092         }
00093         virtual ~CollisionWorld();
00094
00095         virtual void    UpdateActivationState();
00096
00097         BroadphaseInterface*    GetBroadphase()
00098         {
00099                 return m_broadphase;
00100         }
00101
00102         CollisionDispatcher*    GetDispatcher()
00103         {
00104                 return m_dispatcher;
00105         }
00106
00109         struct  LocalShapeInfo
00110         {
00111                 int     m_shapePart;
00112                 int     m_triangleIndex;
00113
00114                 //const CollisionShape* m_shapeTemp;
00115                 //const SimdTransform*  m_shapeLocalTransform;
00116         };
00117
00118         struct  LocalRayResult
00119         {
00120                 LocalRayResult(const CollisionObject*   collisionObject,
00121                         LocalShapeInfo* localShapeInfo,
00122                         const SimdVector3&              hitNormalLocal,
00123                         float hitFraction)
00124                 :m_collisionObject(collisionObject),
00125                 m_localShapeInfo(m_localShapeInfo),
00126                 m_hitNormalLocal(hitNormalLocal),
00127                 m_hitFraction(hitFraction)
00128                 {
00129                 }
00130
00131                 const CollisionObject*  m_collisionObject;
00132                 LocalShapeInfo*                 m_localShapeInfo;
00133                 const SimdVector3&              m_hitNormalLocal;
00134                 float                                   m_hitFraction;
00135
00136         };
00137
00139         struct  RayResultCallback
00140         {
00141                 virtual ~RayResultCallback()
00142                 {
00143                 }
00144                 float   m_closestHitFraction;
00145                 bool    HasHit()
00146                 {
00147                         return (m_closestHitFraction < 1.f);
00148                 }
00149
00150                 RayResultCallback()
00151                         :m_closestHitFraction(1.f)
00152                 {
00153                 }
00154                 virtual float   AddSingleResult(const LocalRayResult& rayResult) = 0;
00155         };
00156
00157         struct  ClosestRayResultCallback : public RayResultCallback
00158         {
00159                 ClosestRayResultCallback(SimdVector3    rayFromWorld,SimdVector3        rayToWorld)
00160                 :m_rayFromWorld(rayFromWorld),
00161                 m_rayToWorld(rayToWorld),
00162                 m_collisionObject(0)
00163                 {
00164                 }
00165
00166                 SimdVector3     m_rayFromWorld;//used to calculate hitPointWorld from hitFraction
00167                 SimdVector3     m_rayToWorld;
00168
00169                 SimdVector3     m_hitNormalWorld;
00170                 SimdVector3     m_hitPointWorld;
00171                 const CollisionObject*  m_collisionObject;
00172
00173                 virtual float   AddSingleResult(const LocalRayResult& rayResult)
00174                 {
00175
00176 //caller already does the filter on the m_closestHitFraction
00177                         assert(rayResult.m_hitFraction <= m_closestHitFraction);
00178
00179                         m_closestHitFraction = rayResult.m_hitFraction;
00180                         m_collisionObject = rayResult.m_collisionObject;
00181                         m_hitNormalWorld = m_collisionObject->m_worldTransform.getBasis()*rayResult.m_hitNormalLocal;
00182                         m_hitPointWorld.setInterpolate3(m_rayFromWorld,m_rayToWorld,rayResult.m_hitFraction);
00183                         return rayResult.m_hitFraction;
00184                 }
00185         };
00186
00187
00188
00189
00190         int     GetNumCollisionObjects() const
00191         {
00192                 return m_collisionObjects.size();
00193         }
00194
00195         void    RayTest(const SimdVector3& rayFromWorld, const SimdVector3& rayToWorld, RayResultCallback& resultCallback);
00196
00197
00198         void    AddCollisionObject(CollisionObject* collisionObject);
00199
00200         void    RemoveCollisionObject(CollisionObject* collisionObject);
00201
00202         virtual void    PerformDiscreteCollisionDetection();
00203
00204 };
00205
00206
00207 #endif //COLLISION_WORLD_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConeShape.cpp File Reference

Bullet » CollisionShapes

ConeShape.cpp File Reference

#include "ConeShape.h"
#include "SimdPoint3.h"

Include dependency graph for ConeShape.cpp:

Go to the source code of this file.

Variables

static int coneindices [3] = {2,1,0}

Variable Documentation

int coneindices[3] = {2,1,0} [static]

Definition at line 22 of file ConeShape.cpp.

Referenced by ConeShape::ConeLocalSupport().

Generated on Wed May 24 13:58:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConeShape.cpp Source File

Bullet » CollisionShapes

ConeShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "ConeShape.h"
00017 #include "SimdPoint3.h"
00018
00019 #ifdef WIN32
00020 static int coneindices[3] = {1,2,0};
00021 #else
00022 static int coneindices[3] = {2,1,0};
00023 #endif
00024
00025 ConeShape::ConeShape (SimdScalar radius,SimdScalar height):
00026 m_radius (radius),
00027 m_height(height)
00028 {
00029         SimdVector3 halfExtents;
00030         m_sinAngle = (m_radius / sqrt(m_radius * m_radius + m_height * m_height));
00031 }
00032
00033
00034 SimdVector3 ConeShape::ConeLocalSupport(const SimdVector3& v) const
00035 {
00036
00037         float halfHeight = m_height * 0.5f;
00038
00039  if (v[coneindices[1]] > v.length() * m_sinAngle)
00040  {
00041         SimdVector3 tmp;
00042
00043         tmp[coneindices[0]] = 0.f;
00044         tmp[coneindices[1]] = halfHeight;
00045         tmp[coneindices[2]] = 0.f;
00046         return tmp;
00047  }
00048   else {
00049     SimdScalar s = SimdSqrt(v[coneindices[0]] * v[coneindices[0]] + v[coneindices[2]] * v[coneindices[2]]);
00050     if (s > SIMD_EPSILON) {
00051       SimdScalar d = m_radius / s;
00052           SimdVector3 tmp;
00053           tmp[coneindices[0]] = v[coneindices[0]] * d;
00054           tmp[coneindices[1]] = -halfHeight;
00055           tmp[coneindices[2]] = v[coneindices[2]] * d;
00056           return tmp;
00057     }
00058     else  {
00059                 SimdVector3 tmp;
00060                 tmp[coneindices[0]] = 0.f;
00061                 tmp[coneindices[1]] = -halfHeight;
00062                 tmp[coneindices[2]] = 0.f;
00063                 return tmp;
00064         }
00065   }
00066
00067 }
00068
00069 SimdVector3     ConeShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec) const
00070 {
00071                 return ConeLocalSupport(vec);
00072 }
00073
00074 void    ConeShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00075 {
00076         for (int i=0;i<numVectors;i++)
00077         {
00078                 const SimdVector3& vec = vectors[i];
00079                 supportVerticesOut[i] = ConeLocalSupport(vec);
00080         }
00081 }
00082
00083
00084 SimdVector3     ConeShape::LocalGetSupportingVertex(const SimdVector3& vec)  const
00085 {
00086         SimdVector3 supVertex = ConeLocalSupport(vec);
00087         if ( GetMargin()!=0.f )
00088         {
00089                 SimdVector3 vecnorm = vec;
00090                 if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
00091                 {
00092                         vecnorm.setValue(-1.f,-1.f,-1.f);
00093                 }
00094                 vecnorm.normalize();
00095                 supVertex+= GetMargin() * vecnorm;
00096         }
00097         return supVertex;
00098 }
00099
00100
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConeShape.h File Reference

Bullet » CollisionShapes

ConeShape.h File Reference

#include "ConvexShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for ConeShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ConeShape
implements cone shape interface More...

Generated on Wed May 24 13:58:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConeShape.h Source File

Bullet » CollisionShapes

ConeShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONE_MINKOWSKI_H
00017 #define CONE_MINKOWSKI_H
00018
00019 #include "ConvexShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021
00023 class ConeShape : public ConvexShape
00024
00025 {
00026
00027         float m_sinAngle;
00028         float m_radius;
00029         float m_height;
00030
00031         SimdVector3 ConeLocalSupport(const SimdVector3& v) const;
00032
00033
00034 public:
00035         ConeShape (SimdScalar radius,SimdScalar height);
00036
00037         virtual SimdVector3     LocalGetSupportingVertex(const SimdVector3& vec) const;
00038         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec) const;
00039         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00040
00041         float GetRadius() const { return m_radius;}
00042         float GetHeight() const { return m_height;}
00043
00044
00045         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00046         {
00047                 SimdTransform identity;
00048                 identity.setIdentity();
00049                 SimdVector3 aabbMin,aabbMax;
00050                 GetAabb(identity,aabbMin,aabbMax);
00051
00052                 SimdVector3 halfExtents = (aabbMax-aabbMin)*0.5f;
00053
00054                 float margin = GetMargin();
00055
00056                 SimdScalar lx=2.f*(halfExtents.x()+margin);
00057                 SimdScalar ly=2.f*(halfExtents.y()+margin);
00058                 SimdScalar lz=2.f*(halfExtents.z()+margin);
00059                 const SimdScalar x2 = lx*lx;
00060                 const SimdScalar y2 = ly*ly;
00061                 const SimdScalar z2 = lz*lz;
00062                 const SimdScalar scaledmass = mass * 0.08333333f;
00063
00064                 inertia = scaledmass * (SimdVector3(y2+z2,x2+z2,x2+y2));
00065
00066 //              inertia.x() = scaledmass * (y2+z2);
00067 //              inertia.y() = scaledmass * (x2+z2);
00068 //              inertia.z() = scaledmass * (x2+y2);
00069         }
00070
00071
00072
00073                 virtual int     GetShapeType() const { return CONE_SHAPE_PROXYTYPE; }
00074
00075                 virtual char*   GetName()const
00076                 {
00077                         return "Cone";
00078                 }
00079 };
00080
00081
00082 #endif //CONE_MINKOWSKI_H
00083
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConstraintSolver.h File Reference

BulletDynamics » ConstraintSolver

ConstraintSolver.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ConstraintSolver
ConstraintSolver provides solver interface. More...

Generated on Wed May 24 13:58:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConstraintSolver.h Source File

BulletDynamics » ConstraintSolver

ConstraintSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONSTRAINT_SOLVER_H
00017 #define CONSTRAINT_SOLVER_H
00018
00019 class PersistentManifold;
00020 class RigidBody;
00021
00022 struct ContactSolverInfo;
00023 struct BroadphaseProxy;
00024 class IDebugDraw;
00025
00027 class ConstraintSolver
00028 {
00029
00030 public:
00031
00032         virtual ~ConstraintSolver() {}
00033
00034         virtual float SolveGroup(PersistentManifold** manifold,int numManifolds,const ContactSolverInfo& info,class IDebugDraw* debugDrawer = 0) = 0;
00035
00036 };
00037
00038
00039
00040
00041 #endif //CONSTRAINT_SOLVER_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactConstraint.cpp File Reference

BulletDynamics » ConstraintSolver

ContactConstraint.cpp File Reference

#include "ContactConstraint.h"
#include "Dynamics/RigidBody.h"
#include "SimdVector3.h"
#include "JacobianEntry.h"
#include "ContactSolverInfo.h"
#include "GEN_MinMax.h"
#include "NarrowPhaseCollision/ManifoldPoint.h"

Include dependency graph for ContactConstraint.cpp:

Go to the source code of this file.

Defines

#define | ASSERT2 assert

Functions

SimdScalar | calculateCombinedFriction (RigidBody &body0, RigidBody &body1)
void | resolveSingleBilateral (RigidBody &body1, const SimdVector3 &pos1, RigidBody &body2, const SimdVector3 &pos2, SimdScalar distance, const SimdVector3 &normal, SimdScalar &impulse, float timeStep)
bilateral constraint between two dynamic objects positive distance = separation, negative distance = penetration
float | resolveSingleCollision (RigidBody &body1, RigidBody &body2, ManifoldPoint &contactPoint, const ContactSolverInfo &solverInfo)
contact constraint resolution: calculate and apply impulse to satisfy non-penetration and non-negative relative velocity constraint positive distance = separation, negative distance = penetration
float | resolveSingleFriction (RigidBody &body1, RigidBody &body2, ManifoldPoint &contactPoint, const ContactSolverInfo &solverInfo)

Variables

float | useGlobalSettingContacts = false
SimdScalar | contactDamping = 0.2f
SimdScalar | contactTau = .02f

Define Documentation

#define ASSERT2 assert

Definition at line 25 of file ContactConstraint.cpp.

Referenced by resolveSingleBilateral().

Function Documentation

SimdScalar calculateCombinedFriction | ( | RigidBody & | body0,
 |  | RigidBody & | body1
 | ) |

Definition at line 36 of file ContactConstraint.cpp.

References RigidBody::getFriction().

Referenced by resolveSingleFriction().

void resolveSingleBilateral | ( | RigidBody & | body1,
 |  | const SimdVector3 & | pos1,
 |  | RigidBody & | body2,
 |  | const SimdVector3 & | pos2,
 |  | SimdScalar | distance,
 |  | const SimdVector3 & | normal,
 |  | SimdScalar & | impulse,
 |  | float | timeStep
 | ) |

bilateral constraint between two dynamic objects positive distance = separation, negative distance = penetration

Definition at line 51 of file ContactConstraint.cpp.

References ASSERT2, contactDamping, RigidBody::getAngularVelocity(), SimdTransform::getBasis(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), RigidBody::getInvInertiaDiagLocal(), RigidBody::getInvMass(), RigidBody::getLinearVelocity(), RigidBody::getVelocityInLocalPoint(), SimdVector3::length2(), and SimdMatrix3x3::transpose().

float resolveSingleCollision | ( | RigidBody & | body1,
 |  | RigidBody & | body2,
 |  | ManifoldPoint & | contactPoint,
 |  | const ContactSolverInfo & | solverInfo
 | ) |

contact constraint resolution: calculate and apply impulse to satisfy non-penetration and non-negative relative velocity constraint positive distance = separation, negative distance = penetration

Definition at line 105 of file ContactConstraint.cpp.

References RigidBody::applyImpulse(), contactDamping, contactTau, SimdVector3::dot(), RigidBody::getCenterOfMassPosition(), ManifoldPoint::GetPositionWorldOnA(), ManifoldPoint::GetPositionWorldOnB(), RigidBody::getRestitution(), RigidBody::getVelocityInLocalPoint(), ConstraintPersistentData::m_appliedImpulse, ContactSolverInfo::m_damping, ContactSolverInfo::m_erp, ConstraintPersistentData::m_jacDiagABInv, ManifoldPoint::m_normalWorldOnB, ConstraintPersistentData::m_penetration, ConstraintPersistentData::m_restitution, ContactSolverInfo::m_timeStep, ManifoldPoint::m_userPersistentData, and useGlobalSettingContacts.

float resolveSingleFriction | ( | RigidBody & | body1,
 |  | RigidBody & | body2,
 |  | ManifoldPoint & | contactPoint,
 |  | const ContactSolverInfo & | solverInfo
 | ) |

Definition at line 182 of file ContactConstraint.cpp.

References RigidBody::applyImpulse(), calculateCombinedFriction(), SimdVector3::dot(), GEN_set_max(), GEN_set_min(), RigidBody::getCenterOfMassPosition(), ManifoldPoint::GetPositionWorldOnA(), ManifoldPoint::GetPositionWorldOnB(), RigidBody::getVelocityInLocalPoint(), ConstraintPersistentData::m_accumulatedTangentImpulse0, ConstraintPersistentData::m_accumulatedTangentImpulse1, ConstraintPersistentData::m_appliedImpulse, ContactSolverInfo::m_damping, ConstraintPersistentData::m_frictionWorldTangential0, ConstraintPersistentData::m_frictionWorldTangential1, ConstraintPersistentData::m_jacDiagABInvTangent0, ConstraintPersistentData::m_jacDiagABInvTangent1, ManifoldPoint::m_normalWorldOnB, and ManifoldPoint::m_userPersistentData.

Referenced by SimpleConstraintSolver::SolveFriction().

Variable Documentation

SimdScalar contactDamping = 0.2f

Definition at line 30 of file ContactConstraint.cpp.

Referenced by resolveSingleBilateral(), and resolveSingleCollision().

SimdScalar contactTau = .02f

Definition at line 31 of file ContactConstraint.cpp.

Referenced by resolveSingleCollision().

float useGlobalSettingContacts = false

Definition at line 29 of file ContactConstraint.cpp.

Referenced by resolveSingleCollision().

Generated on Wed May 24 13:58:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactConstraint.cpp Source File

BulletDynamics » ConstraintSolver

ContactConstraint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "ContactConstraint.h"
00018 #include "Dynamics/RigidBody.h"
00019 #include "SimdVector3.h"
00020 #include "JacobianEntry.h"
00021 #include "ContactSolverInfo.h"
00022 #include "GEN_MinMax.h"
00023 #include "NarrowPhaseCollision/ManifoldPoint.h"
00024
00025 #define ASSERT2 assert
00026
00027 //some values to find stable tresholds
00028
00029 float useGlobalSettingContacts = false;//true;
00030 SimdScalar contactDamping = 0.2f;
00031 SimdScalar contactTau = .02f;//0.02f;//*0.02f;
00032
00033
00034
00035
00036 SimdScalar      calculateCombinedFriction(RigidBody& body0,RigidBody& body1)
00037 {
00038         SimdScalar friction = body0.getFriction() * body1.getFriction();
00039
00040         const SimdScalar MAX_FRICTION  = 10.f;
00041         if (friction < -MAX_FRICTION)
00042                 friction = -MAX_FRICTION;
00043         if (friction > MAX_FRICTION)
00044                 friction = MAX_FRICTION;
00045         return friction;
00046
00047 }
00048
00049
00050 //bilateral constraint between two dynamic objects
00051 void resolveSingleBilateral(RigidBody& body1, const SimdVector3& pos1,
00052                       RigidBody& body2, const SimdVector3& pos2,
00053                       SimdScalar distance, const SimdVector3& normal,SimdScalar& impulse ,float timeStep)
00054 {
00055         float normalLenSqr = normal.length2();
00056         ASSERT2(fabs(normalLenSqr) < 1.1f);
00057         if (normalLenSqr > 1.1f)
00058         {
00059                 impulse = 0.f;
00060                 return;
00061         }
00062         SimdVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition();
00063         SimdVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition();
00064         //this jacobian entry could be re-used for all iterations
00065
00066         SimdVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1);
00067         SimdVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2);
00068         SimdVector3 vel = vel1 - vel2;
00069
00070
00071           JacobianEntry jac(body1.getCenterOfMassTransform().getBasis().transpose(),
00072                 body2.getCenterOfMassTransform().getBasis().transpose(),
00073                 rel_pos1,rel_pos2,normal,body1.getInvInertiaDiagLocal(),body1.getInvMass(),
00074                 body2.getInvInertiaDiagLocal(),body2.getInvMass());
00075
00076         SimdScalar jacDiagAB = jac.getDiagonal();
00077         SimdScalar jacDiagABInv = 1.f / jacDiagAB;
00078
00079           SimdScalar rel_vel = jac.getRelativeVelocity(
00080                 body1.getLinearVelocity(),
00081                 body1.getCenterOfMassTransform().getBasis().transpose() * body1.getAngularVelocity(),
00082                 body2.getLinearVelocity(),
00083                 body2.getCenterOfMassTransform().getBasis().transpose() * body2.getAngularVelocity());
00084         float a;
00085         a=jacDiagABInv;
00086
00087
00088         rel_vel = normal.dot(vel);
00089
00090
00091 #ifdef ONLY_USE_LINEAR_MASS
00092         SimdScalar massTerm = 1.f / (body1.getInvMass() + body2.getInvMass());
00093         impulse = - contactDamping * rel_vel * massTerm;
00094 #else
00095         SimdScalar velocityImpulse = -contactDamping * rel_vel * jacDiagABInv;
00096         impulse = velocityImpulse;
00097 #endif
00098 }
00099
00100
00101
00102
00103 //velocity + friction
00104 //response  between two dynamic objects with friction
00105 float resolveSingleCollision(
00106         RigidBody& body1,
00107         RigidBody& body2,
00108         ManifoldPoint& contactPoint,
00109         const ContactSolverInfo& solverInfo
00110
00111                 )
00112 {
00113
00114         const SimdVector3& pos1 = contactPoint.GetPositionWorldOnA();
00115         const SimdVector3& pos2 = contactPoint.GetPositionWorldOnB();
00116
00117
00118 //      printf("distance=%f\n",distance);
00119
00120         const SimdVector3& normal = contactPoint.m_normalWorldOnB;
00121
00122         SimdVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition();
00123         SimdVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition();
00124
00125         SimdVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1);
00126         SimdVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2);
00127         SimdVector3 vel = vel1 - vel2;
00128         SimdScalar rel_vel;
00129         rel_vel = normal.dot(vel);
00130
00131         float combinedRestitution = body1.getRestitution() * body2.getRestitution();
00132
00133
00134
00135         SimdScalar Kfps = 1.f / solverInfo.m_timeStep ;
00136
00137         float damping = solverInfo.m_damping ;
00138         float Kerp = solverInfo.m_erp;
00139
00140         if (useGlobalSettingContacts)
00141         {
00142                 damping = contactDamping;
00143                 Kerp = contactTau;
00144         }
00145
00146         float Kcor = Kerp *Kfps;
00147
00148         //printf("dist=%f\n",distance);
00149
00150                 ConstraintPersistentData* cpd = (ConstraintPersistentData*) contactPoint.m_userPersistentData;
00151         assert(cpd);
00152
00153         SimdScalar distance = cpd->m_penetration;//contactPoint.GetDistance();
00154
00155
00156         //distance = 0.f;
00157         SimdScalar positionalError = Kcor *-distance;
00158         //jacDiagABInv;
00159         SimdScalar velocityError = cpd->m_restitution - rel_vel;// * damping;
00160
00161
00162         SimdScalar penetrationImpulse = positionalError * cpd->m_jacDiagABInv;
00163
00164         SimdScalar      velocityImpulse = velocityError * cpd->m_jacDiagABInv;
00165
00166         SimdScalar normalImpulse = penetrationImpulse+velocityImpulse;
00167
00168         // See Erin Catto's GDC 2006 paper: Clamp the accumulated impulse
00169         float oldNormalImpulse = cpd->m_appliedImpulse;
00170         float sum = oldNormalImpulse + normalImpulse;
00171         cpd->m_appliedImpulse = 0.f > sum ? 0.f: sum;
00172
00173         normalImpulse = cpd->m_appliedImpulse - oldNormalImpulse;
00174
00175         body1.applyImpulse(normal*(normalImpulse), rel_pos1);
00176         body2.applyImpulse(-normal*(normalImpulse), rel_pos2);
00177
00178         return normalImpulse;
00179 }
00180
00181
00182 float resolveSingleFriction(
00183         RigidBody& body1,
00184         RigidBody& body2,
00185         ManifoldPoint& contactPoint,
00186         const ContactSolverInfo& solverInfo
00187
00188                 )
00189 {
00190         const SimdVector3& pos1 = contactPoint.GetPositionWorldOnA();
00191         const SimdVector3& pos2 = contactPoint.GetPositionWorldOnB();
00192         const SimdVector3& normal = contactPoint.m_normalWorldOnB;
00193
00194         SimdVector3 rel_pos1 = pos1 - body1.getCenterOfMassPosition();
00195         SimdVector3 rel_pos2 = pos2 - body2.getCenterOfMassPosition();
00196         float combinedFriction = calculateCombinedFriction(body1,body2);
00197
00198         ConstraintPersistentData* cpd = (ConstraintPersistentData*) contactPoint.m_userPersistentData;
00199         assert(cpd);
00200
00201         SimdScalar limit = cpd->m_appliedImpulse * combinedFriction;
00202         //if (contactPoint.m_appliedImpulse>0.f)
00203         //friction
00204         {
00205                 //apply friction in the 2 tangential directions
00206
00207                 SimdScalar relaxation = solverInfo.m_damping;
00208                 {
00209                         // 1st tangent
00210                         SimdVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1);
00211                         SimdVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2);
00212                         SimdVector3 vel = vel1 - vel2;
00213
00214                         SimdScalar vrel = cpd->m_frictionWorldTangential0.dot(vel);
00215
00216                         // calculate j that moves us to zero relative velocity
00217                         SimdScalar j = -vrel * cpd->m_jacDiagABInvTangent0;
00218                         float total = cpd->m_accumulatedTangentImpulse0 + j;
00219                         GEN_set_min(total, limit);
00220                         GEN_set_max(total, -limit);
00221                         j = total - cpd->m_accumulatedTangentImpulse0;
00222                         cpd->m_accumulatedTangentImpulse0 = total;
00223                         body1.applyImpulse(j * cpd->m_frictionWorldTangential0, rel_pos1);
00224                         body2.applyImpulse(j * -cpd->m_frictionWorldTangential0, rel_pos2);
00225                 }
00226
00227
00228                 {
00229                         // 2nd tangent
00230                         SimdVector3 vel1 = body1.getVelocityInLocalPoint(rel_pos1);
00231                         SimdVector3 vel2 = body2.getVelocityInLocalPoint(rel_pos2);
00232                         SimdVector3 vel = vel1 - vel2;
00233
00234                         SimdScalar vrel = cpd->m_frictionWorldTangential1.dot(vel);
00235
00236                         // calculate j that moves us to zero relative velocity
00237                         SimdScalar j = -vrel * cpd->m_jacDiagABInvTangent1;
00238                         float total = cpd->m_accumulatedTangentImpulse1 + j;
00239                         GEN_set_min(total, limit);
00240                         GEN_set_max(total, -limit);
00241                         j = total - cpd->m_accumulatedTangentImpulse1;
00242                         cpd->m_accumulatedTangentImpulse1 = total;
00243                         body1.applyImpulse(j * cpd->m_frictionWorldTangential1, rel_pos1);
00244                         body2.applyImpulse(j * -cpd->m_frictionWorldTangential1, rel_pos2);
00245                 }
00246         }
00247         return cpd->m_appliedImpulse;
00248 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactConstraint.h File Reference

BulletDynamics » ConstraintSolver

ContactConstraint.h File Reference

#include "SimdVector3.h"
#include "SimdScalar.h"

Include dependency graph for ContactConstraint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ConstraintPersistentData

Functions

void | resolveSingleBilateral (RigidBody &body1, const SimdVector3 &pos1, RigidBody &body2, const SimdVector3 &pos2, SimdScalar distance, const SimdVector3 &normal, SimdScalar &impulse, float timeStep)
bilateral constraint between two dynamic objects positive distance = separation, negative distance = penetration
float | resolveSingleCollision (RigidBody &body1, RigidBody &body2, ManifoldPoint &contactPoint, const ContactSolverInfo &info)
contact constraint resolution: calculate and apply impulse to satisfy non-penetration and non-negative relative velocity constraint positive distance = separation, negative distance = penetration
float | resolveSingleFriction (RigidBody &body1, RigidBody &body2, ManifoldPoint &contactPoint, const ContactSolverInfo &solverInfo)

Function Documentation

void resolveSingleBilateral | ( | RigidBody & | body1,
 |  | const SimdVector3 & | pos1,
 |  | RigidBody & | body2,
 |  | const SimdVector3 & | pos2,
 |  | SimdScalar | distance,
 |  | const SimdVector3 & | normal,
 |  | SimdScalar & | impulse,
 |  | float | timeStep
 | ) |

bilateral constraint between two dynamic objects positive distance = separation, negative distance = penetration

Definition at line 51 of file ContactConstraint.cpp.

References ASSERT2, contactDamping, RigidBody::getAngularVelocity(), SimdTransform::getBasis(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), RigidBody::getInvInertiaDiagLocal(), RigidBody::getInvMass(), RigidBody::getLinearVelocity(), RigidBody::getVelocityInLocalPoint(), SimdVector3::length2(), and SimdMatrix3x3::transpose().

float resolveSingleCollision | ( | RigidBody & | body1,
 |  | RigidBody & | body2,
 |  | ManifoldPoint & | contactPoint,
 |  | const ContactSolverInfo & | info
 | ) |

contact constraint resolution: calculate and apply impulse to satisfy non-penetration and non-negative relative velocity constraint positive distance = separation, negative distance = penetration

Definition at line 105 of file ContactConstraint.cpp.

References RigidBody::applyImpulse(), contactDamping, contactTau, SimdVector3::dot(), RigidBody::getCenterOfMassPosition(), ManifoldPoint::GetPositionWorldOnA(), ManifoldPoint::GetPositionWorldOnB(), RigidBody::getRestitution(), RigidBody::getVelocityInLocalPoint(), ConstraintPersistentData::m_appliedImpulse, ContactSolverInfo::m_damping, ContactSolverInfo::m_erp, ConstraintPersistentData::m_jacDiagABInv, ManifoldPoint::m_normalWorldOnB, ConstraintPersistentData::m_penetration, ConstraintPersistentData::m_restitution, ContactSolverInfo::m_timeStep, ManifoldPoint::m_userPersistentData, and useGlobalSettingContacts.

float resolveSingleFriction | ( | RigidBody & | body1,
 |  | RigidBody & | body2,
 |  | ManifoldPoint & | contactPoint,
 |  | const ContactSolverInfo & | solverInfo
 | ) |

Definition at line 182 of file ContactConstraint.cpp.

References RigidBody::applyImpulse(), calculateCombinedFriction(), SimdVector3::dot(), GEN_set_max(), GEN_set_min(), RigidBody::getCenterOfMassPosition(), ManifoldPoint::GetPositionWorldOnA(), ManifoldPoint::GetPositionWorldOnB(), RigidBody::getVelocityInLocalPoint(), ConstraintPersistentData::m_accumulatedTangentImpulse0, ConstraintPersistentData::m_accumulatedTangentImpulse1, ConstraintPersistentData::m_appliedImpulse, ContactSolverInfo::m_damping, ConstraintPersistentData::m_frictionWorldTangential0, ConstraintPersistentData::m_frictionWorldTangential1, ConstraintPersistentData::m_jacDiagABInvTangent0, ConstraintPersistentData::m_jacDiagABInvTangent1, ManifoldPoint::m_normalWorldOnB, and ManifoldPoint::m_userPersistentData.

Referenced by SimpleConstraintSolver::SolveFriction().

Generated on Wed May 24 13:58:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactConstraint.h Source File

BulletDynamics » ConstraintSolver

ContactConstraint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONTACT_CONSTRAINT_H
00017 #define CONTACT_CONSTRAINT_H
00018
00019 //todo: make into a proper class working with the iterative constraint solver
00020
00021 class RigidBody;
00022 #include "SimdVector3.h"
00023 #include "SimdScalar.h"
00024 struct ContactSolverInfo;
00025 class ManifoldPoint;
00026
00027 struct ConstraintPersistentData
00028 {
00029         inline ConstraintPersistentData()
00030         :m_appliedImpulse(0.f),
00031         m_prevAppliedImpulse(0.f),
00032         m_accumulatedTangentImpulse0(0.f),
00033         m_accumulatedTangentImpulse1(0.f),
00034         m_jacDiagABInv(0.f),
00035         m_persistentLifeTime(0),
00036         m_restitution(0.f),
00037         m_penetration(0.f)
00038         {
00039         }
00040
00041
00043                         float   m_appliedImpulse;
00044                         float   m_prevAppliedImpulse;
00045                         float   m_accumulatedTangentImpulse0;
00046                         float   m_accumulatedTangentImpulse1;
00047
00048                         float   m_jacDiagABInv;
00049                         float   m_jacDiagABInvTangent0;
00050                         float   m_jacDiagABInvTangent1;
00051                         int             m_persistentLifeTime;
00052                         float   m_restitution;
00053                         float   m_penetration;
00054                         SimdVector3     m_frictionWorldTangential0;
00055                         SimdVector3     m_frictionWorldTangential1;
00056
00057
00058 };
00059
00062 void resolveSingleBilateral(RigidBody& body1, const SimdVector3& pos1,
00063                       RigidBody& body2, const SimdVector3& pos2,
00064                       SimdScalar distance, const SimdVector3& normal,SimdScalar& impulse ,float timeStep);
00065
00066
00070 float resolveSingleCollision(
00071         RigidBody& body1,
00072         RigidBody& body2,
00073                 ManifoldPoint& contactPoint,
00074                  const ContactSolverInfo& info);
00075
00076 float resolveSingleFriction(
00077         RigidBody& body1,
00078         RigidBody& body2,
00079         ManifoldPoint& contactPoint,
00080         const ContactSolverInfo& solverInfo
00081                 );
00082
00083 #endif //CONTACT_CONSTRAINT_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactJoint.cpp File Reference

BulletDynamics » Dynamics

ContactJoint.cpp File Reference

#include "ContactJoint.h"
#include "RigidBody.h"
#include "NarrowPhaseCollision/PersistentManifold.h"

Include dependency graph for ContactJoint.cpp:

Go to the source code of this file.

Defines

#define | FRICTION_CONSTANT 120.f
#define | dCROSS(a, op, b, c)
#define | M_SQRT12 SimdScalar(0.7071067811865475244008443621048490)
#define | dRecipSqrt(x) ((float)(1.0f/SimdSqrt(float(x))))
#define | DO_THE_FRICTION_2

Functions

void | dPlaneSpace1 (const dVector3 n, dVector3 p, dVector3 q)

Variables

int | m_numRows = 3

Define Documentation

#define dCROSS | ( | a,
 |  | op,
 |  | b,
 |  | c | )

Value:

(a)[0] op ((b)[1]*(c)[2] - (b)[2]*(c)[1]); \
  (a)[1] op ((b)[2]*(c)[0] - (b)[0]*(c)[2]); \
  (a)[2] op ((b)[0]*(c)[1] - (b)[1]*(c)[0]);

Definition at line 44 of file ContactJoint.cpp.

#define DO_THE_FRICTION_2

#define dRecipSqrt ( x ) ((float)(1.0f/SimdSqrt(float(x))))

Definition at line 51 of file ContactJoint.cpp.

Referenced by dPlaneSpace1().

#define FRICTION_CONSTANT 120.f

Definition at line 21 of file ContactJoint.cpp.

Referenced by ContactJoint::GetInfo2().

#define M_SQRT12 SimdScalar(0.7071067811865475244008443621048490)

Definition at line 49 of file ContactJoint.cpp.

Referenced by dPlaneSpace1().

Function Documentation

void dPlaneSpace1 | ( | const dVector3 | n,
 |  | dVector3 | p,
 |  | dVector3 | q
 | ) |

Definition at line 55 of file ContactJoint.cpp.

References dRecipSqrt, M_SQRT12, and SimdFabs().

Referenced by ContactJoint::GetInfo2().

Variable Documentation

int m_numRows = 3

Definition at line 33 of file ContactJoint.cpp.

Referenced by ContactJoint::GetInfo1(), and ContactJoint::GetInfo2().

Generated on Wed May 24 13:58:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactJoint.cpp Source File

BulletDynamics » Dynamics

ContactJoint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 #include "ContactJoint.h"
00016 #include "RigidBody.h"
00017 #include "NarrowPhaseCollision/PersistentManifold.h"
00018
00019
00020 //this constant needs to be set up so different solvers give 'similar' results
00021 #define FRICTION_CONSTANT 120.f
00022
00023
00024 ContactJoint::ContactJoint(PersistentManifold* manifold,int index,bool swap,RigidBody* body0,RigidBody* body1)
00025 :m_manifold(manifold),
00026 m_index(index),
00027 m_swapBodies(swap),
00028 m_body0(body0),
00029 m_body1(body1)
00030 {
00031 }
00032
00033 int m_numRows = 3;
00034
00035
00036 void ContactJoint::GetInfo1(Info1 *info)
00037 {
00038         info->m = m_numRows;
00039         //friction adds another 2...
00040
00041         info->nub = 0;
00042 }
00043
00044 #define dCROSS(a,op,b,c) \
00045   (a)[0] op ((b)[1]*(c)[2] - (b)[2]*(c)[1]); \
00046   (a)[1] op ((b)[2]*(c)[0] - (b)[0]*(c)[2]); \
00047   (a)[2] op ((b)[0]*(c)[1] - (b)[1]*(c)[0]);
00048
00049 #define M_SQRT12 SimdScalar(0.7071067811865475244008443621048490)
00050
00051 #define dRecipSqrt(x) ((float)(1.0f/SimdSqrt(float(x))))                /* reciprocal square root */
00052
00053
00054
00055 void dPlaneSpace1 (const dVector3 n, dVector3 p, dVector3 q)
00056 {
00057   if (SimdFabs(n[2]) > M_SQRT12) {
00058     // choose p in y-z plane
00059     SimdScalar a = n[1]*n[1] + n[2]*n[2];
00060     SimdScalar k = dRecipSqrt (a);
00061     p[0] = 0;
00062     p[1] = -n[2]*k;
00063     p[2] = n[1]*k;
00064     // set q = n x p
00065     q[0] = a*k;
00066     q[1] = -n[0]*p[2];
00067     q[2] = n[0]*p[1];
00068   }
00069   else {
00070     // choose p in x-y plane
00071     SimdScalar a = n[0]*n[0] + n[1]*n[1];
00072     SimdScalar k = dRecipSqrt (a);
00073     p[0] = -n[1]*k;
00074     p[1] = n[0]*k;
00075     p[2] = 0;
00076     // set q = n x p
00077     q[0] = -n[2]*p[1];
00078     q[1] = n[2]*p[0];
00079     q[2] = a*k;
00080   }
00081 }
00082
00083
00084
00085 void ContactJoint::GetInfo2(Info2 *info)
00086 {
00087
00088         int s = info->rowskip;
00089         int s2 = 2*s;
00090
00091         float swapFactor = m_swapBodies ? -1.f : 1.f;
00092
00093         // get normal, with sign adjusted for body1/body2 polarity
00094         dVector3 normal;
00095
00096
00097         ManifoldPoint& point = m_manifold->GetContactPoint(m_index);
00098
00099         normal[0] = swapFactor*point.m_normalWorldOnB[0];
00100         normal[1] = swapFactor*point.m_normalWorldOnB[1];
00101         normal[2] = swapFactor*point.m_normalWorldOnB[2];
00102         normal[3] = 0;  // @@@ hmmm
00103
00104         //      if (GetBody0())
00105         SimdVector3 relativePositionA;
00106         {
00107                 relativePositionA = point.GetPositionWorldOnA() - m_body0->getCenterOfMassPosition();
00108                 dVector3 c1;
00109                 c1[0] = relativePositionA[0];
00110                 c1[1] = relativePositionA[1];
00111                 c1[2] = relativePositionA[2];
00112
00113                 // set jacobian for normal
00114                 info->J1l[0] = normal[0];
00115                 info->J1l[1] = normal[1];
00116                 info->J1l[2] = normal[2];
00117                 dCROSS (info->J1a,=,c1,normal);
00118
00119         }
00120         //              if (GetBody1())
00121         SimdVector3 relativePositionB;
00122         {
00123                 dVector3 c2;
00124                 relativePositionB = point.GetPositionWorldOnB() - m_body1->getCenterOfMassPosition();
00125
00126                 //                      for (i=0; i<3; i++) c2[i] = j->contact.geom.pos[i] -
00127                 //                                        j->node[1].body->pos[i];
00128                 c2[0] = relativePositionB[0];
00129                 c2[1] = relativePositionB[1];
00130                 c2[2] = relativePositionB[2];
00131
00132                 info->J2l[0] = -normal[0];
00133                 info->J2l[1] = -normal[1];
00134                 info->J2l[2] = -normal[2];
00135                 dCROSS (info->J2a,= -,c2,normal);
00136         }
00137
00138         SimdScalar k = info->fps * info->erp;
00139
00140         float depth = -point.GetDistance();
00141 //      if (depth < 0.f)
00142 //              depth = 0.f;
00143
00144         info->c[0] = k * depth;
00145         //float maxvel = .2f;
00146
00147 //      if (info->c[0] > maxvel)
00148 //              info->c[0] = maxvel;
00149
00150
00151         //can override it, not necessary
00152 //      info->cfm[0] = 0.f;
00153 //      info->cfm[1] = 0.f;
00154 //      info->cfm[2] = 0.f;
00155
00156
00157
00158         // set LCP limits for normal
00159         info->lo[0] = 0;
00160         info->hi[0] = 1e30f;//dInfinity;
00161         info->lo[1] = 0;
00162         info->hi[1] = 0.f;
00163         info->lo[2] = 0.f;
00164         info->hi[2] = 0.f;
00165
00166 #define DO_THE_FRICTION_2
00167 #ifdef DO_THE_FRICTION_2
00168         // now do jacobian for tangential forces
00169         dVector3 t1,t2; // two vectors tangential to normal
00170
00171         dVector3 c1;
00172         c1[0] = relativePositionA[0];
00173         c1[1] = relativePositionA[1];
00174         c1[2] = relativePositionA[2];
00175
00176         dVector3 c2;
00177         c2[0] = relativePositionB[0];
00178         c2[1] = relativePositionB[1];
00179         c2[2] = relativePositionB[2];
00180
00181
00182         float friction = FRICTION_CONSTANT*m_body0->getFriction() * m_body1->getFriction();
00183
00184         // first friction direction
00185         if (m_numRows >= 2)
00186         {
00187
00188
00189
00190                 dPlaneSpace1 (normal,t1,t2);
00191
00192                 info->J1l[s+0] = t1[0];
00193                 info->J1l[s+1] = t1[1];
00194                 info->J1l[s+2] = t1[2];
00195                 dCROSS (info->J1a+s,=,c1,t1);
00196                 if (1) { //j->node[1].body) {
00197                         info->J2l[s+0] = -t1[0];
00198                         info->J2l[s+1] = -t1[1];
00199                         info->J2l[s+2] = -t1[2];
00200                         dCROSS (info->J2a+s,= -,c2,t1);
00201                 }
00202                 // set right hand side
00203                 if (0) {//j->contact.surface.mode & dContactMotion1) {
00204                         //info->c[1] = j->contact.surface.motion1;
00205                 }
00206                 // set LCP bounds and friction index. this depends on the approximation
00207                 // mode
00208                 //1e30f
00209
00210
00211                 info->lo[1] = -friction;//-j->contact.surface.mu;
00212                 info->hi[1] = friction;//j->contact.surface.mu;
00213                 if (1)//j->contact.surface.mode & dContactApprox1_1)
00214                         info->findex[1] = 0;
00215
00216                 // set slip (constraint force mixing)
00217                 if (0)//j->contact.surface.mode & dContactSlip1)
00218                 {
00219                         //      info->cfm[1] = j->contact.surface.slip1;
00220                 } else
00221                 {
00222                         //info->cfm[1] = 0.f;
00223                 }
00224         }
00225
00226         // second friction direction
00227         if (m_numRows >= 3) {
00228                 info->J1l[s2+0] = t2[0];
00229                 info->J1l[s2+1] = t2[1];
00230                 info->J1l[s2+2] = t2[2];
00231                 dCROSS (info->J1a+s2,=,c1,t2);
00232                 if (1) { //j->node[1].body) {
00233                         info->J2l[s2+0] = -t2[0];
00234                         info->J2l[s2+1] = -t2[1];
00235                         info->J2l[s2+2] = -t2[2];
00236                         dCROSS (info->J2a+s2,= -,c2,t2);
00237                 }
00238
00239                 // set right hand side
00240                 if (0){//j->contact.surface.mode & dContactMotion2) {
00241                         //info->c[2] = j->contact.surface.motion2;
00242                 }
00243                 // set LCP bounds and friction index. this depends on the approximation
00244                 // mode
00245                 if (0){//j->contact.surface.mode & dContactMu2) {
00246                         //info->lo[2] = -j->contact.surface.mu2;
00247                         //info->hi[2] = j->contact.surface.mu2;
00248                 }
00249                 else {
00250                         info->lo[2] = -friction;
00251                         info->hi[2] = friction;
00252                 }
00253                 if (0)//j->contact.surface.mode & dContactApprox1_2)
00254
00255                 {
00256                         info->findex[2] = 0;
00257                 }
00258                 // set slip (constraint force mixing)
00259                 if (0) //j->contact.surface.mode & dContactSlip2)
00260
00261                 {
00262                         //info->cfm[2] = j->contact.surface.slip2;
00263
00264                 }
00265         }
00266
00267 #endif //DO_THE_FRICTION_2
00268
00269 }
00270
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactJoint.h File Reference

BulletDynamics » Dynamics

ContactJoint.h File Reference

#include "BU_Joint.h"

Include dependency graph for ContactJoint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ContactJoint

Generated on Wed May 24 13:58:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactJoint.h Source File

BulletDynamics » Dynamics

ContactJoint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONTACT_JOINT_H
00017 #define CONTACT_JOINT_H
00018
00019 #include "BU_Joint.h"
00020 class RigidBody;
00021 class PersistentManifold;
00022
00023 class ContactJoint : public BU_Joint
00024 {
00025         PersistentManifold* m_manifold;
00026         int             m_index;
00027         bool    m_swapBodies;
00028         RigidBody* m_body0;
00029         RigidBody* m_body1;
00030
00031
00032 public:
00033
00034         ContactJoint() {};
00035
00036         ContactJoint(PersistentManifold* manifold,int index,bool swap,RigidBody* body0,RigidBody* body1);
00037
00038         //BU_Joint interface for solver
00039
00040         virtual void GetInfo1(Info1 *info);
00041
00042         virtual void GetInfo2(Info2 *info);
00043
00044
00045
00046
00047 };
00048
00049 #endif //CONTACT_JOINT_H
00050
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactSolverInfo.h File Reference

BulletDynamics » ConstraintSolver

ContactSolverInfo.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct ContactSolverInfo

Generated on Wed May 24 13:59:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactSolverInfo.h Source File

BulletDynamics » ConstraintSolver

ContactSolverInfo.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONTACT_SOLVER_INFO
00017 #define CONTACT_SOLVER_INFO
00018
00019
00020 struct ContactSolverInfo
00021 {
00022
00023         inline ContactSolverInfo()
00024         {
00025                 m_tau = 0.6f;
00026                 m_damping = 1.0f;
00027                 m_friction = 0.3f;
00028                 m_restitution = 0.f;
00029                 m_maxErrorReduction = 20.f;
00030                 m_numIterations = 10;
00031                 m_erp = 0.4f;
00032                 m_sor = 1.3f;
00033         }
00034
00035         float   m_tau;
00036         float   m_damping;
00037         float   m_friction;
00038         float   m_timeStep;
00039         float   m_restitution;
00040         int             m_numIterations;
00041         float   m_maxErrorReduction;
00042         float   m_sor;
00043         float   m_erp;
00044
00045 };
00046
00047 #endif //CONTACT_SOLVER_INFO
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContinuousConvexCollision.cpp File Reference

Bullet » NarrowPhaseCollision

ContinuousConvexCollision.cpp File Reference

#include "ContinuousConvexCollision.h"
#include "CollisionShapes/ConvexShape.h"
#include "CollisionShapes/MinkowskiSumShape.h"
#include "NarrowPhaseCollision/SimplexSolverInterface.h"
#include "SimdTransformUtil.h"
#include "CollisionShapes/SphereShape.h"
#include "GjkPairDetector.h"
#include "PointCollector.h"

Include dependency graph for ContinuousConvexCollision.cpp:

Go to the source code of this file.

Defines

#define MAX_ITERATIONS 1000
This maximum should not be necessary.

Define Documentation

#define MAX_ITERATIONS 1000

This maximum should not be necessary.

It allows for untested/degenerate cases in production code. You don't want your game ever to lock-up.

Definition at line 38 of file ContinuousConvexCollision.cpp.

Referenced by SubsimplexConvexCast::calcTimeOfImpact(), and ContinuousConvexCollision::calcTimeOfImpact().

Generated on Wed May 24 13:59:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContinuousConvexCollision.cpp Source File

Bullet » NarrowPhaseCollision

ContinuousConvexCollision.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "ContinuousConvexCollision.h"
00018 #include "CollisionShapes/ConvexShape.h"
00019 #include "CollisionShapes/MinkowskiSumShape.h"
00020 #include "NarrowPhaseCollision/SimplexSolverInterface.h"
00021 #include "SimdTransformUtil.h"
00022 #include "CollisionShapes/SphereShape.h"
00023
00024 #include "GjkPairDetector.h"
00025 #include "PointCollector.h"
00026
00027
00028
00029 ContinuousConvexCollision::ContinuousConvexCollision ( ConvexShape*     convexA,ConvexShape*    convexB,SimplexSolverInterface* simplexSolver, ConvexPenetrationDepthSolver* penetrationDepthSolver)
00030 :m_simplexSolver(simplexSolver),
00031 m_penetrationDepthSolver(penetrationDepthSolver),
00032 m_convexA(convexA),m_convexB(convexB)
00033 {
00034 }
00035
00038 #define MAX_ITERATIONS 1000
00039
00040 bool    ContinuousConvexCollision::calcTimeOfImpact(
00041                                 const SimdTransform& fromA,
00042                                 const SimdTransform& toA,
00043                                 const SimdTransform& fromB,
00044                                 const SimdTransform& toB,
00045                                 CastResult& result)
00046 {
00047
00048         m_simplexSolver->reset();
00049
00051         SimdVector3 linVelA,angVelA,linVelB,angVelB;
00052         SimdTransformUtil::CalculateVelocity(fromA,toA,1.f,linVelA,angVelA);
00053         SimdTransformUtil::CalculateVelocity(fromB,toB,1.f,linVelB,angVelB);
00054
00055         SimdScalar boundingRadiusA = m_convexA->GetAngularMotionDisc();
00056         SimdScalar boundingRadiusB = m_convexB->GetAngularMotionDisc();
00057
00058         SimdScalar maxAngularProjectedVelocity = angVelA.length() * boundingRadiusA + angVelB.length() * boundingRadiusB;
00059
00060         float radius = 0.001f;
00061
00062         SimdScalar lambda = 0.f;
00063         SimdVector3 v(1,0,0);
00064
00065         int maxIter = MAX_ITERATIONS;
00066
00067         SimdVector3 n;
00068         n.setValue(0.f,0.f,0.f);
00069         bool hasResult = false;
00070         SimdVector3 c;
00071
00072         float lastLambda = lambda;
00073         //float epsilon = 0.001f;
00074
00075         int numIter = 0;
00076         //first solution, using GJK
00077
00078
00079         SimdTransform identityTrans;
00080         identityTrans.setIdentity();
00081
00082         SphereShape     raySphere(0.0f);
00083         raySphere.SetMargin(0.f);
00084
00085
00086 //      result.DrawCoordSystem(sphereTr);
00087
00088         PointCollector  pointCollector1;
00089
00090         {
00091
00092                 GjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,m_penetrationDepthSolver);
00093                 GjkPairDetector::ClosestPointInput input;
00094
00095                 //we don't use margins during CCD
00096                 gjk.SetIgnoreMargin(true);
00097
00098                 input.m_transformA = fromA;
00099                 input.m_transformB = fromB;
00100                 gjk.GetClosestPoints(input,pointCollector1,0);
00101
00102                 hasResult = pointCollector1.m_hasResult;
00103                 c = pointCollector1.m_pointInWorld;
00104         }
00105
00106         if (hasResult)
00107         {
00108                 SimdScalar dist;
00109                 dist = pointCollector1.m_distance;
00110                 n = pointCollector1.m_normalOnBInWorld;
00111
00112                 //not close enough
00113                 while (dist > radius)
00114                 {
00115                         numIter++;
00116                         if (numIter > maxIter)
00117                                 return false; //todo: report a failure
00118
00119                         float dLambda = 0.f;
00120
00121                         //calculate safe moving fraction from distance / (linear+rotational velocity)
00122
00123                         //float clippedDist  = GEN_min(angularConservativeRadius,dist);
00124                         //float clippedDist  = dist;
00125
00126                         float projectedLinearVelocity = (linVelB-linVelA).dot(n);
00127
00128                         dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity);
00129
00130                         lambda = lambda + dLambda;
00131
00132                         if (lambda > 1.f)
00133                                 return false;
00134
00135                         if (lambda < 0.f)
00136                                 return false;
00137
00138                         //todo: next check with relative epsilon
00139                         if (lambda <= lastLambda)
00140                                 break;
00141                         lastLambda = lambda;
00142
00143
00144
00145                         //interpolate to next lambda
00146                         SimdTransform interpolatedTransA,interpolatedTransB,relativeTrans;
00147
00148                         SimdTransformUtil::IntegrateTransform(fromA,linVelA,angVelA,lambda,interpolatedTransA);
00149                         SimdTransformUtil::IntegrateTransform(fromB,linVelB,angVelB,lambda,interpolatedTransB);
00150                         relativeTrans = interpolatedTransB.inverseTimes(interpolatedTransA);
00151
00152                         result.DebugDraw( lambda );
00153
00154                         PointCollector  pointCollector;
00155                         GjkPairDetector gjk(m_convexA,m_convexB,m_simplexSolver,m_penetrationDepthSolver);
00156                         GjkPairDetector::ClosestPointInput input;
00157                         input.m_transformA = interpolatedTransA;
00158                         input.m_transformB = interpolatedTransB;
00159                         gjk.GetClosestPoints(input,pointCollector,0);
00160                         if (pointCollector.m_hasResult)
00161                         {
00162                                 if (pointCollector.m_distance < 0.f)
00163                                 {
00164                                         //degenerate ?!
00165                                         result.m_fraction = lastLambda;
00166                                         result.m_normal = n;
00167                                         return true;
00168                                 }
00169                                 c = pointCollector.m_pointInWorld;
00170
00171                                 dist = pointCollector.m_distance;
00172                         } else
00173                         {
00174                                 //??
00175                                 return false;
00176                         }
00177
00178                 }
00179
00180                 result.m_fraction = lambda;
00181                 result.m_normal = n;
00182                 return true;
00183         }
00184
00185         return false;
00186
00187 /*
00188 //todo:
00189         //if movement away from normal, discard result
00190         SimdVector3 move = transBLocalTo.getOrigin() - transBLocalFrom.getOrigin();
00191         if (result.m_fraction < 1.f)
00192         {
00193                 if (move.dot(result.m_normal) <= 0.f)
00194                 {
00195                 }
00196         }
00197 */
00198
00199 }
00200
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContinuousConvexCollision.h File Reference

Bullet » NarrowPhaseCollision

ContinuousConvexCollision.h File Reference

#include "ConvexCast.h"
#include "SimplexSolverInterface.h"

Include dependency graph for ContinuousConvexCollision.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ContinuousConvexCollision
ContinuousConvexCollision implements angular and linear time of impact for convex objects. More...

Generated on Wed May 24 13:59:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContinuousConvexCollision.h Source File

Bullet » NarrowPhaseCollision

ContinuousConvexCollision.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef CONTINUOUS_COLLISION_CONVEX_CAST_H
00018 #define CONTINUOUS_COLLISION_CONVEX_CAST_H
00019
00020 #include "ConvexCast.h"
00021 #include "SimplexSolverInterface.h"
00022 class ConvexPenetrationDepthSolver;
00023 class ConvexShape;
00024
00029 class ContinuousConvexCollision : public ConvexCast
00030 {
00031         SimplexSolverInterface* m_simplexSolver;
00032         ConvexPenetrationDepthSolver*   m_penetrationDepthSolver;
00033         ConvexShape*    m_convexA;
00034         ConvexShape*    m_convexB;
00035
00036
00037 public:
00038
00039         ContinuousConvexCollision (ConvexShape* shapeA,ConvexShape*     shapeB ,SimplexSolverInterface* simplexSolver,ConvexPenetrationDepthSolver* penetrationDepthSolver);
00040
00041         virtual bool    calcTimeOfImpact(
00042                                 const SimdTransform& fromA,
00043                                 const SimdTransform& toA,
00044                                 const SimdTransform& fromB,
00045                                 const SimdTransform& toB,
00046                                 CastResult& result);
00047
00048
00049 };
00050
00051 #endif //CONTINUOUS_COLLISION_CONVEX_CAST_H
00052
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexCast.cpp File Reference

Bullet » NarrowPhaseCollision

ConvexCast.cpp File Reference

#include "ConvexCast.h"

Include dependency graph for ConvexCast.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexCast.cpp Source File

Bullet » NarrowPhaseCollision

ConvexCast.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "ConvexCast.h"
00017
00018 ConvexCast::~ConvexCast()
00019 {
00020 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexCast.h File Reference

Bullet » NarrowPhaseCollision

ConvexCast.h File Reference

#include <SimdTransform.h>
#include <SimdVector3.h>
#include <SimdScalar.h>
#include "IDebugDraw.h"

Include dependency graph for ConvexCast.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | ConvexCast
ConvexCast is an interface for Casting. More...
struct | ConvexCast::CastResult
RayResult stores the closest result alternatively, add a callback method to decide about closest/all results. More...

Generated on Wed May 24 13:59:02 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexCast.h Source File

Bullet » NarrowPhaseCollision

ConvexCast.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef CONVEX_CAST_H
00018 #define CONVEX_CAST_H
00019
00020 #include <SimdTransform.h>
00021 #include <SimdVector3.h>
00022 #include <SimdScalar.h>
00023 class MinkowskiSumShape;
00024 #include "IDebugDraw.h"
00025
00027 class ConvexCast
00028 {
00029 public:
00030
00031
00032         virtual ~ConvexCast();
00033
00036         struct  CastResult
00037         {
00038                 //virtual bool  addRayResult(const SimdVector3& normal,SimdScalar       fraction) = 0;
00039
00040                 virtual void    DebugDraw(SimdScalar    fraction) {}
00041                 virtual void    DrawCoordSystem(const SimdTransform& trans) {}
00042
00043                 CastResult()
00044                         :m_fraction(1e30f),
00045                         m_debugDrawer(0)
00046                 {
00047                 }
00048
00049
00050                 virtual ~CastResult() {};
00051
00052                 SimdVector3     m_normal;
00053                 SimdScalar      m_fraction;
00054                 SimdTransform   m_hitTransformA;
00055                 SimdTransform   m_hitTransformB;
00056
00057                 IDebugDraw* m_debugDrawer;
00058
00059         };
00060
00061
00063         virtual bool    calcTimeOfImpact(
00064                                         const SimdTransform& fromA,
00065                                         const SimdTransform& toA,
00066                                         const SimdTransform& fromB,
00067                                         const SimdTransform& toB,
00068                                         CastResult& result) = 0;
00069 };
00070
00071 #endif //CONVEX_CAST_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConcaveCollisionAlgorithm.cpp File Reference

Bullet » CollisionDispatch

ConvexConcaveCollisionAlgorithm.cpp File Reference

#include "ConvexConcaveCollisionAlgorithm.h"
#include "CollisionDispatch/CollisionObject.h"
#include "CollisionShapes/MultiSphereShape.h"
#include "CollisionShapes/BoxShape.h"
#include "ConvexConvexAlgorithm.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "CollisionShapes/TriangleShape.h"
#include "CollisionDispatch/ManifoldResult.h"
#include "NarrowPhaseCollision/RaycastCallback.h"
#include "CollisionShapes/TriangleMeshShape.h"

Include dependency graph for ConvexConcaveCollisionAlgorithm.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:02 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConcaveCollisionAlgorithm.cpp Source File

Bullet » CollisionDispatch

ConvexConcaveCollisionAlgorithm.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "ConvexConcaveCollisionAlgorithm.h"
00018 #include "CollisionDispatch/CollisionObject.h"
00019 #include "CollisionShapes/MultiSphereShape.h"
00020 #include "CollisionShapes/BoxShape.h"
00021 #include "ConvexConvexAlgorithm.h"
00022 #include "BroadphaseCollision/BroadphaseProxy.h"
00023 #include "CollisionShapes/TriangleShape.h"
00024 #include "CollisionDispatch/ManifoldResult.h"
00025 #include "NarrowPhaseCollision/RaycastCallback.h"
00026 #include "CollisionShapes/TriangleMeshShape.h"
00027
00028
00029 ConvexConcaveCollisionAlgorithm::ConvexConcaveCollisionAlgorithm( const CollisionAlgorithmConstructionInfo& ci,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1)
00030 : CollisionAlgorithm(ci),m_convex(*proxy0),m_concave(*proxy1),
00031 m_boxTriangleCallback(ci.m_dispatcher,proxy0,proxy1)
00032
00033 {
00034 }
00035
00036 ConvexConcaveCollisionAlgorithm::~ConvexConcaveCollisionAlgorithm()
00037 {
00038 }
00039
00040
00041
00042 BoxTriangleCallback::BoxTriangleCallback(Dispatcher*  dispatcher,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1):
00043   m_boxProxy(proxy0),m_triangleProxy(*proxy1),m_dispatcher(dispatcher),
00044         m_dispatchInfoPtr(0)
00045 {
00046
00047           //
00048           // create the manifold from the dispatcher 'manifold pool'
00049           //
00050           m_manifoldPtr = m_dispatcher->GetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject);
00051
00052           ClearCache();
00053 }
00054
00055 BoxTriangleCallback::~BoxTriangleCallback()
00056 {
00057         ClearCache();
00058         m_dispatcher->ReleaseManifold( m_manifoldPtr );
00059
00060 }
00061
00062
00063 void    BoxTriangleCallback::ClearCache()
00064 {
00065         m_dispatcher->ClearManifold(m_manifoldPtr);
00066 };
00067
00068
00069
00070 void BoxTriangleCallback::ProcessTriangle(SimdVector3* triangle,int partId, int triangleIndex)
00071 {
00072
00073         //just for debugging purposes
00074         //printf("triangle %d",m_triangleCount++);
00075
00076
00077         //aabb filter is already applied!
00078
00079         CollisionAlgorithmConstructionInfo ci;
00080         ci.m_dispatcher = m_dispatcher;
00081
00082
00083
00084         CollisionObject* colObj = static_cast<CollisionObject*>(m_boxProxy->m_clientObject);
00085
00086         if (colObj->m_collisionShape->IsConvex())
00087         {
00088                 TriangleShape tm(triangle[0],triangle[1],triangle[2]);
00089                 tm.SetMargin(m_collisionMarginTriangle);
00090
00091                 CollisionObject* ob = static_cast<CollisionObject*>(m_triangleProxy.m_clientObject);
00092
00093                 CollisionShape* tmpShape = ob->m_collisionShape;
00094                 ob->m_collisionShape = &tm;
00095
00096                 ConvexConvexAlgorithm cvxcvxalgo(m_manifoldPtr,ci,m_boxProxy,&m_triangleProxy);
00097                 cvxcvxalgo.ProcessCollision(m_boxProxy,&m_triangleProxy,*m_dispatchInfoPtr);
00098                 ob->m_collisionShape = tmpShape;
00099
00100         }
00101
00102
00103
00104 }
00105
00106
00107
00108 void    BoxTriangleCallback::SetTimeStepAndCounters(float collisionMarginTriangle,const DispatcherInfo& dispatchInfo)
00109 {
00110         m_dispatchInfoPtr = &dispatchInfo;
00111         m_collisionMarginTriangle = collisionMarginTriangle;
00112
00113         //recalc aabbs
00114         CollisionObject* boxBody = (CollisionObject* )m_boxProxy->m_clientObject;
00115         CollisionObject* triBody = (CollisionObject* )m_triangleProxy.m_clientObject;
00116
00117         SimdTransform boxInTriangleSpace;
00118         boxInTriangleSpace = triBody->m_worldTransform.inverse() * boxBody->m_worldTransform;
00119
00120         CollisionShape* boxshape = static_cast<CollisionShape*>(boxBody->m_collisionShape);
00121         //CollisionShape* triangleShape = static_cast<CollisionShape*>(triBody->m_collisionShape);
00122
00123         boxshape->GetAabb(boxInTriangleSpace,m_aabbMin,m_aabbMax);
00124
00125         float extraMargin = collisionMarginTriangle;//CONVEX_DISTANCE_MARGIN;//+0.1f;
00126
00127         SimdVector3 extra(extraMargin,extraMargin,extraMargin);
00128
00129         m_aabbMax += extra;
00130         m_aabbMin -= extra;
00131
00132 }
00133
00134 void ConvexConcaveCollisionAlgorithm::ClearCache()
00135 {
00136         m_boxTriangleCallback.ClearCache();
00137
00138 }
00139
00140 void ConvexConcaveCollisionAlgorithm::ProcessCollision (BroadphaseProxy* ,BroadphaseProxy* ,const DispatcherInfo& dispatchInfo)
00141 {
00142
00143         CollisionObject* boxBody = static_cast<CollisionObject* >(m_convex.m_clientObject);
00144         CollisionObject* triBody = static_cast<CollisionObject* >(m_concave.m_clientObject);
00145
00146         if (triBody->m_collisionShape->GetShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
00147         {
00148
00149                 if (!m_dispatcher->NeedsCollision(m_convex,m_concave))
00150                         return;
00151
00152
00153
00154                 CollisionObject*        triOb = static_cast<CollisionObject*>(m_concave.m_clientObject);
00155                 TriangleMeshShape* triangleMesh = static_cast<TriangleMeshShape*>( triOb->m_collisionShape);
00156
00157                 if (boxBody->m_collisionShape->IsConvex())
00158                 {
00159                         float collisionMarginTriangle = triangleMesh->GetMargin();
00160
00161                         m_boxTriangleCallback.SetTimeStepAndCounters(collisionMarginTriangle,dispatchInfo);
00162 #ifdef USE_BOX_TRIANGLE
00163                         m_dispatcher->ClearManifold(m_boxTriangleCallback.m_manifoldPtr);
00164 #endif
00165                         m_boxTriangleCallback.m_manifoldPtr->SetBodies(m_convex.m_clientObject,m_concave.m_clientObject);
00166
00167                         triangleMesh->ProcessAllTriangles( &m_boxTriangleCallback,m_boxTriangleCallback.GetAabbMin(),m_boxTriangleCallback.GetAabbMax());
00168
00169
00170                 }
00171
00172         }
00173
00174 }
00175
00176
00177 float ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* ,BroadphaseProxy* ,const DispatcherInfo& dispatchInfo)
00178 {
00179
00180         //quick approximation using raycast, todo: hook up to the continuous collision detection (one of the ConvexCast)
00181         CollisionObject* convexbody = (CollisionObject* )m_convex.m_clientObject;
00182         CollisionObject* triBody = static_cast<CollisionObject* >(m_concave.m_clientObject);
00183
00184         const SimdVector3& from = convexbody->m_worldTransform.getOrigin();
00185
00186         SimdVector3 to = convexbody->m_interpolationWorldTransform.getOrigin();
00187         //todo: only do if the motion exceeds the 'radius'
00188
00189         struct LocalTriangleRaycastCallback     : public TriangleRaycastCallback
00190         {
00191                 LocalTriangleRaycastCallback(const SimdVector3& from,const SimdVector3& to)
00192                         :TriangleRaycastCallback(from,to)
00193                 {
00194                 }
00195
00196                 virtual float ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex )
00197                 {
00198                         //todo: handle ccd here
00199                         return 0.f;
00200
00201                 }
00202         };
00203
00204
00205         LocalTriangleRaycastCallback raycastCallback(from,to);
00206
00207         raycastCallback.m_hitFraction = convexbody->m_hitFraction;
00208
00209         SimdVector3 aabbMin (-1e30f,-1e30f,-1e30f);
00210         SimdVector3 aabbMax (SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY);
00211
00212         if (triBody->m_collisionShape->GetShapeType() == TRIANGLE_MESH_SHAPE_PROXYTYPE)
00213         {
00214
00215                 CollisionObject* concavebody = (CollisionObject* )m_concave.m_clientObject;
00216
00217                 TriangleMeshShape* triangleMesh = (TriangleMeshShape*) concavebody->m_collisionShape;
00218
00219                 if (triangleMesh)
00220                 {
00221                         triangleMesh->ProcessAllTriangles(&raycastCallback,aabbMin,aabbMax);
00222                 }
00223         }
00224
00225
00226         if (raycastCallback.m_hitFraction < convexbody->m_hitFraction)
00227         {
00228                 convexbody->m_hitFraction = raycastCallback.m_hitFraction;
00229                 return raycastCallback.m_hitFraction;
00230         }
00231
00232         return 1.f;
00233
00234 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConcaveCollisionAlgorithm.h File Reference

Bullet » CollisionDispatch

ConvexConcaveCollisionAlgorithm.h File Reference

#include "BroadphaseCollision/CollisionAlgorithm.h"
#include "BroadphaseCollision/Dispatcher.h"
#include "BroadphaseCollision/BroadphaseInterface.h"
#include "CollisionShapes/TriangleCallback.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for ConvexConcaveCollisionAlgorithm.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | BoxTriangleCallback
class | ConvexConcaveCollisionAlgorithm
ConvexConcaveCollisionAlgorithm supports collision between convex shapes and (concave) trianges meshes. More...

Generated on Wed May 24 13:59:03 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConcaveCollisionAlgorithm.h Source File

Bullet » CollisionDispatch

ConvexConcaveCollisionAlgorithm.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONVEX_CONCAVE_COLLISION_ALGORITHM_H
00017 #define CONVEX_CONCAVE_COLLISION_ALGORITHM_H
00018
00019 #include "BroadphaseCollision/CollisionAlgorithm.h"
00020 #include "BroadphaseCollision/Dispatcher.h"
00021 #include "BroadphaseCollision/BroadphaseInterface.h"
00022 #include "CollisionShapes/TriangleCallback.h"
00023 #include "NarrowPhaseCollision/PersistentManifold.h"
00024 class Dispatcher;
00025 #include "BroadphaseCollision/BroadphaseProxy.h"
00026
00027
00028
00029 class BoxTriangleCallback : public TriangleCallback
00030 {
00031         BroadphaseProxy* m_boxProxy;
00032         BroadphaseProxy m_triangleProxy;
00033
00034         SimdVector3     m_aabbMin;
00035         SimdVector3     m_aabbMax ;
00036
00037         Dispatcher*     m_dispatcher;
00038         const DispatcherInfo* m_dispatchInfoPtr;
00039         float m_collisionMarginTriangle;
00040
00041 public:
00042 int     m_triangleCount;
00043
00044         PersistentManifold*     m_manifoldPtr;
00045
00046         BoxTriangleCallback(Dispatcher* dispatcher,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1);
00047
00048         void    SetTimeStepAndCounters(float collisionMarginTriangle,const DispatcherInfo& dispatchInfo);
00049
00050         virtual ~BoxTriangleCallback();
00051
00052         virtual void ProcessTriangle(SimdVector3* triangle, int partId, int triangleIndex);
00053
00054         void ClearCache();
00055
00056         inline const SimdVector3& GetAabbMin() const
00057         {
00058                 return m_aabbMin;
00059         }
00060         inline const SimdVector3& GetAabbMax() const
00061         {
00062                 return m_aabbMax;
00063         }
00064
00065 };
00066
00067
00068
00069
00071 class ConvexConcaveCollisionAlgorithm  : public CollisionAlgorithm
00072 {
00073
00074         BroadphaseProxy m_convex;
00075
00076         BroadphaseProxy m_concave;
00077
00078         BoxTriangleCallback m_boxTriangleCallback;
00079
00080
00081 public:
00082
00083         ConvexConcaveCollisionAlgorithm( const CollisionAlgorithmConstructionInfo& ci,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1);
00084
00085         virtual ~ConvexConcaveCollisionAlgorithm();
00086
00087         virtual void ProcessCollision (BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo);
00088
00089         float   CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo);
00090
00091         void    ClearCache();
00092
00093 };
00094
00095 #endif //CONVEX_CONCAVE_COLLISION_ALGORITHM_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConvexAlgorithm.cpp File Reference

Bullet » CollisionDispatch

ConvexConvexAlgorithm.cpp File Reference

#include "ConvexConvexAlgorithm.h"
#include <stdio.h>
#include "NarrowPhaseCollision/DiscreteCollisionDetectorInterface.h"
#include "BroadphaseCollision/BroadphaseInterface.h"
#include "CollisionDispatch/CollisionObject.h"
#include "CollisionShapes/ConvexShape.h"
#include "NarrowPhaseCollision/GjkPairDetector.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "CollisionDispatch/CollisionDispatcher.h"
#include "CollisionShapes/BoxShape.h"
#include "CollisionDispatch/ManifoldResult.h"
#include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"
#include "NarrowPhaseCollision/ContinuousConvexCollision.h"
#include "NarrowPhaseCollision/SubSimplexConvexCast.h"
#include "NarrowPhaseCollision/GjkConvexCast.h"
#include "CollisionShapes/MinkowskiSumShape.h"
#include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
#include "CollisionShapes/SphereShape.h"
#include "NarrowPhaseCollision/MinkowskiPenetrationDepthSolver.h"

Include dependency graph for ConvexConvexAlgorithm.cpp:

Go to the source code of this file.

Classes

class | FlippedContactResult

Variables

bool | gUseEpa = false
bool | gForceBoxBox = false
bool | gBoxBoxUseGjk = true
bool | gDisableConvexCollision = false
static MinkowskiPenetrationDepthSolver | gPenetrationDepthSolver
bool | disableCcd = false

Variable Documentation

bool disableCcd = false

Definition at line 330 of file ConvexConvexAlgorithm.cpp.

bool gBoxBoxUseGjk = true

Definition at line 79 of file ConvexConvexAlgorithm.cpp.

bool gDisableConvexCollision = false

Definition at line 80 of file ConvexConvexAlgorithm.cpp.

bool gForceBoxBox = false

Definition at line 77 of file ConvexConvexAlgorithm.cpp.

MinkowskiPenetrationDepthSolver gPenetrationDepthSolver [static]

Definition at line 145 of file ConvexConvexAlgorithm.cpp.

bool gUseEpa = false

Definition at line 62 of file ConvexConvexAlgorithm.cpp.

Referenced by ConvexConvexAlgorithm::CheckPenetrationDepthSolver(), and CcdPhysicsEnvironment::setUseEpa().

Generated on Wed May 24 13:59:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConvexAlgorithm.cpp Source File

Bullet » CollisionDispatch

ConvexConvexAlgorithm.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "ConvexConvexAlgorithm.h"
00017
00018 #include <stdio.h>
00019 #include "NarrowPhaseCollision/DiscreteCollisionDetectorInterface.h"
00020 #include "BroadphaseCollision/BroadphaseInterface.h"
00021 #include "CollisionDispatch/CollisionObject.h"
00022 #include "CollisionShapes/ConvexShape.h"
00023 #include "NarrowPhaseCollision/GjkPairDetector.h"
00024 #include "BroadphaseCollision/BroadphaseProxy.h"
00025 #include "CollisionDispatch/CollisionDispatcher.h"
00026 #include "CollisionShapes/BoxShape.h"
00027 #include "CollisionDispatch/ManifoldResult.h"
00028
00029 #include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"
00030 #include "NarrowPhaseCollision/ContinuousConvexCollision.h"
00031 #include "NarrowPhaseCollision/SubSimplexConvexCast.h"
00032 #include "NarrowPhaseCollision/GjkConvexCast.h"
00033
00034
00035
00036 #include "CollisionShapes/MinkowskiSumShape.h"
00037 #include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
00038 #include "CollisionShapes/SphereShape.h"
00039
00040 #include "NarrowPhaseCollision/MinkowskiPenetrationDepthSolver.h"
00041
00042 //#include "NarrowPhaseCollision/EpaPenetrationDepthSolver.h"
00043
00044 #ifdef WIN32
00045 #if _MSC_VER >= 1310
00046 //only use SIMD Hull code under Win32
00047 #ifdef TEST_HULL
00048 #define USE_HULL 1
00049 #endif //TEST_HULL
00050 #endif //_MSC_VER
00051 #endif //WIN32
00052
00053
00054 #ifdef USE_HULL
00055
00056 #include "NarrowPhaseCollision/Hull.h"
00057 #include "NarrowPhaseCollision/HullContactCollector.h"
00058
00059
00060 #endif //USE_HULL
00061
00062 bool gUseEpa = false;
00063
00064
00065 #ifdef WIN32
00066 void DrawRasterizerLine(const float* from,const float* to,int color);
00067 #endif
00068
00069
00070
00071
00072 //#define PROCESS_SINGLE_CONTACT
00073 #ifdef WIN32
00074 bool gForceBoxBox = false;//false;//true;
00075
00076 #else
00077 bool gForceBoxBox = false;//false;//true;
00078 #endif
00079 bool gBoxBoxUseGjk = true;//true;//false;
00080 bool gDisableConvexCollision = false;
00081
00082
00083
00084 ConvexConvexAlgorithm::ConvexConvexAlgorithm(PersistentManifold* mf,const CollisionAlgorithmConstructionInfo& ci,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1)
00085 : CollisionAlgorithm(ci),
00086 m_gjkPairDetector(0,0,&m_simplexSolver,0),
00087 m_useEpa(!gUseEpa),
00088 m_box0(*proxy0),
00089 m_box1(*proxy1),
00090 m_ownManifold (false),
00091 m_manifoldPtr(mf),
00092 m_lowLevelOfDetail(false)
00093 {
00094         CheckPenetrationDepthSolver();
00095
00096         {
00097                 if (!m_manifoldPtr && m_dispatcher->NeedsCollision(m_box0,m_box1))
00098                 {
00099                         m_manifoldPtr = m_dispatcher->GetNewManifold(proxy0->m_clientObject,proxy1->m_clientObject);
00100                         m_ownManifold = true;
00101                 }
00102         }
00103
00104 }
00105
00106
00107
00108 ConvexConvexAlgorithm::~ConvexConvexAlgorithm()
00109 {
00110         if (m_ownManifold)
00111         {
00112                 if (m_manifoldPtr)
00113                         m_dispatcher->ReleaseManifold(m_manifoldPtr);
00114         }
00115 }
00116
00117 void    ConvexConvexAlgorithm ::SetLowLevelOfDetail(bool useLowLevel)
00118 {
00119         m_lowLevelOfDetail = useLowLevel;
00120 }
00121
00122
00123
00124 class FlippedContactResult : public DiscreteCollisionDetectorInterface::Result
00125 {
00126         DiscreteCollisionDetectorInterface::Result* m_org;
00127
00128 public:
00129
00130         FlippedContactResult(DiscreteCollisionDetectorInterface::Result* org)
00131                 : m_org(org)
00132         {
00133
00134         }
00135
00136         virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
00137         {
00138                 SimdVector3 flippedNormal = -normalOnBInWorld;
00139
00140                 m_org->AddContactPoint(flippedNormal,pointInWorld,depth);
00141         }
00142
00143 };
00144
00145 static MinkowskiPenetrationDepthSolver  gPenetrationDepthSolver;
00146
00147 //static EpaPenetrationDepthSolver      gEpaPenetrationDepthSolver;
00148
00149 #ifdef USE_EPA
00150 Solid3EpaPenetrationDepth       gSolidEpaPenetrationSolver;
00151 #endif //USE_EPA
00152
00153 void    ConvexConvexAlgorithm::CheckPenetrationDepthSolver()
00154 {
00155         if (m_useEpa != gUseEpa)
00156         {
00157                 m_useEpa  = gUseEpa;
00158                 if (m_useEpa)
00159                 {
00160
00161                 //      m_gjkPairDetector.SetPenetrationDepthSolver(&gEpaPenetrationDepthSolver);
00162
00163
00164                 } else
00165                 {
00166                         m_gjkPairDetector.SetPenetrationDepthSolver(&gPenetrationDepthSolver);
00167                 }
00168         }
00169
00170 }
00171
00172 #ifdef USE_HULL
00173
00174 Transform       GetTransformFromSimdTransform(const SimdTransform& trans)
00175 {
00176                         //const SimdVector3& rowA0 = trans.getBasis().getRow(0);
00178                         //const SimdVector3& rowA2 = trans.getBasis().getRow(2);
00179
00180                         SimdVector3 rowA0 = trans.getBasis().getColumn(0);
00181                         SimdVector3 rowA1 = trans.getBasis().getColumn(1);
00182                         SimdVector3 rowA2 = trans.getBasis().getColumn(2);
00183
00184
00185                         Vector3 x(rowA0.getX(),rowA0.getY(),rowA0.getZ());
00186                         Vector3 y(rowA1.getX(),rowA1.getY(),rowA1.getZ());
00187                         Vector3 z(rowA2.getX(),rowA2.getY(),rowA2.getZ());
00188
00189                         Matrix33 ornA(x,y,z);
00190
00191                         Point3 transA(
00192                                 trans.getOrigin().getX(),
00193                                 trans.getOrigin().getY(),
00194                                 trans.getOrigin().getZ());
00195
00196                         return Transform(ornA,transA);
00197 }
00198
00199 class ManifoldResultCollector : public HullContactCollector
00200 {
00201 public:
00202         ManifoldResult& m_manifoldResult;
00203
00204         ManifoldResultCollector(ManifoldResult& manifoldResult)
00205                 :m_manifoldResult(manifoldResult)
00206         {
00207
00208         }
00209
00210
00211         virtual ~ManifoldResultCollector() {};
00212
00213         virtual int     BatchAddContactGroup(const Separation& sep,int numContacts,const Vector3& normalWorld,const Vector3& tangent,const Point3* positionsWorld,const float* depths)
00214         {
00215                 for (int i=0;i<numContacts;i++)
00216                 {
00217                         //printf("numContacts = %i\n",numContacts);
00218                         SimdVector3 normalOnBInWorld(sep.m_axis.GetX(),sep.m_axis.GetY(),sep.m_axis.GetZ());
00219                         //normalOnBInWorld.normalize();
00220                         SimdVector3 pointInWorld(positionsWorld[i].GetX(),positionsWorld[i].GetY(),positionsWorld[i].GetZ());
00221                         float depth = -depths[i];
00222                         m_manifoldResult.AddContactPoint(normalOnBInWorld,pointInWorld,depth);
00223
00224                 }
00225                 return 0;
00226         }
00227
00228         virtual int             GetMaxNumContacts() const
00229         {
00230                 return 4;
00231         }
00232
00233 };
00234 #endif //USE_HULL
00235
00236
00237 //
00238 // Convex-Convex collision algorithm
00239 //
00240 void ConvexConvexAlgorithm ::ProcessCollision (BroadphaseProxy* ,BroadphaseProxy* ,const DispatcherInfo& dispatchInfo)
00241 {
00242
00243         if (!m_manifoldPtr)
00244                 return;
00245
00246         CheckPenetrationDepthSolver();
00247
00248 //      printf("ConvexConvexAlgorithm::ProcessCollision\n");
00249
00250         bool needsCollision = m_dispatcher->NeedsCollision(m_box0,m_box1);
00251         if (!needsCollision)
00252                 return;
00253
00254         CollisionObject*        col0 = static_cast<CollisionObject*>(m_box0.m_clientObject);
00255         CollisionObject*        col1 = static_cast<CollisionObject*>(m_box1.m_clientObject);
00256
00257 #ifdef USE_HULL
00258
00259
00260         if (dispatchInfo.m_enableSatConvex)
00261         {
00262                 if ((col0->m_collisionShape->IsPolyhedral()) &&
00263                         (col1->m_collisionShape->IsPolyhedral()))
00264                 {
00265
00266
00267                         PolyhedralConvexShape* polyhedron0 = static_cast<PolyhedralConvexShape*>(col0->m_collisionShape);
00268                         PolyhedralConvexShape* polyhedron1 = static_cast<PolyhedralConvexShape*>(col1->m_collisionShape);
00269                         if (polyhedron0->m_optionalHull && polyhedron1->m_optionalHull)
00270                         {
00271                                 //printf("Hull-Hull");
00272
00273                                 //todo: cache this information, rather then initialize
00274                                 Separation sep;
00275                                 sep.m_featureA = 0;
00276                                 sep.m_featureB = 0;
00277                                 sep.m_contact = -1;
00278                                 sep.m_separator = 0;
00279
00280                                 //convert from SimdTransform to Transform
00281
00282                                 Transform trA = GetTransformFromSimdTransform(col0->m_worldTransform);
00283                                 Transform trB = GetTransformFromSimdTransform(col1->m_worldTransform);
00284
00285                                 //either use persistent manifold or clear it every time
00286                                 m_dispatcher->ClearManifold(m_manifoldPtr);
00287                                 ManifoldResult* resultOut = m_dispatcher->GetNewManifoldResult(col0,col1,m_manifoldPtr);
00288
00289                                 ManifoldResultCollector hullContactCollector(*resultOut);
00290
00291                                 Hull::ProcessHullHull(sep,*polyhedron0->m_optionalHull,*polyhedron1->m_optionalHull,
00292                                         trA,trB,&hullContactCollector);
00293
00294
00295                                 //user provided hull's, so we use SAT Hull collision detection
00296                                 return;
00297                         }
00298                 }
00299         }
00300
00301 #endif //USE_HULL
00302
00303
00304         ManifoldResult* resultOut = m_dispatcher->GetNewManifoldResult(col0,col1,m_manifoldPtr);
00305
00306         ConvexShape* min0 = static_cast<ConvexShape*>(col0->m_collisionShape);
00307         ConvexShape* min1 = static_cast<ConvexShape*>(col1->m_collisionShape);
00308
00309         GjkPairDetector::ClosestPointInput input;
00310
00311
00312         //TODO: if (dispatchInfo.m_useContinuous)
00313         m_gjkPairDetector.SetMinkowskiA(min0);
00314         m_gjkPairDetector.SetMinkowskiB(min1);
00315         input.m_maximumDistanceSquared = min0->GetMargin() + min1->GetMargin() + m_manifoldPtr->GetContactBreakingTreshold();
00316         input.m_maximumDistanceSquared*= input.m_maximumDistanceSquared;
00317
00318         input.m_maximumDistanceSquared = 1e30f;
00319
00320         input.m_transformA = col0->m_worldTransform;
00321         input.m_transformB = col1->m_worldTransform;
00322
00323         m_gjkPairDetector.GetClosestPoints(input,*resultOut,dispatchInfo.m_debugDraw);
00324
00325         m_dispatcher->ReleaseManifoldResult(resultOut);
00326 }
00327
00328
00329
00330 bool disableCcd = false;
00331 float   ConvexConvexAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo)
00332 {
00334
00337         float resultFraction = 1.f;
00338
00339         CollisionObject* col1 = static_cast<CollisionObject*>(m_box1.m_clientObject);
00340         CollisionObject* col0 = static_cast<CollisionObject*>(m_box0.m_clientObject);
00341
00342         float squareMot0 = (col0->m_interpolationWorldTransform.getOrigin() - col0->m_worldTransform.getOrigin()).length2();
00343         float squareMot1 = (col1->m_interpolationWorldTransform.getOrigin() - col1->m_worldTransform.getOrigin()).length2();
00344
00345         if (squareMot0 < col0->m_ccdSquareMotionTreshold &&
00346                 squareMot0 < col0->m_ccdSquareMotionTreshold)
00347                 return resultFraction;
00348
00349
00350
00351         if (disableCcd)
00352                 return 1.f;
00353
00354         CheckPenetrationDepthSolver();
00355
00356         //An adhoc way of testing the Continuous Collision Detection algorithms
00357         //One object is approximated as a sphere, to simplify things
00358         //Starting in penetration should report no time of impact
00359         //For proper CCD, better accuracy and handling of 'allowed' penetration should be added
00360         //also the mainloop of the physics should have a kind of toi queue (something like Brian Mirtich's application of Timewarp for Rigidbodies)
00361
00362         bool needsCollision = m_dispatcher->NeedsCollision(m_box0,m_box1);
00363
00364         if (!needsCollision)
00365                 return 1.f;
00366
00367
00369         {
00370                 ConvexShape* convex0 = static_cast<ConvexShape*>(col0->m_collisionShape);
00371
00372                 SphereShape     sphere1(col1->m_ccdSweptShereRadius); //todo: allow non-zero sphere sizes, for better approximation
00373                 ConvexCast::CastResult result;
00374                 VoronoiSimplexSolver voronoiSimplex;
00375                 //SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
00377                 GjkConvexCast ccd1( convex0 ,&sphere1,&voronoiSimplex);
00378                 //ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
00379                 if (ccd1.calcTimeOfImpact(col0->m_worldTransform,col0->m_interpolationWorldTransform,
00380                         col1->m_worldTransform,col1->m_interpolationWorldTransform,result))
00381                 {
00382
00383                         //store result.m_fraction in both bodies
00384
00385                         if (col0->m_hitFraction > result.m_fraction)
00386                                 col0->m_hitFraction  = result.m_fraction;
00387
00388                         if (col1->m_hitFraction > result.m_fraction)
00389                                 col1->m_hitFraction  = result.m_fraction;
00390
00391                         if (resultFraction > result.m_fraction)
00392                                 resultFraction = result.m_fraction;
00393
00394                 }
00395
00396
00397
00398
00399         }
00400
00402         {
00403                 ConvexShape* convex1 = static_cast<ConvexShape*>(col1->m_collisionShape);
00404
00405                 SphereShape     sphere0(col0->m_ccdSweptShereRadius); //todo: allow non-zero sphere sizes, for better approximation
00406                 ConvexCast::CastResult result;
00407                 VoronoiSimplexSolver voronoiSimplex;
00408                 //SubsimplexConvexCast ccd0(&sphere,min0,&voronoiSimplex);
00410                 GjkConvexCast ccd1(&sphere0,convex1,&voronoiSimplex);
00411                 //ContinuousConvexCollision ccd(min0,min1,&voronoiSimplex,0);
00412                 if (ccd1.calcTimeOfImpact(col0->m_worldTransform,col0->m_interpolationWorldTransform,
00413                         col1->m_worldTransform,col1->m_interpolationWorldTransform,result))
00414                 {
00415
00416                         //store result.m_fraction in both bodies
00417
00418                         if (col0->m_hitFraction > result.m_fraction)
00419                                 col0->m_hitFraction  = result.m_fraction;
00420
00421                         if (col1->m_hitFraction > result.m_fraction)
00422                                 col1->m_hitFraction  = result.m_fraction;
00423
00424                         if (resultFraction > result.m_fraction)
00425                                 resultFraction = result.m_fraction;
00426
00427                 }
00428         }
00429
00430         return resultFraction;
00431
00432 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConvexAlgorithm.h File Reference

Bullet » CollisionDispatch

ConvexConvexAlgorithm.h File Reference

#include "BroadphaseCollision/CollisionAlgorithm.h"
#include "NarrowPhaseCollision/GjkPairDetector.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "NarrowPhaseCollision/VoronoiSimplexSolver.h"

Include dependency graph for ConvexConvexAlgorithm.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ConvexConvexAlgorithm
ConvexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations. More...

Generated on Wed May 24 13:59:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConvexAlgorithm.h Source File

Bullet » CollisionDispatch

ConvexConvexAlgorithm.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONVEX_CONVEX_ALGORITHM_H
00017 #define CONVEX_CONVEX_ALGORITHM_H
00018
00019 #include "BroadphaseCollision/CollisionAlgorithm.h"
00020 #include "NarrowPhaseCollision/GjkPairDetector.h"
00021 #include "NarrowPhaseCollision/PersistentManifold.h"
00022 #include "BroadphaseCollision/BroadphaseProxy.h"
00023 #include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
00024
00025 class ConvexPenetrationDepthSolver;
00026
00028 class ConvexConvexAlgorithm : public CollisionAlgorithm
00029 {
00030         //ConvexPenetrationDepthSolver* m_penetrationDepthSolver;
00031         VoronoiSimplexSolver    m_simplexSolver;
00032         GjkPairDetector m_gjkPairDetector;
00033         bool    m_useEpa;
00034 public:
00035         BroadphaseProxy m_box0;
00036         BroadphaseProxy m_box1;
00037
00038         bool    m_ownManifold;
00039         PersistentManifold*     m_manifoldPtr;
00040         bool                    m_lowLevelOfDetail;
00041
00042         void    CheckPenetrationDepthSolver();
00043
00044
00045
00046 public:
00047
00048         ConvexConvexAlgorithm(PersistentManifold* mf,const CollisionAlgorithmConstructionInfo& ci,BroadphaseProxy* proxy0,BroadphaseProxy* proxy1);
00049
00050         virtual ~ConvexConvexAlgorithm();
00051
00052         virtual void ProcessCollision (BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo);
00053
00054         virtual float CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo);
00055
00056         void    SetLowLevelOfDetail(bool useLowLevel);
00057
00058
00059
00060         const PersistentManifold*       GetManifold()
00061         {
00062                 return m_manifoldPtr;
00063         }
00064
00065 };
00066
00067 #endif //CONVEX_CONVEX_ALGORITHM_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexHullShape.cpp File Reference

Bullet » CollisionShapes

ConvexHullShape.cpp File Reference

#include "ConvexHullShape.h"
#include "CollisionShapes/CollisionMargin.h"
#include "SimdQuaternion.h"

Include dependency graph for ConvexHullShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexHullShape.cpp Source File

Bullet » CollisionShapes

ConvexHullShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 #include "ConvexHullShape.h"
00016 #include "CollisionShapes/CollisionMargin.h"
00017
00018 #include "SimdQuaternion.h"
00019
00020
00021 ConvexHullShape ::ConvexHullShape (SimdPoint3* points,int numPoints)
00022 {
00023         m_points.resize(numPoints);
00024         for (int i=0;i<numPoints;i++)
00025                 m_points[i] = points[i];
00026 }
00027
00028 SimdVector3     ConvexHullShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec0)const
00029 {
00030         SimdVector3 supVec(0.f,0.f,0.f);
00031         SimdScalar newDot,maxDot = -1e30f;
00032
00033         SimdVector3 vec = vec0;
00034         SimdScalar lenSqr = vec.length2();
00035         if (lenSqr < 0.0001f)
00036         {
00037                 vec.setValue(1,0,0);
00038         } else
00039         {
00040                 float rlen = 1.f / SimdSqrt(lenSqr );
00041                 vec *= rlen;
00042         }
00043
00044
00045         for (size_t i=0;i<m_points.size();i++)
00046         {
00047                 SimdPoint3 vtx = m_points[i] * m_localScaling;
00048
00049                 newDot = vec.dot(vtx);
00050                 if (newDot > maxDot)
00051                 {
00052                         maxDot = newDot;
00053                         supVec = vtx;
00054                 }
00055         }
00056         return supVec;
00057 }
00058
00059 void    ConvexHullShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00060 {
00061         SimdScalar newDot;
00062         //use 'w' component of supportVerticesOut?
00063         {
00064                 for (int i=0;i<numVectors;i++)
00065                 {
00066                         supportVerticesOut[i][3] = -1e30f;
00067                 }
00068         }
00069         for (size_t i=0;i<m_points.size();i++)
00070         {
00071                 SimdPoint3 vtx = m_points[i] * m_localScaling;
00072
00073                 for (int j=0;j<numVectors;j++)
00074                 {
00075                         const SimdVector3& vec = vectors[j];
00076
00077                         newDot = vec.dot(vtx);
00078                         if (newDot > supportVerticesOut[j][3])
00079                         {
00080                                 //WARNING: don't swap next lines, the w component would get overwritten!
00081                                 supportVerticesOut[j] = vtx;
00082                                 supportVerticesOut[j][3] = newDot;
00083                         }
00084                 }
00085         }
00086
00087
00088
00089 }
00090
00091
00092
00093 SimdVector3     ConvexHullShape::LocalGetSupportingVertex(const SimdVector3& vec)const
00094 {
00095         SimdVector3 supVertex = LocalGetSupportingVertexWithoutMargin(vec);
00096
00097         if ( GetMargin()!=0.f )
00098         {
00099                 SimdVector3 vecnorm = vec;
00100                 if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
00101                 {
00102                         vecnorm.setValue(-1.f,-1.f,-1.f);
00103                 }
00104                 vecnorm.normalize();
00105                 supVertex+= GetMargin() * vecnorm;
00106         }
00107         return supVertex;
00108 }
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118 //currently just for debugging (drawing), perhaps future support for algebraic continuous collision detection
00119 //Please note that you can debug-draw ConvexHullShape with the Raytracer Demo
00120 int     ConvexHullShape::GetNumVertices() const
00121 {
00122         return m_points.size();
00123 }
00124
00125 int ConvexHullShape::GetNumEdges() const
00126 {
00127         return m_points.size()*m_points.size();
00128 }
00129
00130 void ConvexHullShape::GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const
00131 {
00132
00133         int index0 = i%m_points.size();
00134         int index1 = i/m_points.size();
00135         pa = m_points[index0]*m_localScaling;
00136         pb = m_points[index1]*m_localScaling;
00137 }
00138
00139 void ConvexHullShape::GetVertex(int i,SimdPoint3& vtx) const
00140 {
00141         vtx = m_points[i]*m_localScaling;
00142 }
00143
00144 int     ConvexHullShape::GetNumPlanes() const
00145 {
00146         return 0;
00147 }
00148
00149 void ConvexHullShape::GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i ) const
00150 {
00151         assert(0);
00152 }
00153
00154 //not yet
00155 bool ConvexHullShape::IsInside(const SimdPoint3& pt,SimdScalar tolerance) const
00156 {
00157         assert(0);
00158         return false;
00159 }
00160
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexHullShape.h File Reference

Bullet » CollisionShapes

ConvexHullShape.h File Reference

#include "PolyhedralConvexShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include <vector>

Include dependency graph for ConvexHullShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ConvexHullShape
ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) No connectivity is needed. More...

Generated on Wed May 24 13:59:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexHullShape.h Source File

Bullet » CollisionShapes

ConvexHullShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONVEX_HULL_SHAPE_H
00017 #define CONVEX_HULL_SHAPE_H
00018
00019 #include "PolyhedralConvexShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021
00022 #include <vector>
00023
00028 class ConvexHullShape : public PolyhedralConvexShape
00029 {
00030         std::vector<SimdPoint3> m_points;
00031
00032 public:
00033         ConvexHullShape(SimdPoint3* points,int numPoints);
00034
00035         void AddPoint(const SimdPoint3& point)
00036         {
00037                 m_points.push_back(point);
00038         }
00039         virtual SimdVector3     LocalGetSupportingVertex(const SimdVector3& vec)const;
00040         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00041         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00042
00043
00044         virtual int     GetShapeType()const { return CONVEX_HULL_SHAPE_PROXYTYPE; }
00045
00046         //debugging
00047         virtual char*   GetName()const {return "Convex";}
00048
00049
00050         virtual int     GetNumVertices() const;
00051         virtual int GetNumEdges() const;
00052         virtual void GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const;
00053         virtual void GetVertex(int i,SimdPoint3& vtx) const;
00054         virtual int     GetNumPlanes() const;
00055         virtual void GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i ) const;
00056         virtual bool IsInside(const SimdPoint3& pt,SimdScalar tolerance) const;
00057
00058
00059
00060 };
00061
00062
00063 #endif //CONVEX_HULL_SHAPE_H
00064
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexPenetrationDepthSolver.h File Reference

Bullet » NarrowPhaseCollision

ConvexPenetrationDepthSolver.h File Reference

#include "SimplexSolverInterface.h"
#include "SimdPoint3.h"

Include dependency graph for ConvexPenetrationDepthSolver.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ConvexPenetrationDepthSolver
ConvexPenetrationDepthSolver provides an interface for penetration depth calculation. More...

Generated on Wed May 24 13:59:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexPenetrationDepthSolver.h Source File

Bullet » NarrowPhaseCollision

ConvexPenetrationDepthSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef CONVEX_PENETRATION_DEPTH_H
00018 #define CONVEX_PENETRATION_DEPTH_H
00019
00020 class SimdVector3;
00021 #include "SimplexSolverInterface.h"
00022 class ConvexShape;
00023 #include "SimdPoint3.h"
00024 class SimdTransform;
00025
00027 class ConvexPenetrationDepthSolver
00028 {
00029 public:
00030
00031         virtual ~ConvexPenetrationDepthSolver() {};
00032         virtual bool CalcPenDepth( SimplexSolverInterface& simplexSolver,
00033                 ConvexShape* convexA,ConvexShape* convexB,
00034                                         const SimdTransform& transA,const SimdTransform& transB,
00035                                 SimdVector3& v, SimdPoint3& pa, SimdPoint3& pb,
00036                                 class IDebugDraw* debugDraw
00037                                 ) = 0;
00038
00039
00040 };
00041 #endif //CONVEX_PENETRATION_DEPTH_H
00042
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexShape.cpp File Reference

Bullet » CollisionShapes

ConvexShape.cpp File Reference

#include "ConvexShape.h"

Include dependency graph for ConvexShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexShape.cpp Source File

Bullet » CollisionShapes

ConvexShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "ConvexShape.h"
00017
00018 ConvexShape::~ConvexShape()
00019 {
00020
00021 }
00022
00023 ConvexShape::ConvexShape()
00024 :m_collisionMargin(CONVEX_DISTANCE_MARGIN),
00025 m_localScaling(1.f,1.f,1.f)
00026 {
00027 }
00028
00029
00030 void    ConvexShape::setLocalScaling(const SimdVector3& scaling)
00031 {
00032         m_localScaling = scaling;
00033 }
00034
00035
00036
00037 void    ConvexShape::GetAabbSlow(const SimdTransform& trans,SimdVector3&minAabb,SimdVector3&maxAabb) const
00038 {
00039
00040         SimdScalar margin = GetMargin();
00041         for (int i=0;i<3;i++)
00042         {
00043                 SimdVector3 vec(0.f,0.f,0.f);
00044                 vec[i] = 1.f;
00045
00046                 SimdVector3 sv = LocalGetSupportingVertex(vec*trans.getBasis());
00047
00048                 SimdVector3 tmp = trans(sv);
00049                 maxAabb[i] = tmp[i]+margin;
00050                 vec[i] = -1.f;
00051                 tmp = trans(LocalGetSupportingVertex(vec*trans.getBasis()));
00052                 minAabb[i] = tmp[i]-margin;
00053         }
00054 };
00055
00056 SimdVector3     ConvexShape::LocalGetSupportingVertex(const SimdVector3& vec)const
00057  {
00058          SimdVector3    supVertex = LocalGetSupportingVertexWithoutMargin(vec);
00059
00060         if ( GetMargin()!=0.f )
00061         {
00062                 SimdVector3 vecnorm = vec;
00063                 if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
00064                 {
00065                         vecnorm.setValue(-1.f,-1.f,-1.f);
00066                 }
00067                 vecnorm.normalize();
00068                 supVertex+= GetMargin() * vecnorm;
00069         }
00070         return supVertex;
00071
00072  }
00073
00074
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexShape.h File Reference

Bullet » CollisionShapes

ConvexShape.h File Reference

#include "CollisionShape.h"
#include "SimdVector3.h"
#include "SimdTransform.h"
#include "SimdMatrix3x3.h"
#include <vector>
#include "CollisionShapes/CollisionMargin.h"

Include dependency graph for ConvexShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ConvexShape
ConvexShape is an abstract shape interface. More...

Generated on Wed May 24 13:59:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexShape.h Source File

Bullet » CollisionShapes

ConvexShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CONVEX_SHAPE_INTERFACE1
00017 #define CONVEX_SHAPE_INTERFACE1
00018
00019 #include "CollisionShape.h"
00020
00021 #include "SimdVector3.h"
00022 #include "SimdTransform.h"
00023 #include "SimdMatrix3x3.h"
00024 #include <vector>
00025 #include "CollisionShapes/CollisionMargin.h"
00026
00027 //todo: get rid of this ConvexCastResult thing!
00028 struct ConvexCastResult;
00029
00030
00034 class ConvexShape : public CollisionShape
00035 {
00036 public:
00037         ConvexShape();
00038
00039         virtual ~ConvexShape();
00040
00041         virtual SimdVector3     LocalGetSupportingVertex(const SimdVector3& vec)const;
00042         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec) const= 0;
00043
00044         //notice that the vectors should be unit length
00045         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const= 0;
00046
00047         // testing for hullnode code
00048
00050         void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
00051         {
00052                 GetAabbSlow(t,aabbMin,aabbMax);
00053         }
00054
00055
00056
00057         virtual void GetAabbSlow(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
00058
00059
00060         virtual void    setLocalScaling(const SimdVector3& scaling);
00061         virtual const SimdVector3& getLocalScaling() const
00062         {
00063                 return m_localScaling;
00064         }
00065
00066
00067         virtual void    SetMargin(float margin)
00068         {
00069                 m_collisionMargin = margin;
00070         }
00071         virtual float   GetMargin() const
00072         {
00073                 return m_collisionMargin;
00074         }
00075 private:
00076         SimdScalar      m_collisionMargin;
00077         //local scaling. collisionMargin is not scaled !
00078 protected:
00079         SimdVector3     m_localScaling;
00080
00081 };
00082
00083
00084
00085 #endif //CONVEX_SHAPE_INTERFACE1
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShape.cpp File Reference

Bullet » CollisionShapes

CylinderShape.cpp File Reference

#include "CylinderShape.h"
#include "SimdPoint3.h"

Include dependency graph for CylinderShape.cpp:

Go to the source code of this file.

Functions

SimdVector3 | CylinderLocalSupportX (const SimdVector3 &halfExtents, const SimdVector3 &v)
SimdVector3 | CylinderLocalSupportY (const SimdVector3 &halfExtents, const SimdVector3 &v)
SimdVector3 | CylinderLocalSupportZ (const SimdVector3 &halfExtents, const SimdVector3 &v)

Function Documentation

SimdVector3 CylinderLocalSupportX | ( | const SimdVector3 & | halfExtents,
 |  | const SimdVector3 & | v
 | ) | [inline]

Definition at line 38 of file CylinderShape.cpp.

References SimdSqrt().

Referenced by CylinderShapeX::BatchedUnitVectorGetSupportingVertexWithoutMargin(), and CylinderShapeX::LocalGetSupportingVertexWithoutMargin().

SimdVector3 CylinderLocalSupportY | ( | const SimdVector3 & | halfExtents,
 |  | const SimdVector3 & | v
 | ) | [inline]

Definition at line 81 of file CylinderShape.cpp.

References SimdSqrt().

Referenced by CylinderShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), and CylinderShape::LocalGetSupportingVertexWithoutMargin().

SimdVector3 CylinderLocalSupportZ | ( | const SimdVector3 & | halfExtents,
 |  | const SimdVector3 & | v
 | ) | [inline]

Definition at line 116 of file CylinderShape.cpp.

References SimdSqrt().

Referenced by CylinderShapeZ::BatchedUnitVectorGetSupportingVertexWithoutMargin(), and CylinderShapeZ::LocalGetSupportingVertexWithoutMargin().

Generated on Wed May 24 13:59:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShape.cpp Source File

Bullet » CollisionShapes

CylinderShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015 #include "CylinderShape.h"
00016 #include "SimdPoint3.h"
00017
00018 CylinderShape::CylinderShape (const SimdVector3& halfExtents)
00019 :BoxShape(halfExtents)
00020 {
00021
00022 }
00023
00024
00025 CylinderShapeX::CylinderShapeX (const SimdVector3& halfExtents)
00026 :CylinderShape(halfExtents)
00027 {
00028 }
00029
00030
00031 CylinderShapeZ::CylinderShapeZ (const SimdVector3& halfExtents)
00032 :CylinderShape(halfExtents)
00033 {
00034 }
00035
00036
00037
00038 inline SimdVector3 CylinderLocalSupportX(const SimdVector3& halfExtents,const SimdVector3& v)
00039 {
00040 const int cylinderUpAxis = 0;
00041 const int XX = 1;
00042 const int YY = 0;
00043 const int ZZ = 2;
00044
00045         //mapping depends on how cylinder local orientation is
00046         // extents of the cylinder is: X,Y is for radius, and Z for height
00047
00048
00049         float radius = halfExtents[XX];
00050         float halfHeight = halfExtents[cylinderUpAxis];
00051
00052
00053     SimdVector3 tmp;
00054         SimdScalar d ;
00055
00056     SimdScalar s = SimdSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
00057     if (s != SimdScalar(0.0))
00058         {
00059         d = radius / s;
00060                 tmp[XX] = v[XX] * d;
00061                 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
00062                 tmp[ZZ] = v[ZZ] * d;
00063                 return tmp;
00064         }
00065     else
00066         {
00067             tmp[XX] = radius;
00068                 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
00069                 tmp[ZZ] = SimdScalar(0.0);
00070                 return tmp;
00071     }
00072
00073
00074 }
00075
00076
00077
00078
00079
00080
00081 inline  SimdVector3 CylinderLocalSupportY(const SimdVector3& halfExtents,const SimdVector3& v)
00082 {
00083
00084 const int cylinderUpAxis = 1;
00085 const int XX = 0;
00086 const int YY = 1;
00087 const int ZZ = 2;
00088
00089
00090         float radius = halfExtents[XX];
00091         float halfHeight = halfExtents[cylinderUpAxis];
00092
00093
00094     SimdVector3 tmp;
00095         SimdScalar d ;
00096
00097     SimdScalar s = SimdSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
00098     if (s != SimdScalar(0.0))
00099         {
00100         d = radius / s;
00101                 tmp[XX] = v[XX] * d;
00102                 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
00103                 tmp[ZZ] = v[ZZ] * d;
00104                 return tmp;
00105         }
00106     else
00107         {
00108             tmp[XX] = radius;
00109                 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
00110                 tmp[ZZ] = SimdScalar(0.0);
00111                 return tmp;
00112     }
00113
00114 }
00115
00116 inline SimdVector3 CylinderLocalSupportZ(const SimdVector3& halfExtents,const SimdVector3& v)
00117 {
00118 const int cylinderUpAxis = 2;
00119 const int XX = 0;
00120 const int YY = 2;
00121 const int ZZ = 1;
00122
00123         //mapping depends on how cylinder local orientation is
00124         // extents of the cylinder is: X,Y is for radius, and Z for height
00125
00126
00127         float radius = halfExtents[XX];
00128         float halfHeight = halfExtents[cylinderUpAxis];
00129
00130
00131     SimdVector3 tmp;
00132         SimdScalar d ;
00133
00134     SimdScalar s = SimdSqrt(v[XX] * v[XX] + v[ZZ] * v[ZZ]);
00135     if (s != SimdScalar(0.0))
00136         {
00137         d = radius / s;
00138                 tmp[XX] = v[XX] * d;
00139                 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
00140                 tmp[ZZ] = v[ZZ] * d;
00141                 return tmp;
00142         }
00143     else
00144         {
00145             tmp[XX] = radius;
00146                 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
00147                 tmp[ZZ] = SimdScalar(0.0);
00148                 return tmp;
00149     }
00150
00151
00152 }
00153
00154 SimdVector3     CylinderShapeX::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00155 {
00156         return CylinderLocalSupportX(GetHalfExtents(),vec);
00157 }
00158
00159
00160 SimdVector3     CylinderShapeZ::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00161 {
00162         return CylinderLocalSupportZ(GetHalfExtents(),vec);
00163 }
00164 SimdVector3     CylinderShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00165 {
00166         return CylinderLocalSupportY(GetHalfExtents(),vec);
00167 }
00168
00169 void    CylinderShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00170 {
00171         for (int i=0;i<numVectors;i++)
00172         {
00173                 supportVerticesOut[i] = CylinderLocalSupportY(GetHalfExtents(),vectors[i]);
00174         }
00175 }
00176
00177 void    CylinderShapeZ::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00178 {
00179         for (int i=0;i<numVectors;i++)
00180         {
00181                 supportVerticesOut[i] = CylinderLocalSupportZ(GetHalfExtents(),vectors[i]);
00182         }
00183 }
00184
00185
00186
00187
00188 void    CylinderShapeX::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00189 {
00190         for (int i=0;i<numVectors;i++)
00191         {
00192                 supportVerticesOut[i] = CylinderLocalSupportX(GetHalfExtents(),vectors[i]);
00193         }
00194 }
00195
00196
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShape.h File Reference

Bullet » CollisionShapes

CylinderShape.h File Reference

#include "BoxShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "SimdVector3.h"

Include dependency graph for CylinderShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | CylinderShape
implements cylinder shape interface More...
class | CylinderShapeX
class | CylinderShapeZ

Generated on Wed May 24 13:59:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShape.h Source File

Bullet » CollisionShapes

CylinderShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef CYLINDER_MINKOWSKI_H
00017 #define CYLINDER_MINKOWSKI_H
00018
00019 #include "BoxShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021 #include "SimdVector3.h"
00022
00024 class CylinderShape : public BoxShape
00025
00026 {
00027
00028 public:
00029         CylinderShape (const SimdVector3& halfExtents);
00030
00032         void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
00033         {
00034                 GetAabbSlow(t,aabbMin,aabbMax);
00035         }
00036
00037         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00038
00039         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00040
00041         virtual SimdVector3     LocalGetSupportingVertex(const SimdVector3& vec) const
00042         {
00043
00044                 SimdVector3 supVertex;
00045                 supVertex = LocalGetSupportingVertexWithoutMargin(vec);
00046
00047                 if ( GetMargin()!=0.f )
00048                 {
00049                         SimdVector3 vecnorm = vec;
00050                         if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
00051                         {
00052                                 vecnorm.setValue(-1.f,-1.f,-1.f);
00053                         }
00054                         vecnorm.normalize();
00055                         supVertex+= GetMargin() * vecnorm;
00056                 }
00057                 return supVertex;
00058         }
00059
00060
00061         //use box inertia
00062         //      virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00063
00064         virtual int     GetShapeType() const
00065         {
00066                 return CYLINDER_SHAPE_PROXYTYPE;
00067         }
00068
00069
00070
00071 };
00072
00073 class CylinderShapeX : public CylinderShape
00074 {
00075 public:
00076         CylinderShapeX (const SimdVector3& halfExtents);
00077
00078         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00079         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00080 };
00081
00082 class CylinderShapeZ : public CylinderShape
00083 {
00084 public:
00085         CylinderShapeZ (const SimdVector3& halfExtents);
00086
00087         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00088         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00089
00090 };
00091
00092
00093 #endif //CYLINDER_MINKOWSKI_H
00094
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DiscreteCollisionDetectorInterface.h File Reference

Bullet » NarrowPhaseCollision

DiscreteCollisionDetectorInterface.h File Reference

#include "SimdTransform.h"
#include "SimdVector3.h"

Include dependency graph for DiscreteCollisionDetectorInterface.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | DiscreteCollisionDetectorInterface
This interface is made to be used by an iterative approach to do TimeOfImpact calculations This interface allows to query for closest points and penetration depth between two (convex) objects the closest point is on the second object (B), and the normal points from the surface on B towards A. More...
struct | DiscreteCollisionDetectorInterface::Result
struct | DiscreteCollisionDetectorInterface::ClosestPointInput
struct | StorageResult

Generated on Wed May 24 13:59:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DiscreteCollisionDetectorInterface.h Source File

Bullet » NarrowPhaseCollision

DiscreteCollisionDetectorInterface.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef DISCRETE_COLLISION_DETECTOR_INTERFACE_H
00018 #define DISCRETE_COLLISION_DETECTOR_INTERFACE_H
00019 #include "SimdTransform.h"
00020 #include "SimdVector3.h"
00021
00022
00028 struct DiscreteCollisionDetectorInterface
00029 {
00030         void operator delete(void* ptr) {};
00031
00032         struct Result
00033         {
00034                 void operator delete(void* ptr) {};
00035
00036                 virtual ~Result(){}
00037                 virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)=0;
00038         };
00039
00040         struct ClosestPointInput
00041         {
00042                 ClosestPointInput()
00043                         :m_maximumDistanceSquared(1e30f)
00044                 {
00045                 }
00046
00047                 SimdTransform m_transformA;
00048                 SimdTransform m_transformB;
00049                 SimdScalar      m_maximumDistanceSquared;
00050         };
00051
00052         virtual ~DiscreteCollisionDetectorInterface() {};
00053
00054         //
00055         // give either closest points (distance > 0) or penetration (distance)
00056         // the normal always points from B towards A
00057         //
00058         virtual void    GetClosestPoints(const ClosestPointInput& input,Result& output,class IDebugDraw* debugDraw) = 0;
00059
00060         SimdScalar      getCollisionMargin() { return 0.2f;}
00061 };
00062
00063 struct StorageResult : public DiscreteCollisionDetectorInterface::Result
00064 {
00065                 SimdVector3     m_normalOnSurfaceB;
00066                 SimdVector3     m_closestPointInB;
00067                 SimdScalar      m_distance; //negative means penetration !
00068
00069                 StorageResult() : m_distance(1e30f)
00070                 {
00071
00072                 }
00073                 virtual ~StorageResult() {};
00074
00075                 virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
00076                 {
00077                         if (depth < m_distance)
00078                         {
00079                                 m_normalOnSurfaceB = normalOnBInWorld;
00080                                 m_closestPointInB = pointInWorld;
00081                                 m_distance = depth;
00082                         }
00083                 }
00084 };
00085
00086 #endif //DISCRETE_COLLISION_DETECTOR_INTERFACE_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Dispatcher.cpp File Reference

Bullet » BroadphaseCollision

Dispatcher.cpp File Reference

#include "Dispatcher.h"

Include dependency graph for Dispatcher.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Dispatcher.cpp Source File

Bullet » BroadphaseCollision

Dispatcher.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "Dispatcher.h"
00017
00018 Dispatcher::~Dispatcher()
00019 {
00020
00021 }
00022
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Dispatcher.h File Reference

Bullet » BroadphaseCollision

Dispatcher.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | DispatcherInfo
class | Dispatcher
Dispatcher can be used in combination with broadphase to dispatch overlapping pairs. More...

Enumerations

enum CollisionDispatcherId {
RIGIDBODY_DISPATCHER = 0,
USERCALLBACK_DISPATCHER
}

Enumeration Type Documentation

enum CollisionDispatcherId

Enumerator:
RIGIDBODY_DISPATCHER
USERCALLBACK_DISPATCHER

Definition at line 25 of file Dispatcher.h.

Generated on Wed May 24 13:59:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Dispatcher.h Source File

Bullet » BroadphaseCollision

Dispatcher.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef _DISPATCHER_H
00017 #define _DISPATCHER_H
00018
00019 class CollisionAlgorithm;
00020 struct BroadphaseProxy;
00021 class RigidBody;
00022 struct  CollisionObject;
00023 class ManifoldResult;
00024
00025 enum CollisionDispatcherId
00026 {
00027         RIGIDBODY_DISPATCHER = 0,
00028         USERCALLBACK_DISPATCHER
00029 };
00030
00031 class PersistentManifold;
00032
00033 struct DispatcherInfo
00034 {
00035         enum DispatchFunc
00036         {
00037                 DISPATCH_DISCRETE = 1,
00038                 DISPATCH_CONTINUOUS
00039         };
00040         DispatcherInfo()
00041                 :m_dispatchFunc(DISPATCH_DISCRETE),
00042                 m_timeOfImpact(1.f),
00043                 m_useContinuous(false),
00044                 m_debugDraw(0),
00045                 m_enableSatConvex(false)
00046         {
00047
00048         }
00049         float   m_timeStep;
00050         int             m_stepCount;
00051         int             m_dispatchFunc;
00052         float   m_timeOfImpact;
00053         bool    m_useContinuous;
00054         class IDebugDraw*       m_debugDraw;
00055         bool    m_enableSatConvex;
00056
00057 };
00058
00061 class Dispatcher
00062 {
00063
00064
00065 public:
00066         virtual ~Dispatcher() ;
00067
00068         virtual CollisionAlgorithm* FindAlgorithm(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1) = 0;
00069
00070         //
00071         // asume dispatchers to have unique id's in the range [0..max dispacher]
00072         //
00073         virtual int GetUniqueId() = 0;
00074
00075         virtual PersistentManifold*     GetNewManifold(void* body0,void* body1)=0;
00076
00077         virtual void ReleaseManifold(PersistentManifold* manifold)=0;
00078
00079         virtual void ClearManifold(PersistentManifold* manifold)=0;
00080
00081         virtual bool    NeedsCollision(BroadphaseProxy& proxy0,BroadphaseProxy& proxy1) = 0;
00082
00083         virtual ManifoldResult* GetNewManifoldResult(CollisionObject* obj0,CollisionObject* obj1,PersistentManifold* manifold) =0;
00084
00085         virtual void    ReleaseManifoldResult(ManifoldResult*)=0;
00086
00087
00088 };
00089
00090
00091 #endif //_DISPATCHER_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyCollisionAlgorithm.cpp File Reference

Bullet » CollisionDispatch

EmptyCollisionAlgorithm.cpp File Reference

#include "EmptyCollisionAlgorithm.h"

Include dependency graph for EmptyCollisionAlgorithm.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyCollisionAlgorithm.cpp Source File

Bullet » CollisionDispatch

EmptyCollisionAlgorithm.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "EmptyCollisionAlgorithm.h"
00017
00018
00019
00020 EmptyAlgorithm::EmptyAlgorithm(const CollisionAlgorithmConstructionInfo& ci)
00021         : CollisionAlgorithm(ci)
00022 {
00023 }
00024
00025 void EmptyAlgorithm::ProcessCollision (BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo)
00026 {
00027
00028 }
00029
00030 float EmptyAlgorithm::CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo)
00031 {
00032         return 1.f;
00033 }
00034
00035
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyCollisionAlgorithm.h File Reference

Bullet » CollisionDispatch

EmptyCollisionAlgorithm.h File Reference

#include "BroadphaseCollision/CollisionAlgorithm.h"

Include dependency graph for EmptyCollisionAlgorithm.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | EmptyAlgorithm
EmptyAlgorithm is a stub for unsupported collision pairs. More...

Defines

#define | ATTRIBUTE_ALIGNED(a)

Variables

EmptyAlgorithm ATTRIBUTE_ALIGNED
EmptyAlgorithm is a stub for unsupported collision pairs.

Define Documentation

#define ATTRIBUTE_ALIGNED ( a )

Definition at line 20 of file EmptyCollisionAlgorithm.h.

Variable Documentation

EmptyAlgorithm ATTRIBUTE_ALIGNED

EmptyAlgorithm is a stub for unsupported collision pairs.

The dispatcher can dispatch a persistent EmptyAlgorithm to avoid a search every frame.

Generated on Wed May 24 13:59:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyCollisionAlgorithm.h Source File

Bullet » CollisionDispatch

EmptyCollisionAlgorithm.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef EMPTY_ALGORITH
00017 #define EMPTY_ALGORITH
00018 #include "BroadphaseCollision/CollisionAlgorithm.h"
00019
00020 #define ATTRIBUTE_ALIGNED(a)
00021
00024 class EmptyAlgorithm : public CollisionAlgorithm
00025 {
00026
00027 public:
00028
00029         EmptyAlgorithm(const CollisionAlgorithmConstructionInfo& ci);
00030
00031         virtual void ProcessCollision (BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo);
00032
00033         virtual float CalculateTimeOfImpact(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1,const DispatcherInfo& dispatchInfo);
00034
00035
00036
00037
00038 } ATTRIBUTE_ALIGNED(16);
00039
00040 #endif //EMPTY_ALGORITH
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyShape.cpp File Reference

Bullet » CollisionShapes

EmptyShape.cpp File Reference

#include "EmptyShape.h"
#include "CollisionShape.h"

Include dependency graph for EmptyShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:10 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyShape.cpp Source File

Bullet » CollisionShapes

EmptyShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "EmptyShape.h"
00017
00018
00019 #include "CollisionShape.h"
00020
00021
00022 EmptyShape::EmptyShape()
00023 {
00024 }
00025
00026
00027 EmptyShape::~EmptyShape()
00028 {
00029 }
00030
00031
00033 void EmptyShape::GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
00034 {
00035         SimdVector3 margin(GetMargin(),GetMargin(),GetMargin());
00036
00037         aabbMin = t.getOrigin() - margin;
00038
00039         aabbMax = t.getOrigin() + margin;
00040
00041 }
00042
00043 void    EmptyShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00044 {
00045         assert(0);
00046 }
00047
00048
00049
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyShape.h File Reference

Bullet » CollisionShapes

EmptyShape.h File Reference

#include "CollisionShape.h"
#include "SimdVector3.h"
#include "SimdTransform.h"
#include "SimdMatrix3x3.h"
#include <vector>
#include "CollisionShapes/CollisionMargin.h"

Include dependency graph for EmptyShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class EmptyShape
EmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime. More...

Generated on Wed May 24 13:59:10 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyShape.h Source File

Bullet » CollisionShapes

EmptyShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef EMPTY_SHAPE_H
00017 #define EMPTY_SHAPE_H
00018
00019 #include "CollisionShape.h"
00020
00021 #include "SimdVector3.h"
00022 #include "SimdTransform.h"
00023 #include "SimdMatrix3x3.h"
00024 #include <vector>
00025 #include "CollisionShapes/CollisionMargin.h"
00026
00027
00028
00029
00031 class EmptyShape        : public CollisionShape
00032 {
00033 public:
00034         EmptyShape();
00035
00036         virtual ~EmptyShape();
00037
00038
00040         void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
00041
00042
00043         virtual void    setLocalScaling(const SimdVector3& scaling)
00044         {
00045                 m_localScaling = scaling;
00046         }
00047         virtual const SimdVector3& getLocalScaling() const
00048         {
00049                 return m_localScaling;
00050         }
00051
00052         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00053
00054         virtual int     GetShapeType() const { return EMPTY_SHAPE_PROXYTYPE;}
00055
00056         virtual void    SetMargin(float margin)
00057         {
00058                 m_collisionMargin = margin;
00059         }
00060         virtual float   GetMargin() const
00061         {
00062                 return m_collisionMargin;
00063         }
00064         virtual char*   GetName()const
00065         {
00066                 return "Empty";
00067         }
00068
00069
00070 private:
00071         SimdScalar      m_collisionMargin;
00072 protected:
00073         SimdVector3     m_localScaling;
00074
00075 };
00076
00077
00078
00079 #endif //EMPTY_SHAPE_H
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Epa.cpp File Reference

Bullet » NarrowPhaseCollision

Epa.cpp File Reference

#include "SimdScalar.h"
#include "SimdVector3.h"
#include "SimdPoint3.h"
#include "SimdTransform.h"
#include "SimdMinMax.h"
#include "CollisionShapes/ConvexShape.h"
#include <vector>
#include <list>
#include <algorithm>
#include "NarrowPhaseCollision/SimplexSolverInterface.h"
#include "NarrowPhaseCollision/EpaCommon.h"
#include "NarrowPhaseCollision/EpaVertex.h"
#include "NarrowPhaseCollision/EpaHalfEdge.h"
#include "NarrowPhaseCollision/EpaFace.h"
#include "NarrowPhaseCollision/EpaPolyhedron.h"
#include "NarrowPhaseCollision/Epa.h"

Include dependency graph for Epa.cpp:

Go to the source code of this file.

Functions

bool | CompareEpaFaceEntries (EpaFace *pFaceA, EpaFace *pFaceB)

Variables

const SimdScalar | EPA_MAX_RELATIVE_ERROR = 1e-2f
const SimdScalar | EPA_MAX_RELATIVE_ERROR_SQRD = EPA_MAX_RELATIVE_ERROR * EPA_MAX_RELATIVE_ERROR

Function Documentation

bool CompareEpaFaceEntries | ( | EpaFace * | pFaceA,
 |  | EpaFace * | pFaceB
 | ) |

Definition at line 557 of file Epa.cpp.

References EpaFace::m_vSqrd.

Referenced by Epa::CalcPenDepth().

Variable Documentation

const SimdScalar EPA_MAX_RELATIVE_ERROR = 1e-2f

Definition at line 40 of file Epa.cpp.

const SimdScalar EPA_MAX_RELATIVE_ERROR_SQRD = EPA_MAX_RELATIVE_ERROR * EPA_MAX_RELATIVE_ERROR

Definition at line 41 of file Epa.cpp.

Generated on Wed May 24 13:59:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Epa.cpp Source File

Bullet » NarrowPhaseCollision

Epa.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017
00018 #include "SimdScalar.h"
00019 #include "SimdVector3.h"
00020 #include "SimdPoint3.h"
00021 #include "SimdTransform.h"
00022 #include "SimdMinMax.h"
00023
00024 #include "CollisionShapes/ConvexShape.h"
00025
00026 #include <vector>
00027 #include <list>
00028 #include <algorithm>
00029
00030 #include "NarrowPhaseCollision/SimplexSolverInterface.h"
00031
00032 #include "NarrowPhaseCollision/EpaCommon.h"
00033
00034 #include "NarrowPhaseCollision/EpaVertex.h"
00035 #include "NarrowPhaseCollision/EpaHalfEdge.h"
00036 #include "NarrowPhaseCollision/EpaFace.h"
00037 #include "NarrowPhaseCollision/EpaPolyhedron.h"
00038 #include "NarrowPhaseCollision/Epa.h"
00039
00040 const SimdScalar EPA_MAX_RELATIVE_ERROR = 1e-2f;
00041 const SimdScalar EPA_MAX_RELATIVE_ERROR_SQRD = EPA_MAX_RELATIVE_ERROR * EPA_MAX_RELATIVE_ERROR;
00042
00043 Epa::Epa( ConvexShape* pConvexShapeA, ConvexShape* pConvexShapeB,
00044                   const SimdTransform& transformA, const SimdTransform& transformB ) : m_pConvexShapeA( pConvexShapeA ),
00045                                                                                                                                                            m_pConvexShapeB( pConvexShapeB ),
00046                                                                                                                                                            m_transformA( transformA ),
00047                                                                                                                                                            m_transformB( transformB )
00048 {
00049         m_faceEntries.reserve( EPA_MAX_FACE_ENTRIES );
00050 }
00051
00052 Epa::~Epa()
00053 {
00054 }
00055
00056 bool Epa::Initialize( SimplexSolverInterface& simplexSolver )
00057 {
00058         // Run GJK on the enlarged shapes to obtain a simplex of the enlarged CSO
00059
00060         SimdVector3 v( 1, 0, 0 );
00061         SimdScalar squaredDistance = SIMD_INFINITY;
00062
00063         SimdScalar delta = 0.f;
00064
00065         simplexSolver.reset();
00066
00067         int nbIterations = 0;
00068
00069         while ( true )
00070         {
00071                 assert( ( v.length2() > 0 ) && "Warning : v has zero magnitude!" );
00072
00073                 SimdVector3 seperatingAxisInA = -v * m_transformA.getBasis();
00074                 SimdVector3 seperatingAxisInB =  v * m_transformB.getBasis();
00075
00076                 SimdVector3 pInA = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00077                 SimdVector3 qInB = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00078
00079                 SimdPoint3  pWorld = m_transformA( pInA );
00080                 SimdPoint3  qWorld = m_transformB( qInB );
00081
00082                 SimdVector3 w = pWorld - qWorld;
00083                 delta = v.dot( w );
00084
00085                 assert( ( delta <= 0 ) && "Shapes are disjoint, EPA should have never    been called!" );
00086                 assert( !simplexSolver.inSimplex( w ) && "Shapes are disjoint, EPA should have never been called!" );
00087
00088                 // Add support point to simplex
00089                 simplexSolver.addVertex( w, pWorld, qWorld );
00090
00091                 bool closestOk = simplexSolver.closest( v );
00092                 assert( closestOk && "Shapes are disjoint, EPA should have never been called!" );
00093
00094                 SimdScalar prevVSqrd = squaredDistance;
00095                 squaredDistance = v.length2();
00096
00097                 // Is v converging to v(A-B) ?
00098                 assert( ( ( prevVSqrd - squaredDistance ) > SIMD_EPSILON * prevVSqrd ) &&
00099                                 "Shapes are disjoint, EPA should have never been called!" );
00100
00101                 if ( simplexSolver.fullSimplex() || ( squaredDistance <= SIMD_EPSILON * simplexSolver.maxVertex() ) )
00102                 {
00103                         break;
00104                 }
00105
00106                 ++nbIterations;
00107         }
00108
00109         SimdPoint3 simplexPoints[ 5 ];
00110         SimdPoint3 wSupportPointsOnA[ 5 ];
00111         SimdPoint3 wSupportPointsOnB[ 5 ];
00112
00113         int nbSimplexPoints = simplexSolver.getSimplex( wSupportPointsOnA, wSupportPointsOnB, simplexPoints );
00114
00115         // nbSimplexPoints can't be one because cases where the origin is on the boundary are handled
00116         // by hybrid penetration depth
00117         assert( ( ( nbSimplexPoints > 1 ) && ( nbSimplexPoints <= 4 ) ) &&
00118                     "Hybrid Penetration Depth algorithm failed!" );
00119
00120         int nbPolyhedronPoints = nbSimplexPoints;
00121
00122 #ifndef EPA_POLYHEDRON_USE_PLANES
00123         int initTetraIndices[ 4 ] = { 0, 1, 2, 3 };
00124 #endif
00125
00126         //      Prepare initial polyhedron to start EPA from
00127         if ( nbSimplexPoints == 1 )
00128         {
00129                 return false;
00130         }
00131         else if ( nbSimplexPoints == 2 )
00132         {
00133                 // We have a line segment inside the CSO that contains the origin
00134                 // Create an hexahedron ( two tetrahedron glued together ) by adding 3 new points
00135
00136                 SimdVector3 d = simplexPoints[ 0 ] - simplexPoints[ 1 ];
00137                 d.normalize();
00138
00139                 SimdVector3 v1;
00140                 SimdVector3 v2;
00141                 SimdVector3 v3;
00142
00143                 SimdVector3 e1;
00144
00145                 SimdScalar absx = abs( d.getX() );
00146                 SimdScalar absy = abs( d.getY() );
00147                 SimdScalar absz = abs( d.getZ() );
00148
00149                 if ( absx < absy )
00150                 {
00151                         if ( absx < absz )
00152                         {
00153                                 e1.setX( 1 );
00154                         }
00155                         else
00156                         {
00157                                 e1.setZ( 1 );
00158                         }
00159                 }
00160                 else
00161                 {
00162                         if ( absy < absz )
00163                         {
00164                                 e1.setY( 1 );
00165                         }
00166                         else
00167                         {
00168                                 e1.setZ( 1 );
00169                         }
00170                 }
00171
00172                 v1 = d.cross( e1 );
00173                 v1.normalize();
00174
00175                 v2 = v1.rotate( d, 120 * SIMD_RADS_PER_DEG );
00176                 v3 = v2.rotate( d, 120 * SIMD_RADS_PER_DEG );
00177
00178                 nbPolyhedronPoints = 5;
00179
00180                 SimdVector3 seperatingAxisInA =  v1 * m_transformA.getBasis();
00181                 SimdVector3 seperatingAxisInB = -v1 * m_transformB.getBasis();
00182
00183                 SimdVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00184                 SimdVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00185
00186                 SimdPoint3 pWorld = m_transformA( p );
00187                 SimdPoint3 qWorld = m_transformB( q );
00188
00189                 wSupportPointsOnA[ 2 ] = pWorld;
00190                 wSupportPointsOnB[ 2 ] = qWorld;
00191                 simplexPoints[ 2 ]         = wSupportPointsOnA[ 2 ] - wSupportPointsOnB[ 2 ];
00192
00193                 seperatingAxisInA =  v2 * m_transformA.getBasis();
00194                 seperatingAxisInB = -v2 * m_transformB.getBasis();
00195
00196                 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00197                 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00198
00199                 pWorld = m_transformA( p );
00200                 qWorld = m_transformB( q );
00201
00202                 wSupportPointsOnA[ 3 ] = pWorld;
00203                 wSupportPointsOnB[ 3 ] = qWorld;
00204                 simplexPoints[ 3 ]         = wSupportPointsOnA[ 3 ] - wSupportPointsOnB[ 3 ];
00205
00206                 seperatingAxisInA =  v3 * m_transformA.getBasis();
00207                 seperatingAxisInB = -v3 * m_transformB.getBasis();
00208
00209                 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00210                 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00211
00212                 pWorld = m_transformA( p );
00213                 qWorld = m_transformB( q );
00214
00215                 wSupportPointsOnA[ 4 ] = pWorld;
00216                 wSupportPointsOnB[ 4 ] = qWorld;
00217                 simplexPoints[ 4 ]         = wSupportPointsOnA[ 4 ] - wSupportPointsOnB[ 4 ];
00218
00219 #ifndef EPA_POLYHEDRON_USE_PLANES
00220                 if ( TetrahedronContainsOrigin( simplexPoints[ 0 ], simplexPoints[ 2 ], simplexPoints[ 3 ], simplexPoints[ 4 ] ) )
00221                 {
00222                         initTetraIndices[ 1 ] = 2;
00223                         initTetraIndices[ 2 ] = 3;
00224                         initTetraIndices[ 3 ] = 4;
00225                 }
00226                 else
00227                 {
00228                         if ( TetrahedronContainsOrigin( simplexPoints[ 1 ], simplexPoints[ 2 ], simplexPoints[ 3 ], simplexPoints[ 4 ] ) )
00229                         {
00230                                 initTetraIndices[ 0 ] = 1;
00231                                 initTetraIndices[ 1 ] = 2;
00232                                 initTetraIndices[ 2 ] = 3;
00233                                 initTetraIndices[ 3 ] = 4;
00234                         }
00235                         else
00236                         {
00237                                 // No tetrahedron contains the origin
00238                                 assert( false && "Unable to find an initial tetrahedron that contains the origin!" );
00239                                 return false;
00240                         }
00241                 }
00242 #endif
00243         }
00244         else if ( nbSimplexPoints == 3 )
00245         {
00246                 // We have a triangle inside the CSO that contains the origin
00247                 // Create an hexahedron ( two tetrahedron glued together ) by adding 2 new points
00248
00249                 SimdVector3 v0 = simplexPoints[ 2 ] - simplexPoints[ 0 ];
00250                 SimdVector3 v1 = simplexPoints[ 1 ] - simplexPoints[ 0 ];
00251                 SimdVector3 triangleNormal = v0.cross( v1 );
00252                 triangleNormal.normalize();
00253
00254                 nbPolyhedronPoints = 5;
00255
00256                 SimdVector3 seperatingAxisInA =  triangleNormal * m_transformA.getBasis();
00257                 SimdVector3 seperatingAxisInB = -triangleNormal * m_transformB.getBasis();
00258
00259                 SimdVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00260                 SimdVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00261
00262                 SimdPoint3 pWorld = m_transformA( p );
00263                 SimdPoint3 qWorld = m_transformB( q );
00264
00265                 wSupportPointsOnA[ 3 ] = pWorld;
00266                 wSupportPointsOnB[ 3 ] = qWorld;
00267                 simplexPoints[ 3 ]         = wSupportPointsOnA[ 3 ] - wSupportPointsOnB[ 3 ];
00268
00269 #ifndef EPA_POLYHEDRON_USE_PLANES
00270                 // We place this check here because if the tetrahedron contains the origin
00271                 // there is no need to sample another support point
00272                 if ( !TetrahedronContainsOrigin( simplexPoints[ 0 ], simplexPoints[ 1 ], simplexPoints[ 2 ], simplexPoints[ 3 ] ) )
00273                 {
00274 #endif
00275                         seperatingAxisInA = -triangleNormal * m_transformA.getBasis();
00276                         seperatingAxisInB =  triangleNormal * m_transformB.getBasis();
00277
00278                         p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00279                         q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00280
00281                         pWorld = m_transformA( p );
00282                         qWorld = m_transformB( q );
00283
00284                         wSupportPointsOnA[ 4 ] = pWorld;
00285                         wSupportPointsOnB[ 4 ] = qWorld;
00286                         simplexPoints[ 4 ]         = wSupportPointsOnA[ 4 ] - wSupportPointsOnB[ 4 ];
00287
00288 #ifndef EPA_POLYHEDRON_USE_PLANES
00289                         if ( TetrahedronContainsOrigin( simplexPoints[ 0 ], simplexPoints[ 1 ], simplexPoints[ 2 ], simplexPoints[ 4 ] ) )
00290                         {
00291                                 initTetraIndices[ 3 ] = 4;
00292                         }
00293                         else
00294                         {
00295                                 // No tetrahedron contains the origin
00296                                 assert( false && "Unable to find an initial tetrahedron that contains the origin!" );
00297                                 return false;
00298                         }
00299                 }
00300 #endif
00301         }
00302 #ifdef _DEBUG
00303         else if ( nbSimplexPoints == 4 )
00304         {
00305                 assert( TetrahedronContainsOrigin( simplexPoints ) && "Initial tetrahedron does not contain the origin!" );
00306         }
00307 #endif
00308
00309 #ifndef EPA_POLYHEDRON_USE_PLANES
00310         SimdPoint3 wTetraPoints[ 4 ] = { simplexPoints[ initTetraIndices[ 0 ] ],
00311                                                                          simplexPoints[ initTetraIndices[ 1 ] ],
00312                                                                          simplexPoints[ initTetraIndices[ 2 ] ],
00313                                                                          simplexPoints[ initTetraIndices[ 3 ] ] };
00314
00315         SimdPoint3 wTetraSupportPointsOnA[ 4 ] = { wSupportPointsOnA[ initTetraIndices[ 0 ] ],
00316                                                                                            wSupportPointsOnA[ initTetraIndices[ 1 ] ],
00317                                                                                            wSupportPointsOnA[ initTetraIndices[ 2 ] ],
00318                                                                                            wSupportPointsOnA[ initTetraIndices[ 3 ] ] };
00319
00320         SimdPoint3 wTetraSupportPointsOnB[ 4 ] = { wSupportPointsOnB[ initTetraIndices[ 0 ] ],
00321                                                                                            wSupportPointsOnB[ initTetraIndices[ 1 ] ],
00322                                                                                            wSupportPointsOnB[ initTetraIndices[ 2 ] ],
00323                                                                                            wSupportPointsOnB[ initTetraIndices[ 3 ] ] };
00324 #endif
00325
00326 #ifdef EPA_POLYHEDRON_USE_PLANES
00327         if ( !m_polyhedron.Create( simplexPoints, wSupportPointsOnA, wSupportPointsOnB, nbPolyhedronPoints ) )
00328 #else
00329         if ( !m_polyhedron.Create( wTetraPoints, wTetraSupportPointsOnA, wTetraSupportPointsOnB, 4 ) )
00330 #endif
00331         {
00332                 // Failed to create initial polyhedron
00333                 assert( false && "Failed to create initial polyhedron!" );
00334                 return false;
00335         }
00336
00337         // Add initial faces to priority queue
00338
00339 #ifdef _DEBUG
00340         //m_polyhedron._dbgSaveToFile( "epa_start.dbg" );
00341 #endif
00342
00343         std::list< EpaFace* >& faces = m_polyhedron.GetFaces();
00344
00345         std::list< EpaFace* >::iterator facesItr( faces.begin() );
00346
00347         while ( facesItr != faces.end() )
00348         {
00349                 EpaFace* pFace = *facesItr;
00350
00351                 if ( !pFace->m_deleted )
00352                 {
00353 //#ifdef EPA_POLYHEDRON_USE_PLANES
00354 //                      if ( pFace->m_planeDistance >= 0 )
00355 //                      {
00356 //                              m_polyhedron._dbgSaveToFile( "epa_start.dbg" );
00357 //                              assert( false && "Face's plane distance equal or greater than 0!" );
00358 //                      }
00359 //#endif
00360
00361                         if ( pFace->IsAffinelyDependent() )
00362                         {
00363                                 assert( false && "One initial face is affinely dependent!" );
00364                                 return false;
00365                         }
00366
00367                         if ( pFace->m_vSqrd <= 0 )
00368                         {
00369                                 assert( false && "Face containing the origin!" );
00370                                 return false;
00371                         }
00372
00373                         if ( pFace->IsClosestPointInternal() )
00374                         {
00375                                 m_faceEntries.push_back( pFace );
00376                                 std::push_heap( m_faceEntries.begin(), m_faceEntries.end(), CompareEpaFaceEntries );
00377                         }
00378                 }
00379
00380                 ++facesItr;
00381         }
00382
00383 #ifdef _DEBUG
00384         //m_polyhedron._dbgSaveToFile( "epa_start.dbg" );
00385 #endif
00386
00387         assert( !m_faceEntries.empty() && "No faces added to heap!" );
00388
00389         return true;
00390 }
00391
00392 SimdScalar Epa::CalcPenDepth( SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB )
00393 {
00394         SimdVector3 v;
00395
00396         SimdScalar upperBoundSqrd = SIMD_INFINITY;
00397         SimdScalar vSqrd = 0;
00398 #ifdef _DEBUG
00399         SimdScalar prevVSqrd;
00400 #endif
00401         SimdScalar delta;
00402
00403         bool isCloseEnough = false;
00404
00405         EpaFace* pEpaFace = NULL;
00406
00407         int nbIterations = 0;
00408         //int nbMaxIterations = 1000;
00409
00410         do
00411         {
00412                 pEpaFace = m_faceEntries.front();
00413                 std::pop_heap( m_faceEntries.begin(), m_faceEntries.end(), CompareEpaFaceEntries );
00414                 m_faceEntries.pop_back();
00415
00416                 if ( !pEpaFace->m_deleted )
00417                 {
00418 #ifdef _DEBUG
00419                         prevVSqrd = vSqrd;
00420 #endif
00421
00422                         vSqrd = pEpaFace->m_vSqrd;
00423
00424                         if ( pEpaFace->m_planeDistance >= 0 )
00425                         {
00426                                 v = pEpaFace->m_planeNormal;
00427                         }
00428                         else
00429                         {
00430                                 v = pEpaFace->m_v;
00431                         }
00432
00433 #ifdef _DEBUG
00434                         //assert_msg( vSqrd <= upperBoundSqrd, "A triangle was falsely rejected!" );
00435                         assert( ( vSqrd >= prevVSqrd ) && "vSqrd decreased!" );
00436 #endif //_DEBUG
00437                         assert( ( v.length2() > 0 ) && "Zero vector not allowed!" );
00438
00439                         SimdVector3 seperatingAxisInA =  v * m_transformA.getBasis();
00440                         SimdVector3 seperatingAxisInB = -v * m_transformB.getBasis();
00441
00442                         SimdVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
00443                         SimdVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
00444
00445                         SimdPoint3 pWorld = m_transformA( p );
00446                         SimdPoint3 qWorld = m_transformB( q );
00447
00448                         SimdPoint3 w = pWorld - qWorld;
00449                         delta = v.dot( w );
00450
00451                         // Keep tighest upper bound
00452                         upperBoundSqrd = SimdMin( upperBoundSqrd, delta * delta / vSqrd );
00453                         //assert_msg( vSqrd <= upperBoundSqrd, "A triangle was falsely rejected!" );
00454
00455                         isCloseEnough = ( upperBoundSqrd <= ( 1 + 1e-4f ) * vSqrd );
00456
00457                         if ( !isCloseEnough )
00458                         {
00459                                 std::list< EpaFace* > newFaces;
00460                                 bool expandOk = m_polyhedron.Expand( w, pWorld, qWorld, pEpaFace, newFaces );
00461
00462                                 if ( expandOk )
00463                                 {
00464                                         assert( !newFaces.empty() && "EPA polyhedron not expanding ?" );
00465
00466                                         bool check    = true;
00467                                         bool areEqual = false;
00468
00469                                         while ( !newFaces.empty() )
00470                                         {
00471                                                 EpaFace* pNewFace = newFaces.front();
00472                                                 assert( !pNewFace->m_deleted && "New face is deleted!" );
00473
00474                                                 if ( !pNewFace->m_deleted )
00475                                                 {
00476                                                         assert( ( pNewFace->m_vSqrd > 0 ) && "Face containing the origin!" );
00477                                                         assert( !pNewFace->IsAffinelyDependent() && "Face is affinely dependent!" );
00478
00479 //#ifdef EPA_POLYHEDRON_USE_PLANES
00482 //                                                              // assert( false && "Face's plane distance greater than 0!" );
00483 //#ifdef _DEBUG
00485 //#endif
00486 //                                                              //pNewFace->FixOrder();
00487 //#ifdef _DEBUG
00488 //                                                              //m_polyhedron._dbgSaveToFile( "epa_afterFix.dbg" );
00489 //#endif
00491 //#endif
00492 //
00493 //#ifdef EPA_POLYHEDRON_USE_PLANES
00494 //                                                      //assert( ( pNewFace->m_planeDistance < 0 ) && "Face's plane distance equal or greater than 0!" );
00495 //#endif
00496
00497                                                         if ( pNewFace->IsClosestPointInternal() && ( vSqrd <= pNewFace->m_vSqrd ) && ( pNewFace->m_vSqrd <= upperBoundSqrd ) )
00498                                                         {
00499                                                                 m_faceEntries.push_back( pNewFace );
00500                                                                 std::push_heap( m_faceEntries.begin(), m_faceEntries.end(), CompareEpaFaceEntries );
00501                                                         }
00502                                                 }
00503
00504                                                 newFaces.pop_front();
00505                                         }
00506                                 }
00507                                 else
00508                                 {
00509                                         pEpaFace->CalcClosestPointOnA( wWitnessOnA );
00510                                         pEpaFace->CalcClosestPointOnB( wWitnessOnB );
00511
00512 #ifdef _DEBUG
00513                                         //m_polyhedron._dbgSaveToFile( "epa_end.dbg" );
00514 #endif
00515
00516                                         return v.length();
00517                                 }
00518                         }
00519                 }
00520
00521                 ++nbIterations;
00522         }
00523         while ( ( m_polyhedron.GetNbFaces() < EPA_MAX_FACE_ENTRIES ) &&/*( nbIterations < nbMaxIterations ) &&*/
00524                         !isCloseEnough && ( m_faceEntries.size() > 0 ) && ( m_faceEntries[ 0 ]->m_vSqrd <= upperBoundSqrd ) );
00525
00526 #ifdef _DEBUG
00527         //m_polyhedron._dbgSaveToFile( "epa_end.dbg" );
00528 #endif
00529
00530         assert( pEpaFace && "Invalid epa face!" );
00531
00532         pEpaFace->CalcClosestPointOnA( wWitnessOnA );
00533         pEpaFace->CalcClosestPointOnB( wWitnessOnB );
00534
00535         return v.length();
00536 }
00537
00538 bool Epa::TetrahedronContainsOrigin( const SimdPoint3& point0, const SimdPoint3& point1,
00539                                                                          const SimdPoint3& point2, const SimdPoint3& point3 )
00540 {
00541         SimdVector3 facesNormals[ 4 ] = { ( point1 - point0 ).cross( point2 - point0 ),
00542                                                                           ( point2 - point1 ).cross( point3 - point1 ),
00543                                                                           ( point3 - point2 ).cross( point0 - point2 ),
00544                                                                           ( point0 - point3 ).cross( point1 - point3 ) };
00545
00546         return ( ( facesNormals[ 0 ].dot( point0 ) > 0 ) != ( facesNormals[ 0 ].dot( point3 ) > 0 ) ) &&
00547                    ( ( facesNormals[ 1 ].dot( point1 ) > 0 ) != ( facesNormals[ 1 ].dot( point0 ) > 0 ) ) &&
00548                    ( ( facesNormals[ 2 ].dot( point2 ) > 0 ) != ( facesNormals[ 2 ].dot( point1 ) > 0 ) ) &&
00549                    ( ( facesNormals[ 3 ].dot( point3 ) > 0 ) != ( facesNormals[ 3 ].dot( point2 ) > 0 ) );
00550 }
00551
00552 bool Epa::TetrahedronContainsOrigin( SimdPoint3* pPoints )
00553 {
00554         return TetrahedronContainsOrigin( pPoints[ 0 ], pPoints[ 1 ], pPoints[ 2 ], pPoints[ 3 ] );
00555 }
00556
00557 bool CompareEpaFaceEntries( EpaFace* pFaceA, EpaFace* pFaceB )
00558 {
00559         return ( pFaceA->m_vSqrd > pFaceB->m_vSqrd );
00560 }
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Epa.h File Reference

Bullet » NarrowPhaseCollision

Epa.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | Epa

Defines

#define | EPA_MAX_FACE_ENTRIES 256

Functions

bool | CompareEpaFaceEntries (EpaFace *pFaceA, EpaFace *pFaceB)

Variables

const SimdScalar | EPA_MAX_RELATIVE_ERROR
const SimdScalar | EPA_MAX_RELATIVE_ERROR_SQRD

Define Documentation

#define EPA_MAX_FACE_ENTRIES 256

Definition at line 20 of file Epa.h.

Referenced by Epa::CalcPenDepth(), and Epa::Epa().

Function Documentation

bool CompareEpaFaceEntries | ( | EpaFace * | pFaceA,
 |  | EpaFace * | pFaceB
 | ) |

Definition at line 557 of file Epa.cpp.

References EpaFace::m_vSqrd.

Referenced by Epa::CalcPenDepth().

Variable Documentation

const SimdScalar EPA_MAX_RELATIVE_ERROR

Definition at line 40 of file Epa.cpp.

const SimdScalar EPA_MAX_RELATIVE_ERROR_SQRD

Definition at line 41 of file Epa.cpp.

Generated on Wed May 24 13:59:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Epa.h Source File

Bullet » NarrowPhaseCollision

Epa.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_H
00018 #define EPA_H
00019
00020 #define EPA_MAX_FACE_ENTRIES 256
00021
00022 extern const SimdScalar EPA_MAX_RELATIVE_ERROR;
00023 extern const SimdScalar EPA_MAX_RELATIVE_ERROR_SQRD;
00024
00025 class Epa
00026 {
00027         private :
00028
00030                 Epa( const Epa& epa );
00031                 const Epa&                      operator = ( const Epa& epa );
00032
00033         public :
00034
00035                 Epa( ConvexShape* pConvexShapeA, ConvexShape* pConvexShapeB,
00036                          const SimdTransform& transformA, const SimdTransform& transformB );
00037                 ~Epa();
00038
00039                 bool                            Initialize( SimplexSolverInterface& simplexSolver );
00040
00041                 SimdScalar                      CalcPenDepth( SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB );
00042
00043         private :
00044
00045                 bool                            TetrahedronContainsOrigin( SimdPoint3* pPoints );
00046                 bool                            TetrahedronContainsOrigin( const SimdPoint3& point0, const SimdPoint3& point1,
00047                                                                                                            const SimdPoint3& point2, const SimdPoint3& point3 );
00048
00049         private :
00050
00052                 std::vector< EpaFace* > m_faceEntries;
00053
00054                 ConvexShape*                    m_pConvexShapeA;
00055                 ConvexShape*                    m_pConvexShapeB;
00056
00057                 SimdTransform                   m_transformA;
00058                 SimdTransform                   m_transformB;
00059
00060                 EpaPolyhedron                   m_polyhedron;
00061 };
00062
00063 extern bool CompareEpaFaceEntries( EpaFace* pFaceA, EpaFace* pFaceB );
00064
00065 #endif
00066
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaCommon.h File Reference

Bullet » NarrowPhaseCollision

EpaCommon.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define EPA_POLYHEDRON_USE_PLANES

Define Documentation

#define EPA_POLYHEDRON_USE_PLANES

Definition at line 20 of file EpaCommon.h.

Generated on Wed May 24 13:59:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaCommon.h Source File

Bullet » NarrowPhaseCollision

EpaCommon.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_COMMON_H
00018 #define EPA_COMMON_H
00019
00020 #define EPA_POLYHEDRON_USE_PLANES
00021
00022 //#define EPA_USE_HYBRID
00023
00024 #endif
00025
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaFace.cpp File Reference

Bullet » NarrowPhaseCollision

EpaFace.cpp File Reference

#include "SimdScalar.h"
#include "SimdVector3.h"
#include "SimdPoint3.h"
#include "NarrowPhaseCollision/EpaCommon.h"
#include "NarrowPhaseCollision/EpaVertex.h"
#include "NarrowPhaseCollision/EpaHalfEdge.h"
#include "NarrowPhaseCollision/EpaFace.h"

Include dependency graph for EpaFace.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaFace.cpp Source File

Bullet » NarrowPhaseCollision

EpaFace.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #include "SimdScalar.h"
00018 #include "SimdVector3.h"
00019 #include "SimdPoint3.h"
00020
00021 #include "NarrowPhaseCollision/EpaCommon.h"
00022
00023 #include "NarrowPhaseCollision/EpaVertex.h"
00024 #include "NarrowPhaseCollision/EpaHalfEdge.h"
00025 #include "NarrowPhaseCollision/EpaFace.h"
00026
00027 #ifdef EPA_POLYHEDRON_USE_PLANES
00028 SimdScalar PLANE_THICKNESS = 1e-5f;
00029 #endif
00030
00031 EpaFace::EpaFace() : m_pHalfEdge( 0 ), m_deleted( false )
00032 {
00033         m_pVertices[ 0 ] = m_pVertices[ 1 ] = m_pVertices[ 2 ] = 0;
00034 }
00035
00036 EpaFace::~EpaFace()
00037 {
00038 }
00039
00040 bool EpaFace::Initialize()
00041 {
00042         assert( m_pHalfEdge && "Must setup half-edge first!" );
00043
00044         CollectVertices( m_pVertices );
00045
00046         const SimdVector3 e0 = m_pVertices[ 1 ]->m_point - m_pVertices[ 0 ]->m_point;
00047         const SimdVector3 e1 = m_pVertices[ 2 ]->m_point - m_pVertices[ 0 ]->m_point;
00048
00049         const SimdScalar e0Sqrd = e0.length2();
00050         const SimdScalar e1Sqrd = e1.length2();
00051         const SimdScalar e0e1   = e0.dot( e1 );
00052
00053         m_determinant = e0Sqrd * e1Sqrd - e0e1 * e0e1;
00054
00055         const SimdScalar e0v0 = e0.dot( m_pVertices[ 0 ]->m_point );
00056         const SimdScalar e1v0 = e1.dot( m_pVertices[ 0 ]->m_point );
00057
00058         m_lambdas[ 0 ] = e0e1 * e1v0 - e1Sqrd * e0v0;
00059         m_lambdas[ 1 ] = e0e1 * e0v0 - e0Sqrd * e1v0;
00060
00061         if ( IsAffinelyDependent() )
00062         {
00063                 return false;
00064         }
00065
00066         CalcClosestPoint();
00067
00068 #ifdef EPA_POLYHEDRON_USE_PLANES
00069         if ( !CalculatePlane() )
00070         {
00071                 return false;
00072         }
00073 #endif
00074
00075         return true;
00076 }
00077
00078 #ifdef EPA_POLYHEDRON_USE_PLANES
00079 bool EpaFace::CalculatePlane()
00080 {
00081         assert( ( m_pVertices[ 0 ] && m_pVertices[ 1 ] && m_pVertices[ 2 ] )
00082                         && "Must setup vertices pointers first!" );
00083
00084         // Traditional method
00085
00086         const SimdVector3 v1 = m_pVertices[ 1 ]->m_point - m_pVertices[ 0 ]->m_point;
00087         const SimdVector3 v2 = m_pVertices[ 2 ]->m_point - m_pVertices[ 0 ]->m_point;
00088
00089         m_planeNormal = v2.cross( v1 );
00090
00091         if ( m_planeNormal.length2() == 0 )
00092         {
00093                 return false;
00094         }
00095
00096         m_planeNormal.normalize();
00097
00098         m_planeDistance = m_pVertices[ 0 ]->m_point.dot( -m_planeNormal );
00099
00100         // Robust method
00101
00102         //SimdVector3 _v1 = m_pVertices[ 1 ]->m_point - m_pVertices[ 0 ]->m_point;
00103         //SimdVector3 _v2 = m_pVertices[ 2 ]->m_point - m_pVertices[ 0 ]->m_point;
00104
00105         //SimdVector3 n;
00106
00107         //n = _v2.cross( _v1 );
00108
00109         //_v1 = m_pVertices[ 0 ]->m_point - m_pVertices[ 1 ]->m_point;
00110         //_v2 = m_pVertices[ 2 ]->m_point - m_pVertices[ 1 ]->m_point;
00111
00112         //n += ( _v1.cross( _v2 ) );
00113
00114         //_v1 = m_pVertices[ 0 ]->m_point - m_pVertices[ 2 ]->m_point;
00115         //_v2 = m_pVertices[ 1 ]->m_point - m_pVertices[ 2 ]->m_point;
00116
00117         //n += ( _v2.cross( _v1 ) );
00118
00119         //n /= 3;
00120         //n.normalize();
00121
00122         //SimdVector3 c = ( m_pVertices[ 0 ]->m_point + m_pVertices[ 1 ]->m_point + m_pVertices[ 2 ]->m_point ) / 3;
00123         //SimdScalar d  = c.dot( -n );
00124
00125         //m_robustPlaneNormal   = n;
00126         //m_robustPlaneDistance = d;
00127
00128         // Compare results from both methods and check whether they disagree
00129
00130         //if ( d < 0 )
00131         //{
00132         //      assert( ( m_planeDistance < 0 ) && "He he! Busted!" );
00133         //}
00134         //else
00135         //{
00136         //      assert( ( m_planeDistance >= 0 ) && "He he! Busted!" );
00137         //}
00138
00139         return true;
00140 }
00141 #endif
00142
00143 void EpaFace::CalcClosestPoint()
00144 {
00145         const SimdVector3 e0 = m_pVertices[ 1 ]->m_point - m_pVertices[ 0 ]->m_point;
00146         const SimdVector3 e1 = m_pVertices[ 2 ]->m_point - m_pVertices[ 0 ]->m_point;
00147
00148         m_v =  m_pVertices[ 0 ]->m_point +
00149                  ( e0 * m_lambdas[ 0 ] + e1 * m_lambdas[ 1 ] ) / m_determinant;
00150
00151         m_vSqrd = m_v.length2();
00152 }
00153
00154 void EpaFace::CalcClosestPointOnA( SimdVector3& closestPointOnA )
00155 {
00156         const SimdVector3 e0 = m_pVertices[ 1 ]->m_wSupportPointOnA - m_pVertices[ 0 ]->m_wSupportPointOnA;
00157         const SimdVector3 e1 = m_pVertices[ 2 ]->m_wSupportPointOnA - m_pVertices[ 0 ]->m_wSupportPointOnA;
00158
00159         closestPointOnA =  m_pVertices[ 0 ]->m_wSupportPointOnA +
00160                                          ( e0 * m_lambdas[ 0 ] + e1 * m_lambdas[ 1 ] ) /
00161                                            m_determinant;
00162 }
00163
00164 void EpaFace::CalcClosestPointOnB( SimdVector3& closestPointOnB )
00165 {
00166         const SimdVector3 e0 = m_pVertices[ 1 ]->m_wSupportPointOnB - m_pVertices[ 0 ]->m_wSupportPointOnB;
00167         const SimdVector3 e1 = m_pVertices[ 2 ]->m_wSupportPointOnB - m_pVertices[ 0 ]->m_wSupportPointOnB;
00168
00169         closestPointOnB =  m_pVertices[ 0 ]->m_wSupportPointOnB +
00170                                          ( e0 * m_lambdas[  0 ] + e1 * m_lambdas[ 1 ] ) /
00171                                            m_determinant;
00172 }
00173
00174 bool EpaFace::IsAffinelyDependent() const
00175 {
00176         return ( m_determinant <= SIMD_EPSILON );
00177 }
00178
00179 bool EpaFace::IsClosestPointInternal() const
00180 {
00181         return ( ( m_lambdas[ 0 ] >= 0 ) && ( m_lambdas[ 1 ] >= 0 ) && ( ( m_lambdas[ 0 ] + m_lambdas[ 1 ] <= m_determinant ) ) );
00182 }
00183
00184 void EpaFace::CollectVertices( EpaVertex** ppVertices )
00185 {
00186         assert( m_pHalfEdge && "Invalid half-edge pointer!" );
00187
00188         int vertexIndex = 0;
00189
00190         EpaHalfEdge* pCurrentHalfEdge = m_pHalfEdge;
00191
00192         do
00193         {
00194                 assert( ( ( vertexIndex >= 0 ) && ( vertexIndex < 3 ) ) &&
00195                                 "Face is not a triangle!" );
00196
00197                 assert( pCurrentHalfEdge->m_pVertex && "Half-edge has an invalid vertex pointer!" );
00198
00199                 ppVertices[ vertexIndex++ ] = pCurrentHalfEdge->m_pVertex;
00200
00201                 pCurrentHalfEdge = pCurrentHalfEdge->m_pNextCCW;
00202
00203         }
00204         while( pCurrentHalfEdge != m_pHalfEdge );
00205 }
00206
00207 //void EpaFace::FixOrder()
00208 //{
00209 //      EpaHalfEdge* pHalfEdges[ 3 ];
00210 //
00211 //      int halfEdgeIndex = 0;
00212 //
00213 //      EpaHalfEdge* pCurrentHalfEdge = m_pHalfEdge;
00214 //
00215 //      do
00216 //      {
00217 //              assert( ( ( halfEdgeIndex >= 0 ) && ( halfEdgeIndex < 3 ) ) &&
00218 //                              "Face is not a triangle!" );
00219 //
00220 //              pHalfEdges[ halfEdgeIndex++ ] = pCurrentHalfEdge;
00221 //
00222 //              pCurrentHalfEdge = pCurrentHalfEdge->m_pNextCCW;
00223 //      }
00224 //      while( pCurrentHalfEdge != m_pHalfEdge );
00225 //
00226 //      EpaVertex* pVertices[ 3 ] = { pHalfEdges[ 0 ]->m_pVertex,
00227 //                                                                pHalfEdges[ 1 ]->m_pVertex,
00228 //                                                                pHalfEdges[ 2 ]->m_pVertex };
00229 //
00230 //      // Make them run in the opposite direction
00231 //      pHalfEdges[ 0 ]->m_pNextCCW = pHalfEdges[ 2 ];
00232 //      pHalfEdges[ 1 ]->m_pNextCCW = pHalfEdges[ 0 ];
00233 //      pHalfEdges[ 2 ]->m_pNextCCW = pHalfEdges[ 1 ];
00234 //
00235 //      // Make half-edges point to their correct origin vertices
00236 //
00237 //      pHalfEdges[ 1 ]->m_pVertex = pVertices[ 2 ];
00238 //      pHalfEdges[ 2 ]->m_pVertex = pVertices[ 0 ];
00239 //      pHalfEdges[ 0 ]->m_pVertex = pVertices[ 1 ];
00240 //
00241 //      // Make vertices point to the correct half-edges
00242 //
00243 //      //pHalfEdges[ 0 ]->m_pVertex->m_pHalfEdge = pHalfEdges[ 0 ];
00244 //      //pHalfEdges[ 1 ]->m_pVertex->m_pHalfEdge = pHalfEdges[ 1 ];
00245 //      //pHalfEdges[ 2 ]->m_pVertex->m_pHalfEdge = pHalfEdges[ 2 ];
00246 //
00247 //      // Flip normal and change the sign of plane distance
00248 //
00249 //#ifdef EPA_POLYHEDRON_USE_PLANES
00250 //      m_planeNormal   = -m_planeNormal;
00251 //      m_planeDistance = -m_planeDistance;
00252 //#endif
00253 //}
00254
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaFace.h File Reference

Bullet » NarrowPhaseCollision

EpaFace.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class EpaFace
Note : This class is not supposed to be a base class. More...

Generated on Wed May 24 13:59:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaFace.h Source File

Bullet » NarrowPhaseCollision

EpaFace.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_FACE_H
00018 #define EPA_FACE_H
00019
00020 class EpaVertex;
00021 class EpaHalfEdge;
00022
00023 #ifdef EPA_POLYHEDRON_USE_PLANES
00024 extern SimdScalar PLANE_THICKNESS;
00025 #endif
00026
00028 class EpaFace
00029 {
00030         private :
00031
00033                 EpaFace( const EpaFace& epaFace );
00034                 const EpaFace&  operator = ( const EpaFace& epaFace );
00035
00036         public :
00037
00038                 EpaFace();
00039                 ~EpaFace();
00040
00041                 bool                    Initialize();
00042
00043 #ifdef EPA_POLYHEDRON_USE_PLANES
00044                 bool                    CalculatePlane();
00045 #endif
00046                 void                    CalcClosestPoint();
00047                 void                    CalcClosestPointOnA( SimdVector3& closestPointOnA );
00048                 void                    CalcClosestPointOnB( SimdVector3& closestPointOnB );
00049
00050                 bool                    IsAffinelyDependent()                                                   const;
00051                 bool                    IsClosestPointInternal()                                                const;
00052
00053                 void                    CollectVertices( EpaVertex** ppVertices );
00054
00055                 //void                  FixOrder();
00056
00057         public :
00058
00059                 EpaHalfEdge*    m_pHalfEdge;
00060
00061                 // We keep vertices here so we don't need to call CollectVertices
00062                 // every time we need them
00063                 EpaVertex*              m_pVertices[ 3 ];
00064
00065 #ifdef EPA_POLYHEDRON_USE_PLANES
00066                 SimdVector3             m_planeNormal;
00067                 SimdScalar              m_planeDistance;
00068
00069                 //SimdVector3           m_robustPlaneNormal;
00070                 //SimdScalar            m_robustPlaneDistance;
00071 #endif
00072
00073                 SimdVector3             m_v;
00074                 SimdScalar              m_vSqrd;
00075
00076                 SimdScalar              m_determinant;
00077                 SimdScalar              m_lambdas[ 2 ];
00078
00079                 bool                    m_deleted;
00080 };
00081
00082 #endif
00083
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaHalfEdge.h File Reference

Bullet » NarrowPhaseCollision

EpaHalfEdge.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class EpaHalfEdge
Note : This class is not supposed to be a base class. More...

Generated on Wed May 24 13:59:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaHalfEdge.h Source File

Bullet » NarrowPhaseCollision

EpaHalfEdge.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_HALF_EDGE_H
00018 #define EPA_HALF_EDGE_H
00019
00020 class EpaFace;
00021 class EpaVertex;
00022
00024 class EpaHalfEdge
00025 {
00026         private :
00027
00029                 EpaHalfEdge( const EpaHalfEdge& epaHalfEdge );
00030                 const EpaHalfEdge&              operator = ( const EpaHalfEdge& epaHalfEdge );
00031
00032         public :
00033
00034                 EpaHalfEdge() : m_pTwin( 0 ), m_pNextCCW( 0 ), m_pFace( 0 ), m_pVertex( 0 )
00035                 {
00036                 }
00037
00038                 ~EpaHalfEdge()
00039                 {
00040                 }
00041
00042         public :
00043
00045                 EpaHalfEdge*                    m_pTwin;
00046
00048                 EpaHalfEdge*                    m_pNextCCW;
00049
00051                 EpaFace*                                m_pFace;
00052
00054                 EpaVertex*                              m_pVertex;
00055 };
00056
00057 #endif
00058
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPenetrationDepthSolver.cpp File Reference

Bullet » NarrowPhaseCollision

EpaPenetrationDepthSolver.cpp File Reference

#include "SimdScalar.h"
#include "SimdVector3.h"
#include "SimdPoint3.h"
#include "SimdTransform.h"
#include "SimdMinMax.h"
#include <list>
#include "CollisionShapes/ConvexShape.h"
#include "NarrowPhaseCollision/SimplexSolverInterface.h"
#include "NarrowPhaseCollision/EpaCommon.h"
#include "NarrowPhaseCollision/EpaVertex.h"
#include "NarrowPhaseCollision/EpaHalfEdge.h"
#include "NarrowPhaseCollision/EpaFace.h"
#include "NarrowPhaseCollision/EpaPolyhedron.h"
#include "NarrowPhaseCollision/Epa.h"
#include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"
#include "NarrowPhaseCollision/EpaPenetrationDepthSolver.h"

Include dependency graph for EpaPenetrationDepthSolver.cpp:

Go to the source code of this file.

Variables

SimdScalar g_GJKMaxRelError = 1e-3f
EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to calculate the penetration depth between two convex shapes.
SimdScalar g_GJKMaxRelErrorSqrd = g_GJKMaxRelError * g_GJKMaxRelError

Variable Documentation

SimdScalar g_GJKMaxRelError = 1e-3f

EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to calculate the penetration depth between two convex shapes.

Definition at line 39 of file EpaPenetrationDepthSolver.cpp.

SimdScalar g_GJKMaxRelErrorSqrd = g_GJKMaxRelError * g_GJKMaxRelError

Definition at line 40 of file EpaPenetrationDepthSolver.cpp.

Generated on Wed May 24 13:59:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPenetrationDepthSolver.cpp Source File

Bullet » NarrowPhaseCollision

EpaPenetrationDepthSolver.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #include "SimdScalar.h"
00018 #include "SimdVector3.h"
00019 #include "SimdPoint3.h"
00020 #include "SimdTransform.h"
00021 #include "SimdMinMax.h"
00022
00023 #include <list>
00024
00025 #include "CollisionShapes/ConvexShape.h"
00026
00027 #include "NarrowPhaseCollision/SimplexSolverInterface.h"
00028
00029 #include "NarrowPhaseCollision/EpaCommon.h"
00030
00031 #include "NarrowPhaseCollision/EpaVertex.h"
00032 #include "NarrowPhaseCollision/EpaHalfEdge.h"
00033 #include "NarrowPhaseCollision/EpaFace.h"
00034 #include "NarrowPhaseCollision/EpaPolyhedron.h"
00035 #include "NarrowPhaseCollision/Epa.h"
00036 #include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"
00037 #include "NarrowPhaseCollision/EpaPenetrationDepthSolver.h"
00038
00039 SimdScalar      g_GJKMaxRelError = 1e-3f;
00040 SimdScalar      g_GJKMaxRelErrorSqrd = g_GJKMaxRelError * g_GJKMaxRelError;
00041
00042 bool EpaPenetrationDepthSolver::CalcPenDepth( SimplexSolverInterface& simplexSolver,
00043                                                                                           ConvexShape* pConvexA, ConvexShape* pConvexB,
00044                                                                                           const SimdTransform& transformA, const SimdTransform& transformB,
00045                                                                                           SimdVector3& v, SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB,
00046                                                                                           class IDebugDraw* debugDraw )
00047 {
00048         assert( pConvexA && "Convex shape A is invalid!" );
00049         assert( pConvexB && "Convex shape B is invalid!" );
00050
00051         SimdScalar penDepth;
00052
00053 #ifdef EPA_USE_HYBRID
00054         bool needsEPA = !HybridPenDepth( simplexSolver, pConvexA, pConvexB, transformA, transformB,
00055                                                                          wWitnessOnA, wWitnessOnB, penDepth, v );
00056
00057         if ( needsEPA )
00058         {
00059 #endif
00060                 penDepth = EpaPenDepth( simplexSolver, pConvexA, pConvexB,
00061                                                                 transformA, transformB,
00062                                                                 wWitnessOnA, wWitnessOnB );
00063                 assert( ( penDepth > 0 ) &&  "EPA or Hybrid Technique failed to calculate penetration depth!" );
00064
00065 #ifdef EPA_USE_HYBRID
00066         }
00067 #endif
00068
00069         return ( penDepth > 0 );
00070 }
00071
00072 #ifdef EPA_USE_HYBRID
00073 bool EpaPenetrationDepthSolver::HybridPenDepth( SimplexSolverInterface& simplexSolver,
00074                                                                                                 ConvexShape* pConvexA, ConvexShape* pConvexB,
00075                                                                                                 const SimdTransform& transformA, const SimdTransform& transformB,
00076                                                                                                 SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB,
00077                                                                                             SimdScalar& penDepth, SimdVector3& v )
00078 {
00079         SimdScalar squaredDistance = SIMD_INFINITY;
00080         SimdScalar delta = 0.f;
00081
00082         const SimdScalar margin     = pConvexA->GetMargin() + pConvexB->GetMargin();
00083         const SimdScalar marginSqrd = margin * margin;
00084
00085         simplexSolver.reset();
00086
00087         int nbIterations = 0;
00088
00089         while ( true )
00090         {
00091                 assert( ( v.length2() > 0 ) && "Warning: v is the zero vector!" );
00092
00093                 SimdVector3 seperatingAxisInA = -v * transformA.getBasis();
00094                 SimdVector3 seperatingAxisInB =  v * transformB.getBasis();
00095
00096                 SimdVector3 pInA = pConvexA->LocalGetSupportingVertexWithoutMargin( seperatingAxisInA );
00097                 SimdVector3 qInB = pConvexB->LocalGetSupportingVertexWithoutMargin( seperatingAxisInB );
00098
00099                 SimdPoint3  pWorld = transformA( pInA );
00100                 SimdPoint3  qWorld = transformB( qInB );
00101
00102                 SimdVector3 w = pWorld - qWorld;
00103                 delta = v.dot( w );
00104
00105                 // potential exit, they don't overlap
00106                 if ( ( delta > 0 ) && ( ( delta * delta / squaredDistance ) > marginSqrd ) )
00107                 {
00108                         // Convex shapes do not overlap
00109                         // Returning true means that Hybrid's result is ok and there's no need to run EPA
00110                         penDepth = 0;
00111                         return true;
00112                 }
00113
00114                 //exit 0: the new point is already in the simplex, or we didn't come any closer
00115                 if ( ( squaredDistance - delta <= squaredDistance * g_GJKMaxRelErrorSqrd ) || simplexSolver.inSimplex( w ) )
00116                 {
00117                         simplexSolver.compute_points( wWitnessOnA, wWitnessOnB );
00118
00119                         assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" );
00120                         SimdScalar vLength = sqrt( squaredDistance );
00121
00122                         wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength );
00123                         wWitnessOnB += v * ( pConvexB->GetMargin() / vLength );
00124
00125                         penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength;
00126
00127                         // Returning true means that Hybrid's result is ok and there's no need to run EPA
00128                         return true;
00129                 }
00130
00131                 //add current vertex to simplex
00132                 simplexSolver.addVertex( w, pWorld, qWorld );
00133
00134                 //calculate the closest point to the origin (update vector v)
00135                 if ( !simplexSolver.closest( v ) )
00136                 {
00137                         simplexSolver.compute_points( wWitnessOnA, wWitnessOnB );
00138
00139                         assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" );
00140                         SimdScalar vLength = sqrt( squaredDistance );
00141
00142                         wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength );
00143                         wWitnessOnB += v * ( pConvexB->GetMargin() / vLength );
00144
00145                         penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength;
00146
00147                         // Returning true means that Hybrid's result is ok and there's no need to run EPA
00148                         return true;
00149                 }
00150
00151                 SimdScalar previousSquaredDistance = squaredDistance;
00152                 squaredDistance = v.length2();
00153
00154                 //are we getting any closer ?
00155                 if ( previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance )
00156                 {
00157                         simplexSolver.backup_closest( v );
00158                         squaredDistance = v.length2();
00159
00160                         simplexSolver.compute_points( wWitnessOnA, wWitnessOnB );
00161
00162                         assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" );
00163                         SimdScalar vLength = sqrt( squaredDistance );
00164
00165                         wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength );
00166                         wWitnessOnB += v * ( pConvexB->GetMargin() / vLength );
00167
00168                         penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength;
00169
00170                         // Returning true means that Hybrid's result is ok and there's no need to run EPA
00171                         return true;
00172                 }
00173
00174                 if ( simplexSolver.fullSimplex() || ( squaredDistance <= SIMD_EPSILON * simplexSolver.maxVertex() ) )
00175                 {
00176                         // Convex Shapes intersect - we need to run EPA
00177                         // Returning false means that Hybrid couldn't do anything for us
00178                         // and that we need to run EPA to calculate the pen depth
00179                         return false;
00180                 }
00181
00182                 ++nbIterations;
00183         }
00184 }
00185 #endif
00186
00187 SimdScalar EpaPenetrationDepthSolver::EpaPenDepth( SimplexSolverInterface& simplexSolver,
00188                                                                                                    ConvexShape* pConvexA, ConvexShape* pConvexB,
00189                                                                                                    const SimdTransform& transformA, const SimdTransform& transformB,
00190                                                                                                    SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB )
00191 {
00192         Epa epa( pConvexA, pConvexB, transformA, transformB );
00193
00194         if ( !epa.Initialize( simplexSolver ) )
00195         {
00196                 assert( false && "Epa failed to initialize!" );
00197                 return 0;
00198         }
00199
00200         return epa.CalcPenDepth( wWitnessOnA, wWitnessOnB );
00201 }
00202
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPenetrationDepthSolver.h File Reference

Bullet » NarrowPhaseCollision

EpaPenetrationDepthSolver.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class EpaPenetrationDepthSolver
Note : This class is not supposed to be a base class. More...

Variables

SimdScalar g_GJKMaxRelError
EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to calculate the penetration depth between two convex shapes.
SimdScalar g_GJKMaxRelErrorSqrd

Variable Documentation

SimdScalar g_GJKMaxRelError

EpaPenetrationDepthSolver uses the Expanding Polytope Algorithm to calculate the penetration depth between two convex shapes.

Definition at line 39 of file EpaPenetrationDepthSolver.cpp.

SimdScalar g_GJKMaxRelErrorSqrd

Definition at line 40 of file EpaPenetrationDepthSolver.cpp.

Generated on Wed May 24 13:59:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPenetrationDepthSolver.h Source File

Bullet » NarrowPhaseCollision

EpaPenetrationDepthSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_PENETRATION_DEPTH_H
00018 #define EPA_PENETRATION_DEPTH_H
00019
00025 extern SimdScalar       g_GJKMaxRelError;
00026 extern SimdScalar       g_GJKMaxRelErrorSqrd;
00027
00029 class EpaPenetrationDepthSolver : public ConvexPenetrationDepthSolver
00030 {
00031         public :
00032
00033                 bool                    CalcPenDepth( SimplexSolverInterface& simplexSolver,
00034                                                                           ConvexShape* pConvexA, ConvexShape* pConvexB,
00035                                                                           const SimdTransform& transformA, const SimdTransform& transformB,
00036                                                                           SimdVector3& v, SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB,
00037                                                                           class IDebugDraw* debugDraw );
00038
00039         private :
00040
00041 #ifdef EPA_USE_HYBRID
00042                 bool                    HybridPenDepth( SimplexSolverInterface& simplexSolver,
00043                                                                                 ConvexShape* pConvexA, ConvexShape* pConvexB,
00044                                                                                 const SimdTransform& transformA, const SimdTransform& transformB,
00045                                                                                 SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB,
00046                                                                                 SimdScalar& penDepth, SimdVector3& v );
00047 #endif
00048
00049                 SimdScalar              EpaPenDepth( SimplexSolverInterface& simplexSolver,
00050                                                                          ConvexShape* pConvexA, ConvexShape* pConvexB,
00051                                                                          const SimdTransform& transformA, const SimdTransform& transformB,
00052                                                                          SimdPoint3& wWitnessOnA, SimdPoint3& wWitnessOnB );
00053 };
00054
00055 #endif  // EPA_PENETRATION_DEPTH_H
00056
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPolyhedron.cpp File Reference

Bullet » NarrowPhaseCollision

EpaPolyhedron.cpp File Reference

#include "SimdScalar.h"
#include "SimdVector3.h"
#include "SimdPoint3.h"
#include "Memory2.h"
#include <list>
#include "NarrowPhaseCollision/EpaCommon.h"
#include "NarrowPhaseCollision/EpaVertex.h"
#include "NarrowPhaseCollision/EpaHalfEdge.h"
#include "NarrowPhaseCollision/EpaFace.h"
#include "NarrowPhaseCollision/EpaPolyhedron.h"

Include dependency graph for EpaPolyhedron.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPolyhedron.cpp Source File

Bullet » NarrowPhaseCollision

EpaPolyhedron.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #include "SimdScalar.h"
00018 #include "SimdVector3.h"
00019 #include "SimdPoint3.h"
00020 #include "Memory2.h"
00021
00022 #include <list>
00023 #ifdef _DEBUG
00024 #include <hash_map>
00025 #endif
00026
00027
00028 #include "NarrowPhaseCollision/EpaCommon.h"
00029
00030 #include "NarrowPhaseCollision/EpaVertex.h"
00031 #include "NarrowPhaseCollision/EpaHalfEdge.h"
00032 #include "NarrowPhaseCollision/EpaFace.h"
00033 #include "NarrowPhaseCollision/EpaPolyhedron.h"
00034
00035
00036 EpaPolyhedron::EpaPolyhedron() : m_nbFaces( 0 )
00037 {
00038 }
00039
00040 EpaPolyhedron::~EpaPolyhedron()
00041 {
00042         Destroy();
00043 }
00044
00045 bool EpaPolyhedron::Create( SimdPoint3* pInitialPoints,
00046                                                         SimdPoint3* pSupportPointsOnA, SimdPoint3* pSupportPointsOnB,
00047                                                         const int nbInitialPoints )
00048 {
00049 #ifndef EPA_POLYHEDRON_USE_PLANES
00050         assert( ( nbInitialPoints <= 4 ) && "nbInitialPoints greater than 4!" );
00051 #endif
00052
00053         if ( nbInitialPoints < 4 )
00054         {
00055                 // Insufficient nb of points
00056                 return false;
00057         }
00058
00060
00061 #ifdef EPA_POLYHEDRON_USE_PLANES
00062         int nbDiffCoords[ 3 ] = { 0, 0, 0 };
00063
00064         bool* pDiffCoords = new bool[ 3 * nbInitialPoints ];
00065
00066
00067         int i;
00068         for (i=0;i<nbInitialPoints*3;i++)
00069         {
00070                 pDiffCoords[i] = false;
00071         }
00072
00073         //::memset( pDiffCoords, 0, sizeof( bool ) * 3 * nbInitialPoints );
00074
00075
00076         int axis;
00077
00078         for ( axis = 0; axis < 3; ++axis )
00079         {
00080                 for ( int i = 0; i < nbInitialPoints; ++i )
00081                 {
00082                         bool isDifferent = true;
00083
00084                         for ( int j = 0; j < i; ++j )
00085                         {
00086                                 if ( pInitialPoints[ i ][ axis ] == pInitialPoints[ j ][ axis ] )
00087                                 {
00088                                         isDifferent = false;
00089                                         break;
00090                                 }
00091                         }
00092
00093                         if ( isDifferent )
00094                         {
00095                                 ++nbDiffCoords[ axis ];
00096                                 pDiffCoords[ axis * nbInitialPoints + i ] = true;
00097                         }
00098                 }
00099
00100                 if ( nbDiffCoords[ axis ] <= 1 )
00101                 {
00102                         // The input is degenerate
00103                         return false;
00104                 }
00105         }
00106
00107         int finalPointsIndices[ 4 ] = { -1, -1, -1, -1 };
00108
00109         int axisOrderIndices[ 3 ] = { 0, 1, 2 };
00110
00111         for ( i = 0; i < 2/*round( nbAxis / 2 )*/; ++i )
00112         {
00113                 if ( nbDiffCoords[ i ] > nbDiffCoords[ i + 1 ] )
00114                 {
00115                         int tmp = nbDiffCoords[ i ];
00116                         nbDiffCoords[ i ] = nbDiffCoords[ i + 1 ];
00117                         nbDiffCoords[ i + 1 ] = tmp;
00118
00119                         tmp = axisOrderIndices[ i ];
00120                         axisOrderIndices[ i ] = axisOrderIndices[ i + 1 ];
00121                         axisOrderIndices[ i + 1 ] = tmp;
00122                 }
00123         }
00124
00125         int nbSuccessfullAxis = 0;
00126
00127         // The axes with less different coordinates choose first
00128         int minsIndices[ 3 ] = { -1, -1, -1 };
00129         int maxsIndices[ 3 ] = { -1, -1, -1 };
00130
00131         int finalPointsIndex = 0;
00132
00133         for ( axis = 0; ( axis < 3 ) && ( nbSuccessfullAxis < 2 ); ++axis )
00134         {
00135                 int axisIndex = axisOrderIndices[ axis ];
00136
00137                 SimdScalar axisMin =  SIMD_INFINITY;
00138                 SimdScalar axisMax = -SIMD_INFINITY;
00139
00140                 for ( int i = 0; i < 4; ++i )
00141                 {
00142                         // Among the diff coords pick the min and max coords
00143
00144                         if ( pDiffCoords[ axisIndex * nbInitialPoints + i ] )
00145                         {
00146                                 if ( pInitialPoints[ i ][ axisIndex ] < axisMin )
00147                                 {
00148                                         axisMin = pInitialPoints[ i ][ axisIndex ];
00149                                         minsIndices[ axisIndex ] = i;
00150                                 }
00151
00152                                 if ( pInitialPoints[ i ][ axisIndex ] > axisMax )
00153                                 {
00154                                         axisMax = pInitialPoints[ i ][ axisIndex ];
00155                                         maxsIndices[ axisIndex ] = i;
00156                                 }
00157                         }
00158                 }
00159
00160                 //assert( ( minsIndices[ axisIndex ] != maxsIndices[ axisIndex ] ) &&
00161                 //              "min and max have the same index!" );
00162
00163                 if ( ( minsIndices[ axisIndex ] != -1 ) && ( maxsIndices[ axisIndex ] != -1 ) &&
00164                          ( minsIndices[ axisIndex ] != maxsIndices[ axisIndex ] ) )
00165                 {
00166                         ++nbSuccessfullAxis;
00167
00168                         finalPointsIndices[ finalPointsIndex++ ] = minsIndices[ axisIndex ];
00169                         finalPointsIndices[ finalPointsIndex++ ] = maxsIndices[ axisIndex ];
00170
00171                         // Make the choosen points to be impossible for other axes to choose
00172
00173                         //assert( ( minsIndices[ axisIndex ] != -1 ) && "Invalid index!" );
00174                         //assert( ( maxsIndices[ axisIndex ] != -1 ) && "Invalid index!" );
00175
00176                         for ( int i = 0; i < 3; ++i )
00177                         {
00178                                 pDiffCoords[ i * nbInitialPoints + minsIndices[ axisIndex ] ] = false;
00179                                 pDiffCoords[ i * nbInitialPoints + maxsIndices[ axisIndex ] ] = false;
00180                         }
00181                 }
00182         }
00183
00184         if ( nbSuccessfullAxis <= 1 )
00185         {
00186                 // Degenerate input ?
00187                 assert( false && "nbSuccessfullAxis must be greater than 1!" );
00188                 return false;
00189         }
00190
00191         delete[] pDiffCoords;
00192 #endif
00193
00195
00196 #ifdef EPA_POLYHEDRON_USE_PLANES
00197         SimdVector3 v0 = pInitialPoints[ finalPointsIndices[ 1 ] ] - pInitialPoints[ finalPointsIndices[ 0 ] ];
00198         SimdVector3 v1 = pInitialPoints[ finalPointsIndices[ 2 ] ] - pInitialPoints[ finalPointsIndices[ 0 ] ];
00199 #else
00200         SimdVector3 v0 = pInitialPoints[ 1 ] - pInitialPoints[ 0 ];
00201         SimdVector3 v1 = pInitialPoints[ 2 ] - pInitialPoints[ 0 ];
00202 #endif
00203
00204         SimdVector3 planeNormal = v1.cross( v0 );
00205         planeNormal.normalize();
00206
00207 #ifdef EPA_POLYHEDRON_USE_PLANES
00208         SimdScalar planeDistance = pInitialPoints[ finalPointsIndices[ 0 ] ].dot( -planeNormal );
00209 #else
00210         SimdScalar planeDistance = pInitialPoints[ 0 ].dot( -planeNormal );
00211 #endif
00212
00213 #ifdef EPA_POLYHEDRON_USE_PLANES
00214         assert( SimdEqual( pInitialPoints[ finalPointsIndices[ 0 ] ].dot( planeNormal ) + planeDistance, PLANE_THICKNESS ) &&
00215                         "Point should be on plane!" );
00216         assert( SimdEqual( pInitialPoints[ finalPointsIndices[ 1 ] ].dot( planeNormal ) + planeDistance, PLANE_THICKNESS ) &&
00217                         "Point should be on plane!" );
00218         assert( SimdEqual( pInitialPoints[ finalPointsIndices[ 2 ] ].dot( planeNormal ) + planeDistance, PLANE_THICKNESS ) &&
00219                         "Point should be on plane!" );
00220 #endif
00221
00222 #ifndef EPA_POLYHEDRON_USE_PLANES
00223         {
00224                 if ( planeDistance > 0 )
00225                 {
00226                         SimdVector3 tmp = pInitialPoints[ 1 ];
00227                         pInitialPoints[ 1 ] = pInitialPoints[ 2 ];
00228                         pInitialPoints[ 2 ] = tmp;
00229
00230                         tmp = pSupportPointsOnA[ 1 ];
00231                         pSupportPointsOnA[ 1 ] = pSupportPointsOnA[ 2 ];
00232                         pSupportPointsOnA[ 2 ] = tmp;
00233
00234                         tmp = pSupportPointsOnB[ 1 ];
00235                         pSupportPointsOnB[ 1 ] = pSupportPointsOnB[ 2 ];
00236                         pSupportPointsOnB[ 2 ] = tmp;
00237                 }
00238         }
00239
00240         EpaVertex* pVertexA = CreateVertex( pInitialPoints[ 0 ], pSupportPointsOnA[ 0 ], pSupportPointsOnB[ 0 ] );
00241         EpaVertex* pVertexB = CreateVertex( pInitialPoints[ 1 ], pSupportPointsOnA[ 1 ], pSupportPointsOnB[ 1 ] );
00242         EpaVertex* pVertexC = CreateVertex( pInitialPoints[ 2 ], pSupportPointsOnA[ 2 ], pSupportPointsOnB[ 2 ] );
00243         EpaVertex* pVertexD = CreateVertex( pInitialPoints[ 3 ], pSupportPointsOnA[ 3 ], pSupportPointsOnB[ 3 ] );
00244 #else
00245         finalPointsIndices[ 3 ] = -1;
00246
00247         SimdScalar absMaxDist = -SIMD_INFINITY;
00248         SimdScalar maxDist;
00249
00250         for ( int pointIndex = 0; pointIndex < nbInitialPoints; ++pointIndex )
00251         {
00252                 SimdScalar dist    = planeNormal.dot( pInitialPoints[ pointIndex ] ) + planeDistance;
00253                 SimdScalar absDist = abs( dist );
00254
00255                 if ( ( absDist > absMaxDist ) &&
00256                         !SimdEqual( dist, PLANE_THICKNESS ) )
00257                 {
00258                         absMaxDist = absDist;
00259                         maxDist    = dist;
00260                         finalPointsIndices[ 3 ] = pointIndex;
00261                 }
00262         }
00263
00264         if ( finalPointsIndices[ 3 ] == -1 )
00265         {
00266                 Destroy();
00267                 return false;
00268         }
00269
00270         if ( maxDist > PLANE_THICKNESS )
00271         {
00272                 // Can swap indices only
00273
00274                 SimdPoint3 tmp = pInitialPoints[ finalPointsIndices[ 1 ] ];
00275                 pInitialPoints[ finalPointsIndices[ 1 ] ] = pInitialPoints[ finalPointsIndices[ 2 ] ];
00276                 pInitialPoints[ finalPointsIndices[ 2 ] ] = tmp;
00277
00278                 tmp = pSupportPointsOnA[ finalPointsIndices[ 1 ] ];
00279                 pSupportPointsOnA[ finalPointsIndices[ 1 ] ] = pSupportPointsOnA[ finalPointsIndices[ 2 ] ];
00280                 pSupportPointsOnA[ finalPointsIndices[ 2 ] ] = tmp;
00281
00282                 tmp = pSupportPointsOnB[ finalPointsIndices[ 1 ] ];
00283                 pSupportPointsOnB[ finalPointsIndices[ 1 ] ] = pSupportPointsOnB[ finalPointsIndices[ 2 ] ];
00284                 pSupportPointsOnB[ finalPointsIndices[ 2 ] ] = tmp;
00285         }
00286
00287         EpaVertex* pVertexA = CreateVertex( pInitialPoints[ finalPointsIndices[ 0 ] ], pSupportPointsOnA[ finalPointsIndices[ 0 ] ], pSupportPointsOnB[ finalPointsIndices[ 0 ] ] );
00288         EpaVertex* pVertexB = CreateVertex( pInitialPoints[ finalPointsIndices[ 1 ] ], pSupportPointsOnA[ finalPointsIndices[ 1 ] ], pSupportPointsOnB[ finalPointsIndices[ 1 ] ] );
00289         EpaVertex* pVertexC = CreateVertex( pInitialPoints[ finalPointsIndices[ 2 ] ], pSupportPointsOnA[ finalPointsIndices[ 2 ] ], pSupportPointsOnB[ finalPointsIndices[ 2 ] ] );
00290         EpaVertex* pVertexD = CreateVertex( pInitialPoints[ finalPointsIndices[ 3 ] ], pSupportPointsOnA[ finalPointsIndices[ 3 ] ], pSupportPointsOnB[ finalPointsIndices[ 3 ] ] );
00291 #endif
00292
00293         EpaFace* pFaceA = CreateFace();
00294         EpaFace* pFaceB = CreateFace();
00295         EpaFace* pFaceC = CreateFace();
00296         EpaFace* pFaceD = CreateFace();
00297
00298         EpaHalfEdge* pFaceAHalfEdges[ 3 ];
00299         EpaHalfEdge* pFaceCHalfEdges[ 3 ];
00300         EpaHalfEdge* pFaceBHalfEdges[ 3 ];
00301         EpaHalfEdge* pFaceDHalfEdges[ 3 ];
00302
00303         pFaceAHalfEdges[ 0 ] = CreateHalfEdge();
00304         pFaceAHalfEdges[ 1 ] = CreateHalfEdge();
00305         pFaceAHalfEdges[ 2 ] = CreateHalfEdge();
00306
00307         pFaceBHalfEdges[ 0 ] = CreateHalfEdge();
00308         pFaceBHalfEdges[ 1 ] = CreateHalfEdge();
00309         pFaceBHalfEdges[ 2 ] = CreateHalfEdge();
00310
00311         pFaceCHalfEdges[ 0 ] = CreateHalfEdge();
00312         pFaceCHalfEdges[ 1 ] = CreateHalfEdge();
00313         pFaceCHalfEdges[ 2 ] = CreateHalfEdge();
00314
00315         pFaceDHalfEdges[ 0 ] = CreateHalfEdge();
00316         pFaceDHalfEdges[ 1 ] = CreateHalfEdge();
00317         pFaceDHalfEdges[ 2 ] = CreateHalfEdge();
00318
00319         pFaceA->m_pHalfEdge = pFaceAHalfEdges[ 0 ];
00320         pFaceB->m_pHalfEdge = pFaceBHalfEdges[ 0 ];
00321         pFaceC->m_pHalfEdge = pFaceCHalfEdges[ 0 ];
00322         pFaceD->m_pHalfEdge = pFaceDHalfEdges[ 0 ];
00323
00324         pFaceAHalfEdges[ 0 ]->m_pNextCCW = pFaceAHalfEdges[ 1 ];
00325         pFaceAHalfEdges[ 1 ]->m_pNextCCW = pFaceAHalfEdges[ 2 ];
00326         pFaceAHalfEdges[ 2 ]->m_pNextCCW = pFaceAHalfEdges[ 0 ];
00327
00328         pFaceBHalfEdges[ 0 ]->m_pNextCCW = pFaceBHalfEdges[ 1 ];
00329         pFaceBHalfEdges[ 1 ]->m_pNextCCW = pFaceBHalfEdges[ 2 ];
00330         pFaceBHalfEdges[ 2 ]->m_pNextCCW = pFaceBHalfEdges[ 0 ];
00331
00332         pFaceCHalfEdges[ 0 ]->m_pNextCCW = pFaceCHalfEdges[ 1 ];
00333         pFaceCHalfEdges[ 1 ]->m_pNextCCW = pFaceCHalfEdges[ 2 ];
00334         pFaceCHalfEdges[ 2 ]->m_pNextCCW = pFaceCHalfEdges[ 0 ];
00335
00336         pFaceDHalfEdges[ 0 ]->m_pNextCCW = pFaceDHalfEdges[ 1 ];
00337         pFaceDHalfEdges[ 1 ]->m_pNextCCW = pFaceDHalfEdges[ 2 ];
00338         pFaceDHalfEdges[ 2 ]->m_pNextCCW = pFaceDHalfEdges[ 0 ];
00339
00340
00341         pFaceAHalfEdges[ 0 ]->m_pFace = pFaceA;
00342         pFaceAHalfEdges[ 1 ]->m_pFace = pFaceA;
00343         pFaceAHalfEdges[ 2 ]->m_pFace = pFaceA;
00344
00345         pFaceBHalfEdges[ 0 ]->m_pFace = pFaceB;
00346         pFaceBHalfEdges[ 1 ]->m_pFace = pFaceB;
00347         pFaceBHalfEdges[ 2 ]->m_pFace = pFaceB;
00348
00349         pFaceCHalfEdges[ 0 ]->m_pFace = pFaceC;
00350         pFaceCHalfEdges[ 1 ]->m_pFace = pFaceC;
00351         pFaceCHalfEdges[ 2 ]->m_pFace = pFaceC;
00352
00353         pFaceDHalfEdges[ 0 ]->m_pFace = pFaceD;
00354         pFaceDHalfEdges[ 1 ]->m_pFace = pFaceD;
00355         pFaceDHalfEdges[ 2 ]->m_pFace = pFaceD;
00356
00357
00358         pFaceAHalfEdges[ 0 ]->m_pVertex = pVertexA;
00359         pFaceAHalfEdges[ 1 ]->m_pVertex = pVertexB;
00360         pFaceAHalfEdges[ 2 ]->m_pVertex = pVertexC;
00361
00362         pFaceBHalfEdges[ 0 ]->m_pVertex = pVertexB;
00363         pFaceBHalfEdges[ 1 ]->m_pVertex = pVertexD;
00364         pFaceBHalfEdges[ 2 ]->m_pVertex = pVertexC;
00365
00366         pFaceCHalfEdges[ 0 ]->m_pVertex = pVertexD;
00367         pFaceCHalfEdges[ 1 ]->m_pVertex = pVertexA;
00368         pFaceCHalfEdges[ 2 ]->m_pVertex = pVertexC;
00369
00370         pFaceDHalfEdges[ 0 ]->m_pVertex = pVertexB;
00371         pFaceDHalfEdges[ 1 ]->m_pVertex = pVertexA;
00372         pFaceDHalfEdges[ 2 ]->m_pVertex = pVertexD;
00373
00374         //pVertexA->m_pHalfEdge = pFaceAHalfEdges[ 0 ];
00375         //pVertexB->m_pHalfEdge = pFaceAHalfEdges[ 1 ];
00376         //pVertexC->m_pHalfEdge = pFaceAHalfEdges[ 2 ];
00377         //pVertexD->m_pHalfEdge = pFaceBHalfEdges[ 1 ];
00378
00379         pFaceAHalfEdges[ 0 ]->m_pTwin = pFaceDHalfEdges[ 0 ];
00380         pFaceAHalfEdges[ 1 ]->m_pTwin = pFaceBHalfEdges[ 2 ];
00381         pFaceAHalfEdges[ 2 ]->m_pTwin = pFaceCHalfEdges[ 1 ];
00382
00383         pFaceBHalfEdges[ 0 ]->m_pTwin = pFaceDHalfEdges[ 2 ];
00384         pFaceBHalfEdges[ 1 ]->m_pTwin = pFaceCHalfEdges[ 2 ];
00385         pFaceBHalfEdges[ 2 ]->m_pTwin = pFaceAHalfEdges[ 1 ];
00386
00387         pFaceCHalfEdges[ 0 ]->m_pTwin = pFaceDHalfEdges[ 1 ];
00388         pFaceCHalfEdges[ 1 ]->m_pTwin = pFaceAHalfEdges[ 2 ];
00389         pFaceCHalfEdges[ 2 ]->m_pTwin = pFaceBHalfEdges[ 1 ];
00390
00391         pFaceDHalfEdges[ 0 ]->m_pTwin = pFaceAHalfEdges[ 0 ];
00392         pFaceDHalfEdges[ 1 ]->m_pTwin = pFaceCHalfEdges[ 0 ];
00393         pFaceDHalfEdges[ 2 ]->m_pTwin = pFaceBHalfEdges[ 0 ];
00394
00395         if ( !pFaceA->Initialize() || !pFaceB->Initialize() ||
00396                  !pFaceC->Initialize() || !pFaceD->Initialize() )
00397         {
00398                 assert( false && "One initial face failed to initialize!" );
00399                 return false;
00400         }
00401
00402 #ifdef EPA_POLYHEDRON_USE_PLANES
00403         if ( nbInitialPoints > 4 )
00404         {
00405                 for ( int i = 0; i < nbInitialPoints; ++i )
00406                 {
00407                         if ( ( i != finalPointsIndices[ 0 ] ) && ( i != finalPointsIndices[ 1 ] ) &&
00408                                  ( i != finalPointsIndices[ 2 ] ) && ( i != finalPointsIndices[ 3 ] ) )
00409                         {
00410                                 std::list< EpaFace* >::iterator facesItr( m_faces.begin() );
00411
00412                                 while ( facesItr != m_faces.end() )
00413                                 {
00414                                         EpaFace* pFace = *facesItr;
00415
00416                                         SimdScalar dist = pFace->m_planeNormal.dot( pInitialPoints[ i ] ) + pFace->m_planeDistance;
00417
00418                                         if ( dist > PLANE_THICKNESS )
00419                                         {
00420                                                 std::list< EpaFace* > newFaces;
00421
00422                                                 bool expandOk = Expand( pInitialPoints[ i ], pSupportPointsOnA[ i ], pSupportPointsOnB[ i ],
00423                                                                                                 pFace, newFaces );
00424
00425                                                 if ( !expandOk )
00426                                                 {
00427                                                         // One or more new faces are affinely dependent
00428                                                         return false;
00429                                                 }
00430
00431                                                 assert( !newFaces.empty() && "Polyhedron should have expanded!" );
00432
00433                                                 break;
00434                                         }
00435
00436                                         ++facesItr;
00437                                 }
00438                         }
00439                 }
00440         }
00441 #endif
00442
00443         return true;
00444 }
00445
00446 void EpaPolyhedron::Destroy()
00447 {
00448         DestroyAllVertices();
00449
00450         DestroyAllHalfEdges();
00451
00452         DestroyAllFaces();
00453 }
00454
00455 EpaFace* EpaPolyhedron::CreateFace()
00456 {
00457         EpaFace* pNewFace = new EpaFace();
00458         assert( pNewFace && "Failed to allocate memory for a new EpaFace!" );
00459
00460         m_faces.push_back( pNewFace );
00461
00462         ++m_nbFaces;
00463
00464         return pNewFace;
00465 }
00466
00467 EpaHalfEdge* EpaPolyhedron::CreateHalfEdge()
00468 {
00469         EpaHalfEdge* pNewHalfEdge = new EpaHalfEdge();
00470         assert( pNewHalfEdge && "Failed to allocate memory for a new EpaHalfEdge!" );
00471
00472         m_halfEdges.push_back( pNewHalfEdge );
00473
00474         return pNewHalfEdge;
00475 }
00476
00477 EpaVertex* EpaPolyhedron::CreateVertex( const SimdPoint3& wSupportPoint,
00478                                                                             const SimdPoint3& wSupportPointOnA,
00479                                                                             const SimdPoint3& wSupportPointOnB )
00480 {
00481         EpaVertex* pNewVertex = new EpaVertex( wSupportPoint, wSupportPointOnA, wSupportPointOnB );
00482         assert( pNewVertex && "Failed to allocate memory for a new EpaVertex!" );
00483
00484         m_vertices.push_back( pNewVertex );
00485
00486         return pNewVertex;
00487 }
00488
00489 void EpaPolyhedron::DeleteFace( EpaFace* pFace )
00490 {
00491         pFace->m_deleted = true;
00492         --m_nbFaces;
00493 }
00494
00495 void EpaPolyhedron::DestroyAllFaces()
00496 {
00497         while ( !m_faces.empty() )
00498         {
00499                 EpaFace* pFace = m_faces.front();
00500
00501                 delete pFace;
00502
00503                 m_faces.pop_front();
00504         }
00505
00506         m_nbFaces = 0;
00507 }
00508
00509 void EpaPolyhedron::DestroyAllHalfEdges()
00510 {
00511         while ( !m_halfEdges.empty() )
00512         {
00513                 EpaHalfEdge* pHalfEdge = m_halfEdges.front();
00514
00515                 delete pHalfEdge;
00516
00517                 m_halfEdges.pop_front();
00518         }
00519 }
00520
00521 void EpaPolyhedron::DestroyAllVertices()
00522 {
00523         while ( !m_vertices.empty() )
00524         {
00525                 EpaVertex* pVertex = m_vertices.front();
00526
00527                 delete pVertex;
00528
00529                 m_vertices.pop_front();
00530         }
00531 }
00532
00533 bool EpaPolyhedron::Expand( const SimdPoint3& wSupportPoint,
00534                                                     const SimdPoint3& wSupportPointOnA,
00535                                                     const SimdPoint3& wSupportPointOnB,
00536                                                     EpaFace* pFace, std::list< EpaFace* >& newFaces )
00537 {
00538         assert( !pFace->m_deleted && "Face is already deleted!" );
00539         assert( newFaces.empty() && "NewFaces list must be empty!" );
00540
00541         assert( !pFace->m_deleted && "Cannot expand deleted face!" );
00542
00543         // wSupportPoint must be front of face's plane used to do the expansion
00544
00545 #ifdef EPA_POLYHEDRON_USE_PLANES
00546         SimdScalar dist = pFace->m_planeNormal.dot( wSupportPoint ) + pFace->m_planeDistance;
00547         if ( dist <= PLANE_THICKNESS )
00548         {
00549                 return false;
00550         }
00551 #endif
00552
00553         std::list< EpaHalfEdge* > coneBaseEdges;
00554         DeleteVisibleFaces( wSupportPoint, pFace, coneBaseEdges );
00555
00556         assert( ( coneBaseEdges.size() >= 3 ) && "Cone base must have at least 3 edges!" );
00557
00558         EpaVertex* pConeAppex = CreateVertex( wSupportPoint, wSupportPointOnA, wSupportPointOnB );
00559         assert( pConeAppex && "Failed to create vertex!" );
00560
00561         CreateCone( pConeAppex, coneBaseEdges, newFaces );
00562
00563         // Initialize new faces
00564
00565         std::list< EpaFace* >::iterator newFacesItr( newFaces.begin() );
00566
00567         while ( newFacesItr != newFaces.end() )
00568         {
00569                 EpaFace* pNewFace = *newFacesItr;
00570
00571                 if ( !pNewFace->Initialize() )
00572                 {
00573                         return false;
00574                 }
00575
00576                 ++newFacesItr;
00577         }
00578
00579         return true;
00580 }
00581
00582 std::list< EpaFace* >& EpaPolyhedron::GetFaces()
00583 {
00584         return m_faces;
00585 }
00586
00587 int EpaPolyhedron::GetNbFaces() const
00588 {
00589         return m_faces.size();
00590 }
00591
00592 void EpaPolyhedron::DeleteVisibleFaces( const SimdPoint3& point, EpaFace* pFace,
00593                                                                                 std::list< EpaHalfEdge* >& coneBaseTwinHalfEdges )
00594 {
00595         assert( !pFace->m_deleted && "Face is already deleted!" );
00596
00597         DeleteFace( pFace );
00598
00599         EpaHalfEdge* pCurrentHalfEdge = pFace->m_pHalfEdge;
00600
00601         do
00602         {
00603                 assert( pCurrentHalfEdge->m_pTwin && "Half-edge without a twin!" );
00604
00605                 EpaFace* pAdjacentFace = pCurrentHalfEdge->m_pTwin->m_pFace;
00606                 assert( pAdjacentFace && "Invalid adjacent face!" );
00607
00608                 if ( !pAdjacentFace->m_deleted )
00609                 {
00610 #ifdef EPA_POLYHEDRON_USE_PLANES
00611                         assert( ( pAdjacentFace->m_planeNormal.length2() > 0 ) && "Invalid plane!" );
00612
00613                         SimdScalar pointDist = pAdjacentFace->m_planeNormal.dot( point ) +
00614                                                                    pAdjacentFace->m_planeDistance;
00615
00616                         if ( pointDist > PLANE_THICKNESS )
00617 #else
00618                         SimdScalar dot = pAdjacentFace->m_v.dot( point );
00619                         if ( dot >= pAdjacentFace->m_vSqrd )
00620 #endif
00621                         {
00622                                 DeleteVisibleFaces( point, pAdjacentFace, coneBaseTwinHalfEdges );
00623                         }
00624                         else
00625                         {
00626                                 coneBaseTwinHalfEdges.push_back( pCurrentHalfEdge->m_pTwin );
00627                         }
00628                 }
00629
00630                 pCurrentHalfEdge = pCurrentHalfEdge->m_pNextCCW;
00631         }
00632         while( pCurrentHalfEdge != pFace->m_pHalfEdge );
00633 }
00634
00635 void EpaPolyhedron::CreateCone( EpaVertex* pAppexVertex, std::list< EpaHalfEdge* >& baseTwinHalfEdges,
00636                                                                 std::list< EpaFace* >& newFaces )
00637 {
00638         assert( ( baseTwinHalfEdges.size() >= 3 ) && "DeleteVisibleFaces method didn't do its job right!" );
00639
00640         std::list< EpaHalfEdge* >::iterator baseHalfEdgesItr( baseTwinHalfEdges.begin() );
00641         std::list< EpaHalfEdge* > halfEdgesToLink;
00642
00643         while ( baseHalfEdgesItr != baseTwinHalfEdges.end() )
00644         {
00645                 EpaFace* pNewFace = CreateConeFace( pAppexVertex, *baseHalfEdgesItr, halfEdgesToLink );
00646
00647                 newFaces.push_back( pNewFace );
00648
00649                 ++baseHalfEdgesItr;
00650         }
00651
00652         // Connect consecutive faces by linking twin half-edges
00653
00654         assert( ( halfEdgesToLink.size() % 2 == 0 ) && "Nb half-edges to link is odd!" );
00655
00656         int nbLinksToCreate = halfEdgesToLink.size() / 2;
00657         int nbLinksCreated  = 0;
00658
00659         std::list< EpaHalfEdge* >::iterator halfEdgesItr( halfEdgesToLink.begin() );
00660
00661         for ( ; ( halfEdgesItr != halfEdgesToLink.end() ) && ( nbLinksCreated < nbLinksToCreate ); ++halfEdgesItr )
00662         {
00663                 std::list< EpaHalfEdge* >::iterator halfEdgesItr2( halfEdgesItr );
00664                 ++halfEdgesItr2;
00665
00666                 for ( ; ( halfEdgesItr2 != halfEdgesToLink.end() ) && ( nbLinksCreated < nbLinksToCreate ); ++halfEdgesItr2 )
00667                 {
00668                         EpaHalfEdge* pHalfEdge1 = *halfEdgesItr;
00669                         EpaHalfEdge* pHalfEdge2 = *halfEdgesItr2;
00670
00671                         EpaHalfEdge* pHalfEdgeNextCCW1 = pHalfEdge1->m_pNextCCW;
00672                         EpaHalfEdge* pHalfEdgeNextCCW2 = pHalfEdge2->m_pNextCCW;
00673
00674                         if ( ( pHalfEdge2->m_pVertex == pHalfEdgeNextCCW1->m_pVertex ) &&
00675                                  ( pHalfEdgeNextCCW2->m_pVertex == pHalfEdge1->m_pVertex ) )
00676                         {
00677                                 pHalfEdge1->m_pTwin = pHalfEdge2;
00678                                 pHalfEdge2->m_pTwin = pHalfEdge1;
00679
00680                                 ++nbLinksCreated;
00681                         }
00682                 }
00683         }
00684
00685         assert( ( nbLinksCreated == nbLinksToCreate ) && "Mesh topology not ok!" );
00686 }
00687
00688 EpaFace* EpaPolyhedron::CreateConeFace( EpaVertex* pAppexVertex, EpaHalfEdge* pBaseTwinHalfEdge,
00689                                                                             std::list< EpaHalfEdge* >& halfEdgesToLink )
00690 {
00691         EpaFace* pNewFace = CreateFace();
00692
00693         EpaHalfEdge* pNewHalfEdge0 = CreateHalfEdge();
00694         EpaHalfEdge* pNewHalfEdge1 = CreateHalfEdge();
00695         EpaHalfEdge* pNewHalfEdge2 = CreateHalfEdge();
00696
00697         // Let new face point to one of its new half-edges
00698         pNewFace->m_pHalfEdge = pNewHalfEdge0;
00699
00700         // Link new half-edges in a loop
00701
00702         pNewHalfEdge0->m_pNextCCW = pNewHalfEdge1;
00703         pNewHalfEdge1->m_pNextCCW = pNewHalfEdge2;
00704         pNewHalfEdge2->m_pNextCCW = pNewHalfEdge0;
00705
00706         // Let new half-edges point to new face
00707
00708         pNewHalfEdge0->m_pFace = pNewFace;
00709         pNewHalfEdge1->m_pFace = pNewFace;
00710         pNewHalfEdge2->m_pFace = pNewFace;
00711
00712         // Let new half-edge 0 and base twin half-edge point to each other
00713
00714         pNewHalfEdge0->m_pTwin     = pBaseTwinHalfEdge;
00715         pBaseTwinHalfEdge->m_pTwin = pNewHalfEdge0;
00716
00717         // Let new half-edges know about their origin vertex
00718
00719         pNewHalfEdge0->m_pVertex = pBaseTwinHalfEdge->m_pNextCCW->m_pVertex;
00720         pNewHalfEdge1->m_pVertex = pBaseTwinHalfEdge->m_pVertex;
00721         pNewHalfEdge2->m_pVertex = pAppexVertex;
00722
00723         // Let vertices know about one of their outgoing edges
00724
00725         //pNewHalfEdge0->m_pVertex->m_pHalfEdge = pNewHalfEdge0;
00726         //pNewHalfEdge1->m_pVertex->m_pHalfEdge = pNewHalfEdge1;
00727         //pNewHalfEdge2->m_pVertex->m_pHalfEdge = pNewHalfEdge2;
00728
00729         halfEdgesToLink.push_back( pNewHalfEdge1 );
00730         halfEdgesToLink.push_back( pNewHalfEdge2 );
00731
00732         return pNewFace;
00733 }
00734
00735
00736 #ifdef DO_SOME_DEBUGGING_
00737 #ifdef _DEBUG
00738 bool EpaPolyhedron::_dbgSaveToFile( const char* pFileName )
00739 {
00740         FILE* fp = NULL;
00741
00742         if ( fopen_s( &fp, pFileName, "wb" ) != 0 )
00743         {
00744                 return false;
00745         }
00746
00747         unsigned long int nbBytesWritten;
00748         unsigned long int byteIndex = 0;
00749
00750         unsigned long int fileID = 0xBADC0DE;
00751         fwrite( &fileID, sizeof( fileID ), 1, fp );
00752         nbBytesWritten = sizeof( fileID );
00753         byteIndex += nbBytesWritten;
00754
00755         unsigned char reservedByte = 0;
00756         fwrite( &reservedByte, sizeof( reservedByte ), 1, fp );
00757         nbBytesWritten = sizeof( reservedByte );
00758         byteIndex += nbBytesWritten;
00759         fwrite( &reservedByte, sizeof( reservedByte ), 1, fp );
00760         nbBytesWritten = sizeof( reservedByte );
00761         byteIndex += nbBytesWritten;
00762         fwrite( &reservedByte, sizeof( reservedByte ), 1, fp );
00763         nbBytesWritten = sizeof( reservedByte );
00764         byteIndex += nbBytesWritten;
00765
00766         fwrite( &reservedByte, sizeof( reservedByte ), 1, fp );
00767         nbBytesWritten = sizeof( reservedByte );
00768         byteIndex += nbBytesWritten;
00769         fwrite( &reservedByte, sizeof( reservedByte ), 1, fp );
00770         nbBytesWritten = sizeof( reservedByte );
00771         byteIndex += nbBytesWritten;
00772         fwrite( &reservedByte, sizeof( reservedByte ), 1, fp );
00773         nbBytesWritten = sizeof( reservedByte );
00774         byteIndex += nbBytesWritten;
00775
00776         unsigned char stringSize = 5;
00777         fwrite( &stringSize, sizeof( stringSize ), 1, fp );
00778         nbBytesWritten = sizeof( stringSize );
00779         byteIndex += nbBytesWritten;
00780
00781         char exportedFrom[ 6 ] = "01234";
00782         fwrite( exportedFrom, stringSize * sizeof( char ), 1, fp );
00783         nbBytesWritten = stringSize * sizeof( char );
00784         byteIndex += nbBytesWritten;
00785
00786         unsigned short int w = 0;
00787
00788         fwrite( &w, sizeof( w ), 1, fp );
00789         nbBytesWritten = sizeof( w );
00790         byteIndex += nbBytesWritten;
00791         fwrite( &w, sizeof( w ), 1, fp );
00792         nbBytesWritten = sizeof( w );
00793         byteIndex += nbBytesWritten;
00794         fwrite( &w, sizeof( w ), 1, fp );
00795         nbBytesWritten = sizeof( w );
00796         byteIndex += nbBytesWritten;
00797
00798         fwrite( &w, sizeof( w ), 1, fp );
00799         nbBytesWritten = sizeof( w );
00800         byteIndex += nbBytesWritten;
00801         fwrite( &w, sizeof( w ), 1, fp );
00802         nbBytesWritten = sizeof( w );
00803         byteIndex += nbBytesWritten;
00804         fwrite( &w, sizeof( w ), 1, fp );
00805         nbBytesWritten = sizeof( w );
00806         byteIndex += nbBytesWritten;
00807
00808         unsigned long int geometryOffsetAtByteNb = byteIndex;
00809
00810         unsigned long int geometryOffset = 0;
00811         unsigned long int geometrySize   = 0;
00812
00813         fseek( fp, sizeof( geometryOffset ) + sizeof( geometrySize ), SEEK_CUR );
00814         byteIndex += sizeof( geometryOffset ) + sizeof( geometrySize );
00815
00816         unsigned long int mappingOffset = 0;
00817         unsigned long int mappingSize   = 0;
00818
00819         fwrite( &mappingOffset, sizeof( mappingOffset ), 1, fp );
00820         nbBytesWritten = sizeof( mappingOffset );
00821         byteIndex += nbBytesWritten;
00822
00823         fwrite( &mappingSize, sizeof( mappingSize ), 1, fp );
00824         nbBytesWritten = sizeof( mappingSize );
00825         byteIndex += nbBytesWritten;
00826
00827         unsigned long int animationOffset = 0;
00828         unsigned long int animationSize   = 0;
00829
00830         fwrite( &animationOffset, sizeof( animationOffset ), 1, fp );
00831         nbBytesWritten = sizeof( animationOffset );
00832         byteIndex += nbBytesWritten;
00833         fwrite( &animationSize, sizeof( animationSize ), 1, fp );
00834         nbBytesWritten = sizeof( animationSize );
00835         byteIndex += nbBytesWritten;
00836
00837         unsigned long int reservedDword = 0;
00838         fwrite( &reservedDword, sizeof( reservedDword ), 1, fp );
00839         nbBytesWritten = sizeof( reservedDword );
00840         byteIndex += nbBytesWritten;
00841         fwrite( &reservedDword, sizeof( reservedDword ), 1, fp );
00842         nbBytesWritten = sizeof( reservedDword );
00843         byteIndex += nbBytesWritten;
00844
00845         geometryOffset = byteIndex;
00846
00847         unsigned short int nbMeshs = 1;
00848         fwrite( &nbMeshs, sizeof( nbMeshs ), 1, fp );
00849         nbBytesWritten = sizeof( nbMeshs );
00850         byteIndex += nbBytesWritten;
00851
00852         char meshName[] = "noname mesh";
00853         unsigned char meshNameSize = strlen( meshName );
00854
00855         fwrite( &meshNameSize, sizeof( meshNameSize ), 1, fp );
00856         nbBytesWritten = sizeof( meshNameSize );
00857         byteIndex += nbBytesWritten;
00858
00859         fwrite( meshName, meshNameSize * sizeof( char ), 1, fp );
00860         nbBytesWritten = meshNameSize * sizeof( char );
00861         byteIndex += nbBytesWritten;
00862
00863         stdext::hash_map< unsigned long int, int > verticesMap;
00864         typedef std::pair< unsigned long int, int > PR;
00865
00866         int vertexIndex = 0;
00867
00868         // Hash only vertices from faces that are not deleted
00869
00870         std::list< EpaFace* >::iterator facesItr( m_faces.begin() );
00871         int nbFaces = 0;
00872
00873         while ( facesItr != m_faces.end() )
00874         {
00875                 EpaFace* pFace = *facesItr;
00876
00877                 if ( !pFace->m_deleted )
00878                 {
00879                         stdext::hash_map< unsigned long int, int >::const_iterator vertexItr;
00880
00881                         vertexItr = verticesMap.find( ( unsigned long int ) pFace->m_pVertices[ 0 ] );
00882                         if ( vertexItr == verticesMap.end() )
00883                         {
00884                                 verticesMap.insert( PR( ( unsigned long int ) pFace->m_pVertices[ 0 ], vertexIndex ) );
00885                                 ++vertexIndex;
00886                         }
00887
00888                         vertexItr = verticesMap.find( ( unsigned long int ) pFace->m_pVertices[ 1 ] );
00889                         if ( vertexItr == verticesMap.end() )
00890                         {
00891                                 verticesMap.insert( PR( ( unsigned long int ) pFace->m_pVertices[ 1 ], vertexIndex ) );
00892                                 ++vertexIndex;
00893                         }
00894
00895                         vertexItr = verticesMap.find( ( unsigned long int ) pFace->m_pVertices[ 2 ] );
00896                         if ( vertexItr == verticesMap.end() )
00897                         {
00898                                 verticesMap.insert( PR( ( unsigned long int ) pFace->m_pVertices[ 2 ], vertexIndex ) );
00899                                 ++vertexIndex;
00900                         }
00901
00902                         ++nbFaces;
00903                 }
00904
00905                 ++facesItr;
00906         }
00907
00908         unsigned long int nbVertices = verticesMap.size();
00909         fwrite( &nbVertices, sizeof( nbVertices ), 1, fp );
00910         nbBytesWritten = sizeof( nbVertices );
00911         byteIndex += nbBytesWritten;
00912
00913         // Collect all safe vertices
00914
00915         float* pVertices = new float[ verticesMap.size() * 3 ];
00916
00917         stdext::hash_map< unsigned long int, int >::iterator verticesItr( verticesMap.begin() );
00918
00919         while ( verticesItr != verticesMap.end() )
00920         {
00921                 stdext::hash_map< unsigned long int, int >::const_iterator vertexItr;
00922
00923                 PR pr = *verticesItr;
00924
00925                 vertexItr = verticesMap.find( pr.first );
00926                 assert( ( vertexItr != verticesMap.end() ) && "Vertex not found in hash table!" );
00927
00928                 EpaVertex* pVertex = ( EpaVertex* ) vertexItr->first;
00929
00930                 pVertices[ vertexItr->second * 3         ] = pVertex->m_point.x();
00931                 pVertices[ vertexItr->second * 3 + 1 ] = pVertex->m_point.y();
00932                 pVertices[ vertexItr->second * 3 + 2 ] = pVertex->m_point.z();
00933
00934                 ++verticesItr;
00935         }
00936
00937         unsigned long int* pIndices = new unsigned long int[ nbFaces * 3 ];
00938
00939         facesItr = m_faces.begin();
00940
00941         int facesIndex = 0;
00942         while ( facesItr != m_faces.end() )
00943         {
00944                 EpaFace* pFace = *facesItr;
00945
00946                 if ( !pFace->m_deleted )
00947                 {
00948                         stdext::hash_map< unsigned long int, int >::const_iterator vertexItr;
00949
00950                         int verticesIndices[ 3 ];
00951
00952                         vertexItr = verticesMap.find( ( unsigned long int ) pFace->m_pVertices[ 0 ] );
00953                         assert( ( vertexItr != verticesMap.end() ) && "Vertex not found in hash table!" );
00954                         verticesIndices[ 0 ] = vertexItr->second;
00955
00956                         vertexItr = verticesMap.find( ( unsigned long int ) pFace->m_pVertices[ 1 ] );
00957                         assert( ( vertexItr != verticesMap.end() ) && "Vertex not found in hash table!" );
00958                         verticesIndices[ 1 ] = vertexItr->second;
00959
00960                         vertexItr = verticesMap.find( ( unsigned long int ) pFace->m_pVertices[ 2 ] );
00961                         assert( ( vertexItr != verticesMap.end() ) && "Vertex not found in hash table!" );
00962                         verticesIndices[ 2 ] = vertexItr->second;
00963
00964                         pIndices[ facesIndex * 3         ] = verticesIndices[ 0 ];
00965                         pIndices[ facesIndex * 3 + 1 ] = verticesIndices[ 1 ];
00966                         pIndices[ facesIndex * 3 + 2 ] = verticesIndices[ 2 ];
00967
00968                         ++facesIndex;
00969                 }
00970
00971                 ++facesItr;
00972         }
00973
00974         fwrite( &nbFaces, sizeof( nbFaces ), 1, fp );
00975         nbBytesWritten = sizeof( nbFaces );
00976         byteIndex += nbBytesWritten;
00977
00978         bool hasSmoothingGroups = false;
00979         fwrite( &hasSmoothingGroups, sizeof( hasSmoothingGroups ), 1, fp );
00980         nbBytesWritten = sizeof( hasSmoothingGroups );
00981         byteIndex += nbBytesWritten;
00982
00983         fwrite( pVertices, verticesMap.size() * 3 * sizeof( float ), 1, fp );
00984         nbBytesWritten = verticesMap.size() * 3 * sizeof( float );
00985         byteIndex += nbBytesWritten;
00986
00987         // write indices
00988         fwrite( pIndices, nbFaces * 3 * sizeof( unsigned long int ), 1, fp );
00989         nbBytesWritten = nbFaces * 3 * sizeof( unsigned long int );
00990         byteIndex += nbBytesWritten;
00991
00992         delete[] pVertices;
00993         delete[] pIndices;
00994
00995         geometrySize = byteIndex - geometryOffset;
00996
00997         fseek( fp, geometryOffsetAtByteNb, SEEK_SET );
00998
00999         fwrite( &geometryOffset, sizeof( geometryOffset ), 1, fp );
01000         nbBytesWritten = sizeof( geometryOffset );
01001         byteIndex += nbBytesWritten;
01002         fwrite( &geometrySize, sizeof( geometrySize ), 1, fp );
01003         nbBytesWritten = sizeof( geometrySize );
01004         byteIndex += nbBytesWritten;
01005
01006         fseek( fp, byteIndex, SEEK_SET );
01007
01008         fclose( fp );
01009
01010         return true;
01011 }
01012 #endif
01013 #endif
01014
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPolyhedron.h File Reference

Bullet » NarrowPhaseCollision

EpaPolyhedron.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class EpaPolyhedron
Note : This class is not supposed to be a base class. More...

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPolyhedron.h Source File

Bullet » NarrowPhaseCollision

EpaPolyhedron.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_POLYHEDRON_H
00018 #define EPA_POLYHEDRON_H
00019
00020 class EpaFace;
00021 class EpaVertex;
00022
00024 class EpaPolyhedron
00025 {
00026         private :
00027
00029                 EpaPolyhedron( const EpaPolyhedron& epaPolyhedron );
00030                 const EpaPolyhedron& operator = ( const EpaPolyhedron& epaPolyhedron );
00031
00032         public :
00033
00034                 EpaPolyhedron();
00035                 ~EpaPolyhedron();
00036
00037                 bool                                    Create( SimdPoint3* pInitialPoints,
00038                                                                                 SimdPoint3* pSupportPointsOnA, SimdPoint3* pSupportPointsOnB,
00039                                                                                 const int nbInitialPoints );
00040                 void                                    Destroy();
00041
00042                 EpaFace*                                CreateFace();
00043                 EpaHalfEdge*                    CreateHalfEdge();
00044                 EpaVertex*                              CreateVertex( const SimdPoint3& wSupportPoint,
00045                                                                                           const SimdPoint3& wSupportPointOnA,
00046                                                                                           const SimdPoint3& wSupportPointOnB );
00047
00048                 void                                    DeleteFace( EpaFace* pFace );
00049
00050                 void                                    DestroyAllFaces();
00051                 void                                    DestroyAllHalfEdges();
00052                 void                                    DestroyAllVertices();
00053
00054                 bool                                    Expand( const SimdPoint3& wSupportPoint,
00055                                                                                 const SimdPoint3& wSupportPointOnA,
00056                                                                                 const SimdPoint3& wSupportPointOnB,
00057                                                                                 EpaFace* pFace, std::list< EpaFace* >& newFaces );
00058
00059                 std::list< EpaFace* >&  GetFaces();
00060                 int                                             GetNbFaces()            const;
00061
00062         private :
00063
00064                 void                                    DeleteVisibleFaces( const SimdPoint3& point, EpaFace* pFace,
00065                                                                                                         std::list< EpaHalfEdge* >& coneBaseTwinHalfEdges );
00066
00067                 void                                    CreateCone( EpaVertex* pAppexVertex, std::list< EpaHalfEdge* >& baseTwinHalfEdges,
00068                                                                                         std::list< EpaFace* >& newFaces );
00069                 EpaFace*                                CreateConeFace( EpaVertex* pAppexVertex, EpaHalfEdge* pBaseTwinHalfEdge,
00070                                                                                                 std::list< EpaHalfEdge* >& halfEdgesToLink );
00071
00072 #ifdef _DEBUG
00073         public :
00075                 bool                                    _dbgSaveToFile( const char* pFileName );
00076 #endif
00077
00078         private :
00079
00081                 int                                                     m_nbFaces;
00082
00083                 std::list< EpaFace* >           m_faces;
00084                 std::list< EpaHalfEdge* >       m_halfEdges;
00085                 std::list< EpaVertex* >         m_vertices;
00086 };
00087
00088 #endif
00089
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaVertex.h File Reference

Bullet » NarrowPhaseCollision

EpaVertex.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class EpaVertex
Note : This class is not supposed to be a base class. More...

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaVertex.h Source File

Bullet » NarrowPhaseCollision

EpaVertex.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 EPA Copyright (c) Ricardo Padrela 2006
00006
00007 This software is provided 'as-is', without any express or implied warranty.
00008 In no event will the authors be held liable for any damages arising from the use of this software.
00009 Permission is granted to anyone to use this software for any purpose,
00010 including commercial applications, and to alter it and redistribute it freely,
00011 subject to the following restrictions:
00012
00013 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 3. This notice may not be removed or altered from any source distribution.
00016 */
00017 #ifndef EPA_VERTEX_H
00018 #define EPA_VERTEX_H
00019
00020 class EpaHalfEdge;
00021
00023 class EpaVertex
00024 {
00025         private :
00026
00028                 EpaVertex( const EpaVertex& epaVertex );
00029                 const EpaVertex&        operator = ( const EpaVertex& epaVertex );
00030
00031         public :
00032
00033                 EpaVertex( const SimdPoint3& point ) : /*m_pHalfEdge( 0 ),*/ m_point( point )
00034                 {
00035                 }
00036
00037                 EpaVertex( const SimdPoint3& point,
00038                                    const SimdPoint3& wSupportPointOnA,
00039                                    const SimdPoint3& wSupportPointOnB ) : /*m_pHalfEdge( 0 ),*/ m_point( point ),
00040                                                                                                                   m_wSupportPointOnA( wSupportPointOnA ),
00041                                                                                                                   m_wSupportPointOnB( wSupportPointOnB )
00042                 {
00043                 }
00044
00045                 ~EpaVertex()
00046                 {
00047                 }
00048
00049         public :
00050
00052                 //EpaHalfEdge*          m_pHalfEdge;
00053
00054                 SimdPoint3                      m_point;
00055
00056                 SimdPoint3                      m_wSupportPointOnA;
00057                 SimdPoint3                      m_wSupportPointOnB;
00058 };
00059
00060 #endif
00061
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_List.h File Reference

LinearMath

GEN_List.h File Reference

Go to the source code of this file.

Classes

class | GEN_Link
class | GEN_List

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_List.h Source File

LinearMath

GEN_List.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef GEN_LIST_H
00018 #define GEN_LIST_H
00019
00020 class GEN_Link {
00021 public:
00022     GEN_Link() : m_next(0), m_prev(0) {}
00023     GEN_Link(GEN_Link *next, GEN_Link *prev) : m_next(next), m_prev(prev) {}
00024
00025     GEN_Link *getNext() const { return m_next; }
00026     GEN_Link *getPrev() const { return m_prev; }
00027
00028     bool isHead() const { return m_prev == 0; }
00029     bool isTail() const { return m_next == 0; }
00030
00031     void insertBefore(GEN_Link *link) {
00032         m_next         = link;
00033         m_prev         = link->m_prev;
00034         m_next->m_prev = this;
00035         m_prev->m_next = this;
00036     }
00037
00038     void insertAfter(GEN_Link *link) {
00039         m_next         = link->m_next;
00040         m_prev         = link;
00041         m_next->m_prev = this;
00042         m_prev->m_next = this;
00043     }
00044
00045     void remove() {
00046         m_next->m_prev = m_prev;
00047         m_prev->m_next = m_next;
00048     }
00049
00050 private:
00051     GEN_Link  *m_next;
00052     GEN_Link  *m_prev;
00053 };
00054
00055 class GEN_List {
00056 public:
00057     GEN_List() : m_head(&m_tail, 0), m_tail(0, &m_head) {}
00058
00059     GEN_Link *getHead() const { return m_head.getNext(); }
00060     GEN_Link *getTail() const { return m_tail.getPrev(); }
00061
00062     void addHead(GEN_Link *link) { link->insertAfter(&m_head); }
00063     void addTail(GEN_Link *link) { link->insertBefore(&m_tail); }
00064
00065 private:
00066     GEN_Link m_head;
00067     GEN_Link m_tail;
00068 };
00069
00070 #endif
00071
00072
00073
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_MinMax.h File Reference

LinearMath

GEN_MinMax.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T>
SIMD_FORCE_INLINE const T & | GEN_min (const T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE const T & | GEN_max (const T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE const T & | GEN_clamped (const T &a, const T &lb, const T &ub)
template<class T>
SIMD_FORCE_INLINE void | GEN_set_min (T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE void | GEN_set_max (T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE void | GEN_clamp (T &a, const T &lb, const T &ub)

Function Documentation

template<class T>
SIMD_FORCE_INLINE void GEN_clamp | ( | T & | a,
 |  | const T & | lb,
 |  | const T & | ub
 | ) |

Definition at line 57 of file GEN_MinMax.h.

template<class T>
SIMD_FORCE_INLINE const T& GEN_clamped | ( | const T & | a,
 |  | const T & | lb,
 |  | const T & | ub
 | ) |

Definition at line 33 of file GEN_MinMax.h.

Referenced by RigidBody::applyForces(), and RigidBody::setDamping().

template<class T>
SIMD_FORCE_INLINE const T& GEN_max | ( | const T & | a,
 |  | const T & | b
 | ) |

Definition at line 27 of file GEN_MinMax.h.

template<class T>
SIMD_FORCE_INLINE const T& GEN_min | ( | const T & | a,
 |  | const T & | b
 | ) |

Definition at line 21 of file GEN_MinMax.h.

template<class T>
SIMD_FORCE_INLINE void GEN_set_max | ( | T & | a,
 |  | const T & | b
 | ) |

Definition at line 48 of file GEN_MinMax.h.

Referenced by resolveSingleFriction().

template<class T>
SIMD_FORCE_INLINE void GEN_set_min | ( | T & | a,
 |  | const T & | b
 | ) |

Definition at line 39 of file GEN_MinMax.h.

Referenced by resolveSingleFriction().

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_MinMax.h Source File

LinearMath

GEN_MinMax.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef GEN_MINMAX_H
00018 #define GEN_MINMAX_H
00019
00020 template <class T>
00021 SIMD_FORCE_INLINE const T& GEN_min(const T& a, const T& b)
00022 {
00023   return b < a ? b : a;
00024 }
00025
00026 template <class T>
00027 SIMD_FORCE_INLINE const T& GEN_max(const T& a, const T& b)
00028 {
00029   return  a < b ? b : a;
00030 }
00031
00032 template <class T>
00033 SIMD_FORCE_INLINE const T& GEN_clamped(const T& a, const T& lb, const T& ub)
00034 {
00035         return a < lb ? lb : (ub < a ? ub : a);
00036 }
00037
00038 template <class T>
00039 SIMD_FORCE_INLINE void GEN_set_min(T& a, const T& b)
00040 {
00041     if (b < a)
00042         {
00043                 a = b;
00044         }
00045 }
00046
00047 template <class T>
00048 SIMD_FORCE_INLINE void GEN_set_max(T& a, const T& b)
00049 {
00050     if (a < b)
00051         {
00052                 a = b;
00053         }
00054 }
00055
00056 template <class T>
00057 SIMD_FORCE_INLINE void GEN_clamp(T& a, const T& lb, const T& ub)
00058 {
00059         if (a < lb)
00060         {
00061                 a = lb;
00062         }
00063         else if (ub < a)
00064         {
00065                 a = ub;
00066         }
00067 }
00068
00069 #endif
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_random.h File Reference

LinearMath

GEN_random.h File Reference

#include <stdlib.h>

Include dependency graph for GEN_random.h:

Go to the source code of this file.

Defines

#define | GEN_RAND_MAX RAND_MAX

Functions

SIMD_FORCE_INLINE void | GEN_srand (unsigned int seed)
SIMD_FORCE_INLINE unsigned int | GEN_rand ()

Define Documentation

#define GEN_RAND_MAX RAND_MAX

Definition at line 34 of file GEN_random.h.

Function Documentation

SIMD_FORCE_INLINE unsigned int GEN_rand ( )

Definition at line 37 of file GEN_random.h.

SIMD_FORCE_INLINE void GEN_srand ( unsigned int seed )

Definition at line 36 of file GEN_random.h.

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_random.h Source File

LinearMath

GEN_random.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef GEN_RANDOM_H
00018 #define GEN_RANDOM_H
00019
00020 #ifdef MT19937
00021
00022 #include <limits.h>
00023 #include <mt19937.h>
00024
00025 #define GEN_RAND_MAX UINT_MAX
00026
00027 SIMD_FORCE_INLINE void         GEN_srand(unsigned int seed) { init_genrand(seed); }
00028 SIMD_FORCE_INLINE unsigned int GEN_rand()                   { return genrand_int32(); }
00029
00030 #else
00031
00032 #include <stdlib.h>
00033
00034 #define GEN_RAND_MAX RAND_MAX
00035
00036 SIMD_FORCE_INLINE void         GEN_srand(unsigned int seed) { srand(seed); }
00037 SIMD_FORCE_INLINE unsigned int GEN_rand()                   { return rand(); }
00038
00039 #endif
00040
00041 #endif
00042
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Geometry.cpp File Reference

LinearMath

Geometry.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Geometry.cpp Source File

LinearMath

Geometry.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Geometry.cpp
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00008 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00009 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00010 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00011 // 3. This notice may not be removed or altered from any source distribution.
00012
00013
00015 #ifdef WIN32
00016 #if _MSC_VER >= 1310
00017
00018
00019 #include "Geometry.h"
00020 #include "Maths.h"
00021 #include <assert.h>
00022
00023
00025 // Line
00026
00027
00028
00030 // Ray
00031
00032
00033 // returns false if the lines are parallel
00034 // t1 and t2 are set to the times of the nearest points on each line
00035 bool Intersect(const Line& la, const Line& lb, float& ta, float& tb)
00036 {
00037         Vector3 ea = la.m_end - la.m_start;
00038         Vector3 eb = lb.m_end - lb.m_start;
00039         Vector3 u = la.m_start - lb.m_start;
00040
00041         float a = Dot(ea, ea);
00042         float b = Dot(ea, eb);
00043         float c = Dot(eb, eb);
00044         float d = Dot(ea, u);
00045         float e = Dot(eb, u);
00046
00047         float det = (a * c - b * b);
00048
00049         if (Abs(det) < 0.001f)
00050                 return false;
00051
00052         float invDet = RcpNr(det);
00053         ta = (b * e - c * d) * invDet;
00054         tb = (a * e - b * d) * invDet;
00055
00056         return true;
00057 }
00058
00059 bool IntersectSegments(const Line& la, const Line& lb, float& ta, float& tb)
00060 {
00061         Vector3 ea = la.m_end - la.m_start;
00062         Vector3 eb = lb.m_end - lb.m_start;
00063         Vector3 u = la.m_start - lb.m_start;
00064
00065         float a = Dot(ea, ea);
00066         float b = Dot(ea, eb);
00067         float c = Dot(eb, eb);
00068         float d = Dot(ea, u);
00069         float e = Dot(eb, u);
00070
00071         float det = (a * c - b * b);
00072
00073         if (Abs(det) < 0.001f)
00074                 return false;
00075
00076         float numa = (b * e - c * d);
00077         float numb = (a * e - b * d);
00078
00079         // clip a
00080         float dena = det, denb = det;
00081         if (numa < 0.0f)
00082         {
00083                 numa = 0.0f;
00084                 numb = e;
00085                 denb = c;
00086         }
00087         else if (numa > det)
00088         {
00089                 numa = det;
00090                 numb = e + b;
00091                 denb = c;
00092         }
00093         else
00094                 denb = det;
00095
00096         // clip b
00097         if (numb < 0.0f)
00098         {
00099                 numb = 0.0f;
00100                 if (-d < 0.0f)
00101                 {
00102                         numa = 0.0f;
00103                 }
00104                 else if (-d > a)
00105                 {
00106                         numa = dena;
00107                 }
00108                 else
00109                 {
00110                         numa = -d;
00111                         dena = a;
00112                 }
00113         }
00114         else if (numb > denb)
00115         {
00116                 numb = denb;
00117                 if ((-d + b) < 0.0f)
00118                 {
00119                         numa = 0.0f;
00120                 }
00121                 else if ((-d + b) > a)
00122                 {
00123                         numa = dena;
00124                 }
00125                 else
00126                 {
00127                         numa = -d + b;
00128                         dena = a;
00129                 }
00130         }
00131
00132         // compute the times
00133         ta = numa / dena;
00134         tb = numb / denb;
00135
00136         return true;
00137 }
00138
00139 // returns intersection of 2 rays or nearest point to it
00140 // t1 and t2 are set to the times of the nearest points on each ray (not clamped to ray though)
00141 // asserts if rays are parallel
00142 bool Intersect(const Ray& ra, const Ray& rb, float& ta, float& tb)
00143 {
00144         Vector3 u = ra.m_start - rb.m_start;
00145
00146         Scalar a = Dot(ra.m_dir, ra.m_dir);
00147         Scalar b = Dot(ra.m_dir, rb.m_dir);
00148         Scalar c = Dot(rb.m_dir, rb.m_dir);
00149         Scalar d = Dot(ra.m_dir, u);
00150         Scalar e = Dot(rb.m_dir, u);
00151
00152         Scalar det = (a * c - b * b);
00153
00154         if (Abs(det) < 0.001f)
00155                 return false;
00156
00157         Scalar invDet = RcpNr(det);
00158         ta = (b * e - c * d) * invDet;
00159         tb = (a * e - b * d) * invDet;
00160
00161         return true;
00162 }
00163
00164
00166 // Plane
00167 bool Plane::IsFinite() const
00168 {
00169         if (IsNan(GetX()) || IsNan(GetY()) || IsNan(GetZ()) || IsNan(GetW()))
00170                 return false;
00171         return true;
00172 }
00173
00175 // Bounds3 - axis aligned bounding box
00176
00177 Bounds3::OriginTag Bounds3::Origin;
00178 Bounds3::EmptyTag Bounds3::Empty;
00179
00180 bool Bounds3::Intersect(const Ray& ray, float& tnear, float& tfar) const
00181 {
00182         Vector3 rcpDir = RcpNr(ray.m_dir);
00183
00184         Vector3 v1 = (m_min - ray.m_start) * rcpDir;
00185         Vector3 v2 = (m_max - ray.m_start) * rcpDir;
00186
00187         Vector3 vmin = Min(v1, v2);
00188         Vector3 vmax = Max(v1, v2);
00189
00190         Scalar snear = MaxComp(vmin);
00191
00192         // handle ray being parallel to any axis
00193         // (most rays don't need this)
00194         if (IsNan(snear))
00195         {
00196                 int inside = (ray.m_start >= m_min) & (ray.m_start <= m_max);
00197
00198                 for (int i = 0; i < 3; i++)
00199                 {
00200                         if (IsNan(rcpDir.Get(i)))
00201                         {
00202                                 if ((inside & (1 << i)) == 0)
00203                                         return false;
00204                                 vmin.Set(i, Scalar::Consts::MinValue);
00205                                 vmax.Set(i, Scalar::Consts::MaxValue);
00206                         }
00207                 }
00208
00209                 snear = MaxComp(vmin);
00210         }
00211
00212         tnear = snear;
00213         tfar = MinComp(vmax);
00214
00215         if (tnear > tfar)
00216                 return false;
00217
00218         if (tfar < 0.0f)
00219                 return false;
00220
00221         return true;
00222 }
00223
00224
00226 // OrientedBounds3 - oriented bounding box
00227
00228 #endif
00229 #endif //WIN32
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Geometry.h File Reference

LinearMath

Geometry.h File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Geometry.h Source File

LinearMath

Geometry.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Geometry.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017
00018 #ifndef BULLET_MATH_GEOMETRY_H
00019 #define BULLET_MATH_GEOMETRY_H
00020
00021
00022 #ifdef WIN32
00023
00024 #include "Vector.h"
00025 #include "Matrix.h"
00026
00027 class Matrix44;
00028 class Transform;
00029
00030
00032 // Line
00033 class Line
00034 {
00035 public:
00036         Point3 m_start;
00037         Point3 m_end;
00038
00039         Line();
00040         Line(const Point3& start, const Point3& end);
00041
00042         // returns false if the lines are parallel
00043         friend bool Intersect(const Line& la, const Line& lb, float& ta, float& tb);
00044         friend bool IntersectSegments(const Line& la, const Line& lb, float& ta, float& tb);
00045
00046         // get projection vector between a point and a line
00047         // (i.e. if you add the vector to the point, then the new point will lie on the line)
00048         friend Vector3 GetProjectionVector(const Line& ln, const Point3& pt);
00049
00050         // get distance from point to line (and time along line)
00051         friend float Distance(const Line& ln, const Point3& pt, float& t);
00052 };
00053
00054
00056 // Ray
00057 class Ray
00058 {
00059 public:
00060         Point3 m_start;
00061         Vector3 m_dir;
00062
00063         Ray();
00064         Ray(const Point3& start, const Vector3& dir);
00065
00066         explicit Ray(const Line& line);
00067
00068         // returns false if the rays are parallel
00069         friend bool Intersect(const Ray& ra, const Ray& rb, float& ta, float& tb);
00070 };
00071
00072
00074 // Plane
00075 class Plane : public Vector4Base
00076 {
00077 public:
00078         // constructors
00079         Plane();
00080         Plane(const Plane& p);
00081         Plane(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w);
00082         Plane(const Vector3& xyz, const Scalar& w);
00083         Plane(const Point3& a, const Point3& b, const Point3& c);
00084         Plane(const Vector3& normal, const Point3& pt);
00085
00086         // construction to constant
00087         Plane(const Maths::ZeroTag&);
00088         Plane(const Maths::UnitXTag&);
00089         Plane(const Maths::UnitYTag&);
00090         Plane(const Maths::UnitZTag&);
00091         Plane(const Maths::UnitNegXTag&);
00092         Plane(const Maths::UnitNegYTag&);
00093         Plane(const Maths::UnitNegZTag&);
00094
00095         // explicit constructors
00096         explicit Plane(const __m128 b);
00097         explicit Plane(const Vector3& v);
00098         explicit Plane(const Vector4& v);
00099         explicit Plane(const float* p);
00100
00101         // assignment
00102         const Plane& operator=(const Plane& v);
00103         const Plane& operator=(const Maths::ZeroTag&);
00104         const Plane& operator=(const Maths::UnitXTag&);
00105         const Plane& operator=(const Maths::UnitYTag&);
00106         const Plane& operator=(const Maths::UnitZTag&);
00107         const Plane& operator=(const Maths::UnitNegXTag&);
00108         const Plane& operator=(const Maths::UnitNegYTag&);
00109         const Plane& operator=(const Maths::UnitNegZTag&);
00110
00111         // element access
00112         const Vector3 GetNormal() const;
00113         const Scalar GetDistance() const;
00114
00115         // transformations
00116         friend const Plane operator-(const Plane& p);
00117         friend const Plane operator*(const Plane& p, const Transform& m);
00118
00119         // operations
00120         friend const Scalar Dot(const Plane& p, const Point3& v);
00121         friend const Scalar Dot(const Point3& v, const Plane& p);
00122
00123         friend const Scalar Dot(const Plane& p, const Vector3& v);
00124         friend const Scalar Dot(const Vector3& v, const Plane& p);
00125
00126         friend const Scalar Dot(const Plane& p, const Vector4& v);
00127         friend const Scalar Dot(const Vector4& v, const Plane& p);
00128
00129         friend const Scalar Intersect(const Plane& p, const Ray& ray);
00130         friend const Scalar Intersect(const Plane& p, const Line& line);
00131
00132         // validation
00133         bool IsFinite() const;
00134 };
00135
00136
00138 // Bounds3 - axis aligned bounding box
00139 class Bounds3
00140 {
00141 public:
00142         Point3 m_min, m_max;
00143
00144         static const enum OriginTag { } Origin;
00145         static const enum EmptyTag { } Empty;
00146
00147         // constructors
00148         Bounds3();
00149         Bounds3(const Bounds3& aabb);
00150         Bounds3(const Point3& min, const Point3& max);
00151
00152         // construction to constant
00153         Bounds3(const OriginTag&);
00154         Bounds3(const EmptyTag&);
00155
00156         // explicit constructors
00157         explicit Bounds3(const Point3& minMax);
00158
00159         // assignment
00160         const Bounds3& operator=(const Bounds3& aabb);
00161         const Bounds3& operator=(const Point3& pt);
00162
00163         const Bounds3& operator=(const OriginTag&);
00164         const Bounds3& operator=(const EmptyTag&);
00165
00166         // in place operations
00167         void operator+=(const Point3& pt);
00168         void operator+=(const Bounds3& aabb);
00169
00170         // operations
00171         friend Bounds3 operator+(const Bounds3& aabb, const Point3& pt);
00172         friend Bounds3 operator+(const Point3& pt, const Bounds3& aabb);
00173         friend Bounds3 operator+(const Bounds3& aabb, const Bounds3& aabb2);
00174
00175         bool Contains(const Point3& pt) const;
00176         bool Contains(const Bounds3& aabb) const;
00177         bool Touches(const Bounds3& aabb) const;
00178
00179         bool Intersect(const Ray& ray, float& tnear, float& tfar) const;
00180         bool Intersect(const Line& line, float& tnear, float& tfar) const;
00181
00182         Point3 GetCenter() const;
00183         Vector3 GetExtent() const;
00184         Vector3 GetSize() const;
00185
00186         // validation
00187         bool IsFinite() const;
00188         bool HasVolume() const;
00189 };
00190
00191
00192 #include "Geometry.inl"
00193
00194 #endif //WIN32
00195 #endif //BULLET_MATH_GEOMETRY_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkConvexCast.cpp File Reference

Bullet » NarrowPhaseCollision

GjkConvexCast.cpp File Reference

#include "GjkConvexCast.h"
#include "CollisionShapes/SphereShape.h"
#include "CollisionShapes/MinkowskiSumShape.h"
#include "GjkPairDetector.h"
#include "PointCollector.h"

Include dependency graph for GjkConvexCast.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkConvexCast.cpp Source File

Bullet » NarrowPhaseCollision

GjkConvexCast.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #include "GjkConvexCast.h"
00019 #include "CollisionShapes/SphereShape.h"
00020 #include "CollisionShapes/MinkowskiSumShape.h"
00021 #include "GjkPairDetector.h"
00022 #include "PointCollector.h"
00023
00024
00025 GjkConvexCast::GjkConvexCast(ConvexShape* convexA,ConvexShape* convexB,SimplexSolverInterface* simplexSolver)
00026 :m_simplexSolver(simplexSolver),
00027 m_convexA(convexA),
00028 m_convexB(convexB)
00029 {
00030 }
00031
00032 bool    GjkConvexCast::calcTimeOfImpact(
00033                                         const SimdTransform& fromA,
00034                                         const SimdTransform& toA,
00035                                         const SimdTransform& fromB,
00036                                         const SimdTransform& toB,
00037                                         CastResult& result)
00038 {
00039
00040
00041         MinkowskiSumShape combi(m_convexA,m_convexB);
00042         MinkowskiSumShape* convex = &combi;
00043
00044         SimdTransform   rayFromLocalA;
00045         SimdTransform   rayToLocalA;
00046
00047         rayFromLocalA = fromA.inverse()* fromB;
00048         rayToLocalA = toA.inverse()* toB;
00049
00050
00051         SimdTransform trA,trB;
00052         trA = SimdTransform(fromA);
00053         trB = SimdTransform(fromB);
00054         trA.setOrigin(SimdPoint3(0,0,0));
00055         trB.setOrigin(SimdPoint3(0,0,0));
00056
00057         convex->SetTransformA(trA);
00058         convex->SetTransformB(trB);
00059
00060
00061
00062
00063         float radius = 0.01f;
00064
00065         SimdScalar lambda = 0.f;
00066         SimdVector3 s = rayFromLocalA.getOrigin();
00067         SimdVector3 r = rayToLocalA.getOrigin()-rayFromLocalA.getOrigin();
00068         SimdVector3 x = s;
00069         SimdVector3 n;
00070         n.setValue(0,0,0);
00071         bool hasResult = false;
00072         SimdVector3 c;
00073
00074         float lastLambda = lambda;
00075
00076         //first solution, using GJK
00077
00078         //no penetration support for now, perhaps pass a pointer when we really want it
00079         ConvexPenetrationDepthSolver* penSolverPtr = 0;
00080
00081         SimdTransform identityTrans;
00082         identityTrans.setIdentity();
00083
00084         SphereShape     raySphere(0.0f);
00085         raySphere.SetMargin(0.f);
00086
00087         SimdTransform sphereTr;
00088         sphereTr.setIdentity();
00089         sphereTr.setOrigin( rayFromLocalA.getOrigin());
00090
00091         result.DrawCoordSystem(sphereTr);
00092         {
00093                 PointCollector  pointCollector1;
00094                 GjkPairDetector gjk(&raySphere,convex,m_simplexSolver,penSolverPtr);
00095
00096                 GjkPairDetector::ClosestPointInput input;
00097                 input.m_transformA = sphereTr;
00098                 input.m_transformB = identityTrans;
00099                 gjk.GetClosestPoints(input,pointCollector1,0);
00100
00101                 hasResult = pointCollector1.m_hasResult;
00102                 c = pointCollector1.m_pointInWorld;
00103                 n = pointCollector1.m_normalOnBInWorld;
00104         }
00105
00106
00107
00108         if (hasResult)
00109         {
00110                 SimdScalar dist;
00111                 dist = (c-x).length();
00112                 if (dist < radius)
00113                 {
00114                         //penetration
00115                         lastLambda = 1.f;
00116                 }
00117
00118                 //not close enough
00119                 while (dist > radius)
00120                 {
00121
00122                         n = x - c;
00123                         SimdScalar nDotr = n.dot(r);
00124
00125                         if (nDotr >= -(SIMD_EPSILON*SIMD_EPSILON))
00126                                 return false;
00127
00128                         lambda = lambda - n.dot(n) / nDotr;
00129                         if (lambda <= lastLambda)
00130                                 break;
00131
00132                         lastLambda = lambda;
00133
00134                         x = s + lambda * r;
00135
00136                         sphereTr.setOrigin( x );
00137                         result.DrawCoordSystem(sphereTr);
00138                         PointCollector  pointCollector;
00139                         GjkPairDetector gjk(&raySphere,convex,m_simplexSolver,penSolverPtr);
00140                         GjkPairDetector::ClosestPointInput input;
00141                         input.m_transformA = sphereTr;
00142                         input.m_transformB = identityTrans;
00143                         gjk.GetClosestPoints(input,pointCollector,0);
00144                         if (pointCollector.m_hasResult)
00145                         {
00146                                 if (pointCollector.m_distance < 0.f)
00147                                 {
00148                                         //degeneracy, report a hit
00149                                         result.m_fraction = lastLambda;
00150                                         result.m_normal = n;
00151                                         return true;
00152                                 }
00153                                 c = pointCollector.m_pointInWorld;
00154                                 dist = (c-x).length();
00155                         } else
00156                         {
00157                                 //??
00158                                 return false;
00159                         }
00160
00161                 }
00162
00163                 if (lastLambda < 1.f)
00164                 {
00165
00166                         result.m_fraction = lastLambda;
00167                         result.m_normal = n;
00168                         return true;
00169                 }
00170         }
00171
00172         return false;
00173 }
00174
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkConvexCast.h File Reference

Bullet » NarrowPhaseCollision

GjkConvexCast.h File Reference

#include <CollisionShapes/CollisionMargin.h>
#include "SimdVector3.h"
#include "ConvexCast.h"
#include "SimplexSolverInterface.h"

Include dependency graph for GjkConvexCast.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class GjkConvexCast
GjkConvexCast performs a raycast on a convex object using support mapping. More...

Generated on Wed May 24 13:59:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkConvexCast.h Source File

Bullet » NarrowPhaseCollision

GjkConvexCast.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #ifndef GJK_CONVEX_CAST_H
00019 #define GJK_CONVEX_CAST_H
00020
00021 #include <CollisionShapes/CollisionMargin.h>
00022
00023 #include "SimdVector3.h"
00024 #include "ConvexCast.h"
00025 class ConvexShape;
00026 class MinkowskiSumShape;
00027 #include "SimplexSolverInterface.h"
00028
00030 class GjkConvexCast : public ConvexCast
00031 {
00032         SimplexSolverInterface* m_simplexSolver;
00033         ConvexShape*    m_convexA;
00034         ConvexShape*    m_convexB;
00035
00036 public:
00037
00038         GjkConvexCast(ConvexShape*      convexA,ConvexShape* convexB,SimplexSolverInterface* simplexSolver);
00039
00041         virtual bool    calcTimeOfImpact(
00042                                         const SimdTransform& fromA,
00043                                         const SimdTransform& toA,
00044                                         const SimdTransform& fromB,
00045                                         const SimdTransform& toB,
00046                                         CastResult& result);
00047
00048 };
00049
00050 #endif //GJK_CONVEX_CAST_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkPairDetector.cpp File Reference

Bullet » NarrowPhaseCollision

GjkPairDetector.cpp File Reference

#include "GjkPairDetector.h"
#include "CollisionShapes/ConvexShape.h"
#include "NarrowPhaseCollision/SimplexSolverInterface.h"
#include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"

Include dependency graph for GjkPairDetector.cpp:

Go to the source code of this file.

Variables

static const SimdScalar | rel_error = SimdScalar(1.0e-5)
SimdScalar rel_error2 = rel_error * rel_error
float | maxdist2 = 1.e30f

Variable Documentation

float maxdist2 = 1.e30f

Definition at line 23 of file GjkPairDetector.cpp.

const SimdScalar rel_error = SimdScalar(1.0e-5) [static]

Definition at line 21 of file GjkPairDetector.cpp.

SimdScalar rel_error2 = rel_error * rel_error

Definition at line 22 of file GjkPairDetector.cpp.

Referenced by GjkPairDetector::GetClosestPoints().

Generated on Wed May 24 13:59:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkPairDetector.cpp Source File

Bullet » NarrowPhaseCollision

GjkPairDetector.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "GjkPairDetector.h"
00017 #include "CollisionShapes/ConvexShape.h"
00018 #include "NarrowPhaseCollision/SimplexSolverInterface.h"
00019 #include "NarrowPhaseCollision/ConvexPenetrationDepthSolver.h"
00020
00021 static const SimdScalar rel_error = SimdScalar(1.0e-5);
00022 SimdScalar rel_error2 = rel_error * rel_error;
00023 float maxdist2 = 1.e30f;
00024
00025
00026
00027 GjkPairDetector::GjkPairDetector(ConvexShape* objectA,ConvexShape* objectB,SimplexSolverInterface* simplexSolver,ConvexPenetrationDepthSolver*  penetrationDepthSolver)
00028 :m_cachedSeparatingAxis(0.f,0.f,1.f),
00029 m_penetrationDepthSolver(penetrationDepthSolver),
00030 m_simplexSolver(simplexSolver),
00031 m_minkowskiA(objectA),
00032 m_minkowskiB(objectB),
00033 m_ignoreMargin(false)
00034 {
00035 }
00036
00037 void GjkPairDetector::GetClosestPoints(const ClosestPointInput& input,Result& output,class IDebugDraw* debugDraw)
00038 {
00039         SimdScalar distance=0.f;
00040         SimdVector3     normalInB(0.f,0.f,0.f);
00041         SimdVector3 pointOnA,pointOnB;
00042
00043         float marginA = m_minkowskiA->GetMargin();
00044         float marginB = m_minkowskiB->GetMargin();
00045
00046         //for CCD we don't use margins
00047         if (m_ignoreMargin)
00048         {
00049                 marginA = 0.f;
00050                 marginB = 0.f;
00051         }
00052
00053         bool isValid = false;
00054         bool checkSimplex = false;
00055         bool checkPenetration = true;
00056
00057         {
00058                 SimdScalar squaredDistance = SIMD_INFINITY;
00059                 SimdScalar delta = 0.f;
00060
00061                 SimdScalar margin = marginA + marginB;
00062
00063
00064
00065                 m_simplexSolver->reset();
00066
00067                 while (true)
00068                 {
00069
00070                         SimdVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis();
00071                         SimdVector3 seperatingAxisInB = m_cachedSeparatingAxis* input.m_transformB.getBasis();
00072
00073                         SimdVector3 pInA = m_minkowskiA->LocalGetSupportingVertexWithoutMargin(seperatingAxisInA);
00074                         SimdVector3 qInB = m_minkowskiB->LocalGetSupportingVertexWithoutMargin(seperatingAxisInB);
00075                         SimdPoint3  pWorld = input.m_transformA(pInA);
00076                         SimdPoint3  qWorld = input.m_transformB(qInB);
00077
00078                         SimdVector3 w   = pWorld - qWorld;
00079                         delta = m_cachedSeparatingAxis.dot(w);
00080
00081                         // potential exit, they don't overlap
00082                         if ((delta > SimdScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared))
00083                         {
00084                                 checkPenetration = false;
00085                                 break;
00086                         }
00087
00088                         //exit 0: the new point is already in the simplex, or we didn't come any closer
00089                         if (m_simplexSolver->inSimplex(w))
00090                         {
00091                                 checkSimplex = true;
00092                                 break;
00093                         }
00094                         // are we getting any closer ?
00095                         if (squaredDistance - delta <= squaredDistance * rel_error2)
00096                         {
00097                                 checkSimplex = true;
00098                                 break;
00099                         }
00100                         //add current vertex to simplex
00101                         m_simplexSolver->addVertex(w, pWorld, qWorld);
00102
00103                         //calculate the closest point to the origin (update vector v)
00104                         if (!m_simplexSolver->closest(m_cachedSeparatingAxis))
00105                         {
00106                                 checkSimplex = true;
00107                                 break;
00108                         }
00109
00110                         SimdScalar previousSquaredDistance = squaredDistance;
00111                         squaredDistance = m_cachedSeparatingAxis.length2();
00112
00113                         //redundant m_simplexSolver->compute_points(pointOnA, pointOnB);
00114
00115                         //are we getting any closer ?
00116                         if (previousSquaredDistance - squaredDistance <= SIMD_EPSILON * previousSquaredDistance)
00117                         {
00118                                 m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
00119                                 checkSimplex = true;
00120                                 break;
00121                         }
00122                         bool check = (!m_simplexSolver->fullSimplex());
00123                         //bool check = (!m_simplexSolver->fullSimplex() && squaredDistance > SIMD_EPSILON * m_simplexSolver->maxVertex());
00124
00125                         if (!check)
00126                         {
00127                                 //do we need this backup_closest here ?
00128                                 m_simplexSolver->backup_closest(m_cachedSeparatingAxis);
00129                                 break;
00130                         }
00131                 }
00132
00133                 if (checkSimplex)
00134                 {
00135                         m_simplexSolver->compute_points(pointOnA, pointOnB);
00136                         normalInB = pointOnA-pointOnB;
00137                         float lenSqr = m_cachedSeparatingAxis.length2();
00138                         //valid normal
00139                         if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
00140                         {
00141                                 float rlen = 1.f / SimdSqrt(lenSqr );
00142                                 normalInB *= rlen; //normalize
00143                                 SimdScalar s = SimdSqrt(squaredDistance);
00144                                 ASSERT(s > SimdScalar(0.0));
00145                                 pointOnA -= m_cachedSeparatingAxis * (marginA / s);
00146                                 pointOnB += m_cachedSeparatingAxis * (marginB / s);
00147                                 distance = ((1.f/rlen) - margin);
00148                                 isValid = true;
00149                         }
00150                 }
00151
00152                 if (checkPenetration && !isValid)
00153                 {
00154                         //penetration case
00155
00156                         //if there is no way to handle penetrations, bail out
00157                         if (m_penetrationDepthSolver)
00158                         {
00159                                 // Penetration depth case.
00160                                 isValid = m_penetrationDepthSolver->CalcPenDepth(
00161                                         *m_simplexSolver,
00162                                         m_minkowskiA,m_minkowskiB,
00163                                         input.m_transformA,input.m_transformB,
00164                                         m_cachedSeparatingAxis, pointOnA, pointOnB,
00165                                         debugDraw
00166                                         );
00167
00168                                 if (isValid)
00169                                 {
00170                                         normalInB = pointOnB-pointOnA;
00171                                         float lenSqr = normalInB.length2();
00172                                         if (lenSqr > (SIMD_EPSILON*SIMD_EPSILON))
00173                                         {
00174                                                 normalInB /= SimdSqrt(lenSqr);
00175                                                 distance = -(pointOnA-pointOnB).length();
00176                                         } else
00177                                         {
00178                                                 isValid = false;
00179                                         }
00180                                 }
00181                         }
00182                 }
00183         }
00184
00185         if (isValid)
00186         {
00187                 output.AddContactPoint(
00188                         normalInB,
00189                         pointOnB,
00190                         distance);
00191                 //printf("gjk add:%f",distance);
00192         }
00193
00194
00195 }
00196
00197
00198
00199
00200
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkPairDetector.h File Reference

Bullet » NarrowPhaseCollision

GjkPairDetector.h File Reference

#include "DiscreteCollisionDetectorInterface.h"
#include "SimdPoint3.h"
#include <CollisionShapes/CollisionMargin.h>
#include "SimplexSolverInterface.h"

Include dependency graph for GjkPairDetector.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class GjkPairDetector
GjkPairDetector uses GJK to implement the DiscreteCollisionDetectorInterface. More...

Generated on Wed May 24 13:59:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkPairDetector.h Source File

Bullet » NarrowPhaseCollision

GjkPairDetector.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018
00019 #ifndef GJK_PAIR_DETECTOR_H
00020 #define GJK_PAIR_DETECTOR_H
00021
00022 #include "DiscreteCollisionDetectorInterface.h"
00023 #include "SimdPoint3.h"
00024
00025 #include <CollisionShapes/CollisionMargin.h>
00026
00027 class ConvexShape;
00028 #include "SimplexSolverInterface.h"
00029 class ConvexPenetrationDepthSolver;
00030
00032 class GjkPairDetector : public DiscreteCollisionDetectorInterface
00033 {
00034
00035
00036         SimdVector3     m_cachedSeparatingAxis;
00037         ConvexPenetrationDepthSolver*   m_penetrationDepthSolver;
00038         SimplexSolverInterface* m_simplexSolver;
00039         ConvexShape* m_minkowskiA;
00040         ConvexShape* m_minkowskiB;
00041         bool            m_ignoreMargin;
00042
00043 public:
00044
00045         GjkPairDetector(ConvexShape* objectA,ConvexShape* objectB,SimplexSolverInterface* simplexSolver,ConvexPenetrationDepthSolver*   penetrationDepthSolver);
00046         virtual ~GjkPairDetector() {};
00047
00048         virtual void    GetClosestPoints(const ClosestPointInput& input,Result& output,class IDebugDraw* debugDraw);
00049
00050         void SetMinkowskiA(ConvexShape* minkA)
00051         {
00052                 m_minkowskiA = minkA;
00053         }
00054
00055         void SetMinkowskiB(ConvexShape* minkB)
00056         {
00057                 m_minkowskiB = minkB;
00058         }
00059         void SetCachedSeperatingAxis(const SimdVector3& seperatingAxis)
00060         {
00061                 m_cachedSeparatingAxis = seperatingAxis;
00062         }
00063
00064         void    SetPenetrationDepthSolver(ConvexPenetrationDepthSolver* penetrationDepthSolver)
00065         {
00066                 m_penetrationDepthSolver = penetrationDepthSolver;
00067         }
00068
00069         void    SetIgnoreMargin(bool ignoreMargin)
00070         {
00071                 m_ignoreMargin = ignoreMargin;
00072         }
00073
00074 };
00075
00076 #endif //GJK_PAIR_DETECTOR_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HingeConstraint.cpp File Reference

BulletDynamics » ConstraintSolver

HingeConstraint.cpp File Reference

#include "HingeConstraint.h"
#include "Dynamics/RigidBody.h"
#include "Dynamics/MassProps.h"
#include "SimdTransformUtil.h"

Include dependency graph for HingeConstraint.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HingeConstraint.cpp Source File

BulletDynamics » ConstraintSolver

HingeConstraint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "HingeConstraint.h"
00018 #include "Dynamics/RigidBody.h"
00019 #include "Dynamics/MassProps.h"
00020 #include "SimdTransformUtil.h"
00021
00022
00023 HingeConstraint::HingeConstraint()
00024 {
00025 }
00026
00027 HingeConstraint::HingeConstraint(RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB,
00028                                                                  SimdVector3& axisInA,SimdVector3& axisInB)
00029 :TypedConstraint(rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB),
00030 m_axisInA(axisInA),
00031 m_axisInB(axisInB),
00032 m_angularOnly(false)
00033 {
00034
00035 }
00036
00037
00038 HingeConstraint::HingeConstraint(RigidBody& rbA,const SimdVector3& pivotInA,SimdVector3& axisInA)
00039 :TypedConstraint(rbA),m_pivotInA(pivotInA),m_pivotInB(rbA.getCenterOfMassTransform()(pivotInA)),
00040 m_axisInA(axisInA),
00041 //fixed axis in worldspace
00042 m_axisInB(rbA.getCenterOfMassTransform().getBasis() * -axisInA),
00043 m_angularOnly(false)
00044 {
00045
00046 }
00047
00048 void    HingeConstraint::BuildJacobian()
00049 {
00050         SimdVector3     normal(0,0,0);
00051
00052         if (!m_angularOnly)
00053         {
00054                 for (int i=0;i<3;i++)
00055                 {
00056                         normal[i] = 1;
00057                         new (&m_jac[i]) JacobianEntry(
00058                                 m_rbA.getCenterOfMassTransform().getBasis().transpose(),
00059                                 m_rbB.getCenterOfMassTransform().getBasis().transpose(),
00060                                 m_rbA.getCenterOfMassTransform()*m_pivotInA - m_rbA.getCenterOfMassPosition(),
00061                                 m_rbB.getCenterOfMassTransform()*m_pivotInB - m_rbB.getCenterOfMassPosition(),
00062                                 normal,
00063                                 m_rbA.getInvInertiaDiagLocal(),
00064                                 m_rbA.getInvMass(),
00065                                 m_rbB.getInvInertiaDiagLocal(),
00066                                 m_rbB.getInvMass());
00067                         normal[i] = 0;
00068                 }
00069         }
00070
00071         //calculate two perpendicular jointAxis, orthogonal to hingeAxis
00072         //these two jointAxis require equal angular velocities for both bodies
00073
00074         //this is ununsed for now, it's a todo
00075         SimdVector3 axisWorldA = GetRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA;
00076         SimdVector3 jointAxis0;
00077         SimdVector3 jointAxis1;
00078         SimdPlaneSpace1(axisWorldA,jointAxis0,jointAxis1);
00079
00080         new (&m_jacAng[0])      JacobianEntry(jointAxis0,
00081                 m_rbA.getCenterOfMassTransform().getBasis().transpose(),
00082                 m_rbB.getCenterOfMassTransform().getBasis().transpose(),
00083                 m_rbA.getInvInertiaDiagLocal(),
00084                 m_rbB.getInvInertiaDiagLocal());
00085
00086         new (&m_jacAng[1])      JacobianEntry(jointAxis1,
00087                 m_rbA.getCenterOfMassTransform().getBasis().transpose(),
00088                 m_rbB.getCenterOfMassTransform().getBasis().transpose(),
00089                 m_rbA.getInvInertiaDiagLocal(),
00090                 m_rbB.getInvInertiaDiagLocal());
00091
00092
00093 }
00094
00095 void    HingeConstraint::SolveConstraint(SimdScalar     timeStep)
00096 {
00097
00098         SimdVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_pivotInA;
00099         SimdVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_pivotInB;
00100
00101         SimdVector3 normal(0,0,0);
00102         SimdScalar tau = 0.3f;
00103         SimdScalar damping = 1.f;
00104
00105         if (!m_angularOnly)
00106         {
00107                 for (int i=0;i<3;i++)
00108                 {
00109                         normal[i] = 1;
00110                         SimdScalar jacDiagABInv = 1.f / m_jac[i].getDiagonal();
00111
00112                         SimdVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition();
00113                         SimdVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition();
00114
00115                         SimdVector3 vel1 = m_rbA.getVelocityInLocalPoint(rel_pos1);
00116                         SimdVector3 vel2 = m_rbB.getVelocityInLocalPoint(rel_pos2);
00117                         SimdVector3 vel = vel1 - vel2;
00118                         SimdScalar rel_vel;
00119                         rel_vel = normal.dot(vel);
00120                         //positional error (zeroth order error)
00121                         SimdScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal
00122                         SimdScalar impulse = depth*tau/timeStep  * jacDiagABInv -  damping * rel_vel * jacDiagABInv * damping;
00123
00124                         SimdVector3 impulse_vector = normal * impulse;
00125                         m_rbA.applyImpulse(impulse_vector, pivotAInW - m_rbA.getCenterOfMassPosition());
00126                         m_rbB.applyImpulse(-impulse_vector, pivotBInW - m_rbB.getCenterOfMassPosition());
00127
00128                         normal[i] = 0;
00129                 }
00130         }
00131
00133
00134         // get axes in world space
00135         SimdVector3 axisA = GetRigidBodyA().getCenterOfMassTransform().getBasis() * m_axisInA;
00136         SimdVector3 axisB = GetRigidBodyB().getCenterOfMassTransform().getBasis() * m_axisInB;
00137
00138         const SimdVector3& angVelA = GetRigidBodyA().getAngularVelocity();
00139         const SimdVector3& angVelB = GetRigidBodyB().getAngularVelocity();
00140         SimdVector3 angA = angVelA - axisA * axisA.dot(angVelA);
00141         SimdVector3 angB = angVelB - axisB * axisB.dot(angVelB);
00142         SimdVector3 velrel = angA-angB;
00143
00144         //solve angular velocity correction
00145         float relaxation = 1.f;
00146         float len = velrel.length();
00147         if (len > 0.00001f)
00148         {
00149                 SimdVector3 normal = velrel.normalized();
00150                 float denom = GetRigidBodyA().ComputeAngularImpulseDenominator(normal) +
00151                         GetRigidBodyB().ComputeAngularImpulseDenominator(normal);
00152                 // scale for mass and relaxation
00153                 velrel *= (1.f/denom) * 0.9;
00154         }
00155
00156         //solve angular positional correction
00157         SimdVector3 angularError = -axisA.cross(axisB) *(1.f/timeStep);
00158         float len2 = angularError.length();
00159         if (len2>0.00001f)
00160         {
00161                 SimdVector3 normal2 = angularError.normalized();
00162                 float denom2 = GetRigidBodyA().ComputeAngularImpulseDenominator(normal2) +
00163                                 GetRigidBodyB().ComputeAngularImpulseDenominator(normal2);
00164                 angularError *= (1.f/denom2) * relaxation;
00165         }
00166
00167         m_rbA.applyTorqueImpulse(-velrel+angularError);
00168         m_rbB.applyTorqueImpulse(velrel-angularError);
00169
00170 }
00171
00172 void    HingeConstraint::UpdateRHS(SimdScalar   timeStep)
00173 {
00174
00175 }
00176
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HingeConstraint.h File Reference

BulletDynamics » ConstraintSolver

HingeConstraint.h File Reference

#include "SimdVector3.h"
#include "ConstraintSolver/JacobianEntry.h"
#include "TypedConstraint.h"

Include dependency graph for HingeConstraint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class HingeConstraint
hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space axis defines the orientation of the hinge axis More...

Generated on Wed May 24 13:59:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HingeConstraint.h Source File

BulletDynamics » ConstraintSolver

HingeConstraint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef HINGECONSTRAINT_H
00017 #define HINGECONSTRAINT_H
00018
00019 #include "SimdVector3.h"
00020
00021 #include "ConstraintSolver/JacobianEntry.h"
00022 #include "TypedConstraint.h"
00023
00024 class RigidBody;
00025
00026
00029 class HingeConstraint : public TypedConstraint
00030 {
00031         JacobianEntry   m_jac[3]; //3 orthogonal linear constraints
00032         JacobianEntry   m_jacAng[2]; //2 orthogonal angular constraints
00033
00034         SimdVector3     m_pivotInA;
00035         SimdVector3     m_pivotInB;
00036         SimdVector3     m_axisInA;
00037         SimdVector3     m_axisInB;
00038
00039         bool    m_angularOnly;
00040
00041 public:
00042
00043         HingeConstraint(RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB,SimdVector3& axisInA,SimdVector3& axisInB);
00044
00045         HingeConstraint(RigidBody& rbA,const SimdVector3& pivotInA,SimdVector3& axisInA);
00046
00047         HingeConstraint();
00048
00049         virtual void    BuildJacobian();
00050
00051         virtual void    SolveConstraint(SimdScalar      timeStep);
00052
00053         void    UpdateRHS(SimdScalar    timeStep);
00054
00055         const RigidBody& GetRigidBodyA() const
00056         {
00057                 return m_rbA;
00058         }
00059         const RigidBody& GetRigidBodyB() const
00060         {
00061                 return m_rbB;
00062         }
00063
00064         void    setAngularOnly(bool angularOnly)
00065         {
00066                 m_angularOnly = angularOnly;
00067         }
00068
00069
00070
00071 };
00072
00073 #endif //HINGECONSTRAINT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull.cpp File Reference

Bullet » NarrowPhaseCollision

Hull.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull.cpp Source File

Bullet » NarrowPhaseCollision

Hull.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 //
00005 // Hull.cpp
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018 #ifdef WIN32
00019 #if _MSC_VER >= 1310
00020
00021 #include "hull.h"
00022 #include "Geometry.h"
00023 #include <assert.h>
00024
00025 #include "HullContactCollector.h"
00026
00027 Hull::Hull()
00028 {
00029         m_numVerts = 0;
00030         m_numFaces = 0;
00031         m_numEdges = 0;
00032
00033         m_pVerts = 0;
00034         m_pFaces = 0;
00035         m_pEdges = 0;
00036         m_pPlanes = 0;
00037 }
00038
00039 Hull::~Hull()
00040 {
00041         delete[] m_pVerts;
00042         delete[] m_pFaces;
00043         delete[] m_pEdges;
00044         delete[] m_pPlanes;
00045 }
00046
00047 Point3 Hull::GetFaceCentroid(short face) const
00048 {
00049         short edge;
00050
00051         edge = GetFaceFirstEdge(face);
00052         Vector3 c = Vector3(GetVertex(GetEdgeVertex0(face, edge)));
00053
00054         for (edge = GetFaceNextEdge(face, edge); edge >= 0; edge = GetFaceNextEdge(face, edge))
00055                 c += Vector3(GetVertex(GetEdgeVertex0(face, edge)));
00056
00057         c /= Scalar(GetFace(face).m_numEdges);
00058
00059         return Point3(c);
00060 }
00061
00062
00063 // helper stuff for MakeHull
00064 short Hull::s_firstFreeTmpFace = 0;
00065 short Hull::s_firstUsedTmpFace = 0;
00066 Hull::TmpFace* Hull::s_pTmpFaces = 0;
00067
00068 short Hull::s_firstFreeTmpEdge = 0;
00069 short Hull::s_firstUsedTmpEdge = 0;
00070 Hull::TmpEdge* Hull::s_pTmpEdges = 0;
00071
00072 const Point3* Hull::s_pPoints = 0;
00073
00074
00075 short Hull::AllocTmpFace()
00076 {
00077         short face = s_firstFreeTmpFace;
00078         assert(face != -1);
00079
00080         TmpFace* pFace = GetTmpFace(face);
00081         s_firstFreeTmpFace = pFace->m_next;
00082
00083         pFace->m_next = s_firstUsedTmpFace;
00084         s_firstUsedTmpFace = face;
00085
00086         for (int i = 0; i < kTmpFaceMaxVerts; i++)
00087                 pFace->m_verts[i] = pFace->m_edges[i] = -1;
00088
00089         pFace->m_plane = Maths::Zero;
00090
00091         return face;
00092 }
00093
00094 void Hull::FreeTmpFace(short face)
00095 {
00096         assert(face >= 0);
00097
00098         TmpFace* pFace = GetTmpFace(face);
00099
00100         if (face == s_firstUsedTmpFace)
00101                 s_firstUsedTmpFace = pFace->m_next;
00102         else
00103         {
00104                 TmpFace* pPrev;
00105                 for (pPrev = GetTmpFace(s_firstUsedTmpFace); pPrev->m_next != face; pPrev = GetTmpFace(pPrev->m_next))
00106                 {
00107                 }
00108                 pPrev->m_next = pFace->m_next;
00109         }
00110
00111         pFace->m_next = s_firstFreeTmpFace;
00112         s_firstFreeTmpFace = face;
00113 }
00114
00115 short Hull::AllocTmpEdge()
00116 {
00117         short edge = s_firstFreeTmpEdge;
00118         assert(edge != -1);
00119
00120         TmpEdge* pEdge = GetTmpEdge(edge);
00121         s_firstFreeTmpEdge = pEdge->m_next;
00122
00123         pEdge->m_next = s_firstUsedTmpEdge;
00124         s_firstUsedTmpEdge = edge;
00125
00126         pEdge->m_verts[0] = pEdge->m_verts[1] = -1;
00127         pEdge->m_faces[0] = pEdge->m_faces[1] = -1;
00128
00129         return edge;
00130 }
00131
00132 void Hull::FreeTmpEdge(short edge)
00133 {
00134         assert(edge >= 0);
00135
00136         TmpEdge* pEdge = GetTmpEdge(edge);
00137
00138         if (edge == s_firstUsedTmpEdge)
00139                 s_firstUsedTmpEdge = pEdge->m_next;
00140         else
00141         {
00142                 TmpEdge* pPrev;
00143                 for ( pPrev= GetTmpEdge(s_firstUsedTmpEdge); pPrev->m_next != edge; pPrev = GetTmpEdge(pPrev->m_next))
00144                 {
00145                 }
00146                 pPrev->m_next = pEdge->m_next;
00147         }
00148
00149         pEdge->m_next = s_firstFreeTmpEdge;
00150         s_firstFreeTmpEdge = edge;
00151 }
00152
00153 short Hull::MatchOrAddEdge(short vert0, short vert1, short face)
00154 {
00155         assert(vert0 >= 0);
00156         assert(vert1 >= 0);
00157         assert(vert0 != vert1);
00158
00159         TmpEdge* pEdge;
00160
00161         // see if edge already exists
00162         for (pEdge = GetTmpEdge(s_firstUsedTmpEdge); pEdge; pEdge = GetTmpEdge(pEdge->m_next))
00163         {
00164                 if (pEdge->m_verts[0] == vert0 && pEdge->m_verts[1] == vert1)
00165                 {
00166                         assert(pEdge->m_faces[0] == -1);
00167                         pEdge->m_faces[0] = face;
00168                         return pEdge->m_index;
00169                 }
00170
00171                 else if (pEdge->m_verts[0] == vert1 && pEdge->m_verts[1] == vert0)
00172                 {
00173                         assert(pEdge->m_faces[1] == -1);
00174                         pEdge->m_faces[1] = face;
00175                         return pEdge->m_index;
00176                 }
00177         }
00178
00179         // doesn't exist so add new face
00180         short edge = AllocTmpEdge();
00181         assert(edge >= 0);
00182
00183         pEdge = GetTmpEdge(edge);
00184
00185         pEdge->m_verts[0] = vert0;
00186         pEdge->m_verts[1] = vert1;
00187         pEdge->m_faces[0] = face;
00188
00189         return edge;
00190 }
00191
00192 void Hull::UnmatchOrRemoveEdge(short edge, short face)
00193 {
00194         assert(edge >= 0);
00195         TmpEdge* pEdge = GetTmpEdge(edge);
00196
00197         if (pEdge->m_faces[0] == face)
00198         {
00199                 pEdge->m_faces[0] = -1;
00200         }
00201         else
00202         {
00203                 assert(pEdge->m_faces[1] == face);
00204                 pEdge->m_faces[1] = -1;
00205         }
00206
00207         // if edge is now redundant then free it
00208         if (pEdge->m_faces[0] == -1 && pEdge->m_faces[1] == -1)
00209                 FreeTmpEdge(edge);
00210 }
00211
00212 short Hull::AddTmpFace(short vert0, short vert1, short vert2)
00213 {
00214         short verts[3] = {vert0, vert1, vert2};
00215         return AddTmpFace(3, verts);
00216 }
00217
00218 short Hull::AddTmpFace(short vert0, short numOtherVerts, short* pVerts)
00219 {
00220         short verts[256];
00221         verts[0] = vert0;
00222         for (short i = 0; i < numOtherVerts; i++)
00223                 verts[i + 1] = pVerts[i];
00224         return AddTmpFace(numOtherVerts + 1, verts);
00225 }
00226
00227 short Hull::AddTmpFace(short numVerts, short* pVerts)
00228 {
00229         assert(numVerts >= 3);
00230         assert(numVerts <= kTmpFaceMaxVerts);
00231         assert(pVerts);
00232
00233         short face = AllocTmpFace();
00234         assert(face >= 0);
00235
00236         TmpFace* pFace = GetTmpFace(face);
00237
00238         pFace->m_numVerts = numVerts;
00239
00240         for (short i = 0; i < numVerts; i++)
00241         {
00242                 pFace->m_verts[i] = pVerts[i];
00243                 pFace->m_edges[i] = MatchOrAddEdge(pVerts[i], pVerts[(i + 1) % numVerts], face);
00244         }
00245
00246         pFace->m_plane = Plane(s_pPoints[pVerts[0]], s_pPoints[pVerts[1]], s_pPoints[pVerts[2]]);
00247
00248         return face;
00249 }
00250
00251 void Hull::RemoveTmpFace(short face)
00252 {
00253         assert(face >= 0);
00254
00255         TmpFace* pFace = GetTmpFace(face);
00256
00257         for (short i = 0; i < pFace->m_numVerts; i++)
00258                 UnmatchOrRemoveEdge(pFace->m_edges[i], face);
00259
00260         FreeTmpFace(face);
00261 }
00262
00263 bool Hull::TmpFaceAddPoint(short point, short face)
00264 {
00265         assert(face >= 0);
00266
00267         TmpFace* pFace = GetTmpFace(face);
00268
00269         // vertex limit reached?
00270         if (pFace->m_numVerts == kTmpFaceMaxVerts)
00271                 return false;
00272
00273         // in same plane?
00274         if (Abs(Dot(pFace->m_plane, s_pPoints[point])) > 0.001f)
00275                 return false;
00276
00277         // remove last edge
00278         UnmatchOrRemoveEdge(pFace->m_edges[pFace->m_numVerts - 1], face);
00279
00280         // add 2 new edges
00281         MatchOrAddEdge(pFace->m_verts[pFace->m_numVerts - 1], point, face);
00282         MatchOrAddEdge(point, pFace->m_verts[0], face);
00283
00284         // add new vertex
00285         pFace->m_verts[pFace->m_numVerts++] = point;
00286
00287         return true;
00288 }
00289
00290 // The resulting hull will not contain interior points
00291 // Note that this is a cheap and cheerful implementation that can only handle
00292 // reasonably small point sets. However, except for the final hull it doesn't do any dynamic
00293 // memory allocation - all the work happens on the stack.
00294 Hull* Hull::MakeHull(int numPoints, const Point3* pPoints)
00295 {
00296         assert(numPoints >= 4);
00297         assert(pPoints);
00298
00299         // check first 4 points are disjoint
00300         // TODO: make it search points so it can cope better with this
00301         assert(Length(pPoints[1] - pPoints[0]) > 0.01f);
00302         assert(Length(pPoints[2] - pPoints[0]) > 0.01f);
00303         assert(Length(pPoints[3] - pPoints[0]) > 0.01f);
00304         assert(Length(pPoints[2] - pPoints[1]) > 0.01f);
00305         assert(Length(pPoints[3] - pPoints[1]) > 0.01f);
00306         assert(Length(pPoints[3] - pPoints[2]) > 0.01f);
00307
00308         s_pPoints = pPoints;
00309
00310         // put all temp faces on a free list
00311         TmpFace tmpFaces[kMaxFaces];
00312
00313         s_firstFreeTmpFace = 0;
00314         s_firstUsedTmpFace = -1;
00315         s_pTmpFaces = tmpFaces;
00316
00317         for (short i = 0; i < kMaxEdges; i++)
00318         {
00319                 tmpFaces[i].m_index = i;
00320                 tmpFaces[i].m_next = i + 1;
00321         }
00322         tmpFaces[kMaxFaces - 1].m_next = -1;
00323
00324         // put all temp edges on a free list
00325         TmpEdge tmpEdges[kMaxEdges];
00326
00327         s_firstFreeTmpEdge = 0;
00328         s_firstUsedTmpEdge = -1;
00329         s_pTmpEdges = tmpEdges;
00330
00331         for (short i = 0; i < kMaxEdges; i++)
00332         {
00333                 tmpEdges[i].m_index = i;
00334                 tmpEdges[i].m_next = i + 1;
00335         }
00336         tmpEdges[kMaxEdges - 1].m_next = -1;
00337
00338         // make initial tetrahedron
00339         Plane plane = Plane(pPoints[0], pPoints[1], pPoints[2]);
00340
00341         Scalar dot = Dot(plane, pPoints[3]);
00342         assert(Abs(dot) > 0.01f);                       // first 4 points are co-planar
00343
00344         if (IsNegative(dot))
00345         {
00346                 AddTmpFace(0, 1, 2);
00347                 AddTmpFace(1, 0, 3);
00348                 AddTmpFace(0, 2, 3);
00349                 AddTmpFace(2, 1, 3);
00350         }
00351         else
00352         {
00353                 AddTmpFace(2, 1, (short)0);
00354                 AddTmpFace(1, 2, 3);
00355                 AddTmpFace(2, 0, 3);
00356                 AddTmpFace(0, 1, 3);
00357         }
00358
00359         // merge all remaining points
00360         for (int i = 4; i < numPoints; i++)
00361                 if (RemoveVisibleFaces(pPoints[i]) > 0)
00362                         FillHole(i);
00363
00364         return MakeHullFromTemp();
00365 }
00366
00367 int Hull::RemoveVisibleFaces(const Point3& point)
00368 {
00369         // test point for containment in current hull
00370         int numRemoved = 0;
00371         TmpFace* pNextFace;
00372         for (TmpFace* pFace = GetTmpFace(s_firstUsedTmpFace); pFace; pFace = pNextFace)
00373         {
00374                 pNextFace = GetTmpFace(pFace->m_next);
00375
00376                 if (Dot(pFace->m_plane, point) > -0.001f)
00377                 {
00378                         RemoveTmpFace(pFace->m_index);
00379                         numRemoved++;
00380                 }
00381         }
00382
00383         return numRemoved;
00384 }
00385
00386 void Hull::FillHole(short newVertex)
00387 {
00388         // gather unmatched edges (they form the silhouette of the hole)
00389         short edgeVert0[kMaxEdges];
00390         short edgeVert1[kMaxEdges];
00391         int numEdges = 0;
00392
00393         for (TmpEdge* pEdge = GetTmpEdge(s_firstUsedTmpEdge); pEdge; pEdge = GetTmpEdge(pEdge->m_next))
00394         {
00395                 if (pEdge->m_faces[0] == -1)
00396                 {
00397                         assert(numEdges < kMaxEdges);
00398                         edgeVert0[numEdges] = pEdge->m_verts[0];
00399                         edgeVert1[numEdges] = pEdge->m_verts[1];
00400                         numEdges++;
00401                 }
00402                 else if (pEdge->m_faces[1] == -1)
00403                 {
00404                         assert(numEdges < kMaxEdges);
00405                         edgeVert0[numEdges] = pEdge->m_verts[1];
00406                         edgeVert1[numEdges] = pEdge->m_verts[0];
00407                         numEdges++;
00408                 }
00409         }
00410
00411         // extract vertex winding by sorting edges
00412         short verts[kMaxEdges + 1];             // +1 for repeat of first vertex
00413
00414         verts[0] = edgeVert0[0];
00415         verts[1] = edgeVert1[0];
00416         short numVerts = 2;
00417
00418         while (numVerts < (numEdges + 1))
00419         {
00420                 for (int i = 0; i < numEdges; i++)
00421                 {
00422                         // if leading vertex of edge matches our last vertex
00423                         if (edgeVert0[i] == verts[numVerts - 1])
00424                         {
00425                                 // then add trailing vertex of edge to our vertex list
00426                                 verts[numVerts++] = edgeVert1[i];
00427                         }
00428                 }
00429         }
00430
00431         // fill the hole
00432         int i = 1;
00433         while (i < numVerts)
00434         {
00435                 // make plane for first 3 vertices
00436                 Plane plane = Plane(s_pPoints[newVertex], s_pPoints[verts[i - 1]], s_pPoints[verts[i]]);
00437
00438                 // any subequent vertices that lie in the same plane are also added
00439                 int numFaceVerts = 2;
00440                 for (int j = i + 1; j < numVerts; j++)
00441                 {
00442                         if (Abs(Dot(plane, s_pPoints[verts[j]])) > 0.001f)
00443                                 break;
00444                         numFaceVerts++;
00445                 }
00446
00447                 // add the polygon
00448                 AddTmpFace(newVertex, numFaceVerts, verts + i - 1);
00449
00450                 // skip to next
00451                 i += numFaceVerts - 1;
00452         }
00453 }
00454
00455 // make hull from temporary working structures
00456 Hull* Hull::MakeHullFromTemp()
00457 {
00458         Hull* pHull = new Hull();
00459
00460         // count and index faces
00461         short index = 0;
00462
00463         for (TmpFace* pFace = GetTmpFace(s_firstUsedTmpFace); pFace; pFace = GetTmpFace(pFace->m_next))
00464         {
00465                 pFace->m_index = index++;
00466                 pHull->m_numFaces++;
00467         }
00468
00469         // count and index edges, also count and index used vertices
00470         short vertIndexes[kMaxVerts];
00471         for (int i = 0; i < kMaxVerts; i++)
00472                 vertIndexes[i] = -1;
00473
00474         index = 0;
00475         for (TmpEdge* pEdge = GetTmpEdge(s_firstUsedTmpEdge); pEdge; pEdge = GetTmpEdge(pEdge->m_next))
00476         {
00477                 pEdge->m_index = index++;
00478                 pHull->m_numEdges++;
00479
00480                 if (vertIndexes[pEdge->m_verts[0]] == -1)
00481                         vertIndexes[pEdge->m_verts[0]] = pHull->m_numVerts++;
00482                 if (vertIndexes[pEdge->m_verts[1]] == -1)
00483                         vertIndexes[pEdge->m_verts[1]] = pHull->m_numVerts++;
00484         }
00485
00486         // allocate hull arrays
00487         pHull->m_pVerts = new Point3[pHull->m_numVerts];
00488         pHull->m_pEdges = new Hull::Edge[pHull->m_numEdges];
00489         pHull->m_pFaces = new Hull::Face[pHull->m_numFaces];
00490         pHull->m_pPlanes = new Plane[pHull->m_numFaces];
00491
00492         // fill in hull arrays
00493         // verts:
00494         for (int i = 0; i < kMaxVerts; i++)
00495                 if (vertIndexes[i] != -1)
00496                         pHull->m_pVerts[vertIndexes[i]] = s_pPoints[i];
00497
00498         // edges:
00499         index = 0;
00500         for (TmpEdge* pEdge = GetTmpEdge(s_firstUsedTmpEdge); pEdge; pEdge = GetTmpEdge(pEdge->m_next))
00501         {
00502                 pHull->m_pEdges[index].m_faces[0] = GetTmpFace(pEdge->m_faces[0])->m_index;
00503                 pHull->m_pEdges[index].m_faces[1] = GetTmpFace(pEdge->m_faces[1])->m_index;
00504                 pHull->m_pEdges[index].m_verts[0] = vertIndexes[pEdge->m_verts[0]];
00505                 pHull->m_pEdges[index].m_verts[1] = vertIndexes[pEdge->m_verts[1]];
00506
00507                 index++;
00508         }
00509
00510         // faces:
00511         index = 0;
00512         for (TmpFace* pFace = GetTmpFace(s_firstUsedTmpFace); pFace; pFace = GetTmpFace(pFace->m_next))
00513         {
00514                 // set edge count
00515                 pHull->m_pFaces[index].m_numEdges = pFace->m_numVerts;
00516
00517                 // make linked list of face edges
00518                 short prevEdge = GetTmpEdge(pFace->m_edges[0])->m_index;
00519                 pHull->m_pFaces[index].m_firstEdge = prevEdge;
00520
00521                 for (int i = 1; i < pFace->m_numVerts; i++)
00522                 {
00523                         Edge& e = pHull->m_pEdges[prevEdge];
00524                         prevEdge = GetTmpEdge(pFace->m_edges[i])->m_index;
00525                         e.m_nextEdge[pFace->m_index == e.m_faces[1]] = prevEdge;
00526                 }
00527
00528                 Edge& e = pHull->m_pEdges[prevEdge];
00529                 e.m_nextEdge[pFace->m_index == e.m_faces[1]] = -1;
00530
00531                 // set plane
00532                 pHull->m_pPlanes[index] = pFace->m_plane;
00533
00534                 index++;
00535         }
00536
00537
00538         return pHull;
00539 }
00540
00541
00542
00543 void Hull::ProcessHullHull(Separation& sep,const Hull& shapeA,const Hull& shapeB,const Transform& trA,const Transform& trB,HullContactCollector* collector)
00544 {
00545         Point3 vertsA[Hull::kMaxVerts];
00546         Point3 vertsB[Hull::kMaxVerts];
00547
00548 //      const Hull& shapeA((const Hull&)*sep.m_pBodyA->GetShape());
00549 //      const Hull& shapeB((const Hull&)*sep.m_pBodyB->GetShape());
00550
00551 //      Transform trA(sep.m_pBodyA->GetTransform());
00552 //      Transform trB(sep.m_pBodyB->GetTransform());
00553
00554         // transform verts of A to world space
00555         Point3* pVertsA = vertsA;
00556         for (short v = 0; v < shapeA.m_numVerts; v++)
00557                 pVertsA[v] = shapeA.m_pVerts[v] * trA;
00558
00559         // transform verts of B to world space
00560         Point3* pVertsB = vertsB;
00561         for (short v = 0; v < shapeB.m_numVerts; v++)
00562                 pVertsB[v] = shapeB.m_pVerts[v] * trB;
00563
00564 #ifdef SHAPE_COLLIDER_USE_CACHING
00565         // update cached pair
00566         if (sep.m_separator != Separation::kFeatureNone)
00567         {
00568                 // re-use the separation
00569                 if (UpdateSeparationHullHull(sep, pVertsA, pVertsB, trA, trB) == true)
00570                         return;
00571
00572                 // also re-use penetration if only slight
00573                 if (sep.m_dist > -0.02f)
00574                 {
00575                         // except if no contacts were generated, in which case we continue through to full test
00576                         if (AddContactsHullHull(sep, pVertsA, pVertsB, trA, trB,shapeA,shapeB) > 0)
00577                                 return;
00578                 }
00579         }
00580 #endif
00581
00582         if (GetSeparationHullHull(sep, pVertsA, pVertsB, trA, trB,shapeA,shapeB) == false)
00583         {
00584                 AddContactsHullHull(sep, pVertsA, pVertsB, trA, trB,shapeA,shapeB,collector);
00585         }
00586 }
00587
00588
00589 void Hull::ComputeInertia(const Transform& transform, Point3& centerOfMass, Matrix33& inertia, float totalMass) const
00590 {
00591         assert(totalMass > 0.0f);
00592
00593         // order: 1, x, y, z, x^2, y^2, z^2, xy, yz, zx
00594         float integral[10] = {0,0,0,0,0,0,0,0,0,0};
00595
00596         // for each triangle
00597         for (short face = 0; face < m_numFaces; face++)
00598         {
00599                 short edge = GetFaceFirstEdge(face);
00600                 Point3 v0 = m_pVerts[ GetEdgeVertex0(face, edge) ] * transform;
00601
00602                 edge = GetFaceNextEdge(face, edge);
00603                 Point3 v1 = m_pVerts[ GetEdgeVertex0(face, edge) ] * transform;
00604
00605                 for (edge = GetFaceNextEdge(face, edge); edge != -1; edge = GetFaceNextEdge(face, edge))
00606                 {
00607                         Point3 v2 = m_pVerts[ GetEdgeVertex0(face, edge) ] * transform;
00608
00609                         // get cross product of triangle edges
00610                         Vector3 d = Cross(v2 - v0, v1 - v0);
00611
00612                         // compute integral terms
00613                         Vector3 w0 = Vector3(v0);
00614                         Vector3 w1 = Vector3(v1);
00615                         Vector3 w2 = Vector3(v2);
00616
00617                         Vector3 temp0 = w0 + w1;
00618                         Vector3 f1 = temp0 + w2;
00619                         Vector3 temp1 = w0 * w0;
00620                         Vector3 temp2 = temp1 + w1 * temp0;
00621                         Vector3 f2 = temp2 + w2 * f1;
00622                         Vector3 f3 = w0 * temp1 + w1 * temp2 + w2 * f2;
00623                         Vector3 g0 = f2 + w0 * (f1 + w0);
00624                         Vector3 g1 = f2 + w1 * (f1 + w1);
00625                         Vector3 g2 = f2 + w2 * (f1 + w2);
00626
00627                         // update integrals
00628                         integral[0] += d[0] * f1[0];
00629                         integral[1] += d[0] * f2[0];
00630                         integral[2] += d[1] * f2[1];
00631                         integral[3] += d[2] * f2[2];
00632                         integral[4] += d[0] * f3[0];
00633                         integral[5] += d[1] * f3[1];
00634                         integral[6] += d[2] * f3[2];
00635                         integral[7] += d[0] * (v0[1] * g0[0] + v1[1] * g1[0] + v2[1] * g2[0]);
00636                         integral[8] += d[1] * (v0[2] * g0[1] + v1[2] * g1[1] + v2[2] * g2[1]);
00637                         integral[9] += d[2] * (v0[0] * g0[2] + v1[0] * g1[2] + v2[0] * g2[2]);
00638
00639                         // next edge
00640                         v1 = v2;
00641                 }
00642         }
00643
00644         integral[0] *= 1.0f / 6.0f;
00645         integral[1] *= 1.0f / 24.0f;
00646         integral[2] *= 1.0f / 24.0f;
00647         integral[3] *= 1.0f / 24.0f;
00648         integral[4] *= 1.0f / 60.0f;
00649         integral[5] *= 1.0f / 60.0f;
00650         integral[6] *= 1.0f / 60.0f;
00651         integral[7] *= 1.0f / 120.0f;
00652         integral[8] *= 1.0f / 120.0f;
00653         integral[9] *= 1.0f / 120.0f;
00654
00655         // scale all integrals to get desired total mass
00656         assert(integral[0] > 0.0f);
00657
00658         float invMassRatio = totalMass / integral[0];
00659         for (int i = 0; i < 10; i++)
00660                 integral[i] *= invMassRatio;
00661
00662         // center of mass
00663         centerOfMass = Point3(integral[1] / totalMass, integral[2] / totalMass, integral[3] / totalMass);
00664
00665         // inertia relative to world
00666         inertia[0][0] = integral[5] + integral[6];
00667         inertia[0][1] = -integral[7];
00668         inertia[0][2] = -integral[9];
00669
00670         inertia[1][0] = -integral[7];
00671         inertia[1][1] = integral[4] + integral[6];
00672         inertia[1][2] = -integral[8];
00673
00674         inertia[2][0] = -integral[9];
00675         inertia[2][1] = -integral[8];
00676         inertia[2][2] = integral[5] + integral[5];
00677
00678         // inertia relative to center of mass
00679         inertia[0][0] -= totalMass * (centerOfMass[1] * centerOfMass[1] + centerOfMass[2] * centerOfMass[2]);
00680         inertia[0][1] += totalMass * centerOfMass[0] * centerOfMass[1];
00681         inertia[0][2] += totalMass * centerOfMass[2] * centerOfMass[0];
00682
00683         inertia[1][0] += totalMass * centerOfMass[0] * centerOfMass[1];
00684         inertia[1][1] -= totalMass * (centerOfMass[2] * centerOfMass[2] + centerOfMass[0] * centerOfMass[0]);
00685         inertia[1][2] += totalMass * centerOfMass[1] * centerOfMass[2];
00686
00687         inertia[2][0] += totalMass * centerOfMass[2] * centerOfMass[0];
00688         inertia[2][1] += totalMass * centerOfMass[1] * centerOfMass[2];
00689         inertia[2][2] -= totalMass * (centerOfMass[0] * centerOfMass[0] + centerOfMass[1] * centerOfMass[1]);
00690 }
00691
00692 Bounds3 Hull::ComputeBounds(const Transform& transform) const
00693 {
00694         Bounds3 b(m_pVerts[0] * transform);
00695         for (int i = 1; i < m_numVerts; i++)
00696                 b += m_pVerts[i] * transform;
00697         return b;
00698 }
00699
00700
00701
00702
00703
00704
00705
00706 // Clips a face to the back of a plane
00707 int Hull::ClipFace(int numVerts, Point3** ppVtxIn, Point3** ppVtxOut, const Plane& plane)
00708 {
00709         int ve, numVertsOut;
00710         Point3 *pVtxOut, *pVtxS, *pVtxE;
00711         Scalar ds, de;
00712
00713         if (numVerts == 0)
00714                 return 0;
00715
00716         pVtxE = *ppVtxIn;
00717         pVtxS = pVtxE + numVerts - 1;
00718         pVtxOut = *ppVtxOut;
00719
00720         Scalar zero(0.0f);
00721
00722         ds = Dot(plane, *pVtxS);
00723
00724         for (ve = 0; ve < numVerts; ve++, pVtxE++)
00725         {
00726                 de = Dot(plane, *pVtxE);
00727
00728                 if (ds <= zero)
00729                 {
00730                         *pVtxOut++ = *pVtxS;
00731                         if (de > zero)
00732                                 *pVtxOut++ = Lerp(*pVtxS, *pVtxE, ds * RcpNr(ds - de));
00733                 }
00734                 else if (de <= zero)
00735                         *pVtxOut++ = Lerp(*pVtxS, *pVtxE, ds * RcpNr(ds - de));
00736
00737                 if (ve == 0)
00738                         pVtxS = *ppVtxIn;
00739                 else
00740                         pVtxS++;
00741
00742                 ds = de;
00743         }
00744
00745         numVertsOut = pVtxOut - *ppVtxOut;
00746
00747         // swap in and out arrays ready for next time
00748         pVtxOut = *ppVtxIn;
00749         *ppVtxIn = *ppVtxOut;
00750         *ppVtxOut = pVtxOut;
00751
00752         return numVertsOut;
00753 }
00754
00755
00756
00757
00758
00759 int Hull::AddContactsHullHull(Separation& sep, const Point3* pVertsA, const Point3* pVertsB,
00760                                                                            const Transform& trA, const Transform& trB,const Hull& hullA,const Hull& hullB,
00761                                                                            HullContactCollector* hullContactCollector)
00762 {
00763         const int maxContacts = hullContactCollector->GetMaxNumContacts();
00764
00765         Vector3 normalWorld = sep.m_axis;
00766
00767         // edge->edge contact is always a single point
00768         if (sep.m_separator == Separation::kFeatureBoth)
00769         {
00770                 const Hull::Edge& edgeA = hullA.GetEdge(sep.m_featureA);
00771                 const Hull::Edge& edgeB = hullB.GetEdge(sep.m_featureB);
00772
00773                 float ta, tb;
00774                 Line la(pVertsA[edgeA.m_verts[0]], pVertsA[edgeA.m_verts[1]]);
00775                 Line lb(pVertsB[edgeB.m_verts[0]], pVertsB[edgeB.m_verts[1]]);
00776
00777                 Intersect(la, lb, ta, tb);
00778
00779 #ifdef VALIDATE_CONTACT_POINTS
00780                 AssertPointInsideHull(contact.m_points[0].m_pos, trA, hullA);
00781                 AssertPointInsideHull(contact.m_points[0].m_pos, trB, hullB);
00782 #endif
00783
00784
00785                 Point3 posWorld = Lerp(la.m_start, la.m_end, ta);
00786                 float depth = -sep.m_dist;
00787         Vector3 tangent = Normalize(pVertsA[edgeA.m_verts[1]] - pVertsA[edgeA.m_verts[0]]);
00788
00789                 sep.m_contact = hullContactCollector->BatchAddContactGroup(sep,1,normalWorld,tangent,&posWorld,&depth);
00790
00791         }
00792         // face->face contact is polygon
00793         else
00794         {
00795                 short faceA = sep.m_featureA;
00796                 short faceB = sep.m_featureB;
00797
00798                 Vector3 tangent;
00799
00800                 // find face of hull A that is most opposite contact axis
00801                 // TODO: avoid having to transform planes here
00802                 if (sep.m_separator == Separation::kFeatureB)
00803                 {
00804                         const Hull::Edge& edgeB = hullB.GetEdge(hullB.GetFaceFirstEdge(faceB));
00805                         tangent = Normalize(pVertsB[edgeB.m_verts[1]] - pVertsB[edgeB.m_verts[0]]);
00806
00807                         Scalar dmin = Scalar::Consts::MaxValue;
00808                         for (short face = 0; face < hullA.m_numFaces; face++)
00809                         {
00810                                 Vector3 normal = hullA.GetPlane(face).GetNormal() * trA;
00811                                 Scalar d = Dot(normal, sep.m_axis);
00812                                 if (d < dmin)
00813                                 {
00814                                         dmin = d;
00815                                         faceA = face;
00816                                 }
00817                         }
00818                 }
00819                 else
00820                 {
00821                         const Hull::Edge& edgeA = hullA.GetEdge(hullA.GetFaceFirstEdge(faceA));
00822                         tangent = Normalize(pVertsA[edgeA.m_verts[1]] - pVertsA[edgeA.m_verts[0]]);
00823
00824                         Scalar dmin = Scalar::Consts::MaxValue;
00825                         for (short face = 0; face < hullB.m_numFaces; face++)
00826                         {
00827                                 Vector3 normal = hullB.GetPlane(face).GetNormal() * trB;
00828                                 Scalar d = Dot(normal, -sep.m_axis);
00829                                 if (d < dmin)
00830                                 {
00831                                         dmin = d;
00832                                         faceB = face;
00833                                 }
00834                         }
00835                 }
00836
00837                 Point3 workspace[2][Hull::kMaxVerts];
00838
00839                 // setup initial clip face (minimizing face from hull B)
00840                 int numContacts = 0;
00841                 for (short edge = hullB.GetFaceFirstEdge(faceB); edge != -1; edge = hullB.GetFaceNextEdge(faceB, edge))
00842                         workspace[0][numContacts++] = pVertsB[ hullB.GetEdgeVertex0(faceB, edge) ];
00843
00844                 // clip polygon to back of planes of all faces of hull A that are adjacent to witness face
00845                 Point3* pVtxIn = workspace[0];
00846                 Point3* pVtxOut = workspace[1];
00847
00848 #if 0
00849                 for (short edge = hullA.GetFaceFirstEdge(faceA); edge != -1; edge = hullA.GetFaceNextEdge(faceA, edge))
00850                 {
00851                         Plane planeA = hullA.GetPlane( hullA.GetEdgeOtherFace(edge, faceA) ) * trA;
00852                         numContacts = ClipFace(numContacts, &pVtxIn, &pVtxOut, planeA);
00853                 }
00854 #else
00855                 for (short f = 0; f < hullA.GetNumFaces(); f++)
00856                 {
00857                         Plane planeA = hullA.GetPlane(f) * trA;
00858                         numContacts = ClipFace(numContacts, &pVtxIn, &pVtxOut, planeA);
00859                 }
00860 #endif
00861
00862                 // only keep points that are behind the witness face
00863                 Plane planeA = hullA.GetPlane(faceA) * trA;
00864
00865                 float depths[Hull::kMaxVerts];
00866                 int numPoints = 0;
00867                 for (int i = 0; i < numContacts; i++)
00868                 {
00869                         Scalar d = Dot(planeA, pVtxIn[i]);
00870                         if (IsNegative(d))
00871                         {
00872                                 depths[numPoints] = (float)-d;
00873                                 pVtxIn[numPoints] = pVtxIn[i];
00874
00875 #ifdef VALIDATE_CONTACT_POINTS
00876                                         AssertPointInsideHull(pVtxIn[numPoints], trA, hullA);
00877                                         AssertPointInsideHull(pVtxIn[numPoints], trB, hullB);
00878 #endif
00879                                 numPoints++;
00880                         }
00881                 }
00882
00883                 //we can also use a persistentManifold/reducer class
00884                 // keep maxContacts points at most
00885                 if (numPoints > 0)
00886                 {
00887                         if (numPoints > maxContacts)
00888                         {
00889                                 int step = (numPoints << 8) / maxContacts;
00890
00891                                 numPoints = maxContacts;
00892                                 for (int i = 0; i < numPoints; i++)
00893                                 {
00894                                         int nth = (step * i) >> 8;
00895
00896                                         depths[i] = depths[nth];
00897                                         pVtxIn[i] = pVtxIn[nth];
00898
00899
00900 #ifdef VALIDATE_CONTACT_POINTS
00901                                         AssertPointInsideHull(contact.m_points[i].m_pos, trA, hullA);
00902                                         AssertPointInsideHull(contact.m_points[i].m_pos, trB, hullB);
00903 #endif
00904                                 }
00905                         }
00906
00907                         sep.m_contact = hullContactCollector->BatchAddContactGroup(sep,numPoints,normalWorld,tangent,pVtxIn,depths);
00908
00909                 }
00910                 return numPoints;
00911         }
00912
00913         // shut up compiler
00914         return 0;
00915 }
00916
00917
00918
00919
00920 // returns true if a separating axis was found
00921 // if no separating axis was found then details of least penetrating axis are returned
00922 // resulting axis always points away from hullB
00923 // either transform can be null in which case it is treated as identity (this avoids a bunch of work)
00924 bool Hull::GetSeparationHullHull(Separation& sep, const Point3* pVertsA, const Point3* pVertsB,
00925                                                                                   const Transform& trA, const Transform& trB,
00926                                                                                   const Hull& hullA,
00927                                                                                   const Hull& hullB
00928                                                                                   )
00929 {
00930         //const Hull& hullA((const Hull&)*sep.m_pShapeA->GetShape());
00931         //const Hull& hullB((const Hull&)*sep.m_pShapeB->GetShape());
00932
00933         sep.m_separator = Separation::kFeatureNone;
00934         sep.m_dist = MinValueF;
00935         sep.m_featureA = sep.m_featureB = -1;
00936         sep.m_contact = -1;
00937
00938         // test verts of A to planes of B
00939         Scalar minDistB = Scalar::Consts::MinValue;
00940         for (short p = 0; p < hullB.m_numFaces; p++)
00941         {
00942                 Plane planeWorld = hullB.m_pPlanes[p] * trB;
00943
00944                 Scalar minDist = Dot(planeWorld, pVertsA[0]);
00945                 for (short v = 1; v < hullA.m_numVerts; v++)
00946                         minDist = Min(minDist, Dot(planeWorld, pVertsA[v]));
00947
00948                 // keep min overlap
00949                 if (minDist > minDistB)
00950                 {
00951                         minDistB = minDist;
00952                         sep.m_featureB = p;
00953                         sep.m_dist = minDist;
00954                         sep.m_axis = planeWorld.GetNormal();
00955                         sep.m_separator = Separation::kFeatureB;
00956                 }
00957
00958                 // got a separating plane?
00959                 if (!IsNegative(minDist))
00960                         return true;
00961         }
00962
00963         // test verts of B to planes of A
00964         Scalar minDistA = Scalar::Consts::MinValue;
00965         for (short p = 0; p < hullA.m_numFaces; p++)
00966         {
00967                 // get plane in world space
00968                 Plane planeWorld = hullA.m_pPlanes[p] * trA;
00969
00970                 // get min dist
00971                 Scalar minDist = Dot(planeWorld, pVertsB[0]);
00972                 for (short v = 1; v < hullB.m_numVerts; v++)
00973                         minDist = Min(minDist, Dot(planeWorld, pVertsB[v]));
00974
00975                 // keep min overlap
00976                 if (minDist > minDistA)
00977                 {
00978                         minDistA = minDist;
00979                         sep.m_featureA = p;
00980
00981                         if ((float)minDist > sep.m_dist)
00982                         {
00983                                 sep.m_dist = (float)minDist;
00984                                 sep.m_axis = -planeWorld.GetNormal();
00985                                 sep.m_separator = Separation::kFeatureA;
00986                         }
00987                 }
00988
00989                 // got a separating plane?
00990                 if (!IsNegative(minDist))
00991                         return true;
00992         }
00993
00994         // test edge pairs on two minimizing faces
00995         short faceA( sep.m_featureA );
00996         short faceB( sep.m_featureB );
00997
00998         Vector3 faceBnormal = Vector3(hullB.m_pPlanes[sep.m_featureB]) * trB;
00999
01000 //      Plane bestPlane;
01001 //      Point3 bestPlanePos;
01002
01003         for (short ea = hullA.GetFaceFirstEdge(faceA); ea != -1; ea = hullA.GetFaceNextEdge(faceA, ea))
01004         {
01005                 const Hull::Edge& edgeA = hullA.GetEdge(ea);
01006
01007                 for (short eb = hullB.GetFaceFirstEdge(faceB); eb != -1; eb = hullB.GetFaceNextEdge(faceB, eb))
01008                 {
01009                         const Hull::Edge& edgeB = hullB.GetEdge(eb);
01010
01011                         Vector3 va = pVertsA[edgeA.m_verts[1]] - pVertsA[edgeA.m_verts[0]];
01012                         Vector3 vb = pVertsB[edgeB.m_verts[1]] - pVertsB[edgeB.m_verts[0]];
01013                         Vector3 axis = Cross(va, vb);
01014                         Scalar rcpLen = LengthRcp(axis);
01015
01016                         // if the two edges have nearly equal or opposite directions then try the next pair
01017                         if (IsNan(rcpLen) || rcpLen > 10000.0f)
01018                                 continue;
01019                         axis *= rcpLen;
01020
01021                         // if axis is very close to current best axis then don't use it
01022                         if (Abs(Dot(sep.m_axis, axis)) > 0.99f)
01023                                 continue;
01024
01025                         // ensure the axis points away from hullB
01026                         if (Dot(faceBnormal, axis) < Scalar::Consts::Zero)
01027                                 axis = -axis;
01028
01029                         Plane plane(axis, pVertsB[edgeB.m_verts[0]]);
01030
01031                         // hull B must be entirely behind plane
01032                         Scalar dmaxB = Dot(plane, pVertsB[0]);
01033                         for (short v = 1; v < hullB.m_numVerts; v++)
01034                                 dmaxB = Max(dmaxB, Dot(plane, pVertsB[v]));
01035
01036                         if (dmaxB > 0.001f)
01037                                 continue;
01038
01039                         // get hull A distance from plane
01040                         Scalar dminA = Dot(plane, pVertsA[0]);
01041                         for (short v = 1; v < hullA.m_numVerts; v++)
01042                                 dminA = Min(dminA, Dot(plane, pVertsA[v]));
01043
01044                         // got a separating plane?
01045                         if (!IsNegative(dminA))
01046                         {
01047                                 sep.m_featureA = ea;
01048                                 sep.m_featureB = eb;
01049                                 sep.m_dist = dminA;
01050                                 sep.m_axis = axis;
01051                                 sep.m_separator = Separation::kFeatureBoth;
01052                                 return true;
01053                         }
01054
01055                         // keep min overlap
01056                         if (dminA > sep.m_dist)
01057                         {
01058                                 // if edge of A is in front of the plane, then we haven't identified the correct edge pair
01059                                 if (IsNegative(Dot(plane, pVertsA[edgeA.m_verts[0]])))
01060                                 {
01061         //                              bestPlane = plane;
01062         //                              bestPlanePos = Lerp(pVertsB[edgeB.m_verts[0]], pVertsB[edgeB.m_verts[1]], 0.5f);
01063
01064 //                                      sep.m_featureA = ea;
01065 //                                      sep.m_featureB = eb;
01066                                         sep.m_dist = dminA;
01067                                         sep.m_axis = axis;
01068 //                                      sep.m_separator = Separation::kFeatureBoth;
01069                                 }
01070                         }
01071
01072                 }
01073
01074 //                      RenderPlane(bestPlane, bestPlanePos);
01075         }
01076
01077         return false;
01078 }
01079 #endif //MSC_VER >= 1310
01080 #endif //WIN32
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull.h File Reference

Bullet » NarrowPhaseCollision

Hull.h File Reference

#include "Maths.h"
#include "Shape.h"
#include "hull.inl"

Include dependency graph for Hull.h:

Go to the source code of this file.

Classes

class | Hull
Hull implements a convex collision detection algorithm based on Separating Axis Theorem (SAT). More...
struct | Hull::Edge
struct | Hull::Face
struct | Hull::TmpFace
struct | Hull::TmpEdge

Generated on Wed May 24 13:59:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull.h Source File

Bullet » NarrowPhaseCollision

Hull.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 //
00005 // Hull.h
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018 #ifndef SAT_HULL_H
00019 #define SAT_HULL_H
00020
00021 #include "Maths.h"
00022 #include "Shape.h"
00023
00024
00025 class DynWorld;
00026 class HullContactCollector;
00027
00032 class Hull : public Shape
00033 {
00034         friend class ShapeCollider;
00035
00036 public:
00037         struct Edge
00038         {
00039                 short m_verts[2];
00040                 short m_faces[2];
00041                 short m_nextEdge[2];    // for each m_face
00042         };
00043
00044         struct Face
00045         {
00046                 short m_numEdges;
00047                 short m_firstEdge;
00048         };
00049
00050 private:
00051         static const int kMaxVerts = 256;
00052         static const int kMaxFaces = 256;
00053         static const int kMaxEdges = 256;
00054
00055         short m_numVerts;
00056         short m_numFaces;
00057         short m_numEdges;
00058
00059         Point3* m_pVerts;
00060         Face* m_pFaces;
00061         Edge* m_pEdges;
00062         Plane* m_pPlanes;
00063
00064         // hull construction stuff
00065         static const int kTmpFaceMaxVerts = 64;
00066         struct TmpFace
00067         {
00068                 short m_index;
00069                 short m_next;
00070                 short m_numVerts;
00071                 short m_verts[kTmpFaceMaxVerts];
00072                 short m_edges[kTmpFaceMaxVerts];
00073                 Plane m_plane;
00074         };
00075
00076         struct TmpEdge
00077         {
00078                 short m_index;
00079                 short m_next;
00080                 short m_verts[2];
00081                 short m_faces[2];
00082         };
00083
00084         static short s_firstFreeTmpFace;
00085         static short s_firstUsedTmpFace;
00086         static TmpFace* s_pTmpFaces;
00087
00088         static short s_firstFreeTmpEdge;
00089         static short s_firstUsedTmpEdge;
00090         static TmpEdge* s_pTmpEdges;
00091
00092         static const Point3* s_pPoints;
00093
00094         static short AllocTmpFace();
00095         static void FreeTmpFace(short face);
00096         static TmpFace* GetTmpFace(short index) {if (index < 0) return 0; return s_pTmpFaces + index;}
00097
00098         static short AllocTmpEdge();
00099         static void FreeTmpEdge(short edge);
00100         static TmpEdge* GetTmpEdge(short index) {if (index < 0) return 0; return s_pTmpEdges + index;}
00101
00102         static short MatchOrAddEdge(short vert0, short vert1, short face);
00103         static void UnmatchOrRemoveEdge(short edge, short face);
00104
00105         static short AddTmpFace(short vert0, short vert1, short vert2);
00106         static short AddTmpFace(short numVerts, short* pVerts);
00107         static short AddTmpFace(short vert0, short numOtherVerts, short* pVerts);
00108         static void RemoveTmpFace(short face);
00109
00110         static bool TmpFaceAddPoint(short point, short face);
00111
00112         static int RemoveVisibleFaces(const Point3& point);
00113         static void FillHole(short newVertex);
00114         static Hull* MakeHullFromTemp();
00115
00116 public:
00117         Hull();
00118         ~Hull();
00119
00120 //      ObjectType GetObjectType() const {return kTypeHull;}
00121
00122         short GetNumVertices() const;
00123         short GetNumFaces() const;
00124         short GetNumEdges() const;
00125
00126         const Point3& GetVertex(short index) const;
00127         const Face& GetFace(short index) const;
00128         const Edge& GetEdge(short index) const;
00129         const Plane& GetPlane(short index) const;
00130
00131         short GetFaceFirstEdge(short face) const;
00132         short GetFaceNextEdge(short face, short prevEdge) const;
00133
00134         short GetEdgeVertex0(short face, short edge) const;
00135         short GetEdgeVertex1(short face, short edge) const;
00136
00137         short GetEdgeOtherFace(short edge, short face) const;
00138
00139         Point3 GetFaceCentroid(short face) const;
00140
00141         //static void ProcessHullHull(Separation& sep);
00142         static void ProcessHullHull(Separation& sep,const Hull& shapeA,const Hull& shapeB,const Transform& trA,const Transform& trB, HullContactCollector* collector);
00143
00144         virtual void ComputeInertia(const Transform& transform, Point3& centerOfMass, Matrix33& inertia, float totalMass) const;
00145         virtual Bounds3 ComputeBounds(const Transform& transform) const;
00146
00147         static Hull* MakeHull(int numPoints, const Point3* pPoints);
00148
00149         //for contact generation
00150
00151
00152
00154         static int ClipFace(int numVerts, Point3** ppVtxIn, Point3** ppVtxOut, const Plane& plane);
00155
00156         static bool GetSeparationHullHull(Separation& sep, const Point3* pVertsA, const Point3* pVertsB,
00157                                                                                   const Transform& trA, const Transform& trB,
00158                                                                                   const Hull& hullA,
00159                                                                                   const Hull& hullB
00160                                                                                   );
00161
00162         static int AddContactsHullHull(Separation& sep, const Point3* pVertsA, const Point3* pVertsB,
00163                                                                            const Transform& trA, const Transform& trB,const Hull& hullA,const Hull& hullB,
00164                                                                            HullContactCollector* hullContactCollector);
00165
00166
00167
00168 };
00169
00170
00171
00172 #include "hull.inl"
00173
00174 #endif //SAT_HULL_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HullContactCollector.h File Reference

Bullet » NarrowPhaseCollision

HullContactCollector.h File Reference

Go to the source code of this file.

Classes

class HullContactCollector
HullContactCollector collects the Hull computation to the contact point results. More...

Generated on Wed May 24 13:59:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HullContactCollector.h Source File

Bullet » NarrowPhaseCollision

HullContactCollector.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef HULL_CONTACT_COLLECTOR_H
00018 #define HULL_CONTACT_COLLECTOR_H
00019
00020 class Vector3;
00021 class Point3;
00022 class Scalar;
00023 struct Separation;
00024
00026 class HullContactCollector
00027 {
00028 public:
00029
00030         virtual ~HullContactCollector() {};
00031
00032         virtual int     BatchAddContactGroup(const Separation& sep,int numContacts,const Vector3& normalWorld,const Vector3& tangent,const Point3* positionsWorld,const float* depths)=0;
00033
00034         virtual int             GetMaxNumContacts() const = 0;
00035
00036 };
00037
00038 #endif //HULL_CONTACT_COLLECTOR_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: IDebugDraw.h File Reference

LinearMath

IDebugDraw.h File Reference

#include "SimdVector3.h"

Include dependency graph for IDebugDraw.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class IDebugDraw

Generated on Wed May 24 13:59:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: IDebugDraw.h Source File

LinearMath

IDebugDraw.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2005 Gino van den Bergen / Erwin Coumans http://continuousphysics.com
00003
00004 Permission is hereby granted, free of charge, to any person or organization
00005 obtaining a copy of the software and accompanying documentation covered by
00006 this license (the "Software") to use, reproduce, display, distribute,
00007 execute, and transmit the Software, and to prepare derivative works of the
00008 Software, and to permit third-parties to whom the Software is furnished to
00009 do so, all subject to the following:
00010
00011 The copyright notices in the Software and this entire statement, including
00012 the above license grant, this restriction and the following disclaimer,
00013 must be included in all copies of the Software, in whole or in part, and
00014 all derivative works of the Software, unless such copies or derivative
00015 works are solely in the form of machine-executable object code generated by
00016 a source language processor.
00017
00018 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00019 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00020 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
00021 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
00022 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
00023 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00024 DEALINGS IN THE SOFTWARE.
00025 */
00026
00027
00028 #ifndef IDEBUG_DRAW__H
00029 #define IDEBUG_DRAW__H
00030
00031 #include "SimdVector3.h"
00032
00033
00034 class   IDebugDraw
00035 {
00036         public:
00037
00038         enum    DebugDrawModes
00039         {
00040                 DBG_NoDebug=0,
00041                 DBG_DrawAabb=1,
00042                 DBG_DrawText=2,
00043                 DBG_DrawFeaturesText=4,
00044                 DBG_DrawContactPoints=8,
00045                 DBG_NoDeactivation=16,
00046                 DBG_NoHelpText = 32,
00047                 DBG_DrawWireframe = 64,
00048                 DBG_ProfileTimings = 128,
00049                 DBG_EnableSatComparison = 256,
00050                 DBG_DisableBulletLCP = 512,
00051                 DBG_EnableCCD = 1024,
00052                 DBG_MAX_DEBUG_DRAW_MODE
00053         };
00054
00055         virtual ~IDebugDraw() {};
00056
00057         virtual void    DrawLine(const SimdVector3& from,const SimdVector3& to,const SimdVector3& color)=0;
00058
00059         virtual void    DrawContactPoint(const SimdVector3& PointOnB,const SimdVector3& normalOnB,float distance,int lifeTime,const SimdVector3& color)=0;
00060
00061         virtual void    SetDebugMode(int debugMode) =0;
00062
00063         virtual int             GetDebugMode() const = 0;
00064
00065
00066 };
00067
00068 #endif //IDEBUG_DRAW__H
00069
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: JacobianEntry.h File Reference

BulletDynamics » ConstraintSolver

JacobianEntry.h File Reference

#include "SimdVector3.h"
#include "Dynamics/RigidBody.h"

Include dependency graph for JacobianEntry.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class JacobianEntry
Jacobian entry is an abstraction that allows to describe constraints it can be used in combination with a constraint solver Can be used to relate the effect of an impulse to the constraint error. More...

Generated on Wed May 24 13:59:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: JacobianEntry.h Source File

BulletDynamics » ConstraintSolver

JacobianEntry.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef JACOBIAN_ENTRY_H
00017 #define JACOBIAN_ENTRY_H
00018
00019 #include "SimdVector3.h"
00020 #include "Dynamics/RigidBody.h"
00021
00022
00023 //notes:
00024 // Another memory optimization would be to store m_1MinvJt in the remaining 3 w components
00025 // which makes the JacobianEntry memory layout 16 bytes
00026 // if you only are interested in angular part, just feed massInvA and massInvB zero
00027
00031 class JacobianEntry
00032 {
00033 public:
00034         JacobianEntry() {};
00035         //constraint between two different rigidbodies
00036         JacobianEntry(
00037                 const SimdMatrix3x3& world2A,
00038                 const SimdMatrix3x3& world2B,
00039                 const SimdVector3& rel_pos1,const SimdVector3& rel_pos2,
00040                 const SimdVector3& jointAxis,
00041                 const SimdVector3& inertiaInvA,
00042                 const SimdScalar massInvA,
00043                 const SimdVector3& inertiaInvB,
00044                 const SimdScalar massInvB)
00045                 :m_jointAxis(jointAxis)
00046         {
00047                 m_aJ = world2A*(rel_pos1.cross(m_jointAxis));
00048                 m_bJ = world2B*(rel_pos2.cross(-m_jointAxis));
00049                 m_0MinvJt       = inertiaInvA * m_aJ;
00050                 m_1MinvJt = inertiaInvB * m_bJ;
00051                 m_Adiag = massInvA + m_0MinvJt.dot(m_aJ) + massInvB + m_1MinvJt.dot(m_bJ);
00052         }
00053
00054                 //angular constraint between two different rigidbodies
00055         JacobianEntry(const SimdVector3& jointAxis,
00056                 const SimdMatrix3x3& world2A,
00057                 const SimdMatrix3x3& world2B,
00058                 const SimdVector3& inertiaInvA,
00059                 const SimdVector3& inertiaInvB)
00060                 :m_jointAxis(m_jointAxis)
00061         {
00062                 m_aJ= world2A*m_jointAxis;
00063                 m_bJ = world2B*-m_jointAxis;
00064                 m_0MinvJt       = inertiaInvA * m_aJ;
00065                 m_1MinvJt = inertiaInvB * m_bJ;
00066                 m_Adiag =  m_0MinvJt.dot(m_aJ) + m_1MinvJt.dot(m_bJ);
00067         }
00068
00069         //constraint on one rigidbody
00070         JacobianEntry(
00071                 const SimdMatrix3x3& world2A,
00072                 const SimdVector3& rel_pos1,const SimdVector3& rel_pos2,
00073                 const SimdVector3& jointAxis,
00074                 const SimdVector3& inertiaInvA,
00075                 const SimdScalar massInvA)
00076                 :m_jointAxis(jointAxis)
00077         {
00078                 m_aJ= world2A*(rel_pos1.cross(m_jointAxis));
00079                 m_bJ = world2A*(rel_pos2.cross(-m_jointAxis));
00080                 m_0MinvJt       = inertiaInvA * m_aJ;
00081                 m_1MinvJt = SimdVector3(0.f,0.f,0.f);
00082                 m_Adiag = massInvA + m_0MinvJt.dot(m_aJ);
00083         }
00084
00085         SimdScalar      getDiagonal() const { return m_Adiag; }
00086
00087         // for two constraints on the same rigidbody (for example vehicle friction)
00088         SimdScalar      getNonDiagonal(const JacobianEntry& jacB, const SimdScalar massInvA) const
00089         {
00090                 const JacobianEntry& jacA = *this;
00091                 SimdScalar lin = massInvA * jacA.m_jointAxis.dot(jacB.m_jointAxis);
00092                 SimdScalar ang = jacA.m_0MinvJt.dot(jacB.m_aJ);
00093                 return lin + ang;
00094         }
00095
00096
00097
00098         // for two constraints on sharing two same rigidbodies (for example two contact points between two rigidbodies)
00099         SimdScalar      getNonDiagonal(const JacobianEntry& jacB,const SimdScalar massInvA,const SimdScalar massInvB) const
00100         {
00101                 const JacobianEntry& jacA = *this;
00102                 SimdVector3 lin = jacA.m_jointAxis* jacB.m_jointAxis;
00103                 SimdVector3 ang0 = jacA.m_0MinvJt * jacB.m_aJ;
00104                 SimdVector3 ang1 = jacA.m_1MinvJt * jacB.m_bJ;
00105                 SimdVector3 lin0 = massInvA * lin ;
00106                 SimdVector3 lin1 = massInvB * lin;
00107                 SimdVector3 sum = ang0+ang1+lin0+lin1;
00108                 return sum[0]+sum[1]+sum[2];
00109         }
00110
00111         SimdScalar getRelativeVelocity(const SimdVector3& linvelA,const SimdVector3& angvelA,const SimdVector3& linvelB,const SimdVector3& angvelB)
00112         {
00113                 SimdVector3 linrel = linvelA - linvelB;
00114                 SimdVector3 angvela  = angvelA * m_aJ;
00115                 SimdVector3 angvelb  = angvelB * m_bJ;
00116                 linrel *= m_jointAxis;
00117                 angvela += angvelb;
00118                 angvela += linrel;
00119                 SimdScalar rel_vel2 = angvela[0]+angvela[1]+angvela[2];
00120                 return rel_vel2 + SIMD_EPSILON;
00121         }
00122 //private:
00123
00124         SimdVector3     m_jointAxis;
00125         SimdVector3     m_aJ;
00126         SimdVector3     m_bJ;
00127         SimdVector3     m_0MinvJt;
00128         SimdVector3     m_1MinvJt;
00129         //Optimization: can be stored in the w/last component of one of the vectors
00130         SimdScalar      m_Adiag;
00131
00132 };
00133
00134 #endif //JACOBIAN_ENTRY_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldContactAddResult.cpp File Reference

Bullet » NarrowPhaseCollision

ManifoldContactAddResult.cpp File Reference

#include "ManifoldContactAddResult.h"
#include "NarrowPhaseCollision/PersistentManifold.h"

Include dependency graph for ManifoldContactAddResult.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldContactAddResult.cpp Source File

Bullet » NarrowPhaseCollision

ManifoldContactAddResult.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "ManifoldContactAddResult.h"
00017 #include "NarrowPhaseCollision/PersistentManifold.h"
00018
00019 ManifoldContactAddResult::ManifoldContactAddResult(SimdTransform transA,SimdTransform transB,PersistentManifold* manifoldPtr)
00020                 :m_manifoldPtr(manifoldPtr)
00021 {
00022         m_transAInv = transA.inverse();
00023         m_transBInv = transB.inverse();
00024
00025 }
00026
00027
00028 void ManifoldContactAddResult::AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
00029 {
00030         if (depth > m_manifoldPtr->GetContactBreakingTreshold())
00031                 return;
00032
00033
00034         SimdVector3 pointA = pointInWorld + normalOnBInWorld * depth;
00035         SimdVector3 localA = m_transAInv(pointA );
00036         SimdVector3 localB = m_transBInv(pointInWorld);
00037         ManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
00038
00039         int insertIndex = m_manifoldPtr->GetCacheEntry(newPt);
00040         if (insertIndex >= 0)
00041         {
00042                 m_manifoldPtr->ReplaceContactPoint(newPt,insertIndex);
00043         } else
00044         {
00045                 m_manifoldPtr->AddManifoldPoint(newPt);
00046         }
00047 }
00048
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldContactAddResult.h File Reference

Bullet » NarrowPhaseCollision

ManifoldContactAddResult.h File Reference

#include "NarrowPhaseCollision/DiscreteCollisionDetectorInterface.h"

Include dependency graph for ManifoldContactAddResult.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ManifoldContactAddResult

Generated on Wed May 24 13:59:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldContactAddResult.h Source File

Bullet » NarrowPhaseCollision

ManifoldContactAddResult.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef MANIFOLD_CONTACT_ADD_RESULT_H
00018 #define MANIFOLD_CONTACT_ADD_RESULT_H
00019
00020 #include "NarrowPhaseCollision/DiscreteCollisionDetectorInterface.h"
00021 class PersistentManifold;
00022
00023 class ManifoldContactAddResult : public DiscreteCollisionDetectorInterface::Result
00024 {
00025         PersistentManifold* m_manifoldPtr;
00026         SimdTransform   m_transAInv;
00027         SimdTransform   m_transBInv;
00028
00029 public:
00030
00031         ManifoldContactAddResult(SimdTransform transA,SimdTransform transB,PersistentManifold* manifoldPtr);
00032
00033         virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth);
00034
00035 };
00036
00037 #endif //MANIFOLD_CONTACT_ADD_RESULT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldPoint.h File Reference

Bullet » NarrowPhaseCollision

ManifoldPoint.h File Reference

#include "SimdVector3.h"
#include "SimdTransformUtil.h"

Include dependency graph for ManifoldPoint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ManifoldPoint
ManifoldContactPoint collects and maintains persistent contactpoints. More...

Generated on Wed May 24 13:59:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldPoint.h Source File

Bullet » NarrowPhaseCollision

ManifoldPoint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef MANIFOLD_CONTACT_POINT_H
00017 #define MANIFOLD_CONTACT_POINT_H
00018
00019 #include "SimdVector3.h"
00020 #include "SimdTransformUtil.h"
00021
00022
00023
00024
00025
00028 class ManifoldPoint
00029         {
00030                 public:
00031                         ManifoldPoint()
00032                                 :m_userPersistentData(0)
00033                         {
00034                         }
00035
00036                         ManifoldPoint( const SimdVector3 &pointA, const SimdVector3 &pointB,
00037                                         const SimdVector3 &normal,
00038                                         SimdScalar distance ) :
00039                                         m_localPointA( pointA ),
00040                                         m_localPointB( pointB ),
00041                                         m_normalWorldOnB( normal ),
00042                                         m_distance1( distance ),
00043                                         m_userPersistentData(0),
00044                                         m_lifeTime(0)
00045                         {
00046
00047
00048                         }
00049
00050
00051
00052                         SimdVector3 m_localPointA;
00053                         SimdVector3 m_localPointB;
00054                         SimdVector3     m_positionWorldOnB;
00056                         SimdVector3     m_positionWorldOnA;
00057                         SimdVector3 m_normalWorldOnB;
00058
00059                         float   m_distance1;
00060
00061
00062                         void*   m_userPersistentData;
00063
00064                         int             m_lifeTime;//lifetime of the contactpoint in frames
00065
00066                         float GetDistance() const
00067                         {
00068                                 return m_distance1;
00069                         }
00070                         int     GetLifeTime() const
00071                         {
00072                                 return m_lifeTime;
00073                         }
00074
00075                         SimdVector3 GetPositionWorldOnA() {
00076                                 return m_positionWorldOnA;
00077 //                              return m_positionWorldOnB + m_normalWorldOnB * m_distance1;
00078                         }
00079
00080                         const SimdVector3& GetPositionWorldOnB()
00081                         {
00082                                 return m_positionWorldOnB;
00083                         }
00084
00085                         void    SetDistance(float dist)
00086                         {
00087                                 m_distance1 = dist;
00088                         }
00089
00090
00091
00092         };
00093
00094 #endif //MANIFOLD_CONTACT_POINT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldResult.cpp File Reference

Bullet » CollisionDispatch

ManifoldResult.cpp File Reference

#include "ManifoldResult.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "CollisionDispatch/CollisionObject.h"

Include dependency graph for ManifoldResult.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldResult.cpp Source File

Bullet » CollisionDispatch

ManifoldResult.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "ManifoldResult.h"
00018 #include "NarrowPhaseCollision/PersistentManifold.h"
00019 #include "CollisionDispatch/CollisionObject.h"
00020
00021 ManifoldResult::ManifoldResult(CollisionObject* body0,CollisionObject* body1,PersistentManifold* manifoldPtr)
00022                 :m_manifoldPtr(manifoldPtr),
00023                 m_body0(body0),
00024                 m_body1(body1)
00025         {
00026         }
00027
00028
00029 void ManifoldResult::AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
00030 {
00031         if (depth > m_manifoldPtr->GetContactBreakingTreshold())
00032                 return;
00033
00034         SimdTransform transAInv = m_body0->m_worldTransform.inverse();
00035         SimdTransform transBInv= m_body1->m_worldTransform.inverse();
00036         SimdVector3 pointA = pointInWorld + normalOnBInWorld * depth;
00037         SimdVector3 localA = transAInv(pointA );
00038         SimdVector3 localB = transBInv(pointInWorld);
00039         ManifoldPoint newPt(localA,localB,normalOnBInWorld,depth);
00040
00041
00042
00043         int insertIndex = m_manifoldPtr->GetCacheEntry(newPt);
00044         if (insertIndex >= 0)
00045         {
00046
00047 // This is not needed, just use the old info!
00048 //              const ManifoldPoint& oldPoint = m_manifoldPtr->GetContactPoint(insertIndex);
00049 //              newPt.CopyPersistentInformation(oldPoint);
00050 //              m_manifoldPtr->ReplaceContactPoint(newPt,insertIndex);
00051
00052
00053         } else
00054         {
00055                 m_manifoldPtr->AddManifoldPoint(newPt);
00056         }
00057 }
00058
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldResult.h File Reference

Bullet » CollisionDispatch

ManifoldResult.h File Reference

#include "NarrowPhaseCollision/DiscreteCollisionDetectorInterface.h"

Include dependency graph for ManifoldResult.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class ManifoldResult
ManifoldResult is a helper class to manage contact results. More...

Generated on Wed May 24 13:59:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldResult.h Source File

Bullet » CollisionDispatch

ManifoldResult.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef MANIFOLD_RESULT_H
00018 #define MANIFOLD_RESULT_H
00019
00020 #include "NarrowPhaseCollision/DiscreteCollisionDetectorInterface.h"
00021 struct CollisionObject;
00022 class PersistentManifold;
00023
00025 class ManifoldResult : public DiscreteCollisionDetectorInterface::Result
00026 {
00027         PersistentManifold* m_manifoldPtr;
00028         CollisionObject* m_body0;
00029         CollisionObject* m_body1;
00030
00031 public:
00032
00033         ManifoldResult(CollisionObject* body0,CollisionObject* body1,PersistentManifold* manifoldPtr);
00034
00035         virtual ~ManifoldResult() {};
00036
00037         virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth);
00038
00039 };
00040
00041 #endif //MANIFOLD_RESULT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MassProps.h File Reference

BulletDynamics » Dynamics

MassProps.h File Reference

#include <SimdVector3.h>

Include dependency graph for MassProps.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct MassProps

Generated on Wed May 24 13:59:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MassProps.h Source File

BulletDynamics » Dynamics

MassProps.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef MASS_PROPS_H
00017 #define MASS_PROPS_H
00018
00019 #include <SimdVector3.h>
00020
00021 struct MassProps {
00022         MassProps(float mass,const SimdVector3& inertiaLocal):
00023         m_mass(mass),
00024                 m_inertiaLocal(inertiaLocal)
00025         {
00026         }
00027         float   m_mass;
00028         SimdVector3     m_inertiaLocal;
00029 };
00030
00031
00032 #endif
00033
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Maths.h File Reference

LinearMath

Maths.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Generated on Wed May 24 13:59:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Maths.h Source File

LinearMath

Maths.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Maths.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifndef BULLET_MATH_H
00018 #define BULLET_MATH_H
00019
00020 #ifdef WIN32
00021
00022 #include <math.h>
00023 #include <stdlib.h>
00024 #include <float.h>
00025
00026 // intrinsics headers
00027 #include <mmintrin.h>
00028 #include <xmmintrin.h>
00029
00030 // vector maths classes require aligned alloc
00031 #include "Memory2.h"
00032
00033 // constants
00034 #define PI                              3.141592654f
00035
00036 #define Angle5                  0.087266462f
00037 #define Angle10                 0.174532925f
00038 #define Angle15                 0.261799388f
00039 #define Angle30                 0.523598776f
00040 #define Angle45                 0.785398163f
00041 #define Angle60                 0.523598776f
00042 #define Angle90                 1.570796327f
00043 #define Angle180                PI
00044 #define Angle270                4.71238898f
00045 #define Angle360                6.283185307f
00046
00047 #define Deg2RadF                0.01745329251994329547f
00048 #define Rad2DegF                57.29577951308232286465f
00049
00050 #define MinValueF               -3.402823466e+38f
00051 #define MaxValueF               3.402823466e+38F
00052
00053 #define DefaultEpsilon  0.001f
00054
00055
00056 // float functions
00057
00058 inline float Sin(const float f)
00059 {
00060         return sinf(f);
00061 }
00062
00063 inline float Cos(const float f)
00064 {
00065         return cosf(f);
00066 }
00067
00068 inline float Tan(const float f)
00069 {
00070         return tanf(f);
00071 }
00072
00073 inline float Asin(const float f)
00074 {
00075         return asinf(f);
00076 }
00077
00078 inline float Acos(const float f)
00079 {
00080         return acosf(f);
00081 }
00082
00083 inline float Atan(const float f)
00084 {
00085         return atanf(f);
00086 }
00087
00088 inline float Atan2(const float y, const float x)
00089 {
00090         return atan2f(y, x);
00091 }
00092
00093 inline float Pow(const float x, const float y)
00094 {
00095         return powf(x, y);
00096 }
00097
00098 inline float Abs(const float x)
00099 {
00100         return fabsf(x);
00101 }
00102
00103 inline float Min(const float x, const float y)
00104 {
00105         return (x < y) ? x : y;
00106 }
00107
00108 inline float Max(const float x, const float y)
00109 {
00110         return (x > y) ? x : y;
00111 }
00112
00113 inline float Clamp(const float x, const float min, const float max)
00114 {
00115         return (x >= max) ? max : Max(x, min);
00116 }
00117
00118 inline float Sgn(const float f)
00119 {
00120         // TODO: replace this with something that doesn't branch
00121         if (f < 0.0f)
00122                 return -1.0f;
00123         if (f > 0.0f)
00124                 return 1.0f;
00125         return 0.0f;
00126 }
00127
00128 inline float Floor(const float f)
00129 {
00130         return floorf(f);
00131 }
00132
00133 inline float Ceil(const float f)
00134 {
00135         return ceilf(f);
00136 }
00137
00138 inline float Mod(const float x, const float y)
00139 {
00140         float n = Floor(x / y);
00141         return x - n * y;
00142 }
00143
00144 inline float Sqrt(const float f)
00145 {
00146         return sqrtf(f);
00147 }
00148
00149 inline bool Equal(const float x, const float y, const float epsilon = DefaultEpsilon)
00150 {
00151         return Abs(x-y) <= epsilon;
00152 }
00153
00154 inline float Lerp(const float x, const float y, const float t)
00155 {
00156         return x + (y - x) * t;
00157 }
00158
00159 inline int Min(const int x, const int y)
00160 {
00161         return (x < y) ? x : y;
00162 }
00163
00164 inline int Max(const int x, const int y)
00165 {
00166         return (x > y) ? x : y;
00167 }
00168
00169 #include "Vector.h"
00170 #include "Matrix.h"
00171 #include "Quat.h"
00172 #include "Geometry.h"
00173
00174 #endif //WIN32
00175 #endif //BULLET_MATH_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Matrix.cpp File Reference

LinearMath

Matrix.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Matrix.cpp Source File

LinearMath

Matrix.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Matrix.cpp
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017
00018 #ifdef WIN32
00019 #if _MSC_VER >= 1310
00020
00021 #include "matrix.h"
00022 #include <assert.h>
00023
00024
00026 // Matrix33
00027 Matrix33::Matrix33(const Quat& q)
00028 {
00029         float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2;
00030         float *pIn = (float*)&q;
00031         float *pOut = (float*)this;
00032
00033         float x = pIn[0], y = pIn[1], z = pIn[2], w = pIn[3];
00034
00035         x2 = x + x; y2 = y + y; z2 = z + z;
00036         xx = x * x2; yy = y * y2; zz = z * z2;
00037         wx = w * x2; wy = w * y2; wz = w * z2;
00038         xy = x * y2; xz = x * z2;
00039         yz = y * z2;
00040
00041         pOut[0] = 1.0f - (yy + zz);
00042         pOut[1] = xy + wz;
00043         pOut[2] = xz - wy;
00044         pOut[3] = 0.0f;
00045
00046         pOut[4] = xy - wz;
00047         pOut[5] = 1.0f - (xx + zz);
00048         pOut[6] = yz + wx;
00049         pOut[7] = 0.0f;
00050
00051         pOut[8] = xz + wy;
00052         pOut[9] = yz - wx;
00053         pOut[10] = 1.0f - (xx + yy);
00054         pOut[11] = 0.0f;
00055 }
00056
00057 const Matrix33 Inv(const Matrix33& m)
00058 {
00059         // TODO: do this efficiently - for now we just use the Matrix44 version
00060         Matrix44 m44 = Inv(Matrix44(Vector4(m[0]), Vector4(m[1]), Vector4(m[2]), Vector4(Maths::UnitW)));
00061         return Matrix33(Vector3(m44[0]), Vector3(m44[1]), Vector3(m44[2]));
00062 }
00063
00064
00066 // Matrix44
00067
00068 // calculate the inverse of a general 4x4 matrix
00069 //
00070 //     -1
00071 //     A  = ___1__ adjoint A
00072 //         det A
00073 //
00074 const Matrix44 Inv(const Matrix44& src)
00075 {
00076         __m128  minor0, minor1, minor2, minor3;
00077         __m128  row0,   row1 = _mm_set_ps1(0.0f),   row2,   row3 = row1;
00078         __m128  det,    tmp1 = row1,  tmp2;
00079
00080         Matrix44 tmp(src);
00081         float   *m = (float*)&tmp;
00082
00083         tmp1    = _mm_loadh_pi( _mm_loadl_pi( tmp1, (__m64*)(m  ) ), (__m64*)(m+ 4) );
00084         row1    = _mm_loadh_pi( _mm_loadl_pi( row1, (__m64*)(m+8) ), (__m64*)(m+12) );
00085
00086         row0    = _mm_shuffle_ps( tmp1, row1, 0x88 );
00087         row1    = _mm_shuffle_ps( row1, tmp1, 0xDD );
00088
00089         tmp1    = _mm_loadh_pi( _mm_loadl_pi( tmp1, (__m64*)(m+ 2) ), (__m64*)(m+ 6) );
00090         row3    = _mm_loadh_pi( _mm_loadl_pi( row3, (__m64*)(m+10) ), (__m64*)(m+14) );
00091
00092         row2    = _mm_shuffle_ps( tmp1, row3, 0x88 );
00093         row3    = _mm_shuffle_ps( row3, tmp1, 0xDD );
00094 //      -----------------------------------------------
00095         tmp2    = _mm_mul_ps( row2, row3 );
00096         tmp1    = _mm_shuffle_ps( tmp2, tmp2, 0xB1);
00097
00098         minor0  = _mm_mul_ps( row1, tmp1 );
00099         minor1  = _mm_mul_ps( row0, tmp1 );
00100
00101         tmp1    = _mm_shuffle_ps( tmp1, tmp1, 0x4E );
00102
00103         minor0  = _mm_sub_ps( _mm_mul_ps( row1, tmp1 ), minor0 );
00104         minor1  = _mm_sub_ps( _mm_mul_ps( row0, tmp1 ), minor1 );
00105         minor1  = _mm_shuffle_ps( minor1, minor1, 0x4E );
00106 //      -----------------------------------------------
00107         tmp2    = _mm_mul_ps( row1, row2);
00108         tmp1    = _mm_shuffle_ps( tmp2, tmp2, 0xB1 );
00109
00110         minor0  = _mm_add_ps( _mm_mul_ps( row3, tmp1 ), minor0  );
00111         minor3  = _mm_mul_ps( row0, tmp1 );
00112
00113         tmp1    = _mm_shuffle_ps( tmp1, tmp1, 0x4E );
00114
00115         minor0  = _mm_sub_ps( minor0, _mm_mul_ps( row3, tmp1 ) );
00116         minor3  = _mm_sub_ps( _mm_mul_ps( row0, tmp1 ), minor3 );
00117         minor3  = _mm_shuffle_ps( minor3, minor3, 0x4E );
00118 //      -----------------------------------------------
00119         tmp2    = _mm_mul_ps( _mm_shuffle_ps( row1, row1, 0x4E ), row3 );
00120         tmp1    = _mm_shuffle_ps( tmp2, tmp2, 0xB1 );
00121         row2    = _mm_shuffle_ps( row2, row2, 0x4E );
00122
00123         minor0  = _mm_add_ps( _mm_mul_ps( row2, tmp1 ), minor0 );
00124         minor2  = _mm_mul_ps( row0, tmp1 );
00125
00126         tmp1    = _mm_shuffle_ps( tmp1, tmp1, 0x4E );
00127
00128         minor0  = _mm_sub_ps( minor0, _mm_mul_ps( row2, tmp1 ) );
00129         minor2  = _mm_sub_ps( _mm_mul_ps( row0, tmp1 ), minor2 );
00130         minor2  = _mm_shuffle_ps( minor2, minor2, 0x4E );
00131 //      -----------------------------------------------
00132         tmp2    = _mm_mul_ps( row0, row1);
00133         tmp1    = _mm_shuffle_ps( tmp2, tmp2, 0xB1 );
00134
00135         minor2  = _mm_add_ps( _mm_mul_ps( row3, tmp1 ), minor2 );
00136         minor3  = _mm_sub_ps( _mm_mul_ps( row2, tmp1 ), minor3 );
00137
00138         tmp1    = _mm_shuffle_ps( tmp1, tmp1, 0x4E );
00139
00140         minor2  = _mm_sub_ps( _mm_mul_ps( row3, tmp1 ), minor2 );
00141         minor3  = _mm_sub_ps( minor3, _mm_mul_ps( row2, tmp1 ) );
00142 //      -----------------------------------------------
00143         tmp2    = _mm_mul_ps( row0, row3);
00144         tmp1    = _mm_shuffle_ps( tmp2, tmp2, 0xB1 );
00145
00146         minor1  = _mm_sub_ps( minor1, _mm_mul_ps( row2, tmp1 ) );
00147         minor2  = _mm_add_ps( _mm_mul_ps( row1, tmp1 ), minor2 );
00148
00149         tmp1    = _mm_shuffle_ps( tmp1, tmp1, 0x4E );
00150
00151         minor1  = _mm_add_ps( _mm_mul_ps( row2, tmp1 ), minor1 );
00152         minor2  = _mm_sub_ps( minor2, _mm_mul_ps( row1, tmp1 ) );
00153 //      -----------------------------------------------
00154         tmp2    = _mm_mul_ps( row0, row2);
00155         tmp1    = _mm_shuffle_ps( tmp2, tmp2, 0xB1 );
00156
00157         minor1  = _mm_add_ps( _mm_mul_ps( row3, tmp1 ), minor1 );
00158         minor3  = _mm_sub_ps( minor3, _mm_mul_ps( row1, tmp1 ) );
00159
00160         tmp1    = _mm_shuffle_ps( tmp1, tmp1, 0x4E );
00161
00162         minor1  = _mm_sub_ps( minor1, _mm_mul_ps( row3, tmp1 ) );
00163         minor3  = _mm_add_ps( _mm_mul_ps( row1, tmp1 ), minor3 );
00164 //      -----------------------------------------------
00165         det             = _mm_mul_ps( row0, minor0 );
00166         det             = _mm_add_ps( _mm_shuffle_ps( det, det, 0x4E ), det );
00167         det             = _mm_add_ss( _mm_shuffle_ps( det, det, 0xB1 ), det );
00168         tmp1    = _mm_rcp_ss( det );
00169
00170         det             = _mm_sub_ss( _mm_add_ss( tmp1, tmp1 ), _mm_mul_ss( det, _mm_mul_ss( tmp1, tmp1 ) ) );
00171         det             = _mm_shuffle_ps( det, det, 0x00 );
00172
00173         minor0  = _mm_mul_ps( det, minor0 );
00174         _mm_storel_pi( (__m64*)( m ), minor0 );
00175         _mm_storeh_pi( (__m64*)(m+2), minor0 );
00176
00177         minor1  = _mm_mul_ps( det, minor1 );
00178         _mm_storel_pi( (__m64*)(m+4), minor1 );
00179         _mm_storeh_pi( (__m64*)(m+6), minor1 );
00180
00181         minor2  = _mm_mul_ps( det, minor2 );
00182         _mm_storel_pi( (__m64*)(m+ 8), minor2 );
00183         _mm_storeh_pi( (__m64*)(m+10), minor2 );
00184
00185         minor3  = _mm_mul_ps( det, minor3 );
00186         _mm_storel_pi( (__m64*)(m+12), minor3 );
00187         _mm_storeh_pi( (__m64*)(m+14), minor3 );
00188
00189         return tmp;
00190 }
00191
00192
00193
00195 // Transform
00196
00197
00198
00200 // Matrix66
00201
00202 #endif
00203 #endif //#ifdef WIN32
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Matrix.h File Reference

LinearMath

Matrix.h File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Matrix.h Source File

LinearMath

Matrix.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Matrix.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifndef BULLET_MATRIX_H
00018 #define BULLET_MATRIX_H
00019
00020 #ifdef WIN32
00021
00022 #include "Vector.h"
00023 #include "Memory2.h"
00024
00025 class Quat;
00026
00027 #include <malloc.h>
00028
00029
00032 __declspec(align(16)) class Matrix33
00033 {
00034 private:
00035         Vector3 m_rows[3];
00036
00037 public:
00038
00039         BULLET_ALIGNED_NEW_AND_DELETE
00040
00041
00042         // constructors
00043         Matrix33();
00044         Matrix33(const Vector3& x, const Vector3& y, const Vector3& z);
00045
00046         // explicit constructors
00047         explicit Matrix33(const Quat& q);
00048
00049         explicit Matrix33(const Maths::ZeroTag&);
00050         explicit Matrix33(const Maths::IdentityTag&);
00051         explicit Matrix33(const Maths::RotateXTag&, float radians);
00052         explicit Matrix33(const Maths::RotateYTag&, float radians);
00053         explicit Matrix33(const Maths::RotateZTag&, float radians);
00054         explicit Matrix33(const Maths::ScaleTag&, const Vector3& scale);
00055         explicit Matrix33(const Maths::SkewTag&, const Vector3& v);
00056
00057         // assignment
00058         const Matrix33& operator=(const Matrix33& m);
00059
00060         // assignment to constant
00061         const Matrix33& operator=(const Maths::ZeroTag&);
00062         const Matrix33& operator=(const Maths::IdentityTag&);
00063
00064         // element access
00065         Vector3& operator[](int row);
00066         const Vector3& operator[](int row) const;
00067
00068         Vector3& GetAxisX();
00069         const Vector3& GetAxisX() const;
00070         void SetAxisX(const Vector3& v);
00071
00072         Vector3& GetAxisY();
00073         const Vector3& GetAxisY() const;
00074         void SetAxisY(const Vector3& v);
00075
00076         Vector3& GetAxisZ();
00077         const Vector3& GetAxisZ() const;
00078         void SetAxisZ(const Vector3& v);
00079
00080         // operations
00081         void operator*=(const Matrix33& a);
00082         void operator*=(const Scalar& s);
00083         void operator+=(const Matrix33& a);
00084         void operator-=(const Matrix33& a);
00085
00086         friend const Vector3 operator*(const Vector3& v, const Matrix33& m);
00087         friend const Vector3 operator*(const Matrix33& m, const Vector3& vT);
00088         friend const Matrix33 operator*(const Matrix33& a, const Matrix33& b);
00089         friend const Matrix33 operator*(const Matrix33& m, const Scalar& s);
00090         friend const Matrix33 operator+(const Matrix33& a, const Matrix33& b);
00091         friend const Matrix33 operator-(const Matrix33& a, const Matrix33& b);
00092
00093         friend const Matrix33 Transpose(const Matrix33& m);
00094         friend const Matrix33 Inv(const Matrix33& m);
00095         friend const Scalar Det(const Matrix33& m);
00096 };
00097
00098
00100 // Matrix44
00101
00102 __declspec(align(16)) class Matrix44
00103 {
00104 private:
00105         Vector4 m_rows[4];
00106
00107 public:
00108         // constructors
00109         Matrix44();
00110         Matrix44(const Vector4& x, const Vector4& y, const Vector4& z, const Vector4& w);
00111
00112         // explicit constructors
00113         explicit Matrix44(const Maths::ZeroTag&);
00114         explicit Matrix44(const Maths::IdentityTag&);
00115         explicit Matrix44(const Maths::RotateXTag&, float radians);
00116         explicit Matrix44(const Maths::RotateYTag&, float radians);
00117         explicit Matrix44(const Maths::RotateZTag&, float radians);
00118
00119         // assignment
00120         const Matrix44& operator=(const Matrix44& m);
00121
00122         // assignment to constant
00123         const Matrix44& operator=(const Maths::ZeroTag&);
00124         const Matrix44& operator=(const Maths::IdentityTag&);
00125
00126         // element access
00127         Vector4& operator[](int row);
00128         const Vector4& operator[](int row) const;
00129
00130         // operations
00131         void operator*=(const Matrix44& a);
00132         void operator*=(const Scalar& s);
00133         void operator+=(const Matrix44& a);
00134         void operator-=(const Matrix44& a);
00135
00136         friend const Vector3 operator*(const Vector3& v, const Matrix44& m);
00137         friend const Point3 operator*(const Point3& v, const Matrix44& m);
00138         friend const Vector4 operator*(const Vector4& v, const Matrix44& m);
00139
00140         friend const Matrix44 operator*(const Matrix44& a, const Matrix44& b);
00141         friend const Matrix44 operator*(const Scalar& s, const Matrix44& m);
00142         friend const Matrix44 operator*(const Matrix44& m, const Scalar& s);
00143         friend const Matrix44 operator+(const Matrix44& a, const Matrix44& b);
00144         friend const Matrix44 operator-(const Matrix44& a, const Matrix44& b);
00145
00146         friend const Matrix44 Transpose(const Matrix44& m);
00147         friend const Matrix44 Inv(const Matrix44& m);
00148 };
00149
00150
00152 // Transform
00153
00154 __declspec(align(16)) class Transform
00155 {
00156 private:
00157         Matrix33 m_rotation;
00158         Point3 m_translation;
00159
00160 public:
00161         // constructors
00162         Transform();
00163         Transform(const Matrix33& xyz, const Point3& w);
00164         Transform(const Vector3& x, const Vector3& y, const Vector3& z, const Point3& w);
00165
00166         // explicit constructors
00167         explicit Transform(const Maths::IdentityTag&);
00168
00169         // assignment
00170         const Transform& operator=(const Transform& m);
00171
00172         // assignment to constant
00173         const Transform& operator=(const Maths::IdentityTag&);
00174
00175         // element access
00176         Matrix33& GetRotation();
00177         const Matrix33& GetRotation() const;
00178         void SetRotation(const Matrix33& m);
00179         void SetRotation(const Quat& q);
00180
00181         Point3& GetTranslation();
00182         const Point3& GetTranslation() const;
00183         void SetTranslation(const Point3& p);
00184
00185         Vector3& GetAxisX();
00186         const Vector3& GetAxisX() const;
00187
00188         Vector3& GetAxisY();
00189         const Vector3& GetAxisY() const;
00190
00191         Vector3& GetAxisZ();
00192         const Vector3& GetAxisZ() const;
00193
00194         // operations
00195         friend const Vector3 operator*(const Vector3& v, const Transform& m);
00196         friend const Point3 operator*(const Point3& v, const Transform& m);
00197
00198         friend const Transform operator*(const Transform& v, const Transform& m);
00199
00200         friend const Transform Inv(const Transform& m);
00201 };
00202
00203
00204
00205 #include "matrix.inl"
00206
00207 #endif //#ifdef WIN32
00208 #endif //BULLET_MATRIX_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Memory2.h File Reference

LinearMath

Memory2.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Generated on Wed May 24 13:59:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Memory2.h Source File

LinearMath

Memory2.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Memory.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017
00018 #ifndef BULLET_MEMORY2_H
00019 #define BULLET_MEMORY2_H
00020
00021 #ifdef WIN32
00022
00023 // default new and delete overrides that guarantee 16 byte alignment and zero allocated memory
00024 void* operator new(size_t sz) throw();
00025 void* operator new[](size_t sz) throw();
00026 void operator delete(void* m) throw();
00027 void operator delete[](void* m) throw();
00028
00029 #include <malloc.h>
00030
00031 #define BULLET_ALIGNED_NEW_AND_DELETE \
00032 \
00033 inline void* operator new(size_t sz) throw()    \
00034 {                                                                                               \
00035         void* mem = _aligned_malloc(sz + 64, 16);       \
00036         return mem;                                                                     \
00037 }                                                                                               \
00038                                                                                                 \
00039 inline void* operator new[](size_t sz) throw()  \
00040 {                                                                                               \
00041         void* mem = _aligned_malloc(sz + 64, 16);       \
00042         return mem;                                                                     \
00043 }                                                                                               \
00044                                                                                                 \
00045 inline void operator delete(void* m) throw()    \
00046 {                                                                                               \
00047         if (m == 0)                                                                     \
00048                 return;                                                                 \
00049         _aligned_free(m);                                                       \
00050 }                                                                                               \
00051                                                                                                 \
00052 inline void operator delete[](void* m) throw()  \
00053 {                                                                                               \
00054         _aligned_free(m);                                                       \
00055 }                                                                                               \
00056
00057
00058
00059 #endif //WIN32
00060
00061 #endif //MEMORY2_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiPenetrationDepthSolver.cpp File Reference

Bullet » NarrowPhaseCollision

MinkowskiPenetrationDepthSolver.cpp File Reference

#include "MinkowskiPenetrationDepthSolver.h"
#include "CollisionShapes/MinkowskiSumShape.h"
#include "NarrowPhaseCollision/SubSimplexConvexCast.h"
#include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
#include "NarrowPhaseCollision/GjkPairDetector.h"

Include dependency graph for MinkowskiPenetrationDepthSolver.cpp:

Go to the source code of this file.

Classes

struct | MyResult

Defines

#define | NUM_UNITSPHERE_POINTS 42
#define | USE_BATCHED_SUPPORT 1

Variables

static SimdVector3 | sPenetrationDirections [NUM_UNITSPHERE_POINTS]

Define Documentation

#define NUM_UNITSPHERE_POINTS 42

Definition at line 44 of file MinkowskiPenetrationDepthSolver.cpp.

Referenced by MinkowskiPenetrationDepthSolver::CalcPenDepth().

#define USE_BATCHED_SUPPORT 1

Variable Documentation

SimdVector3 sPenetrationDirections[NUM_UNITSPHERE_POINTS] [static]

Definition at line 45 of file MinkowskiPenetrationDepthSolver.cpp.

Generated on Wed May 24 13:59:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiPenetrationDepthSolver.cpp Source File

Bullet » NarrowPhaseCollision

MinkowskiPenetrationDepthSolver.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "MinkowskiPenetrationDepthSolver.h"
00017 #include "CollisionShapes/MinkowskiSumShape.h"
00018 #include "NarrowPhaseCollision/SubSimplexConvexCast.h"
00019 #include "NarrowPhaseCollision/VoronoiSimplexSolver.h"
00020 #include "NarrowPhaseCollision/GjkPairDetector.h"
00021
00022
00023 struct MyResult : public DiscreteCollisionDetectorInterface::Result
00024 {
00025
00026         MyResult():m_hasResult(false)
00027         {
00028         }
00029
00030         SimdVector3 m_normalOnBInWorld;
00031         SimdVector3 m_pointInWorld;
00032         float m_depth;
00033         bool    m_hasResult;
00034
00035         void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
00036         {
00037                 m_normalOnBInWorld = normalOnBInWorld;
00038                 m_pointInWorld = pointInWorld;
00039                 m_depth = depth;
00040                 m_hasResult = true;
00041         }
00042 };
00043
00044 #define NUM_UNITSPHERE_POINTS 42
00045 static SimdVector3      sPenetrationDirections[NUM_UNITSPHERE_POINTS] =
00046 {
00047 SimdVector3(0.000000f , -0.000000f,-1.000000f),
00048 SimdVector3(0.723608f , -0.525725f,-0.447219f),
00049 SimdVector3(-0.276388f , -0.850649f,-0.447219f),
00050 SimdVector3(-0.894426f , -0.000000f,-0.447216f),
00051 SimdVector3(-0.276388f , 0.850649f,-0.447220f),
00052 SimdVector3(0.723608f , 0.525725f,-0.447219f),
00053 SimdVector3(0.276388f , -0.850649f,0.447220f),
00054 SimdVector3(-0.723608f , -0.525725f,0.447219f),
00055 SimdVector3(-0.723608f , 0.525725f,0.447219f),
00056 SimdVector3(0.276388f , 0.850649f,0.447219f),
00057 SimdVector3(0.894426f , 0.000000f,0.447216f),
00058 SimdVector3(-0.000000f , 0.000000f,1.000000f),
00059 SimdVector3(0.425323f , -0.309011f,-0.850654f),
00060 SimdVector3(-0.162456f , -0.499995f,-0.850654f),
00061 SimdVector3(0.262869f , -0.809012f,-0.525738f),
00062 SimdVector3(0.425323f , 0.309011f,-0.850654f),
00063 SimdVector3(0.850648f , -0.000000f,-0.525736f),
00064 SimdVector3(-0.525730f , -0.000000f,-0.850652f),
00065 SimdVector3(-0.688190f , -0.499997f,-0.525736f),
00066 SimdVector3(-0.162456f , 0.499995f,-0.850654f),
00067 SimdVector3(-0.688190f , 0.499997f,-0.525736f),
00068 SimdVector3(0.262869f , 0.809012f,-0.525738f),
00069 SimdVector3(0.951058f , 0.309013f,0.000000f),
00070 SimdVector3(0.951058f , -0.309013f,0.000000f),
00071 SimdVector3(0.587786f , -0.809017f,0.000000f),
00072 SimdVector3(0.000000f , -1.000000f,0.000000f),
00073 SimdVector3(-0.587786f , -0.809017f,0.000000f),
00074 SimdVector3(-0.951058f , -0.309013f,-0.000000f),
00075 SimdVector3(-0.951058f , 0.309013f,-0.000000f),
00076 SimdVector3(-0.587786f , 0.809017f,-0.000000f),
00077 SimdVector3(-0.000000f , 1.000000f,-0.000000f),
00078 SimdVector3(0.587786f , 0.809017f,-0.000000f),
00079 SimdVector3(0.688190f , -0.499997f,0.525736f),
00080 SimdVector3(-0.262869f , -0.809012f,0.525738f),
00081 SimdVector3(-0.850648f , 0.000000f,0.525736f),
00082 SimdVector3(-0.262869f , 0.809012f,0.525738f),
00083 SimdVector3(0.688190f , 0.499997f,0.525736f),
00084 SimdVector3(0.525730f , 0.000000f,0.850652f),
00085 SimdVector3(0.162456f , -0.499995f,0.850654f),
00086 SimdVector3(-0.425323f , -0.309011f,0.850654f),
00087 SimdVector3(-0.425323f , 0.309011f,0.850654f),
00088 SimdVector3(0.162456f , 0.499995f,0.850654f)
00089 };
00090
00091
00092 bool MinkowskiPenetrationDepthSolver::CalcPenDepth(SimplexSolverInterface& simplexSolver,
00093                                                                                                    ConvexShape* convexA,ConvexShape* convexB,
00094                                                                                                    const SimdTransform& transA,const SimdTransform& transB,
00095                                                                                                    SimdVector3& v, SimdPoint3& pa, SimdPoint3& pb,
00096                                                                                                    class IDebugDraw* debugDraw
00097                                                                                                    )
00098 {
00099
00100         //just take fixed number of orientation, and sample the penetration depth in that direction
00101         float minProj = 1e30f;
00102         SimdVector3 minNorm;
00103         SimdVector3 minVertex;
00104         SimdVector3 minA,minB;
00105         SimdVector3 seperatingAxisInA,seperatingAxisInB;
00106         SimdVector3 pInA,qInB,pWorld,qWorld,w;
00107
00108 #define USE_BATCHED_SUPPORT 1
00109 #ifdef USE_BATCHED_SUPPORT
00110         SimdVector3     supportVerticesABatch[NUM_UNITSPHERE_POINTS];
00111         SimdVector3     supportVerticesBBatch[NUM_UNITSPHERE_POINTS];
00112         SimdVector3     seperatingAxisInABatch[NUM_UNITSPHERE_POINTS];
00113         SimdVector3     seperatingAxisInBBatch[NUM_UNITSPHERE_POINTS];
00114         int i;
00115
00116         for (i=0;i<NUM_UNITSPHERE_POINTS;i++)
00117         {
00118                 const SimdVector3& norm = sPenetrationDirections[i];
00119                 seperatingAxisInABatch[i] = (-norm)* transA.getBasis();
00120                 seperatingAxisInBBatch[i] = norm * transB.getBasis();
00121         }
00122
00123         convexA->BatchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInABatch,supportVerticesABatch,NUM_UNITSPHERE_POINTS);
00124         convexB->BatchedUnitVectorGetSupportingVertexWithoutMargin(seperatingAxisInBBatch,supportVerticesBBatch,NUM_UNITSPHERE_POINTS);
00125         for (i=0;i<NUM_UNITSPHERE_POINTS;i++)
00126         {
00127                 const SimdVector3& norm = sPenetrationDirections[i];
00128                 seperatingAxisInA = seperatingAxisInABatch[i];
00129                 seperatingAxisInB = seperatingAxisInBBatch[i];
00130
00131                 pInA = supportVerticesABatch[i];
00132                 qInB = supportVerticesBBatch[i];
00133
00134                 pWorld = transA(pInA);
00135                 qWorld = transB(qInB);
00136                 w       = qWorld - pWorld;
00137                 float delta = norm.dot(w);
00138                 //find smallest delta
00139                 if (delta < minProj)
00140                 {
00141                         minProj = delta;
00142                         minNorm = norm;
00143                         minA = pWorld;
00144                         minB = qWorld;
00145                 }
00146         }
00147 #else
00148         for (int i=0;i<NUM_UNITSPHERE_POINTS;i++)
00149         {
00150                 const SimdVector3& norm = sPenetrationDirections[i];
00151                 seperatingAxisInA = (-norm)* transA.getBasis();
00152                 seperatingAxisInB = norm* transB.getBasis();
00153                 pInA = convexA->LocalGetSupportingVertexWithoutMargin(seperatingAxisInA);
00154                 qInB = convexB->LocalGetSupportingVertexWithoutMargin(seperatingAxisInB);
00155                 pWorld = transA(pInA);
00156                 qWorld = transB(qInB);
00157                 w       = qWorld - pWorld;
00158                 float delta = norm.dot(w);
00159                 //find smallest delta
00160                 if (delta < minProj)
00161                 {
00162                         minProj = delta;
00163                         minNorm = norm;
00164                         minA = pWorld;
00165                         minB = qWorld;
00166                 }
00167         }
00168 #endif //USE_BATCHED_SUPPORT
00169
00170         //add the margins
00171
00172         minA += minNorm*convexA->GetMargin();
00173         minB -= minNorm*convexB->GetMargin();
00174         minProj += (convexA->GetMargin() + convexB->GetMargin());
00175
00176
00177
00178
00179 //#define DEBUG_DRAW 1
00180 #ifdef DEBUG_DRAW
00181         if (debugDraw)
00182         {
00183                 SimdVector3 color(0,1,0);
00184                 debugDraw->DrawLine(minA,minB,color);
00185                 color = SimdVector3 (1,1,1);
00186                 SimdVector3 vec = minB-minA;
00187                 float prj2 = minNorm.dot(vec);
00188                 debugDraw->DrawLine(minA,minA+(minNorm*minProj),color);
00189
00190         }
00191 #endif //DEBUG_DRAW
00192
00193
00194
00195         GjkPairDetector gjkdet(convexA,convexB,&simplexSolver,0);
00196
00197         SimdScalar offsetDist = minProj;
00198         SimdVector3 offset = minNorm * offsetDist;
00199
00200
00201
00202         GjkPairDetector::ClosestPointInput input;
00203
00204         SimdVector3 newOrg = transA.getOrigin() + offset;
00205
00206         SimdTransform displacedTrans = transA;
00207         displacedTrans.setOrigin(newOrg);
00208
00209         input.m_transformA = displacedTrans;
00210         input.m_transformB = transB;
00211         input.m_maximumDistanceSquared = 1e30f;//minProj;
00212
00213         MyResult res;
00214         gjkdet.GetClosestPoints(input,res,debugDraw);
00215
00216         float correctedMinNorm = minProj - res.m_depth;
00217
00218
00219         //the penetration depth is over-estimated, relax it
00220         float penetration_relaxation= 1.f;
00221         minNorm*=penetration_relaxation;
00222
00223         if (res.m_hasResult)
00224         {
00225
00226                 pa = res.m_pointInWorld - minNorm * correctedMinNorm;
00227                 pb = res.m_pointInWorld;
00228
00229 #ifdef DEBUG_DRAW
00230                 if (debugDraw)
00231                 {
00232                         SimdVector3 color(1,0,0);
00233                         debugDraw->DrawLine(pa,pb,color);
00234                 }
00235 #endif//DEBUG_DRAW
00236
00237
00238         }
00239         return res.m_hasResult;
00240 }
00241
00242
00243
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiPenetrationDepthSolver.h File Reference

Bullet » NarrowPhaseCollision

MinkowskiPenetrationDepthSolver.h File Reference

#include "ConvexPenetrationDepthSolver.h"

Include dependency graph for MinkowskiPenetrationDepthSolver.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class MinkowskiPenetrationDepthSolver
MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation. More...

Generated on Wed May 24 13:59:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiPenetrationDepthSolver.h Source File

Bullet » NarrowPhaseCollision

MinkowskiPenetrationDepthSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
00017 #define MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
00018
00019 #include "ConvexPenetrationDepthSolver.h"
00020
00023 class MinkowskiPenetrationDepthSolver : public ConvexPenetrationDepthSolver
00024 {
00025 public:
00026
00027         virtual bool CalcPenDepth( SimplexSolverInterface& simplexSolver,
00028         ConvexShape* convexA,ConvexShape* convexB,
00029                                 const SimdTransform& transA,const SimdTransform& transB,
00030                         SimdVector3& v, SimdPoint3& pa, SimdPoint3& pb,
00031                         class IDebugDraw* debugDraw
00032                         );
00033
00034 };
00035
00036 #endif //MINKOWSKI_PENETRATION_DEPTH_SOLVER_H
00037
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiSumShape.cpp File Reference

Bullet » CollisionShapes

MinkowskiSumShape.cpp File Reference

#include "MinkowskiSumShape.h"

Include dependency graph for MinkowskiSumShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiSumShape.cpp Source File

Bullet » CollisionShapes

MinkowskiSumShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "MinkowskiSumShape.h"
00017
00018
00019 MinkowskiSumShape::MinkowskiSumShape(ConvexShape* shapeA,ConvexShape* shapeB)
00020 :m_shapeA(shapeA),
00021 m_shapeB(shapeB)
00022 {
00023         m_transA.setIdentity();
00024         m_transB.setIdentity();
00025 }
00026
00027 SimdVector3 MinkowskiSumShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00028 {
00029         SimdVector3 supVertexA = m_transA(m_shapeA->LocalGetSupportingVertexWithoutMargin(vec*m_transA.getBasis()));
00030         SimdVector3 supVertexB = m_transB(m_shapeB->LocalGetSupportingVertexWithoutMargin(vec*m_transB.getBasis()));
00031         return supVertexA + supVertexB;
00032 }
00033
00034 void    MinkowskiSumShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00035 {
00036         //todo: could make recursive use of batching. probably this shape is not used frequently.
00037         for (int i=0;i<numVectors;i++)
00038         {
00039                 supportVerticesOut[i] = LocalGetSupportingVertexWithoutMargin(vectors[i]);
00040         }
00041
00042 }
00043
00044
00045
00046 float   MinkowskiSumShape::GetMargin() const
00047 {
00048         return m_shapeA->GetMargin() + m_shapeB->GetMargin();
00049 }
00050
00051
00052 void    MinkowskiSumShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00053 {
00054         assert(0);
00055         inertia.setValue(0,0,0);
00056 }
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiSumShape.h File Reference

Bullet » CollisionShapes

MinkowskiSumShape.h File Reference

#include "ConvexShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for MinkowskiSumShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class MinkowskiSumShape
MinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes. More...

Generated on Wed May 24 13:59:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiSumShape.h Source File

Bullet » CollisionShapes

MinkowskiSumShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef MINKOWSKI_SUM_SHAPE_H
00017 #define MINKOWSKI_SUM_SHAPE_H
00018
00019 #include "ConvexShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021
00023 class MinkowskiSumShape : public ConvexShape
00024 {
00025
00026         SimdTransform   m_transA;
00027         SimdTransform   m_transB;
00028         ConvexShape*    m_shapeA;
00029         ConvexShape*    m_shapeB;
00030
00031 public:
00032
00033         MinkowskiSumShape(ConvexShape* shapeA,ConvexShape* shapeB);
00034
00035         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00036
00037         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00038
00039
00040         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00041
00042         void    SetTransformA(const SimdTransform&      transA) { m_transA = transA;}
00043         void    SetTransformB(const SimdTransform&      transB) { m_transB = transB;}
00044
00045         const SimdTransform& GetTransformA()const  { return m_transA;}
00046         const SimdTransform& GetTransformB()const  { return m_transB;}
00047
00048
00049         virtual int     GetShapeType() const { return MINKOWSKI_SUM_SHAPE_PROXYTYPE; }
00050
00051         virtual float   GetMargin() const;
00052
00053         const ConvexShape*      GetShapeA() const { return m_shapeA;}
00054         const ConvexShape*      GetShapeB() const { return m_shapeB;}
00055
00056         virtual char*   GetName()const
00057         {
00058                 return "MinkowskiSum";
00059         }
00060 };
00061
00062 #endif //MINKOWSKI_SUM_SHAPE_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MultiSphereShape.cpp File Reference

Bullet » CollisionShapes

MultiSphereShape.cpp File Reference

#include "MultiSphereShape.h"
#include "CollisionShapes/CollisionMargin.h"
#include "SimdQuaternion.h"

Include dependency graph for MultiSphereShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MultiSphereShape.cpp Source File

Bullet » CollisionShapes

MultiSphereShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "MultiSphereShape.h"
00017 #include "CollisionShapes/CollisionMargin.h"
00018 #include "SimdQuaternion.h"
00019
00020 MultiSphereShape::MultiSphereShape (const SimdVector3& inertiaHalfExtents,const SimdVector3* positions,const SimdScalar* radi,int numSpheres)
00021 :m_inertiaHalfExtents(inertiaHalfExtents)
00022 {
00023         m_minRadius = 1e30f;
00024
00025         m_numSpheres = numSpheres;
00026         for (int i=0;i<m_numSpheres;i++)
00027         {
00028                 m_localPositions[i] = positions[i];
00029                 m_radi[i] = radi[i];
00030                 if (radi[i] < m_minRadius)
00031                         m_minRadius = radi[i];
00032         }
00033         SetMargin(m_minRadius);
00034
00035 }
00036
00037
00038
00039
00040  SimdVector3    MultiSphereShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec0)const
00041 {
00042         int i;
00043         SimdVector3 supVec(0,0,0);
00044
00045         SimdScalar maxDot(-1e30f);
00046
00047
00048         SimdVector3 vec = vec0;
00049         SimdScalar lenSqr = vec.length2();
00050         if (lenSqr < 0.0001f)
00051         {
00052                 vec.setValue(1,0,0);
00053         } else
00054         {
00055                 float rlen = 1.f / SimdSqrt(lenSqr );
00056                 vec *= rlen;
00057         }
00058
00059         SimdVector3 vtx;
00060         SimdScalar newDot;
00061
00062         const SimdVector3* pos = &m_localPositions[0];
00063         const SimdScalar* rad = &m_radi[0];
00064
00065         for (i=0;i<m_numSpheres;i++)
00066         {
00067                 vtx = (*pos) +vec*((*rad)-m_minRadius);
00068                 pos++;
00069                 rad++;
00070                 newDot = vec.dot(vtx);
00071                 if (newDot > maxDot)
00072                 {
00073                         maxDot = newDot;
00074                         supVec = vtx;
00075                 }
00076         }
00077
00078         return supVec;
00079
00080 }
00081
00082  void   MultiSphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00083 {
00084
00085         for (int j=0;j<numVectors;j++)
00086         {
00087                 SimdScalar maxDot(-1e30f);
00088
00089                 const SimdVector3& vec = vectors[j];
00090
00091                 SimdVector3 vtx;
00092                 SimdScalar newDot;
00093
00094                 const SimdVector3* pos = &m_localPositions[0];
00095                 const SimdScalar* rad = &m_radi[0];
00096
00097                 for (int i=0;i<m_numSpheres;i++)
00098                 {
00099                         vtx = (*pos) +vec*((*rad)-m_minRadius);
00100                         pos++;
00101                         rad++;
00102                         newDot = vec.dot(vtx);
00103                         if (newDot > maxDot)
00104                         {
00105                                 maxDot = newDot;
00106                                 supportVerticesOut[j] = vtx;
00107                         }
00108                 }
00109         }
00110 }
00111
00112
00113
00114
00115
00116
00117
00118
00119 void    MultiSphereShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00120 {
00121         //as an approximation, take the inertia of the box that bounds the spheres
00122
00123         SimdTransform ident;
00124         ident.setIdentity();
00125 //      SimdVector3 aabbMin,aabbMax;
00126
00127 //      GetAabb(ident,aabbMin,aabbMax);
00128
00129         SimdVector3 halfExtents = m_inertiaHalfExtents;//(aabbMax - aabbMin)* 0.5f;
00130
00131         float margin = CONVEX_DISTANCE_MARGIN;
00132
00133         SimdScalar lx=2.f*(halfExtents[0]+margin);
00134         SimdScalar ly=2.f*(halfExtents[1]+margin);
00135         SimdScalar lz=2.f*(halfExtents[2]+margin);
00136         const SimdScalar x2 = lx*lx;
00137         const SimdScalar y2 = ly*ly;
00138         const SimdScalar z2 = lz*lz;
00139         const SimdScalar scaledmass = mass * 0.08333333f;
00140
00141         inertia[0] = scaledmass * (y2+z2);
00142         inertia[1] = scaledmass * (x2+z2);
00143         inertia[2] = scaledmass * (x2+y2);
00144
00145 }
00146
00147
00148
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MultiSphereShape.h File Reference

Bullet » CollisionShapes

MultiSphereShape.h File Reference

#include "ConvexShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for MultiSphereShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | MultiSphereShape
MultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex). More...

Defines

#define | MAX_NUM_SPHERES 5

Define Documentation

#define MAX_NUM_SPHERES 5

Definition at line 22 of file MultiSphereShape.h.

Generated on Wed May 24 13:59:23 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MultiSphereShape.h Source File

Bullet » CollisionShapes

MultiSphereShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef MULTI_SPHERE_MINKOWSKI_H
00017 #define MULTI_SPHERE_MINKOWSKI_H
00018
00019 #include "ConvexShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021
00022 #define MAX_NUM_SPHERES 5
00023
00025 class MultiSphereShape : public ConvexShape
00026
00027 {
00028
00029         SimdVector3 m_localPositions[MAX_NUM_SPHERES];
00030         SimdScalar  m_radi[MAX_NUM_SPHERES];
00031         SimdVector3     m_inertiaHalfExtents;
00032
00033         int m_numSpheres;
00034         float m_minRadius;
00035
00036
00037
00038
00039
00040 public:
00041         MultiSphereShape (const SimdVector3& inertiaHalfExtents,const SimdVector3* positions,const SimdScalar* radi,int numSpheres);
00042
00044         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00045
00047         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00048
00049         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00050
00051
00052         virtual int     GetShapeType() const { return MULTI_SPHERE_SHAPE_PROXYTYPE; }
00053
00054         virtual char*   GetName()const
00055         {
00056                 return "MultiSphere";
00057         }
00058
00059 };
00060
00061
00062 #endif //MULTI_SPHERE_MINKOWSKI_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OdeConstraintSolver.cpp File Reference

BulletDynamics » ConstraintSolver

OdeConstraintSolver.cpp File Reference

#include "OdeConstraintSolver.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "Dynamics/RigidBody.h"
#include "ContactConstraint.h"
#include "Solve2LinearConstraint.h"
#include "ContactSolverInfo.h"
#include "Dynamics/BU_Joint.h"
#include "Dynamics/ContactJoint.h"
#include "IDebugDraw.h"
#include "SorLcp.h"
#include <math.h>
#include <float.h>
#include <string.h>
#include <stdio.h>
#include <alloca.h>

Include dependency graph for OdeConstraintSolver.cpp:

Go to the source code of this file.

Defines

#define | USE_SOR_SOLVER
#define | _R(i, j) R[(i)*4+(j)]
#define | MAX_JOINTS_1 8192

Typedefs

typedef SimdScalar | dQuaternion [4]

Functions

void | dRfromQ1 (dMatrix3 R, const dQuaternion q)

Variables

static ContactJoint | gJointArray [MAX_JOINTS_1]

Define Documentation

#define _R | ( | i,
 |  | j | ) | R[(i)*4+(j)]

Definition at line 105 of file OdeConstraintSolver.cpp.

Referenced by dRfromQ1().

#define MAX_JOINTS_1 8192

Definition at line 189 of file OdeConstraintSolver.cpp.

Referenced by OdeConstraintSolver::ConvertConstraint().

#define USE_SOR_SOLVER

Definition at line 30 of file OdeConstraintSolver.cpp.

Typedef Documentation

typedef SimdScalar dQuaternion[4]

Definition at line 104 of file OdeConstraintSolver.cpp.

Function Documentation

void dRfromQ1 | ( | dMatrix3 | R,
 |  | const dQuaternion | q
 | ) |

Definition at line 107 of file OdeConstraintSolver.cpp.

References _R.

Referenced by OdeConstraintSolver::ConvertBody().

Variable Documentation

ContactJoint gJointArray[MAX_JOINTS_1] [static]

Definition at line 191 of file OdeConstraintSolver.cpp.

Generated on Wed May 24 13:59:23 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OdeConstraintSolver.cpp Source File

BulletDynamics » ConstraintSolver

OdeConstraintSolver.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #include "OdeConstraintSolver.h"
00019
00020 #include "NarrowPhaseCollision/PersistentManifold.h"
00021 #include "Dynamics/RigidBody.h"
00022 #include "ContactConstraint.h"
00023 #include "Solve2LinearConstraint.h"
00024 #include "ContactSolverInfo.h"
00025 #include "Dynamics/BU_Joint.h"
00026 #include "Dynamics/ContactJoint.h"
00027
00028 #include "IDebugDraw.h"
00029
00030 #define USE_SOR_SOLVER
00031
00032 #include "SorLcp.h"
00033
00034 #include <math.h>
00035 #include <float.h>//FLT_MAX
00036 #ifdef WIN32
00037 #include <memory.h>
00038 #endif
00039 #include <string.h>
00040 #include <stdio.h>
00041
00042 #if defined (WIN32)
00043 #include <malloc.h>
00044 #else
00045 #if defined (__FreeBSD__)
00046 #include <stdlib.h>
00047 #else
00048 #include <alloca.h>
00049 #endif
00050 #endif
00051
00052 class BU_Joint;
00053
00054 //see below
00055
00056 OdeConstraintSolver::OdeConstraintSolver():
00057 m_cfm(0.f),//1e-5f),
00058 m_erp(0.4f)
00059 {
00060 }
00061
00062
00063
00064
00065
00066
00067
00068 //iterative lcp and penalty method
00069 float OdeConstraintSolver::SolveGroup(PersistentManifold** manifoldPtr, int numManifolds,const ContactSolverInfo& infoGlobal,IDebugDraw* debugDrawer)
00070 {
00071         m_CurBody = 0;
00072         m_CurJoint = 0;
00073
00074
00075         RigidBody* bodies [MAX_RIGIDBODIES];
00076
00077         int numBodies = 0;
00078         BU_Joint* joints [MAX_RIGIDBODIES*4];
00079         int numJoints = 0;
00080
00081         for (int j=0;j<numManifolds;j++)
00082         {
00083
00084                 int body0=-1,body1=-1;
00085
00086                 PersistentManifold* manifold = manifoldPtr[j];
00087                 if (manifold->GetNumContacts() > 0)
00088                 {
00089                         body0 = ConvertBody((RigidBody*)manifold->GetBody0(),bodies,numBodies);
00090                         body1 = ConvertBody((RigidBody*)manifold->GetBody1(),bodies,numBodies);
00091                         ConvertConstraint(manifold,joints,numJoints,bodies,body0,body1,debugDrawer);
00092                 }
00093         }
00094
00095         SolveInternal1(m_cfm,m_erp,bodies,numBodies,joints,numJoints,infoGlobal);
00096
00097         return 0.f;
00098
00099 }
00100
00102
00103
00104 typedef SimdScalar dQuaternion[4];
00105 #define _R(i,j) R[(i)*4+(j)]
00106
00107 void dRfromQ1 (dMatrix3 R, const dQuaternion q)
00108 {
00109   // q = (s,vx,vy,vz)
00110   SimdScalar qq1 = 2.f*q[1]*q[1];
00111   SimdScalar qq2 = 2.f*q[2]*q[2];
00112   SimdScalar qq3 = 2.f*q[3]*q[3];
00113   _R(0,0) = 1.f - qq2 - qq3;
00114   _R(0,1) = 2*(q[1]*q[2] - q[0]*q[3]);
00115   _R(0,2) = 2*(q[1]*q[3] + q[0]*q[2]);
00116   _R(0,3) = 0.f;
00117
00118   _R(1,0) = 2*(q[1]*q[2] + q[0]*q[3]);
00119   _R(1,1) = 1.f - qq1 - qq3;
00120   _R(1,2) = 2*(q[2]*q[3] - q[0]*q[1]);
00121   _R(1,3) = 0.f;
00122
00123   _R(2,0) = 2*(q[1]*q[3] - q[0]*q[2]);
00124   _R(2,1) = 2*(q[2]*q[3] + q[0]*q[1]);
00125   _R(2,2) = 1.f - qq1 - qq2;
00126   _R(2,3) = 0.f;
00127
00128 }
00129
00130
00131
00132 int OdeConstraintSolver::ConvertBody(RigidBody* body,RigidBody** bodies,int& numBodies)
00133 {
00134         if (!body || (body->getInvMass() == 0.f) )
00135         {
00136                 return -1;
00137         }
00138         //first try to find
00139         int i,j;
00140         for (i=0;i<numBodies;i++)
00141         {
00142                 if (bodies[i] == body)
00143                         return i;
00144         }
00145         //if not found, create a new body
00146         bodies[numBodies++] = body;
00147         //convert data
00148
00149
00150         body->m_facc.setValue(0,0,0,0);
00151         body->m_tacc.setValue(0,0,0,0);
00152
00153         //are the indices the same ?
00154         for (i=0;i<4;i++)
00155         {
00156                 for ( j=0;j<3;j++)
00157                 {
00158                         body->m_invI[i+4*j] = 0.f;
00159                         body->m_I[i+4*j] = 0.f;
00160                 }
00161         }
00162         body->m_invI[0+4*0] =   body->getInvInertiaDiagLocal()[0];
00163         body->m_invI[1+4*1] =   body->getInvInertiaDiagLocal()[1];
00164         body->m_invI[2+4*2] =   body->getInvInertiaDiagLocal()[2];
00165
00166         body->m_I[0+0*4] = 1.f/body->getInvInertiaDiagLocal()[0];
00167         body->m_I[1+1*4] = 1.f/body->getInvInertiaDiagLocal()[1];
00168         body->m_I[2+2*4] = 1.f/body->getInvInertiaDiagLocal()[2];
00169
00170
00171
00172
00173         dQuaternion q;
00174
00175         q[1] = body->getOrientation()[0];
00176         q[2] = body->getOrientation()[1];
00177         q[3] = body->getOrientation()[2];
00178         q[0] = body->getOrientation()[3];
00179
00180         dRfromQ1(body->m_R,q);
00181
00182         return numBodies-1;
00183 }
00184
00185
00186
00187
00188
00189 #define MAX_JOINTS_1 8192
00190
00191 static ContactJoint gJointArray[MAX_JOINTS_1];
00192
00193
00194 void OdeConstraintSolver::ConvertConstraint(PersistentManifold* manifold,BU_Joint** joints,int& numJoints,
00195                                            RigidBody** bodies,int _bodyId0,int _bodyId1,IDebugDraw* debugDrawer)
00196 {
00197
00198
00199         manifold->RefreshContactPoints(((RigidBody*)manifold->GetBody0())->getCenterOfMassTransform(),
00200                 ((RigidBody*)manifold->GetBody1())->getCenterOfMassTransform());
00201
00202         int bodyId0 = _bodyId0,bodyId1 = _bodyId1;
00203
00204         int i,numContacts = manifold->GetNumContacts();
00205
00206         bool swapBodies = (bodyId0 < 0);
00207
00208
00209         RigidBody* body0,*body1;
00210
00211         if (swapBodies)
00212         {
00213                 bodyId0 = _bodyId1;
00214                 bodyId1 = _bodyId0;
00215
00216                 body0 = (RigidBody*)manifold->GetBody1();
00217                 body1 = (RigidBody*)manifold->GetBody0();
00218
00219         } else
00220         {
00221                 body0 = (RigidBody*)manifold->GetBody0();
00222                 body1 = (RigidBody*)manifold->GetBody1();
00223         }
00224
00225         assert(bodyId0 >= 0);
00226
00227         SimdVector3 color(0,1,0);
00228         for (i=0;i<numContacts;i++)
00229         {
00230
00231                 if (debugDrawer)
00232                 {
00233                         const ManifoldPoint& cp = manifold->GetContactPoint(i);
00234
00235                         debugDrawer->DrawContactPoint(
00236                                 cp.m_positionWorldOnB,
00237                                 cp.m_normalWorldOnB,
00238                                 cp.GetDistance(),
00239                                 cp.GetLifeTime(),
00240                                 color);
00241
00242                 }
00243                 assert (m_CurJoint < MAX_JOINTS_1);
00244
00245 //              if (manifold->GetContactPoint(i).GetDistance() < 0.0f)
00246                 {
00247                         ContactJoint* cont = new (&gJointArray[m_CurJoint++]) ContactJoint( manifold ,i, swapBodies,body0,body1);
00248
00249                         cont->node[0].joint = cont;
00250                         cont->node[0].body = bodyId0 >= 0 ? bodies[bodyId0] : 0;
00251
00252                         cont->node[1].joint = cont;
00253                         cont->node[1].body = bodyId1 >= 0 ? bodies[bodyId1] : 0;
00254
00255                         joints[numJoints++] = cont;
00256                         for (int i=0;i<6;i++)
00257                                 cont->lambda[i] = 0.f;
00258
00259                         cont->flags = 0;
00260                 }
00261         }
00262
00263         //create a new contact constraint
00264 };
00265
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OdeConstraintSolver.h File Reference

BulletDynamics » ConstraintSolver

OdeConstraintSolver.h File Reference

#include "ConstraintSolver.h"

Include dependency graph for OdeConstraintSolver.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class OdeConstraintSolver
OdeConstraintSolver is one of the available solvers for Bullet dynamics framework It uses the the unmodified version of quickstep solver from the open dynamics project. More...

Generated on Wed May 24 13:59:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OdeConstraintSolver.h Source File

BulletDynamics » ConstraintSolver

OdeConstraintSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef ODE_CONSTRAINT_SOLVER_H
00017 #define ODE_CONSTRAINT_SOLVER_H
00018
00019 #include "ConstraintSolver.h"
00020
00021 class RigidBody;
00022 class BU_Joint;
00023
00026 class OdeConstraintSolver : public ConstraintSolver
00027 {
00028 private:
00029
00030         int m_CurBody;
00031         int m_CurJoint;
00032
00033         float   m_cfm;
00034         float   m_erp;
00035
00036
00037         int ConvertBody(RigidBody* body,RigidBody** bodies,int& numBodies);
00038         void ConvertConstraint(PersistentManifold* manifold,BU_Joint** joints,int& numJoints,
00039                                            RigidBody** bodies,int _bodyId0,int _bodyId1,IDebugDraw* debugDrawer);
00040
00041 public:
00042
00043         OdeConstraintSolver();
00044
00045         virtual ~OdeConstraintSolver() {}
00046
00047         virtual float SolveGroup(PersistentManifold** manifold,int numManifolds,const ContactSolverInfo& info,IDebugDraw* debugDrawer = 0);
00048
00051         void    setConstraintForceMixing(float cfm) {
00052                 m_cfm  = cfm;
00053         }
00054
00057         void    setErrorReductionParamter(float erp)
00058         {
00059                 m_erp = erp;
00060         }
00061 };
00062
00063
00064
00065
00066 #endif //ODE_CONSTRAINT_SOLVER_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OptimizedBvh.cpp File Reference

Bullet » CollisionShapes

OptimizedBvh.cpp File Reference

#include "OptimizedBvh.h"
#include "StridingMeshInterface.h"
#include "AabbUtil2.h"

Include dependency graph for OptimizedBvh.cpp:

Go to the source code of this file.

Variables

int maxIterations = 0

Variable Documentation

int maxIterations = 0

Definition at line 231 of file OptimizedBvh.cpp.

Generated on Wed May 24 13:59:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OptimizedBvh.cpp Source File

Bullet » CollisionShapes

OptimizedBvh.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "OptimizedBvh.h"
00017 #include "StridingMeshInterface.h"
00018 #include "AabbUtil2.h"
00019
00020
00021
00022 void OptimizedBvh::Build(StridingMeshInterface* triangles)
00023 {
00024         //int countTriangles = 0;
00025
00026
00027
00028         // NodeArray    triangleNodes;
00029
00030         struct  NodeTriangleCallback : public InternalTriangleIndexCallback
00031         {
00032                 NodeArray&      m_triangleNodes;
00033
00034                 NodeTriangleCallback(NodeArray& triangleNodes)
00035                         :m_triangleNodes(triangleNodes)
00036                 {
00037
00038                 }
00039
00040                 virtual void InternalProcessTriangleIndex(SimdVector3* triangle,int partId,int  triangleIndex)
00041                 {
00042
00043                         OptimizedBvhNode node;
00044                         node.m_aabbMin = SimdVector3(1e30f,1e30f,1e30f);
00045                         node.m_aabbMax = SimdVector3(-1e30f,-1e30f,-1e30f);
00046                         node.m_aabbMin.setMin(triangle[0]);
00047                         node.m_aabbMax.setMax(triangle[0]);
00048                         node.m_aabbMin.setMin(triangle[1]);
00049                         node.m_aabbMax.setMax(triangle[1]);
00050                         node.m_aabbMin.setMin(triangle[2]);
00051                         node.m_aabbMax.setMax(triangle[2]);
00052
00053                         node.m_escapeIndex = -1;
00054                         node.m_leftChild = 0;
00055                         node.m_rightChild = 0;
00056
00057
00058                         //for child nodes
00059                         node.m_subPart = partId;
00060                         node.m_triangleIndex = triangleIndex;
00061
00062
00063                         m_triangleNodes.push_back(node);
00064                 }
00065         };
00066
00067
00068
00069         NodeTriangleCallback    callback(m_leafNodes);
00070
00071         SimdVector3 aabbMin(-1e30f,-1e30f,-1e30f);
00072         SimdVector3 aabbMax(1e30f,1e30f,1e30f);
00073
00074         triangles->InternalProcessAllTriangles(&callback,aabbMin,aabbMax);
00075
00076         //now we have an array of leafnodes in m_leafNodes
00077
00078         m_contiguousNodes = new OptimizedBvhNode[2*m_leafNodes.size()];
00079         m_curNodeIndex = 0;
00080
00081         m_rootNode1 = BuildTree(m_leafNodes,0,m_leafNodes.size());
00082
00083
00085 //      OptimizedBvhNode* leafNodes = new OptimizedBvhNode;
00086 }
00087
00088
00089 OptimizedBvhNode*       OptimizedBvh::BuildTree (NodeArray&     leafNodes,int startIndex,int endIndex)
00090 {
00091         OptimizedBvhNode* internalNode;
00092
00093         int splitAxis, splitIndex, i;
00094         int numIndices =endIndex-startIndex;
00095         int curIndex = m_curNodeIndex;
00096
00097         assert(numIndices>0);
00098
00099         if (numIndices==1)
00100         {
00101                 return new (&m_contiguousNodes[m_curNodeIndex++]) OptimizedBvhNode(leafNodes[startIndex]);
00102         }
00103         //calculate Best Splitting Axis and where to split it. Sort the incoming 'leafNodes' array within range 'startIndex/endIndex'.
00104
00105         splitAxis = CalcSplittingAxis(leafNodes,startIndex,endIndex);
00106
00107         splitIndex = SortAndCalcSplittingIndex(leafNodes,startIndex,endIndex,splitAxis);
00108
00109         internalNode = &m_contiguousNodes[m_curNodeIndex++];
00110
00111         internalNode->m_aabbMax.setValue(-1e30f,-1e30f,-1e30f);
00112         internalNode->m_aabbMin.setValue(1e30f,1e30f,1e30f);
00113
00114         for (i=startIndex;i<endIndex;i++)
00115         {
00116                 internalNode->m_aabbMax.setMax(leafNodes[i].m_aabbMax);
00117                 internalNode->m_aabbMin.setMin(leafNodes[i].m_aabbMin);
00118         }
00119
00120
00121
00122         //internalNode->m_escapeIndex;
00123         internalNode->m_leftChild = BuildTree(leafNodes,startIndex,splitIndex);
00124         internalNode->m_rightChild = BuildTree(leafNodes,splitIndex,endIndex);
00125
00126         internalNode->m_escapeIndex  = m_curNodeIndex - curIndex;
00127         return internalNode;
00128 }
00129
00130 int     OptimizedBvh::SortAndCalcSplittingIndex(NodeArray&      leafNodes,int startIndex,int endIndex,int splitAxis)
00131 {
00132         int i;
00133         int splitIndex =startIndex;
00134         int numIndices = endIndex - startIndex;
00135         float splitValue;
00136
00137         SimdVector3 means(0.f,0.f,0.f);
00138         for (i=startIndex;i<endIndex;i++)
00139         {
00140                 SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
00141                 means+=center;
00142         }
00143         means *= (1.f/(float)numIndices);
00144
00145         splitValue = means[splitAxis];
00146
00147         //sort leafNodes so all values larger then splitValue comes first, and smaller values start from 'splitIndex'.
00148         for (i=startIndex;i<endIndex;i++)
00149         {
00150                 SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
00151                 if (center[splitAxis] > splitValue)
00152                 {
00153                         //swap
00154                         OptimizedBvhNode tmp = leafNodes[i];
00155                         leafNodes[i] = leafNodes[splitIndex];
00156                         leafNodes[splitIndex] = tmp;
00157                         splitIndex++;
00158                 }
00159         }
00160         if ((splitIndex==startIndex) || (splitIndex == (endIndex-1)))
00161         {
00162                 splitIndex = startIndex+ (numIndices>>1);
00163         }
00164         return splitIndex;
00165 }
00166
00167
00168 int     OptimizedBvh::CalcSplittingAxis(NodeArray&      leafNodes,int startIndex,int endIndex)
00169 {
00170         int i;
00171
00172         SimdVector3 means(0.f,0.f,0.f);
00173         SimdVector3 variance(0.f,0.f,0.f);
00174         int numIndices = endIndex-startIndex;
00175
00176         for (i=startIndex;i<endIndex;i++)
00177         {
00178                 SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
00179                 means+=center;
00180         }
00181         means *= (1.f/(float)numIndices);
00182
00183         for (i=startIndex;i<endIndex;i++)
00184         {
00185                 SimdVector3 center = 0.5f*(leafNodes[i].m_aabbMax+leafNodes[i].m_aabbMin);
00186                 SimdVector3 diff2 = center-means;
00187                 diff2 = diff2 * diff2;
00188                 variance += diff2;
00189         }
00190         variance *= (1.f/       ((float)numIndices-1)   );
00191
00192         return variance.maxAxis();
00193 }
00194
00195
00196
00197 void    OptimizedBvh::ReportAabbOverlappingNodex(NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00198 {
00199         if (aabbMin.length() > 1000.f)
00200         {
00201                 for (size_t i=0;i<m_leafNodes.size();i++)
00202                 {
00203                         const OptimizedBvhNode& node = m_leafNodes[i];
00204                         nodeCallback->ProcessNode(&node);
00205                 }
00206         } else
00207         {
00208                 //WalkTree(m_rootNode1,nodeCallback,aabbMin,aabbMax);
00209                 WalkStacklessTree(m_rootNode1,nodeCallback,aabbMin,aabbMax);
00210         }
00211 }
00212
00213 void    OptimizedBvh::WalkTree(OptimizedBvhNode* rootNode,NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00214 {
00215         bool isLeafNode, aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
00216         if (aabbOverlap)
00217         {
00218                 isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
00219                 if (isLeafNode)
00220                 {
00221                         nodeCallback->ProcessNode(rootNode);
00222                 } else
00223                 {
00224                         WalkTree(rootNode->m_leftChild,nodeCallback,aabbMin,aabbMax);
00225                         WalkTree(rootNode->m_rightChild,nodeCallback,aabbMin,aabbMax);
00226                 }
00227         }
00228
00229 }
00230
00231 int maxIterations = 0;
00232
00233 void    OptimizedBvh::WalkStacklessTree(OptimizedBvhNode* rootNode,NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00234 {
00235         int escapeIndex, curIndex = 0;
00236         int walkIterations = 0;
00237         bool aabbOverlap, isLeafNode;
00238
00239         while (curIndex < m_curNodeIndex)
00240         {
00241                 //catch bugs in tree data
00242                 assert (walkIterations < m_curNodeIndex);
00243
00244                 walkIterations++;
00245                 aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMin,rootNode->m_aabbMax);
00246                 isLeafNode = (!rootNode->m_leftChild && !rootNode->m_rightChild);
00247
00248                 if (isLeafNode && aabbOverlap)
00249                 {
00250                         nodeCallback->ProcessNode(rootNode);
00251                 }
00252
00253                 if (aabbOverlap || isLeafNode)
00254                 {
00255                         rootNode++;
00256                         curIndex++;
00257                 } else
00258                 {
00259                         escapeIndex = rootNode->m_escapeIndex;
00260                         rootNode += escapeIndex;
00261                         curIndex += escapeIndex;
00262                 }
00263
00264         }
00265
00266         if (maxIterations < walkIterations)
00267                 maxIterations = walkIterations;
00268
00269 }
00270
00271
00272 void    OptimizedBvh::ReportSphereOverlappingNodex(NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00273 {
00274
00275 }
00276
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OptimizedBvh.h File Reference

Bullet » CollisionShapes

OptimizedBvh.h File Reference

#include "SimdVector3.h"
#include <vector>

Include dependency graph for OptimizedBvh.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | OptimizedBvhNode
OptimizedBvhNode contains both internal and leaf node information. More...
class | NodeOverlapCallback
class | OptimizedBvh
OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU,GPU in future). More...

Typedefs

typedef std::vector< OptimizedBvhNode > | NodeArray

Typedef Documentation

typedef std::vector<OptimizedBvhNode> NodeArray

Definition at line 55 of file OptimizedBvh.h.

Generated on Wed May 24 13:59:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OptimizedBvh.h Source File

Bullet » CollisionShapes

OptimizedBvh.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef OPTIMIZED_BVH_H
00017 #define OPTIMIZED_BVH_H
00018 #include "SimdVector3.h"
00019 #include <vector>
00020
00021 class StridingMeshInterface;
00022
00029 struct OptimizedBvhNode
00030 {
00031
00032         SimdVector3     m_aabbMin;
00033         SimdVector3     m_aabbMax;
00034
00035 //these 2 pointers are obsolete, the stackless traversal just uses the escape index
00036         OptimizedBvhNode*       m_leftChild;
00037         OptimizedBvhNode*       m_rightChild;
00038
00039         int     m_escapeIndex;
00040
00041         //for child nodes
00042         int     m_subPart;
00043         int     m_triangleIndex;
00044
00045 };
00046
00047 class NodeOverlapCallback
00048 {
00049 public:
00050         virtual ~NodeOverlapCallback() {};
00051
00052         virtual void ProcessNode(const OptimizedBvhNode* node) = 0;
00053 };
00054
00055 typedef std::vector<OptimizedBvhNode>   NodeArray;
00056
00057
00059 class OptimizedBvh
00060 {
00061         OptimizedBvhNode*       m_rootNode1;
00062
00063         OptimizedBvhNode*       m_contiguousNodes;
00064         int                                     m_curNodeIndex;
00065
00066         int                                     m_numNodes;
00067
00068         NodeArray                       m_leafNodes;
00069
00070 public:
00071         OptimizedBvh() :m_rootNode1(0), m_numNodes(0) { }
00072         virtual ~OptimizedBvh() {};
00073
00074         void    Build(StridingMeshInterface* triangles);
00075
00076         OptimizedBvhNode*       BuildTree       (NodeArray&     leafNodes,int startIndex,int endIndex);
00077
00078         int     CalcSplittingAxis(NodeArray&    leafNodes,int startIndex,int endIndex);
00079
00080         int     SortAndCalcSplittingIndex(NodeArray&    leafNodes,int startIndex,int endIndex,int splitAxis);
00081
00082         void    WalkTree(OptimizedBvhNode* rootNode,NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00083
00084         void    WalkStacklessTree(OptimizedBvhNode* rootNode,NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00085
00086
00087         //OptimizedBvhNode*     GetRootNode() { return m_rootNode1;}
00088
00089         int                                     GetNumNodes() { return m_numNodes;}
00090
00091         void    ReportAabbOverlappingNodex(NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00092
00093         void    ReportSphereOverlappingNodex(NodeOverlapCallback* nodeCallback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00094
00095
00096 };
00097
00098
00099 #endif //OPTIMIZED_BVH_H
00100
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PersistentManifold.cpp File Reference

Bullet » NarrowPhaseCollision

PersistentManifold.cpp File Reference

#include "PersistentManifold.h"
#include "SimdTransform.h"
#include <assert.h>

Include dependency graph for PersistentManifold.cpp:

Go to the source code of this file.

Variables

float | gContactBreakingTreshold = 0.02f
contact breaking and merging treshold
ContactDestroyedCallback | gContactCallback = 0

Variable Documentation

float gContactBreakingTreshold = 0.02f

contact breaking and merging treshold

Definition at line 21 of file PersistentManifold.cpp.

Referenced by PersistentManifold::GetContactBreakingTreshold(), CcdPhysicsEnvironment::setContactBreakingTreshold(), and CcdPhysicsEnvironment::UpdateAabbs().

ContactDestroyedCallback gContactCallback = 0

Definition at line 22 of file PersistentManifold.cpp.

Referenced by PersistentManifold::ClearUserCache(), and SimpleConstraintSolver::SimpleConstraintSolver().

Generated on Wed May 24 13:59:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PersistentManifold.cpp Source File

Bullet » NarrowPhaseCollision

PersistentManifold.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "PersistentManifold.h"
00018 #include "SimdTransform.h"
00019 #include <assert.h>
00020
00021 float                                           gContactBreakingTreshold = 0.02f;
00022 ContactDestroyedCallback        gContactCallback = 0;
00023
00024
00025 PersistentManifold::PersistentManifold()
00026 :m_body0(0),
00027 m_body1(0),
00028 m_cachedPoints (0),
00029 m_index1(0)
00030 {
00031 }
00032
00033
00034 void    PersistentManifold::ClearManifold()
00035 {
00036         int i;
00037         for (i=0;i<m_cachedPoints;i++)
00038         {
00039                 ClearUserCache(m_pointCache[i]);
00040         }
00041         m_cachedPoints = 0;
00042 }
00043
00044 #ifdef DEBUG_PERSISTENCY
00045 #include <stdio.h>
00046 void    PersistentManifold::DebugPersistency()
00047 {
00048         int i;
00049         printf("DebugPersistency : numPoints %d\n",m_cachedPoints);
00050         for (i=0;i<m_cachedPoints;i++)
00051         {
00052                 printf("m_pointCache[%d].m_userPersistentData = %x\n",i,m_pointCache[i].m_userPersistentData);
00053         }
00054 }
00055 #endif //DEBUG_PERSISTENCY
00056
00057 void PersistentManifold::ClearUserCache(ManifoldPoint& pt)
00058 {
00059
00060         void* oldPtr = pt.m_userPersistentData;
00061         if (oldPtr)
00062         {
00063 #ifdef DEBUG_PERSISTENCY
00064                 int i;
00065                 int occurance = 0;
00066                 for (i=0;i<m_cachedPoints;i++)
00067                 {
00068                         if (m_pointCache[i].m_userPersistentData == oldPtr)
00069                         {
00070                                 occurance++;
00071                                 if (occurance>1)
00072                                         printf("error in ClearUserCache\n");
00073                         }
00074                 }
00075                 assert(occurance<=0);
00076 #endif //DEBUG_PERSISTENCY
00077
00078                 if (pt.m_userPersistentData && gContactCallback)
00079                 {
00080                         (*gContactCallback)(pt.m_userPersistentData);
00081                         pt.m_userPersistentData = 0;
00082                 }
00083
00084 #ifdef DEBUG_PERSISTENCY
00085                 DebugPersistency();
00086 #endif
00087         }
00088
00089
00090 }
00091
00092
00093
00094
00095 int PersistentManifold::SortCachedPoints(const ManifoldPoint& pt)
00096 {
00097
00098                 //calculate 4 possible cases areas, and take biggest area
00099
00100                 SimdScalar res0,res1,res2,res3;
00101
00102                 {
00103                         SimdVector3 a0 = pt.m_localPointA-m_pointCache[1].m_localPointA;
00104                         SimdVector3 b0 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
00105                         SimdVector3 cross = a0.cross(b0);
00106                         res0 = cross.length2();
00107                 }
00108                 {
00109                         SimdVector3 a1 = pt.m_localPointA-m_pointCache[0].m_localPointA;
00110                         SimdVector3 b1 = m_pointCache[3].m_localPointA-m_pointCache[2].m_localPointA;
00111                         SimdVector3 cross = a1.cross(b1);
00112                         res1 = cross.length2();
00113                 }
00114                 {
00115                         SimdVector3 a2 = pt.m_localPointA-m_pointCache[0].m_localPointA;
00116                         SimdVector3 b2 = m_pointCache[3].m_localPointA-m_pointCache[1].m_localPointA;
00117                         SimdVector3 cross = a2.cross(b2);
00118                         res2 = cross.length2();
00119                 }
00120                 {
00121                         SimdVector3 a3 = pt.m_localPointA-m_pointCache[0].m_localPointA;
00122                         SimdVector3 b3 = m_pointCache[2].m_localPointA-m_pointCache[1].m_localPointA;
00123                         SimdVector3 cross = a3.cross(b3);
00124                         res3 = cross.length2();
00125                 }
00126
00127                 SimdVector4 maxvec(res0,res1,res2,res3);
00128                 int biggestarea = maxvec.closestAxis4();
00129
00130                 return biggestarea;
00131
00132
00133 }
00134
00135
00136
00137 int PersistentManifold::GetCacheEntry(const ManifoldPoint& newPoint) const
00138 {
00139         SimdScalar shortestDist =  GetContactBreakingTreshold() * GetContactBreakingTreshold();
00140         int size = GetNumContacts();
00141         int nearestPoint = -1;
00142         for( int i = 0; i < size; i++ )
00143         {
00144                 const ManifoldPoint &mp = m_pointCache[i];
00145
00146                 SimdVector3 diffA =  mp.m_localPointA- newPoint.m_localPointA;
00147                 const SimdScalar distToManiPoint = diffA.dot(diffA);
00148                 if( distToManiPoint < shortestDist )
00149                 {
00150                         shortestDist = distToManiPoint;
00151                         nearestPoint = i;
00152                 }
00153         }
00154         return nearestPoint;
00155 }
00156
00157 void PersistentManifold::AddManifoldPoint(const ManifoldPoint& newPoint)
00158 {
00159         assert(ValidContactDistance(newPoint));
00160
00161         int insertIndex = GetNumContacts();
00162         if (insertIndex == MANIFOLD_CACHE_SIZE)
00163         {
00164 #if MANIFOLD_CACHE_SIZE >= 4
00165                 //sort cache so best points come first, based on area
00166                 insertIndex = SortCachedPoints(newPoint);
00167 #else
00168                 insertIndex = 0;
00169 #endif
00170
00171
00172         } else
00173         {
00174                 m_cachedPoints++;
00175
00176
00177         }
00178         ReplaceContactPoint(newPoint,insertIndex);
00179 }
00180
00181 float   PersistentManifold::GetContactBreakingTreshold() const
00182 {
00183         return gContactBreakingTreshold;
00184 }
00185
00186 void PersistentManifold::RefreshContactPoints(const SimdTransform& trA,const SimdTransform& trB)
00187 {
00188         int i;
00189
00191         for (i=GetNumContacts()-1;i>=0;i--)
00192         {
00193                 ManifoldPoint &manifoldPoint = m_pointCache[i];
00194                 manifoldPoint.m_positionWorldOnA = trA( manifoldPoint.m_localPointA );
00195                 manifoldPoint.m_positionWorldOnB = trB( manifoldPoint.m_localPointB );
00196                 manifoldPoint.m_distance1 = (manifoldPoint.m_positionWorldOnA -  manifoldPoint.m_positionWorldOnB).dot(manifoldPoint.m_normalWorldOnB);
00197                 manifoldPoint.m_lifeTime++;
00198         }
00199
00201         SimdScalar distance2d;
00202         SimdVector3 projectedDifference,projectedPoint;
00203         for (i=GetNumContacts()-1;i>=0;i--)
00204         {
00205
00206                 ManifoldPoint &manifoldPoint = m_pointCache[i];
00207                 //contact becomes invalid when signed distance exceeds margin (projected on contactnormal direction)
00208                 if (!ValidContactDistance(manifoldPoint))
00209                 {
00210                         RemoveContactPoint(i);
00211                 } else
00212                 {
00213                         //contact also becomes invalid when relative movement orthogonal to normal exceeds margin
00214                         projectedPoint = manifoldPoint.m_positionWorldOnA - manifoldPoint.m_normalWorldOnB * manifoldPoint.m_distance1;
00215                         projectedDifference = manifoldPoint.m_positionWorldOnB - projectedPoint;
00216                         distance2d = projectedDifference.dot(projectedDifference);
00217                         if (distance2d  > GetContactBreakingTreshold()*GetContactBreakingTreshold() )
00218                         {
00219                                 RemoveContactPoint(i);
00220                         }
00221                 }
00222         }
00223 #ifdef DEBUG_PERSISTENCY
00224         DebugPersistency();
00225 #endif //
00226 }
00227
00228
00229
00230
00231
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PersistentManifold.h File Reference

Bullet » NarrowPhaseCollision

PersistentManifold.h File Reference

#include "SimdVector3.h"
#include "SimdTransform.h"
#include "ManifoldPoint.h"

Include dependency graph for PersistentManifold.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | PersistentManifold
PersistentManifold maintains contact points, and reduces them to 4. More...

Defines

#define | MANIFOLD_CACHE_SIZE 4

Typedefs

typedef bool(* | ContactDestroyedCallback )(void *userPersistentData)

Variables

float | gContactBreakingTreshold
contact breaking and merging treshold
ContactDestroyedCallback gContactCallback

Define Documentation

#define MANIFOLD_CACHE_SIZE 4

Definition at line 35 of file PersistentManifold.h.

Referenced by PersistentManifold::AddManifoldPoint().

Typedef Documentation

typedef bool(* ContactDestroyedCallback)(void *userPersistentData)

Definition at line 29 of file PersistentManifold.h.

Variable Documentation

float gContactBreakingTreshold

contact breaking and merging treshold

Definition at line 21 of file PersistentManifold.cpp.

Referenced by PersistentManifold::GetContactBreakingTreshold(), CcdPhysicsEnvironment::setContactBreakingTreshold(), and CcdPhysicsEnvironment::UpdateAabbs().

ContactDestroyedCallback gContactCallback

Definition at line 22 of file PersistentManifold.cpp.

Referenced by PersistentManifold::ClearUserCache(), and SimpleConstraintSolver::SimpleConstraintSolver().

Generated on Wed May 24 13:59:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PersistentManifold.h Source File

Bullet » NarrowPhaseCollision

PersistentManifold.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef PERSISTENT_MANIFOLD_H
00017 #define PERSISTENT_MANIFOLD_H
00018
00019
00020 #include "SimdVector3.h"
00021 #include "SimdTransform.h"
00022 #include "ManifoldPoint.h"
00023
00024 struct CollisionResult;
00025
00027 extern float gContactBreakingTreshold;
00028
00029 typedef bool (*ContactDestroyedCallback)(void* userPersistentData);
00030
00031 extern ContactDestroyedCallback gContactCallback;
00032
00033
00034
00035 #define MANIFOLD_CACHE_SIZE 4
00036
00039 class PersistentManifold
00040 {
00041
00042         ManifoldPoint m_pointCache[MANIFOLD_CACHE_SIZE];
00043
00046         void* m_body0;
00047         void* m_body1;
00048         int     m_cachedPoints;
00049
00050
00052         int     SortCachedPoints(const ManifoldPoint& pt);
00053
00054         int             FindContactPoint(const ManifoldPoint* unUsed, int numUnused,const ManifoldPoint& pt);
00055
00056 public:
00057
00058         int m_index1;
00059
00060         PersistentManifold();
00061
00062         PersistentManifold(void* body0,void* body1)
00063                 : m_body0(body0),m_body1(body1),m_cachedPoints(0)
00064         {
00065         }
00066
00067         inline void* GetBody0() { return m_body0;}
00068         inline void* GetBody1() { return m_body1;}
00069
00070         inline const void* GetBody0() const { return m_body0;}
00071         inline const void* GetBody1() const { return m_body1;}
00072
00073         void    SetBodies(void* body0,void* body1)
00074         {
00075                 m_body0 = body0;
00076                 m_body1 = body1;
00077         }
00078
00079         void ClearUserCache(ManifoldPoint& pt);
00080
00081 #ifdef DEBUG_PERSISTENCY
00082         void    DebugPersistency();
00083 #endif //
00084
00085         inline int      GetNumContacts() const { return m_cachedPoints;}
00086
00087         inline const ManifoldPoint& GetContactPoint(int index) const
00088         {
00089                 ASSERT(index < m_cachedPoints);
00090                 return m_pointCache[index];
00091         }
00092
00093         inline ManifoldPoint& GetContactPoint(int index)
00094         {
00095                 ASSERT(index < m_cachedPoints);
00096                 return m_pointCache[index];
00097         }
00098
00100         float   GetContactBreakingTreshold() const;
00101
00102         int GetCacheEntry(const ManifoldPoint& newPoint) const;
00103
00104         void AddManifoldPoint( const ManifoldPoint& newPoint);
00105
00106         void RemoveContactPoint (int index)
00107         {
00108                 ClearUserCache(m_pointCache[index]);
00109
00110                 int lastUsedIndex = GetNumContacts() - 1;
00111                 m_pointCache[index] = m_pointCache[lastUsedIndex];
00112                 //get rid of duplicated userPersistentData pointer
00113                 m_pointCache[lastUsedIndex].m_userPersistentData = 0;
00114                 m_cachedPoints--;
00115         }
00116         void ReplaceContactPoint(const ManifoldPoint& newPoint,int insertIndex)
00117         {
00118                 assert(ValidContactDistance(newPoint));
00119
00120                 ClearUserCache(m_pointCache[insertIndex]);
00121
00122                 m_pointCache[insertIndex] = newPoint;
00123         }
00124
00125         bool ValidContactDistance(const ManifoldPoint& pt) const
00126         {
00127                 return pt.m_distance1 <= GetContactBreakingTreshold();
00128         }
00130         void    RefreshContactPoints(  const SimdTransform& trA,const SimdTransform& trB);
00131
00132         void    ClearManifold();
00133
00134
00135
00136 };
00137
00138
00139
00140 #endif //PERSISTENT_MANIFOLD_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_DynamicTypes.h File Reference

Extras » PhysicsInterface » Common

PHY_DynamicTypes.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | PHY__Vector3
struct | PHY_CollData

Typedefs

typedef PHY_CollData | PHY_CollData
typedef bool(* | PHY_ResponseCallback )(void *client_data, void *client_object1, void *client_object2, const PHY_CollData *coll_data)
typedef enum PHY_PhysicsType | PHY_PhysicsType
PHY_PhysicsType enumerates all possible Physics Entities.
typedef enum PHY_ConstraintType | PHY_ConstraintType
PHY_ConstraintType enumerates all supported Constraint Types.
typedef float | PHY_Vector3 [3]

Enumerations

enum {
PHY_FH_RESPONSE,
PHY_SENSOR_RESPONSE,
PHY_CAMERA_RESPONSE,
PHY_OBJECT_RESPONSE,
PHY_STATIC_RESPONSE,
PHY_NUM_RESPONSE
}
enum PHY_PhysicsType {
PHY_CONVEX_RIGIDBODY = 16386,
PHY_CONCAVE_RIGIDBODY = 16399,
PHY_CONVEX_FIXEDBODY = 16388,
PHY_CONCAVE_FIXEDBODY = 16401,
PHY_CONVEX_KINEMATICBODY = 16387,
PHY_CONCAVE_KINEMATICBODY = 16400,
PHY_CONVEX_PHANTOMBODY = 16398,
PHY_CONCAVE_PHANTOMBODY = 16402
}
PHY_PhysicsType enumerates all possible Physics Entities. More...
enum PHY_ConstraintType {
PHY_POINT2POINT_CONSTRAINT = 1,
PHY_LINEHINGE_CONSTRAINT = 2,
PHY_ANGULAR_CONSTRAINT = 3,
PHY_VEHICLE_CONSTRAINT = 11
}
PHY_ConstraintType enumerates all supported Constraint Types. More...

Typedef Documentation

typedef struct PHY_CollData PHY_CollData

typedef enum PHY_ConstraintType PHY_ConstraintType

PHY_ConstraintType enumerates all supported Constraint Types.

typedef enum PHY_PhysicsType PHY_PhysicsType

PHY_PhysicsType enumerates all possible Physics Entities.

It is mainly used to create/add Physics Objects

typedef bool(* PHY_ResponseCallback)(void *client_data, void *client_object1, void *client_object2, const PHY_CollData *coll_data)

Definition at line 58 of file PHY_DynamicTypes.h.

typedef float PHY_Vector3[3]

Definition at line 89 of file PHY_DynamicTypes.h.

Enumeration Type Documentation

anonymous enum

Enumerator:
PHY_FH_RESPONSE
PHY_SENSOR_RESPONSE
PHY_CAMERA_RESPONSE
PHY_OBJECT_RESPONSE
PHY_STATIC_RESPONSE
PHY_NUM_RESPONSE

Definition at line 40 of file PHY_DynamicTypes.h.

enum PHY_ConstraintType

PHY_ConstraintType enumerates all supported Constraint Types.

Enumerator:
PHY_POINT2POINT_CONSTRAINT
PHY_LINEHINGE_CONSTRAINT
PHY_ANGULAR_CONSTRAINT
PHY_VEHICLE_CONSTRAINT

Definition at line 80 of file PHY_DynamicTypes.h.

enum PHY_PhysicsType

PHY_PhysicsType enumerates all possible Physics Entities.

It is mainly used to create/add Physics Objects

Enumerator:
PHY_CONVEX_RIGIDBODY
PHY_CONCAVE_RIGIDBODY
PHY_CONVEX_FIXEDBODY
PHY_CONCAVE_FIXEDBODY
PHY_CONVEX_KINEMATICBODY
PHY_CONCAVE_KINEMATICBODY
PHY_CONVEX_PHANTOMBODY
PHY_CONCAVE_PHANTOMBODY

Definition at line 68 of file PHY_DynamicTypes.h.

Generated on Wed May 24 13:59:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_DynamicTypes.h Source File

Extras » PhysicsInterface » Common

PHY_DynamicTypes.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef __PHY_DYNAMIC_TYPES
00018 #define __PHY_DYNAMIC_TYPES
00019
00020
00021
00022 class   PHY_ResponseTable;
00023
00024 class PHY_Shape;
00025
00026 struct  PHY__Vector3
00027 {
00028         float   m_vec[4];
00029         operator const float* () const
00030         {
00031                 return &m_vec[0];
00032         }
00033         operator float* ()
00034         {
00035                 return &m_vec[0];
00036         }
00037 };
00038 //typedef       float   PHY__Vector3[4];
00039
00040 typedef enum
00041 {
00042         PHY_FH_RESPONSE,
00043         PHY_SENSOR_RESPONSE,            /* Touch Sensors */
00044         PHY_CAMERA_RESPONSE,    /* Visibility Culling */
00045         PHY_OBJECT_RESPONSE,    /* Object Dynamic Geometry Response */
00046         PHY_STATIC_RESPONSE,    /* Static Geometry Response */
00047
00048         PHY_NUM_RESPONSE
00049 };
00050
00051         typedef struct PHY_CollData {
00052                 PHY__Vector3 m_point1;               /* Point in object1 in world coordinates */
00053                 PHY__Vector3 m_point2;               /* Point in object2 in world coordinates */
00054                 PHY__Vector3 m_normal;               /* point2 - point1 */
00055         } PHY_CollData;
00056
00057
00058         typedef bool (*PHY_ResponseCallback)(void *client_data,
00059                                                                                    void *client_object1,
00060                                                                                    void *client_object2,
00061                                                                                    const PHY_CollData *coll_data);
00062
00063
00064
00067
00068 typedef enum PHY_PhysicsType {
00069         PHY_CONVEX_RIGIDBODY=16386,
00070         PHY_CONCAVE_RIGIDBODY=16399,
00071         PHY_CONVEX_FIXEDBODY=16388,//'collision object'
00072         PHY_CONCAVE_FIXEDBODY=16401,
00073         PHY_CONVEX_KINEMATICBODY=16387,//
00074         PHY_CONCAVE_KINEMATICBODY=16400,
00075         PHY_CONVEX_PHANTOMBODY=16398,
00076         PHY_CONCAVE_PHANTOMBODY=16402
00077 } PHY_PhysicsType;
00078
00080 typedef enum PHY_ConstraintType {
00081         PHY_POINT2POINT_CONSTRAINT=1,
00082         PHY_LINEHINGE_CONSTRAINT=2,
00083         PHY_ANGULAR_CONSTRAINT = 3,//hinge without ball socket
00084         PHY_VEHICLE_CONSTRAINT=11,//complex 'constraint' that turns a rigidbody into a vehicle
00085
00086
00087 } PHY_ConstraintType;
00088
00089 typedef float   PHY_Vector3[3];
00090
00091 #endif //__PHY_DYNAMIC_TYPES
00092
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IMotionState.cpp File Reference

Extras » PhysicsInterface » Common

PHY_IMotionState.cpp File Reference

#include "PHY_IMotionState.h"

Include dependency graph for PHY_IMotionState.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IMotionState.cpp Source File

Extras » PhysicsInterface » Common

PHY_IMotionState.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "PHY_IMotionState.h"
00018
00019 PHY_IMotionState::~PHY_IMotionState()
00020 {
00021
00022 }
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IMotionState.h File Reference

Extras » PhysicsInterface » Common

PHY_IMotionState.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class PHY_IMotionState
PHY_IMotionState is the Interface to explicitly synchronize the world transformation. More...

Generated on Wed May 24 13:59:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IMotionState.h Source File

Extras » PhysicsInterface » Common

PHY_IMotionState.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef PHY__MOTIONSTATE_H
00018 #define PHY__MOTIONSTATE_H
00019
00024 class   PHY_IMotionState
00025
00026 {
00027         public:
00028
00029                 virtual ~PHY_IMotionState();
00030
00031                 virtual void    getWorldPosition(float& posX,float& posY,float& posZ)=0;
00032                 virtual void    getWorldScaling(float& scaleX,float& scaleY,float& scaleZ)=0;
00033                 virtual void    getWorldOrientation(float& quatIma0,float& quatIma1,float& quatIma2,float& quatReal)=0;
00034
00035                 virtual void    setWorldPosition(float posX,float posY,float posZ)=0;
00036                 virtual void    setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal)=0;
00037
00038                 virtual void    calculateWorldTransformations()=0;
00039 };
00040
00041 #endif //PHY__MOTIONSTATE_H
00042
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsController.cpp File Reference

Extras » PhysicsInterface » Common

PHY_IPhysicsController.cpp File Reference

#include "PHY_IPhysicsController.h"

Include dependency graph for PHY_IPhysicsController.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsController.cpp Source File

Extras » PhysicsInterface » Common

PHY_IPhysicsController.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "PHY_IPhysicsController.h"
00018
00019 PHY_IPhysicsController::~PHY_IPhysicsController()
00020 {
00021
00022 }
00023
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsController.h File Reference

Extras » PhysicsInterface » Common

PHY_IPhysicsController.h File Reference

#include "PHY_DynamicTypes.h"

Include dependency graph for PHY_IPhysicsController.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class PHY_IPhysicsController
PHY_IPhysicsController is the abstract simplified Interface to a physical object. More...

Generated on Wed May 24 13:59:27 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsController.h Source File

Extras » PhysicsInterface » Common

PHY_IPhysicsController.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef PHY_IPHYSICSCONTROLLER_H
00018 #define PHY_IPHYSICSCONTROLLER_H
00019
00020 #include "PHY_DynamicTypes.h"
00021
00028 class PHY_IPhysicsController
00029 {
00030
00031         public:
00032
00033                 virtual ~PHY_IPhysicsController();
00037                 virtual bool            SynchronizeMotionStates(float time)=0;
00042                 virtual void            WriteMotionStateToDynamics(bool nondynaonly)=0;
00043                 virtual void            WriteDynamicsToMotionState()=0;
00044                 // controller replication
00045                 virtual void            PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl)=0;
00046
00047                 // kinematic methods
00048                 virtual void            RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local)=0;
00049                 virtual void            RelativeRotate(const float drot[12],bool local)=0;
00050                 virtual void            getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal)=0;
00051                 virtual void            setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal)=0;
00052                 virtual void            setPosition(float posX,float posY,float posZ)=0;
00053                 virtual void            getPosition(PHY__Vector3&       pos) const=0;
00054                 virtual void            setScaling(float scaleX,float scaleY,float scaleZ)=0;
00055
00056                 // physics methods
00057                 virtual void            ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local)=0;
00058                 virtual void            ApplyForce(float forceX,float forceY,float forceZ,bool local)=0;
00059                 virtual void            SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local)=0;
00060                 virtual void            SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local)=0;
00061
00062                 virtual void            applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ)=0;
00063                 virtual void            SetActive(bool active)=0;
00064
00065                 // reading out information from physics
00066                 virtual void            GetLinearVelocity(float& linvX,float& linvY,float& linvZ)=0;
00067                 virtual void            GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ)=0;
00068                 virtual void            getReactionForce(float& forceX,float& forceY,float& forceZ)=0;
00069
00070                 // dyna's that are rigidbody are free in orientation, dyna's with non-rigidbody are restricted
00071                 virtual void            setRigidBody(bool rigid)=0;
00072
00073
00074                 // clientinfo for raycasts for example
00075                 virtual void*                           getNewClientInfo()=0;
00076                 virtual void                            setNewClientInfo(void* clientinfo)=0;
00077                 virtual PHY_IPhysicsController* GetReplica() {return 0;}
00078
00079                 virtual void    calcXform() =0;
00080                 virtual void SetMargin(float margin) =0;
00081                 virtual float GetMargin() const=0;
00082                 virtual float GetRadius() const { return 0.f;}
00083                 PHY__Vector3    GetWorldPosition(PHY__Vector3& localpos);
00084
00085 };
00086
00087 #endif //PHY_IPHYSICSCONTROLLER_H
00088
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsEnvironment.cpp File Reference

Extras » PhysicsInterface » Common

PHY_IPhysicsEnvironment.cpp File Reference

#include "PHY_IPhysicsEnvironment.h"

Include dependency graph for PHY_IPhysicsEnvironment.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:27 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsEnvironment.cpp Source File

Extras » PhysicsInterface » Common

PHY_IPhysicsEnvironment.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2005 Erwin Coumans <phy@erwincoumans.com>
00003  *
00004  * Permission to use, copy, modify, distribute and sell this software
00005  * and its documentation for any purpose is hereby granted without fee,
00006  * provided that the above copyright notice appear in all copies and
00007  * that both that copyright notice and this permission notice appear
00008  * in supporting documentation.  Erwin Coumans makes no
00009  * representations about the suitability of this software for any
00010  * purpose.  It is provided "as is" without express or implied warranty.
00011  *
00012  */
00013
00014 #include "PHY_IPhysicsEnvironment.h"
00015
00023 PHY_IPhysicsEnvironment::~PHY_IPhysicsEnvironment()
00024 {
00025
00026 }
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsEnvironment.h File Reference

Extras » PhysicsInterface » Common

PHY_IPhysicsEnvironment.h File Reference

#include <vector>
#include "PHY_DynamicTypes.h"

Include dependency graph for PHY_IPhysicsEnvironment.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class PHY_IPhysicsEnvironment
Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc. More...

Generated on Wed May 24 13:59:27 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsEnvironment.h Source File

Extras » PhysicsInterface » Common

PHY_IPhysicsEnvironment.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef _IPHYSICSENVIRONMENT
00018 #define _IPHYSICSENVIRONMENT
00019
00020 #include <vector>
00021 #include "PHY_DynamicTypes.h"
00022
00027 class PHY_IPhysicsEnvironment
00028 {
00029         public:
00030                 virtual         ~PHY_IPhysicsEnvironment();
00032                 virtual bool            proceedDeltaTime(double curTime,float timeStep)=0;
00033
00034
00035                 virtual void            setGravity(float x,float y,float z)=0;
00036
00037                 virtual int                     createConstraint(class PHY_IPhysicsController* ctrl,class PHY_IPhysicsController* ctrl2,PHY_ConstraintType type,
00038                         float pivotX,float pivotY,float pivotZ,
00039                         float axisX,float axisY,float axisZ)=0;
00040                 virtual void            removeConstraint(int constraintid)=0;
00041
00042                 virtual PHY_IPhysicsController* rayTest(PHY_IPhysicsController* ignoreClient, float fromX,float fromY,float fromZ, float toX,float toY,float toZ,
00043                                                                                 float& hitX,float& hitY,float& hitZ,float& normalX,float& normalY,float& normalZ)=0;
00044
00045
00046                 //Methods for gamelogic collision/physics callbacks
00047                 //todo:
00048                 virtual void addSensor(PHY_IPhysicsController* ctrl)=0;
00049                 virtual void removeSensor(PHY_IPhysicsController* ctrl)=0;
00050                 virtual void addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0;
00051                 virtual void requestCollisionCallback(PHY_IPhysicsController* ctrl)=0;
00052                 virtual PHY_IPhysicsController* CreateSphereController(float radius,const PHY__Vector3& position) =0;
00053                 virtual PHY_IPhysicsController* CreateConeController(float coneradius,float coneheight)=0;
00054
00055 };
00056
00057 #endif //_IPHYSICSENVIRONMENT
00058
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IVehicle.cpp File Reference

Extras » PhysicsInterface » Common

PHY_IVehicle.cpp File Reference

#include "PHY_IVehicle.h"

Include dependency graph for PHY_IVehicle.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:27 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IVehicle.cpp Source File

Extras » PhysicsInterface » Common

PHY_IVehicle.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #include "PHY_IVehicle.h"
00019
00020 PHY_IVehicle::~PHY_IVehicle()
00021 {
00022
00023 }
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IVehicle.h File Reference

Extras » PhysicsInterface » Common

PHY_IVehicle.h File Reference

#include "PHY_DynamicTypes.h"

Include dependency graph for PHY_IVehicle.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class PHY_IVehicle

Generated on Wed May 24 13:59:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IVehicle.h Source File

Extras » PhysicsInterface » Common

PHY_IVehicle.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef PHY_IVEHICLE_H
00018 #define PHY_IVEHICLE_H
00019
00020 //PHY_IVehicle provides a generic interface for (raycast based) vehicles. Mostly targetting 4 wheel cars and 2 wheel motorbikes.
00021
00022 class PHY_IMotionState;
00023 #include "PHY_DynamicTypes.h"
00024
00025 class PHY_IVehicle
00026 {
00027 public:
00028
00029         virtual ~PHY_IVehicle();
00030
00031         virtual void    AddWheel(
00032                         PHY_IMotionState* motionState,
00033                         PHY__Vector3    connectionPoint,
00034                         PHY__Vector3    downDirection,
00035                         PHY__Vector3    axleDirection,
00036                         float   suspensionRestLength,
00037                         float wheelRadius,
00038                         bool hasSteering
00039                 ) = 0;
00040
00041
00042         virtual int             GetNumWheels() const = 0;
00043
00044         virtual void    GetWheelPosition(int wheelIndex,float& posX,float& posY,float& posZ) const = 0;
00045         virtual void    GetWheelOrientationQuaternion(int wheelIndex,float& quatX,float& quatY,float& quatZ,float& quatW) const = 0;
00046         virtual float   GetWheelRotation(int wheelIndex) const = 0;
00047
00048         virtual int     GetUserConstraintId() const =0;
00049         virtual int     GetUserConstraintType() const =0;
00050
00051         //some basic steering/braking/tuning/balancing (bikes)
00052
00053         virtual void    SetSteeringValue(float steering,int wheelIndex) = 0;
00054
00055         virtual void    ApplyEngineForce(float force,int wheelIndex) = 0;
00056
00057         virtual void    ApplyBraking(float braking,int wheelIndex) = 0;
00058
00059 };
00060
00061 #endif //PHY_IVEHICLE_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_Pro.h File Reference

Extras » PhysicsInterface » Common

PHY_Pro.h File Reference

Go to the source code of this file.

Classes

struct | PHY_ShapeProps
struct | PHY_MaterialProps

Generated on Wed May 24 13:59:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_Pro.h Source File

Extras » PhysicsInterface » Common

PHY_Pro.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef PHY_PROPSH
00017 #define PHY_PROPSH
00018
00019
00020 class CollisionShape;
00021
00022 // Properties of dynamic objects
00023 struct PHY_ShapeProps {
00024         float  m_mass;                  // Total mass
00025         float  m_inertia;               // Inertia, should be a tensor some time
00026         float  m_lin_drag;              // Linear drag (air, water) 0 = concrete, 1 = vacuum
00027         float  m_ang_drag;              // Angular drag
00028         float  m_friction_scaling[3];   // Scaling for anisotropic friction. Component in range [0, 1]
00029         bool       m_do_anisotropic;        // Should I do anisotropic friction?
00030         bool       m_do_fh;                 // Should the object have a linear Fh spring?
00031         bool       m_do_rot_fh;             // Should the object have an angular Fh spring?
00032         CollisionShape* m_shape;
00033 };
00034
00035
00036 // Properties of collidable objects (non-ghost objects)
00037 struct PHY_MaterialProps {
00038         float m_restitution;           // restitution of energie after a collision 0 = inelastic, 1 = elastic
00039         float m_friction;              // Coulomb friction (= ratio between the normal en maximum friction force)
00040         float m_fh_spring;             // Spring constant (both linear and angular)
00041         float m_fh_damping;            // Damping factor (linear and angular) in range [0, 1]
00042         float m_fh_distance;           // The range above the surface where Fh is active.
00043         bool      m_fh_normal;             // Should the object slide off slopes?
00044 };
00045
00046 #endif //PHY_PROPSH
00047
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Point2PointConstraint.cpp File Reference

BulletDynamics » ConstraintSolver

Point2PointConstraint.cpp File Reference

#include "Point2PointConstraint.h"
#include "Dynamics/RigidBody.h"
#include "Dynamics/MassProps.h"

Include dependency graph for Point2PointConstraint.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Point2PointConstraint.cpp Source File

BulletDynamics » ConstraintSolver

Point2PointConstraint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "Point2PointConstraint.h"
00018 #include "Dynamics/RigidBody.h"
00019 #include "Dynamics/MassProps.h"
00020
00021
00022
00023
00024 Point2PointConstraint::Point2PointConstraint()
00025 {
00026 }
00027
00028 Point2PointConstraint::Point2PointConstraint(RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB)
00029 :TypedConstraint(rbA,rbB),m_pivotInA(pivotInA),m_pivotInB(pivotInB)
00030 {
00031
00032 }
00033
00034
00035 Point2PointConstraint::Point2PointConstraint(RigidBody& rbA,const SimdVector3& pivotInA)
00036 :TypedConstraint(rbA),m_pivotInA(pivotInA),m_pivotInB(rbA.getCenterOfMassTransform()(pivotInA))
00037 {
00038
00039 }
00040
00041 void    Point2PointConstraint::BuildJacobian()
00042 {
00043         SimdVector3     normal(0,0,0);
00044
00045         for (int i=0;i<3;i++)
00046         {
00047                 normal[i] = 1;
00048                 new (&m_jac[i]) JacobianEntry(
00049                         m_rbA.getCenterOfMassTransform().getBasis().transpose(),
00050                         m_rbB.getCenterOfMassTransform().getBasis().transpose(),
00051                         m_rbA.getCenterOfMassTransform()*m_pivotInA - m_rbA.getCenterOfMassPosition(),
00052                         m_rbB.getCenterOfMassTransform()*m_pivotInB - m_rbB.getCenterOfMassPosition(),
00053                         normal,
00054                         m_rbA.getInvInertiaDiagLocal(),
00055                         m_rbA.getInvMass(),
00056                         m_rbB.getInvInertiaDiagLocal(),
00057                         m_rbB.getInvMass());
00058                 normal[i] = 0;
00059         }
00060
00061 }
00062
00063 void    Point2PointConstraint::SolveConstraint(SimdScalar       timeStep)
00064 {
00065         SimdVector3 pivotAInW = m_rbA.getCenterOfMassTransform()*m_pivotInA;
00066         SimdVector3 pivotBInW = m_rbB.getCenterOfMassTransform()*m_pivotInB;
00067
00068
00069         SimdVector3 normal(0,0,0);
00070
00071
00072 //      SimdVector3 angvelA = m_rbA.getCenterOfMassTransform().getBasis().transpose() * m_rbA.getAngularVelocity();
00073 //      SimdVector3 angvelB = m_rbB.getCenterOfMassTransform().getBasis().transpose() * m_rbB.getAngularVelocity();
00074
00075         for (int i=0;i<3;i++)
00076         {
00077                 normal[i] = 1;
00078                 SimdScalar jacDiagABInv = 1.f / m_jac[i].getDiagonal();
00079
00080                 SimdVector3 rel_pos1 = pivotAInW - m_rbA.getCenterOfMassPosition();
00081                 SimdVector3 rel_pos2 = pivotBInW - m_rbB.getCenterOfMassPosition();
00082                 //this jacobian entry could be re-used for all iterations
00083
00084                 SimdVector3 vel1 = m_rbA.getVelocityInLocalPoint(rel_pos1);
00085                 SimdVector3 vel2 = m_rbB.getVelocityInLocalPoint(rel_pos2);
00086                 SimdVector3 vel = vel1 - vel2;
00087
00088                 SimdScalar rel_vel;
00089                 rel_vel = normal.dot(vel);
00090
00091         /*
00092                 //velocity error (first order error)
00093                 SimdScalar rel_vel = m_jac[i].getRelativeVelocity(m_rbA.getLinearVelocity(),angvelA,
00094                                                                                                                 m_rbB.getLinearVelocity(),angvelB);
00095         */
00096
00097                 //positional error (zeroth order error)
00098                 SimdScalar depth = -(pivotAInW - pivotBInW).dot(normal); //this is the error projected on the normal
00099
00100                 SimdScalar impulse = depth*m_setting.m_tau/timeStep  * jacDiagABInv -  m_setting.m_damping * rel_vel * jacDiagABInv;
00101
00102                 SimdVector3 impulse_vector = normal * impulse;
00103                 m_rbA.applyImpulse(impulse_vector, pivotAInW - m_rbA.getCenterOfMassPosition());
00104                 m_rbB.applyImpulse(-impulse_vector, pivotBInW - m_rbB.getCenterOfMassPosition());
00105
00106                 normal[i] = 0;
00107         }
00108 }
00109
00110 void    Point2PointConstraint::UpdateRHS(SimdScalar     timeStep)
00111 {
00112
00113 }
00114
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Point2PointConstraint.h File Reference

BulletDynamics » ConstraintSolver

Point2PointConstraint.h File Reference

#include "SimdVector3.h"
#include "ConstraintSolver/JacobianEntry.h"
#include "TypedConstraint.h"

Include dependency graph for Point2PointConstraint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | ConstraintSetting
class | Point2PointConstraint
point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space More...

Generated on Wed May 24 13:59:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Point2PointConstraint.h Source File

BulletDynamics » ConstraintSolver

Point2PointConstraint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef POINT2POINTCONSTRAINT_H
00017 #define POINT2POINTCONSTRAINT_H
00018
00019 #include "SimdVector3.h"
00020
00021 #include "ConstraintSolver/JacobianEntry.h"
00022 #include "TypedConstraint.h"
00023
00024 class RigidBody;
00025
00026 struct  ConstraintSetting
00027 {
00028         ConstraintSetting()     :
00029                 m_tau(0.3f),
00030                 m_damping(1.f)
00031         {
00032         }
00033         float           m_tau;
00034         float           m_damping;
00035 };
00036
00038 class Point2PointConstraint : public TypedConstraint
00039 {
00040         JacobianEntry   m_jac[3]; //3 orthogonal linear constraints
00041
00042         SimdVector3     m_pivotInA;
00043         SimdVector3     m_pivotInB;
00044
00045
00046
00047 public:
00048
00049         ConstraintSetting       m_setting;
00050
00051         Point2PointConstraint(RigidBody& rbA,RigidBody& rbB, const SimdVector3& pivotInA,const SimdVector3& pivotInB);
00052
00053         Point2PointConstraint(RigidBody& rbA,const SimdVector3& pivotInA);
00054
00055         Point2PointConstraint();
00056
00057         virtual void    BuildJacobian();
00058
00059
00060         virtual void    SolveConstraint(SimdScalar      timeStep);
00061
00062         void    UpdateRHS(SimdScalar    timeStep);
00063
00064         void    SetPivotA(const SimdVector3& pivotA)
00065         {
00066                 m_pivotInA = pivotA;
00067         }
00068
00069         void    SetPivotB(const SimdVector3& pivotB)
00070         {
00071                 m_pivotInB = pivotB;
00072         }
00073
00074
00075
00076 };
00077
00078 #endif //POINT2POINTCONSTRAINT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PointCollector.h File Reference

Bullet » NarrowPhaseCollision

PointCollector.h File Reference

#include "DiscreteCollisionDetectorInterface.h"

Include dependency graph for PointCollector.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct PointCollector

Generated on Wed May 24 13:59:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PointCollector.h Source File

Bullet » NarrowPhaseCollision

PointCollector.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef POINT_COLLECTOR_H
00017 #define POINT_COLLECTOR_H
00018
00019 #include "DiscreteCollisionDetectorInterface.h"
00020
00021
00022
00023 struct PointCollector : public DiscreteCollisionDetectorInterface::Result
00024 {
00025
00026
00027         SimdVector3 m_normalOnBInWorld;
00028         SimdVector3 m_pointInWorld;
00029         SimdScalar      m_distance;//negative means penetration
00030
00031         bool    m_hasResult;
00032
00033         PointCollector ()
00034                 : m_distance(1e30f),m_hasResult(false)
00035         {
00036         }
00037
00038         virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth)
00039         {
00040                 if (depth< m_distance)
00041                 {
00042                         m_hasResult = true;
00043                         m_normalOnBInWorld = normalOnBInWorld;
00044                         m_pointInWorld = pointInWorld;
00045                         //negative means penetration
00046                         m_distance = depth;
00047                 }
00048         }
00049 };
00050
00051 #endif //POINT_COLLECTOR_H
00052
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PolyhedralConvexShape.cpp File Reference

Bullet » CollisionShapes

PolyhedralConvexShape.cpp File Reference

#include <CollisionShapes/PolyhedralConvexShape.h>

Include dependency graph for PolyhedralConvexShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PolyhedralConvexShape.cpp Source File

Bullet » CollisionShapes

PolyhedralConvexShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include <CollisionShapes/PolyhedralConvexShape.h>
00017
00018 PolyhedralConvexShape::PolyhedralConvexShape()
00019 :m_optionalHull(0)
00020 {
00021
00022 }
00023
00024
00025
00026 SimdVector3     PolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec0)const
00027 {
00028         int i;
00029         SimdVector3 supVec(0,0,0);
00030
00031         SimdScalar maxDot(-1e30f);
00032
00033         SimdVector3 vec = vec0;
00034         SimdScalar lenSqr = vec.length2();
00035         if (lenSqr < 0.0001f)
00036         {
00037                 vec.setValue(1,0,0);
00038         } else
00039         {
00040                 float rlen = 1.f / SimdSqrt(lenSqr );
00041                 vec *= rlen;
00042         }
00043
00044         SimdVector3 vtx;
00045         SimdScalar newDot;
00046
00047         for (i=0;i<GetNumVertices();i++)
00048         {
00049                 GetVertex(i,vtx);
00050                 newDot = vec.dot(vtx);
00051                 if (newDot > maxDot)
00052                 {
00053                         maxDot = newDot;
00054                         supVec = vtx;
00055                 }
00056         }
00057
00058         return supVec;
00059
00060 }
00061
00062 void    PolyhedralConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00063 {
00064         int i;
00065
00066         SimdVector3 vtx;
00067         SimdScalar newDot;
00068
00069         for (int j=0;j<numVectors;j++)
00070         {
00071                 SimdScalar maxDot(-1e30f);
00072
00073                 const SimdVector3& vec = vectors[j];
00074
00075                 for (i=0;i<GetNumVertices();i++)
00076                 {
00077                         GetVertex(i,vtx);
00078                         newDot = vec.dot(vtx);
00079                         if (newDot > maxDot)
00080                         {
00081                                 maxDot = newDot;
00082                                 supportVerticesOut[i] = vtx;
00083                         }
00084                 }
00085         }
00086 }
00087
00088
00089
00090 void    PolyhedralConvexShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00091 {
00092         //not yet, return box inertia
00093
00094         float margin = GetMargin();
00095
00096         SimdTransform ident;
00097         ident.setIdentity();
00098         SimdVector3 aabbMin,aabbMax;
00099         GetAabb(ident,aabbMin,aabbMax);
00100         SimdVector3 halfExtents = (aabbMax-aabbMin)*0.5f;
00101
00102         SimdScalar lx=2.f*(halfExtents.x()+margin);
00103         SimdScalar ly=2.f*(halfExtents.y()+margin);
00104         SimdScalar lz=2.f*(halfExtents.z()+margin);
00105         const SimdScalar x2 = lx*lx;
00106         const SimdScalar y2 = ly*ly;
00107         const SimdScalar z2 = lz*lz;
00108         const SimdScalar scaledmass = mass * 0.08333333f;
00109
00110         inertia = scaledmass * (SimdVector3(y2+z2,x2+z2,x2+y2));
00111
00112 }
00113
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PolyhedralConvexShape.h File Reference

Bullet » CollisionShapes

PolyhedralConvexShape.h File Reference

#include <SimdPoint3.h>
#include <SimdMatrix3x3.h>
#include <CollisionShapes/ConvexShape.h>

Include dependency graph for PolyhedralConvexShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class PolyhedralConvexShape
PolyhedralConvexShape is an interface class for feature based (vertex/edge/face) convex shapes. More...

Generated on Wed May 24 13:59:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PolyhedralConvexShape.h Source File

Bullet » CollisionShapes

PolyhedralConvexShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef BU_SHAPE
00017 #define BU_SHAPE
00018
00019 #include <SimdPoint3.h>
00020 #include <SimdMatrix3x3.h>
00021 #include <CollisionShapes/ConvexShape.h>
00022
00023
00025 class PolyhedralConvexShape : public ConvexShape
00026 {
00027
00028 public:
00029
00030         PolyhedralConvexShape();
00031
00032         //brute force implementations
00033         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00034         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00035
00036         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00037
00038
00039
00040         virtual int     GetNumVertices() const = 0 ;
00041         virtual int GetNumEdges() const = 0;
00042         virtual void GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const = 0;
00043         virtual void GetVertex(int i,SimdPoint3& vtx) const = 0;
00044         virtual int     GetNumPlanes() const = 0;
00045         virtual void GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i ) const = 0;
00046 //      virtual int GetIndex(int i) const = 0 ;
00047
00048         virtual bool IsInside(const SimdPoint3& pt,SimdScalar tolerance) const = 0;
00049
00051         class   Hull*   m_optionalHull;
00052
00053 };
00054
00055 #endif //BU_SHAPE
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Quat.cpp File Reference

LinearMath

Quat.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Quat.cpp Source File

LinearMath

Quat.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Quat.cpp
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017
00018 #ifdef WIN32
00019 #if _MSC_VER >= 1310
00020
00021 #include "Quat.h"
00022 #include "Maths.h"
00023
00024 bool Quat::IsFinite() const
00025 {
00026         if (_finite(GetX()) && _finite(GetY()) && _finite(GetZ()) && _finite(GetW()))
00027                 return true;
00028         return false;
00029 }
00030
00031 Quat::Quat(const Matrix33& m)
00032 {
00033         float tr, s, q[4];
00034         int i, j, k;
00035         int nxt[3] = {1, 2, 0};
00036         float x, y, z, w;
00037
00038         // Check the diagonal
00039         tr = m[0][0] + m[1][1] + m[2][2];
00040         if (tr >= 0.0f)
00041         {
00042                 // Diagonal is positive
00043                 s = ::Sqrt(tr + 1.0f);
00044                 w = s * 0.5f;
00045                 s = 0.5f / s;
00046                 x = (m[1][2] - m[2][1]) * s;
00047                 y = (m[2][0] - m[0][2]) * s;
00048                 z = (m[0][1] - m[1][0]) * s;
00049         }
00050         else
00051         {
00052                 // Diagonal is negative
00053                 i = 0;
00054                 if (m[1][1] > m[0][0]) i = 1;
00055                 if (m[2][2] > m[i][i]) i = 2;
00056                 j = nxt[i];
00057                 k = nxt[j];
00058
00059                 s = ::Sqrt((m[i][i] - (m[j][j] + m[k][k])) + 1.0f);
00060                 q[i] = s * 0.5f;
00061                 if (s != 0.0f) s = 0.5f / s;
00062
00063                 q[3] = (m[j][k] - m[k][j]) * s;
00064                 q[j] = (m[i][j] + m[j][i]) * s;
00065                 q[k] = (m[i][k] + m[k][i]) * s;
00066
00067                 x = q[0];
00068                 y = q[1];
00069                 z = q[2];
00070                 w = q[3];
00071         }
00072
00073         *this = Quat(x, y, z, w);
00074 }
00075
00076 const Quat Slerp(const Quat& a, const Quat& b, const Scalar& t)
00077 {
00078         Quat e;
00079         Scalar cosom, t0, t1;
00080
00081         cosom = Dot(a, b);
00082
00083         if (cosom < Scalar::Consts::Zero)
00084         {
00085                 cosom = -cosom;
00086                 e = -b;
00087         }
00088         else
00089                 e = b;
00090
00091         if (cosom < 0.9999f)
00092         {
00093                 float omega = ::Acos(cosom);
00094                 Scalar rcpSinom = Rcp(Scalar(::Sin(omega)));
00095                 t0 = Scalar(::Sin((1.0f - (float)t) * omega)) * rcpSinom;
00096                 t1 = Scalar(::Sin((float)t * omega)) * rcpSinom;
00097         }
00098         else
00099         {
00100                 t0 = Scalar(1.0f) - t;
00101                 t1 = t;
00102         }
00103
00104         return a * t0 + e * t;
00105 }
00106
00107 #endif
00108 #endif //#ifdef WIN32
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Quat.h File Reference

LinearMath

Quat.h File Reference

#include "Vector.h"
#include "Quat.inl"

Include dependency graph for Quat.h:

Go to the source code of this file.

Classes

class Quat

Generated on Wed May 24 13:59:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Quat.h Source File

LinearMath

Quat.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Quat.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifndef BULLET_QUAT_H
00018 #define BULLET_QUAT_H
00019
00020 #include "Vector.h"
00021
00022 class Matrix33;
00023
00024
00025 class Quat : public Vector4Base
00026 {
00027 public:
00028         BULLET_ALIGNED_NEW_AND_DELETE
00029
00030         // constructors
00031         Quat();
00032         Quat(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w);
00033         Quat(const Vector3& axis, const Scalar& angle);
00034
00035         // construction to constant
00036         Quat(const Maths::IdentityTag&);
00037
00038         // explicit constructors
00039         explicit Quat(const __m128 b);
00040         explicit Quat(const Vector3& v);
00041         explicit Quat(const Vector4& v);
00042         explicit Quat(const Matrix33& m);
00043         explicit Quat(const float* p);
00044
00045         // assignment
00046         const Quat& operator=(const Quat& v);
00047         const Quat& operator=(const Maths::IdentityTag&);
00048
00049         // in place operations
00050         void operator+=(const Quat& b);
00051         void operator-=(const Quat& b);
00052         void operator*=(const Quat& b);
00053         void operator*=(const Scalar& s);
00054
00055         // operations
00056         friend const Quat operator-(const Quat& a);
00057         friend const Quat operator+(const Quat& a, const Quat& b);
00058         friend const Quat operator-(const Quat& a, const Quat& b);
00059         friend const Quat operator*(const Quat& a, const Quat& b);
00060         friend const Quat operator*(const Quat& a, const Scalar& s);
00061         friend const Quat operator*(const Scalar& s, const Quat& a);
00062
00063         friend const Quat Inv(const Quat& a);
00064
00065         friend const Scalar Dot(const Quat& a, const Quat& b);
00066
00067         friend const Scalar Length(const Quat& a);
00068         friend const Quat Normalize(const Quat& a);
00069
00070         friend const Scalar LengthFast(const Quat& a);
00071         friend const Quat NormalizeFast(const Quat& a);
00072
00073         friend const Quat Slerp(const Quat& a, const Quat& b, const Scalar& t);
00074         friend const Quat Lerp(const Quat& a, const Quat& b, const Scalar& t);
00075
00076         const Vector3 Rotate(const Vector3& v) const;
00077         void GetAngleAxis(Vector3& axis, Scalar& angle) const;
00078
00079         // validation
00080         bool IsFinite() const;
00081 };
00082
00083
00084 #include "Quat.inl"
00085
00086
00087 #endif //BULLET_QUAT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: quickprof.cpp File Reference

LinearMath

quickprof.cpp File Reference

#include "quickprof.h"

Include dependency graph for quickprof.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: quickprof.cpp Source File

LinearMath

quickprof.cpp

Go to the documentation of this file.
00001 /************************************************************************
00002 * QuickProf                                                             *
00003 * Copyright (C) 2006                                                    *
00004 * Tyler Streeter  tylerstreeter@gmail.com                               *
00005 * All rights reserved.                                                  *
00006 * Web: http://quickprof.sourceforge.net                                 *
00007 *                                                                       *
00008 * This library is free software; you can redistribute it and/or         *
00009 * modify it under the terms of EITHER:                                  *
00010 *   (1) The GNU Lesser General Public License as published by the Free  *
00011 *       Software Foundation; either version 2.1 of the License, or (at  *
00012 *       your option) any later version. The text of the GNU Lesser      *
00013 *       General Public License is included with this library in the     *
00014 *       file license-LGPL.txt.                                          *
00015 *   (2) The BSD-style license that is included with this library in     *
00016 *       the file license-BSD.txt.                                       *
00017 *                                                                       *
00018 * This library is distributed in the hope that it will be useful,       *
00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00021 * license-LGPL.txt and license-BSD.txt for more details.                *
00022 ************************************************************************/
00023
00024 // Please visit the project website (http://quickprof.sourceforge.net)
00025 // for usage instructions.
00026
00027 // Credits: The Clock class was inspired by the Timer classes in
00028 // Ogre (www.ogre3d.org).
00029
00030 #include "quickprof.h"
00031
00032 #ifdef USE_QUICKPROF
00033
00034 // Note: We must declare these private static variables again here to
00035 // avoid link errors.
00036 bool Profiler::mEnabled = false;
00037 hidden::Clock Profiler::mClock;
00038 unsigned long int Profiler::mCurrentCycleStartMicroseconds = 0;
00039 unsigned long int Profiler::mLastCycleDurationMicroseconds = 0;
00040 std::map<std::string, hidden::ProfileBlock*> Profiler::mProfileBlocks;
00041 std::ofstream Profiler::mOutputFile;
00042 bool Profiler::mFirstFileOutput = true;
00043 Profiler::BlockTimingMethod Profiler::mFileOutputMethod;
00044 unsigned long int Profiler::mCycleNumber = 0;
00045 #endif //USE_QUICKPROF
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: quickprof.h File Reference

LinearMath

quickprof.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Generated on Wed May 24 13:59:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: quickprof.h Source File

LinearMath

quickprof.h

Go to the documentation of this file.
00001 /************************************************************************
00002 * QuickProf                                                             *
00003 * Copyright (C) 2006                                                    *
00004 * Tyler Streeter  tylerstreeter@gmail.com                               *
00005 * All rights reserved.                                                  *
00006 * Web: http://quickprof.sourceforge.net                                 *
00007 *                                                                       *
00008 * This library is free software; you can redistribute it and/or         *
00009 * modify it under the terms of EITHER:                                  *
00010 *   (1) The GNU Lesser General Public License as published by the Free  *
00011 *       Software Foundation; either version 2.1 of the License, or (at  *
00012 *       your option) any later version. The text of the GNU Lesser      *
00013 *       General Public License is included with this library in the     *
00014 *       file license-LGPL.txt.                                          *
00015 *   (2) The BSD-style license that is included with this library in     *
00016 *       the file license-BSD.txt.                                       *
00017 *                                                                       *
00018 * This library is distributed in the hope that it will be useful,       *
00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00021 * license-LGPL.txt and license-BSD.txt for more details.                *
00022 ************************************************************************/
00023
00024 // Please visit the project website (http://quickprof.sourceforge.net)
00025 // for usage instructions.
00026
00027 // Credits: The Clock class was inspired by the Timer classes in
00028 // Ogre (www.ogre3d.org).
00029
00030
00031 //#define USE_QUICKPROF 1
00032
00033 #ifdef USE_QUICKPROF
00034
00035 #ifndef QUICK_PROF_H
00036 #define QUICK_PROF_H
00037
00038 #include <iostream>
00039 #include <fstream>
00040 #include <string>
00041 #include <map>
00042
00043 #ifdef __PPU__
00044 #include <sys/sys_time.h>
00045 #include <stdio.h>
00046 typedef uint64_t __int64;
00047 #endif
00048
00049 #if defined(WIN32) || defined(_WIN32)
00050         #define USE_WINDOWS_TIMERS
00051         #include <windows.h>
00052         #include <time.h>
00053 #else
00054         #include <sys/time.h>
00055 #endif
00056
00057 #define mymin(a,b) (a > b ? a : b)
00058 namespace hidden
00059 {
00062         struct ProfileBlock
00063         {
00064                 ProfileBlock()
00065                 {
00066                         currentBlockStartMicroseconds = 0;
00067                         currentCycleTotalMicroseconds = 0;
00068                         lastCycleTotalMicroseconds = 0;
00069                         totalMicroseconds = 0;
00070                 }
00071
00073                 unsigned long int currentBlockStartMicroseconds;
00074
00077                 unsigned long int currentCycleTotalMicroseconds;
00078
00081                 unsigned long int lastCycleTotalMicroseconds;
00082
00084                 unsigned long int totalMicroseconds;
00085         };
00086
00087         class Clock
00088         {
00089         public:
00090                 Clock()
00091                 {
00092 #ifdef USE_WINDOWS_TIMERS
00093                         QueryPerformanceFrequency(&mClockFrequency);
00094 #endif
00095                         reset();
00096                 }
00097
00098                 ~Clock()
00099                 {
00100                 }
00101
00103                 void reset()
00104                 {
00105 #ifdef USE_WINDOWS_TIMERS
00106                         QueryPerformanceCounter(&mStartTime);
00107                         mStartTick = GetTickCount();
00108                         mPrevElapsedTime = 0;
00109 #else
00110 #ifdef __PPU__
00111
00112         typedef uint64_t __int64;
00113         typedef __int64  ClockSize;
00114         ClockSize newTime;
00115         __asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
00116         mStartTime = newTime;
00117 #else
00118                         gettimeofday(&mStartTime, NULL);
00119 #endif
00120
00121 #endif
00122                 }
00123
00126                 unsigned long int getTimeMilliseconds()
00127                 {
00128 #ifdef USE_WINDOWS_TIMERS
00129                         LARGE_INTEGER currentTime;
00130                         QueryPerformanceCounter(&currentTime);
00131                         LONGLONG elapsedTime = currentTime.QuadPart -
00132                                 mStartTime.QuadPart;
00133
00134                         // Compute the number of millisecond ticks elapsed.
00135                         unsigned long msecTicks = (unsigned long)(1000 * elapsedTime /
00136                                 mClockFrequency.QuadPart);
00137
00138                         // Check for unexpected leaps in the Win32 performance counter.
00139                         // (This is caused by unexpected data across the PCI to ISA
00140                         // bridge, aka south bridge.  See Microsoft KB274323.)
00141                         unsigned long elapsedTicks = GetTickCount() - mStartTick;
00142                         signed long msecOff = (signed long)(msecTicks - elapsedTicks);
00143                         if (msecOff < -100 || msecOff > 100)
00144                         {
00145                                 // Adjust the starting time forwards.
00146                                 LONGLONG msecAdjustment = mymin(msecOff *
00147                                         mClockFrequency.QuadPart / 1000, elapsedTime -
00148                                         mPrevElapsedTime);
00149                                 mStartTime.QuadPart += msecAdjustment;
00150                                 elapsedTime -= msecAdjustment;
00151
00152                                 // Recompute the number of millisecond ticks elapsed.
00153                                 msecTicks = (unsigned long)(1000 * elapsedTime /
00154                                         mClockFrequency.QuadPart);
00155                         }
00156
00157                         // Store the current elapsed time for adjustments next time.
00158                         mPrevElapsedTime = elapsedTime;
00159
00160                         return msecTicks;
00161 #else
00162
00163 #ifdef __PPU__
00164         __int64 freq=sys_time_get_timebase_frequency();
00165          double dFreq=((double) freq) / 1000.0;
00166         typedef uint64_t __int64;
00167         typedef __int64  ClockSize;
00168         ClockSize newTime;
00169         __asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
00170
00171         return (newTime-mStartTime) / dFreq;
00172 #else
00173
00174                         struct timeval currentTime;
00175                         gettimeofday(&currentTime, NULL);
00176                         return (currentTime.tv_sec - mStartTime.tv_sec) * 1000 +
00177                                 (currentTime.tv_usec - mStartTime.tv_usec) / 1000;
00178 #endif //__PPU__
00179 #endif
00180                 }
00181
00184                 unsigned long int getTimeMicroseconds()
00185                 {
00186 #ifdef USE_WINDOWS_TIMERS
00187                         LARGE_INTEGER currentTime;
00188                         QueryPerformanceCounter(&currentTime);
00189                         LONGLONG elapsedTime = currentTime.QuadPart -
00190                                 mStartTime.QuadPart;
00191
00192                         // Compute the number of millisecond ticks elapsed.
00193                         unsigned long msecTicks = (unsigned long)(1000 * elapsedTime /
00194                                 mClockFrequency.QuadPart);
00195
00196                         // Check for unexpected leaps in the Win32 performance counter.
00197                         // (This is caused by unexpected data across the PCI to ISA
00198                         // bridge, aka south bridge.  See Microsoft KB274323.)
00199                         unsigned long elapsedTicks = GetTickCount() - mStartTick;
00200                         signed long msecOff = (signed long)(msecTicks - elapsedTicks);
00201                         if (msecOff < -100 || msecOff > 100)
00202                         {
00203                                 // Adjust the starting time forwards.
00204                                 LONGLONG msecAdjustment = mymin(msecOff *
00205                                         mClockFrequency.QuadPart / 1000, elapsedTime -
00206                                         mPrevElapsedTime);
00207                                 mStartTime.QuadPart += msecAdjustment;
00208                                 elapsedTime -= msecAdjustment;
00209                         }
00210
00211                         // Store the current elapsed time for adjustments next time.
00212                         mPrevElapsedTime = elapsedTime;
00213
00214                         // Convert to microseconds.
00215                         unsigned long usecTicks = (unsigned long)(1000000 * elapsedTime /
00216                                 mClockFrequency.QuadPart);
00217
00218                         return usecTicks;
00219 #else
00220
00221 #ifdef __PPU__
00222         __int64 freq=sys_time_get_timebase_frequency();
00223          double dFreq=((double) freq)/ 1000000.0;
00224         typedef uint64_t __int64;
00225         typedef __int64  ClockSize;
00226         ClockSize newTime;
00227         __asm __volatile__( "mftb %0" : "=r" (newTime) : : "memory");
00228
00229         return (newTime-mStartTime) / dFreq;
00230 #else
00231
00232                         struct timeval currentTime;
00233                         gettimeofday(&currentTime, NULL);
00234                         return (currentTime.tv_sec - mStartTime.tv_sec) * 1000000 +
00235                                 (currentTime.tv_usec - mStartTime.tv_usec);
00236 #endif//__PPU__
00237 #endif
00238                 }
00239
00240         private:
00241 #ifdef USE_WINDOWS_TIMERS
00242                 LARGE_INTEGER mClockFrequency;
00243                 DWORD mStartTick;
00244                 LONGLONG mPrevElapsedTime;
00245                 LARGE_INTEGER mStartTime;
00246 #else
00247 #ifdef __PPU__
00248                 uint64_t        mStartTime;
00249 #else
00250                 struct timeval mStartTime;
00251 #endif
00252 #endif //__PPU__
00253
00254         };
00255 };
00256
00258 class Profiler
00259 {
00260 public:
00262         enum BlockTimingMethod
00263         {
00266                 BLOCK_TOTAL_SECONDS,
00267
00270                 BLOCK_TOTAL_MILLISECONDS,
00271
00274                 BLOCK_TOTAL_MICROSECONDS,
00275
00278                 BLOCK_TOTAL_PERCENT,
00279
00282                 BLOCK_CYCLE_SECONDS,
00283
00286                 BLOCK_CYCLE_MILLISECONDS,
00287
00290                 BLOCK_CYCLE_MICROSECONDS,
00291
00294                 BLOCK_CYCLE_PERCENT
00295         };
00296
00305         inline static void init(const std::string outputFilename="",
00306                 BlockTimingMethod outputMethod=BLOCK_CYCLE_MILLISECONDS);
00307
00309         inline static void destroy();
00310
00312         inline static void beginBlock(const std::string& name);
00313
00317         inline static void endBlock(const std::string& name);
00318
00321         inline static double getBlockTime(const std::string& name,
00322                 BlockTimingMethod method=BLOCK_CYCLE_MILLISECONDS);
00323
00327         inline static void endProfilingCycle();
00328
00332         inline static std::string createStatsString(
00333                 BlockTimingMethod method=BLOCK_TOTAL_PERCENT);
00334
00335 //private:
00336         inline Profiler();
00337
00338         inline ~Profiler();
00339
00341         inline static void printError(const std::string& msg)
00342         {
00343                 std::cout << "[QuickProf error] " << msg << std::endl;
00344         }
00345
00347         static bool mEnabled;
00348
00350         static hidden::Clock mClock;
00351
00353         static unsigned long int mCurrentCycleStartMicroseconds;
00354
00356         static unsigned long int mLastCycleDurationMicroseconds;
00357
00359         static std::map<std::string, hidden::ProfileBlock*> mProfileBlocks;
00360
00362         static std::ofstream mOutputFile;
00363
00365         static bool mFirstFileOutput;
00366
00368         static BlockTimingMethod mFileOutputMethod;
00369
00371         static unsigned long int mCycleNumber;
00372 };
00373
00374
00375 Profiler::Profiler()
00376 {
00377         // This never gets called because a Profiler instance is never
00378         // created.
00379 }
00380
00381 Profiler::~Profiler()
00382 {
00383         // This never gets called because a Profiler instance is never
00384         // created.
00385 }
00386
00387 void Profiler::init(const std::string outputFilename,
00388         BlockTimingMethod outputMethod)
00389 {
00390         mEnabled = true;
00391
00392         if (!outputFilename.empty())
00393         {
00394                 mOutputFile.open(outputFilename.c_str());
00395         }
00396
00397         mFileOutputMethod = outputMethod;
00398
00399         mClock.reset();
00400
00401         // Set the start time for the first cycle.
00402         mCurrentCycleStartMicroseconds = mClock.getTimeMicroseconds();
00403 }
00404
00405 void Profiler::destroy()
00406 {
00407         if (!mEnabled)
00408         {
00409                 return;
00410         }
00411
00412         if (mOutputFile.is_open())
00413         {
00414                 mOutputFile.close();
00415         }
00416
00417         // Destroy all ProfileBlocks.
00418         while (!mProfileBlocks.empty())
00419         {
00420                 delete (*mProfileBlocks.begin()).second;
00421                 mProfileBlocks.erase(mProfileBlocks.begin());
00422         }
00423 }
00424
00425 void Profiler::beginBlock(const std::string& name)
00426 {
00427         if (!mEnabled)
00428         {
00429                 return;
00430         }
00431
00432         if (name.empty())
00433         {
00434                 printError("Cannot allow unnamed profile blocks.");
00435                 return;
00436         }
00437
00438         hidden::ProfileBlock* block = mProfileBlocks[name];
00439
00440         if (!block)
00441         {
00442                 // Create a new ProfileBlock.
00443                 mProfileBlocks[name] = new hidden::ProfileBlock();
00444                 block = mProfileBlocks[name];
00445         }
00446
00447         // We do this at the end to get more accurate results.
00448         block->currentBlockStartMicroseconds = mClock.getTimeMicroseconds();
00449 }
00450
00451 void Profiler::endBlock(const std::string& name)
00452 {
00453         if (!mEnabled)
00454         {
00455                 return;
00456         }
00457
00458         // We do this at the beginning to get more accurate results.
00459         unsigned long int endTick = mClock.getTimeMicroseconds();
00460
00461         hidden::ProfileBlock* block = mProfileBlocks[name];
00462
00463         if (!block)
00464         {
00465                 // The named block does not exist.  Print an error.
00466                 printError("The profile block named '" + name +
00467                         "' does not exist.");
00468                 return;
00469         }
00470
00471         unsigned long int blockDuration = endTick -
00472                 block->currentBlockStartMicroseconds;
00473         block->currentCycleTotalMicroseconds += blockDuration;
00474         block->totalMicroseconds += blockDuration;
00475 }
00476
00477 double Profiler::getBlockTime(const std::string& name,
00478         BlockTimingMethod method)
00479 {
00480         if (!mEnabled)
00481         {
00482                 return 0;
00483         }
00484
00485         hidden::ProfileBlock* block = mProfileBlocks[name];
00486
00487         if (!block)
00488         {
00489                 // The named block does not exist.  Print an error.
00490                 printError("The profile block named '" + name +
00491                         "' does not exist.");
00492                 return 0;
00493         }
00494
00495         double result = 0;
00496
00497         switch(method)
00498         {
00499                 case BLOCK_TOTAL_SECONDS:
00500                         result = (double)block->totalMicroseconds * (double)0.000001;
00501                         break;
00502                 case BLOCK_TOTAL_MILLISECONDS:
00503                         result = (double)block->totalMicroseconds * (double)0.001;
00504                         break;
00505                 case BLOCK_TOTAL_MICROSECONDS:
00506                         result = (double)block->totalMicroseconds;
00507                         break;
00508                 case BLOCK_TOTAL_PERCENT:
00509                 {
00510                         double timeSinceInit = (double)mClock.getTimeMicroseconds();
00511                         if (timeSinceInit <= 0)
00512                         {
00513                                 result = 0;
00514                         }
00515                         else
00516                         {
00517                                 result = 100.0 * (double)block->totalMicroseconds /
00518                                         timeSinceInit;
00519                         }
00520                         break;
00521                 }
00522                 case BLOCK_CYCLE_SECONDS:
00523                         result = (double)block->lastCycleTotalMicroseconds *
00524                                 (double)0.000001;
00525                         break;
00526                 case BLOCK_CYCLE_MILLISECONDS:
00527                         result = (double)block->lastCycleTotalMicroseconds *
00528                                 (double)0.001;
00529                         break;
00530                 case BLOCK_CYCLE_MICROSECONDS:
00531                         result = (double)block->lastCycleTotalMicroseconds;
00532                         break;
00533                 case BLOCK_CYCLE_PERCENT:
00534                 {
00535                         if (0 == mLastCycleDurationMicroseconds)
00536                         {
00537                                 // We have not yet finished a cycle, so just return zero
00538                                 // percent to avoid a divide by zero error.
00539                                 result = 0;
00540                         }
00541                         else
00542                         {
00543                                 result = 100.0 * (double)block->lastCycleTotalMicroseconds /
00544                                         mLastCycleDurationMicroseconds;
00545                         }
00546                         break;
00547                 }
00548                 default:
00549                         break;
00550         }
00551
00552         return result;
00553 }
00554
00555 void Profiler::endProfilingCycle()
00556 {
00557         if (!mEnabled)
00558         {
00559                 return;
00560         }
00561
00562         // Store the duration of the cycle that just finished.
00563         mLastCycleDurationMicroseconds = mClock.getTimeMicroseconds() -
00564                 mCurrentCycleStartMicroseconds;
00565
00566         // For each block, update data for the cycle that just finished.
00567         std::map<std::string, hidden::ProfileBlock*>::iterator iter;
00568         for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end(); ++iter)
00569         {
00570                 hidden::ProfileBlock* block = (*iter).second;
00571                 block->lastCycleTotalMicroseconds =
00572                         block->currentCycleTotalMicroseconds;
00573                 block->currentCycleTotalMicroseconds = 0;
00574         }
00575
00576         if (mOutputFile.is_open())
00577         {
00578                 // Print data to the output file.
00579                 if (mFirstFileOutput)
00580                 {
00581                         // On the first iteration, print a header line that shows the
00582                         // names of each profiling block.
00583                         mOutputFile << "#cycle; ";
00584
00585                         for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end();
00586                                 ++iter)
00587                         {
00588                                 mOutputFile << (*iter).first << "; ";
00589                         }
00590
00591                         mOutputFile << std::endl;
00592                         mFirstFileOutput = false;
00593                 }
00594
00595                 mOutputFile << mCycleNumber << "; ";
00596
00597                 for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end();
00598                         ++iter)
00599                 {
00600                         mOutputFile << getBlockTime((*iter).first, mFileOutputMethod)
00601                                 << "; ";
00602                 }
00603
00604                 mOutputFile << std::endl;
00605         }
00606
00607         ++mCycleNumber;
00608         mCurrentCycleStartMicroseconds = mClock.getTimeMicroseconds();
00609 }
00610
00611 std::string Profiler::createStatsString(BlockTimingMethod method)
00612 {
00613         if (!mEnabled)
00614         {
00615                 return "";
00616         }
00617
00618         std::string s;
00619         std::string suffix;
00620
00621         switch(method)
00622         {
00623                 case BLOCK_TOTAL_SECONDS:
00624                         suffix = "s";
00625                         break;
00626                 case BLOCK_TOTAL_MILLISECONDS:
00627                         suffix = "ms";
00628                         break;
00629                 case BLOCK_TOTAL_MICROSECONDS:
00630                         suffix = "us";
00631                         break;
00632                 case BLOCK_TOTAL_PERCENT:
00633                 {
00634                         suffix = "%";
00635                         break;
00636                 }
00637                 case BLOCK_CYCLE_SECONDS:
00638                         suffix = "s";
00639                         break;
00640                 case BLOCK_CYCLE_MILLISECONDS:
00641                         suffix = "ms";
00642                         break;
00643                 case BLOCK_CYCLE_MICROSECONDS:
00644                         suffix = "us";
00645                         break;
00646                 case BLOCK_CYCLE_PERCENT:
00647                 {
00648                         suffix = "%";
00649                         break;
00650                 }
00651                 default:
00652                         break;
00653         }
00654
00655         std::map<std::string, hidden::ProfileBlock*>::iterator iter;
00656         for (iter = mProfileBlocks.begin(); iter != mProfileBlocks.end(); ++iter)
00657         {
00658                 if (iter != mProfileBlocks.begin())
00659                 {
00660                         s += "\n";
00661                 }
00662
00663                 char blockTime[64];
00664                 sprintf(blockTime, "%lf", getBlockTime((*iter).first, method));
00665
00666                 s += (*iter).first;
00667                 s += ": ";
00668                 s += blockTime;
00669                 s += " ";
00670                 s += suffix;
00671         }
00672
00673         return s;
00674 }
00675
00676 #endif
00677
00678 #endif //USE_QUICKPROF
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RaycastCallback.cpp File Reference

Bullet » NarrowPhaseCollision

RaycastCallback.cpp File Reference

#include "RaycastCallback.h"

Include dependency graph for RaycastCallback.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:31 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RaycastCallback.cpp Source File

Bullet » NarrowPhaseCollision

RaycastCallback.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "RaycastCallback.h"
00018
00019 TriangleRaycastCallback::TriangleRaycastCallback(const SimdVector3& from,const SimdVector3& to)
00020         :
00021         m_from(from),
00022         m_to(to),
00023         m_hitFraction(1.f)
00024 {
00025
00026 }
00027
00028
00029
00030 void TriangleRaycastCallback::ProcessTriangle(SimdVector3* triangle,int partId, int triangleIndex)
00031 {
00032
00033
00034         const SimdVector3 &vert0=triangle[0];
00035         const SimdVector3 &vert1=triangle[1];
00036         const SimdVector3 &vert2=triangle[2];
00037
00038         SimdVector3 v10; v10 = vert1 - vert0 ;
00039         SimdVector3 v20; v20 = vert2 - vert0 ;
00040
00041         SimdVector3 triangleNormal; triangleNormal = v10.cross( v20 );
00042
00043         const float dist = vert0.dot(triangleNormal);
00044         float dist_a = triangleNormal.dot(m_from) ;
00045         dist_a-= dist;
00046         float dist_b = triangleNormal.dot(m_to);
00047         dist_b -= dist;
00048
00049         if ( dist_a * dist_b >= 0.0f)
00050         {
00051                 return ; // same sign
00052         }
00053
00054         const float proj_length=dist_a-dist_b;
00055         const float distance = (dist_a)/(proj_length);
00056         // Now we have the intersection point on the plane, we'll see if it's inside the triangle
00057         // Add an epsilon as a tolerance for the raycast,
00058         // in case the ray hits exacly on the edge of the triangle.
00059         // It must be scaled for the triangle size.
00060
00061         if(distance < m_hitFraction)
00062         {
00063
00064
00065                 float edge_tolerance =triangleNormal.length2();
00066                 edge_tolerance *= -0.0001f;
00067                 SimdVector3 point; point.setInterpolate3( m_from, m_to, distance);
00068                 {
00069                         SimdVector3 v0p; v0p = vert0 - point;
00070                         SimdVector3 v1p; v1p = vert1 - point;
00071                         SimdVector3 cp0; cp0 = v0p.cross( v1p );
00072
00073                         if ( (float)(cp0.dot(triangleNormal)) >=edge_tolerance)
00074                         {
00075
00076
00077                                 SimdVector3 v2p; v2p = vert2 -  point;
00078                                 SimdVector3 cp1;
00079                                 cp1 = v1p.cross( v2p);
00080                                 if ( (float)(cp1.dot(triangleNormal)) >=edge_tolerance)
00081                                 {
00082                                         SimdVector3 cp2;
00083                                         cp2 = v2p.cross(v0p);
00084
00085                                         if ( (float)(cp2.dot(triangleNormal)) >=edge_tolerance)
00086                                         {
00087
00088                                                 if ( dist_a > 0 )
00089                                                 {
00090                                                         m_hitFraction = ReportHit(triangleNormal,distance,partId,triangleIndex);
00091                                                 }
00092                                                 else
00093                                                 {
00094                                                         m_hitFraction = ReportHit(-triangleNormal,distance,partId,triangleIndex);
00095                                                 }
00096                                         }
00097                                 }
00098                         }
00099                 }
00100         }
00101 }
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RaycastCallback.h File Reference

Bullet » NarrowPhaseCollision

RaycastCallback.h File Reference

#include "CollisionShapes/TriangleCallback.h"

Include dependency graph for RaycastCallback.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class TriangleRaycastCallback

Generated on Wed May 24 13:59:31 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RaycastCallback.h Source File

Bullet » NarrowPhaseCollision

RaycastCallback.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef RAYCAST_TRI_CALLBACK_H
00017 #define RAYCAST_TRI_CALLBACK_H
00018
00019 #include "CollisionShapes/TriangleCallback.h"
00020 struct BroadphaseProxy;
00021
00022
00023 class  TriangleRaycastCallback: public TriangleCallback
00024 {
00025 public:
00026
00027                 //input
00028         SimdVector3 m_from;
00029         SimdVector3 m_to;
00030
00031         float   m_hitFraction;
00032
00033         TriangleRaycastCallback(const SimdVector3& from,const SimdVector3& to);
00034
00035         virtual void ProcessTriangle(SimdVector3* triangle, int partId, int triangleIndex);
00036
00037         virtual float ReportHit(const SimdVector3& hitNormalLocal, float hitFraction, int partId, int triangleIndex ) = 0;
00038
00039 };
00040
00041 #endif //RAYCAST_TRI_CALLBACK_H
00042
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RigidBody.cpp File Reference

BulletDynamics » Dynamics

RigidBody.cpp File Reference

#include "RigidBody.h"
#include "MassProps.h"
#include "CollisionShapes/ConvexShape.h"
#include "GEN_MinMax.h"
#include <SimdTransformUtil.h>
#include <stdio.h>

Include dependency graph for RigidBody.cpp:

Go to the source code of this file.

Defines

#define | FORCE_VELOCITY_DAMPING 1
#define | MAX_ANGVEL SIMD_HALF_PI

Variables

float | gLinearAirDamping = 1.f
static int | uniqueId = 0

Define Documentation

#define FORCE_VELOCITY_DAMPING 1

#define MAX_ANGVEL SIMD_HALF_PI

Referenced by RigidBody::integrateVelocities().

Variable Documentation

float gLinearAirDamping = 1.f

Definition at line 22 of file RigidBody.cpp.

Referenced by RigidBody::applyForces(), and CcdPhysicsEnvironment::setLinearAirDamping().

int uniqueId = 0 [static]

Definition at line 24 of file RigidBody.cpp.

Referenced by RigidBody::RigidBody().

Generated on Wed May 24 13:59:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RigidBody.cpp Source File

BulletDynamics » Dynamics

RigidBody.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "RigidBody.h"
00017 #include "MassProps.h"
00018 #include "CollisionShapes/ConvexShape.h"
00019 #include "GEN_MinMax.h"
00020 #include <SimdTransformUtil.h>
00021
00022 float gLinearAirDamping = 1.f;
00023
00024 static int uniqueId = 0;
00025
00026 RigidBody::RigidBody( const MassProps& massProps,SimdScalar linearDamping,SimdScalar angularDamping,SimdScalar friction,SimdScalar restitution)
00027 :
00028         m_gravity(0.0f, 0.0f, 0.0f),
00029         m_totalForce(0.0f, 0.0f, 0.0f),
00030         m_totalTorque(0.0f, 0.0f, 0.0f),
00031         m_linearVelocity(0.0f, 0.0f, 0.0f),
00032         m_angularVelocity(0.f,0.f,0.f),
00033         m_linearDamping(0.f),
00034         m_angularDamping(0.5f),
00035         m_friction(friction),
00036         m_restitution(restitution),
00037         m_kinematicTimeStep(0.f)
00038 {
00039         m_debugBodyId = uniqueId++;
00040
00041         setMassProps(massProps.m_mass, massProps.m_inertiaLocal);
00042     setDamping(linearDamping, angularDamping);
00043         m_worldTransform.setIdentity();
00044         updateInertiaTensor();
00045
00046 }
00047
00048
00049 void RigidBody::setLinearVelocity(const SimdVector3& lin_vel)
00050 {
00051
00052         m_linearVelocity = lin_vel;
00053 }
00054
00055
00056 void RigidBody::predictIntegratedTransform(SimdScalar timeStep,SimdTransform& predictedTransform) const
00057 {
00058         SimdTransformUtil::IntegrateTransform(m_worldTransform,m_linearVelocity,m_angularVelocity,timeStep,predictedTransform);
00059 }
00060
00061 void                    RigidBody::saveKinematicState(SimdScalar timeStep)
00062 {
00063
00064         if (m_kinematicTimeStep)
00065         {
00066                 SimdVector3 linVel,angVel;
00067                 SimdTransformUtil::CalculateVelocity(m_interpolationWorldTransform,m_worldTransform,m_kinematicTimeStep,m_linearVelocity,m_angularVelocity);
00068                 //printf("angular = %f %f %f\n",m_angularVelocity.getX(),m_angularVelocity.getY(),m_angularVelocity.getZ());
00069         }
00070
00071
00072         m_interpolationWorldTransform = m_worldTransform;
00073
00074         m_kinematicTimeStep = timeStep;
00075 }
00076
00077 void    RigidBody::getAabb(SimdVector3& aabbMin,SimdVector3& aabbMax) const
00078 {
00079         GetCollisionShape()->GetAabb(m_worldTransform,aabbMin,aabbMax);
00080 }
00081
00082
00083
00084
00085 void RigidBody::setGravity(const SimdVector3& acceleration)
00086 {
00087         if (m_inverseMass != 0.0f)
00088         {
00089                 m_gravity = acceleration * (1.0f / m_inverseMass);
00090         }
00091 }
00092
00093
00094
00095
00096
00097
00098 void RigidBody::setDamping(SimdScalar lin_damping, SimdScalar ang_damping)
00099 {
00100         m_linearDamping = GEN_clamped(lin_damping, 0.0f, 1.0f);
00101         m_angularDamping = GEN_clamped(ang_damping, 0.0f, 1.0f);
00102 }
00103
00104
00105
00106 #include <stdio.h>
00107
00108
00109 void RigidBody::applyForces(SimdScalar step)
00110 {
00111         if (IsStatic())
00112                 return;
00113
00114
00115         applyCentralForce(m_gravity);
00116
00117         m_linearVelocity *= GEN_clamped((1.f - step * gLinearAirDamping * m_linearDamping), 0.0f, 1.0f);
00118         m_angularVelocity *= GEN_clamped((1.f - step * m_angularDamping), 0.0f, 1.0f);
00119
00120 #define FORCE_VELOCITY_DAMPING 1
00121 #ifdef FORCE_VELOCITY_DAMPING
00122         float speed = m_linearVelocity.length();
00123         if (speed < m_linearDamping)
00124         {
00125                 float dampVel = 0.005f;
00126                 if (speed > dampVel)
00127                 {
00128                         SimdVector3 dir = m_linearVelocity.normalized();
00129                         m_linearVelocity -=  dir * dampVel;
00130                 } else
00131                 {
00132                         m_linearVelocity.setValue(0.f,0.f,0.f);
00133                 }
00134         }
00135
00136         float angSpeed = m_angularVelocity.length();
00137         if (angSpeed < m_angularDamping)
00138         {
00139                 float angDampVel = 0.005f;
00140                 if (angSpeed > angDampVel)
00141                 {
00142                         SimdVector3 dir = m_angularVelocity.normalized();
00143                         m_angularVelocity -=  dir * angDampVel;
00144                 } else
00145                 {
00146                         m_angularVelocity.setValue(0.f,0.f,0.f);
00147                 }
00148         }
00149 #endif //FORCE_VELOCITY_DAMPING
00150
00151 }
00152
00153 void RigidBody::proceedToTransform(const SimdTransform& newTrans)
00154 {
00155         setCenterOfMassTransform( newTrans );
00156 }
00157
00158
00159 void RigidBody::setMassProps(SimdScalar mass, const SimdVector3& inertia)
00160 {
00161         if (mass == 0.f)
00162         {
00163                 m_collisionFlags = CollisionObject::isStatic;
00164                 m_inverseMass = 0.f;
00165         } else
00166         {
00167                 m_collisionFlags = 0;
00168                 m_inverseMass = 1.0f / mass;
00169         }
00170
00171
00172         m_invInertiaLocal.setValue(inertia[0] != 0.0f ? 1.0f / inertia[0]: 0.0f,
00173                                                    inertia[1] != 0.0f ? 1.0f / inertia[1]: 0.0f,
00174                                                    inertia[2] != 0.0f ? 1.0f / inertia[2]: 0.0f);
00175
00176 }
00177
00178
00179
00180 void RigidBody::updateInertiaTensor()
00181 {
00182         m_invInertiaTensorWorld = m_worldTransform.getBasis().scaled(m_invInertiaLocal) * m_worldTransform.getBasis().transpose();
00183 }
00184
00185
00186 void RigidBody::integrateVelocities(SimdScalar step)
00187 {
00188         if (IsStatic())
00189                 return;
00190
00191         m_linearVelocity += m_totalForce * (m_inverseMass * step);
00192         m_angularVelocity += m_invInertiaTensorWorld * m_totalTorque * step;
00193
00194 #define MAX_ANGVEL SIMD_HALF_PI
00196         float angvel = m_angularVelocity.length();
00197         if (angvel*step > MAX_ANGVEL)
00198         {
00199                 m_angularVelocity *= (MAX_ANGVEL/step) /angvel;
00200         }
00201
00202         clearForces();
00203 }
00204
00205 SimdQuaternion RigidBody::getOrientation() const
00206 {
00207                 SimdQuaternion orn;
00208                 m_worldTransform.getBasis().getRotation(orn);
00209                 return orn;
00210 }
00211
00212
00213 void RigidBody::setCenterOfMassTransform(const SimdTransform& xform)
00214 {
00215         m_worldTransform = xform;
00216         updateInertiaTensor();
00217 }
00218
00219
00220
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RigidBody.h File Reference

BulletDynamics » Dynamics

RigidBody.h File Reference

#include <vector>
#include <SimdPoint3.h>
#include <SimdTransform.h>
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "CollisionDispatch/CollisionObject.h"

Include dependency graph for RigidBody.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | RigidBody
RigidBody class for RigidBody Dynamics. More...

Defines

#define | MAX_RIGIDBODIES 8192

Typedefs

typedef SimdScalar | dMatrix3 [4 *3]

Variables

float | gLinearAirDamping
bool | gUseEpa

Define Documentation

#define MAX_RIGIDBODIES 8192

Definition at line 34 of file RigidBody.h.

Referenced by OdeConstraintSolver::SolveGroup().

Typedef Documentation

typedef SimdScalar dMatrix3[4 *3]

Definition at line 28 of file RigidBody.h.

Variable Documentation

float gLinearAirDamping

Definition at line 22 of file RigidBody.cpp.

Referenced by RigidBody::applyForces(), and CcdPhysicsEnvironment::setLinearAirDamping().

bool gUseEpa

Definition at line 62 of file ConvexConvexAlgorithm.cpp.

Referenced by ConvexConvexAlgorithm::CheckPenetrationDepthSolver(), and CcdPhysicsEnvironment::setUseEpa().

Generated on Wed May 24 13:59:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RigidBody.h Source File

BulletDynamics » Dynamics

RigidBody.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef RIGIDBODY_H
00017 #define RIGIDBODY_H
00018
00019 #include <vector>
00020 #include <SimdPoint3.h>
00021 #include <SimdTransform.h>
00022 #include "BroadphaseCollision/BroadphaseProxy.h"
00023
00024
00025 #include "CollisionDispatch/CollisionObject.h"
00026
00027 class CollisionShape;
00028 struct MassProps;
00029 typedef SimdScalar dMatrix3[4*3];
00030
00031 extern float gLinearAirDamping;
00032 extern bool gUseEpa;
00033
00034 #define MAX_RIGIDBODIES 8192
00035
00036
00039 class RigidBody  : public CollisionObject
00040 {
00041 public:
00042
00043         RigidBody(const MassProps& massProps,SimdScalar linearDamping,SimdScalar angularDamping,SimdScalar friction,SimdScalar restitution);
00044
00045         void                    proceedToTransform(const SimdTransform& newTrans);
00046
00047
00049         void                    predictIntegratedTransform(SimdScalar step, SimdTransform& predictedTransform) const;
00050
00051         void                    saveKinematicState(SimdScalar step);
00052
00053
00054         void                    applyForces(SimdScalar step);
00055
00056         void                    setGravity(const SimdVector3& acceleration);
00057
00058         void                    setDamping(SimdScalar lin_damping, SimdScalar ang_damping);
00059
00060         inline const CollisionShape*    GetCollisionShape() const {
00061                 return m_collisionShape;
00062         }
00063
00064         inline CollisionShape*  GetCollisionShape() {
00065                         return m_collisionShape;
00066         }
00067
00068         void                    setMassProps(SimdScalar mass, const SimdVector3& inertia);
00069
00070         SimdScalar              getInvMass() const { return m_inverseMass; }
00071         const SimdMatrix3x3& getInvInertiaTensorWorld() const {
00072                 return m_invInertiaTensorWorld;
00073         }
00074
00075         void                    integrateVelocities(SimdScalar step);
00076
00077         void                    setCenterOfMassTransform(const SimdTransform& xform);
00078
00079         void                    applyCentralForce(const SimdVector3& force)
00080         {
00081                 m_totalForce += force;
00082         }
00083
00084         const SimdVector3& getInvInertiaDiagLocal()
00085         {
00086                 return m_invInertiaLocal;
00087         };
00088
00089         void    setInvInertiaDiagLocal(const SimdVector3& diagInvInertia)
00090         {
00091                 m_invInertiaLocal = diagInvInertia;
00092         }
00093
00094         void    applyTorque(const SimdVector3& torque)
00095         {
00096                 m_totalTorque += torque;
00097         }
00098
00099         void    applyForce(const SimdVector3& force, const SimdVector3& rel_pos)
00100         {
00101                 applyCentralForce(force);
00102                 applyTorque(rel_pos.cross(force));
00103         }
00104
00105         void applyCentralImpulse(const SimdVector3& impulse)
00106         {
00107                 m_linearVelocity += impulse * m_inverseMass;
00108         }
00109
00110         void applyTorqueImpulse(const SimdVector3& torque)
00111         {
00112                 if (!IsStatic())
00113                         m_angularVelocity += m_invInertiaTensorWorld * torque;
00114
00115         }
00116
00117         void applyImpulse(const SimdVector3& impulse, const SimdVector3& rel_pos)
00118         {
00119                 if (m_inverseMass != 0.f)
00120                 {
00121                         applyCentralImpulse(impulse);
00122                         applyTorqueImpulse(rel_pos.cross(impulse));
00123                 }
00124         }
00125
00126         void clearForces()
00127         {
00128                 m_totalForce.setValue(0.0f, 0.0f, 0.0f);
00129                 m_totalTorque.setValue(0.0f, 0.0f, 0.0f);
00130         }
00131
00132         void updateInertiaTensor();
00133
00134         const SimdPoint3&     getCenterOfMassPosition() const {
00135                 return m_worldTransform.getOrigin();
00136         }
00137         SimdQuaternion getOrientation() const;
00138
00139         const SimdTransform&  getCenterOfMassTransform() const {
00140                 return m_worldTransform;
00141         }
00142         const SimdVector3&   getLinearVelocity() const {
00143                 return m_linearVelocity;
00144         }
00145         const SimdVector3&    getAngularVelocity() const {
00146                 return m_angularVelocity;
00147         }
00148
00149
00150         void setLinearVelocity(const SimdVector3& lin_vel);
00151         void setAngularVelocity(const SimdVector3& ang_vel) {
00152                 if (!IsStatic())
00153                 {
00154                         m_angularVelocity = ang_vel;
00155                 }
00156         }
00157
00158         SimdVector3 getVelocityInLocalPoint(const SimdVector3& rel_pos) const
00159         {
00160                 //we also calculate lin/ang velocity for kinematic objects
00161                 return m_linearVelocity + m_angularVelocity.cross(rel_pos);
00162
00163                 //for kinematic objects, we could also use use:
00164                 //              return  (m_worldTransform(rel_pos) - m_interpolationWorldTransform(rel_pos)) / m_kinematicTimeStep;
00165         }
00166
00167         void translate(const SimdVector3& v)
00168         {
00169                 m_worldTransform.getOrigin() += v;
00170         }
00171
00172
00173         void    getAabb(SimdVector3& aabbMin,SimdVector3& aabbMax) const;
00174
00175
00176         void    setRestitution(float rest)
00177         {
00178                 m_restitution = rest;
00179         }
00180         float   getRestitution() const
00181         {
00182                 return m_restitution;
00183         }
00184         void    setFriction(float frict)
00185         {
00186                 m_friction = frict;
00187         }
00188         float   getFriction() const
00189         {
00190                 return m_friction;
00191         }
00192
00193
00194         inline float ComputeImpulseDenominator(const SimdPoint3& pos, const SimdVector3& normal) const
00195         {
00196                 SimdVector3 r0 = pos - getCenterOfMassPosition();
00197
00198                 SimdVector3 c0 = (r0).cross(normal);
00199
00200                 SimdVector3 vec = (c0 * getInvInertiaTensorWorld()).cross(r0);
00201
00202                 return m_inverseMass + normal.dot(vec);
00203
00204         }
00205
00206         inline float ComputeAngularImpulseDenominator(const SimdVector3& axis) const
00207         {
00208                 SimdVector3 vec = axis * getInvInertiaTensorWorld();
00209                 return axis.dot(vec);
00210         }
00211
00212
00213
00214 private:
00215
00216         SimdMatrix3x3   m_invInertiaTensorWorld;
00217         SimdVector3             m_gravity;
00218         SimdVector3             m_invInertiaLocal;
00219         SimdVector3             m_totalForce;
00220         SimdVector3             m_totalTorque;
00221 //      SimdQuaternion  m_orn1;
00222
00223         SimdVector3             m_linearVelocity;
00224
00225         SimdVector3             m_angularVelocity;
00226
00227         SimdScalar              m_linearDamping;
00228         SimdScalar              m_angularDamping;
00229         SimdScalar              m_inverseMass;
00230
00231         SimdScalar              m_friction;
00232         SimdScalar              m_restitution;
00233
00234         SimdScalar              m_kinematicTimeStep;
00235
00236         BroadphaseProxy*        m_broadphaseProxy;
00237
00238
00239
00240
00241
00242
00243 public:
00244         const BroadphaseProxy*  GetBroadphaseProxy() const
00245         {
00246                 return m_broadphaseProxy;
00247         }
00248         BroadphaseProxy*        GetBroadphaseProxy()
00249         {
00250                 return m_broadphaseProxy;
00251         }
00252         void    SetBroadphaseProxy(BroadphaseProxy* broadphaseProxy)
00253         {
00254                 m_broadphaseProxy = broadphaseProxy;
00255         }
00256
00257
00259         dMatrix3                m_R;//temp
00260         dMatrix3                m_I;
00261         dMatrix3                m_invI;
00262
00263         int                             m_odeTag;
00264         float           m_padding[1024];
00265         SimdVector3             m_tacc;//temp
00266         SimdVector3             m_facc;
00267
00268
00269         int     m_debugBodyId;
00270 };
00271
00272
00273
00274 #endif
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Scalar.cpp File Reference

LinearMath

Scalar.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Scalar.cpp Source File

LinearMath

Scalar.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Scalar.cpp
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifdef WIN32
00018 #if _MSC_VER >= 1310
00019
00020 #include "Scalar.h"
00021
00022 const Scalar Scalar::Consts::MinusOne(-1.0f);
00023 const Scalar Scalar::Consts::Zero(0.0f);
00024 const Scalar Scalar::Consts::Half(0.5f);
00025 const Scalar Scalar::Consts::One(1.0f);
00026 const Scalar Scalar::Consts::Three(3.0f);
00027
00028 const Scalar Scalar::Consts::MinValue(-3.402823466e+38f);
00029 const Scalar Scalar::Consts::MaxValue(3.402823466e+38f);
00030 const Scalar Scalar::Consts::Epsilon(1.192092896e-07f);
00031
00032 const Scalar Scalar::Consts::PosInfinity(0x7f800000, true);
00033 const Scalar Scalar::Consts::NegInfinity(0xff800000, true);
00034
00035 const Scalar Scalar::Consts::AbsMask(0x7fffffff, true);
00036
00037 #endif
00038 #endif //WIN32
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Scalar.h File Reference

LinearMath

Scalar.h File Reference

#include <xmmintrin.h>
#include "Memory2.h"
#include "Scalar.inl"

Include dependency graph for Scalar.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

__declspec (align(16)) class Scalar

Function Documentation

__declspec ( align(16) )

Definition at line 28 of file Scalar.h.

References operator *(), operator+(), operator-(), operator/(), and Maths::Zero.

Generated on Wed May 24 13:59:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Scalar.h Source File

LinearMath

Scalar.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Scalar.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifndef BULLET_SCALAR_H
00018 #define BULLET_SCALAR_H
00019
00020
00021 #include <xmmintrin.h>
00022 #include "Memory2.h"
00023
00024 // resolved overload found with Koenig lookup
00025 #pragma warning (disable : 4675)
00026
00027
00028 __declspec(align(16)) class Scalar
00029 {
00030 public:
00031         BULLET_ALIGNED_NEW_AND_DELETE
00032
00033         __m128 base;
00034
00035         // constants
00036         struct Consts{
00037                 static const Scalar
00038                         MinusOne,
00039                         Zero,
00040                         Half,
00041                         One,
00042                         Three,
00043                         MinValue,
00044                         MaxValue,
00045                         Epsilon,
00046                         NegInfinity,
00047                         PosInfinity,
00048                         AbsMask;
00049         };
00050
00051         // constructors
00052         Scalar();
00053         Scalar(float f);
00054         Scalar(int i, bool forceNoConvert);
00055
00056         // explicit constructors
00057         explicit Scalar(__m128 s);
00058         explicit Scalar(int i);
00059
00060         // assignment
00061         const Scalar& operator=(const Scalar& a);
00062
00063         // conversion
00064         operator const float() const;
00065         operator const float();
00066
00067         // in place operations
00068         void operator+=(const Scalar& b);
00069         void operator-=(const Scalar& b);
00070         void operator*=(const Scalar& b);
00071         void operator/=(const Scalar& b);
00072
00073         // operations
00074         friend const Scalar operator-(const Scalar& a);
00075
00076         friend const Scalar operator+(const Scalar& a, const Scalar& b);
00077         friend const Scalar operator-(const Scalar& a, const Scalar& b);
00078         friend const Scalar operator*(const Scalar& a, const Scalar& b);
00079         friend const Scalar operator/(const Scalar& a, const Scalar& b);
00080
00081         friend const Scalar Abs(const Scalar& a);
00082         friend const Scalar Rcp(const Scalar& a);
00083         friend const Scalar Rsqrt(const Scalar& a);
00084         friend const Scalar Sqrt(const Scalar& a);
00085         friend const Scalar RcpNr(const Scalar& a);
00086         friend const Scalar RsqrtNr(const Scalar& a);
00087
00088         friend const Scalar Min(const Scalar& a, const Scalar& b);
00089         friend const Scalar Max(const Scalar& a, const Scalar& b);
00090         friend const Scalar Clamp(const Scalar& a, const Scalar& min, const Scalar& max);
00091
00092         friend const Scalar Lerp(const Scalar& a, const Scalar& b, const Scalar& t);
00093
00094         // comparison
00095         friend const int IsNegative(const Scalar& a);
00096
00097         friend const int IsNan(const Scalar& a);
00098         friend const int IsInfinity(const Scalar& a);
00099         friend const int IsPosInfinity(const Scalar& a);
00100         friend const int IsNegInfinity(const Scalar& a);
00101 };
00102
00103
00104 #include "Scalar.inl"
00105
00106 #endif //BULLET_SCALAR_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Shape.cpp File Reference

Bullet » NarrowPhaseCollision

Shape.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Shape.cpp Source File

Bullet » NarrowPhaseCollision

Shape.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 //
00005 // Shape.cpp
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018
00019
00020 #ifdef WIN32
00021 #if _MSC_VER >= 1310
00022
00023 #include "shape.h"
00024
00025 Shape::Shape()
00026 {
00027 }
00028
00029 Shape::~Shape()
00030 {
00031 }
00032
00033 #endif
00034 #endif //WIN32
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Shape.h File Reference

Bullet » NarrowPhaseCollision

Shape.h File Reference

#include "Maths.h"

Include dependency graph for Shape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | Separation
class | Shape
Shape provides a interface for Hull class (convex hull calculation). More...

Generated on Wed May 24 13:59:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Shape.h Source File

Bullet » NarrowPhaseCollision

Shape.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 //
00005 // Shape.h
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018 //
00019 // Shape.h
00020 //
00021 #ifndef BULLET_SHAPE_H
00022 #define BULLET_SHAPE_H
00023
00024 #include "Maths.h"
00025
00026
00027
00028
00029 struct Separation
00030 {
00031
00032         short m_featureA;
00033         short m_featureB;
00034         float m_dist;
00035         Vector3 m_axis;         // in world space
00036
00037         // separators
00038         enum
00039         {
00040                 kFeatureNone,           // not separated
00041                 kFeatureA,
00042                 kFeatureB,
00043                 kFeatureBoth
00044         };
00045         short m_separator;
00046
00047         // contact between the 2 bodies (-1 if none)
00048         short m_contact;
00049 };
00050
00052 class Shape
00053 {
00054 public:
00055         Shape();
00056         virtual ~Shape();
00057
00058         //virtual void ComputeInertia(Point3& centerOfMass, Matrix33& inertia, float totalMass) const = 0;
00059         virtual void ComputeInertia(const Transform& transform, Point3& centerOfMass, Matrix33& inertia, float totalMass) const = 0;
00060
00061
00062         virtual Bounds3 ComputeBounds(const Transform& transform) const = 0;
00063 };
00064
00065
00066
00067 #endif //BULLET_SHAPE_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdMatrix3x3.h File Reference

LinearMath

SimdMatrix3x3.h File Reference

#include "SimdScalar.h"
#include "SimdVector3.h"
#include "SimdQuaternion.h"

Include dependency graph for SimdMatrix3x3.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | SimdMatrix3x3

Functions

SIMD_FORCE_INLINE SimdVector3 | operator * (const SimdMatrix3x3 &m, const SimdVector3 &v)
SIMD_FORCE_INLINE SimdVector3 | operator * (const SimdVector3 &v, const SimdMatrix3x3 &m)
SIMD_FORCE_INLINE SimdMatrix3x3 | operator * (const SimdMatrix3x3 &m1, const SimdMatrix3x3 &m2)
SIMD_FORCE_INLINE SimdMatrix3x3 | SimdMultTransposeLeft (const SimdMatrix3x3 &m1, const SimdMatrix3x3 &m2)

Function Documentation

SIMD_FORCE_INLINE SimdMatrix3x3 operator * | ( | const SimdMatrix3x3 & | m1,
 |  | const SimdMatrix3x3 & | m2
 | ) |

Definition at line 372 of file SimdMatrix3x3.h.

References SimdMatrix3x3::tdot().

SIMD_FORCE_INLINE SimdVector3 operator * | ( | const SimdVector3 & | v,
 |  | const SimdMatrix3x3 & | m
 | ) |

Definition at line 366 of file SimdMatrix3x3.h.

References SIMD_FORCE_INLINE, and SimdMatrix3x3::tdot().

SIMD_FORCE_INLINE SimdVector3 operator * | ( | const SimdMatrix3x3 & | m,
 |  | const SimdVector3 & | v
 | ) |

Definition at line 359 of file SimdMatrix3x3.h.

References dot().

Referenced by __declspec().

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMultTransposeLeft | ( | const SimdMatrix3x3 & | m1,
 |  | const SimdMatrix3x3 & | m2
 | ) |

Definition at line 381 of file SimdMatrix3x3.h.

Referenced by SimdTransform::multInverseLeft().

Generated on Wed May 24 13:59:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdMatrix3x3.h Source File

LinearMath

SimdMatrix3x3.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016 #ifndef SimdMatrix3x3_H
00017 #define SimdMatrix3x3_H
00018
00019 #include "SimdScalar.h"
00020
00021 #include "SimdVector3.h"
00022 #include "SimdQuaternion.h"
00023
00024
00025 class SimdMatrix3x3 {
00026         public:
00027                 SimdMatrix3x3 () {}
00028
00029 //              explicit SimdMatrix3x3(const SimdScalar *m) { setFromOpenGLSubMatrix(m); }
00030
00031                 explicit SimdMatrix3x3(const SimdQuaternion& q) { setRotation(q); }
00032                 /*
00033                 template <typename SimdScalar>
00034                 Matrix3x3(const SimdScalar& yaw, const SimdScalar& pitch, const SimdScalar& roll)
00035                 {
00036                         setEulerYPR(yaw, pitch, roll);
00037                 }
00038                 */
00039                 SimdMatrix3x3(const SimdScalar& xx, const SimdScalar& xy, const SimdScalar& xz,
00040                                   const SimdScalar& yx, const SimdScalar& yy, const SimdScalar& yz,
00041                                   const SimdScalar& zx, const SimdScalar& zy, const SimdScalar& zz)
00042                 {
00043                         setValue(xx, xy, xz,
00044                                          yx, yy, yz,
00045                                          zx, zy, zz);
00046                 }
00047
00048                 SimdVector3 getColumn(int i) const
00049                 {
00050                         return SimdVector3(m_el[0][i],m_el[1][i],m_el[2][i]);
00051                 }
00052
00053                 const SimdVector3& getRow(int i) const
00054                 {
00055                         return m_el[i];
00056                 }
00057
00058
00059                 SIMD_FORCE_INLINE SimdVector3&  operator[](int i)
00060                 {
00061                         assert(0 <= i && i < 3);
00062                         return m_el[i];
00063                 }
00064
00065                 const SimdVector3& operator[](int i) const
00066                 {
00067                         assert(0 <= i && i < 3);
00068                         return m_el[i];
00069                 }
00070
00071                 SimdMatrix3x3& operator*=(const SimdMatrix3x3& m);
00072
00073
00074         void setFromOpenGLSubMatrix(const SimdScalar *m)
00075                 {
00076                         m_el[0][0] = (m[0]);
00077                         m_el[1][0] = (m[1]);
00078                         m_el[2][0] = (m[2]);
00079                         m_el[0][1] = (m[4]);
00080                         m_el[1][1] = (m[5]);
00081                         m_el[2][1] = (m[6]);
00082                         m_el[0][2] = (m[8]);
00083                         m_el[1][2] = (m[9]);
00084                         m_el[2][2] = (m[10]);
00085                 }
00086
00087                 void setValue(const SimdScalar& xx, const SimdScalar& xy, const SimdScalar& xz,
00088                                           const SimdScalar& yx, const SimdScalar& yy, const SimdScalar& yz,
00089                                           const SimdScalar& zx, const SimdScalar& zy, const SimdScalar& zz)
00090                 {
00091                         m_el[0][0] = SimdScalar(xx);
00092                         m_el[0][1] = SimdScalar(xy);
00093                         m_el[0][2] = SimdScalar(xz);
00094                         m_el[1][0] = SimdScalar(yx);
00095                         m_el[1][1] = SimdScalar(yy);
00096                         m_el[1][2] = SimdScalar(yz);
00097                         m_el[2][0] = SimdScalar(zx);
00098                         m_el[2][1] = SimdScalar(zy);
00099                         m_el[2][2] = SimdScalar(zz);
00100                 }
00101
00102                 void setRotation(const SimdQuaternion& q)
00103                 {
00104                         SimdScalar d = q.length2();
00105                         assert(d != SimdScalar(0.0));
00106                         SimdScalar s = SimdScalar(2.0) / d;
00107                         SimdScalar xs = q[0] * s,   ys = q[1] * s,   zs = q[2] * s;
00108                         SimdScalar wx = q[3] * xs,  wy = q[3] * ys,  wz = q[3] * zs;
00109                         SimdScalar xx = q[0] * xs,  xy = q[0] * ys,  xz = q[0] * zs;
00110                         SimdScalar yy = q[1] * ys,  yz = q[1] * zs,  zz = q[2] * zs;
00111                         setValue(SimdScalar(1.0) - (yy + zz), xy - wz, xz + wy,
00112                                          xy + wz, SimdScalar(1.0) - (xx + zz), yz - wx,
00113                                          xz - wy, yz + wx, SimdScalar(1.0) - (xx + yy));
00114                 }
00115
00116
00117
00118                 void setEulerYPR(const SimdScalar& yaw, const SimdScalar& pitch, const SimdScalar& roll)
00119                 {
00120
00121                         SimdScalar cy(SimdCos(yaw));
00122                         SimdScalar  sy(SimdSin(yaw));
00123                         SimdScalar  cp(SimdCos(pitch));
00124                         SimdScalar  sp(SimdSin(pitch));
00125                         SimdScalar  cr(SimdCos(roll));
00126                         SimdScalar  sr(SimdSin(roll));
00127                         SimdScalar  cc = cy * cr;
00128                         SimdScalar  cs = cy * sr;
00129                         SimdScalar  sc = sy * cr;
00130                         SimdScalar  ss = sy * sr;
00131                         setValue(cc - sp * ss, -cs - sp * sc, -sy * cp,
00132                      cp * sr,       cp * cr,      -sp,
00133                                          sc + sp * cs, -ss + sp * cc,  cy * cp);
00134
00135                 }
00136
00145         void setEulerZYX(SimdScalar eulerX,SimdScalar eulerY,SimdScalar eulerZ) {
00146                 SimdScalar ci ( SimdCos(eulerX));
00147                 SimdScalar cj ( SimdCos(eulerY));
00148                 SimdScalar ch ( SimdCos(eulerZ));
00149                 SimdScalar si ( SimdSin(eulerX));
00150                 SimdScalar sj ( SimdSin(eulerY));
00151                 SimdScalar sh ( SimdSin(eulerZ));
00152                 SimdScalar cc = ci * ch;
00153                 SimdScalar cs = ci * sh;
00154                 SimdScalar sc = si * ch;
00155                 SimdScalar ss = si * sh;
00156
00157                 setValue(cj * ch, sj * sc - cs, sj * cc + ss,
00158                                  cj * sh, sj * ss + cc, sj * cs - sc,
00159                                  -sj,      cj * si,      cj * ci);
00160         }
00161
00162                 void setIdentity()
00163                 {
00164                         setValue(SimdScalar(1.0), SimdScalar(0.0), SimdScalar(0.0),
00165                                          SimdScalar(0.0), SimdScalar(1.0), SimdScalar(0.0),
00166                                          SimdScalar(0.0), SimdScalar(0.0), SimdScalar(1.0));
00167                 }
00168
00169                 void getOpenGLSubMatrix(SimdScalar *m) const
00170                 {
00171                         m[0]  = SimdScalar(m_el[0][0]);
00172                         m[1]  = SimdScalar(m_el[1][0]);
00173                         m[2]  = SimdScalar(m_el[2][0]);
00174                         m[3]  = SimdScalar(0.0);
00175                         m[4]  = SimdScalar(m_el[0][1]);
00176                         m[5]  = SimdScalar(m_el[1][1]);
00177                         m[6]  = SimdScalar(m_el[2][1]);
00178                         m[7]  = SimdScalar(0.0);
00179                         m[8]  = SimdScalar(m_el[0][2]);
00180                         m[9]  = SimdScalar(m_el[1][2]);
00181                         m[10] = SimdScalar(m_el[2][2]);
00182                         m[11] = SimdScalar(0.0);
00183                 }
00184
00185                 void getRotation(SimdQuaternion& q) const
00186                 {
00187                         SimdScalar trace = m_el[0][0] + m_el[1][1] + m_el[2][2];
00188
00189                         if (trace > SimdScalar(0.0))
00190                         {
00191                                 SimdScalar s = SimdSqrt(trace + SimdScalar(1.0));
00192                                 q[3] = s * SimdScalar(0.5);
00193                                 s = SimdScalar(0.5) / s;
00194
00195                                 q[0] = (m_el[2][1] - m_el[1][2]) * s;
00196                                 q[1] = (m_el[0][2] - m_el[2][0]) * s;
00197                                 q[2] = (m_el[1][0] - m_el[0][1]) * s;
00198                         }
00199                         else
00200                         {
00201                                 int i = m_el[0][0] < m_el[1][1] ?
00202                                         (m_el[1][1] < m_el[2][2] ? 2 : 1) :
00203                                         (m_el[0][0] < m_el[2][2] ? 2 : 0);
00204                                 int j = (i + 1) % 3;
00205                                 int k = (i + 2) % 3;
00206
00207                                 SimdScalar s = SimdSqrt(m_el[i][i] - m_el[j][j] - m_el[k][k] + SimdScalar(1.0));
00208                                 q[i] = s * SimdScalar(0.5);
00209                                 s = SimdScalar(0.5) / s;
00210
00211                                 q[3] = (m_el[k][j] - m_el[j][k]) * s;
00212                                 q[j] = (m_el[j][i] + m_el[i][j]) * s;
00213                                 q[k] = (m_el[k][i] + m_el[i][k]) * s;
00214                         }
00215                 }
00216
00217
00218
00219                 void getEuler(SimdScalar& yaw, SimdScalar& pitch, SimdScalar& roll) const
00220                 {
00221                         pitch = SimdScalar(SimdAsin(-m_el[2][0]));
00222                         if (pitch < SIMD_2_PI)
00223                         {
00224                                 if (pitch > SIMD_2_PI)
00225                                 {
00226                                         yaw = SimdScalar(SimdAtan2(m_el[1][0], m_el[0][0]));
00227                                         roll = SimdScalar(SimdAtan2(m_el[2][1], m_el[2][2]));
00228                                 }
00229                                 else
00230                                 {
00231                                         yaw = SimdScalar(-SimdAtan2(-m_el[0][1], m_el[0][2]));
00232                                         roll = SimdScalar(0.0);
00233                                 }
00234                         }
00235                         else
00236                         {
00237                                 yaw = SimdScalar(SimdAtan2(-m_el[0][1], m_el[0][2]));
00238                                 roll = SimdScalar(0.0);
00239                         }
00240                 }
00241
00242                 SimdVector3 getScaling() const
00243                 {
00244                         return SimdVector3(m_el[0][0] * m_el[0][0] + m_el[1][0] * m_el[1][0] + m_el[2][0] * m_el[2][0],
00245                                                                    m_el[0][1] * m_el[0][1] + m_el[1][1] * m_el[1][1] + m_el[2][1] * m_el[2][1],
00246                                                                    m_el[0][2] * m_el[0][2] + m_el[1][2] * m_el[1][2] + m_el[2][2] * m_el[2][2]);
00247                 }
00248
00249
00250                 SimdMatrix3x3 scaled(const SimdVector3& s) const
00251                 {
00252                         return SimdMatrix3x3(m_el[0][0] * s[0], m_el[0][1] * s[1], m_el[0][2] * s[2],
00253                                                                          m_el[1][0] * s[0], m_el[1][1] * s[1], m_el[1][2] * s[2],
00254                                                                          m_el[2][0] * s[0], m_el[2][1] * s[1], m_el[2][2] * s[2]);
00255                 }
00256
00257                 SimdScalar            determinant() const;
00258                 SimdMatrix3x3 adjoint() const;
00259                 SimdMatrix3x3 absolute() const;
00260                 SimdMatrix3x3 transpose() const;
00261                 SimdMatrix3x3 inverse() const;
00262
00263                 SimdMatrix3x3 transposeTimes(const SimdMatrix3x3& m) const;
00264                 SimdMatrix3x3 timesTranspose(const SimdMatrix3x3& m) const;
00265
00266                 SimdScalar tdot(int c, const SimdVector3& v) const
00267                 {
00268                         return m_el[0][c] * v[0] + m_el[1][c] * v[1] + m_el[2][c] * v[2];
00269                 }
00270
00271         protected:
00272                 SimdScalar cofac(int r1, int c1, int r2, int c2) const
00273                 {
00274                         return m_el[r1][c1] * m_el[r2][c2] - m_el[r1][c2] * m_el[r2][c1];
00275                 }
00276
00277                 SimdVector3 m_el[3];
00278         };
00279
00280         SIMD_FORCE_INLINE SimdMatrix3x3&
00281         SimdMatrix3x3::operator*=(const SimdMatrix3x3& m)
00282         {
00283                 setValue(m.tdot(0, m_el[0]), m.tdot(1, m_el[0]), m.tdot(2, m_el[0]),
00284                                  m.tdot(0, m_el[1]), m.tdot(1, m_el[1]), m.tdot(2, m_el[1]),
00285                                  m.tdot(0, m_el[2]), m.tdot(1, m_el[2]), m.tdot(2, m_el[2]));
00286                 return *this;
00287         }
00288
00289         SIMD_FORCE_INLINE SimdScalar
00290         SimdMatrix3x3::determinant() const
00291         {
00292                 return triple((*this)[0], (*this)[1], (*this)[2]);
00293         }
00294
00295
00296         SIMD_FORCE_INLINE SimdMatrix3x3
00297         SimdMatrix3x3::absolute() const
00298         {
00299                 return SimdMatrix3x3(
00300                         SimdFabs(m_el[0][0]), SimdFabs(m_el[0][1]), SimdFabs(m_el[0][2]),
00301                         SimdFabs(m_el[1][0]), SimdFabs(m_el[1][1]), SimdFabs(m_el[1][2]),
00302                         SimdFabs(m_el[2][0]), SimdFabs(m_el[2][1]), SimdFabs(m_el[2][2]));
00303         }
00304
00305         SIMD_FORCE_INLINE SimdMatrix3x3
00306         SimdMatrix3x3::transpose() const
00307         {
00308                 return SimdMatrix3x3(m_el[0][0], m_el[1][0], m_el[2][0],
00309                                                                  m_el[0][1], m_el[1][1], m_el[2][1],
00310                                                                  m_el[0][2], m_el[1][2], m_el[2][2]);
00311         }
00312
00313         SIMD_FORCE_INLINE SimdMatrix3x3
00314         SimdMatrix3x3::adjoint() const
00315         {
00316                 return SimdMatrix3x3(cofac(1, 1, 2, 2), cofac(0, 2, 2, 1), cofac(0, 1, 1, 2),
00317                                                                  cofac(1, 2, 2, 0), cofac(0, 0, 2, 2), cofac(0, 2, 1, 0),
00318                                                                  cofac(1, 0, 2, 1), cofac(0, 1, 2, 0), cofac(0, 0, 1, 1));
00319         }
00320
00321         SIMD_FORCE_INLINE SimdMatrix3x3
00322         SimdMatrix3x3::inverse() const
00323         {
00324                 SimdVector3 co(cofac(1, 1, 2, 2), cofac(1, 2, 2, 0), cofac(1, 0, 2, 1));
00325                 SimdScalar det = (*this)[0].dot(co);
00326                 assert(det != SimdScalar(0.0f));
00327                 SimdScalar s = SimdScalar(1.0f) / det;
00328                 return SimdMatrix3x3(co[0] * s, cofac(0, 2, 2, 1) * s, cofac(0, 1, 1, 2) * s,
00329                                                                  co[1] * s, cofac(0, 0, 2, 2) * s, cofac(0, 2, 1, 0) * s,
00330                                                                  co[2] * s, cofac(0, 1, 2, 0) * s, cofac(0, 0, 1, 1) * s);
00331         }
00332
00333         SIMD_FORCE_INLINE SimdMatrix3x3
00334         SimdMatrix3x3::transposeTimes(const SimdMatrix3x3& m) const
00335         {
00336                 return SimdMatrix3x3(
00337                         m_el[0][0] * m[0][0] + m_el[1][0] * m[1][0] + m_el[2][0] * m[2][0],
00338                         m_el[0][0] * m[0][1] + m_el[1][0] * m[1][1] + m_el[2][0] * m[2][1],
00339                         m_el[0][0] * m[0][2] + m_el[1][0] * m[1][2] + m_el[2][0] * m[2][2],
00340                         m_el[0][1] * m[0][0] + m_el[1][1] * m[1][0] + m_el[2][1] * m[2][0],
00341                         m_el[0][1] * m[0][1] + m_el[1][1] * m[1][1] + m_el[2][1] * m[2][1],
00342                         m_el[0][1] * m[0][2] + m_el[1][1] * m[1][2] + m_el[2][1] * m[2][2],
00343                         m_el[0][2] * m[0][0] + m_el[1][2] * m[1][0] + m_el[2][2] * m[2][0],
00344                         m_el[0][2] * m[0][1] + m_el[1][2] * m[1][1] + m_el[2][2] * m[2][1],
00345                         m_el[0][2] * m[0][2] + m_el[1][2] * m[1][2] + m_el[2][2] * m[2][2]);
00346         }
00347
00348         SIMD_FORCE_INLINE SimdMatrix3x3
00349         SimdMatrix3x3::timesTranspose(const SimdMatrix3x3& m) const
00350         {
00351                 return SimdMatrix3x3(
00352                         m_el[0].dot(m[0]), m_el[0].dot(m[1]), m_el[0].dot(m[2]),
00353                         m_el[1].dot(m[0]), m_el[1].dot(m[1]), m_el[1].dot(m[2]),
00354                         m_el[2].dot(m[0]), m_el[2].dot(m[1]), m_el[2].dot(m[2]));
00355
00356         }
00357
00358         SIMD_FORCE_INLINE SimdVector3
00359         operator*(const SimdMatrix3x3& m, const SimdVector3& v)
00360         {
00361                 return SimdVector3(m[0].dot(v), m[1].dot(v), m[2].dot(v));
00362         }
00363
00364
00365         SIMD_FORCE_INLINE SimdVector3
00366         operator*(const SimdVector3& v, const SimdMatrix3x3& m)
00367         {
00368                 return SimdVector3(m.tdot(0, v), m.tdot(1, v), m.tdot(2, v));
00369         }
00370
00371         SIMD_FORCE_INLINE SimdMatrix3x3
00372         operator*(const SimdMatrix3x3& m1, const SimdMatrix3x3& m2)
00373         {
00374                 return SimdMatrix3x3(
00375                         m2.tdot(0, m1[0]), m2.tdot(1, m1[0]), m2.tdot(2, m1[0]),
00376                         m2.tdot(0, m1[1]), m2.tdot(1, m1[1]), m2.tdot(2, m1[1]),
00377                         m2.tdot(0, m1[2]), m2.tdot(1, m1[2]), m2.tdot(2, m1[2]));
00378         }
00379
00380
00381         SIMD_FORCE_INLINE SimdMatrix3x3 SimdMultTransposeLeft(const SimdMatrix3x3& m1, const SimdMatrix3x3& m2) {
00382     return SimdMatrix3x3(
00383         m1[0][0] * m2[0][0] + m1[1][0] * m2[1][0] + m1[2][0] * m2[2][0],
00384         m1[0][0] * m2[0][1] + m1[1][0] * m2[1][1] + m1[2][0] * m2[2][1],
00385         m1[0][0] * m2[0][2] + m1[1][0] * m2[1][2] + m1[2][0] * m2[2][2],
00386         m1[0][1] * m2[0][0] + m1[1][1] * m2[1][0] + m1[2][1] * m2[2][0],
00387         m1[0][1] * m2[0][1] + m1[1][1] * m2[1][1] + m1[2][1] * m2[2][1],
00388         m1[0][1] * m2[0][2] + m1[1][1] * m2[1][2] + m1[2][1] * m2[2][2],
00389         m1[0][2] * m2[0][0] + m1[1][2] * m2[1][0] + m1[2][2] * m2[2][0],
00390         m1[0][2] * m2[0][1] + m1[1][2] * m2[1][1] + m1[2][2] * m2[2][1],
00391         m1[0][2] * m2[0][2] + m1[1][2] * m2[1][2] + m1[2][2] * m2[2][2]);
00392 }
00393
00394
00395 #endif
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdMinMax.h File Reference

LinearMath

SimdMinMax.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T>
SIMD_FORCE_INLINE const T & | SimdMin (const T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE const T & | SimdMax (const T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE void | SimdSetMin (T &a, const T &b)
template<class T>
SIMD_FORCE_INLINE void | SimdSetMax (T &a, const T &b)

Function Documentation

template<class T>
SIMD_FORCE_INLINE const T& SimdMax | ( | const T & | a,
 |  | const T & | b
 | ) |

Definition at line 26 of file SimdMinMax.h.

template<class T>
SIMD_FORCE_INLINE const T& SimdMin | ( | const T & | a,
 |  | const T & | b
 | ) |

Definition at line 21 of file SimdMinMax.h.

template<class T>
SIMD_FORCE_INLINE void SimdSetMax | ( | T & | a,
 |  | const T & | b
 | ) |

Definition at line 36 of file SimdMinMax.h.

template<class T>
SIMD_FORCE_INLINE void SimdSetMin | ( | T & | a,
 |  | const T & | b
 | ) |

Definition at line 31 of file SimdMinMax.h.

Generated on Wed May 24 13:59:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdMinMax.h Source File

LinearMath

SimdMinMax.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef SIMD_MINMAX_H
00018 #define SIMD_MINMAX_H
00019
00020 template <class T>
00021 SIMD_FORCE_INLINE const T& SimdMin(const T& a, const T& b) {
00022   return b < a ? b : a;
00023 }
00024
00025 template <class T>
00026 SIMD_FORCE_INLINE const T& SimdMax(const T& a, const T& b) {
00027   return  a < b ? b : a;
00028 }
00029
00030 template <class T>
00031 SIMD_FORCE_INLINE void SimdSetMin(T& a, const T& b) {
00032     if (a > b) a = b;
00033 }
00034
00035 template <class T>
00036 SIMD_FORCE_INLINE void SimdSetMax(T& a, const T& b) {
00037     if (a < b) a = b;
00038 }
00039
00040 #endif
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdPoint3.h File Reference

LinearMath

SimdPoint3.h File Reference

#include "SimdVector3.h"

Include dependency graph for SimdPoint3.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef SimdVector3 SimdPoint3

Typedef Documentation

typedef SimdVector3 SimdPoint3

Definition at line 22 of file SimdPoint3.h.

Generated on Wed May 24 13:59:35 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdPoint3.h Source File

LinearMath

SimdPoint3.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef SimdPoint3_H
00018 #define SimdPoint3_H
00019
00020 #include "SimdVector3.h"
00021
00022 typedef SimdVector3 SimdPoint3;
00023
00024 #endif
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdQuadWord.h File Reference

LinearMath

SimdQuadWord.h File Reference

#include "SimdScalar.h"

Include dependency graph for SimdQuadWord.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class SimdQuadWord

Generated on Wed May 24 13:59:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdQuadWord.h Source File

LinearMath

SimdQuadWord.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016 #ifndef SIMD_QUADWORD_H
00017 #define SIMD_QUADWORD_H
00018
00019 #include "SimdScalar.h"
00020
00021
00022
00023
00024
00025 class   SimdQuadWord
00026 {
00027         protected:
00028                 ATTRIBUTE_ALIGNED16     (SimdScalar     m_x);
00029                 SimdScalar      m_y;
00030                 SimdScalar      m_z;
00031                 SimdScalar      m_unusedW;
00032
00033         public:
00034
00035                 SIMD_FORCE_INLINE SimdScalar&       operator[](int i)       { return (&m_x)[i]; }
00036                 SIMD_FORCE_INLINE const SimdScalar& operator[](int i) const { return (&m_x)[i]; }
00037
00038                 SIMD_FORCE_INLINE const SimdScalar& getX() const { return m_x; }
00039
00040                 SIMD_FORCE_INLINE const SimdScalar& getY() const { return m_y; }
00041
00042                 SIMD_FORCE_INLINE const SimdScalar& getZ() const { return m_z; }
00043
00044                 SIMD_FORCE_INLINE void  setX(float x) { m_x = x;};
00045
00046                 SIMD_FORCE_INLINE void  setY(float y) { m_y = y;};
00047
00048                 SIMD_FORCE_INLINE void  setZ(float z) { m_z = z;};
00049
00050                 SIMD_FORCE_INLINE const SimdScalar& x() const { return m_x; }
00051
00052                 SIMD_FORCE_INLINE const SimdScalar& y() const { return m_y; }
00053
00054                 SIMD_FORCE_INLINE const SimdScalar& z() const { return m_z; }
00055
00056
00057                 operator       SimdScalar *()       { return &m_x; }
00058                 operator const SimdScalar *() const { return &m_x; }
00059
00060                 SIMD_FORCE_INLINE void  setValue(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z)
00061                 {
00062                         m_x=x;
00063                         m_y=y;
00064                         m_z=z;
00065                 }
00066
00067 /*              void getValue(SimdScalar *m) const
00068                 {
00069                         m[0] = m_x;
00070                         m[1] = m_y;
00071                         m[2] = m_z;
00072                 }
00073 */
00074                 SIMD_FORCE_INLINE void  setValue(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z,const SimdScalar& w)
00075                 {
00076                         m_x=x;
00077                         m_y=y;
00078                         m_z=z;
00079                         m_unusedW=w;
00080                 }
00081
00082                 SIMD_FORCE_INLINE SimdQuadWord() :
00083                 m_x(0.f),m_y(0.f),m_z(0.f),m_unusedW(0.f)
00084                 {
00085                 }
00086
00087                 SIMD_FORCE_INLINE SimdQuadWord(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z)
00088                 :m_x(x),m_y(y),m_z(z)
00089                 //todo, remove this in release/simd ?
00090                 ,m_unusedW(0.f)
00091                 {
00092                 }
00093
00094                 SIMD_FORCE_INLINE SimdQuadWord(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z,const SimdScalar& w)
00095                         :m_x(x),m_y(y),m_z(z),m_unusedW(w)
00096                 {
00097                 }
00098
00099
00100                 SIMD_FORCE_INLINE void  setMax(const SimdQuadWord& other)
00101                 {
00102                         if (other.m_x > m_x)
00103                                 m_x = other.m_x;
00104
00105                         if (other.m_y > m_y)
00106                                 m_y = other.m_y;
00107
00108                         if (other.m_z > m_z)
00109                                 m_z = other.m_z;
00110
00111                         if (other.m_unusedW > m_unusedW)
00112                                 m_unusedW = other.m_unusedW;
00113                 }
00114
00115                 SIMD_FORCE_INLINE void  setMin(const SimdQuadWord& other)
00116                 {
00117                         if (other.m_x < m_x)
00118                                 m_x = other.m_x;
00119
00120                         if (other.m_y < m_y)
00121                                 m_y = other.m_y;
00122
00123                         if (other.m_z < m_z)
00124                                 m_z = other.m_z;
00125
00126                         if (other.m_unusedW < m_unusedW)
00127                                 m_unusedW = other.m_unusedW;
00128                 }
00129
00130
00131
00132 };
00133
00134 #endif //SIMD_QUADWORD_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdQuaternion.h File Reference

LinearMath

SimdQuaternion.h File Reference

#include "SimdVector3.h"

Include dependency graph for SimdQuaternion.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | SimdQuaternion

Functions

SIMD_FORCE_INLINE SimdQuaternion | operator- (const SimdQuaternion &q)
SIMD_FORCE_INLINE SimdQuaternion | operator * (const SimdQuaternion &q1, const SimdQuaternion &q2)
SIMD_FORCE_INLINE SimdQuaternion | operator * (const SimdQuaternion &q, const SimdVector3 &w)
SIMD_FORCE_INLINE SimdQuaternion | operator * (const SimdVector3 &w, const SimdQuaternion &q)
SIMD_FORCE_INLINE SimdScalar | dot (const SimdQuaternion &q1, const SimdQuaternion &q2)
SIMD_FORCE_INLINE SimdScalar | length (const SimdQuaternion &q)
SIMD_FORCE_INLINE SimdScalar | angle (const SimdQuaternion &q1, const SimdQuaternion &q2)
SIMD_FORCE_INLINE SimdQuaternion | inverse (const SimdQuaternion &q)
SIMD_FORCE_INLINE SimdQuaternion | slerp (const SimdQuaternion &q1, const SimdQuaternion &q2, const SimdScalar &t)

Function Documentation

SIMD_FORCE_INLINE SimdScalar angle | ( | const SimdQuaternion & | q1,
 |  | const SimdQuaternion & | q2
 | ) |

Definition at line 268 of file SimdQuaternion.h.

References SimdQuaternion::angle().

Referenced by SimdTransformUtil::CalculateVelocity().

SIMD_FORCE_INLINE SimdScalar dot | ( | const SimdQuaternion & | q1,
 |  | const SimdQuaternion & | q2
 | ) |

Definition at line 255 of file SimdQuaternion.h.

References SimdQuaternion::dot().

Referenced by ContinuousConvexCollision::calcTimeOfImpact(), VoronoiSimplexSolver::ClosestPtPointTetrahedron(), EpaPolyhedron::Create(), EpaPolyhedron::DeleteVisibleFaces(), TriangleMeshShape::GetAabb(), BoxShape::GetAabb(), operator *(), SimdTransform::operator()(), VoronoiSimplexSolver::PointOutsideOfPlane(), SupportVertexCallback::ProcessTriangle(), PersistentManifold::RefreshContactPoints(), Point2PointConstraint::SolveConstraint(), HingeConstraint::SolveConstraint(), Epa::TetrahedronContainsOrigin(), and SimdMatrix3x3::timesTranspose().

SIMD_FORCE_INLINE SimdQuaternion inverse ( const SimdQuaternion & q )

Definition at line 275 of file SimdQuaternion.h.

References SimdQuaternion::inverse().

SIMD_FORCE_INLINE SimdScalar length ( const SimdQuaternion & q )

Definition at line 262 of file SimdQuaternion.h.

References SimdQuaternion::length().

Referenced by GjkConvexCast::calcTimeOfImpact(), CollisionShape::GetAngularMotionDisc(), CollisionShape::GetBoundingSphere(), and GjkPairDetector::GetClosestPoints().

SIMD_FORCE_INLINE SimdQuaternion operator * | ( | const SimdVector3 & | w,
 |  | const SimdQuaternion & | q
 | ) |

Definition at line 246 of file SimdQuaternion.h.

References SIMD_FORCE_INLINE, SimdQuaternion::SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdQuaternion operator * | ( | const SimdQuaternion & | q,
 |  | const SimdVector3 & | w
 | ) |

Definition at line 237 of file SimdQuaternion.h.

References SIMD_FORCE_INLINE, SimdQuaternion::SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdQuaternion operator * | ( | const SimdQuaternion & | q1,
 |  | const SimdQuaternion & | q2
 | ) |

Definition at line 229 of file SimdQuaternion.h.

References SIMD_FORCE_INLINE, SimdQuaternion::SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdQuaternion operator- ( const SimdQuaternion & q )

Definition at line 220 of file SimdQuaternion.h.

References SIMD_FORCE_INLINE, SimdQuaternion::SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by __declspec().

SIMD_FORCE_INLINE SimdQuaternion slerp | ( | const SimdQuaternion & | q1,
 |  | const SimdQuaternion & | q2,
 |  | const SimdScalar & | t
 | ) |

Definition at line 281 of file SimdQuaternion.h.

References SimdQuaternion::slerp().

Generated on Wed May 24 13:59:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdQuaternion.h Source File

LinearMath

SimdQuaternion.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef SIMD__QUATERNION_H_
00018 #define SIMD__QUATERNION_H_
00019
00020 #include "SimdVector3.h"
00021
00022 class SimdQuaternion : public SimdQuadWord {
00023 public:
00024         SimdQuaternion() {}
00025
00026         //              template <typename SimdScalar>
00027         //              explicit Quaternion(const SimdScalar *v) : Tuple4<SimdScalar>(v) {}
00028
00029         SimdQuaternion(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z, const SimdScalar& w)
00030                 : SimdQuadWord(x, y, z, w)
00031         {}
00032
00033         SimdQuaternion(const SimdVector3& axis, const SimdScalar& angle)
00034         {
00035                 setRotation(axis, angle);
00036         }
00037
00038         SimdQuaternion(const SimdScalar& yaw, const SimdScalar& pitch, const SimdScalar& roll)
00039         {
00040                 setEuler(yaw, pitch, roll);
00041         }
00042
00043         void setRotation(const SimdVector3& axis, const SimdScalar& angle)
00044         {
00045                 SimdScalar d = axis.length();
00046                 assert(d != SimdScalar(0.0));
00047                 SimdScalar s = SimdSin(angle * SimdScalar(0.5)) / d;
00048                 setValue(axis.x() * s, axis.y() * s, axis.z() * s,
00049                         SimdCos(angle * SimdScalar(0.5)));
00050         }
00051
00052         void setEuler(const SimdScalar& yaw, const SimdScalar& pitch, const SimdScalar& roll)
00053         {
00054                 SimdScalar halfYaw = SimdScalar(yaw) * SimdScalar(0.5);
00055                 SimdScalar halfPitch = SimdScalar(pitch) * SimdScalar(0.5);
00056                 SimdScalar halfRoll = SimdScalar(roll) * SimdScalar(0.5);
00057                 SimdScalar cosYaw = SimdCos(halfYaw);
00058                 SimdScalar sinYaw = SimdSin(halfYaw);
00059                 SimdScalar cosPitch = SimdCos(halfPitch);
00060                 SimdScalar sinPitch = SimdSin(halfPitch);
00061                 SimdScalar cosRoll = SimdCos(halfRoll);
00062                 SimdScalar sinRoll = SimdSin(halfRoll);
00063                 setValue(cosRoll * sinPitch * cosYaw + sinRoll * cosPitch * sinYaw,
00064                         cosRoll * cosPitch * sinYaw - sinRoll * sinPitch * cosYaw,
00065                         sinRoll * cosPitch * cosYaw - cosRoll * sinPitch * sinYaw,
00066                         cosRoll * cosPitch * cosYaw + sinRoll * sinPitch * sinYaw);
00067         }
00068
00069         SimdQuaternion& operator+=(const SimdQuaternion& q)
00070         {
00071                 m_x += q.x(); m_y += q.y(); m_z += q.z(); m_unusedW += q[3];
00072                 return *this;
00073         }
00074
00075         SimdQuaternion& operator-=(const SimdQuaternion& q)
00076         {
00077                 m_x -= q.x(); m_y -= q.y(); m_z -= q.z(); m_unusedW -= q[3];
00078                 return *this;
00079         }
00080
00081         SimdQuaternion& operator*=(const SimdScalar& s)
00082         {
00083                 m_x *= s; m_y *= s; m_z *= s; m_unusedW *= s;
00084                 return *this;
00085         }
00086
00087
00088         SimdQuaternion& operator*=(const SimdQuaternion& q)
00089         {
00090                 setValue(m_unusedW * q.x() + m_x * q[3] + m_y * q.z() - m_z * q.y(),
00091                         m_unusedW * q.y() + m_y * q[3] + m_z * q.x() - m_x * q.z(),
00092                         m_unusedW * q.z() + m_z * q[3] + m_x * q.y() - m_y * q.x(),
00093                         m_unusedW * q[3] - m_x * q.x() - m_y * q.y() - m_z * q.z());
00094                 return *this;
00095         }
00096
00097         SimdScalar dot(const SimdQuaternion& q) const
00098         {
00099                 return m_x * q.x() + m_y * q.y() + m_z * q.z() + m_unusedW * q[3];
00100         }
00101
00102         SimdScalar length2() const
00103         {
00104                 return dot(*this);
00105         }
00106
00107         SimdScalar length() const
00108         {
00109                 return SimdSqrt(length2());
00110         }
00111
00112         SimdQuaternion& normalize()
00113         {
00114                 return *this /= length();
00115         }
00116
00117         SIMD_FORCE_INLINE SimdQuaternion
00118         operator*(const SimdScalar& s) const
00119         {
00120                 return SimdQuaternion(x() * s, y() * s, z() * s, m_unusedW * s);
00121         }
00122
00123
00124
00125         SimdQuaternion operator/(const SimdScalar& s) const
00126         {
00127                 assert(s != SimdScalar(0.0));
00128                 return *this * (SimdScalar(1.0) / s);
00129         }
00130
00131
00132         SimdQuaternion& operator/=(const SimdScalar& s)
00133         {
00134                 assert(s != SimdScalar(0.0));
00135                 return *this *= SimdScalar(1.0) / s;
00136         }
00137
00138
00139         SimdQuaternion normalized() const
00140         {
00141                 return *this / length();
00142         }
00143
00144         SimdScalar angle(const SimdQuaternion& q) const
00145         {
00146                 SimdScalar s = SimdSqrt(length2() * q.length2());
00147                 assert(s != SimdScalar(0.0));
00148                 return SimdAcos(dot(q) / s);
00149         }
00150
00151         SimdScalar getAngle() const
00152         {
00153                 SimdScalar s = 2.f * SimdAcos(m_unusedW);
00154                 return s;
00155         }
00156
00157
00158
00159         SimdQuaternion inverse() const
00160         {
00161                 return SimdQuaternion(m_x, m_y, m_z, -m_unusedW);
00162         }
00163
00164         SIMD_FORCE_INLINE SimdQuaternion
00165         operator+(const SimdQuaternion& q2) const
00166         {
00167                 const SimdQuaternion& q1 = *this;
00168                 return SimdQuaternion(q1.x() + q2.x(), q1.y() + q2.y(), q1.z() + q2.z(), q1[3] + q2[3]);
00169         }
00170
00171         SIMD_FORCE_INLINE SimdQuaternion
00172         operator-(const SimdQuaternion& q2) const
00173         {
00174                 const SimdQuaternion& q1 = *this;
00175                 return SimdQuaternion(q1.x() - q2.x(), q1.y() - q2.y(), q1.z() - q2.z(), q1[3] - q2[3]);
00176         }
00177
00178         SIMD_FORCE_INLINE SimdQuaternion operator-() const
00179         {
00180                 const SimdQuaternion& q2 = *this;
00181                 return SimdQuaternion( - q2.x(), - q2.y(),  - q2.z(),  - q2[3]);
00182         }
00183
00184         SIMD_FORCE_INLINE SimdQuaternion farthest( const SimdQuaternion& qd) const
00185         {
00186                 SimdQuaternion diff,sum;
00187                 diff = *this - qd;
00188                 sum = *this + qd;
00189                 if( diff.dot(diff) > sum.dot(sum) )
00190                         return qd;
00191                 return (-qd);
00192         }
00193
00194         SimdQuaternion slerp(const SimdQuaternion& q, const SimdScalar& t) const
00195         {
00196                 SimdScalar theta = angle(q);
00197                 if (theta != SimdScalar(0.0))
00198                 {
00199                         SimdScalar d = SimdScalar(1.0) / SimdSin(theta);
00200                         SimdScalar s0 = SimdSin((SimdScalar(1.0) - t) * theta);
00201                         SimdScalar s1 = SimdSin(t * theta);
00202                         return SimdQuaternion((m_x * s0 + q.x() * s1) * d,
00203                                 (m_y * s0 + q.y() * s1) * d,
00204                                 (m_z * s0 + q.z() * s1) * d,
00205                                 (m_unusedW * s0 + q[3] * s1) * d);
00206                 }
00207                 else
00208                 {
00209                         return *this;
00210                 }
00211         }
00212
00213
00214
00215 };
00216
00217
00218
00219 SIMD_FORCE_INLINE SimdQuaternion
00220 operator-(const SimdQuaternion& q)
00221 {
00222         return SimdQuaternion(-q.x(), -q.y(), -q.z(), -q[3]);
00223 }
00224
00225
00226
00227
00228 SIMD_FORCE_INLINE SimdQuaternion
00229 operator*(const SimdQuaternion& q1, const SimdQuaternion& q2) {
00230         return SimdQuaternion(q1[3] * q2.x() + q1.x() * q2[3] + q1.y() * q2.z() - q1.z() * q2.y(),
00231                 q1[3] * q2.y() + q1.y() * q2[3] + q1.z() * q2.x() - q1.x() * q2.z(),
00232                 q1[3] * q2.z() + q1.z() * q2[3] + q1.x() * q2.y() - q1.y() * q2.x(),
00233                 q1[3] * q2[3] - q1.x() * q2.x() - q1.y() * q2.y() - q1.z() * q2.z());
00234 }
00235
00236 SIMD_FORCE_INLINE SimdQuaternion
00237 operator*(const SimdQuaternion& q, const SimdVector3& w)
00238 {
00239         return SimdQuaternion( q[3] * w.x() + q.y() * w.z() - q.z() * w.y(),
00240                 q[3] * w.y() + q.z() * w.x() - q.x() * w.z(),
00241                 q[3] * w.z() + q.x() * w.y() - q.y() * w.x(),
00242                 -q.x() * w.x() - q.y() * w.y() - q.z() * w.z());
00243 }
00244
00245 SIMD_FORCE_INLINE SimdQuaternion
00246 operator*(const SimdVector3& w, const SimdQuaternion& q)
00247 {
00248         return SimdQuaternion( w.x() * q[3] + w.y() * q.z() - w.z() * q.y(),
00249                 w.y() * q[3] + w.z() * q.x() - w.x() * q.z(),
00250                 w.z() * q[3] + w.x() * q.y() - w.y() * q.x(),
00251                 -w.x() * q.x() - w.y() * q.y() - w.z() * q.z());
00252 }
00253
00254 SIMD_FORCE_INLINE SimdScalar
00255 dot(const SimdQuaternion& q1, const SimdQuaternion& q2)
00256 {
00257         return q1.dot(q2);
00258 }
00259
00260
00261 SIMD_FORCE_INLINE SimdScalar
00262 length(const SimdQuaternion& q)
00263 {
00264         return q.length();
00265 }
00266
00267 SIMD_FORCE_INLINE SimdScalar
00268 angle(const SimdQuaternion& q1, const SimdQuaternion& q2)
00269 {
00270         return q1.angle(q2);
00271 }
00272
00273
00274 SIMD_FORCE_INLINE SimdQuaternion
00275 inverse(const SimdQuaternion& q)
00276 {
00277         return q.inverse();
00278 }
00279
00280 SIMD_FORCE_INLINE SimdQuaternion
00281 slerp(const SimdQuaternion& q1, const SimdQuaternion& q2, const SimdScalar& t)
00282 {
00283         return q1.slerp(q2, t);
00284 }
00285
00286
00287 #endif
00288
00289
00290
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdScalar.h File Reference

LinearMath

SimdScalar.h File Reference

#include <math.h>
#include <cstdlib>
#include <cfloat>
#include <float.h>
#include <assert.h>

Include dependency graph for SimdScalar.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | SIMD_FORCE_INLINE inline
#define | ATTRIBUTE_ALIGNED16(a) a
#define | ASSERT assert

Typedefs

typedef float | SimdScalar

Functions

SIMD_FORCE_INLINE SimdScalar | SimdSqrt (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdFabs (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdCos (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdSin (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdTan (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdAcos (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdAsin (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdAtan (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdAtan2 (SimdScalar x, SimdScalar y)
SIMD_FORCE_INLINE SimdScalar | SimdExp (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdLog (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdPow (SimdScalar x, SimdScalar y)
SIMD_FORCE_INLINE bool | SimdFuzzyZero (SimdScalar x)
SIMD_FORCE_INLINE bool | SimdEqual (SimdScalar a, SimdScalar eps)
SIMD_FORCE_INLINE bool | SimdGreaterEqual (SimdScalar a, SimdScalar eps)
SIMD_FORCE_INLINE int | SimdSign (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdRadians (SimdScalar x)
SIMD_FORCE_INLINE SimdScalar | SimdDegrees (SimdScalar x)

Variables

const SimdScalar | SIMD_2_PI = 6.283185307179586232f
const SimdScalar | SIMD_PI = SIMD_2_PI * SimdScalar(0.5f)
const SimdScalar | SIMD_HALF_PI = SIMD_2_PI * SimdScalar(0.25f)
const SimdScalar | SIMD_RADS_PER_DEG = SIMD_2_PI / SimdScalar(360.0f)
const SimdScalar | SIMD_DEGS_PER_RAD = SimdScalar(360.0f) / SIMD_2_PI
const SimdScalar | SIMD_EPSILON = FLT_EPSILON
const SimdScalar | SIMD_INFINITY = FLT_MAX

Define Documentation

#define ASSERT assert

Definition at line 51 of file SimdScalar.h.

Referenced by TriangleShape::CalculateLocalInertia(), CcdPhysicsEnvironment::createConstraint(), GjkPairDetector::GetClosestPoints(), PersistentManifold::GetContactPoint(), BoxShape::GetEdge(), StridingMeshInterface::InternalProcessAllTriangles(), Solve2LinearConstraint::resolveBilateralPairConstraint(), and Solve2LinearConstraint::resolveUnilateralPairConstraint().

#define ATTRIBUTE_ALIGNED16 ( a ) a

Definition at line 45 of file SimdScalar.h.

#define SIMD_FORCE_INLINE inline

Definition at line 44 of file SimdScalar.h.

Referenced by SimdTransform::inverseTimes(), SimdTransform::invXform(), operator *(), SimdMatrix3x3::operator *=(), operator+(), SimdQuaternion::operator+(), operator-(), operator/(), and SimdQuaternion::slerp().

Typedef Documentation

typedef float SimdScalar

Definition at line 57 of file SimdScalar.h.

Function Documentation

SIMD_FORCE_INLINE SimdScalar SimdAcos ( SimdScalar x )

Definition at line 82 of file SimdScalar.h.

Referenced by SimdVector3::angle(), SimdQuaternion::angle(), BU_EdgeEdge::Calc2DRotationPointPoint(), SimdQuaternion::getAngle(), and BU_AlgebraicPolynomialSolver::Solve3Cubic().

SIMD_FORCE_INLINE SimdScalar SimdAsin ( SimdScalar x )

Definition at line 83 of file SimdScalar.h.

Referenced by SimdMatrix3x3::getEuler().

SIMD_FORCE_INLINE SimdScalar SimdAtan ( SimdScalar x )

Definition at line 84 of file SimdScalar.h.

Referenced by BU_VertexPoly::GetTimeOfImpact(), and BU_EdgeEdge::GetTimeOfImpactGeneralCase().

SIMD_FORCE_INLINE SimdScalar SimdAtan2 | ( | SimdScalar | x,
 |  | SimdScalar | y
 | ) |

Definition at line 85 of file SimdScalar.h.

Referenced by SimdMatrix3x3::getEuler().

SIMD_FORCE_INLINE SimdScalar SimdCos ( SimdScalar x )

Definition at line 79 of file SimdScalar.h.

Referenced by BU_Screwing::BU_Screwing(), BU_EdgeEdge::Calc2DRotationPointPoint(), BU_Screwing::InBetweenPosition(), BU_Screwing::InBetweenTransform(), BU_Screwing::InBetweenVector(), SimdTransformUtil::IntegrateTransform(), SimdVector3::rotate(), SimdQuaternion::setEuler(), SimdMatrix3x3::setEulerYPR(), SimdMatrix3x3::setEulerZYX(), SimdQuaternion::setRotation(), and BU_AlgebraicPolynomialSolver::Solve3Cubic().

SIMD_FORCE_INLINE SimdScalar SimdDegrees ( SimdScalar x )

Definition at line 124 of file SimdScalar.h.

References SIMD_DEGS_PER_RAD.

SIMD_FORCE_INLINE bool SimdEqual | ( | SimdScalar | a,
 |  | SimdScalar | eps
 | ) |

Definition at line 103 of file SimdScalar.h.

Referenced by EpaPolyhedron::Create(), BU_AlgebraicPolynomialSolver::Solve3Cubic(), and BU_AlgebraicPolynomialSolver::Solve4Quartic().

SIMD_FORCE_INLINE SimdScalar SimdExp ( SimdScalar x )

Definition at line 86 of file SimdScalar.h.

SIMD_FORCE_INLINE SimdScalar SimdFabs ( SimdScalar x )

Definition at line 78 of file SimdScalar.h.

Referenced by SimdVector3::absolute(), SimdMatrix3x3::absolute(), SimdVector4::absolute4(), dPlaneSpace1(), SimdFuzzyZero(), SimdPlaneSpace1(), SOR_LCP(), and TestFuzzyZero().

SIMD_FORCE_INLINE bool SimdFuzzyZero ( SimdScalar x )

Definition at line 101 of file SimdScalar.h.

References SIMD_EPSILON, and SimdFabs().

Referenced by BU_EdgeEdge::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpactGeneralCase(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), and CcdPhysicsController::setScaling().

SIMD_FORCE_INLINE bool SimdGreaterEqual | ( | SimdScalar | a,
 |  | SimdScalar | eps
 | ) |

Definition at line 106 of file SimdScalar.h.

Referenced by BU_AlgebraicPolynomialSolver::Solve2Quadratic().

SIMD_FORCE_INLINE SimdScalar SimdLog ( SimdScalar x )

Definition at line 87 of file SimdScalar.h.

SIMD_FORCE_INLINE SimdScalar SimdPow | ( | SimdScalar | x,
 |  | SimdScalar | y
 | ) |

Definition at line 88 of file SimdScalar.h.

SIMD_FORCE_INLINE SimdScalar SimdRadians ( SimdScalar x )

Definition at line 123 of file SimdScalar.h.

References SIMD_RADS_PER_DEG.

SIMD_FORCE_INLINE int SimdSign ( SimdScalar x )

Definition at line 119 of file SimdScalar.h.

Referenced by BU_Screwing::LocalMatrix().

SIMD_FORCE_INLINE SimdScalar SimdSin ( SimdScalar x )

Definition at line 80 of file SimdScalar.h.

Referenced by BU_Screwing::BU_Screwing(), BU_EdgeEdge::Calc2DRotationPointPoint(), BU_Screwing::InBetweenPosition(), BU_Screwing::InBetweenTransform(), BU_Screwing::InBetweenVector(), SimdTransformUtil::IntegrateTransform(), SimdVector3::rotate(), SimdQuaternion::setEuler(), SimdMatrix3x3::setEulerYPR(), SimdMatrix3x3::setEulerZYX(), SimdQuaternion::setRotation(), and SimdQuaternion::slerp().

SIMD_FORCE_INLINE SimdScalar SimdSqrt ( SimdScalar x )

Definition at line 77 of file SimdScalar.h.

Referenced by SimdVector3::angle(), SimdQuaternion::angle(), BU_Screwing::BU_Screwing(), SimdTransformUtil::CalculateVelocity(), ConeShape::ConeLocalSupport(), CylinderLocalSupportX(), CylinderLocalSupportY(), CylinderLocalSupportZ(), GjkPairDetector::GetClosestPoints(), SimdMatrix3x3::getRotation(), BU_EdgeEdge::GetTimeOfImpact(), SimdVector3::length(), SimdQuaternion::length(), PolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(), MultiSphereShape::LocalGetSupportingVertexWithoutMargin(), ConvexHullShape::LocalGetSupportingVertexWithoutMargin(), BU_Screwing::LocalMatrix(), BU_AlgebraicPolynomialSolver::Solve2Quadratic(), BU_AlgebraicPolynomialSolver::Solve2QuadraticFull(), BU_AlgebraicPolynomialSolver::Solve3Cubic(), and BU_AlgebraicPolynomialSolver::Solve4Quartic().

SIMD_FORCE_INLINE SimdScalar SimdTan ( SimdScalar x )

Definition at line 81 of file SimdScalar.h.

Referenced by BU_Screwing::CalculateF(), BU_VertexPoly::GetTimeOfImpact(), and BU_EdgeEdge::GetTimeOfImpactGeneralCase().

Variable Documentation

const SimdScalar SIMD_2_PI = 6.283185307179586232f

Definition at line 93 of file SimdScalar.h.

Referenced by SimdMatrix3x3::getEuler(), and BU_AlgebraicPolynomialSolver::Solve3Cubic().

const SimdScalar SIMD_DEGS_PER_RAD = SimdScalar(360.0f) / SIMD_2_PI

Definition at line 97 of file SimdScalar.h.

Referenced by SimdDegrees().

const SimdScalar SIMD_EPSILON = FLT_EPSILON

Definition at line 98 of file SimdScalar.h.

Referenced by CcdPhysicsController::applyImpulse(), SubsimplexConvexCast::calcTimeOfImpact(), GjkConvexCast::calcTimeOfImpact(), SimdTransformUtil::CalculateVelocity(), ConeShape::ConeLocalSupport(), GjkPairDetector::GetClosestPoints(), JacobianEntry::getRelativeVelocity(), Epa::Initialize(), EpaFace::IsAffinelyDependent(), SphereShape::LocalGetSupportingVertex(), CylinderShape::LocalGetSupportingVertex(), ConvexShape::LocalGetSupportingVertex(), ConvexHullShape::LocalGetSupportingVertex(), ConeShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertex(), Solve2LinearConstraint::resolveBilateralPairConstraint(), Solve2LinearConstraint::resolveUnilateralPairConstraint(), CcdPhysicsController::SetAngularVelocity(), CcdPhysicsController::SetLinearVelocity(), BvhTriangleMeshShape::setLocalScaling(), SimdFuzzyZero(), BU_AlgebraicPolynomialSolver::Solve2Quadratic(), BU_AlgebraicPolynomialSolver::Solve3Cubic(), and BU_AlgebraicPolynomialSolver::Solve4Quartic().

const SimdScalar SIMD_HALF_PI = SIMD_2_PI * SimdScalar(0.25f)

Definition at line 95 of file SimdScalar.h.

Referenced by RigidBody::integrateVelocities().

const SimdScalar SIMD_INFINITY = FLT_MAX

Definition at line 99 of file SimdScalar.h.

Referenced by Epa::CalcPenDepth(), ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), EpaPolyhedron::Create(), GjkPairDetector::GetClosestPoints(), and Epa::Initialize().

const SimdScalar SIMD_PI = SIMD_2_PI * SimdScalar(0.5f)

Definition at line 94 of file SimdScalar.h.

const SimdScalar SIMD_RADS_PER_DEG = SIMD_2_PI / SimdScalar(360.0f)

Definition at line 96 of file SimdScalar.h.

Referenced by Epa::Initialize(), and SimdRadians().

Generated on Wed May 24 13:59:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdScalar.h Source File

LinearMath

SimdScalar.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef SIMD___SCALAR_H
00018 #define SIMD___SCALAR_H
00019
00020 #include <math.h>
00021 #undef max
00022
00023
00024
00025 #include <cstdlib>
00026 #include <cfloat>
00027 #include <float.h>
00028
00029 #ifdef WIN32
00030 #pragma warning(disable:4530)
00031 #pragma warning(disable:4996)
00032 #ifdef __MINGW32__
00033 #define SIMD_FORCE_INLINE inline
00034 #else
00035 #define SIMD_FORCE_INLINE __forceinline
00036 #endif //__MINGW32__
00037
00038 //#define ATTRIBUTE_ALIGNED16(a) __declspec(align(16)) a
00039 #define ATTRIBUTE_ALIGNED16(a) a
00040
00041 #include <assert.h>
00042 #define ASSERT assert
00043 #else
00044 #define SIMD_FORCE_INLINE inline
00045 #define ATTRIBUTE_ALIGNED16(a) a
00046 #ifndef assert
00047 #include <assert.h>
00048 #endif
00049
00050
00051 #define ASSERT assert
00052
00053 #endif
00054
00055
00056
00057 typedef float    SimdScalar;
00058
00059 #if defined (__sun) || defined (__sun__) || defined (__sparc) || defined (__APPLE__)
00060 //use double float precision operation on those platforms for Blender
00061
00062 SIMD_FORCE_INLINE SimdScalar SimdSqrt(SimdScalar x) { return sqrt(x); }
00063 SIMD_FORCE_INLINE SimdScalar SimdFabs(SimdScalar x) { return fabs(x); }
00064 SIMD_FORCE_INLINE SimdScalar SimdCos(SimdScalar x) { return cos(x); }
00065 SIMD_FORCE_INLINE SimdScalar SimdSin(SimdScalar x) { return sin(x); }
00066 SIMD_FORCE_INLINE SimdScalar SimdTan(SimdScalar x) { return tan(x); }
00067 SIMD_FORCE_INLINE SimdScalar SimdAcos(SimdScalar x) { return acos(x); }
00068 SIMD_FORCE_INLINE SimdScalar SimdAsin(SimdScalar x) { return asin(x); }
00069 SIMD_FORCE_INLINE SimdScalar SimdAtan(SimdScalar x) { return atan(x); }
00070 SIMD_FORCE_INLINE SimdScalar SimdAtan2(SimdScalar x, SimdScalar y) { return atan2(x, y); }
00071 SIMD_FORCE_INLINE SimdScalar SimdExp(SimdScalar x) { return exp(x); }
00072 SIMD_FORCE_INLINE SimdScalar SimdLog(SimdScalar x) { return log(x); }
00073 SIMD_FORCE_INLINE SimdScalar SimdPow(SimdScalar x,SimdScalar y) { return pow(x,y); }
00074
00075 #else
00076
00077 SIMD_FORCE_INLINE SimdScalar SimdSqrt(SimdScalar x) { return sqrtf(x); }
00078 SIMD_FORCE_INLINE SimdScalar SimdFabs(SimdScalar x) { return fabsf(x); }
00079 SIMD_FORCE_INLINE SimdScalar SimdCos(SimdScalar x) { return cosf(x); }
00080 SIMD_FORCE_INLINE SimdScalar SimdSin(SimdScalar x) { return sinf(x); }
00081 SIMD_FORCE_INLINE SimdScalar SimdTan(SimdScalar x) { return tanf(x); }
00082 SIMD_FORCE_INLINE SimdScalar SimdAcos(SimdScalar x) { return acosf(x); }
00083 SIMD_FORCE_INLINE SimdScalar SimdAsin(SimdScalar x) { return asinf(x); }
00084 SIMD_FORCE_INLINE SimdScalar SimdAtan(SimdScalar x) { return atanf(x); }
00085 SIMD_FORCE_INLINE SimdScalar SimdAtan2(SimdScalar x, SimdScalar y) { return atan2f(x, y); }
00086 SIMD_FORCE_INLINE SimdScalar SimdExp(SimdScalar x) { return expf(x); }
00087 SIMD_FORCE_INLINE SimdScalar SimdLog(SimdScalar x) { return logf(x); }
00088 SIMD_FORCE_INLINE SimdScalar SimdPow(SimdScalar x,SimdScalar y) { return powf(x,y); }
00089
00090 #endif
00091
00092
00093 const SimdScalar  SIMD_2_PI         = 6.283185307179586232f;
00094 const SimdScalar  SIMD_PI           = SIMD_2_PI * SimdScalar(0.5f);
00095 const SimdScalar  SIMD_HALF_PI           = SIMD_2_PI * SimdScalar(0.25f);
00096 const SimdScalar  SIMD_RADS_PER_DEG = SIMD_2_PI / SimdScalar(360.0f);
00097 const SimdScalar  SIMD_DEGS_PER_RAD = SimdScalar(360.0f) / SIMD_2_PI;
00098 const SimdScalar  SIMD_EPSILON      = FLT_EPSILON;
00099 const SimdScalar  SIMD_INFINITY     = FLT_MAX;
00100
00101 SIMD_FORCE_INLINE bool      SimdFuzzyZero(SimdScalar x) { return SimdFabs(x) < SIMD_EPSILON; }
00102
00103 SIMD_FORCE_INLINE bool  SimdEqual(SimdScalar a, SimdScalar eps) {
00104         return (((a) <= eps) && !((a) < -eps));
00105 }
00106 SIMD_FORCE_INLINE bool  SimdGreaterEqual (SimdScalar a, SimdScalar eps) {
00107         return (!((a) <= eps));
00108 }
00109
00110 /*SIMD_FORCE_INLINE SimdScalar SimdCos(SimdScalar x) { return cosf(x); }
00111 SIMD_FORCE_INLINE SimdScalar SimdSin(SimdScalar x) { return sinf(x); }
00112 SIMD_FORCE_INLINE SimdScalar SimdTan(SimdScalar x) { return tanf(x); }
00113 SIMD_FORCE_INLINE SimdScalar SimdAcos(SimdScalar x) { return acosf(x); }
00114 SIMD_FORCE_INLINE SimdScalar SimdAsin(SimdScalar x) { return asinf(x); }
00115 SIMD_FORCE_INLINE SimdScalar SimdAtan(SimdScalar x) { return atanf(x); }
00116 SIMD_FORCE_INLINE SimdScalar SimdAtan2(SimdScalar x, SimdScalar y) { return atan2f(x, y); }
00117 */
00118
00119 SIMD_FORCE_INLINE int       SimdSign(SimdScalar x) {
00120     return x < 0.0f ? -1 : x > 0.0f ? 1 : 0;
00121 }
00122
00123 SIMD_FORCE_INLINE SimdScalar SimdRadians(SimdScalar x) { return x * SIMD_RADS_PER_DEG; }
00124 SIMD_FORCE_INLINE SimdScalar SimdDegrees(SimdScalar x) { return x * SIMD_DEGS_PER_RAD; }
00125
00126
00127
00128 #endif //SIMD___SCALAR_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdTransform.h File Reference

LinearMath

SimdTransform.h File Reference

#include "SimdVector3.h"
#include "SimdMatrix3x3.h"

Include dependency graph for SimdTransform.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class SimdTransform

Generated on Wed May 24 13:59:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdTransform.h Source File

LinearMath

SimdTransform.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef SimdTransform_H
00018 #define SimdTransform_H
00019
00020 #include "SimdVector3.h"
00021 #include "SimdMatrix3x3.h"
00022
00023
00024
00025 class SimdTransform {
00026         enum {
00027                 TRANSLATION = 0x01,
00028                 ROTATION    = 0x02,
00029                 RIGID       = TRANSLATION | ROTATION,
00030                 SCALING     = 0x04,
00031                 LINEAR      = ROTATION | SCALING,
00032                 AFFINE      = TRANSLATION | LINEAR
00033         };
00034
00035 public:
00036         SimdTransform() {}
00037
00038         //      template <typename Scalar2>
00039         //      explicit Transform(const Scalar2 *m) { setValue(m); }
00040
00041         explicit SIMD_FORCE_INLINE SimdTransform(const SimdQuaternion& q,
00042                 const SimdVector3& c = SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0)))
00043                 : m_basis(q),
00044                 m_origin(c),
00045                 m_type(RIGID)
00046         {}
00047
00048         explicit SIMD_FORCE_INLINE SimdTransform(const SimdMatrix3x3& b,
00049                 const SimdVector3& c = SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0)),
00050                 unsigned int type = AFFINE)
00051                 : m_basis(b),
00052                 m_origin(c),
00053                 m_type(type)
00054         {}
00055
00056
00057                 SIMD_FORCE_INLINE void mult(const SimdTransform& t1, const SimdTransform& t2) {
00058                         m_basis = t1.m_basis * t2.m_basis;
00059                         m_origin = t1(t2.m_origin);
00060                         m_type = t1.m_type | t2.m_type;
00061                 }
00062
00063                 void multInverseLeft(const SimdTransform& t1, const SimdTransform& t2) {
00064                         SimdVector3 v = t2.m_origin - t1.m_origin;
00065                         if (t1.m_type & SCALING) {
00066                                 SimdMatrix3x3 inv = t1.m_basis.inverse();
00067                                 m_basis = inv * t2.m_basis;
00068                                 m_origin = inv * v;
00069                         }
00070                         else {
00071                                 m_basis = SimdMultTransposeLeft(t1.m_basis, t2.m_basis);
00072                                 m_origin = v * t1.m_basis;
00073                         }
00074                         m_type = t1.m_type | t2.m_type;
00075                 }
00076
00077         SIMD_FORCE_INLINE SimdVector3 operator()(const SimdVector3& x) const
00078         {
00079                 return SimdVector3(m_basis[0].dot(x) + m_origin[0],
00080                         m_basis[1].dot(x) + m_origin[1],
00081                         m_basis[2].dot(x) + m_origin[2]);
00082         }
00083
00084         SIMD_FORCE_INLINE SimdVector3 operator*(const SimdVector3& x) const
00085         {
00086                 return (*this)(x);
00087         }
00088
00089         SIMD_FORCE_INLINE SimdMatrix3x3&       getBasis()          { return m_basis; }
00090         SIMD_FORCE_INLINE const SimdMatrix3x3& getBasis()    const { return m_basis; }
00091
00092         SIMD_FORCE_INLINE SimdVector3&         getOrigin()         { return m_origin; }
00093         SIMD_FORCE_INLINE const SimdVector3&   getOrigin()   const { return m_origin; }
00094
00095         SimdQuaternion getRotation() const {
00096                 SimdQuaternion q;
00097                 m_basis.getRotation(q);
00098                 return q;
00099         }
00100         template <typename Scalar2>
00101                 void setValue(const Scalar2 *m)
00102         {
00103                 m_basis.setValue(m);
00104                 m_origin.setValue(&m[12]);
00105                 m_type = AFFINE;
00106         }
00107
00108
00109         void setFromOpenGLMatrix(const SimdScalar *m)
00110         {
00111                 m_basis.setFromOpenGLSubMatrix(m);
00112                 m_origin[0] = m[12];
00113                 m_origin[1] = m[13];
00114                 m_origin[2] = m[14];
00115         }
00116
00117         void getOpenGLMatrix(SimdScalar *m) const
00118         {
00119                 m_basis.getOpenGLSubMatrix(m);
00120                 m[12] = m_origin[0];
00121                 m[13] = m_origin[1];
00122                 m[14] = m_origin[2];
00123                 m[15] = SimdScalar(1.0f);
00124         }
00125
00126         SIMD_FORCE_INLINE void setOrigin(const SimdVector3& origin)
00127         {
00128                 m_origin = origin;
00129                 m_type |= TRANSLATION;
00130         }
00131
00132         SIMD_FORCE_INLINE SimdVector3 invXform(const SimdVector3& inVec) const;
00133
00134
00135
00136         SIMD_FORCE_INLINE void setBasis(const SimdMatrix3x3& basis)
00137         {
00138                 m_basis = basis;
00139                 m_type |= LINEAR;
00140         }
00141
00142         SIMD_FORCE_INLINE void setRotation(const SimdQuaternion& q)
00143         {
00144                 m_basis.setRotation(q);
00145                 m_type = (m_type & ~LINEAR) | ROTATION;
00146         }
00147
00148         SIMD_FORCE_INLINE void scale(const SimdVector3& scaling)
00149         {
00150                 m_basis = m_basis.scaled(scaling);
00151                 m_type |= SCALING;
00152         }
00153
00154         void setIdentity()
00155         {
00156                 m_basis.setIdentity();
00157                 m_origin.setValue(SimdScalar(0.0), SimdScalar(0.0), SimdScalar(0.0));
00158                 m_type = 0x0;
00159         }
00160
00161         SIMD_FORCE_INLINE bool isIdentity() const { return m_type == 0x0; }
00162
00163         SimdTransform& operator*=(const SimdTransform& t)
00164         {
00165                 m_origin += m_basis * t.m_origin;
00166                 m_basis *= t.m_basis;
00167                 m_type |= t.m_type;
00168                 return *this;
00169         }
00170
00171         SimdTransform inverse() const
00172         {
00173                 if (m_type)
00174                 {
00175                         SimdMatrix3x3 inv = (m_type & SCALING) ?
00176                                 m_basis.inverse() :
00177                         m_basis.transpose();
00178
00179                         return SimdTransform(inv, inv * -m_origin, m_type);
00180                 }
00181
00182                 return *this;
00183         }
00184
00185         SimdTransform inverseTimes(const SimdTransform& t) const;
00186
00187         SimdTransform operator*(const SimdTransform& t) const;
00188
00189 private:
00190
00191         SimdMatrix3x3 m_basis;
00192         SimdVector3   m_origin;
00193         unsigned int      m_type;
00194 };
00195
00196
00197 SIMD_FORCE_INLINE SimdVector3
00198 SimdTransform::invXform(const SimdVector3& inVec) const
00199 {
00200         SimdVector3 v = inVec - m_origin;
00201         return (m_basis.transpose() * v);
00202 }
00203
00204 SIMD_FORCE_INLINE SimdTransform
00205 SimdTransform::inverseTimes(const SimdTransform& t) const
00206 {
00207         SimdVector3 v = t.getOrigin() - m_origin;
00208         if (m_type & SCALING)
00209         {
00210                 SimdMatrix3x3 inv = m_basis.inverse();
00211                 return SimdTransform(inv * t.getBasis(), inv * v,
00212                         m_type | t.m_type);
00213         }
00214         else
00215         {
00216                 return SimdTransform(m_basis.transposeTimes(t.m_basis),
00217                         v * m_basis, m_type | t.m_type);
00218         }
00219 }
00220
00221 SIMD_FORCE_INLINE SimdTransform
00222 SimdTransform::operator*(const SimdTransform& t) const
00223 {
00224         return SimdTransform(m_basis * t.m_basis,
00225                 (*this)(t.m_origin),
00226                 m_type | t.m_type);
00227 }
00228
00229
00230
00231 #endif
00232
00233
00234
00235
00236
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdTransformUtil.h File Reference

LinearMath

SimdTransformUtil.h File Reference

#include "SimdTransform.h"

Include dependency graph for SimdTransformUtil.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | SimdTransformUtil
Utils related to temporal transforms. More...

Defines

#define | ANGULAR_MOTION_TRESHOLD 0.5f*SIMD_HALF_PI
#define | SIMDSQRT12 SimdScalar(0.7071067811865475244008443621048490)
#define | SimdRecipSqrt(x) ((float)(1.0f/SimdSqrt(float(x))))

Functions

void | SimdPlaneSpace1 (const SimdVector3 &n, SimdVector3 &p, SimdVector3 &q)

Define Documentation

#define ANGULAR_MOTION_TRESHOLD 0.5f*SIMD_HALF_PI

Definition at line 20 of file SimdTransformUtil.h.

Referenced by SimdTransformUtil::IntegrateTransform().

#define SimdRecipSqrt ( x ) ((float)(1.0f/SimdSqrt(float(x))))

Definition at line 26 of file SimdTransformUtil.h.

Referenced by SimdPlaneSpace1().

#define SIMDSQRT12 SimdScalar(0.7071067811865475244008443621048490)

Definition at line 24 of file SimdTransformUtil.h.

Referenced by SimdPlaneSpace1().

Function Documentation

void SimdPlaneSpace1 | ( | const SimdVector3 & | n,
 |  | SimdVector3 & | p,
 |  | SimdVector3 & | q
 | ) | [inline]

Definition at line 29 of file SimdTransformUtil.h.

References SimdFabs(), SimdRecipSqrt, and SIMDSQRT12.

Referenced by HingeConstraint::BuildJacobian(), and SimpleConstraintSolver::Solve().

Generated on Wed May 24 13:59:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdTransformUtil.h Source File

LinearMath

SimdTransformUtil.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016 #ifndef SIMD_TRANSFORM_UTIL_H
00017 #define SIMD_TRANSFORM_UTIL_H
00018
00019 #include "SimdTransform.h"
00020 #define ANGULAR_MOTION_TRESHOLD 0.5f*SIMD_HALF_PI
00021
00022
00023
00024 #define SIMDSQRT12 SimdScalar(0.7071067811865475244008443621048490)
00025
00026 #define SimdRecipSqrt(x) ((float)(1.0f/SimdSqrt(float(x))))             /* reciprocal square root */
00027
00028
00029 inline void SimdPlaneSpace1 (const SimdVector3& n, SimdVector3& p, SimdVector3& q)
00030 {
00031   if (SimdFabs(n[2]) > SIMDSQRT12) {
00032     // choose p in y-z plane
00033     SimdScalar a = n[1]*n[1] + n[2]*n[2];
00034     SimdScalar k = SimdRecipSqrt (a);
00035     p[0] = 0;
00036     p[1] = -n[2]*k;
00037     p[2] = n[1]*k;
00038     // set q = n x p
00039     q[0] = a*k;
00040     q[1] = -n[0]*p[2];
00041     q[2] = n[0]*p[1];
00042   }
00043   else {
00044     // choose p in x-y plane
00045     SimdScalar a = n[0]*n[0] + n[1]*n[1];
00046     SimdScalar k = SimdRecipSqrt (a);
00047     p[0] = -n[1]*k;
00048     p[1] = n[0]*k;
00049     p[2] = 0;
00050     // set q = n x p
00051     q[0] = -n[2]*p[1];
00052     q[1] = n[2]*p[0];
00053     q[2] = a*k;
00054   }
00055 }
00056
00057
00058
00060 class SimdTransformUtil
00061 {
00062
00063 public:
00064
00065         static void IntegrateTransform(const SimdTransform& curTrans,const SimdVector3& linvel,const SimdVector3& angvel,SimdScalar timeStep,SimdTransform& predictedTransform)
00066         {
00067                 predictedTransform.setOrigin(curTrans.getOrigin() + linvel * timeStep);
00068 //      #define QUATERNION_DERIVATIVE
00069         #ifdef QUATERNION_DERIVATIVE
00070                 SimdQuaternion orn = curTrans.getRotation();
00071                 orn += (angvel * orn) * (timeStep * 0.5f);
00072                 orn.normalize();
00073         #else
00074                 //exponential map
00075                 SimdVector3 axis;
00076                 SimdScalar      fAngle = angvel.length();
00077                 //limit the angular motion
00078                 if (fAngle*timeStep > ANGULAR_MOTION_TRESHOLD)
00079                 {
00080                         fAngle = ANGULAR_MOTION_TRESHOLD / timeStep;
00081                 }
00082
00083                 if ( fAngle < 0.001f )
00084                 {
00085                         // use Taylor's expansions of sync function
00086                         axis   = angvel*( 0.5f*timeStep-(timeStep*timeStep*timeStep)*(0.020833333333f)*fAngle*fAngle );
00087                 }
00088                 else
00089                 {
00090                         // sync(fAngle) = sin(c*fAngle)/t
00091                         axis   = angvel*( SimdSin(0.5f*fAngle*timeStep)/fAngle );
00092                 }
00093                 SimdQuaternion dorn (axis.x(),axis.y(),axis.z(),SimdCos( fAngle*timeStep*0.5f ));
00094                 SimdQuaternion orn0 = curTrans.getRotation();
00095
00096                 SimdQuaternion predictedOrn = dorn * orn0;
00097         #endif
00098                 predictedTransform.setRotation(predictedOrn);
00099         }
00100
00101         static void     CalculateVelocity(const SimdTransform& transform0,const SimdTransform& transform1,SimdScalar timeStep,SimdVector3& linVel,SimdVector3& angVel)
00102         {
00103                 linVel = (transform1.getOrigin() - transform0.getOrigin()) / timeStep;
00104 #ifdef USE_QUATERNION_DIFF
00105                 SimdQuaternion orn0 = transform0.getRotation();
00106                 SimdQuaternion orn1a = transform1.getRotation();
00107                 SimdQuaternion orn1 = orn0.farthest(orn1a);
00108                 SimdQuaternion dorn = orn1 * orn0.inverse();
00109 #else
00110                 SimdMatrix3x3 dmat = transform1.getBasis() * transform0.getBasis().inverse();
00111                 SimdQuaternion dorn;
00112                 dmat.getRotation(dorn);
00113 #endif//USE_QUATERNION_DIFF
00114
00115                 SimdVector3 axis;
00116                 SimdScalar  angle;
00117                 angle = dorn.getAngle();
00118                 axis = SimdVector3(dorn.x(),dorn.y(),dorn.z());
00119                 axis[3] = 0.f;
00120                 //check for axis length
00121                 SimdScalar len = axis.length2();
00122                 if (len < SIMD_EPSILON*SIMD_EPSILON)
00123                         axis = SimdVector3(1.f,0.f,0.f);
00124                 else
00125                         axis /= SimdSqrt(len);
00126
00127
00128                 angVel = axis * angle / timeStep;
00129
00130         }
00131
00132
00133 };
00134
00135 #endif //SIMD_TRANSFORM_UTIL_H
00136
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdVector3.h File Reference

LinearMath

SimdVector3.h File Reference

#include "SimdQuadWord.h"

Include dependency graph for SimdVector3.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | SimdVector3
SimdVector3 is 16byte aligned, and has an extra unused component m_w this extra component can be used by derived classes (Quaternion?) or by user. More...
class | SimdVector4

Functions

SIMD_FORCE_INLINE SimdVector3 | operator+ (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdVector3 | operator * (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdVector3 | operator- (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdVector3 | operator- (const SimdVector3 &v)
SIMD_FORCE_INLINE SimdVector3 | operator * (const SimdVector3 &v, const SimdScalar &s)
SIMD_FORCE_INLINE SimdVector3 | operator * (const SimdScalar &s, const SimdVector3 &v)
SIMD_FORCE_INLINE SimdVector3 | operator/ (const SimdVector3 &v, const SimdScalar &s)
SIMD_FORCE_INLINE SimdVector3 | operator/ (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdScalar | dot (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdScalar | distance2 (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdScalar | distance (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdScalar | angle (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdVector3 | cross (const SimdVector3 &v1, const SimdVector3 &v2)
SIMD_FORCE_INLINE SimdScalar | triple (const SimdVector3 &v1, const SimdVector3 &v2, const SimdVector3 &v3)
SIMD_FORCE_INLINE SimdVector3 | lerp (const SimdVector3 &v1, const SimdVector3 &v2, const SimdScalar &t)
SIMD_FORCE_INLINE bool | operator== (const SimdVector3 &p1, const SimdVector3 &p2)

Function Documentation

SIMD_FORCE_INLINE SimdScalar angle | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 248 of file SimdVector3.h.

References SimdVector3::angle().

SIMD_FORCE_INLINE SimdVector3 cross | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 254 of file SimdVector3.h.

References SimdVector3::cross().

Referenced by TriangleShape::CalcNormal(), RigidBody::ComputeImpulseDenominator(), VoronoiSimplexSolver::PointOutsideOfPlane(), PersistentManifold::SortCachedPoints(), and Epa::TetrahedronContainsOrigin().

SIMD_FORCE_INLINE SimdScalar distance | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 242 of file SimdVector3.h.

References SimdVector3::distance().

Referenced by GjkPairDetector::GetClosestPoints(), and TriangleRaycastCallback::ProcessTriangle().

SIMD_FORCE_INLINE SimdScalar distance2 | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 235 of file SimdVector3.h.

References SimdVector3::distance2().

SIMD_FORCE_INLINE SimdScalar dot | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 227 of file SimdVector3.h.

References SimdVector3::dot().

SIMD_FORCE_INLINE SimdVector3 lerp | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2,
 |  | const SimdScalar & | t
 | ) |

Definition at line 266 of file SimdVector3.h.

References SimdVector3::lerp().

SIMD_FORCE_INLINE SimdVector3 operator * | ( | const SimdScalar & | s,
 |  | const SimdVector3 & | v
 | ) |

Definition at line 208 of file SimdVector3.h.

SIMD_FORCE_INLINE SimdVector3 operator * | ( | const SimdVector3 & | v,
 |  | const SimdScalar & | s
 | ) |

Definition at line 202 of file SimdVector3.h.

References SIMD_FORCE_INLINE, and SimdVector3::SimdVector3().

SIMD_FORCE_INLINE SimdVector3 operator * | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 184 of file SimdVector3.h.

References SIMD_FORCE_INLINE, SimdVector3::SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3 operator+ | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 178 of file SimdVector3.h.

References SIMD_FORCE_INLINE, SimdVector3::SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by __declspec().

SIMD_FORCE_INLINE SimdVector3 operator- ( const SimdVector3 & v )

Definition at line 196 of file SimdVector3.h.

References SIMD_FORCE_INLINE, SimdVector3::SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3 operator- | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 190 of file SimdVector3.h.

References SIMD_FORCE_INLINE, SimdVector3::SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3 operator/ | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) |

Definition at line 221 of file SimdVector3.h.

References SIMD_FORCE_INLINE, SimdVector3::SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3 operator/ | ( | const SimdVector3 & | v,
 |  | const SimdScalar & | s
 | ) |

Definition at line 214 of file SimdVector3.h.

References SIMD_FORCE_INLINE.

Referenced by __declspec().

SIMD_FORCE_INLINE bool operator== | ( | const SimdVector3 & | p1,
 |  | const SimdVector3 & | p2
 | ) |

Definition at line 272 of file SimdVector3.h.

Referenced by __declspec().

SIMD_FORCE_INLINE SimdScalar triple | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2,
 |  | const SimdVector3 & | v3
 | ) |

Definition at line 260 of file SimdVector3.h.

References SimdVector3::triple().

Referenced by SimdMatrix3x3::determinant().

Generated on Wed May 24 13:59:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdVector3.h Source File

LinearMath

SimdVector3.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans  http://continuousphysics.com/Bullet/
00003
00004 This software is provided 'as-is', without any express or implied warranty.
00005 In no event will the authors be held liable for any damages arising from the use of this software.
00006 Permission is granted to anyone to use this software for any purpose,
00007 including commercial applications, and to alter it and redistribute it freely,
00008 subject to the following restrictions:
00009
00010 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00011 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00012 3. This notice may not be removed or altered from any source distribution.
00013 */
00014
00015
00016
00017 #ifndef SIMD__VECTOR3_H
00018 #define SIMD__VECTOR3_H
00019
00020 #include "SimdQuadWord.h"
00021
00022
00025 class SimdVector3 : public SimdQuadWord {
00026
00027
00028 public:
00029         SIMD_FORCE_INLINE SimdVector3() {}
00030
00031
00032
00033         SIMD_FORCE_INLINE SimdVector3(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z)
00034                 :SimdQuadWord(x,y,z,0.f)
00035         {
00036         }
00037
00038 //      SIMD_FORCE_INLINE SimdVector3(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z,const SimdScalar& w)
00039 //              : SimdQuadWord(x,y,z,w)
00040 //      {
00041 //      }
00042
00043
00044
00045         SIMD_FORCE_INLINE SimdVector3& operator+=(const SimdVector3& v)
00046         {
00047                 m_x += v.x(); m_y += v.y(); m_z += v.z();
00048                 return *this;
00049         }
00050
00051
00052
00053         SIMD_FORCE_INLINE SimdVector3& operator-=(const SimdVector3& v)
00054         {
00055                 m_x -= v.x(); m_y -= v.y(); m_z -= v.z();
00056                 return *this;
00057         }
00058
00059         SIMD_FORCE_INLINE SimdVector3& operator*=(const SimdScalar& s)
00060         {
00061                 m_x *= s; m_y *= s; m_z *= s;
00062                 return *this;
00063         }
00064
00065         SIMD_FORCE_INLINE SimdVector3& operator/=(const SimdScalar& s)
00066         {
00067                 assert(s != SimdScalar(0.0));
00068                 return *this *= SimdScalar(1.0) / s;
00069         }
00070
00071         SIMD_FORCE_INLINE SimdScalar dot(const SimdVector3& v) const
00072         {
00073                 return m_x * v.x() + m_y * v.y() + m_z * v.z();
00074         }
00075
00076         SIMD_FORCE_INLINE SimdScalar length2() const
00077         {
00078                 return dot(*this);
00079         }
00080
00081         SIMD_FORCE_INLINE SimdScalar length() const
00082         {
00083                 return SimdSqrt(length2());
00084         }
00085
00086         SIMD_FORCE_INLINE SimdScalar distance2(const SimdVector3& v) const;
00087
00088         SIMD_FORCE_INLINE SimdScalar distance(const SimdVector3& v) const;
00089
00090         SIMD_FORCE_INLINE SimdVector3& normalize()
00091         {
00092                 return *this /= length();
00093         }
00094
00095         SIMD_FORCE_INLINE SimdVector3 normalized() const;
00096
00097         SIMD_FORCE_INLINE SimdVector3 rotate( const SimdVector3& wAxis, const SimdScalar angle );
00098
00099         SIMD_FORCE_INLINE SimdScalar angle(const SimdVector3& v) const
00100         {
00101                 SimdScalar s = SimdSqrt(length2() * v.length2());
00102                 assert(s != SimdScalar(0.0));
00103                 return SimdAcos(dot(v) / s);
00104         }
00105
00106         SIMD_FORCE_INLINE SimdVector3 absolute() const
00107         {
00108                 return SimdVector3(
00109                         SimdFabs(m_x),
00110                         SimdFabs(m_y),
00111                         SimdFabs(m_z));
00112         }
00113
00114         SIMD_FORCE_INLINE SimdVector3 cross(const SimdVector3& v) const
00115         {
00116                 return SimdVector3(
00117                         m_y * v.z() - m_z * v.y(),
00118                         m_z * v.x() - m_x * v.z(),
00119                         m_x * v.y() - m_y * v.x());
00120         }
00121
00122         SIMD_FORCE_INLINE SimdScalar triple(const SimdVector3& v1, const SimdVector3& v2) const
00123         {
00124                 return m_x * (v1.y() * v2.z() - v1.z() * v2.y()) +
00125                         m_y * (v1.z() * v2.x() - v1.x() * v2.z()) +
00126                         m_z * (v1.x() * v2.y() - v1.y() * v2.x());
00127         }
00128
00129         SIMD_FORCE_INLINE int minAxis() const
00130         {
00131                 return m_x < m_y ? (m_x < m_z ? 0 : 2) : (m_y < m_z ? 1 : 2);
00132         }
00133
00134         SIMD_FORCE_INLINE int maxAxis() const
00135         {
00136                 return m_x < m_y ? (m_y < m_z ? 2 : 1) : (m_x < m_z ? 2 : 0);
00137         }
00138
00139         SIMD_FORCE_INLINE int furthestAxis() const
00140         {
00141                 return absolute().minAxis();
00142         }
00143
00144         SIMD_FORCE_INLINE int closestAxis() const
00145         {
00146                 return absolute().maxAxis();
00147         }
00148
00149         SIMD_FORCE_INLINE void setInterpolate3(const SimdVector3& v0, const SimdVector3& v1, SimdScalar rt)
00150         {
00151                 SimdScalar s = 1.0f - rt;
00152                 m_x = s * v0[0] + rt * v1.x();
00153                 m_y = s * v0[1] + rt * v1.y();
00154                 m_z = s * v0[2] + rt * v1.z();
00155                 //don't do the unused w component
00156                 //              m_co[3] = s * v0[3] + rt * v1[3];
00157         }
00158
00159         SIMD_FORCE_INLINE SimdVector3 lerp(const SimdVector3& v, const SimdScalar& t) const
00160         {
00161                 return SimdVector3(m_x + (v.x() - m_x) * t,
00162                         m_y + (v.y() - m_y) * t,
00163                         m_z + (v.z() - m_z) * t);
00164         }
00165
00166
00167         SIMD_FORCE_INLINE SimdVector3& operator*=(const SimdVector3& v)
00168         {
00169                 m_x *= v.x(); m_y *= v.y(); m_z *= v.z();
00170                 return *this;
00171         }
00172
00173
00174
00175 };
00176
00177 SIMD_FORCE_INLINE SimdVector3
00178 operator+(const SimdVector3& v1, const SimdVector3& v2)
00179 {
00180         return SimdVector3(v1.x() + v2.x(), v1.y() + v2.y(), v1.z() + v2.z());
00181 }
00182
00183 SIMD_FORCE_INLINE SimdVector3
00184 operator*(const SimdVector3& v1, const SimdVector3& v2)
00185 {
00186         return SimdVector3(v1.x() * v2.x(), v1.y() * v2.y(), v1.z() *+ v2.z());
00187 }
00188
00189 SIMD_FORCE_INLINE SimdVector3
00190 operator-(const SimdVector3& v1, const SimdVector3& v2)
00191 {
00192         return SimdVector3(v1.x() - v2.x(), v1.y() - v2.y(), v1.z() - v2.z());
00193 }
00194
00195 SIMD_FORCE_INLINE SimdVector3
00196 operator-(const SimdVector3& v)
00197 {
00198         return SimdVector3(-v.x(), -v.y(), -v.z());
00199 }
00200
00201 SIMD_FORCE_INLINE SimdVector3
00202 operator*(const SimdVector3& v, const SimdScalar& s)
00203 {
00204         return SimdVector3(v.x() * s, v.y() * s, v.z() * s);
00205 }
00206
00207 SIMD_FORCE_INLINE SimdVector3
00208 operator*(const SimdScalar& s, const SimdVector3& v)
00209 {
00210         return v * s;
00211 }
00212
00213 SIMD_FORCE_INLINE SimdVector3
00214 operator/(const SimdVector3& v, const SimdScalar& s)
00215 {
00216         assert(s != SimdScalar(0.0));
00217         return v * (SimdScalar(1.0) / s);
00218 }
00219
00220 SIMD_FORCE_INLINE SimdVector3
00221 operator/(const SimdVector3& v1, const SimdVector3& v2)
00222 {
00223         return SimdVector3(v1.x() / v2.x(),v1.y() / v2.y(),v1.z() / v2.z());
00224 }
00225
00226 SIMD_FORCE_INLINE SimdScalar
00227 dot(const SimdVector3& v1, const SimdVector3& v2)
00228 {
00229         return v1.dot(v2);
00230 }
00231
00232
00233
00234 SIMD_FORCE_INLINE SimdScalar
00235 distance2(const SimdVector3& v1, const SimdVector3& v2)
00236 {
00237         return v1.distance2(v2);
00238 }
00239
00240
00241 SIMD_FORCE_INLINE SimdScalar
00242 distance(const SimdVector3& v1, const SimdVector3& v2)
00243 {
00244         return v1.distance(v2);
00245 }
00246
00247 SIMD_FORCE_INLINE SimdScalar
00248 angle(const SimdVector3& v1, const SimdVector3& v2)
00249 {
00250         return v1.angle(v2);
00251 }
00252
00253 SIMD_FORCE_INLINE SimdVector3
00254 cross(const SimdVector3& v1, const SimdVector3& v2)
00255 {
00256         return v1.cross(v2);
00257 }
00258
00259 SIMD_FORCE_INLINE SimdScalar
00260 triple(const SimdVector3& v1, const SimdVector3& v2, const SimdVector3& v3)
00261 {
00262         return v1.triple(v2, v3);
00263 }
00264
00265 SIMD_FORCE_INLINE SimdVector3
00266 lerp(const SimdVector3& v1, const SimdVector3& v2, const SimdScalar& t)
00267 {
00268         return v1.lerp(v2, t);
00269 }
00270
00271
00272 SIMD_FORCE_INLINE bool operator==(const SimdVector3& p1, const SimdVector3& p2)
00273 {
00274         return p1[0] == p2[0] && p1[1] == p2[1] && p1[2] == p2[2];
00275 }
00276
00277 SIMD_FORCE_INLINE SimdScalar SimdVector3::distance2(const SimdVector3& v) const
00278 {
00279         return (v - *this).length2();
00280 }
00281
00282 SIMD_FORCE_INLINE SimdScalar SimdVector3::distance(const SimdVector3& v) const
00283 {
00284         return (v - *this).length();
00285 }
00286
00287 SIMD_FORCE_INLINE SimdVector3 SimdVector3::normalized() const
00288 {
00289         return *this / length();
00290 }
00291
00292 SIMD_FORCE_INLINE SimdVector3 SimdVector3::rotate( const SimdVector3& wAxis, const SimdScalar angle )
00293 {
00294         // wAxis must be a unit lenght vector
00295
00296         SimdVector3 o = wAxis * wAxis.dot( *this );
00297         SimdVector3 x = *this - o;
00298         SimdVector3 y;
00299
00300         y = wAxis.cross( *this );
00301
00302         return ( o + x * SimdCos( angle ) + y * SimdSin( angle ) );
00303 }
00304
00305 class SimdVector4 : public SimdVector3
00306 {
00307 public:
00308
00309         SIMD_FORCE_INLINE SimdVector4() {}
00310
00311
00312         SIMD_FORCE_INLINE SimdVector4(const SimdScalar& x, const SimdScalar& y, const SimdScalar& z,const SimdScalar& w)
00313                 : SimdVector3(x,y,z)
00314         {
00315                 m_unusedW = w;
00316         }
00317
00318
00319         SIMD_FORCE_INLINE SimdVector4 absolute4() const
00320         {
00321                 return SimdVector4(
00322                         SimdFabs(m_x),
00323                         SimdFabs(m_y),
00324                         SimdFabs(m_z),
00325                         SimdFabs(m_unusedW));
00326         }
00327
00328
00329
00330         float   getW() const { return m_unusedW;}
00331
00332
00333                 SIMD_FORCE_INLINE int maxAxis4() const
00334         {
00335                 int maxIndex = -1;
00336                 float maxVal = -1e30f;
00337                 if (m_x > maxVal)
00338                 {
00339                         maxIndex = 0;
00340                         maxVal = m_x;
00341                 }
00342                 if (m_y > maxVal)
00343                 {
00344                         maxIndex = 1;
00345                         maxVal = m_y;
00346                 }
00347                 if (m_z > maxVal)
00348                 {
00349                         maxIndex = 2;
00350                         maxVal = m_z;
00351                 }
00352                 if (m_unusedW > maxVal)
00353                 {
00354                         maxIndex = 3;
00355                         maxVal = m_unusedW;
00356                 }
00357
00358
00359
00360
00361                 return maxIndex;
00362
00363         }
00364
00365
00366         SIMD_FORCE_INLINE int minAxis4() const
00367         {
00368                 int minIndex = -1;
00369                 float minVal = 1e30f;
00370                 if (m_x < minVal)
00371                 {
00372                         minIndex = 0;
00373                         minVal = m_x;
00374                 }
00375                 if (m_y < minVal)
00376                 {
00377                         minIndex = 1;
00378                         minVal = m_y;
00379                 }
00380                 if (m_z < minVal)
00381                 {
00382                         minIndex = 2;
00383                         minVal = m_z;
00384                 }
00385                 if (m_unusedW < minVal)
00386                 {
00387                         minIndex = 3;
00388                         minVal = m_unusedW;
00389                 }
00390
00391                 return minIndex;
00392
00393         }
00394
00395
00396         SIMD_FORCE_INLINE int closestAxis4() const
00397         {
00398                 return absolute4().maxAxis4();
00399         }
00400
00401 };
00402
00403 #endif //SIMD__VECTOR3_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleBroadphase.cpp File Reference

Bullet » BroadphaseCollision

SimpleBroadphase.cpp File Reference

#include "SimpleBroadphase.h"
#include "BroadphaseCollision/Dispatcher.h"
#include "BroadphaseCollision/CollisionAlgorithm.h"
#include "SimdVector3.h"
#include "SimdTransform.h"
#include "SimdMatrix3x3.h"
#include <vector>

Include dependency graph for SimpleBroadphase.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleBroadphase.cpp Source File

Bullet » BroadphaseCollision

SimpleBroadphase.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "SimpleBroadphase.h"
00017 #include "BroadphaseCollision/Dispatcher.h"
00018 #include "BroadphaseCollision/CollisionAlgorithm.h"
00019
00020 #include "SimdVector3.h"
00021 #include "SimdTransform.h"
00022 #include "SimdMatrix3x3.h"
00023 #include <vector>
00024
00025
00026 void    SimpleBroadphase::validate()
00027 {
00028         for (int i=0;i<m_numProxies;i++)
00029         {
00030                 for (int j=i+1;j<m_numProxies;j++)
00031                 {
00032                         assert(m_pProxies[i] != m_pProxies[j]);
00033                 }
00034         }
00035
00036 }
00037
00038 SimpleBroadphase::SimpleBroadphase(int maxProxies,int maxOverlap)
00039         :m_firstFreeProxy(0),
00040         m_numProxies(0),
00041         m_blockedForChanges(false),
00042         m_NumOverlapBroadphasePair(0),
00043         m_maxProxies(maxProxies),
00044         m_maxOverlap(maxOverlap)
00045 {
00046
00047         m_proxies = new SimpleBroadphaseProxy[maxProxies];
00048         m_freeProxies = new int[maxProxies];
00049         m_pProxies = new SimpleBroadphaseProxy*[maxProxies];
00050         m_OverlappingPairs = new BroadphasePair[maxOverlap];
00051
00052
00053         int i;
00054         for (i=0;i<m_maxProxies;i++)
00055         {
00056                 m_freeProxies[i] = i;
00057         }
00058 }
00059
00060 SimpleBroadphase::~SimpleBroadphase()
00061 {
00062         delete[] m_proxies;
00063         delete []m_freeProxies;
00064         delete [] m_pProxies;
00065         delete [] m_OverlappingPairs;
00066
00067         /*int i;
00068         for (i=m_numProxies-1;i>=0;i--)
00069         {
00070                 BP_Proxy* proxy = m_pProxies[i];
00071                 destroyProxy(proxy);
00072         }
00073         */
00074 }
00075
00076
00077 BroadphaseProxy*        SimpleBroadphase::CreateProxy(  const SimdVector3& min,  const SimdVector3& max,int shapeType,void* userPtr)
00078 {
00079         if (m_numProxies >= m_maxProxies)
00080         {
00081                 assert(0);
00082                 return 0; //should never happen, but don't let the game crash ;-)
00083         }
00084         assert(min[0]<= max[0] && min[1]<= max[1] && min[2]<= max[2]);
00085
00086         int freeIndex= m_freeProxies[m_firstFreeProxy];
00087         SimpleBroadphaseProxy* proxy = new (&m_proxies[freeIndex])SimpleBroadphaseProxy(min,max,shapeType,userPtr);
00088         m_firstFreeProxy++;
00089
00090         SimpleBroadphaseProxy* proxy1 = &m_proxies[0];
00091
00092         int index = proxy - proxy1;
00093         assert(index == freeIndex);
00094
00095         m_pProxies[m_numProxies] = proxy;
00096         m_numProxies++;
00097         //validate();
00098
00099         return proxy;
00100 }
00101
00102 void    SimpleBroadphase::RemoveOverlappingPairsContainingProxy(BroadphaseProxy* proxy)
00103 {
00104         int i;
00105                 for ( i=m_NumOverlapBroadphasePair-1;i>=0;i--)
00106                 {
00107                         BroadphasePair& pair = m_OverlappingPairs[i];
00108                         if (pair.m_pProxy0 == proxy ||
00109                                         pair.m_pProxy1 == proxy)
00110                         {
00111                                 RemoveOverlappingPair(pair);
00112                         }
00113                 }
00114 }
00115
00116 void    SimpleBroadphase::DestroyProxy(BroadphaseProxy* proxyOrg)
00117 {
00118
00119                 int i;
00120
00121                 SimpleBroadphaseProxy* proxy0 = static_cast<SimpleBroadphaseProxy*>(proxyOrg);
00122                 SimpleBroadphaseProxy* proxy1 = &m_proxies[0];
00123
00124                 int index = proxy0 - proxy1;
00125                 assert (index < m_maxProxies);
00126                 m_freeProxies[--m_firstFreeProxy] = index;
00127
00128                 RemoveOverlappingPairsContainingProxy(proxyOrg);
00129
00130
00131                 for (i=0;i<m_numProxies;i++)
00132                 {
00133                         if (m_pProxies[i] == proxyOrg)
00134                         {
00135                                 m_pProxies[i] = m_pProxies[m_numProxies-1];
00136                                 break;
00137                         }
00138                 }
00139                 m_numProxies--;
00140                 //validate();
00141
00142 }
00143
00144 void    SimpleBroadphase::SetAabb(BroadphaseProxy* proxy,const SimdVector3& aabbMin,const SimdVector3& aabbMax)
00145 {
00146         SimpleBroadphaseProxy* sbp = GetSimpleProxyFromProxy(proxy);
00147         sbp->m_min = aabbMin;
00148         sbp->m_max = aabbMax;
00149 }
00150
00151 void    SimpleBroadphase::CleanOverlappingPair(BroadphasePair& pair)
00152 {
00153         for (int dispatcherId=0;dispatcherId<SIMPLE_MAX_ALGORITHMS;dispatcherId++)
00154         {
00155                 if (pair.m_algorithms[dispatcherId])
00156                 {
00157                         {
00158                                 delete pair.m_algorithms[dispatcherId];
00159                                 pair.m_algorithms[dispatcherId]=0;
00160                         }
00161                 }
00162         }
00163 }
00164
00165
00166 void    SimpleBroadphase::CleanProxyFromPairs(BroadphaseProxy* proxy)
00167 {
00168         for (int i=0;i<m_NumOverlapBroadphasePair;i++)
00169         {
00170                 BroadphasePair& pair = m_OverlappingPairs[i];
00171                 if (pair.m_pProxy0 == proxy ||
00172                                 pair.m_pProxy1 == proxy)
00173                 {
00174                         CleanOverlappingPair(pair);
00175                 }
00176         }
00177 }
00178
00179 void    SimpleBroadphase::AddOverlappingPair(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1)
00180 {
00181         //don't add overlap with own
00182         assert(proxy0 != proxy1);
00183
00184         BroadphasePair pair(*proxy0,*proxy1);
00185         m_OverlappingPairs[m_NumOverlapBroadphasePair] = pair;
00186
00187         int i;
00188         for (i=0;i<SIMPLE_MAX_ALGORITHMS;i++)
00189         {
00190                 assert(!m_OverlappingPairs[m_NumOverlapBroadphasePair].m_algorithms[i]);
00191                 m_OverlappingPairs[m_NumOverlapBroadphasePair].m_algorithms[i] = 0;
00192         }
00193
00194         if (m_NumOverlapBroadphasePair >= m_maxOverlap)
00195         {
00196                 //printf("Error: too many overlapping objects: m_NumOverlapBroadphasePair: %d\n",m_NumOverlapBroadphasePair);
00197 #ifdef DEBUG
00198                 assert(0);
00199 #endif
00200         } else
00201         {
00202                 m_NumOverlapBroadphasePair++;
00203         }
00204
00205
00206 }
00207
00208 BroadphasePair* SimpleBroadphase::FindPair(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1)
00209 {
00210         BroadphasePair* foundPair = 0;
00211
00212         int i;
00213         for (i=m_NumOverlapBroadphasePair-1;i>=0;i--)
00214         {
00215                 BroadphasePair& pair = m_OverlappingPairs[i];
00216                 if (((pair.m_pProxy0 == proxy0) && (pair.m_pProxy1 == proxy1)) ||
00217                         ((pair.m_pProxy0 == proxy1) && (pair.m_pProxy1 == proxy0)))
00218                 {
00219                         foundPair = &pair;
00220                         return foundPair;
00221                 }
00222         }
00223
00224         return foundPair;
00225 }
00226 void    SimpleBroadphase::RemoveOverlappingPair(BroadphasePair& pair)
00227 {
00228     CleanOverlappingPair(pair);
00229         int     index = &pair - &m_OverlappingPairs[0];
00230         //remove efficiently, swap with the last
00231         m_OverlappingPairs[index] = m_OverlappingPairs[m_NumOverlapBroadphasePair-1];
00232         m_NumOverlapBroadphasePair--;
00233 }
00234
00235 bool    SimpleBroadphase::AabbOverlap(SimpleBroadphaseProxy* proxy0,SimpleBroadphaseProxy* proxy1)
00236 {
00237         return proxy0->m_min[0] <= proxy1->m_max[0] && proxy1->m_min[0] <= proxy0->m_max[0] &&
00238                    proxy0->m_min[1] <= proxy1->m_max[1] && proxy1->m_min[1] <= proxy0->m_max[1] &&
00239                    proxy0->m_min[2] <= proxy1->m_max[2] && proxy1->m_min[2] <= proxy0->m_max[2];
00240
00241 }
00242 void    SimpleBroadphase::RefreshOverlappingPairs()
00243 {
00244         //first check for new overlapping pairs
00245         int i,j;
00246
00247         for (i=0;i<m_numProxies;i++)
00248         {
00249                 BroadphaseProxy* proxy0 = m_pProxies[i];
00250                 for (j=i+1;j<m_numProxies;j++)
00251                 {
00252                         BroadphaseProxy* proxy1 = m_pProxies[j];
00253                         SimpleBroadphaseProxy* p0 = GetSimpleProxyFromProxy(proxy0);
00254                         SimpleBroadphaseProxy* p1 = GetSimpleProxyFromProxy(proxy1);
00255
00256                         if (AabbOverlap(p0,p1))
00257                         {
00258                                 if ( !FindPair(proxy0,proxy1))
00259                                 {
00260                                         AddOverlappingPair(proxy0,proxy1);
00261                                 }
00262                         }
00263
00264                 }
00265         }
00266
00267         //then remove non-overlapping ones
00268         for (i=0;i<m_NumOverlapBroadphasePair;i++)
00269         {
00270                 BroadphasePair& pair = m_OverlappingPairs[i];
00271                 SimpleBroadphaseProxy* proxy0 = GetSimpleProxyFromProxy(pair.m_pProxy0);
00272                 SimpleBroadphaseProxy* proxy1 = GetSimpleProxyFromProxy(pair.m_pProxy1);
00273                 if (!AabbOverlap(proxy0,proxy1))
00274                 {
00275             RemoveOverlappingPair(pair);
00276                 }
00277         }
00278
00279
00280
00281 }
00282
00283 void    SimpleBroadphase::DispatchAllCollisionPairs(Dispatcher& dispatcher,DispatcherInfo& dispatchInfo)
00284 {
00285         m_blockedForChanges = true;
00286
00287         int i;
00288
00289         int dispatcherId = dispatcher.GetUniqueId();
00290
00291         RefreshOverlappingPairs();
00292
00293         for (i=0;i<m_NumOverlapBroadphasePair;i++)
00294         {
00295
00296                 BroadphasePair& pair = m_OverlappingPairs[i];
00297
00298                 if (dispatcherId>= 0)
00299                 {
00300                         //dispatcher will keep algorithms persistent in the collision pair
00301                         if (!pair.m_algorithms[dispatcherId])
00302                         {
00303                                 pair.m_algorithms[dispatcherId] = dispatcher.FindAlgorithm(
00304                                         *pair.m_pProxy0,
00305                                         *pair.m_pProxy1);
00306                         }
00307
00308                         if (pair.m_algorithms[dispatcherId])
00309                         {
00310                                 if (dispatchInfo.m_dispatchFunc ==              DispatcherInfo::DISPATCH_DISCRETE)
00311                                 {
00312                                         pair.m_algorithms[dispatcherId]->ProcessCollision(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo);
00313                                 } else
00314                                 {
00315                                         float toi = pair.m_algorithms[dispatcherId]->CalculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo);
00316                                         if (dispatchInfo.m_timeOfImpact > toi)
00317                                                 dispatchInfo.m_timeOfImpact = toi;
00318
00319                                 }
00320                         }
00321                 } else
00322                 {
00323                         //non-persistent algorithm dispatcher
00324                                 CollisionAlgorithm* algo = dispatcher.FindAlgorithm(
00325                                         *pair.m_pProxy0,
00326                                         *pair.m_pProxy1);
00327
00328                                 if (algo)
00329                                 {
00330                                         if (dispatchInfo.m_dispatchFunc ==              DispatcherInfo::DISPATCH_DISCRETE)
00331                                         {
00332                                                 algo->ProcessCollision(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo);
00333                                         } else
00334                                         {
00335                                                 float toi = algo->CalculateTimeOfImpact(pair.m_pProxy0,pair.m_pProxy1,dispatchInfo);
00336                                                 if (dispatchInfo.m_timeOfImpact > toi)
00337                                                         dispatchInfo.m_timeOfImpact = toi;
00338                                         }
00339                                 }
00340                 }
00341
00342         }
00343
00344         m_blockedForChanges = false;
00345
00346 }
00347
00348
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleBroadphase.h File Reference

Bullet » BroadphaseCollision

SimpleBroadphase.h File Reference

#include "BroadphaseInterface.h"
#include "BroadphaseProxy.h"
#include "SimdPoint3.h"

Include dependency graph for SimpleBroadphase.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | SimpleBroadphaseProxy
class | SimpleBroadphase
SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks. More...

Generated on Wed May 24 13:59:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleBroadphase.h Source File

Bullet » BroadphaseCollision

SimpleBroadphase.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef SIMPLE_BROADPHASE_H
00017 #define SIMPLE_BROADPHASE_H
00018
00019 //#define SIMPLE_MAX_PROXIES 8192
00020 //#define SIMPLE_MAX_OVERLAP 4096
00021
00022 #include "BroadphaseInterface.h"
00023 #include "BroadphaseProxy.h"
00024 #include "SimdPoint3.h"
00025
00026 struct SimpleBroadphaseProxy : public BroadphaseProxy
00027 {
00028         SimdVector3     m_min;
00029         SimdVector3     m_max;
00030
00031         SimpleBroadphaseProxy() {};
00032
00033         SimpleBroadphaseProxy(const SimdPoint3& minpt,const SimdPoint3& maxpt,int shapeType,void* userPtr)
00034         :BroadphaseProxy(shapeType,userPtr),
00035         m_min(minpt),m_max(maxpt)
00036         {
00037         }
00038
00039
00040 };
00041
00043 class SimpleBroadphase : public BroadphaseInterface
00044 {
00045
00046         SimpleBroadphaseProxy*  m_proxies;
00047         int*                            m_freeProxies;
00048         int                             m_firstFreeProxy;
00049
00050         SimpleBroadphaseProxy** m_pProxies;
00051         int                             m_numProxies;
00052
00053         //during the dispatch, check that user doesn't destroy/create proxy
00054         bool            m_blockedForChanges;
00055
00056         BroadphasePair* m_OverlappingPairs;
00057         int     m_NumOverlapBroadphasePair;
00058
00059         int m_maxProxies;
00060         int m_maxOverlap;
00061
00062         inline SimpleBroadphaseProxy*   GetSimpleProxyFromProxy(BroadphaseProxy* proxy)
00063         {
00064                 SimpleBroadphaseProxy* proxy0 = static_cast<SimpleBroadphaseProxy*>(proxy);
00065                 return proxy0;
00066         }
00067
00068         bool    AabbOverlap(SimpleBroadphaseProxy* proxy0,SimpleBroadphaseProxy* proxy1);
00069
00070         void    validate();
00071
00072 protected:
00073         void    RemoveOverlappingPair(BroadphasePair& pair);
00074         void    CleanOverlappingPair(BroadphasePair& pair);
00075
00076         void    RemoveOverlappingPairsContainingProxy(BroadphaseProxy* proxy);
00077
00078         void    AddOverlappingPair(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1);
00079         BroadphasePair* FindPair(BroadphaseProxy* proxy0,BroadphaseProxy* proxy1);
00080         virtual void    RefreshOverlappingPairs();
00081 public:
00082         SimpleBroadphase(int maxProxies=4096,int maxOverlap=8192);
00083         virtual ~SimpleBroadphase();
00084
00085         virtual BroadphaseProxy*        CreateProxy(  const SimdVector3& min,  const SimdVector3& max,int shapeType,void* userPtr);
00086
00087         virtual void    DestroyProxy(BroadphaseProxy* proxy);
00088         virtual void    SetAabb(BroadphaseProxy* proxy,const SimdVector3& aabbMin,const SimdVector3& aabbMax);
00089         virtual void    CleanProxyFromPairs(BroadphaseProxy* proxy);
00090         virtual void    DispatchAllCollisionPairs(Dispatcher&   dispatcher,DispatcherInfo& dispatchInfo);
00091
00092 };
00093
00094
00095
00096 #endif //SIMPLE_BROADPHASE_H
00097
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleConstraintSolver.cpp File Reference

BulletDynamics » ConstraintSolver

SimpleConstraintSolver.cpp File Reference

#include "SimpleConstraintSolver.h"
#include "NarrowPhaseCollision/PersistentManifold.h"
#include "Dynamics/RigidBody.h"
#include "ContactConstraint.h"
#include "Solve2LinearConstraint.h"
#include "ContactSolverInfo.h"
#include "Dynamics/BU_Joint.h"
#include "Dynamics/ContactJoint.h"
#include "IDebugDraw.h"
#include "JacobianEntry.h"
#include "GEN_MinMax.h"

Include dependency graph for SimpleConstraintSolver.cpp:

Go to the source code of this file.

Defines

#define | NO_FRICTION_WARMSTART 1

Functions

bool | MyContactDestroyedCallback (void *userPersistentData)
SimdScalar | restitutionCurve (SimdScalar rel_vel, SimdScalar restitution)

Variables

int | totalCpd = 0
float | penetrationResolveFactor = 0.9f

Define Documentation

#define NO_FRICTION_WARMSTART 1

Referenced by SimpleConstraintSolver::Solve().

Function Documentation

bool MyContactDestroyedCallback ( void * userPersistentData )

Definition at line 37 of file SimpleConstraintSolver.cpp.

References totalCpd.

Referenced by SimpleConstraintSolver::SimpleConstraintSolver().

SimdScalar restitutionCurve | ( | SimdScalar | rel_vel,
 |  | SimdScalar | restitution
 | ) |

Definition at line 107 of file SimpleConstraintSolver.cpp.

Referenced by SimpleConstraintSolver::Solve().

Variable Documentation

float penetrationResolveFactor = 0.9f

Definition at line 106 of file SimpleConstraintSolver.cpp.

int totalCpd = 0

Definition at line 33 of file SimpleConstraintSolver.cpp.

Referenced by MyContactDestroyedCallback(), and SimpleConstraintSolver::Solve().

Generated on Wed May 24 13:59:42 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleConstraintSolver.cpp Source File

BulletDynamics » ConstraintSolver

SimpleConstraintSolver.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "SimpleConstraintSolver.h"
00018 #include "NarrowPhaseCollision/PersistentManifold.h"
00019 #include "Dynamics/RigidBody.h"
00020 #include "ContactConstraint.h"
00021 #include "Solve2LinearConstraint.h"
00022 #include "ContactSolverInfo.h"
00023 #include "Dynamics/BU_Joint.h"
00024 #include "Dynamics/ContactJoint.h"
00025 #include "IDebugDraw.h"
00026 #include "JacobianEntry.h"
00027 #include "GEN_MinMax.h"
00028
00029 #ifdef USE_PROFILE
00030 #include "quickprof.h"
00031 #endif //USE_PROFILE
00032
00033 int totalCpd = 0;
00034
00035
00036
00037 bool  MyContactDestroyedCallback(void* userPersistentData)
00038 {
00039         assert (userPersistentData);
00040         ConstraintPersistentData* cpd = (ConstraintPersistentData*)userPersistentData;
00041         delete cpd;
00042         totalCpd--;
00043         //printf("totalCpd = %i. DELETED Ptr %x\n",totalCpd,userPersistentData);
00044         return true;
00045 }
00046
00047
00048 SimpleConstraintSolver::SimpleConstraintSolver()
00049 {
00050         gContactCallback = &MyContactDestroyedCallback;
00051 }
00052
00053
00055 float SimpleConstraintSolver::SolveGroup(PersistentManifold** manifoldPtr, int numManifolds,const ContactSolverInfo& infoGlobal,IDebugDraw* debugDrawer)
00056 {
00057
00058         ContactSolverInfo info = infoGlobal;
00059
00060         int numiter = infoGlobal.m_numIterations;
00061 #ifdef USE_PROFILE
00062         Profiler::beginBlock("Solve");
00063 #endif //USE_PROFILE
00064
00065         //should traverse the contacts random order...
00066         int i;
00067         for ( i = 0;i<numiter;i++)
00068         {
00069                 int j;
00070                 for (j=0;j<numManifolds;j++)
00071                 {
00072                         int k=j;
00073                         if (i&1)
00074                                 k=numManifolds-j-1;
00075
00076                         Solve(manifoldPtr[k],info,i,debugDrawer);
00077                 }
00078
00079         }
00080 #ifdef USE_PROFILE
00081         Profiler::endBlock("Solve");
00082
00083         Profiler::beginBlock("SolveFriction");
00084 #endif //USE_PROFILE
00085
00086         //now solve the friction
00087         for (i = 0;i<numiter;i++)
00088         {
00089                 int j;
00090         for (j=0;j<numManifolds;j++)
00091                 {
00092                         int k = j;
00093                         if (i&1)
00094                                 k=numManifolds-j-1;
00095                         SolveFriction(manifoldPtr[k],info,i,debugDrawer);
00096                 }
00097         }
00098 #ifdef USE_PROFILE
00099         Profiler::endBlock("SolveFriction");
00100 #endif //USE_PROFILE
00101
00102         return 0.f;
00103 }
00104
00105
00106 float penetrationResolveFactor = 0.9f;
00107 SimdScalar restitutionCurve(SimdScalar rel_vel, SimdScalar restitution)
00108 {
00109         SimdScalar rest = restitution * -rel_vel;
00110         return rest;
00111 }
00112
00113
00114
00115
00116 float SimpleConstraintSolver::Solve(PersistentManifold* manifoldPtr, const ContactSolverInfo& info,int iter,IDebugDraw* debugDrawer)
00117 {
00118
00119         RigidBody* body0 = (RigidBody*)manifoldPtr->GetBody0();
00120         RigidBody* body1 = (RigidBody*)manifoldPtr->GetBody1();
00121
00122         float maxImpulse = 0.f;
00123
00124         //only necessary to refresh the manifold once (first iteration). The integration is done outside the loop
00125         if (iter == 0)
00126         {
00127                 manifoldPtr->RefreshContactPoints(body0->getCenterOfMassTransform(),body1->getCenterOfMassTransform());
00128
00129                 int numpoints = manifoldPtr->GetNumContacts();
00130
00131                 SimdVector3 color(0,1,0);
00132                 for (int i=0;i<numpoints ;i++)
00133                 {
00134                         ManifoldPoint& cp = manifoldPtr->GetContactPoint(i);
00135                         if (cp.GetDistance() <= 0.f)
00136                         {
00137                                 const SimdVector3& pos1 = cp.GetPositionWorldOnA();
00138                                 const SimdVector3& pos2 = cp.GetPositionWorldOnB();
00139
00140                                 SimdVector3 rel_pos1 = pos1 - body0->getCenterOfMassPosition();
00141                                 SimdVector3 rel_pos2 = pos2 - body1->getCenterOfMassPosition();
00142
00143
00144                                 //this jacobian entry is re-used for all iterations
00145                                 JacobianEntry jac(body0->getCenterOfMassTransform().getBasis().transpose(),
00146                                         body1->getCenterOfMassTransform().getBasis().transpose(),
00147                                         rel_pos1,rel_pos2,cp.m_normalWorldOnB,body0->getInvInertiaDiagLocal(),body0->getInvMass(),
00148                                         body1->getInvInertiaDiagLocal(),body1->getInvMass());
00149
00150
00151                                 SimdScalar jacDiagAB = jac.getDiagonal();
00152
00153                                 ConstraintPersistentData* cpd = (ConstraintPersistentData*) cp.m_userPersistentData;
00154                                 if (cpd)
00155                                 {
00156                                         //might be invalid
00157                                         cpd->m_persistentLifeTime++;
00158                                         if (cpd->m_persistentLifeTime != cp.GetLifeTime())
00159                                         {
00160                                                 //printf("Invalid: cpd->m_persistentLifeTime = %i cp.GetLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.GetLifeTime());
00161                                                 new (cpd) ConstraintPersistentData;
00162                                                 cpd->m_persistentLifeTime = cp.GetLifeTime();
00163
00164                                         } else
00165                                         {
00166                                                 //printf("Persistent: cpd->m_persistentLifeTime = %i cp.GetLifeTime() = %i\n",cpd->m_persistentLifeTime,cp.GetLifeTime());
00167
00168                                         }
00169                                 } else
00170                                 {
00171
00172                                         cpd = new ConstraintPersistentData();
00173                                         totalCpd ++;
00174                                         //printf("totalCpd = %i Created Ptr %x\n",totalCpd,cpd);
00175                                         cp.m_userPersistentData = cpd;
00176                                         cpd->m_persistentLifeTime = cp.GetLifeTime();
00177                                         //printf("CREATED: %x . cpd->m_persistentLifeTime = %i cp.GetLifeTime() = %i\n",cpd,cpd->m_persistentLifeTime,cp.GetLifeTime());
00178
00179                                 }
00180                                 assert(cpd);
00181
00182                                 cpd->m_jacDiagABInv = 1.f / jacDiagAB;
00183
00184
00185                                 SimdVector3 vel1 = body0->getVelocityInLocalPoint(rel_pos1);
00186                                 SimdVector3 vel2 = body1->getVelocityInLocalPoint(rel_pos2);
00187                                 SimdVector3 vel = vel1 - vel2;
00188                                 SimdScalar rel_vel;
00189                                 rel_vel = cp.m_normalWorldOnB.dot(vel);
00190
00191                                 float combinedRestitution = body0->getRestitution() * body1->getRestitution();
00192
00193                                 cpd->m_penetration = cp.GetDistance();
00194
00195                                 cpd->m_restitution = restitutionCurve(rel_vel, combinedRestitution);
00196                                 if (cpd->m_restitution <= 0.) //0.f)
00197                                 {
00198                                         cpd->m_restitution = 0.0f;
00199
00200                                 };
00201
00202                                 //restitution and penetration work in same direction so
00203                                 //rel_vel
00204
00205                                 SimdScalar penVel = -cpd->m_penetration/info.m_timeStep;
00206
00207                                 if (cpd->m_restitution >= penVel)
00208                                 {
00209                                         cpd->m_penetration = 0.f;
00210                                 }
00211
00212
00213                                 float relaxation = info.m_damping;
00214                                 cpd->m_appliedImpulse *= relaxation;
00215                                 //for friction
00216                                 cpd->m_prevAppliedImpulse = cpd->m_appliedImpulse;
00217
00218                                 //re-calculate friction direction every frame, todo: check if this is really needed
00219                                 SimdPlaneSpace1(cp.m_normalWorldOnB,cpd->m_frictionWorldTangential0,cpd->m_frictionWorldTangential1);
00220
00221
00222 #define NO_FRICTION_WARMSTART 1
00223
00224         #ifdef NO_FRICTION_WARMSTART
00225                                 cpd->m_accumulatedTangentImpulse0 = 0.f;
00226                                 cpd->m_accumulatedTangentImpulse1 = 0.f;
00227         #endif //NO_FRICTION_WARMSTART
00228                                 float denom0 = body0->ComputeImpulseDenominator(pos1,cpd->m_frictionWorldTangential0);
00229                                 float denom1 = body1->ComputeImpulseDenominator(pos2,cpd->m_frictionWorldTangential0);
00230                                 float denom = relaxation/(denom0+denom1);
00231                                 cpd->m_jacDiagABInvTangent0 = denom;
00232
00233
00234                                 denom0 = body0->ComputeImpulseDenominator(pos1,cpd->m_frictionWorldTangential1);
00235                                 denom1 = body1->ComputeImpulseDenominator(pos2,cpd->m_frictionWorldTangential1);
00236                                 denom = relaxation/(denom0+denom1);
00237                                 cpd->m_jacDiagABInvTangent1 = denom;
00238
00239                                 SimdVector3 totalImpulse =
00240         #ifndef NO_FRICTION_WARMSTART
00241                                         cp.m_frictionWorldTangential0*cp.m_accumulatedTangentImpulse0+
00242                                         cp.m_frictionWorldTangential1*cp.m_accumulatedTangentImpulse1+
00243         #endif //NO_FRICTION_WARMSTART
00244                                         cp.m_normalWorldOnB*cpd->m_appliedImpulse;
00245
00246                                 //apply previous frames impulse on both bodies
00247                                 body0->applyImpulse(totalImpulse, rel_pos1);
00248                                 body1->applyImpulse(-totalImpulse, rel_pos2);
00249                         }
00250
00251                 }
00252         }
00253
00254         {
00255                 const int numpoints = manifoldPtr->GetNumContacts();
00256
00257                 SimdVector3 color(0,1,0);
00258                 for (int i=0;i<numpoints ;i++)
00259                 {
00260
00261                         int j=i;
00262                         if (iter % 2)
00263                                 j = numpoints-1-i;
00264                         else
00265                                 j=i;
00266
00267                         ManifoldPoint& cp = manifoldPtr->GetContactPoint(j);
00268                                 if (cp.GetDistance() <= 0.f)
00269                         {
00270
00271                                 if (iter == 0)
00272                                 {
00273                                         if (debugDrawer)
00274                                                 debugDrawer->DrawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.GetDistance(),cp.GetLifeTime(),color);
00275                                 }
00276
00277                                 {
00278
00279
00280                                         //float dist =  cp.GetDistance();
00281                                         //printf("dist(%i)=%f\n",j,dist);
00282                                         float impulse = resolveSingleCollision(
00283                                                 *body0,*body1,
00284                                                 cp,
00285                                                 info);
00286
00287                                         if (maxImpulse < impulse)
00288                                                 maxImpulse  = impulse;
00289
00290                                 }
00291                         }
00292                 }
00293         }
00294         return maxImpulse;
00295 }
00296
00297 float SimpleConstraintSolver::SolveFriction(PersistentManifold* manifoldPtr, const ContactSolverInfo& info,int iter,IDebugDraw* debugDrawer)
00298 {
00299         RigidBody* body0 = (RigidBody*)manifoldPtr->GetBody0();
00300         RigidBody* body1 = (RigidBody*)manifoldPtr->GetBody1();
00301
00302
00303         {
00304                 const int numpoints = manifoldPtr->GetNumContacts();
00305
00306                 SimdVector3 color(0,1,0);
00307                 for (int i=0;i<numpoints ;i++)
00308                 {
00309
00310                         int j=i;
00311                         //if (iter % 2)
00312                         //      j = numpoints-1-i;
00313
00314                         ManifoldPoint& cp = manifoldPtr->GetContactPoint(j);
00315                                 if (cp.GetDistance() <= 0.f)
00316                         {
00317
00318                                 resolveSingleFriction(
00319                                         *body0,*body1,
00320                                         cp,
00321                                         info);
00322
00323                         }
00324                 }
00325
00326
00327         }
00328         return 0.f;
00329 }
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleConstraintSolver.h File Reference

BulletDynamics » ConstraintSolver

SimpleConstraintSolver.h File Reference

#include "ConstraintSolver.h"

Include dependency graph for SimpleConstraintSolver.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class SimpleConstraintSolver
SimpleConstraintSolver uses a Propagation Method and Sequentially applies impulses The approach is the 3D version of Erin Catto's GDC 2006 tutorial. More...

Generated on Wed May 24 13:59:42 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleConstraintSolver.h Source File

BulletDynamics » ConstraintSolver

SimpleConstraintSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef SIMPLE_CONSTRAINT_SOLVER_H
00017 #define SIMPLE_CONSTRAINT_SOLVER_H
00018
00019 #include "ConstraintSolver.h"
00020 class IDebugDraw;
00021
00026 class SimpleConstraintSolver : public ConstraintSolver
00027 {
00028         float Solve(PersistentManifold* manifold, const ContactSolverInfo& info,int iter,IDebugDraw* debugDrawer);
00029         float SolveFriction(PersistentManifold* manifoldPtr, const ContactSolverInfo& info,int iter,IDebugDraw* debugDrawer);
00030
00031
00032 public:
00033
00034         SimpleConstraintSolver();
00035
00036         virtual ~SimpleConstraintSolver() {}
00037
00038         virtual float SolveGroup(PersistentManifold** manifold,int numManifolds,const ContactSolverInfo& info, IDebugDraw* debugDrawer=0);
00039
00040 };
00041
00042 #endif //SIMPLE_CONSTRAINT_SOLVER_H
00043
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Simplex1to4Shape.cpp File Reference

Bullet » CollisionShapes

Simplex1to4Shape.cpp File Reference

#include "Simplex1to4Shape.h"
#include "SimdMatrix3x3.h"

Include dependency graph for Simplex1to4Shape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:43 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Simplex1to4Shape.cpp Source File

Bullet » CollisionShapes

Simplex1to4Shape.cpp

Go to the documentation of this file.
00001
00002 /*
00003 Bullet Continuous Collision Detection and Physics Library
00004 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00005
00006 This software is provided 'as-is', without any express or implied warranty.
00007 In no event will the authors be held liable for any damages arising from the use of this software.
00008 Permission is granted to anyone to use this software for any purpose,
00009 including commercial applications, and to alter it and redistribute it freely,
00010 subject to the following restrictions:
00011
00012 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00014 3. This notice may not be removed or altered from any source distribution.
00015 */
00016 #include "Simplex1to4Shape.h"
00017 #include "SimdMatrix3x3.h"
00018
00019 BU_Simplex1to4::BU_Simplex1to4()
00020 :m_numVertices(0)
00021 {
00022 }
00023
00024 BU_Simplex1to4::BU_Simplex1to4(const SimdPoint3& pt0)
00025 :m_numVertices(0)
00026 {
00027         AddVertex(pt0);
00028 }
00029
00030 BU_Simplex1to4::BU_Simplex1to4(const SimdPoint3& pt0,const SimdPoint3& pt1)
00031 :m_numVertices(0)
00032 {
00033         AddVertex(pt0);
00034         AddVertex(pt1);
00035 }
00036
00037 BU_Simplex1to4::BU_Simplex1to4(const SimdPoint3& pt0,const SimdPoint3& pt1,const SimdPoint3& pt2)
00038 :m_numVertices(0)
00039 {
00040         AddVertex(pt0);
00041         AddVertex(pt1);
00042         AddVertex(pt2);
00043 }
00044
00045 BU_Simplex1to4::BU_Simplex1to4(const SimdPoint3& pt0,const SimdPoint3& pt1,const SimdPoint3& pt2,const SimdPoint3& pt3)
00046 :m_numVertices(0)
00047 {
00048         AddVertex(pt0);
00049         AddVertex(pt1);
00050         AddVertex(pt2);
00051         AddVertex(pt3);
00052 }
00053
00054
00055
00056
00057
00058 void BU_Simplex1to4::AddVertex(const SimdPoint3& pt)
00059 {
00060         m_vertices[m_numVertices++] = pt;
00061 }
00062
00063
00064 int     BU_Simplex1to4::GetNumVertices() const
00065 {
00066         return m_numVertices;
00067 }
00068
00069 int BU_Simplex1to4::GetNumEdges() const
00070 {
00071         //euler formula, F-E+V = 2, so E = F+V-2
00072
00073         switch (m_numVertices)
00074         {
00075         case 0:
00076                 return 0;
00077         case 1: return 0;
00078         case 2: return 1;
00079         case 3: return 3;
00080         case 4: return 6;
00081
00082
00083         }
00084
00085         return 0;
00086 }
00087
00088 void BU_Simplex1to4::GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const
00089 {
00090
00091     switch (m_numVertices)
00092         {
00093
00094         case 2:
00095                 pa = m_vertices[0];
00096                 pb = m_vertices[1];
00097                 break;
00098         case 3:
00099                 switch (i)
00100                 {
00101                 case 0:
00102                         pa = m_vertices[0];
00103                         pb = m_vertices[1];
00104                         break;
00105                 case 1:
00106                         pa = m_vertices[1];
00107                         pb = m_vertices[2];
00108                         break;
00109                 case 2:
00110                         pa = m_vertices[2];
00111                         pb = m_vertices[0];
00112                         break;
00113
00114                 }
00115                 break;
00116         case 4:
00117                 switch (i)
00118                 {
00119                 case 0:
00120                         pa = m_vertices[0];
00121                         pb = m_vertices[1];
00122                         break;
00123                 case 1:
00124                         pa = m_vertices[1];
00125                         pb = m_vertices[2];
00126                         break;
00127                 case 2:
00128                         pa = m_vertices[2];
00129                         pb = m_vertices[0];
00130                         break;
00131                 case 3:
00132                         pa = m_vertices[0];
00133                         pb = m_vertices[3];
00134                         break;
00135                 case 4:
00136                         pa = m_vertices[1];
00137                         pb = m_vertices[3];
00138                         break;
00139                 case 5:
00140                         pa = m_vertices[2];
00141                         pb = m_vertices[3];
00142                         break;
00143                 }
00144
00145         }
00146
00147
00148
00149
00150 }
00151
00152 void BU_Simplex1to4::GetVertex(int i,SimdPoint3& vtx) const
00153 {
00154         vtx = m_vertices[i];
00155 }
00156
00157 int     BU_Simplex1to4::GetNumPlanes() const
00158 {
00159         switch (m_numVertices)
00160         {
00161         case 0:
00162                         return 0;
00163         case 1:
00164                         return 0;
00165         case 2:
00166                         return 0;
00167         case 3:
00168                         return 2;
00169         case 4:
00170                         return 4;
00171         default:
00172                 {
00173                 }
00174         }
00175         return 0;
00176 }
00177
00178
00179 void BU_Simplex1to4::GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i) const
00180 {
00181
00182 }
00183
00184 int BU_Simplex1to4::GetIndex(int i) const
00185 {
00186         return 0;
00187 }
00188
00189 bool BU_Simplex1to4::IsInside(const SimdPoint3& pt,SimdScalar tolerance) const
00190 {
00191         return false;
00192 }
00193
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Simplex1to4Shape.h File Reference

Bullet » CollisionShapes

Simplex1to4Shape.h File Reference

#include <CollisionShapes/PolyhedralConvexShape.h>
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for Simplex1to4Shape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class BU_Simplex1to4
BU_Simplex1to4 implements feature based and implicit simplex of up to 4 vertices (tetrahedron, triangle, line, vertex). More...

Generated on Wed May 24 13:59:43 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Simplex1to4Shape.h Source File

Bullet » CollisionShapes

Simplex1to4Shape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef BU_SIMPLEX_1TO4_SHAPE
00017 #define BU_SIMPLEX_1TO4_SHAPE
00018
00019
00020 #include <CollisionShapes/PolyhedralConvexShape.h>
00021 #include "BroadphaseCollision/BroadphaseProxy.h"
00022
00023
00025 class BU_Simplex1to4 : public PolyhedralConvexShape
00026 {
00027 protected:
00028
00029         int     m_numVertices;
00030         SimdPoint3      m_vertices[4];
00031
00032 public:
00033         BU_Simplex1to4();
00034
00035         BU_Simplex1to4(const SimdPoint3& pt0);
00036         BU_Simplex1to4(const SimdPoint3& pt0,const SimdPoint3& pt1);
00037         BU_Simplex1to4(const SimdPoint3& pt0,const SimdPoint3& pt1,const SimdPoint3& pt2);
00038         BU_Simplex1to4(const SimdPoint3& pt0,const SimdPoint3& pt1,const SimdPoint3& pt2,const SimdPoint3& pt3);
00039
00040
00041         void    Reset()
00042         {
00043                 m_numVertices = 0;
00044         }
00045
00046
00047         virtual int     GetShapeType() const{ return TETRAHEDRAL_SHAPE_PROXYTYPE; }
00048
00049         void AddVertex(const SimdPoint3& pt);
00050
00051         //PolyhedralConvexShape interface
00052
00053         virtual int     GetNumVertices() const;
00054
00055         virtual int GetNumEdges() const;
00056
00057         virtual void GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const;
00058
00059         virtual void GetVertex(int i,SimdPoint3& vtx) const;
00060
00061         virtual int     GetNumPlanes() const;
00062
00063         virtual void GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i) const;
00064
00065         virtual int GetIndex(int i) const;
00066
00067         virtual bool IsInside(const SimdPoint3& pt,SimdScalar tolerance) const;
00068
00069
00071         virtual  char*  GetName()const { return "BU_Simplex1to4";}
00072
00073 };
00074
00075 #endif //BU_SIMPLEX_1TO4_SHAPE
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimplexSolverInterface.h File Reference

Bullet » NarrowPhaseCollision

SimplexSolverInterface.h File Reference

#include "SimdVector3.h"
#include "SimdPoint3.h"
#include "VoronoiSimplexSolver.h"

Include dependency graph for SimplexSolverInterface.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | NO_VIRTUAL_INTERFACE 1
#define | SimplexSolverInterface VoronoiSimplexSolver

Define Documentation

#define NO_VIRTUAL_INTERFACE 1

Definition at line 24 of file SimplexSolverInterface.h.

#define SimplexSolverInterface VoronoiSimplexSolver

Definition at line 27 of file SimplexSolverInterface.h.

Generated on Wed May 24 13:59:44 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimplexSolverInterface.h Source File

Bullet » NarrowPhaseCollision

SimplexSolverInterface.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #ifndef SIMPLEX_SOLVER_INTERFACE_H
00019 #define SIMPLEX_SOLVER_INTERFACE_H
00020
00021 #include "SimdVector3.h"
00022 #include "SimdPoint3.h"
00023
00024 #define NO_VIRTUAL_INTERFACE 1
00025 #ifdef NO_VIRTUAL_INTERFACE
00026 #include "VoronoiSimplexSolver.h"
00027 #define SimplexSolverInterface VoronoiSimplexSolver
00028 #else
00029
00033 class SimplexSolverInterface
00034 {
00035         public:
00036                 virtual ~SimplexSolverInterface() {};
00037
00038         virtual void reset() = 0;
00039
00040         virtual void addVertex(const SimdVector3& w, const SimdPoint3& p, const SimdPoint3& q) = 0;
00041
00042         virtual bool closest(SimdVector3& v) = 0;
00043
00044         virtual SimdScalar maxVertex() = 0;
00045
00046         virtual bool fullSimplex() const = 0;
00047
00048         virtual int getSimplex(SimdPoint3 *pBuf, SimdPoint3 *qBuf, SimdVector3 *yBuf) const = 0;
00049
00050         virtual bool inSimplex(const SimdVector3& w) = 0;
00051
00052         virtual void backup_closest(SimdVector3& v) = 0;
00053
00054         virtual bool emptySimplex() const = 0;
00055
00056         virtual void compute_points(SimdPoint3& p1, SimdPoint3& p2) = 0;
00057
00058         virtual int numVertices() const =0;
00059
00060
00061 };
00062 #endif
00063 #endif //SIMPLEX_SOLVER_INTERFACE_H
00064
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Solve2LinearConstraint.cpp File Reference

BulletDynamics » ConstraintSolver

Solve2LinearConstraint.cpp File Reference

#include "Solve2LinearConstraint.h"
#include "Dynamics/RigidBody.h"
#include "SimdVector3.h"
#include "JacobianEntry.h"

Include dependency graph for Solve2LinearConstraint.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:44 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Solve2LinearConstraint.cpp Source File

BulletDynamics » ConstraintSolver

Solve2LinearConstraint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #include "Solve2LinearConstraint.h"
00019
00020 #include "Dynamics/RigidBody.h"
00021 #include "SimdVector3.h"
00022 #include "JacobianEntry.h"
00023
00024
00025 void Solve2LinearConstraint::resolveUnilateralPairConstraint(
00026                                                                                                    RigidBody* body1,
00027                 RigidBody* body2,
00028
00029                                                 const SimdMatrix3x3& world2A,
00030                                                 const SimdMatrix3x3& world2B,
00031
00032                                                 const SimdVector3& invInertiaADiag,
00033                                                 const SimdScalar invMassA,
00034                                                 const SimdVector3& linvelA,const SimdVector3& angvelA,
00035                                                 const SimdVector3& rel_posA1,
00036                                                 const SimdVector3& invInertiaBDiag,
00037                                                 const SimdScalar invMassB,
00038                                                 const SimdVector3& linvelB,const SimdVector3& angvelB,
00039                                                 const SimdVector3& rel_posA2,
00040
00041                                           SimdScalar depthA, const SimdVector3& normalA,
00042                                           const SimdVector3& rel_posB1,const SimdVector3& rel_posB2,
00043                                           SimdScalar depthB, const SimdVector3& normalB,
00044                                           SimdScalar& imp0,SimdScalar& imp1)
00045 {
00046
00047         imp0 = 0.f;
00048         imp1 = 0.f;
00049
00050         SimdScalar len = fabs(normalA.length())-1.f;
00051         if (fabs(len) >= SIMD_EPSILON)
00052                 return;
00053
00054         ASSERT(len < SIMD_EPSILON);
00055
00056
00057         //this jacobian entry could be re-used for all iterations
00058         JacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA,
00059                 invInertiaBDiag,invMassB);
00060         JacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA,
00061                 invInertiaBDiag,invMassB);
00062
00063         //const SimdScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
00064         //const SimdScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
00065
00066         const SimdScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1));
00067         const SimdScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1));
00068
00069 //      SimdScalar penetrationImpulse = (depth*contactTau*timeCorrection)  * massTerm;//jacDiagABInv
00070         SimdScalar massTerm = 1.f / (invMassA + invMassB);
00071
00072
00073         // calculate rhs (or error) terms
00074         const SimdScalar dv0 = depthA  * m_tau * massTerm - vel0 * m_damping;
00075         const SimdScalar dv1 = depthB  * m_tau * massTerm - vel1 * m_damping;
00076
00077
00078         // dC/dv * dv = -C
00079
00080         // jacobian * impulse = -error
00081         //
00082
00083         //impulse = jacobianInverse * -error
00084
00085         // inverting 2x2 symmetric system (offdiagonal are equal!)
00086         //
00087
00088
00089         SimdScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB);
00090         SimdScalar      invDet = 1.0f / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag );
00091
00092         //imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
00093         //imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
00094
00095         imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
00096         imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
00097
00098         //[a b]                                                           [d -c]
00099         //[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc)
00100
00101         //[jA nD] * [imp0] = [dv0]
00102         //[nD jB]   [imp1]   [dv1]
00103
00104 }
00105
00106
00107
00108 void Solve2LinearConstraint::resolveBilateralPairConstraint(
00109                                                 RigidBody* body1,
00110                                                 RigidBody* body2,
00111                                                 const SimdMatrix3x3& world2A,
00112                                                 const SimdMatrix3x3& world2B,
00113
00114                                                 const SimdVector3& invInertiaADiag,
00115                                                 const SimdScalar invMassA,
00116                                                 const SimdVector3& linvelA,const SimdVector3& angvelA,
00117                                                 const SimdVector3& rel_posA1,
00118                                                 const SimdVector3& invInertiaBDiag,
00119                                                 const SimdScalar invMassB,
00120                                                 const SimdVector3& linvelB,const SimdVector3& angvelB,
00121                                                 const SimdVector3& rel_posA2,
00122
00123                                           SimdScalar depthA, const SimdVector3& normalA,
00124                                           const SimdVector3& rel_posB1,const SimdVector3& rel_posB2,
00125                                           SimdScalar depthB, const SimdVector3& normalB,
00126                                           SimdScalar& imp0,SimdScalar& imp1)
00127 {
00128
00129         imp0 = 0.f;
00130         imp1 = 0.f;
00131
00132         SimdScalar len = fabs(normalA.length())-1.f;
00133         if (fabs(len) >= SIMD_EPSILON)
00134                 return;
00135
00136         ASSERT(len < SIMD_EPSILON);
00137
00138
00139         //this jacobian entry could be re-used for all iterations
00140         JacobianEntry jacA(world2A,world2B,rel_posA1,rel_posA2,normalA,invInertiaADiag,invMassA,
00141                 invInertiaBDiag,invMassB);
00142         JacobianEntry jacB(world2A,world2B,rel_posB1,rel_posB2,normalB,invInertiaADiag,invMassA,
00143                 invInertiaBDiag,invMassB);
00144
00145         //const SimdScalar vel0 = jacA.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
00146         //const SimdScalar vel1 = jacB.getRelativeVelocity(linvelA,angvelA,linvelB,angvelB);
00147
00148         const SimdScalar vel0 = normalA.dot(body1->getVelocityInLocalPoint(rel_posA1)-body2->getVelocityInLocalPoint(rel_posA1));
00149         const SimdScalar vel1 = normalB.dot(body1->getVelocityInLocalPoint(rel_posB1)-body2->getVelocityInLocalPoint(rel_posB1));
00150
00151         // calculate rhs (or error) terms
00152         const SimdScalar dv0 = depthA  * m_tau - vel0 * m_damping;
00153         const SimdScalar dv1 = depthB  * m_tau - vel1 * m_damping;
00154
00155         // dC/dv * dv = -C
00156
00157         // jacobian * impulse = -error
00158         //
00159
00160         //impulse = jacobianInverse * -error
00161
00162         // inverting 2x2 symmetric system (offdiagonal are equal!)
00163         //
00164
00165
00166         SimdScalar nonDiag = jacA.getNonDiagonal(jacB,invMassA,invMassB);
00167         SimdScalar      invDet = 1.0f / (jacA.getDiagonal() * jacB.getDiagonal() - nonDiag * nonDiag );
00168
00169         //imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
00170         //imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
00171
00172         imp0 = dv0 * jacA.getDiagonal() * invDet + dv1 * -nonDiag * invDet;
00173         imp1 = dv1 * jacB.getDiagonal() * invDet + dv0 * - nonDiag * invDet;
00174
00175         //[a b]                                                           [d -c]
00176         //[c d] inverse = (1 / determinant) * [-b a] where determinant is (ad - bc)
00177
00178         //[jA nD] * [imp0] = [dv0]
00179         //[nD jB]   [imp1]   [dv1]
00180
00181         if ( imp0 > 0.0f)
00182         {
00183                 if ( imp1 > 0.0f )
00184                 {
00185                         //both positive
00186                 }
00187                 else
00188                 {
00189                         imp1 = 0.f;
00190
00191                         // now imp0>0 imp1<0
00192                         imp0 = dv0 / jacA.getDiagonal();
00193                         if ( imp0 > 0.0f )
00194                         {
00195                         } else
00196                         {
00197                                 imp0 = 0.f;
00198                         }
00199                 }
00200         }
00201         else
00202         {
00203                 imp0 = 0.f;
00204
00205                 imp1 = dv1 / jacB.getDiagonal();
00206                 if ( imp1 <= 0.0f )
00207                 {
00208                         imp1 = 0.f;
00209                         // now imp0>0 imp1<0
00210                         imp0 = dv0 / jacA.getDiagonal();
00211                         if ( imp0 > 0.0f )
00212                         {
00213                         } else
00214                         {
00215                                 imp0 = 0.f;
00216                         }
00217                 } else
00218                 {
00219                 }
00220         }
00221 }
00222
00223
00224
00225 void Solve2LinearConstraint::resolveAngularConstraint(  const SimdMatrix3x3& invInertiaAWS,
00226                                                                                         const SimdScalar invMassA,
00227                                                                                         const SimdVector3& linvelA,const SimdVector3& angvelA,
00228                                                                                         const SimdVector3& rel_posA1,
00229                                                                                         const SimdMatrix3x3& invInertiaBWS,
00230                                                                                         const SimdScalar invMassB,
00231                                                                                         const SimdVector3& linvelB,const SimdVector3& angvelB,
00232                                                                                         const SimdVector3& rel_posA2,
00233
00234                                                                                         SimdScalar depthA, const SimdVector3& normalA,
00235                                                                                         const SimdVector3& rel_posB1,const SimdVector3& rel_posB2,
00236                                                                                         SimdScalar depthB, const SimdVector3& normalB,
00237                                                                                         SimdScalar& imp0,SimdScalar& imp1)
00238 {
00239
00240 }
00241
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Solve2LinearConstraint.h File Reference

BulletDynamics » ConstraintSolver

Solve2LinearConstraint.h File Reference

#include "SimdMatrix3x3.h"
#include "SimdVector3.h"

Include dependency graph for Solve2LinearConstraint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class Solve2LinearConstraint
constraint class used for lateral tyre friction. More...

Generated on Wed May 24 13:59:44 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Solve2LinearConstraint.h Source File

BulletDynamics » ConstraintSolver

Solve2LinearConstraint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef SOLVE_2LINEAR_CONSTRAINT_H
00017 #define SOLVE_2LINEAR_CONSTRAINT_H
00018
00019 #include "SimdMatrix3x3.h"
00020 #include "SimdVector3.h"
00021
00022
00023 class RigidBody;
00024
00025
00026
00028 class   Solve2LinearConstraint
00029 {
00030         SimdScalar      m_tau;
00031         SimdScalar      m_damping;
00032
00033 public:
00034
00035         Solve2LinearConstraint(SimdScalar tau,SimdScalar damping)
00036         {
00037                 m_tau = tau;
00038                 m_damping = damping;
00039         }
00040         //
00041         // solve unilateral constraint (equality, direct method)
00042         //
00043         void resolveUnilateralPairConstraint(
00044                                                                                                                    RigidBody* body0,
00045                 RigidBody* body1,
00046
00047                 const SimdMatrix3x3& world2A,
00048                                                 const SimdMatrix3x3& world2B,
00049
00050                                                 const SimdVector3& invInertiaADiag,
00051                                                 const SimdScalar invMassA,
00052                                                 const SimdVector3& linvelA,const SimdVector3& angvelA,
00053                                                 const SimdVector3& rel_posA1,
00054                                                 const SimdVector3& invInertiaBDiag,
00055                                                 const SimdScalar invMassB,
00056                                                 const SimdVector3& linvelB,const SimdVector3& angvelB,
00057                                                 const SimdVector3& rel_posA2,
00058
00059                                           SimdScalar depthA, const SimdVector3& normalA,
00060                                           const SimdVector3& rel_posB1,const SimdVector3& rel_posB2,
00061                                           SimdScalar depthB, const SimdVector3& normalB,
00062                                           SimdScalar& imp0,SimdScalar& imp1);
00063
00064
00065         //
00066         // solving 2x2 lcp problem (inequality, direct solution )
00067         //
00068         void resolveBilateralPairConstraint(
00069                         RigidBody* body0,
00070                                                 RigidBody* body1,
00071                 const SimdMatrix3x3& world2A,
00072                                                 const SimdMatrix3x3& world2B,
00073
00074                                                 const SimdVector3& invInertiaADiag,
00075                                                 const SimdScalar invMassA,
00076                                                 const SimdVector3& linvelA,const SimdVector3& angvelA,
00077                                                 const SimdVector3& rel_posA1,
00078                                                 const SimdVector3& invInertiaBDiag,
00079                                                 const SimdScalar invMassB,
00080                                                 const SimdVector3& linvelB,const SimdVector3& angvelB,
00081                                                 const SimdVector3& rel_posA2,
00082
00083                                           SimdScalar depthA, const SimdVector3& normalA,
00084                                           const SimdVector3& rel_posB1,const SimdVector3& rel_posB2,
00085                                           SimdScalar depthB, const SimdVector3& normalB,
00086                                           SimdScalar& imp0,SimdScalar& imp1);
00087
00088
00089         void resolveAngularConstraint(  const SimdMatrix3x3& invInertiaAWS,
00090                                                 const SimdScalar invMassA,
00091                                                 const SimdVector3& linvelA,const SimdVector3& angvelA,
00092                                                 const SimdVector3& rel_posA1,
00093                                                 const SimdMatrix3x3& invInertiaBWS,
00094                                                 const SimdScalar invMassB,
00095                                                 const SimdVector3& linvelB,const SimdVector3& angvelB,
00096                                                 const SimdVector3& rel_posA2,
00097
00098                                           SimdScalar depthA, const SimdVector3& normalA,
00099                                           const SimdVector3& rel_posB1,const SimdVector3& rel_posB2,
00100                                           SimdScalar depthB, const SimdVector3& normalB,
00101                                           SimdScalar& imp0,SimdScalar& imp1);
00102
00103
00104 };
00105
00106 #endif //SOLVE_2LINEAR_CONSTRAINT_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SorLcp.cpp File Reference

BulletDynamics » ConstraintSolver

SorLcp.cpp File Reference

#include "SorLcp.h"
#include "SimdScalar.h"
#include "Dynamics/RigidBody.h"
#include <math.h>
#include <float.h>
#include <string.h>
#include <stdio.h>
#include <alloca.h>
#include "Dynamics/BU_Joint.h"
#include "ContactSolverInfo.h"

Include dependency graph for SorLcp.cpp:

Go to the source code of this file.

Classes

struct | IndexError

Defines

#define | dInfinity FLT_MAX
#define | dRecip(x) ((float)(1.0f/(x)))
#define | dMULTIPLY0_331NEW(A, op, B, C)
#define | dMULTIPLY0_331(A, B, C) dMULTIPLYOP0_331(A,=,B,C)
#define | dMULTIPLYOP0_331(A, op, B, C)
#define | dAASSERT ASSERT
#define | dIASSERT ASSERT
#define | REAL float
#define | dDOTpq(a, b, p, q) ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])
#define | dDOT14(a, b) dDOTpq(a,b,1,4)
#define | dCROSS(a, op, b, c)
#define | dMULTIPLYOP2_333(A, op, B, C)
#define | dMULTIPLYOP0_333(A, op, B, C)
#define | dMULTIPLY2_333(A, B, C) dMULTIPLYOP2_333(A,=,B,C)
#define | dMULTIPLY0_333(A, B, C) dMULTIPLYOP0_333(A,=,B,C)
#define | dMULTIPLYADD0_331(A, B, C) dMULTIPLYOP0_331(A,+=,B,C)
#define | EFFICIENT_ALIGNMENT 16
#define | dEFFICIENT_SIZE(x) ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)
#define | dALLOCA16(n) ((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))
#define | ALLOCA dALLOCA16
#define | dRealArray(name, n) SimdScalar name[n];
#define | dRealAllocaArray(name, n) SimdScalar *name = (SimdScalar*) ALLOCA ((n)*sizeof(SimdScalar));
#define | RANDOMLY_REORDER_CONSTRAINTS 1

Typedefs

typedef SimdScalar | dVector4 [4]
typedef SimdScalar | dMatrix3 [4 *3]
typedef const SimdScalar * | dRealPtr
typedef SimdScalar * | dRealMutablePtr

Functions

SimdScalar | dDOT1 (const SimdScalar *a, const SimdScalar *b)
void | dSetZero1 (SimdScalar *a, int n)
void | dSetValue1 (SimdScalar *a, int n, SimdScalar value)
static void | compute_invM_JT (int m, dRealMutablePtr J, dRealMutablePtr iMJ, int *jb, RigidBody *const *body, dRealPtr invI)
static void | multiply_J (int m, dRealMutablePtr J, int *jb, dRealMutablePtr in, dRealMutablePtr out)
unsigned long | dRand2 ()
int | dRandInt2 (int n)
static void | SOR_LCP (int m, int nb, dRealMutablePtr J, int *jb, RigidBody *const *body, dRealPtr invI, dRealMutablePtr lambda, dRealMutablePtr invMforce, dRealMutablePtr rhs, dRealMutablePtr lo, dRealMutablePtr hi, dRealPtr cfm, int *findex, int numiter, float overRelax)
void | SolveInternal1 (float global_cfm, float global_erp, RigidBody *const *body, int nb, BU_Joint *const *_joint, int nj, const ContactSolverInfo &solverInfo)

Variables

static unsigned long | seed2 = 0

Define Documentation

#define ALLOCA dALLOCA16

Definition at line 172 of file SorLcp.cpp.

#define dAASSERT ASSERT

Definition at line 83 of file SorLcp.cpp.

Referenced by dSetValue1(), and dSetZero1().

#define dALLOCA16 ( n ) ((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))

Definition at line 130 of file SorLcp.cpp.

#define dCROSS | ( | a,
 |  | op,
 |  | b,
 |  | c | )

Value:

(a)[0] op ((b)[1]*(c)[2] - (b)[2]*(c)[1]); \
  (a)[1] op ((b)[2]*(c)[0] - (b)[0]*(c)[2]); \
  (a)[2] op ((b)[0]*(c)[1] - (b)[1]*(c)[0]);

Definition at line 91 of file SorLcp.cpp.

Referenced by ContactJoint::GetInfo2(), and SolveInternal1().

#define dDOT14 | ( | a,
 |  | b | ) | dDOTpq(a,b,1,4)

Definition at line 89 of file SorLcp.cpp.

#define dDOTpq | ( | a,
 |  | b,
 |  | p,
 |  | q | ) | ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])

Definition at line 87 of file SorLcp.cpp.

Referenced by dDOT1().

#define dEFFICIENT_SIZE ( x ) ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)

Definition at line 125 of file SorLcp.cpp.

#define dIASSERT ASSERT

Definition at line 84 of file SorLcp.cpp.

Referenced by SolveInternal1(), and SOR_LCP().

#define dInfinity FLT_MAX

Definition at line 60 of file SorLcp.cpp.

Referenced by SolveInternal1(), and SOR_LCP().

#define dMULTIPLY0_331 | ( | A,
 |  | B,
 |  | C | ) | dMULTIPLYOP0_331(A,=,B,C)

Definition at line 77 of file SorLcp.cpp.

Referenced by compute_invM_JT(), and SolveInternal1().

#define dMULTIPLY0_331NEW | ( | A,
 |  | op,
 |  | B,
 |  | C | )

Value:

{\
        float tmp[3];\
        tmp[0] = C.getX();\
        tmp[1] = C.getY();\
        tmp[2] = C.getZ();\
        dMULTIPLYOP0_331(A,op,B,tmp);\
}

Definition at line 68 of file SorLcp.cpp.

Referenced by SolveInternal1().

#define dMULTIPLY0_333 | ( | A,
 |  | B,
 |  | C | ) | dMULTIPLYOP0_333(A,=,B,C)

Definition at line 119 of file SorLcp.cpp.

Referenced by SolveInternal1().

#define dMULTIPLY2_333 | ( | A,
 |  | B,
 |  | C | ) | dMULTIPLYOP2_333(A,=,B,C)

Definition at line 118 of file SorLcp.cpp.

Referenced by SolveInternal1().

#define dMULTIPLYADD0_331 | ( | A,
 |  | B,
 |  | C | ) | dMULTIPLYOP0_331(A,+=,B,C)

Definition at line 120 of file SorLcp.cpp.

#define dMULTIPLYOP0_331 | ( | A,
 |  | op,
 |  | B,
 |  | C | )

Value:

(A)[0] op dDOT1((B),(C)); \
  (A)[1] op dDOT1((B+4),(C)); \
  (A)[2] op dDOT1((B+8),(C));

Definition at line 78 of file SorLcp.cpp.

#define dMULTIPLYOP0_333 | ( | A,
 |  | op,
 |  | B,
 |  | C | )

Value:

(A)[0] op dDOT14((B),(C)); \
  (A)[1] op dDOT14((B),(C+1)); \
  (A)[2] op dDOT14((B),(C+2)); \
  (A)[4] op dDOT14((B+4),(C)); \
  (A)[5] op dDOT14((B+4),(C+1)); \
  (A)[6] op dDOT14((B+4),(C+2)); \
  (A)[8] op dDOT14((B+8),(C)); \
  (A)[9] op dDOT14((B+8),(C+1)); \
  (A)[10] op dDOT14((B+8),(C+2));

Definition at line 107 of file SorLcp.cpp.

#define dMULTIPLYOP2_333 | ( | A,
 |  | op,
 |  | B,
 |  | C | )

Value:

(A)[0] op dDOT1((B),(C)); \
  (A)[1] op dDOT1((B),(C+4)); \
  (A)[2] op dDOT1((B),(C+8)); \
  (A)[4] op dDOT1((B+4),(C)); \
  (A)[5] op dDOT1((B+4),(C+4)); \
  (A)[6] op dDOT1((B+4),(C+8)); \
  (A)[8] op dDOT1((B+8),(C)); \
  (A)[9] op dDOT1((B+8),(C+4)); \
  (A)[10] op dDOT1((B+8),(C+8));

Definition at line 97 of file SorLcp.cpp.

#define dRealAllocaArray | ( | name,
 |  | n | ) | SimdScalar *name = (SimdScalar*) ALLOCA ((n)*sizeof(SimdScalar));

Definition at line 177 of file SorLcp.cpp.

Referenced by SolveInternal1(), and SOR_LCP().

#define dRealArray | ( | name,
 |  | n | ) | SimdScalar name[n];

Definition at line 176 of file SorLcp.cpp.

#define dRecip ( x ) ((float)(1.0f/(x)))

Definition at line 64 of file SorLcp.cpp.

Referenced by SolveInternal1().

#define EFFICIENT_ALIGNMENT 16

Definition at line 124 of file SorLcp.cpp.

#define RANDOMLY_REORDER_CONSTRAINTS 1

Definition at line 213 of file SorLcp.cpp.

#define REAL float

Definition at line 86 of file SorLcp.cpp.

Typedef Documentation

typedef SimdScalar dMatrix3[4 *3]

Definition at line 59 of file SorLcp.cpp.

typedef SimdScalar* dRealMutablePtr

Definition at line 175 of file SorLcp.cpp.

typedef const SimdScalar* dRealPtr

Definition at line 174 of file SorLcp.cpp.

typedef SimdScalar dVector4[4]

Definition at line 58 of file SorLcp.cpp.

Function Documentation

static void compute_invM_JT | ( | int | m,
 |  | dRealMutablePtr | J,
 |  | dRealMutablePtr | iMJ,
 |  | int * | jb,
 |  | RigidBody *const * | body,
 |  | dRealPtr | invI
 | ) | [static]

Definition at line 222 of file SorLcp.cpp.

References dMULTIPLY0_331, and RigidBody::getInvMass().

Referenced by SOR_LCP().

SimdScalar dDOT1 | ( | const SimdScalar * | a,
 |  | const SimdScalar * | b
 | ) |

Definition at line 88 of file SorLcp.cpp.

References dDOTpq.

unsigned long dRand2 ( )

Definition at line 368 of file SorLcp.cpp.

Referenced by dRandInt2().

int dRandInt2 ( int n )

Definition at line 374 of file SorLcp.cpp.

References dRand2().

Referenced by SOR_LCP().

void dSetValue1 | ( | SimdScalar * | a,
 |  | int | n,
 |  | SimdScalar | value
 | ) |

Definition at line 188 of file SorLcp.cpp.

References dAASSERT.

Referenced by SolveInternal1().

void dSetZero1 | ( | SimdScalar * | a,
 |  | int | n
 | ) |

Definition at line 179 of file SorLcp.cpp.

References dAASSERT.

Referenced by SolveInternal1(), and SOR_LCP().

static void multiply_J | ( | int | m,
 |  | dRealMutablePtr | J,
 |  | int * | jb,
 |  | dRealMutablePtr | in,
 |  | dRealMutablePtr | out
 | ) | [static]

Definition at line 325 of file SorLcp.cpp.

Referenced by SolveInternal1().

void SolveInternal1 | ( | float | global_cfm,
 |  | float | global_erp,
 |  | RigidBody *const * | body,
 |  | int | nb,
 |  | BU_Joint *const * | _joint,
 |  | int | nj,
 |  | const ContactSolverInfo & | solverInfo
 | ) |

Definition at line 598 of file SorLcp.cpp.

References BU_ContactJointNode::body, BU_Joint::Info2::c, BU_Joint::Info2::cfm, dCROSS, dIASSERT, dInfinity, dMULTIPLY0_331, dMULTIPLY0_331NEW, dMULTIPLY0_333, dMULTIPLY2_333, dRealAllocaArray, dRecip, dSetValue1(), dSetZero1(), BU_Joint::Info2::erp, BU_Joint::Info2::findex, BU_Joint::Info2::fps, RigidBody::getAngularVelocity(), BU_Joint::GetInfo1(), BU_Joint::GetInfo2(), RigidBody::getInvMass(), RigidBody::getLinearVelocity(), BU_Joint::Info2::hi, BU_Joint::Info2::J1a, BU_Joint::Info2::J1l, BU_Joint::Info2::J2a, BU_Joint::Info2::J2l, BU_Joint::Info2::lo, BU_Joint::Info1::m, RigidBody::m_facc, ContactSolverInfo::m_maxErrorReduction, ContactSolverInfo::m_numIterations, RigidBody::m_odeTag, ContactSolverInfo::m_sor, RigidBody::m_tacc, ContactSolverInfo::m_timeStep, multiply_J(), BU_Joint::node, BU_Joint::Info2::rowskip, RigidBody::setAngularVelocity(), RigidBody::setLinearVelocity(), and SOR_LCP().

static void SOR_LCP | ( | int | m,
 |  | int | nb,
 |  | dRealMutablePtr | J,
 |  | int * | jb,
 |  | RigidBody *const * | body,
 |  | dRealPtr | invI,
 |  | dRealMutablePtr | lambda,
 |  | dRealMutablePtr | invMforce,
 |  | dRealMutablePtr | rhs,
 |  | dRealMutablePtr | lo,
 |  | dRealMutablePtr | hi,
 |  | dRealPtr | cfm,
 |  | int * | findex,
 |  | int | numiter,
 |  | float | overRelax
 | ) | [static]

Definition at line 381 of file SorLcp.cpp.

References compute_invM_JT(), dIASSERT, dInfinity, dRandInt2(), dRealAllocaArray, dSetZero1(), IndexError::error, IndexError::findex, IndexError::index, and SimdFabs().

Referenced by SolveInternal1().

Variable Documentation

unsigned long seed2 = 0 [static]

Definition at line 366 of file SorLcp.cpp.

Generated on Wed May 24 13:59:45 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SorLcp.cpp Source File

BulletDynamics » ConstraintSolver

SorLcp.cpp

Go to the documentation of this file.
00001 /*************************************************************************
00002  *                                                                       *
00003  * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.       *
00004  * All rights reserved.  Email: russ@q12.org   Web: www.q12.org          *
00005  *                                                                       *
00006  * This library is free software; you can redistribute it and/or         *
00007  * modify it under the terms of EITHER:                                  *
00008  *   (1) The GNU Lesser General Public License as published by the Free  *
00009  *       Software Foundation; either version 2.1 of the License, or (at  *
00010  *       your option) any later version. The text of the GNU Lesser      *
00011  *       General Public License is included with this library in the     *
00012  *       file LICENSE.TXT.                                               *
00013  *   (2) The BSD-style license that is included with this library in     *
00014  *       the file LICENSE-BSD.TXT.                                       *
00015  *                                                                       *
00016  * This library is distributed in the hope that it will be useful,       *
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00019  * LICENSE.TXT and LICENSE-BSD.TXT for more details.                     *
00020  *                                                                       *
00021  *************************************************************************/
00022
00023 #include "SorLcp.h"
00024
00025 #ifdef USE_SOR_SOLVER
00026
00027 // SOR LCP taken from ode quickstep,
00028 // todo: write own successive overrelaxation gauss-seidel, or jacobi iterative solver
00029
00030
00031 #include "SimdScalar.h"
00032
00033 #include "Dynamics/RigidBody.h"
00034 #include <math.h>
00035 #include <float.h>//FLT_MAX
00036 #ifdef WIN32
00037 #include <memory.h>
00038 #endif
00039 #include <string.h>
00040 #include <stdio.h>
00041
00042 #if defined (WIN32)
00043 #include <malloc.h>
00044 #else
00045 #if defined (__FreeBSD__)
00046 #include <stdlib.h>
00047 #else
00048 #include <alloca.h>
00049 #endif
00050 #endif
00051
00052 #include "Dynamics/BU_Joint.h"
00053 #include "ContactSolverInfo.h"
00054
00056 //math stuff
00057
00058 typedef SimdScalar dVector4[4];
00059 typedef SimdScalar dMatrix3[4*3];
00060 #define dInfinity FLT_MAX
00061
00062
00063
00064 #define dRecip(x) ((float)(1.0f/(x)))                           /* reciprocal */
00065
00066
00067
00068 #define dMULTIPLY0_331NEW(A,op,B,C) \
00069 {\
00070         float tmp[3];\
00071         tmp[0] = C.getX();\
00072         tmp[1] = C.getY();\
00073         tmp[2] = C.getZ();\
00074         dMULTIPLYOP0_331(A,op,B,tmp);\
00075 }
00076
00077 #define dMULTIPLY0_331(A,B,C) dMULTIPLYOP0_331(A,=,B,C)
00078 #define dMULTIPLYOP0_331(A,op,B,C) \
00079   (A)[0] op dDOT1((B),(C)); \
00080   (A)[1] op dDOT1((B+4),(C)); \
00081   (A)[2] op dDOT1((B+8),(C));
00082
00083 #define dAASSERT ASSERT
00084 #define dIASSERT ASSERT
00085
00086 #define REAL float
00087 #define dDOTpq(a,b,p,q) ((a)[0]*(b)[0] + (a)[p]*(b)[q] + (a)[2*(p)]*(b)[2*(q)])
00088 SimdScalar dDOT1  (const SimdScalar *a, const SimdScalar *b) { return dDOTpq(a,b,1,1); }
00089 #define dDOT14(a,b) dDOTpq(a,b,1,4)
00090
00091 #define dCROSS(a,op,b,c) \
00092   (a)[0] op ((b)[1]*(c)[2] - (b)[2]*(c)[1]); \
00093   (a)[1] op ((b)[2]*(c)[0] - (b)[0]*(c)[2]); \
00094   (a)[2] op ((b)[0]*(c)[1] - (b)[1]*(c)[0]);
00095
00096
00097 #define dMULTIPLYOP2_333(A,op,B,C) \
00098   (A)[0] op dDOT1((B),(C)); \
00099   (A)[1] op dDOT1((B),(C+4)); \
00100   (A)[2] op dDOT1((B),(C+8)); \
00101   (A)[4] op dDOT1((B+4),(C)); \
00102   (A)[5] op dDOT1((B+4),(C+4)); \
00103   (A)[6] op dDOT1((B+4),(C+8)); \
00104   (A)[8] op dDOT1((B+8),(C)); \
00105   (A)[9] op dDOT1((B+8),(C+4)); \
00106   (A)[10] op dDOT1((B+8),(C+8));
00107 #define dMULTIPLYOP0_333(A,op,B,C) \
00108   (A)[0] op dDOT14((B),(C)); \
00109   (A)[1] op dDOT14((B),(C+1)); \
00110   (A)[2] op dDOT14((B),(C+2)); \
00111   (A)[4] op dDOT14((B+4),(C)); \
00112   (A)[5] op dDOT14((B+4),(C+1)); \
00113   (A)[6] op dDOT14((B+4),(C+2)); \
00114   (A)[8] op dDOT14((B+8),(C)); \
00115   (A)[9] op dDOT14((B+8),(C+1)); \
00116   (A)[10] op dDOT14((B+8),(C+2));
00117
00118 #define dMULTIPLY2_333(A,B,C) dMULTIPLYOP2_333(A,=,B,C)
00119 #define dMULTIPLY0_333(A,B,C) dMULTIPLYOP0_333(A,=,B,C)
00120 #define dMULTIPLYADD0_331(A,B,C) dMULTIPLYOP0_331(A,+=,B,C)
00121
00122
00124 #define EFFICIENT_ALIGNMENT 16
00125 #define dEFFICIENT_SIZE(x) ((((x)-1)|(EFFICIENT_ALIGNMENT-1))+1)
00126 /* alloca aligned to the EFFICIENT_ALIGNMENT. note that this can waste
00127  * up to 15 bytes per allocation, depending on what alloca() returns.
00128  */
00129
00130 #define dALLOCA16(n) \
00131   ((char*)dEFFICIENT_SIZE(((size_t)(alloca((n)+(EFFICIENT_ALIGNMENT-1))))))
00132
00133
00134
00137
00138 #ifdef DEBUG
00139 #define ANSI_FTOL 1
00140
00141 extern "C" {
00142     __declspec(naked) void _ftol2() {
00143         __asm    {
00144 #if ANSI_FTOL
00145             fnstcw   WORD PTR [esp-2]
00146             mov      ax, WORD PTR [esp-2]
00147
00148             OR AX,       0C00h
00149
00150             mov      WORD PTR [esp-4], ax
00151             fldcw    WORD PTR [esp-4]
00152             fistp    QWORD PTR [esp-12]
00153             fldcw    WORD PTR [esp-2]
00154             mov      eax, DWORD PTR [esp-12]
00155             mov      edx, DWORD PTR [esp-8]
00156 #else
00157             fistp    DWORD PTR [esp-12]
00158             mov          eax, DWORD PTR [esp-12]
00159             mov          ecx, DWORD PTR [esp-8]
00160 #endif
00161             ret
00162         }
00163     }
00164 }
00165 #endif //DEBUG
00166
00167
00168
00169
00170
00171
00172 #define ALLOCA dALLOCA16
00173
00174 typedef const SimdScalar *dRealPtr;
00175 typedef SimdScalar *dRealMutablePtr;
00176 #define dRealArray(name,n) SimdScalar name[n];
00177 #define dRealAllocaArray(name,n) SimdScalar *name = (SimdScalar*) ALLOCA ((n)*sizeof(SimdScalar));
00178
00179 void dSetZero1 (SimdScalar *a, int n)
00180 {
00181   dAASSERT (a && n >= 0);
00182   while (n > 0) {
00183     *(a++) = 0;
00184     n--;
00185   }
00186 }
00187
00188 void dSetValue1 (SimdScalar *a, int n, SimdScalar value)
00189 {
00190   dAASSERT (a && n >= 0);
00191   while (n > 0) {
00192     *(a++) = value;
00193     n--;
00194   }
00195 }
00196
00197
00198 //***************************************************************************
00199 // configuration
00200
00201 // for the SOR and CG methods:
00202 // uncomment the following line to use warm starting. this definitely
00203 // help for motor-driven joints. unfortunately it appears to hurt
00204 // with high-friction contacts using the SOR method. use with care
00205
00206 //#define WARM_STARTING 1
00207
00208 // for the SOR method:
00209 // uncomment the following line to randomly reorder constraint rows
00210 // during the solution. depending on the situation, this can help a lot
00211 // or hardly at all, but it doesn't seem to hurt.
00212
00213 #define RANDOMLY_REORDER_CONSTRAINTS 1
00214
00215
00216
00217 //***************************************************************************
00218 // various common computations involving the matrix J
00219
00220 // compute iMJ = inv(M)*J'
00221
00222 static void compute_invM_JT (int m, dRealMutablePtr J, dRealMutablePtr iMJ, int *jb,
00223         RigidBody * const *body, dRealPtr invI)
00224 {
00225         int i,j;
00226         dRealMutablePtr iMJ_ptr = iMJ;
00227         dRealMutablePtr J_ptr = J;
00228         for (i=0; i<m; i++) {
00229                 int b1 = jb[i*2];
00230                 int b2 = jb[i*2+1];
00231                 SimdScalar k = body[b1]->getInvMass();
00232                 for (j=0; j<3; j++) iMJ_ptr[j] = k*J_ptr[j];
00233                 dMULTIPLY0_331 (iMJ_ptr + 3, invI + 12*b1, J_ptr + 3);
00234                 if (b2 >= 0) {
00235                         k = body[b2]->getInvMass();
00236                         for (j=0; j<3; j++) iMJ_ptr[j+6] = k*J_ptr[j+6];
00237                         dMULTIPLY0_331 (iMJ_ptr + 9, invI + 12*b2, J_ptr + 9);
00238                 }
00239                 J_ptr += 12;
00240                 iMJ_ptr += 12;
00241         }
00242 }
00243
00244 #if 0
00245 static void multiply_invM_JTSpecial (int m, int nb, dRealMutablePtr iMJ, int *jb,
00246         dRealMutablePtr in, dRealMutablePtr out,int onlyBody1,int onlyBody2)
00247 {
00248         int i,j;
00249
00250
00251
00252         dRealMutablePtr out_ptr1 = out + onlyBody1*6;
00253
00254         for (j=0; j<6; j++)
00255                 out_ptr1[j] = 0;
00256
00257         if (onlyBody2 >= 0)
00258         {
00259                 out_ptr1 = out + onlyBody2*6;
00260
00261                 for (j=0; j<6; j++)
00262                         out_ptr1[j] = 0;
00263         }
00264
00265         dRealPtr iMJ_ptr = iMJ;
00266         for (i=0; i<m; i++) {
00267
00268                 int b1 = jb[i*2];
00269
00270                 dRealMutablePtr out_ptr = out + b1*6;
00271                 if ((b1 == onlyBody1) || (b1 == onlyBody2))
00272                 {
00273                         for (j=0; j<6; j++)
00274                                 out_ptr[j] += iMJ_ptr[j] * in[i] ;
00275                 }
00276
00277                 iMJ_ptr += 6;
00278
00279                 int b2 = jb[i*2+1];
00280                 if ((b2 == onlyBody1) || (b2 == onlyBody2))
00281                 {
00282                         if (b2 >= 0)
00283                         {
00284                                         out_ptr = out + b2*6;
00285                                         for (j=0; j<6; j++)
00286                                                 out_ptr[j] += iMJ_ptr[j] * in[i];
00287                         }
00288                 }
00289
00290                 iMJ_ptr += 6;
00291
00292         }
00293 }
00294 #endif
00295
00296
00297 // compute out = inv(M)*J'*in.
00298
00299 #if 0
00300 static void multiply_invM_JT (int m, int nb, dRealMutablePtr iMJ, int *jb,
00301         dRealMutablePtr in, dRealMutablePtr out)
00302 {
00303         int i,j;
00304         dSetZero1 (out,6*nb);
00305         dRealPtr iMJ_ptr = iMJ;
00306         for (i=0; i<m; i++) {
00307                 int b1 = jb[i*2];
00308                 int b2 = jb[i*2+1];
00309                 dRealMutablePtr out_ptr = out + b1*6;
00310                 for (j=0; j<6; j++)
00311                         out_ptr[j] += iMJ_ptr[j] * in[i];
00312                 iMJ_ptr += 6;
00313                 if (b2 >= 0) {
00314                         out_ptr = out + b2*6;
00315                         for (j=0; j<6; j++) out_ptr[j] += iMJ_ptr[j] * in[i];
00316                 }
00317                 iMJ_ptr += 6;
00318         }
00319 }
00320 #endif
00321
00322
00323 // compute out = J*in.
00324
00325 static void multiply_J (int m, dRealMutablePtr J, int *jb,
00326         dRealMutablePtr in, dRealMutablePtr out)
00327 {
00328         int i,j;
00329         dRealPtr J_ptr = J;
00330         for (i=0; i<m; i++) {
00331                 int b1 = jb[i*2];
00332                 int b2 = jb[i*2+1];
00333                 SimdScalar sum = 0;
00334                 dRealMutablePtr in_ptr = in + b1*6;
00335                 for (j=0; j<6; j++) sum += J_ptr[j] * in_ptr[j];
00336                 J_ptr += 6;
00337                 if (b2 >= 0) {
00338                         in_ptr = in + b2*6;
00339                         for (j=0; j<6; j++) sum += J_ptr[j] * in_ptr[j];
00340                 }
00341                 J_ptr += 6;
00342                 out[i] = sum;
00343         }
00344 }
00345
00346 //***************************************************************************
00347 // SOR-LCP method
00348
00349 // nb is the number of bodies in the body array.
00350 // J is an m*12 matrix of constraint rows
00351 // jb is an array of first and second body numbers for each constraint row
00352 // invI is the global frame inverse inertia for each body (stacked 3x3 matrices)
00353 //
00354 // this returns lambda and fc (the constraint force).
00355 // note: fc is returned as inv(M)*J'*lambda, the constraint force is actually J'*lambda
00356 //
00357 // b, lo and hi are modified on exit
00358
00359
00360 struct IndexError {
00361         SimdScalar error;               // error to sort on
00362         int findex;
00363         int index;              // row index
00364 };
00365
00366 static unsigned long seed2 = 0;
00367
00368 unsigned long dRand2()
00369 {
00370   seed2 = (1664525L*seed2 + 1013904223L) & 0xffffffff;
00371   return seed2;
00372 }
00373
00374 int dRandInt2 (int n)
00375 {
00376   float a = float(n) / 4294967296.0f;
00377   return (int) (float(dRand2()) * a);
00378 }
00379
00380
00381 static void SOR_LCP (int m, int nb, dRealMutablePtr J, int *jb, RigidBody * const *body,
00382         dRealPtr invI, dRealMutablePtr lambda, dRealMutablePtr invMforce, dRealMutablePtr rhs,
00383         dRealMutablePtr lo, dRealMutablePtr hi, dRealPtr cfm, int *findex,
00384         int numiter,float overRelax)
00385 {
00386         const int num_iterations = numiter;
00387         const float sor_w = overRelax;          // SOR over-relaxation parameter
00388
00389         int i,j;
00390
00391 #ifdef WARM_STARTING
00392         // for warm starting, this seems to be necessary to prevent
00393         // jerkiness in motor-driven joints. i have no idea why this works.
00394         for (i=0; i<m; i++) lambda[i] *= 0.9;
00395 #else
00396         dSetZero1 (lambda,m);
00397 #endif
00398
00399         // the lambda computed at the previous iteration.
00400         // this is used to measure error for when we are reordering the indexes.
00401         dRealAllocaArray (last_lambda,m);
00402
00403         // a copy of the 'hi' vector in case findex[] is being used
00404         dRealAllocaArray (hicopy,m);
00405         memcpy (hicopy,hi,m*sizeof(float));
00406
00407         // precompute iMJ = inv(M)*J'
00408         dRealAllocaArray (iMJ,m*12);
00409         compute_invM_JT (m,J,iMJ,jb,body,invI);
00410
00411         // compute fc=(inv(M)*J')*lambda. we will incrementally maintain fc
00412         // as we change lambda.
00413 #ifdef WARM_STARTING
00414         multiply_invM_JT (m,nb,iMJ,jb,lambda,fc);
00415 #else
00416         dSetZero1 (invMforce,nb*6);
00417 #endif
00418
00419         // precompute 1 / diagonals of A
00420         dRealAllocaArray (Ad,m);
00421         dRealPtr iMJ_ptr = iMJ;
00422         dRealMutablePtr J_ptr = J;
00423         for (i=0; i<m; i++) {
00424                 float sum = 0;
00425                 for (j=0; j<6; j++) sum += iMJ_ptr[j] * J_ptr[j];
00426                 if (jb[i*2+1] >= 0) {
00427                         for (j=6; j<12; j++) sum += iMJ_ptr[j] * J_ptr[j];
00428                 }
00429                 iMJ_ptr += 12;
00430                 J_ptr += 12;
00431                 Ad[i] = sor_w / sum;//(sum + cfm[i]);
00432         }
00433
00434         // scale J and b by Ad
00435         J_ptr = J;
00436         for (i=0; i<m; i++) {
00437                 for (j=0; j<12; j++) {
00438                         J_ptr[0] *= Ad[i];
00439                         J_ptr++;
00440                 }
00441                 rhs[i] *= Ad[i];
00442         }
00443
00444         // scale Ad by CFM
00445         for (i=0; i<m; i++)
00446                 Ad[i] *= cfm[i];
00447
00448         // order to solve constraint rows in
00449         IndexError *order = (IndexError*) alloca (m*sizeof(IndexError));
00450
00451 #ifndef REORDER_CONSTRAINTS
00452         // make sure constraints with findex < 0 come first.
00453         j=0;
00454         for (i=0; i<m; i++)
00455                 if (findex[i] < 0)
00456                         order[j++].index = i;
00457         for (i=0; i<m; i++)
00458                 if (findex[i] >= 0)
00459                         order[j++].index = i;
00460         dIASSERT (j==m);
00461 #endif
00462
00463         for (int iteration=0; iteration < num_iterations; iteration++) {
00464
00465 #ifdef REORDER_CONSTRAINTS
00466                 // constraints with findex < 0 always come first.
00467                 if (iteration < 2) {
00468                         // for the first two iterations, solve the constraints in
00469                         // the given order
00470                         for (i=0; i<m; i++) {
00471                                 order[i].error = i;
00472                                 order[i].findex = findex[i];
00473                                 order[i].index = i;
00474                         }
00475                 }
00476                 else {
00477                         // sort the constraints so that the ones converging slowest
00478                         // get solved last. use the absolute (not relative) error.
00479                         for (i=0; i<m; i++) {
00480                                 float v1 = dFabs (lambda[i]);
00481                                 float v2 = dFabs (last_lambda[i]);
00482                                 float max = (v1 > v2) ? v1 : v2;
00483                                 if (max > 0) {
00484                                         //@@@ relative error: order[i].error = dFabs(lambda[i]-last_lambda[i])/max;
00485                                         order[i].error = dFabs(lambda[i]-last_lambda[i]);
00486                                 }
00487                                 else {
00488                                         order[i].error = dInfinity;
00489                                 }
00490                                 order[i].findex = findex[i];
00491                                 order[i].index = i;
00492                         }
00493                 }
00494                 qsort (order,m,sizeof(IndexError),&compare_index_error);
00495 #endif
00496 #ifdef RANDOMLY_REORDER_CONSTRAINTS
00497                 if ((iteration & 7) == 0) {
00498                         for (i=1; i<m; ++i) {
00499                                 IndexError tmp = order[i];
00500                                 int swapi = dRandInt2(i+1);
00501                                 order[i] = order[swapi];
00502                                 order[swapi] = tmp;
00503                         }
00504                 }
00505 #endif
00506
00507                 //@@@ potential optimization: swap lambda and last_lambda pointers rather
00508                 //    than copying the data. we must make sure lambda is properly
00509                 //    returned to the caller
00510                 memcpy (last_lambda,lambda,m*sizeof(float));
00511
00512                 for (int i=0; i<m; i++) {
00513                         // @@@ potential optimization: we could pre-sort J and iMJ, thereby
00514                         //     linearizing access to those arrays. hmmm, this does not seem
00515                         //     like a win, but we should think carefully about our memory
00516                         //     access pattern.
00517
00518                         int index = order[i].index;
00519                         J_ptr = J + index*12;
00520                         iMJ_ptr = iMJ + index*12;
00521
00522                         // set the limits for this constraint. note that 'hicopy' is used.
00523                         // this is the place where the QuickStep method differs from the
00524                         // direct LCP solving method, since that method only performs this
00525                         // limit adjustment once per time step, whereas this method performs
00526                         // once per iteration per constraint row.
00527                         // the constraints are ordered so that all lambda[] values needed have
00528                         // already been computed.
00529                         if (findex[index] >= 0) {
00530                                 hi[index] = SimdFabs (hicopy[index] * lambda[findex[index]]);
00531                                 lo[index] = -hi[index];
00532                         }
00533
00534                         int b1 = jb[index*2];
00535                         int b2 = jb[index*2+1];
00536                         float delta = rhs[index] - lambda[index]*Ad[index];
00537                         dRealMutablePtr fc_ptr = invMforce + 6*b1;
00538
00539                         // @@@ potential optimization: SIMD-ize this and the b2 >= 0 case
00540                         delta -=fc_ptr[0] * J_ptr[0] + fc_ptr[1] * J_ptr[1] +
00541                                 fc_ptr[2] * J_ptr[2] + fc_ptr[3] * J_ptr[3] +
00542                                 fc_ptr[4] * J_ptr[4] + fc_ptr[5] * J_ptr[5];
00543                         // @@@ potential optimization: handle 1-body constraints in a separate
00544                         //     loop to avoid the cost of test & jump?
00545                         if (b2 >= 0) {
00546                                 fc_ptr = invMforce + 6*b2;
00547                                 delta -=fc_ptr[0] * J_ptr[6] + fc_ptr[1] * J_ptr[7] +
00548                                         fc_ptr[2] * J_ptr[8] + fc_ptr[3] * J_ptr[9] +
00549                                         fc_ptr[4] * J_ptr[10] + fc_ptr[5] * J_ptr[11];
00550                         }
00551
00552                         // compute lambda and clamp it to [lo,hi].
00553                         // @@@ potential optimization: does SSE have clamping instructions
00554                         //     to save test+jump penalties here?
00555                         float new_lambda = lambda[index] + delta;
00556                         if (new_lambda < lo[index]) {
00557                                 delta = lo[index]-lambda[index];
00558                                 lambda[index] = lo[index];
00559                         }
00560                         else if (new_lambda > hi[index]) {
00561                                 delta = hi[index]-lambda[index];
00562                                 lambda[index] = hi[index];
00563                         }
00564                         else {
00565                                 lambda[index] = new_lambda;
00566                         }
00567
00568                         //@@@ a trick that may or may not help
00569                         //float ramp = (1-((float)(iteration+1)/(float)num_iterations));
00570                         //delta *= ramp;
00571
00572                         // update invMforce.
00573                         // @@@ potential optimization: SIMD for this and the b2 >= 0 case
00574                         fc_ptr = invMforce + 6*b1;
00575                         fc_ptr[0] += delta * iMJ_ptr[0];
00576                         fc_ptr[1] += delta * iMJ_ptr[1];
00577                         fc_ptr[2] += delta * iMJ_ptr[2];
00578                         fc_ptr[3] += delta * iMJ_ptr[3];
00579                         fc_ptr[4] += delta * iMJ_ptr[4];
00580                         fc_ptr[5] += delta * iMJ_ptr[5];
00581                         // @@@ potential optimization: handle 1-body constraints in a separate
00582                         //     loop to avoid the cost of test & jump?
00583                         if (b2 >= 0) {
00584                                 fc_ptr = invMforce + 6*b2;
00585                                 fc_ptr[0] += delta * iMJ_ptr[6];
00586                                 fc_ptr[1] += delta * iMJ_ptr[7];
00587                                 fc_ptr[2] += delta * iMJ_ptr[8];
00588                                 fc_ptr[3] += delta * iMJ_ptr[9];
00589                                 fc_ptr[4] += delta * iMJ_ptr[10];
00590                                 fc_ptr[5] += delta * iMJ_ptr[11];
00591                         }
00592                 }
00593         }
00594 }
00595
00596
00597
00598 void SolveInternal1 (float global_cfm,
00599                                          float global_erp,
00600                                          RigidBody * const *body, int nb,
00601                                         BU_Joint * const *_joint,
00602                                         int nj,
00603                                         const ContactSolverInfo& solverInfo)
00604 {
00605
00606         int numIter = solverInfo.m_numIterations;
00607         float sOr = solverInfo.m_sor;
00608
00609         int i,j;
00610
00611         SimdScalar stepsize1 = dRecip(solverInfo.m_timeStep);
00612
00613         // number all bodies in the body list - set their tag values
00614         for (i=0; i<nb; i++)
00615                 body[i]->m_odeTag = i;
00616
00617         // make a local copy of the joint array, because we might want to modify it.
00618         // (the "BU_Joint *const*" declaration says we're allowed to modify the joints
00619         // but not the joint array, because the caller might need it unchanged).
00620         //@@@ do we really need to do this? we'll be sorting constraint rows individually, not joints
00621         BU_Joint **joint = (BU_Joint**) alloca (nj * sizeof(BU_Joint*));
00622         memcpy (joint,_joint,nj * sizeof(BU_Joint*));
00623
00624         // for all bodies, compute the inertia tensor and its inverse in the global
00625         // frame, and compute the rotational force and add it to the torque
00626         // accumulator. I and invI are a vertical stack of 3x4 matrices, one per body.
00627         dRealAllocaArray (I,3*4*nb);
00628         dRealAllocaArray (invI,3*4*nb);
00629 /*      for (i=0; i<nb; i++) {
00630                 dMatrix3 tmp;
00631                 // compute inertia tensor in global frame
00632                 dMULTIPLY2_333 (tmp,body[i]->m_I,body[i]->m_R);
00633                 // compute inverse inertia tensor in global frame
00634                 dMULTIPLY2_333 (tmp,body[i]->m_invI,body[i]->m_R);
00635                 dMULTIPLY0_333 (invI+i*12,body[i]->m_R,tmp);
00636                 // compute rotational force
00637                 dCROSS (body[i]->m_tacc,-=,body[i]->getAngularVelocity(),tmp);
00638         }
00639 */
00640         for (i=0; i<nb; i++) {
00641                 dMatrix3 tmp;
00642                 // compute inertia tensor in global frame
00643                 dMULTIPLY2_333 (tmp,body[i]->m_I,body[i]->m_R);
00644                 dMULTIPLY0_333 (I+i*12,body[i]->m_R,tmp);
00645
00646                 // compute inverse inertia tensor in global frame
00647                 dMULTIPLY2_333 (tmp,body[i]->m_invI,body[i]->m_R);
00648                 dMULTIPLY0_333 (invI+i*12,body[i]->m_R,tmp);
00649                 // compute rotational force
00650                 dMULTIPLY0_331 (tmp,I+i*12,body[i]->getAngularVelocity());
00651                 dCROSS (body[i]->m_tacc,-=,body[i]->getAngularVelocity(),tmp);
00652         }
00653
00654
00655
00656
00657         // get joint information (m = total constraint dimension, nub = number of unbounded variables).
00658         // joints with m=0 are inactive and are removed from the joints array
00659         // entirely, so that the code that follows does not consider them.
00660         //@@@ do we really need to save all the info1's
00661         BU_Joint::Info1 *info = (BU_Joint::Info1*) alloca (nj*sizeof(BU_Joint::Info1));
00662         for (i=0, j=0; j<nj; j++) {     // i=dest, j=src
00663                 joint[j]->GetInfo1 (info+i);
00664                 dIASSERT (info[i].m >= 0 && info[i].m <= 6 && info[i].nub >= 0 && info[i].nub <= info[i].m);
00665                 if (info[i].m > 0) {
00666                         joint[i] = joint[j];
00667                         i++;
00668                 }
00669         }
00670         nj = i;
00671
00672         // create the row offset array
00673         int m = 0;
00674         int *ofs = (int*) alloca (nj*sizeof(int));
00675         for (i=0; i<nj; i++) {
00676                 ofs[i] = m;
00677                 m += info[i].m;
00678         }
00679
00680         // if there are constraints, compute the constraint force
00681         dRealAllocaArray (J,m*12);
00682         int *jb = (int*) alloca (m*2*sizeof(int));
00683         if (m > 0) {
00684                 // create a constraint equation right hand side vector `c', a constraint
00685                 // force mixing vector `cfm', and LCP low and high bound vectors, and an
00686                 // 'findex' vector.
00687                 dRealAllocaArray (c,m);
00688                 dRealAllocaArray (cfm,m);
00689                 dRealAllocaArray (lo,m);
00690                 dRealAllocaArray (hi,m);
00691                 int *findex = (int*) alloca (m*sizeof(int));
00692                 dSetZero1 (c,m);
00693                 dSetValue1 (cfm,m,global_cfm);
00694                 dSetValue1 (lo,m,-dInfinity);
00695                 dSetValue1 (hi,m, dInfinity);
00696                 for (i=0; i<m; i++) findex[i] = -1;
00697
00698                 // get jacobian data from constraints. an m*12 matrix will be created
00699                 // to store the two jacobian blocks from each constraint. it has this
00700                 // format:
00701                 //
00702                 //   l1 l1 l1 a1 a1 a1 l2 l2 l2 a2 a2 a2 \    .
00703                 //   l1 l1 l1 a1 a1 a1 l2 l2 l2 a2 a2 a2  }-- jacobian for joint 0, body 1 and body 2 (3 rows)
00704                 //   l1 l1 l1 a1 a1 a1 l2 l2 l2 a2 a2 a2 /
00705                 //   l1 l1 l1 a1 a1 a1 l2 l2 l2 a2 a2 a2 }--- jacobian for joint 1, body 1 and body 2 (3 rows)
00706                 //   etc...
00707                 //
00708                 //   (lll) = linear jacobian data
00709                 //   (aaa) = angular jacobian data
00710                 //
00711                 dSetZero1 (J,m*12);
00712                 BU_Joint::Info2 Jinfo;
00713                 Jinfo.rowskip = 12;
00714                 Jinfo.fps = stepsize1;
00715                 Jinfo.erp = global_erp;
00716                 for (i=0; i<nj; i++) {
00717                         Jinfo.J1l = J + ofs[i]*12;
00718                         Jinfo.J1a = Jinfo.J1l + 3;
00719                         Jinfo.J2l = Jinfo.J1l + 6;
00720                         Jinfo.J2a = Jinfo.J1l + 9;
00721                         Jinfo.c = c + ofs[i];
00722                         Jinfo.cfm = cfm + ofs[i];
00723                         Jinfo.lo = lo + ofs[i];
00724                         Jinfo.hi = hi + ofs[i];
00725                         Jinfo.findex = findex + ofs[i];
00726                         joint[i]->GetInfo2 (&Jinfo);
00727
00728                         if (Jinfo.c[0] > solverInfo.m_maxErrorReduction)
00729                                 Jinfo.c[0] = solverInfo.m_maxErrorReduction;
00730
00731
00732
00733
00734                         // adjust returned findex values for global index numbering
00735                         for (j=0; j<info[i].m; j++) {
00736                                 if (findex[ofs[i] + j] >= 0)
00737                                         findex[ofs[i] + j] += ofs[i];
00738                         }
00739                 }
00740
00741                 // create an array of body numbers for each joint row
00742                 int *jb_ptr = jb;
00743                 for (i=0; i<nj; i++) {
00744                         int b1 = (joint[i]->node[0].body) ? (joint[i]->node[0].body->m_odeTag) : -1;
00745                         int b2 = (joint[i]->node[1].body) ? (joint[i]->node[1].body->m_odeTag) : -1;
00746                         for (j=0; j<info[i].m; j++) {
00747                                 jb_ptr[0] = b1;
00748                                 jb_ptr[1] = b2;
00749                                 jb_ptr += 2;
00750                         }
00751                 }
00752                 dIASSERT (jb_ptr == jb+2*m);
00753
00754                 // compute the right hand side `rhs'
00755                 dRealAllocaArray (tmp1,nb*6);
00756                 // put v/h + invM*fe into tmp1
00757                 for (i=0; i<nb; i++) {
00758                         SimdScalar body_invMass = body[i]->getInvMass();
00759                         for (j=0; j<3; j++)
00760                                 tmp1[i*6+j] = body[i]->m_facc[j] * body_invMass + body[i]->getLinearVelocity()[j] * stepsize1;
00761                         dMULTIPLY0_331NEW (tmp1 + i*6 + 3,=,invI + i*12,body[i]->m_tacc);
00762                         for (j=0; j<3; j++)
00763                                 tmp1[i*6+3+j] += body[i]->getAngularVelocity()[j] * stepsize1;
00764                 }
00765
00766                 // put J*tmp1 into rhs
00767                 dRealAllocaArray (rhs,m);
00768                 multiply_J (m,J,jb,tmp1,rhs);
00769
00770                 // complete rhs
00771                 for (i=0; i<m; i++) rhs[i] = c[i]*stepsize1 - rhs[i];
00772
00773                 // scale CFM
00774                 for (i=0; i<m; i++)
00775                         cfm[i] *= stepsize1;
00776
00777                 // load lambda from the value saved on the previous iteration
00778                 dRealAllocaArray (lambda,m);
00779 #ifdef WARM_STARTING
00780                 dSetZero1 (lambda,m);   //@@@ shouldn't be necessary
00781                 for (i=0; i<nj; i++) {
00782                         memcpy (lambda+ofs[i],joint[i]->lambda,info[i].m * sizeof(SimdScalar));
00783                 }
00784 #endif
00785
00786                 // solve the LCP problem and get lambda and invM*constraint_force
00787                 dRealAllocaArray (cforce,nb*6);
00788
00789                 SOR_LCP (m,nb,J,jb,body,invI,lambda,cforce,rhs,lo,hi,cfm,findex,numIter,sOr);
00790
00791 #ifdef WARM_STARTING
00792                 // save lambda for the next iteration
00793                 //@@@ note that this doesn't work for contact joints yet, as they are
00794                 // recreated every iteration
00795                 for (i=0; i<nj; i++) {
00796                         memcpy (joint[i]->lambda,lambda+ofs[i],info[i].m * sizeof(SimdScalar));
00797                 }
00798 #endif
00799
00800
00801                 // note that the SOR method overwrites rhs and J at this point, so
00802                 // they should not be used again.
00803
00804                 // add stepsize * cforce to the body velocity
00805                 for (i=0; i<nb; i++) {
00806                         SimdVector3 linvel = body[i]->getLinearVelocity();
00807                         SimdVector3 angvel = body[i]->getAngularVelocity();
00808
00809                         for (j=0; j<3; j++)
00810                                 linvel[j] += solverInfo.m_timeStep* cforce[i*6+j];
00811                         for (j=0; j<3; j++)
00812                                 angvel[j] += solverInfo.m_timeStep* cforce[i*6+3+j];
00813
00814                         body[i]->setLinearVelocity(linvel);
00815                         body[i]->setAngularVelocity(angvel);
00816
00817                 }
00818
00819         }
00820
00821
00822
00823         // compute the velocity update:
00824         // add stepsize * invM * fe to the body velocity
00825
00826         for (i=0; i<nb; i++) {
00827                 SimdScalar body_invMass = body[i]->getInvMass();
00828                 SimdVector3 linvel = body[i]->getLinearVelocity();
00829                 SimdVector3 angvel = body[i]->getAngularVelocity();
00830
00831                 for (j=0; j<3; j++)
00832                 {
00833                         linvel[j] += solverInfo.m_timeStep * body_invMass * body[i]->m_facc[j];
00834                 }
00835                 for (j=0; j<3; j++)
00836                 {
00837                         body[i]->m_tacc[j] *= solverInfo.m_timeStep;
00838                 }
00839                 dMULTIPLY0_331NEW(angvel,+=,invI + i*12,body[i]->m_tacc);
00840                 body[i]->setAngularVelocity(angvel);
00841
00842         }
00843
00844
00845
00846 }
00847
00848
00849 #endif //USE_SOR_SOLVER
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SorLcp.h File Reference

BulletDynamics » ConstraintSolver

SorLcp.h File Reference

#include "SimdScalar.h"

Include dependency graph for SorLcp.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define | USE_SOR_SOLVER

Functions

void | SolveInternal1 (float global_cfm, float global_erp, RigidBody *const *body, int nb, BU_Joint *const *_joint, int nj, const ContactSolverInfo &info)
int | dRandInt2 (int n)

Define Documentation

#define USE_SOR_SOLVER

Definition at line 23 of file SorLcp.h.

Function Documentation

int dRandInt2 ( int n )

Definition at line 374 of file SorLcp.cpp.

References dRand2().

Referenced by SOR_LCP().

void SolveInternal1 | ( | float | global_cfm,
 |  | float | global_erp,
 |  | RigidBody *const * | body,
 |  | int | nb,
 |  | BU_Joint *const * | _joint,
 |  | int | nj,
 |  | const ContactSolverInfo & | info
 | ) |

Definition at line 598 of file SorLcp.cpp.

References BU_ContactJointNode::body, BU_Joint::Info2::c, BU_Joint::Info2::cfm, dCROSS, dIASSERT, dInfinity, dMULTIPLY0_331, dMULTIPLY0_331NEW, dMULTIPLY0_333, dMULTIPLY2_333, dRealAllocaArray, dRecip, dSetValue1(), dSetZero1(), BU_Joint::Info2::erp, BU_Joint::Info2::findex, BU_Joint::Info2::fps, RigidBody::getAngularVelocity(), BU_Joint::GetInfo1(), BU_Joint::GetInfo2(), RigidBody::getInvMass(), RigidBody::getLinearVelocity(), BU_Joint::Info2::hi, BU_Joint::Info2::J1a, BU_Joint::Info2::J1l, BU_Joint::Info2::J2a, BU_Joint::Info2::J2l, BU_Joint::Info2::lo, BU_Joint::Info1::m, RigidBody::m_facc, ContactSolverInfo::m_maxErrorReduction, ContactSolverInfo::m_numIterations, RigidBody::m_odeTag, ContactSolverInfo::m_sor, RigidBody::m_tacc, ContactSolverInfo::m_timeStep, multiply_J(), BU_Joint::node, BU_Joint::Info2::rowskip, RigidBody::setAngularVelocity(), RigidBody::setLinearVelocity(), and SOR_LCP().

Generated on Wed May 24 13:59:45 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SorLcp.h Source File

BulletDynamics » ConstraintSolver

SorLcp.h

Go to the documentation of this file.
00001 /*************************************************************************
00002  *                                                                       *
00003  * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith.       *
00004  * All rights reserved.  Email: russ@q12.org   Web: www.q12.org          *
00005  *                                                                       *
00006  * This library is free software; you can redistribute it and/or         *
00007  * modify it under the terms of EITHER:                                  *
00008  *   (1) The GNU Lesser General Public License as published by the Free  *
00009  *       Software Foundation; either version 2.1 of the License, or (at  *
00010  *       your option) any later version. The text of the GNU Lesser      *
00011  *       General Public License is included with this library in the     *
00012  *       file LICENSE.TXT.                                               *
00013  *   (2) The BSD-style license that is included with this library in     *
00014  *       the file LICENSE-BSD.TXT.                                       *
00015  *                                                                       *
00016  * This library is distributed in the hope that it will be useful,       *
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files    *
00019  * LICENSE.TXT and LICENSE-BSD.TXT for more details.                     *
00020  *                                                                       *
00021  *************************************************************************/
00022
00023 #define USE_SOR_SOLVER
00024 #ifdef USE_SOR_SOLVER
00025
00026 #ifndef SOR_LCP_H
00027 #define SOR_LCP_H
00028 class RigidBody;
00029 class BU_Joint;
00030 #include "SimdScalar.h"
00031
00032 struct ContactSolverInfo;
00033
00034 void SolveInternal1 (float global_cfm,
00035                                          float global_erp,
00036                                          RigidBody * const *body, int nb,
00037                      BU_Joint * const *_joint, int nj, const ContactSolverInfo& info);
00038
00039 int dRandInt2 (int n);
00040
00041
00042 #endif //SOR_LCP_H
00043
00044 #endif //USE_SOR_SOLVER
00045
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SphereShape.cpp File Reference

Bullet » CollisionShapes

SphereShape.cpp File Reference

#include "SphereShape.h"
#include "CollisionShapes/CollisionMargin.h"
#include "SimdQuaternion.h"

Include dependency graph for SphereShape.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:45 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SphereShape.cpp Source File

Bullet » CollisionShapes

SphereShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "SphereShape.h"
00017 #include "CollisionShapes/CollisionMargin.h"
00018
00019 #include "SimdQuaternion.h"
00020
00021
00022 SphereShape ::SphereShape (SimdScalar radius)
00023 : m_radius(radius)
00024 {
00025 }
00026
00027 SimdVector3     SphereShape::LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00028 {
00029         return SimdVector3(0.f,0.f,0.f);
00030 }
00031
00032 void    SphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00033 {
00034         for (int i=0;i<numVectors;i++)
00035         {
00036                 supportVerticesOut[i].setValue(0.f,0.f,0.f);
00037         }
00038 }
00039
00040
00041 SimdVector3     SphereShape::LocalGetSupportingVertex(const SimdVector3& vec)const
00042 {
00043         SimdVector3 supVertex;
00044         supVertex = LocalGetSupportingVertexWithoutMargin(vec);
00045
00046         SimdVector3 vecnorm = vec;
00047         if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON))
00048         {
00049                 vecnorm.setValue(-1.f,-1.f,-1.f);
00050         }
00051         vecnorm.normalize();
00052         supVertex+= GetMargin() * vecnorm;
00053         return supVertex;
00054 }
00055
00056
00057 //broken due to scaling
00058 void SphereShape::GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const
00059 {
00060         const SimdVector3& center = t.getOrigin();
00061         SimdVector3 extent(GetMargin(),GetMargin(),GetMargin());
00062         aabbMin = center - extent;
00063         aabbMax = center + extent;
00064 }
00065
00066
00067
00068 void    SphereShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00069 {
00070         SimdScalar elem = 0.4f * mass * GetMargin()*GetMargin();
00071         inertia[0] = inertia[1] = inertia[2] = elem;
00072
00073 }
00074
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SphereShape.h File Reference

Bullet » CollisionShapes

SphereShape.h File Reference

#include "ConvexShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"

Include dependency graph for SphereShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class SphereShape
SphereShape implements an implicit (getSupportingVertex) Sphere. More...

Generated on Wed May 24 13:59:46 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SphereShape.h Source File

Bullet » CollisionShapes

SphereShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef SPHERE_MINKOWSKI_H
00017 #define SPHERE_MINKOWSKI_H
00018
00019 #include "ConvexShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021
00023 class SphereShape : public ConvexShape
00024
00025 {
00026         SimdScalar m_radius;
00027
00028 public:
00029         SphereShape (SimdScalar radius);
00030
00031
00032         virtual SimdVector3     LocalGetSupportingVertex(const SimdVector3& vec)const;
00033         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const;
00034         //notice that the vectors should be unit length
00035         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const;
00036
00037
00038         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00039
00040         virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
00041
00042         virtual int     GetShapeType() const { return SPHERE_SHAPE_PROXYTYPE; }
00043
00044         SimdScalar      GetRadius() const { return m_radius;}
00045
00046         //debugging
00047         virtual char*   GetName()const {return "SPHERE";}
00048
00049         virtual void    SetMargin(float margin)
00050         {
00051                 ConvexShape::SetMargin(margin);
00052         }
00053         virtual float   GetMargin() const
00054         {
00055                 //to improve gjk behaviour, use radius+margin as the full margin, so never get into the penetration case
00056                 //this means, non-uniform scaling is not supported anymore
00057                 return m_localScaling[0] * m_radius + ConvexShape::GetMargin();
00058         }
00059
00060
00061 };
00062
00063
00064 #endif //SPHERE_MINKOWSKI_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: StridingMeshInterface.cpp File Reference

Bullet » CollisionShapes

StridingMeshInterface.cpp File Reference

#include "StridingMeshInterface.h"

Include dependency graph for StridingMeshInterface.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:46 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: StridingMeshInterface.cpp Source File

Bullet » CollisionShapes

StridingMeshInterface.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "StridingMeshInterface.h"
00017
00018 StridingMeshInterface::~StridingMeshInterface()
00019 {
00020
00021 }
00022
00023
00024 void    StridingMeshInterface::InternalProcessAllTriangles(InternalTriangleIndexCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00025 {
00026
00027         SimdVector3 meshScaling = getScaling();
00028
00029         int numtotalphysicsverts = 0;
00030         int part,graphicssubparts = getNumSubParts();
00031         for (part=0;part<graphicssubparts ;part++)
00032         {
00033                 const unsigned char * vertexbase;
00034                 const unsigned char * indexbase;
00035                 int indexstride;
00036                 PHY_ScalarType type;
00037                 PHY_ScalarType gfxindextype;
00038                 int stride,numverts,numtriangles;
00039                 getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,type,stride,&indexbase,indexstride,numtriangles,gfxindextype,part);
00040
00041                 numtotalphysicsverts+=numtriangles*3; //upper bound
00042
00043
00044                 int gfxindex;
00045                 SimdVector3 triangle[3];
00046
00047                 for (gfxindex=0;gfxindex<numtriangles;gfxindex++)
00048                 {
00049
00050                         int     graphicsindex=0;
00051
00052 #ifdef DEBUG_TRIANGLE_MESH
00053                         printf("triangle indices:\n");
00054 #endif //DEBUG_TRIANGLE_MESH
00055                         ASSERT(gfxindextype == PHY_INTEGER);
00056                         int* gfxbase = (int*)(indexbase+gfxindex*indexstride);
00057
00058                         for (int j=2;j>=0;j--)
00059                         {
00060
00061                                 graphicsindex = gfxbase[j];
00062 #ifdef DEBUG_TRIANGLE_MESH
00063                                 printf("%d ,",graphicsindex);
00064 #endif //DEBUG_TRIANGLE_MESH
00065                                 float* graphicsbase = (float*)(vertexbase+graphicsindex*stride);
00066
00067                                 triangle[j] = SimdVector3(
00068                                         graphicsbase[0]*meshScaling.getX(),
00069                                         graphicsbase[1]*meshScaling.getY(),
00070                                         graphicsbase[2]*meshScaling.getZ());
00071 #ifdef DEBUG_TRIANGLE_MESH
00072                                 printf("triangle vertices:%f,%f,%f\n",triangle[j].x(),triangle[j].y(),triangle[j].z());
00073 #endif //DEBUG_TRIANGLE_MESH
00074                         }
00075
00076
00077                         //check aabb in triangle-space, before doing this
00078                         callback->InternalProcessTriangleIndex(triangle,part,gfxindex);
00079
00080                 }
00081
00082                 unLockReadOnlyVertexBase(part);
00083         }
00084 }
00085
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: StridingMeshInterface.h File Reference

Bullet » CollisionShapes

StridingMeshInterface.h File Reference

#include "SimdVector3.h"
#include "TriangleCallback.h"

Include dependency graph for StridingMeshInterface.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | StridingMeshInterface
StridingMeshInterface is the interface class for high performance access to triangle meshes It allows for sharing graphics and collision meshes. More...

Typedefs

typedef enum PHY_ScalarType | PHY_ScalarType
PHY_ScalarType enumerates possible scalar types.

Enumerations

enum PHY_ScalarType {
PHY_FLOAT,
PHY_DOUBLE,
PHY_INTEGER,
PHY_SHORT,
PHY_FIXEDPOINT88
}
PHY_ScalarType enumerates possible scalar types. More...

Typedef Documentation

typedef enum PHY_ScalarType PHY_ScalarType

PHY_ScalarType enumerates possible scalar types.

See the StridingMeshInterface for its use

Enumeration Type Documentation

enum PHY_ScalarType

PHY_ScalarType enumerates possible scalar types.

See the StridingMeshInterface for its use

Enumerator:
PHY_FLOAT
PHY_DOUBLE
PHY_INTEGER
PHY_SHORT
PHY_FIXEDPOINT88

Definition at line 24 of file StridingMeshInterface.h.

Generated on Wed May 24 13:59:47 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: StridingMeshInterface.h Source File

Bullet » CollisionShapes

StridingMeshInterface.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef STRIDING_MESHINTERFACE_H
00017 #define STRIDING_MESHINTERFACE_H
00018
00019 #include "SimdVector3.h"
00020 #include "TriangleCallback.h"
00021
00024 typedef enum PHY_ScalarType {
00025         PHY_FLOAT,
00026         PHY_DOUBLE,
00027         PHY_INTEGER,
00028         PHY_SHORT,
00029         PHY_FIXEDPOINT88
00030 } PHY_ScalarType;
00031
00034 class  StridingMeshInterface
00035 {
00036         protected:
00037
00038                 SimdVector3 m_scaling;
00039
00040         public:
00041                 StridingMeshInterface() :m_scaling(1.f,1.f,1.f)
00042                 {
00043
00044                 }
00045
00046                 virtual ~StridingMeshInterface();
00047
00048
00049
00050                 void    InternalProcessAllTriangles(InternalTriangleIndexCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00051
00052
00058                 virtual void    getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0)=0;
00059
00060                 virtual void    getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const=0;
00061
00064                 virtual void    unLockVertexBase(int subpart)=0;
00065
00066                 virtual void    unLockReadOnlyVertexBase(int subpart) const=0;
00067
00068
00071                 virtual int             getNumSubParts() const=0;
00072
00073                 virtual void    preallocateVertices(int numverts)=0;
00074                 virtual void    preallocateIndices(int numindices)=0;
00075
00076                 const SimdVector3&      getScaling() const {
00077                         return m_scaling;
00078                 }
00079                 void    setScaling(const SimdVector3& scaling)
00080                 {
00081                         m_scaling = scaling;
00082                 }
00083
00084
00085 };
00086
00087 #endif //STRIDING_MESHINTERFACE_H
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SubSimplexConvexCast.cpp File Reference

Bullet » NarrowPhaseCollision

SubSimplexConvexCast.cpp File Reference

#include "SubSimplexConvexCast.h"
#include "CollisionShapes/ConvexShape.h"
#include "CollisionShapes/MinkowskiSumShape.h"
#include "NarrowPhaseCollision/SimplexSolverInterface.h"

Include dependency graph for SubSimplexConvexCast.cpp:

Go to the source code of this file.

Defines

#define MAX_ITERATIONS 1000

Define Documentation

#define MAX_ITERATIONS 1000

Definition at line 30 of file SubSimplexConvexCast.cpp.

Generated on Wed May 24 13:59:47 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SubSimplexConvexCast.cpp Source File

Bullet » NarrowPhaseCollision

SubSimplexConvexCast.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "SubSimplexConvexCast.h"
00018 #include "CollisionShapes/ConvexShape.h"
00019 #include "CollisionShapes/MinkowskiSumShape.h"
00020 #include "NarrowPhaseCollision/SimplexSolverInterface.h"
00021
00022
00023 SubsimplexConvexCast::SubsimplexConvexCast (ConvexShape* convexA,ConvexShape* convexB,SimplexSolverInterface* simplexSolver)
00024 :m_simplexSolver(simplexSolver),
00025 m_convexA(convexA),m_convexB(convexB)
00026 {
00027 }
00028
00029
00030 #define MAX_ITERATIONS 1000
00031
00032 bool    SubsimplexConvexCast::calcTimeOfImpact(
00033                 const SimdTransform& fromA,
00034                 const SimdTransform& toA,
00035                 const SimdTransform& fromB,
00036                 const SimdTransform& toB,
00037                 CastResult& result)
00038 {
00039
00040         MinkowskiSumShape combi(m_convexA,m_convexB);
00041         MinkowskiSumShape* convex = &combi;
00042
00043         SimdTransform   rayFromLocalA;
00044         SimdTransform   rayToLocalA;
00045
00046         rayFromLocalA = fromA.inverse()* fromB;
00047         rayToLocalA = toA.inverse()* toB;
00048
00049
00050         m_simplexSolver->reset();
00051
00052         convex->SetTransformB(SimdTransform(rayFromLocalA.getBasis()));
00053
00054         //float radius = 0.01f;
00055
00056         SimdScalar lambda = 0.f;
00057         //todo: need to verify this:
00058         //because of minkowski difference, we need the inverse direction
00059
00060         SimdVector3 s = -rayFromLocalA.getOrigin();
00061         SimdVector3 r = -(rayToLocalA.getOrigin()-rayFromLocalA.getOrigin());
00062         SimdVector3 x = s;
00063         SimdVector3 v;
00064         SimdVector3 arbitraryPoint = convex->LocalGetSupportingVertex(r);
00065
00066         v = x - arbitraryPoint;
00067
00068         int maxIter = MAX_ITERATIONS;
00069
00070         SimdVector3 n;
00071         n.setValue(0.f,0.f,0.f);
00072         bool hasResult = false;
00073         SimdVector3 c;
00074
00075         float lastLambda = lambda;
00076
00077
00078         float dist2 = v.length2();
00079         float epsilon = 0.0001f;
00080
00081         SimdVector3     w,p;
00082         float VdotR;
00083
00084         while ( (dist2 > epsilon) && maxIter--)
00085         {
00086                 p = convex->LocalGetSupportingVertex( v);
00087                  w = x - p;
00088
00089                 float VdotW = v.dot(w);
00090
00091                 if ( VdotW > 0.f)
00092                 {
00093                         VdotR = v.dot(r);
00094
00095                         if (VdotR >= -(SIMD_EPSILON*SIMD_EPSILON))
00096                                 return false;
00097                         else
00098                         {
00099                                 lambda = lambda - VdotW / VdotR;
00100                                 x = s + lambda * r;
00101                                 m_simplexSolver->reset();
00102                                 //check next line
00103                                 w = x-p;
00104                                 lastLambda = lambda;
00105                                 n = v;
00106                                 hasResult = true;
00107                         }
00108                 }
00109                 m_simplexSolver->addVertex( w, x , p);
00110                 if (m_simplexSolver->closest(v))
00111                 {
00112                         dist2 = v.length2();
00113                         hasResult = true;
00114                         //printf("V=%f , %f, %f\n",v[0],v[1],v[2]);
00115                         //printf("DIST2=%f\n",dist2);
00116                         //printf("numverts = %i\n",m_simplexSolver->numVertices());
00117                 } else
00118                 {
00119                         dist2 = 0.f;
00120                 }
00121         }
00122
00123         //int numiter = MAX_ITERATIONS - maxIter;
00124 //      printf("number of iterations: %d", numiter);
00125         result.m_fraction = lambda;
00126         result.m_normal = n;
00127
00128         return true;
00129 }
00130
00131
00132
Generated on Wed May 24 13:58:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SubSimplexConvexCast.h File Reference

Bullet » NarrowPhaseCollision

SubSimplexConvexCast.h File Reference

#include "ConvexCast.h"
#include "SimplexSolverInterface.h"

Include dependency graph for SubSimplexConvexCast.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class SubsimplexConvexCast
SubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against General Convex Objects with Application to Continuous Collision Detection" GJK based Ray Cast, optimized version Objects should not start in overlap, otherwise results are not defined. More...

Generated on Wed May 24 13:59:48 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SubSimplexConvexCast.h Source File

Bullet » NarrowPhaseCollision

SubSimplexConvexCast.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef SUBSIMPLEX_CONVEX_CAST_H
00018 #define SUBSIMPLEX_CONVEX_CAST_H
00019
00020 #include "ConvexCast.h"
00021 #include "SimplexSolverInterface.h"
00022 class ConvexShape;
00023
00028 class SubsimplexConvexCast : public ConvexCast
00029 {
00030         SimplexSolverInterface* m_simplexSolver;
00031         ConvexShape*    m_convexA;
00032         ConvexShape*    m_convexB;
00033
00034 public:
00035
00036         SubsimplexConvexCast (ConvexShape*      shapeA,ConvexShape*     shapeB,SimplexSolverInterface* simplexSolver);
00037
00038         //virtual ~SubsimplexConvexCast();
00041         virtual bool    calcTimeOfImpact(
00042                         const SimdTransform& fromA,
00043                         const SimdTransform& toA,
00044                         const SimdTransform& fromB,
00045                         const SimdTransform& toB,
00046                         CastResult& result);
00047
00048 };
00049
00050 #endif //SUBSIMPLEX_CONVEX_CAST_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleCallback.cpp File Reference

Bullet » CollisionShapes

TriangleCallback.cpp File Reference

#include "TriangleCallback.h"

Include dependency graph for TriangleCallback.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:48 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleCallback.cpp Source File

Bullet » CollisionShapes

TriangleCallback.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "TriangleCallback.h"
00017
00018 TriangleCallback::~TriangleCallback()
00019 {
00020
00021 }
00022
00023
00024 InternalTriangleIndexCallback::~InternalTriangleIndexCallback()
00025 {
00026
00027 }
00028
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleCallback.h File Reference

Bullet » CollisionShapes

TriangleCallback.h File Reference

#include "SimdVector3.h"

Include dependency graph for TriangleCallback.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | TriangleCallback
class | InternalTriangleIndexCallback

Generated on Wed May 24 13:59:49 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleCallback.h Source File

Bullet » CollisionShapes

TriangleCallback.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef TRIANGLE_CALLBACK_H
00017 #define TRIANGLE_CALLBACK_H
00018
00019 #include "SimdVector3.h"
00020
00021
00022 class TriangleCallback
00023 {
00024 public:
00025
00026         virtual ~TriangleCallback();
00027         virtual void ProcessTriangle(SimdVector3* triangle, int partId, int triangleIndex) = 0;
00028 };
00029
00030 class InternalTriangleIndexCallback
00031 {
00032 public:
00033
00034         virtual ~InternalTriangleIndexCallback();
00035         virtual void InternalProcessTriangleIndex(SimdVector3* triangle,int partId,int  triangleIndex) = 0;
00036 };
00037
00038
00039
00040 #endif //TRIANGLE_CALLBACK_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleIndexVertexArray.cpp File Reference

Bullet » CollisionShapes

TriangleIndexVertexArray.cpp File Reference

#include "TriangleIndexVertexArray.h"

Include dependency graph for TriangleIndexVertexArray.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:49 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleIndexVertexArray.cpp Source File

Bullet » CollisionShapes

TriangleIndexVertexArray.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "TriangleIndexVertexArray.h"
00017
00018 TriangleIndexVertexArray::TriangleIndexVertexArray(int numTriangleIndices,int* triangleIndexBase,int triangleIndexStride,int numVertices,float* vertexBase,int vertexStride)
00019 :m_numTriangleIndices(numTriangleIndices),
00020 m_triangleIndexBase(triangleIndexBase),
00021 m_triangleIndexStride(triangleIndexStride),
00022 m_numVertices(numVertices),
00023 m_vertexBase(vertexBase),
00024 m_vertexStride(vertexStride)
00025 {
00026 }
00027
00028 void    TriangleIndexVertexArray::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart)
00029 {
00030         numverts = m_numVertices;
00031         (*vertexbase) = (unsigned char *)m_vertexBase;
00032         type = PHY_FLOAT;
00033         vertexStride = m_vertexStride;
00034
00035         numfaces = m_numTriangleIndices;
00036         (*indexbase) = (unsigned char *)m_triangleIndexBase;
00037         indexstride = m_triangleIndexStride;
00038         indicestype = PHY_INTEGER;
00039 }
00040
00041 void    TriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const
00042 {
00043         numverts = m_numVertices;
00044         (*vertexbase) = (unsigned char *)m_vertexBase;
00045         type = PHY_FLOAT;
00046         vertexStride = m_vertexStride;
00047
00048         numfaces = m_numTriangleIndices;
00049         (*indexbase) = (unsigned char *)m_triangleIndexBase;
00050         indexstride = m_triangleIndexStride;
00051         indicestype = PHY_INTEGER;
00052 }
00053
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleIndexVertexArray.h File Reference

Bullet » CollisionShapes

TriangleIndexVertexArray.h File Reference

#include "StridingMeshInterface.h"

Include dependency graph for TriangleIndexVertexArray.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class TriangleIndexVertexArray

Generated on Wed May 24 13:59:49 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleIndexVertexArray.h Source File

Bullet » CollisionShapes

TriangleIndexVertexArray.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "StridingMeshInterface.h"
00017
00018
00019 class TriangleIndexVertexArray : public StridingMeshInterface
00020 {
00021
00022         int                     m_numTriangleIndices;
00023         int*            m_triangleIndexBase;
00024         int                     m_triangleIndexStride;
00025         int                     m_numVertices;
00026         float*          m_vertexBase;
00027         int                     m_vertexStride;
00028
00029 public:
00030
00031         TriangleIndexVertexArray(int numTriangleIndices,int* triangleIndexBase,int triangleIndexStride,int numVertices,float* vertexBase,int vertexStride);
00032
00033         virtual void    getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0);
00034
00035         virtual void    getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& vertexStride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const;
00036
00039         virtual void    unLockVertexBase(int subpart) {}
00040
00041         virtual void    unLockReadOnlyVertexBase(int subpart) const {}
00042
00045         virtual int             getNumSubParts() const { return 1;}
00046
00047         virtual void    preallocateVertices(int numverts){}
00048         virtual void    preallocateIndices(int numindices){}
00049
00050 };
00051
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMesh.cpp File Reference

Bullet » CollisionShapes

TriangleMesh.cpp File Reference

#include "TriangleMesh.h"
#include <assert.h>

Include dependency graph for TriangleMesh.cpp:

Go to the source code of this file.

Variables

static int myindices [3] = {0,1,2}

Variable Documentation

int myindices[3] = {0,1,2} [static]

Definition at line 19 of file TriangleMesh.cpp.

Referenced by TriangleMesh::getLockedReadOnlyVertexIndexBase(), and TriangleMesh::getLockedVertexIndexBase().

Generated on Wed May 24 13:59:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMesh.cpp Source File

Bullet » CollisionShapes

TriangleMesh.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "TriangleMesh.h"
00017 #include <assert.h>
00018
00019 static int      myindices[3] = {0,1,2};
00020
00021 TriangleMesh::TriangleMesh ()
00022 {
00023
00024 }
00025
00026 void    TriangleMesh::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart)
00027 {
00028         numverts = 3;
00029         *vertexbase = (unsigned char*)&m_triangles[subpart];
00030         type = PHY_FLOAT;
00031         stride = sizeof(SimdVector3);
00032
00033
00034         numfaces = 1;
00035         *indexbase = (unsigned char*) &myindices[0];
00036         indicestype = PHY_INTEGER;
00037         indexstride = sizeof(int);
00038
00039 }
00040
00041 void    TriangleMesh::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const
00042 {
00043         numverts = 3;
00044         *vertexbase = (unsigned char*)&m_triangles[subpart];
00045         type = PHY_FLOAT;
00046         stride = sizeof(SimdVector3);
00047
00048
00049         numfaces = 1;
00050         *indexbase = (unsigned char*) &myindices[0];
00051         indicestype = PHY_INTEGER;
00052         indexstride = sizeof(int);
00053
00054 }
00055
00056
00057
00058 int             TriangleMesh::getNumSubParts() const
00059 {
00060         return m_triangles.size();
00061 }
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMesh.h File Reference

Bullet » CollisionShapes

TriangleMesh.h File Reference

#include "CollisionShapes/StridingMeshInterface.h"
#include <vector>
#include <SimdVector3.h>

Include dependency graph for TriangleMesh.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | MyTriangle
class | TriangleMesh
TriangleMesh provides storage for a concave triangle mesh. It can be used as data for the TriangleMeshShape. More...

Generated on Wed May 24 13:59:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMesh.h Source File

Bullet » CollisionShapes

TriangleMesh.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #ifndef TRIANGLE_MESH_H
00018 #define TRIANGLE_MESH_H
00019
00020 #include "CollisionShapes/StridingMeshInterface.h"
00021 #include <vector>
00022 #include <SimdVector3.h>
00023
00024 struct MyTriangle
00025 {
00026         SimdVector3     m_vert0;
00027         SimdVector3     m_vert1;
00028         SimdVector3     m_vert2;
00029 };
00030
00032 class TriangleMesh : public StridingMeshInterface
00033 {
00034         std::vector<MyTriangle> m_triangles;
00035
00036
00037         public:
00038                 TriangleMesh ();
00039
00040                 void    AddTriangle(const SimdVector3& vertex0,const SimdVector3& vertex1,const SimdVector3& vertex2)
00041                 {
00042                         MyTriangle tri;
00043                         tri.m_vert0 = vertex0;
00044                         tri.m_vert1 = vertex1;
00045                         tri.m_vert2 = vertex2;
00046                         m_triangles.push_back(tri);
00047                 }
00048
00049
00050 //StridingMeshInterface interface implementation
00051
00052                 virtual void    getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0);
00053
00054                 virtual void    getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart=0) const;
00055
00058                 virtual void    unLockVertexBase(int subpart) {}
00059
00060                 virtual void    unLockReadOnlyVertexBase(int subpart) const {}
00061
00064                 virtual int             getNumSubParts() const;
00065
00066                 virtual void    preallocateVertices(int numverts){}
00067                 virtual void    preallocateIndices(int numindices){}
00068
00069
00070 };
00071
00072 #endif //TRIANGLE_MESH_H
00073
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMeshShape.cpp File Reference

Bullet » CollisionShapes

TriangleMeshShape.cpp File Reference

#include "TriangleMeshShape.h"
#include "SimdVector3.h"
#include "SimdQuaternion.h"
#include "StridingMeshInterface.h"
#include "AabbUtil2.h"
#include "CollisionShapes/CollisionMargin.h"
#include "stdio.h"

Include dependency graph for TriangleMeshShape.cpp:

Go to the source code of this file.

Classes

class SupportVertexCallback

Generated on Wed May 24 13:59:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMeshShape.cpp Source File

Bullet » CollisionShapes

TriangleMeshShape.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "TriangleMeshShape.h"
00017 #include "SimdVector3.h"
00018 #include "SimdQuaternion.h"
00019 #include "StridingMeshInterface.h"
00020 #include "AabbUtil2.h"
00021 #include "CollisionShapes/CollisionMargin.h"
00022
00023 #include "stdio.h"
00024
00025 TriangleMeshShape::TriangleMeshShape(StridingMeshInterface* meshInterface)
00026 : m_meshInterface(meshInterface),
00027 m_collisionMargin(CONVEX_DISTANCE_MARGIN)
00028 {
00029         RecalcLocalAabb();
00030 }
00031
00032
00033 TriangleMeshShape::~TriangleMeshShape()
00034 {
00035
00036 }
00037
00038
00039
00040
00041 void TriangleMeshShape::GetAabb(const SimdTransform& trans,SimdVector3& aabbMin,SimdVector3& aabbMax) const
00042 {
00043
00044         SimdVector3 localHalfExtents = 0.5f*(m_localAabbMax-m_localAabbMin);
00045         SimdVector3 localCenter = 0.5f*(m_localAabbMax+m_localAabbMin);
00046
00047         SimdMatrix3x3 abs_b = trans.getBasis().absolute();
00048
00049         SimdPoint3 center = trans(localCenter);
00050
00051         SimdVector3 extent = SimdVector3(abs_b[0].dot(localHalfExtents),
00052                    abs_b[1].dot(localHalfExtents),
00053                   abs_b[2].dot(localHalfExtents));
00054         extent += SimdVector3(GetMargin(),GetMargin(),GetMargin());
00055
00056         aabbMin = center - extent;
00057         aabbMax = center + extent;
00058
00059
00060 }
00061
00062 void    TriangleMeshShape::RecalcLocalAabb()
00063 {
00064         for (int i=0;i<3;i++)
00065         {
00066                 SimdVector3 vec(0.f,0.f,0.f);
00067                 vec[i] = 1.f;
00068                 SimdVector3 tmp = LocalGetSupportingVertex(vec);
00069                 m_localAabbMax[i] = tmp[i]+m_collisionMargin;
00070                 vec[i] = -1.f;
00071                 tmp = LocalGetSupportingVertex(vec);
00072                 m_localAabbMin[i] = tmp[i]-m_collisionMargin;
00073         }
00074 }
00075
00076
00077
00078 class SupportVertexCallback : public TriangleCallback
00079 {
00080
00081         SimdVector3 m_supportVertexLocal;
00082 public:
00083
00084         SimdTransform   m_worldTrans;
00085         SimdScalar m_maxDot;
00086         SimdVector3 m_supportVecLocal;
00087
00088         SupportVertexCallback(const SimdVector3& supportVecWorld,const SimdTransform& trans)
00089                 : m_supportVertexLocal(0.f,0.f,0.f), m_worldTrans(trans) ,m_maxDot(-1e30f)
00090
00091         {
00092                 m_supportVecLocal = supportVecWorld * m_worldTrans.getBasis();
00093         }
00094
00095         virtual void ProcessTriangle( SimdVector3* triangle,int partId, int triangleIndex)
00096         {
00097                 for (int i=0;i<3;i++)
00098                 {
00099                         SimdScalar dot = m_supportVecLocal.dot(triangle[i]);
00100                         if (dot > m_maxDot)
00101                         {
00102                                 m_maxDot = dot;
00103                                 m_supportVertexLocal = triangle[i];
00104                         }
00105                 }
00106         }
00107
00108         SimdVector3 GetSupportVertexWorldSpace()
00109         {
00110                 return m_worldTrans(m_supportVertexLocal);
00111         }
00112
00113         SimdVector3     GetSupportVertexLocal()
00114         {
00115                 return m_supportVertexLocal;
00116         }
00117
00118 };
00119
00120
00121 void TriangleMeshShape::setLocalScaling(const SimdVector3& scaling)
00122 {
00123         m_meshInterface->setScaling(scaling);
00124         RecalcLocalAabb();
00125 }
00126
00127 const SimdVector3& TriangleMeshShape::getLocalScaling() const
00128 {
00129         return m_meshInterface->getScaling();
00130 }
00131
00132
00133
00134
00135
00136
00137 //#define DEBUG_TRIANGLE_MESH
00138
00139
00140 void    TriangleMeshShape::ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const
00141 {
00142
00143         struct FilteredCallback : public InternalTriangleIndexCallback
00144         {
00145                 TriangleCallback* m_callback;
00146                 SimdVector3 m_aabbMin;
00147                 SimdVector3 m_aabbMax;
00148
00149                 FilteredCallback(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax)
00150                         :m_callback(callback),
00151                         m_aabbMin(aabbMin),
00152                         m_aabbMax(aabbMax)
00153                 {
00154                 }
00155
00156                 virtual void InternalProcessTriangleIndex(SimdVector3* triangle,int partId,int triangleIndex)
00157                 {
00158                         if (TestTriangleAgainstAabb2(&triangle[0],m_aabbMin,m_aabbMax))
00159                         {
00160                                 //check aabb in triangle-space, before doing this
00161                                 m_callback->ProcessTriangle(triangle,partId,triangleIndex);
00162                         }
00163
00164                 }
00165
00166         };
00167
00168         FilteredCallback filterCallback(callback,aabbMin,aabbMax);
00169
00170         m_meshInterface->InternalProcessAllTriangles(&filterCallback,aabbMin,aabbMax);
00171
00172 }
00173
00174
00175
00176
00177
00178 void    TriangleMeshShape::CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00179 {
00180         //moving concave objects not supported
00181         assert(0);
00182         inertia.setValue(0.f,0.f,0.f);
00183 }
00184
00185
00186 SimdVector3 TriangleMeshShape::LocalGetSupportingVertex(const SimdVector3& vec) const
00187 {
00188         SimdVector3 supportVertex;
00189
00190         SimdTransform ident;
00191         ident.setIdentity();
00192
00193         SupportVertexCallback supportCallback(vec,ident);
00194
00195         SimdVector3 aabbMax(1e30f,1e30f,1e30f);
00196
00197         ProcessAllTriangles(&supportCallback,-aabbMax,aabbMax);
00198
00199         supportVertex = supportCallback.GetSupportVertexLocal();
00200
00201         return supportVertex;
00202 }
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMeshShape.h File Reference

Bullet » CollisionShapes

TriangleMeshShape.h File Reference

#include "CollisionShapes/CollisionShape.h"
#include "BroadphaseCollision/BroadphaseProxy.h"
#include "StridingMeshInterface.h"
#include "TriangleCallback.h"

Include dependency graph for TriangleMeshShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class TriangleMeshShape
Concave triangle mesh. Uses an interface to access the triangles to allow for sharing graphics/physics triangles. More...

Generated on Wed May 24 13:59:51 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMeshShape.h Source File

Bullet » CollisionShapes

TriangleMeshShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef TRIANGLE_MESH_SHAPE_H
00017 #define TRIANGLE_MESH_SHAPE_H
00018
00019 #include "CollisionShapes/CollisionShape.h"
00020 #include "BroadphaseCollision/BroadphaseProxy.h" // for the types
00021
00022 #include "StridingMeshInterface.h"
00023 #include "TriangleCallback.h"
00024
00025
00026
00028 class TriangleMeshShape : public CollisionShape
00029 {
00030 protected:
00031         StridingMeshInterface* m_meshInterface;
00032         SimdVector3     m_localAabbMin;
00033         SimdVector3     m_localAabbMax;
00034         float m_collisionMargin;
00035
00036 public:
00037         TriangleMeshShape(StridingMeshInterface* meshInterface);
00038
00039         virtual ~TriangleMeshShape();
00040
00041
00042
00043         virtual SimdVector3 LocalGetSupportingVertex(const SimdVector3& vec) const;
00044
00045         virtual SimdVector3     LocalGetSupportingVertexWithoutMargin(const SimdVector3& vec)const
00046         {
00047                 assert(0);
00048                 return LocalGetSupportingVertex(vec);
00049         }
00050
00051         void    RecalcLocalAabb();
00052
00053         virtual int     GetShapeType() const
00054         {
00055                 return TRIANGLE_MESH_SHAPE_PROXYTYPE;
00056         }
00057
00058         virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax) const;
00059
00060         virtual void    ProcessAllTriangles(TriangleCallback* callback,const SimdVector3& aabbMin,const SimdVector3& aabbMax) const;
00061
00062         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia);
00063
00064         virtual void    setLocalScaling(const SimdVector3& scaling);
00065         virtual const SimdVector3& getLocalScaling() const;
00066
00067
00068         //debugging
00069         virtual char*   GetName()const {return "TRIANGLEMESH";}
00070
00071
00072         virtual float GetMargin() const {
00073                 return m_collisionMargin;
00074         }
00075         virtual void SetMargin(float collisionMargin)
00076         {
00077                 m_collisionMargin = collisionMargin;
00078         }
00079
00080
00081
00082 };
00083
00084 #endif //TRIANGLE_MESH_SHAPE_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleShape.h File Reference

Bullet » CollisionShapes

TriangleShape.h File Reference

#include "ConvexShape.h"
#include "CollisionShapes/BoxShape.h"

Include dependency graph for TriangleShape.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class TriangleShape

Generated on Wed May 24 13:59:51 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleShape.h Source File

Bullet » CollisionShapes

TriangleShape.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef OBB_TRIANGLE_MINKOWSKI_H
00017 #define OBB_TRIANGLE_MINKOWSKI_H
00018
00019 #include "ConvexShape.h"
00020 #include "CollisionShapes/BoxShape.h"
00021
00022 class TriangleShape : public PolyhedralConvexShape
00023 {
00024
00025
00026 public:
00027
00028         SimdVector3     m_vertices1[3];
00029
00030
00031         virtual int GetNumVertices() const
00032         {
00033                 return 3;
00034         }
00035
00036         const SimdVector3& GetVertexPtr(int index) const
00037         {
00038                 return m_vertices1[index];
00039         }
00040         virtual void GetVertex(int index,SimdVector3& vert) const
00041         {
00042                 vert = m_vertices1[index];
00043         }
00044         virtual int     GetShapeType() const
00045         {
00046                 return TRIANGLE_SHAPE_PROXYTYPE;
00047         }
00048
00049         virtual int GetNumEdges() const
00050         {
00051                 return 3;
00052         }
00053
00054         virtual void GetEdge(int i,SimdPoint3& pa,SimdPoint3& pb) const
00055         {
00056                 GetVertex(i,pa);
00057                 GetVertex((i+1)%3,pb);
00058         }
00059
00060         virtual void GetAabb(const SimdTransform& t,SimdVector3& aabbMin,SimdVector3& aabbMax)const
00061         {
00062 //              ASSERT(0);
00063                 GetAabbSlow(t,aabbMin,aabbMax);
00064         }
00065
00066         SimdVector3 LocalGetSupportingVertexWithoutMargin(const SimdVector3& dir)const
00067         {
00068                 SimdVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2]));
00069                 return m_vertices1[dots.maxAxis()];
00070
00071         }
00072
00073         virtual void    BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3* vectors,SimdVector3* supportVerticesOut,int numVectors) const
00074         {
00075                 for (int i=0;i<numVectors;i++)
00076                 {
00077                         const SimdVector3& dir = vectors[i];
00078                         SimdVector3 dots(dir.dot(m_vertices1[0]), dir.dot(m_vertices1[1]), dir.dot(m_vertices1[2]));
00079                         supportVerticesOut[i] = m_vertices1[dots.maxAxis()];
00080                 }
00081
00082         }
00083
00084
00085
00086         TriangleShape(const SimdVector3& p0,const SimdVector3& p1,const SimdVector3& p2)
00087         {
00088                 m_vertices1[0] = p0;
00089                 m_vertices1[1] = p1;
00090                 m_vertices1[2] = p2;
00091         }
00092
00093
00094
00095         virtual void GetPlane(SimdVector3& planeNormal,SimdPoint3& planeSupport,int i) const
00096         {
00097                 GetPlaneEquation(i,planeNormal,planeSupport);
00098         }
00099
00100         virtual int     GetNumPlanes() const
00101         {
00102                 return 1;
00103         }
00104
00105         void CalcNormal(SimdVector3& normal) const
00106         {
00107                 normal = (m_vertices1[1]-m_vertices1[0]).cross(m_vertices1[2]-m_vertices1[0]);
00108                 normal.normalize();
00109         }
00110
00111         virtual void GetPlaneEquation(int i, SimdVector3& planeNormal,SimdPoint3& planeSupport) const
00112         {
00113                 CalcNormal(planeNormal);
00114                 planeSupport = m_vertices1[0];
00115         }
00116
00117         virtual void    CalculateLocalInertia(SimdScalar mass,SimdVector3& inertia)
00118         {
00119                 ASSERT(0);
00120                 inertia.setValue(0.f,0.f,0.f);
00121         }
00122
00123                 virtual bool IsInside(const SimdPoint3& pt,SimdScalar tolerance) const
00124         {
00125                 SimdVector3 normal;
00126                 CalcNormal(normal);
00127                 //distance to plane
00128                 SimdScalar dist = pt.dot(normal);
00129                 SimdScalar planeconst = m_vertices1[0].dot(normal);
00130                 dist -= planeconst;
00131                 if (dist >= -tolerance && dist <= tolerance)
00132                 {
00133                         //inside check on edge-planes
00134                         int i;
00135                         for (i=0;i<3;i++)
00136                         {
00137                                 SimdPoint3 pa,pb;
00138                                 GetEdge(i,pa,pb);
00139                                 SimdVector3 edge = pb-pa;
00140                                 SimdVector3 edgeNormal = edge.cross(normal);
00141                                 edgeNormal.normalize();
00142                                 SimdScalar dist = pt.dot( edgeNormal);
00143                                 SimdScalar edgeConst = pa.dot(edgeNormal);
00144                                 dist -= edgeConst;
00145                                 if (dist < -tolerance)
00146                                         return false;
00147                         }
00148
00149                         return true;
00150                 }
00151
00152                 return false;
00153         }
00154                 //debugging
00155                 virtual char*   GetName()const
00156                 {
00157                         return "Triangle";
00158                 }
00159
00160
00161 };
00162
00163 #endif //OBB_TRIANGLE_MINKOWSKI_H
00164
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TypedConstraint.cpp File Reference

BulletDynamics » ConstraintSolver

TypedConstraint.cpp File Reference

#include "TypedConstraint.h"
#include "Dynamics/RigidBody.h"
#include "Dynamics/MassProps.h"

Include dependency graph for TypedConstraint.cpp:

Go to the source code of this file.

Functions

static RigidBody s_fixed (MassProps(0, SimdVector3(0.f, 0.f, 0.f)), 0.f, 0.f, 1.f, 1.f)

Function Documentation

static RigidBody s_fixed | ( | MassProps(0, SimdVector3(0.f, 0.f, 0.f)) | ,
 |  | 0. | f,
 |  | 0. | f,
 |  | 1. | f,
 |  | 1. | f
 | ) | [static]

Referenced by TypedConstraint::TypedConstraint().

Generated on Wed May 24 13:59:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TypedConstraint.cpp Source File

BulletDynamics » ConstraintSolver

TypedConstraint.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017 #include "TypedConstraint.h"
00018 #include "Dynamics/RigidBody.h"
00019 #include "Dynamics/MassProps.h"
00020
00021 static RigidBody s_fixed(MassProps(0,SimdVector3(0.f,0.f,0.f)),0.f,0.f,1.f,1.f);
00022
00023 TypedConstraint::TypedConstraint()
00024 : m_userConstraintType(-1),
00025 m_userConstraintId(-1),
00026 m_rbA(s_fixed),
00027 m_rbB(s_fixed)
00028 {
00029         s_fixed.setMassProps(0.f,SimdVector3(0.f,0.f,0.f));
00030 }
00031 TypedConstraint::TypedConstraint(RigidBody& rbA)
00032 : m_userConstraintType(-1),
00033 m_userConstraintId(-1),
00034 m_rbA(rbA),
00035 m_rbB(s_fixed)
00036 {
00037                 s_fixed.setMassProps(0.f,SimdVector3(0.f,0.f,0.f));
00038
00039 }
00040
00041
00042 TypedConstraint::TypedConstraint(RigidBody& rbA,RigidBody& rbB)
00043 : m_userConstraintType(-1),
00044 m_userConstraintId(-1),
00045 m_rbA(rbA),
00046 m_rbB(rbB)
00047 {
00048                 s_fixed.setMassProps(0.f,SimdVector3(0.f,0.f,0.f));
00049
00050 }
00051
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TypedConstraint.h File Reference

BulletDynamics » ConstraintSolver

TypedConstraint.h File Reference

#include "SimdScalar.h"

Include dependency graph for TypedConstraint.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class TypedConstraint

Generated on Wed May 24 13:59:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TypedConstraint.h Source File

BulletDynamics » ConstraintSolver

TypedConstraint.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef TYPED_CONSTRAINT_H
00017 #define TYPED_CONSTRAINT_H
00018
00019 class RigidBody;
00020 #include "SimdScalar.h"
00021
00022 //TypedConstraint is the baseclass for Bullet constraints and vehicles
00023 class TypedConstraint
00024 {
00025         int     m_userConstraintType;
00026         int     m_userConstraintId;
00027
00028 protected:
00029         RigidBody&      m_rbA;
00030         RigidBody&      m_rbB;
00031
00032 public:
00033
00034         TypedConstraint();
00035         virtual ~TypedConstraint() {};
00036         TypedConstraint(RigidBody& rbA);
00037
00038         TypedConstraint(RigidBody& rbA,RigidBody& rbB);
00039
00040         virtual void    BuildJacobian() = 0;
00041
00042         virtual void    SolveConstraint(SimdScalar      timeStep) = 0;
00043
00044         const RigidBody& GetRigidBodyA() const
00045         {
00046                 return m_rbA;
00047         }
00048         const RigidBody& GetRigidBodyB() const
00049         {
00050                 return m_rbB;
00051         }
00052
00053         int GetUserConstraintType() const
00054         {
00055                 return m_userConstraintType ;
00056         }
00057
00058         void    SetUserConstraintType(int userConstraintType)
00059         {
00060                 m_userConstraintType = userConstraintType;
00061         };
00062
00063         void    SetUserConstraintId(int uid)
00064         {
00065                 m_userConstraintId = uid;
00066         }
00067
00068         int GetUserConstraintId()
00069         {
00070                 return m_userConstraintId;
00071         }
00072 };
00073
00074 #endif //TYPED_CONSTRAINT_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: UnionFind.cpp File Reference

Bullet » CollisionDispatch

UnionFind.cpp File Reference

#include "UnionFind.h"
#include <assert.h>

Include dependency graph for UnionFind.cpp:

Go to the source code of this file.

Generated on Wed May 24 13:59:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: UnionFind.cpp Source File

Bullet » CollisionDispatch

UnionFind.cpp

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #include "UnionFind.h"
00017 #include <assert.h>
00018
00019
00020 int UnionFind::find(int x)
00021 {
00022         assert(x < m_N);
00023         assert(x >= 0);
00024
00025         while (x != m_id[x])
00026         {
00027                 x = m_id[x];
00028                 assert(x < m_N);
00029                 assert(x >= 0);
00030
00031         }
00032         return x;
00033 }
00034
00035 UnionFind::~UnionFind()
00036 {
00037         Free();
00038
00039 }
00040
00041 UnionFind::UnionFind()
00042 :m_id(0),
00043 m_sz(0),
00044 m_N(0)
00045 {
00046
00047 }
00048
00049 void    UnionFind::Allocate(int N)
00050 {
00051         if (m_N < N)
00052         {
00053                 Free();
00054
00055                 m_N = N;
00056                 m_id = new int[N];
00057                 m_sz = new int[N];
00058         }
00059 }
00060 void    UnionFind::Free()
00061 {
00062         if (m_N)
00063         {
00064                 m_N=0;
00065                 delete m_id;
00066                 delete m_sz;
00067         }
00068 }
00069
00070
00071 void    UnionFind::reset(int N)
00072 {
00073         Allocate(N);
00074
00075         for (int i = 0; i < m_N; i++)
00076         {
00077                 m_id[i] = i; m_sz[i] = 1;
00078         }
00079 }
00080
00081
00082 int UnionFind ::find(int p, int q)
00083 {
00084         return (find(p) == find(q));
00085 }
00086
00087 void UnionFind ::unite(int p, int q)
00088 {
00089         int i = find(p), j = find(q);
00090         if (i == j)
00091                 return;
00092         if (m_sz[i] < m_sz[j])
00093         {
00094                 m_id[i] = j; m_sz[j] += m_sz[i];
00095         }
00096         else
00097         {
00098                 m_id[j] = i; m_sz[i] += m_sz[j];
00099         }
00100 }
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: UnionFind.h File Reference

Bullet » CollisionDispatch

UnionFind.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class UnionFind
UnionFind calculates connected subsets. More...

Generated on Wed May 24 13:59:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: UnionFind.h Source File

Bullet » CollisionDispatch

UnionFind.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016 #ifndef UNION_FIND_H
00017 #define UNION_FIND_H
00018
00020 class UnionFind
00021   {
00022     private:
00023                 int*    m_id;
00024                 int*    m_sz;
00025                 int m_N;
00026
00027     public:
00028                 int find(int x);
00029
00030                 UnionFind();
00031                 ~UnionFind();
00032
00033           void  reset(int N);
00034
00035       int find(int p, int q);
00036       void unite(int p, int q);
00037
00038           void  Allocate(int N);
00039           void  Free();
00040
00041   };
00042
00043
00044 #endif //UNION_FIND_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Vector.cpp File Reference

LinearMath

Vector.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:52 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Vector.cpp Source File

LinearMath

Vector.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 //
00005 // Vector.cpp
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018 #ifdef WIN32
00019 #if _MSC_VER >= 1310
00020 #include "Vector.h"
00021 #include <float.h>
00022
00024 // Vector3
00025
00026 bool Vector3::IsFinite() const
00027 {
00028         if (_finite(GetX()) && _finite(GetY()) && _finite(GetZ()))
00029                 return true;
00030         return false;
00031 }
00032
00033
00035 // Point3
00036
00037 bool Point3::IsFinite() const
00038 {
00039         if (_finite(GetX()) && _finite(GetY()) && _finite(GetZ()))
00040                 return true;
00041         return false;
00042 }
00043
00044
00046 // Vector4
00047 bool Vector4::IsFinite() const
00048 {
00049         if (_finite(GetX()) && _finite(GetY()) && _finite(GetZ()) && _finite(GetW()))
00050                 return true;
00051         return false;
00052 }
00053
00054 #endif
00055 #endif //WIN32
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Vector.h File Reference

LinearMath

Vector.h File Reference

#include "VectorBase.h"
#include "Vector.inl"

Include dependency graph for Vector.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class | Vector2
class | Point2

Functions

__declspec (align(16)) class Vector3

Function Documentation

__declspec ( align(16) )

Definition at line 27 of file Vector.h.

References operator *(), operator+(), operator-(), operator/(), and operator==().

Generated on Wed May 24 13:59:53 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Vector.h Source File

LinearMath

Vector.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // Vector.h
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifndef BULLET_VECTOR_H
00018 #define BULLET_VECTOR_H
00019
00020 #include "VectorBase.h"
00021
00022 class Point3;
00023 class Vector4;
00024
00026 // Vector3
00027 __declspec(align(16)) class Vector3 : public Vector4Base
00028 {
00029 public:
00030         BULLET_ALIGNED_NEW_AND_DELETE
00031
00032         // constructors
00033         Vector3();
00034         Vector3(const Vector3& v);
00035         Vector3(float x, float y, float z);
00036         Vector3(const Scalar& x, const Scalar& y, const Scalar& z);
00037
00038         // construction to constant
00039         Vector3(const Maths::ZeroTag&);
00040         Vector3(const Maths::UnitXTag&);
00041         Vector3(const Maths::UnitYTag&);
00042         Vector3(const Maths::UnitZTag&);
00043         Vector3(const Maths::UnitNegXTag&);
00044         Vector3(const Maths::UnitNegYTag&);
00045         Vector3(const Maths::UnitNegZTag&);
00046
00047         // explicit constructors
00048         explicit Vector3(const __m128 b);
00049         explicit Vector3(const Vector4Base& v);
00050         explicit Vector3(const Scalar& v);
00051         explicit Vector3(const Point3& v);
00052         explicit Vector3(const Vector4& v);
00053         explicit Vector3(const float* p);
00054
00055         // assignment
00056         const Vector3& operator=(const Vector3& v);
00057
00058         // assignment to constant
00059         const Vector3& operator=(const Maths::ZeroTag&);
00060         const Vector3& operator=(const Maths::UnitXTag&);
00061         const Vector3& operator=(const Maths::UnitYTag&);
00062         const Vector3& operator=(const Maths::UnitZTag&);
00063         const Vector3& operator=(const Maths::UnitNegXTag&);
00064         const Vector3& operator=(const Maths::UnitNegYTag&);
00065         const Vector3& operator=(const Maths::UnitNegZTag&);
00066
00067         // in place operations
00068         void operator+=(const Vector3& b);
00069         void operator-=(const Vector3& b);
00070         void operator*=(const Vector3& b);
00071         void operator/=(const Vector3& b);
00072         void operator*=(const Scalar& s);
00073         void operator/=(const Scalar& s);
00074
00075         // operations
00076         friend const Vector3 operator-(const Vector3& a);
00077
00078         friend const Vector3 operator+(const Vector3& a, const Vector3& b);
00079         friend const Vector3 operator-(const Vector3& a, const Vector3& b);
00080         friend const Vector3 operator*(const Vector3& a, const Vector3& b);
00081         friend const Vector3 operator/(const Vector3& a, const Vector3& b);
00082         friend const Vector3 operator*(const Vector3& a, const Scalar& s);
00083         friend const Vector3 operator*(const Scalar& s,  const Vector3& a);
00084         friend const Vector3 operator/(const Vector3& a, const Scalar& s);
00085
00086         friend const Vector3 Abs(const Vector3& a);
00087         friend const Vector3 Rcp(const Vector3& a);
00088         friend const Vector3 Rsqrt(const Vector3& a);
00089         friend const Vector3 Sqrt(const Vector3& a);
00090         friend const Vector3 RcpNr(const Vector3& a);
00091         friend const Vector3 RsqrtNr(const Vector3& a);
00092
00093         friend const Scalar Sum(const Vector3& a);
00094         friend const Scalar Dot(const Vector3& a, const Vector3& b);
00095
00096         friend const Vector3 Cross(const Vector3& a, const Vector3& b);
00097
00098         friend const Vector3 Min(const Vector3& a, const Vector3& b);
00099         friend const Vector3 Max(const Vector3& a, const Vector3& b);
00100         friend const Vector3 Clamp(const Vector3& v, const Vector3& min, const Vector3& max);
00101
00102         friend const Scalar MinComp(const Vector3& a);
00103         friend const Scalar MaxComp(const Vector3& a);
00104         friend const int MinCompIndex(const Vector3& a);
00105         friend const int MaxCompIndex(const Vector3& a);
00106
00107         friend const Scalar Length(const Vector3& a);
00108         friend const Scalar LengthSqr(const Vector3& a);
00109         friend const Scalar LengthRcp(const Vector3& a);
00110         friend const Vector3 Normalize(const Vector3& a);
00111
00112         friend const Scalar LengthFast(const Vector3& a);
00113         friend const Scalar LengthRcpFast(const Vector3& a);
00114         friend const Vector3 NormalizeFast(const Vector3& a);
00115
00116         friend const Vector3 Lerp(const Vector3& a, const Vector3& b, const Scalar& t);
00117
00118         // returns an arbitrary perpendicular vector (not normalized)
00119         friend const Vector3 Perp(const Vector3& v);
00120
00121         // comparisons (return 1 bit per component)
00122         friend int operator==(const Vector3& a, const Vector3& b);
00123         friend int operator!=(const Vector3& a, const Vector3& b);
00124         friend int operator<(const Vector3& a, const Vector3& b);
00125         friend int operator<=(const Vector3& a, const Vector3& b);
00126         friend int operator>(const Vector3& a, const Vector3& b);
00127         friend int operator>=(const Vector3& a, const Vector3& b);
00128
00129         // validation
00130         bool IsFinite() const;
00131 };
00132
00133
00135 // Point3
00136 __declspec(align(16)) class Point3 : public Vector4Base
00137 {
00138 public:
00139         // constructors
00140         Point3();
00141         Point3(const Point3& v);
00142         Point3(float x, float y, float z);
00143         Point3(const Scalar& x, const Scalar& y, const Scalar& z);
00144
00145         // construction to constant
00146         Point3(const Maths::ZeroTag&);
00147         Point3(const Maths::UnitXTag&);
00148         Point3(const Maths::UnitYTag&);
00149         Point3(const Maths::UnitZTag&);
00150         Point3(const Maths::UnitNegXTag&);
00151         Point3(const Maths::UnitNegYTag&);
00152         Point3(const Maths::UnitNegZTag&);
00153
00154         // explicit constructors
00155         explicit Point3(const __m128 b);
00156         explicit Point3(const Vector4Base& v);
00157         explicit Point3(const Scalar& v);
00158         explicit Point3(const Vector3& v);
00159         explicit Point3(const Vector4& v);
00160         explicit Point3(const float* p);
00161
00162         // assignment
00163         const Point3& operator=(const Point3& v);
00164
00165         // assignment to constant
00166         const Point3& operator=(const Maths::ZeroTag&);
00167         const Point3& operator=(const Maths::UnitXTag&);
00168         const Point3& operator=(const Maths::UnitYTag&);
00169         const Point3& operator=(const Maths::UnitZTag&);
00170         const Point3& operator=(const Maths::UnitNegXTag&);
00171         const Point3& operator=(const Maths::UnitNegYTag&);
00172         const Point3& operator=(const Maths::UnitNegZTag&);
00173
00174         // in place operations
00175         void operator+=(const Vector3& b);
00176         void operator-=(const Vector3& b);
00177
00178         // operations
00179         friend const Point3 operator-(const Point3& a);
00180
00181         friend const Point3 operator+(const Point3& a, const Vector3& b);
00182         friend const Point3 operator+(const Vector3& a, const Point3& b);
00183
00184         friend const Point3 operator-(const Point3& a, const Vector3& b);
00185         friend const Vector3 operator-(const Point3& a, const Point3& b);
00186
00187         friend const Vector3 operator*(const Point3& a, const Vector3& b);
00188         friend const Vector3 operator*(const Vector3& a, const Point3& b);
00189
00190         friend const Point3 Abs(const Point3& a);
00191
00192         friend const Scalar Sum(const Point3& a);
00193         friend const Scalar Dot(const Point3& a, const Point3& b);
00194         friend const Scalar Dot(const Vector3& a, const Point3& b);
00195         friend const Scalar Dot(const Point3& a, const Vector3& b);
00196
00197         friend const Point3 Min(const Point3& a, const Point3& b);
00198         friend const Point3 Max(const Point3& a, const Point3& b);
00199         friend const Point3 Clamp(const Point3& v, const Point3& min, const Point3& max);
00200
00201         friend const Scalar Dist(const Point3& a, const Point3& b);
00202         friend const Scalar DistSqr(const Point3& a, const Point3& b);
00203         friend const Scalar DistRcp(const Point3& a, const Point3& b);
00204
00205         friend const Scalar DistFast(const Point3& a, const Point3& b);
00206         friend const Scalar DistRcpFast(const Point3& a, const Point3& b);
00207
00208         friend const Point3 Lerp(const Point3& a, const Point3& b, const Scalar& t);
00209
00210         friend const Point3 Homogenize(const Vector4& v);
00211         friend const Point3 HomogenizeFast(const Vector4& v);
00212
00213         // comparisons (return 1 bit per component)
00214         friend int operator==(const Point3& a, const Point3& b);
00215         friend int operator!=(const Point3& a, const Point3& b);
00216         friend int operator<(const Point3& a, const Point3& b);
00217         friend int operator<=(const Point3& a, const Point3& b);
00218         friend int operator>(const Point3& a, const Point3& b);
00219         friend int operator>=(const Point3& a, const Point3& b);
00220
00221         // validation
00222         bool IsFinite() const;
00223 };
00224
00225
00227 // Vector4
00228 __declspec(align(16)) class Vector4 : public Vector4Base
00229 {
00230 public:
00231         // constructors
00232         Vector4();
00233         Vector4(const Vector4& v);
00234         Vector4(float x, float y, float z, float w);
00235         Vector4(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w);
00236         Vector4(const Vector3& xyz, const Scalar& w);
00237
00238         // construction to constant
00239         Vector4(const Maths::ZeroTag&);
00240         Vector4(const Maths::UnitXTag&);
00241         Vector4(const Maths::UnitYTag&);
00242         Vector4(const Maths::UnitZTag&);
00243         Vector4(const Maths::UnitWTag&);
00244         Vector4(const Maths::UnitNegXTag&);
00245         Vector4(const Maths::UnitNegYTag&);
00246         Vector4(const Maths::UnitNegZTag&);
00247         Vector4(const Maths::UnitNegWTag&);
00248
00249         // explicit constructors
00250         explicit Vector4(const __m128 b);
00251         explicit Vector4(const Vector4Base& v);
00252         explicit Vector4(const Scalar& v);
00253         explicit Vector4(const Vector3& v);
00254         explicit Vector4(const Point3& v);
00255         explicit Vector4(const float* p);
00256
00257         // assignment
00258         const Vector4& operator=(const Vector4& v);
00259
00260         // assignment to constant
00261         const Vector4& operator=(const Maths::ZeroTag&);
00262         const Vector4& operator=(const Maths::UnitXTag&);
00263         const Vector4& operator=(const Maths::UnitYTag&);
00264         const Vector4& operator=(const Maths::UnitZTag&);
00265         const Vector4& operator=(const Maths::UnitWTag&);
00266         const Vector4& operator=(const Maths::UnitNegXTag&);
00267         const Vector4& operator=(const Maths::UnitNegYTag&);
00268         const Vector4& operator=(const Maths::UnitNegZTag&);
00269         const Vector4& operator=(const Maths::UnitNegWTag&);
00270
00271         // in place operations
00272         void operator+=(const Vector4& b);
00273         void operator-=(const Vector4& b);
00274         void operator*=(const Vector4& b);
00275         void operator/=(const Vector4& b);
00276         void operator*=(const Scalar& s);
00277         void operator/=(const Scalar& s);
00278
00279         // operations
00280         friend const Vector4 operator-(const Vector4& a);
00281
00282         friend const Vector4 operator+(const Vector4& a, const Vector4& b);
00283         friend const Vector4 operator-(const Vector4& a, const Vector4& b);
00284         friend const Vector4 operator*(const Vector4& a, const Vector4& b);
00285         friend const Vector4 operator/(const Vector4& a, const Vector4& b);
00286         friend const Vector4 operator*(const Vector4& a, const Scalar& s);
00287         friend const Vector4 operator*(const Scalar& s,  const Vector4& a);
00288         friend const Vector4 operator/(const Vector4& a, const Scalar& s);
00289
00290         friend const Vector4 Abs(const Vector4& a);
00291         friend const Vector4 Rcp(const Vector4& a);
00292         friend const Vector4 Rsqrt(const Vector4& a);
00293         friend const Vector4 Sqrt(const Vector4& a);
00294         friend const Vector4 RcpNr(const Vector4& a);
00295         friend const Vector4 RsqrtNr(const Vector4& a);
00296
00297         friend const Scalar Sum(const Vector4& a);
00298         friend const Scalar Dot(const Vector4& a, const Vector4& b);
00299
00300         friend const Vector4 Min(const Vector4& a, const Vector4& b);
00301         friend const Vector4 Max(const Vector4& a, const Vector4& b);
00302         friend const Vector4 Clamp(const Vector4& v, const Vector4& min, const Vector4& max);
00303
00304         friend const Scalar MinComp(const Vector4& a);
00305         friend const Scalar MaxComp(const Vector4& a);
00306
00307         friend const Scalar Length(const Vector4& a);
00308         friend const Scalar LengthSqr(const Vector4& a);
00309         friend const Scalar LengthRcp(const Vector4& a);
00310         friend const Vector4 Normalize(const Vector4& a);
00311
00312         friend const Scalar LengthFast(const Vector4& a);
00313         friend const Scalar LengthRcpFast(const Vector4& a);
00314         friend const Vector4 NormalizeFast(const Vector4& a);
00315
00316         friend const Vector4 Lerp(const Vector4& a, const Vector4& b, const Scalar& t);
00317
00318         // comparisons (return 1 bit per component)
00319         friend int operator==(const Vector4& a, const Vector4& b);
00320         friend int operator!=(const Vector4& a, const Vector4& b);
00321         friend int operator<(const Vector4& a, const Vector4& b);
00322         friend int operator<=(const Vector4& a, const Vector4& b);
00323         friend int operator>(const Vector4& a, const Vector4& b);
00324         friend int operator>=(const Vector4& a, const Vector4& b);
00325
00326         // validation
00327         bool IsFinite() const;
00328 };
00329
00330
00332 // Vector2
00333 class Vector2 : public Vector2Base
00334 {
00335 public:
00336 };
00337
00338
00340 // Point2
00341 class Point2 : public Vector2Base
00342 {
00343 public:
00344
00345 };
00346
00347
00348 #include "Vector.inl"
00349 #endif //BULLET_VECTOR_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VectorBase.cpp File Reference

LinearMath

VectorBase.cpp File Reference

Go to the source code of this file.

Generated on Wed May 24 13:59:53 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VectorBase.cpp Source File

LinearMath

VectorBase.cpp

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 // VectorBase.cpp
00005 //
00006 // Copyright (c) 2006 Simon Hobbs
00007 //
00008 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00009 //
00010 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00011 //
00012 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 //
00014 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00015 //
00016 // 3. This notice may not be removed or altered from any source distribution.
00017 #ifdef WIN32
00018 #if _MSC_VER >= 1310
00019
00020 #include "VectorBase.h"
00021
00022 const __m128 Vector4Base::Consts::kZero         = _mm_set1_ps(0.0f);
00023 const __m128 Vector4Base::Consts::kHalf         = _mm_set1_ps(0.5f);
00024 const __m128 Vector4Base::Consts::kThree        = _mm_set1_ps(3.0f);
00025
00026 const __m128 Vector4Base::Consts::k1000         = _mm_setr_ps(1.0f, 0.0f, 0.0f, 0.0f);
00027 const __m128 Vector4Base::Consts::k0100         = _mm_setr_ps(0.0f, 1.0f, 0.0f, 0.0f);
00028 const __m128 Vector4Base::Consts::k0010         = _mm_setr_ps(0.0f, 0.0f, 1.0f, 0.0f);
00029 const __m128 Vector4Base::Consts::k0001         = _mm_setr_ps(0.0f, 0.0f, 0.0f, 1.0f);
00030
00031 const __m128 Vector4Base::Consts::kNeg1000      = _mm_setr_ps(-1.0f, 0.0f, 0.0f, 0.0f);
00032 const __m128 Vector4Base::Consts::kNeg0100      = _mm_setr_ps(0.0f, -1.0f, 0.0f, 0.0f);
00033 const __m128 Vector4Base::Consts::kNeg0010      = _mm_setr_ps(0.0f, 0.0f, -1.0f, 0.0f);
00034 const __m128 Vector4Base::Consts::kNeg0001      = _mm_setr_ps(0.0f, 0.0f, 0.0f, -1.0f);
00035
00036 const __m128 Vector4Base::Consts::kNeg111_1     = _mm_setr_ps(-1.0f, -1.0f, -1.0f, 1.0f);
00037 const __m128 Vector4Base::Consts::k1110         = _mm_setr_ps(1.0f, 1.0f, 1.0f, 0.0f);
00038
00039 const unsigned int Vector4Base::Consts::maskAbs = 0x7fffffff;
00040 const __m128 Vector4Base::Consts::kMaskAbs = _mm_load1_ps((float*)&Vector4Base::Consts::maskAbs);
00041
00042 const unsigned int Vector4Base::Consts::mask1110[4] = {0xffffffff, 0xffffffff, 0xffffffff, 0x00000000};
00043 const unsigned int Vector4Base::Consts::mask0001[4] = {0x00000000, 0x00000000, 0x00000000, 0xffffffff};
00044
00045 const __m128 Vector4Base::Consts::kMask1110 = _mm_loadu_ps((float*)Vector4Base::Consts::mask1110);
00046 const __m128 Vector4Base::Consts::kMask0001 = _mm_loadu_ps((float*)Vector4Base::Consts::mask0001);
00047
00048 #endif
00049 #endif //WIN32
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VectorBase.h File Reference

LinearMath

VectorBase.h File Reference

#include "Scalar.h"
#include "Memory2.h"
#include "VectorBase.inl"

Include dependency graph for VectorBase.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace | Maths

Enumerations

enum | Maths::ZeroTag
enum | Maths::UnitXTag
enum | Maths::UnitYTag
enum | Maths::UnitZTag
enum | Maths::UnitWTag
enum | Maths::UnitNegXTag
enum | Maths::UnitNegYTag
enum | Maths::UnitNegZTag
enum | Maths::UnitNegWTag
enum | Maths::IdentityTag
enum | Maths::RotateXTag
enum | Maths::RotateYTag
enum | Maths::RotateZTag
enum | Maths::ScaleTag
enum | Maths::SkewTag

Functions

__declspec (align(16)) class Vector4Base
class | __declspec (align(8)) Vector2Base

Variables

static const enum Maths::ZeroTag | Maths::Zero
static const enum Maths::UnitXTag | Maths::UnitX
static const enum Maths::UnitYTag | Maths::UnitY
static const enum Maths::UnitZTag | Maths::UnitZ
static const enum Maths::UnitWTag | Maths::UnitW
static const enum Maths::UnitNegXTag | Maths::UnitNegX
static const enum Maths::UnitNegYTag | Maths::UnitNegY
static const enum Maths::UnitNegZTag | Maths::UnitNegZ
static const enum Maths::UnitNegWTag | Maths::UnitNegW
static const enum Maths::IdentityTag | Maths::Identity
static const enum Maths::RotateXTag | Maths::RotateX
static const enum Maths::RotateYTag | Maths::RotateY
static const enum Maths::RotateZTag | Maths::RotateZ
static const enum Maths::ScaleTag | Maths::Scale
static const enum Maths::SkewTag | Maths::Skew

Function Documentation

class __declspec ( align(8) )

Definition at line 133 of file VectorBase.h.

__declspec ( align(16) )

Definition at line 47 of file VectorBase.h.

Generated on Wed May 24 13:59:53 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VectorBase.h Source File

LinearMath

VectorBase.h

Go to the documentation of this file.
00001 // Bullet Continuous Collision Detection and Physics Library
00002 // Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00003 //
00004 //
00005 // VectorBase.h
00006 //
00007 // Copyright (c) 2006 Simon Hobbs
00008 //
00009 // This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
00010 //
00011 // Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
00012 //
00013 // 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00014 //
00015 // 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00016 //
00017 // 3. This notice may not be removed or altered from any source distribution.
00018 #ifndef BULLET_VECTOR_BASE_H
00019 #define BULLET_VECTOR_BASE_H
00020
00021 #include "Scalar.h"
00022 #include "Memory2.h"
00023
00024 // vector constants
00025 namespace Maths
00026 {
00027         static const enum ZeroTag { } Zero;
00028         static const enum UnitXTag { } UnitX;
00029         static const enum UnitYTag { } UnitY;
00030         static const enum UnitZTag { } UnitZ;
00031         static const enum UnitWTag { } UnitW;
00032         static const enum UnitNegXTag { } UnitNegX;
00033         static const enum UnitNegYTag { } UnitNegY;
00034         static const enum UnitNegZTag { } UnitNegZ;
00035         static const enum UnitNegWTag { } UnitNegW;
00036
00037         static const enum IdentityTag { } Identity;
00038         static const enum RotateXTag { } RotateX;
00039         static const enum RotateYTag { } RotateY;
00040         static const enum RotateZTag { } RotateZ;
00041         static const enum ScaleTag { } Scale;
00042         static const enum SkewTag { } Skew;
00043 };
00044
00046 // Vector4Base
00047 __declspec(align(16)) class Vector4Base
00048 {
00049 public:
00050         BULLET_ALIGNED_NEW_AND_DELETE
00051
00052         __m128 base;
00053
00054 //protected:
00055         // useful constants for internal use
00056         struct Consts
00057         {
00058                 static const unsigned int maskAbs;
00059                 static const unsigned int mask1110[4];
00060                 static const unsigned int mask0001[4];
00061
00062                 static const __m128
00063                         kZero,
00064                         kHalf,
00065                         kThree,
00066
00067                         k1000,
00068                         k0100,
00069                         k0010,
00070                         k0001,
00071
00072                         kNeg1000,
00073                         kNeg0100,
00074                         kNeg0010,
00075                         kNeg0001,
00076
00077                         kNeg111_1,
00078
00079                         k1110,
00080                         kMaskAbs,
00081                         kMask1110,
00082                         kMask0001;
00083         };
00084
00085         // can't construct a Vector4Base
00086         Vector4Base();
00087
00088         // compound operations helpers for use by derived classes
00089         void Set(const __m128& x, const __m128& y, const __m128& z, const __m128& w);
00090         void Set(const __m128& xyz, const __m128& w);
00091
00092         static __m128 Dot3(const __m128& v0, const __m128& v1);
00093         static __m128 Dot4(const __m128& v0, const __m128& v1);
00094
00095         static __m128 Sum3(const __m128& a);
00096         static __m128 Sum4(const __m128& a);
00097
00098         static __m128 MinComp3(const __m128& a);
00099         static __m128 MinComp4(const __m128& a);
00100
00101         static __m128 MaxComp3(const __m128& a);
00102         static __m128 MaxComp4(const __m128& a);
00103
00104 public:
00105         // element access
00106         const float& operator[](int i) const;
00107         float& operator[](int i);
00108
00109         // get/set elements
00110         const Scalar GetX() const;
00111         const Scalar GetY() const;
00112         const Scalar GetZ() const;
00113         const Scalar GetW() const;
00114         const Scalar Get(int i) const;
00115
00116         void SetX(const Scalar& s);
00117         void SetY(const Scalar& s);
00118         void SetZ(const Scalar& s);
00119         void SetW(const Scalar& s);
00120         void Set(int i, const Scalar& s);
00121
00122         // unaligned load/store
00123         void LoadUnaligned3(const float* p);
00124         void LoadUnaligned4(const float* p);
00125
00126         void StoreUnaligned3(float* p) const;
00127         void StoreUnaligned4(float* p) const;
00128 };
00129
00130
00132 // Vector2Base
00133 class __declspec(align(8)) Vector2Base
00134 {
00135 public:
00136         float x, y;
00137 };
00138
00139
00140 #include "VectorBase.inl"
00141
00142 #endif //BULLET_VECTOR_BASE_H
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VoronoiSimplexSolver.cpp File Reference

Bullet » NarrowPhaseCollision

VoronoiSimplexSolver.cpp File Reference

#include "VoronoiSimplexSolver.h"
#include <assert.h>
#include <stdio.h>

Include dependency graph for VoronoiSimplexSolver.cpp:

Go to the source code of this file.

Defines

#define | VERTA 0
#define | VERTB 1
#define | VERTC 2
#define | VERTD 3
#define | CATCH_DEGENERATE_TETRAHEDRON 1

Define Documentation

#define CATCH_DEGENERATE_TETRAHEDRON 1

Definition at line 36 of file VoronoiSimplexSolver.cpp.

#define VERTA 0

Definition at line 31 of file VoronoiSimplexSolver.cpp.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron().

#define VERTB 1

Definition at line 32 of file VoronoiSimplexSolver.cpp.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron().

#define VERTC 2

Definition at line 33 of file VoronoiSimplexSolver.cpp.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron().

#define VERTD 3

Definition at line 34 of file VoronoiSimplexSolver.cpp.

Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VoronoiSimplexSolver.cpp Source File

Bullet » NarrowPhaseCollision

VoronoiSimplexSolver.cpp

Go to the documentation of this file.
00001
00002 /*
00003 Bullet Continuous Collision Detection and Physics Library
00004 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00005
00006 This software is provided 'as-is', without any express or implied warranty.
00007 In no event will the authors be held liable for any damages arising from the use of this software.
00008 Permission is granted to anyone to use this software for any purpose,
00009 including commercial applications, and to alter it and redistribute it freely,
00010 subject to the following restrictions:
00011
00012 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00013 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00014 3. This notice may not be removed or altered from any source distribution.
00015
00016         Elsevier CDROM license agreements grants nonexclusive license to use the software
00017         for any purpose, commercial or non-commercial as long as the following credit is included
00018         identifying the original source of the software:
00019
00020         Parts of the source are "from the book Real-Time Collision Detection by
00021         Christer Ericson, published by Morgan Kaufmann Publishers,
00022         (c) 2005 Elsevier Inc."
00023
00024 */
00025
00026
00027 #include "VoronoiSimplexSolver.h"
00028 #include <assert.h>
00029 #include <stdio.h>
00030
00031 #define VERTA  0
00032 #define VERTB  1
00033 #define VERTC  2
00034 #define VERTD  3
00035
00036 #define CATCH_DEGENERATE_TETRAHEDRON 1
00037 void    VoronoiSimplexSolver::removeVertex(int index)
00038 {
00039
00040         assert(m_numVertices>0);
00041         m_numVertices--;
00042         m_simplexVectorW[index] = m_simplexVectorW[m_numVertices];
00043         m_simplexPointsP[index] = m_simplexPointsP[m_numVertices];
00044         m_simplexPointsQ[index] = m_simplexPointsQ[m_numVertices];
00045 }
00046
00047 void    VoronoiSimplexSolver::ReduceVertices (const UsageBitfield& usedVerts)
00048 {
00049         if ((numVertices() >= 4) && (!usedVerts.usedVertexD))
00050                 removeVertex(3);
00051
00052         if ((numVertices() >= 3) && (!usedVerts.usedVertexC))
00053                 removeVertex(2);
00054
00055         if ((numVertices() >= 2) && (!usedVerts.usedVertexB))
00056                 removeVertex(1);
00057
00058         if ((numVertices() >= 1) && (!usedVerts.usedVertexA))
00059                 removeVertex(0);
00060
00061 }
00062
00063
00064
00065
00066
00067 //clear the simplex, remove all the vertices
00068 void VoronoiSimplexSolver::reset()
00069 {
00070         m_cachedValidClosest = false;
00071         m_numVertices = 0;
00072         m_needsUpdate = true;
00073         m_lastW = SimdVector3(1e30f,1e30f,1e30f);
00074         m_cachedBC.Reset();
00075 }
00076
00077
00078
00079         //add a vertex
00080 void VoronoiSimplexSolver::addVertex(const SimdVector3& w, const SimdPoint3& p, const SimdPoint3& q)
00081 {
00082         m_lastW = w;
00083         m_needsUpdate = true;
00084
00085         m_simplexVectorW[m_numVertices] = w;
00086         m_simplexPointsP[m_numVertices] = p;
00087         m_simplexPointsQ[m_numVertices] = q;
00088
00089         m_numVertices++;
00090 }
00091
00092 bool    VoronoiSimplexSolver::UpdateClosestVectorAndPoints()
00093 {
00094
00095         if (m_needsUpdate)
00096         {
00097                 m_cachedBC.Reset();
00098
00099                 m_needsUpdate = false;
00100
00101                 switch (numVertices())
00102                 {
00103                 case 0:
00104                                 m_cachedValidClosest = false;
00105                                 break;
00106                 case 1:
00107                         {
00108                                 m_cachedP1 = m_simplexPointsP[0];
00109                                 m_cachedP2 = m_simplexPointsQ[0];
00110                                 m_cachedV = m_cachedP1-m_cachedP2; //== m_simplexVectorW[0]
00111                                 m_cachedBC.Reset();
00112                                 m_cachedBC.SetBarycentricCoordinates(1.f,0.f,0.f,0.f);
00113                                 m_cachedValidClosest = m_cachedBC.IsValid();
00114                                 break;
00115                         };
00116                 case 2:
00117                         {
00118                         //closest point origin from line segment
00119                                         const SimdVector3& from = m_simplexVectorW[0];
00120                                         const SimdVector3& to = m_simplexVectorW[1];
00121                                         SimdVector3 nearest;
00122
00123                                         SimdVector3 p (0.f,0.f,0.f);
00124                                         SimdVector3 diff = p - from;
00125                                         SimdVector3 v = to - from;
00126                                         float t = v.dot(diff);
00127
00128                                         if (t > 0) {
00129                                                 float dotVV = v.dot(v);
00130                                                 if (t < dotVV) {
00131                                                         t /= dotVV;
00132                                                         diff -= t*v;
00133                                                         m_cachedBC.m_usedVertices.usedVertexA = true;
00134                                                         m_cachedBC.m_usedVertices.usedVertexB = true;
00135                                                 } else {
00136                                                         t = 1;
00137                                                         diff -= v;
00138                                                         //reduce to 1 point
00139                                                         m_cachedBC.m_usedVertices.usedVertexB = true;
00140                                                 }
00141                                         } else
00142                                         {
00143                                                 t = 0;
00144                                                 //reduce to 1 point
00145                                                 m_cachedBC.m_usedVertices.usedVertexA = true;
00146                                         }
00147                                         m_cachedBC.SetBarycentricCoordinates(1-t,t);
00148                                         nearest = from + t*v;
00149
00150                                         m_cachedP1 = m_simplexPointsP[0] + t * (m_simplexPointsP[1] - m_simplexPointsP[0]);
00151                                         m_cachedP2 = m_simplexPointsQ[0] + t * (m_simplexPointsQ[1] - m_simplexPointsQ[0]);
00152                                         m_cachedV = m_cachedP1 - m_cachedP2;
00153
00154                                         ReduceVertices(m_cachedBC.m_usedVertices);
00155
00156                                         m_cachedValidClosest = m_cachedBC.IsValid();
00157                                         break;
00158                         }
00159                 case 3:
00160                         {
00161                                 //closest point origin from triangle
00162                                 SimdVector3 p (0.f,0.f,0.f);
00163
00164                                 const SimdVector3& a = m_simplexVectorW[0];
00165                                 const SimdVector3& b = m_simplexVectorW[1];
00166                                 const SimdVector3& c = m_simplexVectorW[2];
00167
00168                                 ClosestPtPointTriangle(p,a,b,c,m_cachedBC);
00169                                 m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] +
00170                                                                 m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] +
00171                                                                 m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2] +
00172                                                                 m_simplexPointsP[3] * m_cachedBC.m_barycentricCoords[3];
00173
00174                                 m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] +
00175                                         m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] +
00176                                         m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2] +
00177                                         m_simplexPointsQ[3] * m_cachedBC.m_barycentricCoords[3];
00178
00179                                 m_cachedV = m_cachedP1-m_cachedP2;
00180
00181                                 ReduceVertices (m_cachedBC.m_usedVertices);
00182                                 m_cachedValidClosest =  m_cachedBC.IsValid();
00183
00184                                 break;
00185                         }
00186                 case 4:
00187                         {
00188
00189
00190                                 SimdVector3 p (0.f,0.f,0.f);
00191
00192                                 const SimdVector3& a = m_simplexVectorW[0];
00193                                 const SimdVector3& b = m_simplexVectorW[1];
00194                                 const SimdVector3& c = m_simplexVectorW[2];
00195                                 const SimdVector3& d = m_simplexVectorW[3];
00196
00197                                 bool hasSeperation = ClosestPtPointTetrahedron(p,a,b,c,d,m_cachedBC);
00198
00199                                 if (hasSeperation)
00200                                 {
00201
00202                                         m_cachedP1 = m_simplexPointsP[0] * m_cachedBC.m_barycentricCoords[0] +
00203                                                 m_simplexPointsP[1] * m_cachedBC.m_barycentricCoords[1] +
00204                                                 m_simplexPointsP[2] * m_cachedBC.m_barycentricCoords[2] +
00205                                                 m_simplexPointsP[3] * m_cachedBC.m_barycentricCoords[3];
00206
00207                                         m_cachedP2 = m_simplexPointsQ[0] * m_cachedBC.m_barycentricCoords[0] +
00208                                                 m_simplexPointsQ[1] * m_cachedBC.m_barycentricCoords[1] +
00209                                                 m_simplexPointsQ[2] * m_cachedBC.m_barycentricCoords[2] +
00210                                                 m_simplexPointsQ[3] * m_cachedBC.m_barycentricCoords[3];
00211
00212                                         m_cachedV = m_cachedP1-m_cachedP2;
00213                                         ReduceVertices (m_cachedBC.m_usedVertices);
00214                                 } else
00215                                 {
00216 //                                      printf("sub distance got penetration\n");
00217
00218                                         if (m_cachedBC.m_degenerate)
00219                                         {
00220                                                 m_cachedValidClosest = false;
00221                                         } else
00222                                         {
00223                                                 m_cachedValidClosest = true;
00224                                                 //degenerate case == false, penetration = true + zero
00225                                                 m_cachedV.setValue(0.f,0.f,0.f);
00226                                         }
00227                                         break;
00228                                 }
00229
00230                                 m_cachedValidClosest = m_cachedBC.IsValid();
00231
00232                                 //closest point origin from tetrahedron
00233                                 break;
00234                         }
00235                 default:
00236                         {
00237                                 m_cachedValidClosest = false;
00238                         }
00239                 };
00240         }
00241
00242         return m_cachedValidClosest;
00243
00244 }
00245
00246 //return/calculate the closest vertex
00247 bool VoronoiSimplexSolver::closest(SimdVector3& v)
00248 {
00249         bool succes = UpdateClosestVectorAndPoints();
00250         v = m_cachedV;
00251         return succes;
00252 }
00253
00254
00255
00256 SimdScalar VoronoiSimplexSolver::maxVertex()
00257 {
00258         int i, numverts = numVertices();
00259         SimdScalar maxV = 0.f;
00260         for (i=0;i<numverts;i++)
00261         {
00262                 SimdScalar curLen2 = m_simplexVectorW[i].length2();
00263                 if (maxV < curLen2)
00264                         maxV = curLen2;
00265         }
00266         return maxV;
00267 }
00268
00269
00270
00271         //return the current simplex
00272 int VoronoiSimplexSolver::getSimplex(SimdPoint3 *pBuf, SimdPoint3 *qBuf, SimdVector3 *yBuf) const
00273 {
00274         int i;
00275         for (i=0;i<numVertices();i++)
00276         {
00277                 yBuf[i] = m_simplexVectorW[i];
00278                 pBuf[i] = m_simplexPointsP[i];
00279                 qBuf[i] = m_simplexPointsQ[i];
00280         }
00281         return numVertices();
00282 }
00283
00284
00285
00286
00287 bool VoronoiSimplexSolver::inSimplex(const SimdVector3& w)
00288 {
00289         bool found = false;
00290         int i, numverts = numVertices();
00291         //SimdScalar maxV = 0.f;
00292
00293         //w is in the current (reduced) simplex
00294         for (i=0;i<numverts;i++)
00295         {
00296                 if (m_simplexVectorW[i] == w)
00297                         found = true;
00298         }
00299
00300         //check in case lastW is already removed
00301         if (w == m_lastW)
00302                 return true;
00303
00304         return found;
00305 }
00306
00307 void VoronoiSimplexSolver::backup_closest(SimdVector3& v)
00308 {
00309         v = m_cachedV;
00310 }
00311
00312
00313 bool VoronoiSimplexSolver::emptySimplex() const
00314 {
00315         return (numVertices() == 0);
00316
00317 }
00318
00319 void VoronoiSimplexSolver::compute_points(SimdPoint3& p1, SimdPoint3& p2)
00320 {
00321         UpdateClosestVectorAndPoints();
00322         p1 = m_cachedP1;
00323         p2 = m_cachedP2;
00324
00325 }
00326
00327
00328
00329
00330 bool    VoronoiSimplexSolver::ClosestPtPointTriangle(const SimdPoint3& p, const SimdPoint3& a, const SimdPoint3& b, const SimdPoint3& c,SubSimplexClosestResult& result)
00331 {
00332         result.m_usedVertices.reset();
00333
00334     // Check if P in vertex region outside A
00335     SimdVector3 ab = b - a;
00336     SimdVector3 ac = c - a;
00337     SimdVector3 ap = p - a;
00338     float d1 = ab.dot(ap);
00339     float d2 = ac.dot(ap);
00340     if (d1 <= 0.0f && d2 <= 0.0f)
00341         {
00342                 result.m_closestPointOnSimplex = a;
00343                 result.m_usedVertices.usedVertexA = true;
00344                 result.SetBarycentricCoordinates(1,0,0);
00345                 return true;// a; // barycentric coordinates (1,0,0)
00346         }
00347
00348     // Check if P in vertex region outside B
00349     SimdVector3 bp = p - b;
00350     float d3 = ab.dot(bp);
00351     float d4 = ac.dot(bp);
00352     if (d3 >= 0.0f && d4 <= d3)
00353         {
00354                 result.m_closestPointOnSimplex = b;
00355                 result.m_usedVertices.usedVertexB = true;
00356                 result.SetBarycentricCoordinates(0,1,0);
00357
00358                 return true; // b; // barycentric coordinates (0,1,0)
00359         }
00360     // Check if P in edge region of AB, if so return projection of P onto AB
00361     float vc = d1*d4 - d3*d2;
00362     if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) {
00363         float v = d1 / (d1 - d3);
00364                 result.m_closestPointOnSimplex = a + v * ab;
00365                 result.m_usedVertices.usedVertexA = true;
00366                 result.m_usedVertices.usedVertexB = true;
00367                 result.SetBarycentricCoordinates(1-v,v,0);
00368                 return true;
00369         //return a + v * ab; // barycentric coordinates (1-v,v,0)
00370     }
00371
00372     // Check if P in vertex region outside C
00373     SimdVector3 cp = p - c;
00374     float d5 = ab.dot(cp);
00375     float d6 = ac.dot(cp);
00376     if (d6 >= 0.0f && d5 <= d6)
00377         {
00378                 result.m_closestPointOnSimplex = c;
00379                 result.m_usedVertices.usedVertexC = true;
00380                 result.SetBarycentricCoordinates(0,0,1);
00381                 return true;//c; // barycentric coordinates (0,0,1)
00382         }
00383
00384     // Check if P in edge region of AC, if so return projection of P onto AC
00385     float vb = d5*d2 - d1*d6;
00386     if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) {
00387         float w = d2 / (d2 - d6);
00388                 result.m_closestPointOnSimplex = a + w * ac;
00389                 result.m_usedVertices.usedVertexA = true;
00390                 result.m_usedVertices.usedVertexC = true;
00391                 result.SetBarycentricCoordinates(1-w,0,w);
00392                 return true;
00393         //return a + w * ac; // barycentric coordinates (1-w,0,w)
00394     }
00395
00396     // Check if P in edge region of BC, if so return projection of P onto BC
00397     float va = d3*d6 - d5*d4;
00398     if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) {
00399         float w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
00400
00401                 result.m_closestPointOnSimplex = b + w * (c - b);
00402                 result.m_usedVertices.usedVertexB = true;
00403                 result.m_usedVertices.usedVertexC = true;
00404                 result.SetBarycentricCoordinates(0,1-w,w);
00405                 return true;
00406        // return b + w * (c - b); // barycentric coordinates (0,1-w,w)
00407     }
00408
00409     // P inside face region. Compute Q through its barycentric coordinates (u,v,w)
00410     float denom = 1.0f / (va + vb + vc);
00411     float v = vb * denom;
00412     float w = vc * denom;
00413
00414         result.m_closestPointOnSimplex = a + ab * v + ac * w;
00415         result.m_usedVertices.usedVertexA = true;
00416         result.m_usedVertices.usedVertexB = true;
00417         result.m_usedVertices.usedVertexC = true;
00418         result.SetBarycentricCoordinates(1-v-w,v,w);
00419
00420         return true;
00421 //      return a + ab * v + ac * w; // = u*a + v*b + w*c, u = va * denom = 1.0f - v - w
00422
00423 }
00424
00425
00426
00427
00428
00430 int VoronoiSimplexSolver::PointOutsideOfPlane(const SimdPoint3& p, const SimdPoint3& a, const SimdPoint3& b, const SimdPoint3& c, const SimdPoint3& d)
00431 {
00432         SimdVector3 normal = (b-a).cross(c-a);
00433
00434     float signp = (p - a).dot(normal); // [AP AB AC]
00435     float signd = (d - a).dot( normal); // [AD AB AC]
00436
00437 #ifdef CATCH_DEGENERATE_TETRAHEDRON
00438         if (signd * signd < (1e-4f * 1e-4f))
00439         {
00440 //              printf("affine dependent/degenerate\n");//
00441                 return -1;
00442         }
00443 #endif
00444         // Points on opposite sides if expression signs are opposite
00445     return signp * signd < 0.f;
00446 }
00447
00448
00449 bool    VoronoiSimplexSolver::ClosestPtPointTetrahedron(const SimdPoint3& p, const SimdPoint3& a, const SimdPoint3& b, const SimdPoint3& c, const SimdPoint3& d, SubSimplexClosestResult& finalResult)
00450 {
00451         SubSimplexClosestResult tempResult;
00452
00453     // Start out assuming point inside all halfspaces, so closest to itself
00454         finalResult.m_closestPointOnSimplex = p;
00455         finalResult.m_usedVertices.reset();
00456     finalResult.m_usedVertices.usedVertexA = true;
00457         finalResult.m_usedVertices.usedVertexB = true;
00458         finalResult.m_usedVertices.usedVertexC = true;
00459         finalResult.m_usedVertices.usedVertexD = true;
00460
00461     int pointOutsideABC = PointOutsideOfPlane(p, a, b, c, d);
00462         int pointOutsideACD = PointOutsideOfPlane(p, a, c, d, b);
00463         int     pointOutsideADB = PointOutsideOfPlane(p, a, d, b, c);
00464         int     pointOutsideBDC = PointOutsideOfPlane(p, b, d, c, a);
00465
00466    if (pointOutsideABC < 0 || pointOutsideACD < 0 || pointOutsideADB < 0 || pointOutsideBDC < 0)
00467    {
00468            finalResult.m_degenerate = true;
00469            return false;
00470    }
00471
00472    if (!pointOutsideABC  && !pointOutsideACD && !pointOutsideADB && !pointOutsideBDC)
00473          {
00474                  return false;
00475          }
00476
00477
00478     float bestSqDist = FLT_MAX;
00479     // If point outside face abc then compute closest point on abc
00480         if (pointOutsideABC)
00481         {
00482         ClosestPtPointTriangle(p, a, b, c,tempResult);
00483                 SimdPoint3 q = tempResult.m_closestPointOnSimplex;
00484
00485         float sqDist = (q - p).dot( q - p);
00486         // Update best closest point if (squared) distance is less than current best
00487         if (sqDist < bestSqDist) {
00488                         bestSqDist = sqDist;
00489                         finalResult.m_closestPointOnSimplex = q;
00490                         //convert result bitmask!
00491                         finalResult.m_usedVertices.reset();
00492                         finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
00493                         finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexB;
00494                         finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC;
00495                         finalResult.SetBarycentricCoordinates(
00496                                         tempResult.m_barycentricCoords[VERTA],
00497                                         tempResult.m_barycentricCoords[VERTB],
00498                                         tempResult.m_barycentricCoords[VERTC],
00499                                         0
00500                         );
00501
00502                 }
00503     }
00504
00505
00506         // Repeat test for face acd
00507         if (pointOutsideACD)
00508         {
00509         ClosestPtPointTriangle(p, a, c, d,tempResult);
00510                 SimdPoint3 q = tempResult.m_closestPointOnSimplex;
00511                 //convert result bitmask!
00512
00513         float sqDist = (q - p).dot( q - p);
00514         if (sqDist < bestSqDist)
00515                 {
00516                         bestSqDist = sqDist;
00517                         finalResult.m_closestPointOnSimplex = q;
00518                         finalResult.m_usedVertices.reset();
00519                         finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
00520                         finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexB;
00521                         finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexC;
00522                         finalResult.SetBarycentricCoordinates(
00523                                         tempResult.m_barycentricCoords[VERTA],
00524                                         0,
00525                                         tempResult.m_barycentricCoords[VERTB],
00526                                         tempResult.m_barycentricCoords[VERTC]
00527                         );
00528
00529                 }
00530     }
00531     // Repeat test for face adb
00532
00533
00534         if (pointOutsideADB)
00535         {
00536                 ClosestPtPointTriangle(p, a, d, b,tempResult);
00537                 SimdPoint3 q = tempResult.m_closestPointOnSimplex;
00538                 //convert result bitmask!
00539
00540         float sqDist = (q - p).dot( q - p);
00541         if (sqDist < bestSqDist)
00542                 {
00543                         bestSqDist = sqDist;
00544                         finalResult.m_closestPointOnSimplex = q;
00545                         finalResult.m_usedVertices.reset();
00546                         finalResult.m_usedVertices.usedVertexA = tempResult.m_usedVertices.usedVertexA;
00547                         finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB;
00548                         finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexC;
00549                         finalResult.SetBarycentricCoordinates(
00550                                         tempResult.m_barycentricCoords[VERTA],
00551                                         tempResult.m_barycentricCoords[VERTC],
00552                                         0,
00553                                         tempResult.m_barycentricCoords[VERTB]
00554                         );
00555
00556                 }
00557     }
00558     // Repeat test for face bdc
00559
00560
00561         if (pointOutsideBDC)
00562         {
00563         ClosestPtPointTriangle(p, b, d, c,tempResult);
00564                 SimdPoint3 q = tempResult.m_closestPointOnSimplex;
00565                 //convert result bitmask!
00566         float sqDist = (q - p).dot( q - p);
00567         if (sqDist < bestSqDist)
00568                 {
00569                         bestSqDist = sqDist;
00570                         finalResult.m_closestPointOnSimplex = q;
00571                         finalResult.m_usedVertices.reset();
00572                         finalResult.m_usedVertices.usedVertexB = tempResult.m_usedVertices.usedVertexA;
00573                         finalResult.m_usedVertices.usedVertexD = tempResult.m_usedVertices.usedVertexB;
00574                         finalResult.m_usedVertices.usedVertexC = tempResult.m_usedVertices.usedVertexC;
00575
00576                         finalResult.SetBarycentricCoordinates(
00577                                         0,
00578                                         tempResult.m_barycentricCoords[VERTA],
00579                                         tempResult.m_barycentricCoords[VERTC],
00580                                         tempResult.m_barycentricCoords[VERTB]
00581                         );
00582
00583                 }
00584     }
00585
00586         //help! we ended up full !
00587
00588         if (finalResult.m_usedVertices.usedVertexA &&
00589                 finalResult.m_usedVertices.usedVertexB &&
00590                 finalResult.m_usedVertices.usedVertexC &&
00591                 finalResult.m_usedVertices.usedVertexD)
00592         {
00593                 return true;
00594         }
00595
00596     return true;
00597 }
00598
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VoronoiSimplexSolver.h File Reference

Bullet » NarrowPhaseCollision

VoronoiSimplexSolver.h File Reference

#include "SimplexSolverInterface.h"

Include dependency graph for VoronoiSimplexSolver.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct | UsageBitfield
struct | SubSimplexClosestResult
class | VoronoiSimplexSolver
VoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin. More...

Defines

#define | VORONOI_SIMPLEX_MAX_VERTS 5

Define Documentation

#define VORONOI_SIMPLEX_MAX_VERTS 5

Definition at line 25 of file VoronoiSimplexSolver.h.

Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VoronoiSimplexSolver.h Source File

Bullet » NarrowPhaseCollision

VoronoiSimplexSolver.h

Go to the documentation of this file.
00001 /*
00002 Bullet Continuous Collision Detection and Physics Library
00003 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
00004
00005 This software is provided 'as-is', without any express or implied warranty.
00006 In no event will the authors be held liable for any damages arising from the use of this software.
00007 Permission is granted to anyone to use this software for any purpose,
00008 including commercial applications, and to alter it and redistribute it freely,
00009 subject to the following restrictions:
00010
00011 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
00012 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
00013 3. This notice may not be removed or altered from any source distribution.
00014 */
00015
00016
00017
00018 #ifndef VoronoiSimplexSolver_H
00019 #define VoronoiSimplexSolver_H
00020
00021 #include "SimplexSolverInterface.h"
00022
00023
00024
00025 #define VORONOI_SIMPLEX_MAX_VERTS 5
00026
00027 struct UsageBitfield{
00028         UsageBitfield()
00029         {
00030                 reset();
00031         }
00032
00033         void reset()
00034         {
00035                 usedVertexA = false;
00036                 usedVertexB = false;
00037                 usedVertexC = false;
00038                 usedVertexD = false;
00039         }
00040         unsigned short usedVertexA      : 1;
00041         unsigned short usedVertexB      : 1;
00042         unsigned short usedVertexC      : 1;
00043         unsigned short usedVertexD      : 1;
00044         unsigned short unused1          : 1;
00045         unsigned short unused2          : 1;
00046         unsigned short unused3          : 1;
00047         unsigned short unused4          : 1;
00048 };
00049
00050
00051 struct  SubSimplexClosestResult
00052 {
00053         SimdPoint3      m_closestPointOnSimplex;
00054         //MASK for m_usedVertices
00055         //stores the simplex vertex-usage, using the MASK,
00056         // if m_usedVertices & MASK then the related vertex is used
00057         UsageBitfield   m_usedVertices;
00058         float   m_barycentricCoords[4];
00059         bool m_degenerate;
00060
00061         void    Reset()
00062         {
00063                 m_degenerate = false;
00064                 SetBarycentricCoordinates();
00065                 m_usedVertices.reset();
00066         }
00067         bool    IsValid()
00068         {
00069                 bool valid = (m_barycentricCoords[0] >= 0.f) &&
00070                         (m_barycentricCoords[1] >= 0.f) &&
00071                         (m_barycentricCoords[2] >= 0.f) &&
00072                         (m_barycentricCoords[3] >= 0.f);
00073
00074
00075                 return valid;
00076         }
00077         void    SetBarycentricCoordinates(float a=0.f,float b=0.f,float c=0.f,float d=0.f)
00078         {
00079                 m_barycentricCoords[0] = a;
00080                 m_barycentricCoords[1] = b;
00081                 m_barycentricCoords[2] = c;
00082                 m_barycentricCoords[3] = d;
00083         }
00084
00085 };
00086
00089 #ifdef NO_VIRTUAL_INTERFACE
00090 class VoronoiSimplexSolver
00091 #else
00092 class VoronoiSimplexSolver : public SimplexSolverInterface
00093 #endif
00094 {
00095 public:
00096
00097         int     m_numVertices;
00098
00099         SimdVector3     m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS];
00100         SimdPoint3      m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS];
00101         SimdPoint3      m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS];
00102
00103
00104
00105         SimdPoint3      m_cachedP1;
00106         SimdPoint3      m_cachedP2;
00107         SimdVector3     m_cachedV;
00108         SimdVector3     m_lastW;
00109         bool            m_cachedValidClosest;
00110
00111         SubSimplexClosestResult m_cachedBC;
00112
00113         bool    m_needsUpdate;
00114
00115         void    removeVertex(int index);
00116         void    ReduceVertices (const UsageBitfield& usedVerts);
00117         bool    UpdateClosestVectorAndPoints();
00118
00119         bool    ClosestPtPointTetrahedron(const SimdPoint3& p, const SimdPoint3& a, const SimdPoint3& b, const SimdPoint3& c, const SimdPoint3& d, SubSimplexClosestResult& finalResult);
00120         int             PointOutsideOfPlane(const SimdPoint3& p, const SimdPoint3& a, const SimdPoint3& b, const SimdPoint3& c, const SimdPoint3& d);
00121         bool    ClosestPtPointTriangle(const SimdPoint3& p, const SimdPoint3& a, const SimdPoint3& b, const SimdPoint3& c,SubSimplexClosestResult& result);
00122
00123 public:
00124
00125          void reset();
00126
00127          void addVertex(const SimdVector3& w, const SimdPoint3& p, const SimdPoint3& q);
00128
00129
00130          bool closest(SimdVector3& v);
00131
00132          SimdScalar maxVertex();
00133
00134          bool fullSimplex() const
00135          {
00136                  return (m_numVertices == 4);
00137          }
00138
00139          int getSimplex(SimdPoint3 *pBuf, SimdPoint3 *qBuf, SimdVector3 *yBuf) const;
00140
00141          bool inSimplex(const SimdVector3& w);
00142
00143          void backup_closest(SimdVector3& v) ;
00144
00145          bool emptySimplex() const ;
00146
00147          void compute_points(SimdPoint3& p1, SimdPoint3& p2) ;
00148
00149          int numVertices() const
00150          {
00151                  return m_numVertices;
00152          }
00153
00154
00155 };
00156
00157 #endif //VoronoiSimplexSolver
Generated on Wed May 24 13:58:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

AxisSweep3 Class Reference

AxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase. More...

#include <AxisSweep3.h>

Inheritance diagram for AxisSweep3:

[legend]
Collaboration diagram for AxisSweep3:

[legend]
List of all members.

Public Member Functions

AxisSweep3 (const SimdPoint3 &worldAabbMin, const SimdPoint3 &worldAabbMax, int maxHandles=1024, int maxOverlaps=8192)
virtual | ~AxisSweep3 ()
virtual void | RefreshOverlappingPairs ()
unsigned short | AddHandle (const SimdPoint3 &aabbMin, const SimdPoint3 &aabbMax, void *pOwner)
void | RemoveHandle (unsigned short handle)
void | UpdateHandle (unsigned short handle, const SimdPoint3 &aabbMin, const SimdPoint3 &aabbMax)
Handle * | GetHandle (unsigned short index) const
virtual BroadphaseProxy * | CreateProxy (const SimdVector3 &min, const SimdVector3 &max, int shapeType, void *userPtr)
virtual void | DestroyProxy (BroadphaseProxy *proxy)
virtual void | SetAabb (BroadphaseProxy *proxy, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)

Private Member Functions

unsigned short | AllocHandle ()
void | FreeHandle (unsigned short handle)
bool | TestOverlap (int ignoreAxis, const Handle *pHandleA, const Handle *pHandleB)
void | Quantize (unsigned short *out, const SimdPoint3 &point, int isMax) const
void | SortMinDown (int axis, unsigned short edge, bool updateOverlaps=true)
void | SortMinUp (int axis, unsigned short edge, bool updateOverlaps=true)
void | SortMaxDown (int axis, unsigned short edge, bool updateOverlaps=true)
void | SortMaxUp (int axis, unsigned short edge, bool updateOverlaps=true)

Private Attributes

SimdPoint3 m_worldAabbMin
SimdPoint3 m_worldAabbMax
SimdVector3 m_quantize
int | m_numHandles
int | m_maxHandles
Handle * m_pHandles
unsigned short | m_firstFreeHandle
Edge * | m_pEdges [3]

Classes

class | Edge
class | Handle

Detailed Description

AxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase.

It uses arrays rather then lists for storage of the 3 axis. Also it operates using integer coordinates instead of floats. The TestOverlap check is optimized to check the array index, rather then the actual AABB coordinates/pos

Definition at line 30 of file AxisSweep3.h.

Constructor & Destructor Documentation

AxisSweep3::AxisSweep3 | ( | const SimdPoint3 & | worldAabbMin,
 |  | const SimdPoint3 & | worldAabbMax,
 |  | int | maxHandles = 1024,
 |  | int | maxOverlaps = 8192
 | ) |

Definition at line 49 of file AxisSweep3.cpp.

References BroadphaseProxy::m_clientObject, m_firstFreeHandle, AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_maxEdges, m_maxHandles, AxisSweep3::Handle::m_minEdges, m_numHandles, m_pEdges, m_pHandles, AxisSweep3::Edge::m_pos, m_quantize, m_worldAabbMax, m_worldAabbMin, and AxisSweep3::Handle::SetNextFree().

AxisSweep3::~AxisSweep3 ( ) [virtual]

Definition at line 103 of file AxisSweep3.cpp.

References m_pEdges, and m_pHandles.

Member Function Documentation

unsigned short AxisSweep3::AddHandle | ( | const SimdPoint3 & | aabbMin,
 |  | const SimdPoint3 & | aabbMax,
 |  | void * | pOwner
 | ) |

Definition at line 159 of file AxisSweep3.cpp.

References AllocHandle(), GetHandle(), BroadphaseProxy::m_clientObject, AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_handleId, AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_numHandles, m_pEdges, m_pHandles, AxisSweep3::Edge::m_pos, Quantize(), SortMaxDown(), and SortMinDown().

Referenced by CreateProxy().

unsigned short AxisSweep3::AllocHandle ( ) [private]

Definition at line 136 of file AxisSweep3.cpp.

References GetHandle(), AxisSweep3::Handle::GetNextFree(), m_firstFreeHandle, and m_numHandles.

Referenced by AddHandle().

BroadphaseProxy * AxisSweep3::CreateProxy | ( | const SimdVector3 & | min,
 |  | const SimdVector3 & | max,
 |  | int | shapeType,
 |  | void * | userPtr
 | ) | [virtual]

Reimplemented from SimpleBroadphase.

Definition at line 24 of file AxisSweep3.cpp.

References AddHandle(), and GetHandle().

void AxisSweep3::DestroyProxy ( BroadphaseProxy * proxy ) [virtual]

Reimplemented from SimpleBroadphase.

Definition at line 32 of file AxisSweep3.cpp.

References AxisSweep3::Handle::m_handleId, and RemoveHandle().

void AxisSweep3::FreeHandle ( unsigned short handle ) [private]

Definition at line 147 of file AxisSweep3.cpp.

References GetHandle(), m_firstFreeHandle, m_maxHandles, m_numHandles, and AxisSweep3::Handle::SetNextFree().

Referenced by RemoveHandle().

Handle* AxisSweep3::GetHandle ( unsigned short index ) const [inline]

Definition at line 105 of file AxisSweep3.h.

References m_pHandles.

Referenced by AddHandle(), AllocHandle(), CreateProxy(), FreeHandle(), RemoveHandle(), SortMaxDown(), SortMaxUp(), SortMinDown(), SortMinUp(), and UpdateHandle().

void AxisSweep3::Quantize | ( | unsigned short * | out,
 |  | const SimdPoint3 & | point,
 |  | int | isMax
 | ) | const [private]

Definition at line 111 of file AxisSweep3.cpp.

References SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), m_quantize, m_worldAabbMax, m_worldAabbMin, SimdQuadWord::setMax(), and SimdQuadWord::setMin().

Referenced by AddHandle(), and UpdateHandle().

virtual void AxisSweep3::RefreshOverlappingPairs ( ) [inline, virtual]

Reimplemented from SimpleBroadphase.

Definition at line 97 of file AxisSweep3.h.

void AxisSweep3::RemoveHandle ( unsigned short handle )

Definition at line 211 of file AxisSweep3.cpp.

References FreeHandle(), GetHandle(), AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_numHandles, m_pEdges, AxisSweep3::Edge::m_pos, SimpleBroadphase::RemoveOverlappingPairsContainingProxy(), SortMaxUp(), and SortMinUp().

Referenced by DestroyProxy().

void AxisSweep3::SetAabb | ( | BroadphaseProxy * | proxy,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | [virtual]

Reimplemented from SimpleBroadphase.

Definition at line 38 of file AxisSweep3.cpp.

References AxisSweep3::Handle::m_handleId, and UpdateHandle().

void AxisSweep3::SortMaxDown | ( | int | axis,
 |  | unsigned short | edge,
 |  | bool | updateOverlaps = true
 | ) | [private]

Definition at line 416 of file AxisSweep3.cpp.

References SimpleBroadphase::FindPair(), GetHandle(), AxisSweep3::Edge::IsMax(), AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_pEdges, AxisSweep3::Edge::m_pos, and SimpleBroadphase::RemoveOverlappingPair().

Referenced by AddHandle(), and UpdateHandle().

void AxisSweep3::SortMaxUp | ( | int | axis,
 |  | unsigned short | edge,
 |  | bool | updateOverlaps = true
 | ) | [private]

Definition at line 462 of file AxisSweep3.cpp.

References SimpleBroadphase::AddOverlappingPair(), GetHandle(), AxisSweep3::Edge::IsMax(), AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_pEdges, AxisSweep3::Edge::m_pos, and TestOverlap().

Referenced by RemoveHandle(), and UpdateHandle().

void AxisSweep3::SortMinDown | ( | int | axis,
 |  | unsigned short | edge,
 |  | bool | updateOverlaps = true
 | ) | [private]

Definition at line 330 of file AxisSweep3.cpp.

References SimpleBroadphase::AddOverlappingPair(), GetHandle(), AxisSweep3::Edge::IsMax(), AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_pEdges, AxisSweep3::Edge::m_pos, and TestOverlap().

Referenced by AddHandle(), and UpdateHandle().

void AxisSweep3::SortMinUp | ( | int | axis,
 |  | unsigned short | edge,
 |  | bool | updateOverlaps = true
 | ) | [private]

Definition at line 371 of file AxisSweep3.cpp.

References SimpleBroadphase::FindPair(), GetHandle(), AxisSweep3::Edge::IsMax(), AxisSweep3::Edge::m_handle, AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_pEdges, AxisSweep3::Edge::m_pos, and SimpleBroadphase::RemoveOverlappingPair().

Referenced by RemoveHandle(), and UpdateHandle().

bool AxisSweep3::TestOverlap | ( | int | ignoreAxis,
 |  | const Handle * | pHandleA,
 |  | const Handle * | pHandleB
 | ) | [private]

Definition at line 256 of file AxisSweep3.cpp.

References AxisSweep3::Handle::m_maxEdges, and AxisSweep3::Handle::m_minEdges.

Referenced by SortMaxUp(), and SortMinDown().

void AxisSweep3::UpdateHandle | ( | unsigned short | handle,
 |  | const SimdPoint3 & | aabbMin,
 |  | const SimdPoint3 & | aabbMax
 | ) |

Definition at line 287 of file AxisSweep3.cpp.

References GetHandle(), AxisSweep3::Handle::m_maxEdges, AxisSweep3::Handle::m_minEdges, m_pEdges, AxisSweep3::Edge::m_pos, Quantize(), SortMaxDown(), SortMaxUp(), SortMinDown(), and SortMinUp().

Referenced by SetAabb().

Member Data Documentation

unsigned short AxisSweep3::m_firstFreeHandle [private]

Definition at line 71 of file AxisSweep3.h.

Referenced by AllocHandle(), AxisSweep3(), and FreeHandle().

int AxisSweep3::m_maxHandles [private]

Definition at line 69 of file AxisSweep3.h.

Referenced by AxisSweep3(), and FreeHandle().

int AxisSweep3::m_numHandles [private]

Definition at line 68 of file AxisSweep3.h.

Referenced by AddHandle(), AllocHandle(), AxisSweep3(), FreeHandle(), and RemoveHandle().

Edge* AxisSweep3::m_pEdges[3] [private]

Definition at line 73 of file AxisSweep3.h.

Referenced by AddHandle(), AxisSweep3(), RemoveHandle(), SortMaxDown(), SortMaxUp(), SortMinDown(), SortMinUp(), UpdateHandle(), and ~AxisSweep3().

Handle* AxisSweep3::m_pHandles [private]

Definition at line 70 of file AxisSweep3.h.

Referenced by AddHandle(), AxisSweep3(), GetHandle(), and ~AxisSweep3().

SimdVector3 AxisSweep3::m_quantize [private]

Definition at line 66 of file AxisSweep3.h.

Referenced by AxisSweep3(), and Quantize().

SimdPoint3 AxisSweep3::m_worldAabbMax [private]

Definition at line 64 of file AxisSweep3.h.

Referenced by AxisSweep3(), and Quantize().

SimdPoint3 AxisSweep3::m_worldAabbMin [private]

Definition at line 63 of file AxisSweep3.h.

Referenced by AxisSweep3(), and Quantize().

The documentation for this class was generated from the following files:
  • AxisSweep3.h
  • AxisSweep3.cpp
Generated on Wed May 24 13:59:55 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

AxisSweep3 Member List

This is the complete list of members for AxisSweep3, including all inherited members.

AddHandle(const SimdPoint3 &aabbMin, const SimdPoint3 &aabbMax, void *pOwner) | AxisSweep3 |
AddOverlappingPair(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | SimpleBroadphase | [protected]
AllocHandle() | AxisSweep3 | [private]
AxisSweep3(const SimdPoint3 &worldAabbMin, const SimdPoint3 &worldAabbMax, int maxHandles=1024, int maxOverlaps=8192) | AxisSweep3 |
CleanOverlappingPair(BroadphasePair &pair) | SimpleBroadphase | [protected]
CleanProxyFromPairs(BroadphaseProxy *proxy) | SimpleBroadphase | [virtual]
CreateProxy(const SimdVector3 &min, const SimdVector3 &max, int shapeType, void *userPtr) | AxisSweep3 | [virtual]
DestroyProxy(BroadphaseProxy *proxy) | AxisSweep3 | [virtual]
DispatchAllCollisionPairs(Dispatcher &dispatcher, DispatcherInfo &dispatchInfo) | SimpleBroadphase | [virtual]
FindPair(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | SimpleBroadphase | [protected]
FreeHandle(unsigned short handle) | AxisSweep3 | [private]
GetHandle(unsigned short index) const | AxisSweep3 | [inline]
m_firstFreeHandle | AxisSweep3 | [private]
m_maxHandles | AxisSweep3 | [private]
m_numHandles | AxisSweep3 | [private]
m_pEdges | AxisSweep3 | [private]
m_pHandles | AxisSweep3 | [private]
m_quantize | AxisSweep3 | [private]
m_worldAabbMax | AxisSweep3 | [private]
m_worldAabbMin | AxisSweep3 | [private]
Quantize(unsigned short *out, const SimdPoint3 &point, int isMax) const | AxisSweep3 | [private]
RefreshOverlappingPairs() | AxisSweep3 | [inline, virtual]
RemoveHandle(unsigned short handle) | AxisSweep3 |
RemoveOverlappingPair(BroadphasePair &pair) | SimpleBroadphase | [protected]
RemoveOverlappingPairsContainingProxy(BroadphaseProxy *proxy) | SimpleBroadphase | [protected]
SetAabb(BroadphaseProxy *proxy, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) | AxisSweep3 | [virtual]
SimpleBroadphase(int maxProxies=4096, int maxOverlap=8192) | SimpleBroadphase |
SortMaxDown(int axis, unsigned short edge, bool updateOverlaps=true) | AxisSweep3 | [private]
SortMaxUp(int axis, unsigned short edge, bool updateOverlaps=true) | AxisSweep3 | [private]
SortMinDown(int axis, unsigned short edge, bool updateOverlaps=true) | AxisSweep3 | [private]
SortMinUp(int axis, unsigned short edge, bool updateOverlaps=true) | AxisSweep3 | [private]
TestOverlap(int ignoreAxis, const Handle *pHandleA, const Handle *pHandleB) | AxisSweep3 | [private]
UpdateHandle(unsigned short handle, const SimdPoint3 &aabbMin, const SimdPoint3 &aabbMax) | AxisSweep3 |
~AxisSweep3() | AxisSweep3 | [virtual]
~BroadphaseInterface() | BroadphaseInterface | [inline, virtual]
~SimpleBroadphase() | SimpleBroadphase | [virtual]

Generated on Wed May 24 13:59:55 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3::Edge Class Reference

  • Class List
  • Class Hierarchy
  • Class Members
AxisSweep3::Edge

AxisSweep3::Edge Class Reference

#include <AxisSweep3.h>

List of all members.

Public Member Functions

unsigned short | IsMax () const

Public Attributes

unsigned short | m_pos
unsigned short | m_handle

Detailed Description

Definition at line 36 of file AxisSweep3.h.

Member Function Documentation

unsigned short AxisSweep3::Edge::IsMax ( ) const [inline]

Definition at line 42 of file AxisSweep3.h.

References m_pos.

Referenced by AxisSweep3::SortMaxDown(), AxisSweep3::SortMaxUp(), AxisSweep3::SortMinDown(), and AxisSweep3::SortMinUp().

Member Data Documentation

unsigned short AxisSweep3::Edge::m_handle

Definition at line 40 of file AxisSweep3.h.

Referenced by AxisSweep3::AddHandle(), AxisSweep3::AxisSweep3(), AxisSweep3::RemoveHandle(), AxisSweep3::SortMaxDown(), AxisSweep3::SortMaxUp(), AxisSweep3::SortMinDown(), and AxisSweep3::SortMinUp().

unsigned short AxisSweep3::Edge::m_pos

Definition at line 39 of file AxisSweep3.h.

Referenced by AxisSweep3::AddHandle(), AxisSweep3::AxisSweep3(), IsMax(), AxisSweep3::RemoveHandle(), AxisSweep3::SortMaxDown(), AxisSweep3::SortMaxUp(), AxisSweep3::SortMinDown(), AxisSweep3::SortMinUp(), and AxisSweep3::UpdateHandle().

The documentation for this class was generated from the following file:
  • AxisSweep3.h
Generated on Wed May 24 13:59:55 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

AxisSweep3::Edge Member List

This is the complete list of members for AxisSweep3::Edge, including all inherited members.

IsMax() const | AxisSweep3::Edge | [inline]
m_handle | AxisSweep3::Edge |
m_pos | AxisSweep3::Edge |

Generated on Wed May 24 13:59:55 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: AxisSweep3::Handle Class Reference

  • Class List
  • Class Hierarchy
  • Class Members
AxisSweep3::Handle

AxisSweep3::Handle Class Reference

#include <AxisSweep3.h>

Inheritance diagram for AxisSweep3::Handle:

[legend]
Collaboration diagram for AxisSweep3::Handle:

[legend]
List of all members.

Public Member Functions

void | SetNextFree (unsigned short next)
unsigned short | GetNextFree () const

Public Attributes

unsigned short | m_minEdges [3]
unsigned short | m_maxEdges [3]
unsigned short | m_handleId
unsigned short | m_pad

Detailed Description

Definition at line 46 of file AxisSweep3.h.

Member Function Documentation

unsigned short AxisSweep3::Handle::GetNextFree ( ) const [inline]

Definition at line 58 of file AxisSweep3.h.

References m_minEdges.

Referenced by AxisSweep3::AllocHandle().

void AxisSweep3::Handle::SetNextFree ( unsigned short next ) [inline]

Definition at line 57 of file AxisSweep3.h.

References m_minEdges.

Referenced by AxisSweep3::AxisSweep3(), and AxisSweep3::FreeHandle().

Member Data Documentation

unsigned short AxisSweep3::Handle::m_handleId

Definition at line 52 of file AxisSweep3.h.

Referenced by AxisSweep3::AddHandle(), AxisSweep3::DestroyProxy(), and AxisSweep3::SetAabb().

unsigned short AxisSweep3::Handle::m_maxEdges[3]

Definition at line 51 of file AxisSweep3.h.

Referenced by AxisSweep3::AddHandle(), AxisSweep3::AxisSweep3(), AxisSweep3::RemoveHandle(), AxisSweep3::SortMaxDown(), AxisSweep3::SortMaxUp(), AxisSweep3::SortMinDown(), AxisSweep3::SortMinUp(), AxisSweep3::TestOverlap(), and AxisSweep3::UpdateHandle().

unsigned short AxisSweep3::Handle::m_minEdges[3]

Definition at line 51 of file AxisSweep3.h.

Referenced by AxisSweep3::AddHandle(), AxisSweep3::AxisSweep3(), GetNextFree(), AxisSweep3::RemoveHandle(), SetNextFree(), AxisSweep3::SortMaxDown(), AxisSweep3::SortMaxUp(), AxisSweep3::SortMinDown(), AxisSweep3::SortMinUp(), AxisSweep3::TestOverlap(), and AxisSweep3::UpdateHandle().

unsigned short AxisSweep3::Handle::m_pad

Definition at line 53 of file AxisSweep3.h.

The documentation for this class was generated from the following file:
  • AxisSweep3.h
Generated on Wed May 24 13:59:56 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

AxisSweep3::Handle Member List

This is the complete list of members for AxisSweep3::Handle, including all inherited members.

BroadphaseProxy() | BroadphaseProxy | [inline]
BroadphaseProxy(int shapeType, void *userPtr) | BroadphaseProxy | [inline]
GetNextFree() const | AxisSweep3::Handle | [inline]
m_clientObject | BroadphaseProxy |
m_handleId | AxisSweep3::Handle |
m_maxEdges | AxisSweep3::Handle |
m_minEdges | AxisSweep3::Handle |
m_pad | AxisSweep3::Handle |
SetNextFree(unsigned short next) | AxisSweep3::Handle | [inline]

Generated on Wed May 24 13:59:56 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BoxShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BoxShape Class Reference

BoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box. More...

#include <BoxShape.h>

Inheritance diagram for BoxShape:

[legend]
Collaboration diagram for BoxShape:

[legend]
List of all members.

Public Member Functions

virtual | ~BoxShape ()
SimdVector3 | GetHalfExtents () const
virtual int | GetShapeType () const
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
BoxShape (const SimdVector3 &boxHalfExtents)
virtual void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual void | GetPlane (SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const
virtual int | GetNumPlanes () const
virtual int | GetNumVertices () const
virtual int | GetNumEdges () const
virtual void | GetVertex (int i, SimdVector3 &vtx) const
virtual void | GetPlaneEquation (SimdVector4 &plane, int i) const
virtual void | GetEdge (int i, SimdPoint3 &pa, SimdPoint3 &pb) const
virtual bool | IsInside (const SimdPoint3 &pt, SimdScalar tolerance) const
virtual char * | GetName () const

Private Attributes

SimdVector3 m_boxHalfExtents1

Detailed Description

BoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box.

Definition at line 26 of file BoxShape.h.

Constructor & Destructor Documentation

virtual BoxShape::~BoxShape ( ) [inline, virtual]

Definition at line 34 of file BoxShape.h.

BoxShape::BoxShape ( const SimdVector3 & boxHalfExtents ) [inline]

Definition at line 101 of file BoxShape.h.

Member Function Documentation

virtual void BoxShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [inline, virtual]

Reimplemented from PolyhedralConvexShape.

Reimplemented in CylinderShape, CylinderShapeX, and CylinderShapeZ.

Definition at line 83 of file BoxShape.h.

References GetHalfExtents(), ConvexShape::GetMargin(), SimdQuadWord::setValue(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

void BoxShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

Reimplemented from PolyhedralConvexShape.

Definition at line 43 of file BoxShape.cpp.

References GetHalfExtents(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

void BoxShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [virtual]

GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.

Reimplemented from ConvexShape.

Reimplemented in CylinderShape.

Definition at line 25 of file BoxShape.cpp.

References SimdMatrix3x3::absolute(), dot(), SimdTransform::getBasis(), GetHalfExtents(), ConvexShape::GetMargin(), and SimdTransform::getOrigin().

virtual void BoxShape::GetEdge | ( | int | i,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 182 of file BoxShape.h.

References ASSERT, and GetVertex().

SimdVector3 BoxShape::GetHalfExtents ( ) const

Definition at line 18 of file BoxShape.cpp.

References m_boxHalfExtents1, and ConvexShape::m_localScaling.

Referenced by CylinderShapeX::BatchedUnitVectorGetSupportingVertexWithoutMargin(), CylinderShapeZ::BatchedUnitVectorGetSupportingVertexWithoutMargin(), CylinderShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), BatchedUnitVectorGetSupportingVertexWithoutMargin(), CalculateLocalInertia(), GetAabb(), GetPlaneEquation(), GetVertex(), IsInside(), LocalGetSupportingVertex(), CylinderShape::LocalGetSupportingVertexWithoutMargin(), CylinderShapeZ::LocalGetSupportingVertexWithoutMargin(), CylinderShapeX::LocalGetSupportingVertexWithoutMargin(), and LocalGetSupportingVertexWithoutMargin().

virtual char* BoxShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 271 of file BoxShape.h.

virtual int BoxShape::GetNumEdges ( ) const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 129 of file BoxShape.h.

virtual int BoxShape::GetNumPlanes ( ) const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 119 of file BoxShape.h.

virtual int BoxShape::GetNumVertices ( ) const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 124 of file BoxShape.h.

virtual void BoxShape::GetPlane | ( | SimdVector3 & | planeNormal,
 |  | SimdPoint3 & | planeSupport,
 |  | int | i
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 109 of file BoxShape.h.

References GetPlaneEquation(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), and LocalGetSupportingVertex().

virtual void BoxShape::GetPlaneEquation | ( | SimdVector4 & | plane,
 |  | int | i
 | ) | const [inline, virtual]

Definition at line 146 of file BoxShape.h.

References GetHalfExtents(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by GetPlane().

virtual int BoxShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Reimplemented in CylinderShape.

Definition at line 45 of file BoxShape.h.

References BOX_SHAPE_PROXYTYPE.

virtual void BoxShape::GetVertex | ( | int | i,
 |  | SimdVector3 & | vtx
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 135 of file BoxShape.h.

References GetHalfExtents(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by GetEdge().

virtual bool BoxShape::IsInside | ( | const SimdPoint3 & | pt,
 |  | SimdScalar | tolerance
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 253 of file BoxShape.h.

References GetHalfExtents(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

virtual SimdVector3 BoxShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [inline, virtual]

Reimplemented from ConvexShape.

Reimplemented in CylinderShape.

Definition at line 47 of file BoxShape.h.

References GetHalfExtents(), ConvexShape::GetMargin(), SimdVector3::normalize(), SimdQuadWord::setValue(), SIMD_EPSILON, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by GetPlane().

virtual SimdVector3 BoxShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [inline, virtual]

Reimplemented from PolyhedralConvexShape.

Reimplemented in CylinderShape, CylinderShapeX, and CylinderShapeZ.

Definition at line 72 of file BoxShape.h.

References GetHalfExtents(), ConvexShape::GetMargin(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Member Data Documentation

SimdVector3 BoxShape::m_boxHalfExtents1 [private]

Definition at line 29 of file BoxShape.h.

Referenced by GetHalfExtents().

The documentation for this class was generated from the following files:
  • BoxShape.h
  • BoxShape.cpp
Generated on Wed May 24 13:59:56 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BoxShape Member List

This is the complete list of members for BoxShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | BoxShape | [inline, virtual]
BoxShape(const SimdVector3 &boxHalfExtents) | BoxShape | [inline]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | BoxShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | BoxShape | [virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | BoxShape | [inline, virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
GetHalfExtents() const | BoxShape |
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | BoxShape | [inline, virtual]
GetNumEdges() const | BoxShape | [inline, virtual]
GetNumPlanes() const | BoxShape | [inline, virtual]
GetNumVertices() const | BoxShape | [inline, virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | BoxShape | [inline, virtual]
GetPlaneEquation(SimdVector4 &plane, int i) const | BoxShape | [inline, virtual]
GetShapeType() const | BoxShape | [inline, virtual]
GetVertex(int i, SimdVector3 &vtx) const | BoxShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | BoxShape | [inline, virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | BoxShape | [inline, virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | BoxShape | [inline, virtual]
m_boxHalfExtents1 | BoxShape | [private]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~BoxShape() | BoxShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 13:59:56 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BoxTriangleCallback Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BoxTriangleCallback Class Reference

#include <ConvexConcaveCollisionAlgorithm.h>

Inheritance diagram for BoxTriangleCallback:

[legend]
Collaboration diagram for BoxTriangleCallback:

[legend]
List of all members.

Public Member Functions

BoxTriangleCallback (Dispatcher *dispatcher, BroadphaseProxy *proxy0, BroadphaseProxy *proxy1)
void | SetTimeStepAndCounters (float collisionMarginTriangle, const DispatcherInfo &dispatchInfo)
virtual | ~BoxTriangleCallback ()
virtual void | ProcessTriangle (SimdVector3 *triangle, int partId, int triangleIndex)
void | ClearCache ()
const SimdVector3 & | GetAabbMin () const
const SimdVector3 & | GetAabbMax () const

Public Attributes

int | m_triangleCount
PersistentManifold * m_manifoldPtr

Private Attributes

BroadphaseProxy * m_boxProxy
BroadphaseProxy m_triangleProxy
SimdVector3 m_aabbMin
SimdVector3 m_aabbMax
Dispatcher * m_dispatcher
const DispatcherInfo * | m_dispatchInfoPtr
float | m_collisionMarginTriangle

Detailed Description

Definition at line 29 of file ConvexConcaveCollisionAlgorithm.h.

Constructor & Destructor Documentation

BoxTriangleCallback::BoxTriangleCallback | ( | Dispatcher * | dispatcher,
 |  | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1
 | ) |

Definition at line 42 of file ConvexConcaveCollisionAlgorithm.cpp.

References ClearCache(), Dispatcher::GetNewManifold(), BroadphaseProxy::m_clientObject, m_dispatcher, and m_manifoldPtr.

BoxTriangleCallback::~BoxTriangleCallback ( ) [virtual]

Definition at line 55 of file ConvexConcaveCollisionAlgorithm.cpp.

References ClearCache(), m_dispatcher, m_manifoldPtr, and Dispatcher::ReleaseManifold().

Member Function Documentation

void BoxTriangleCallback::ClearCache ( )

Definition at line 63 of file ConvexConcaveCollisionAlgorithm.cpp.

References Dispatcher::ClearManifold(), m_dispatcher, and m_manifoldPtr.

Referenced by BoxTriangleCallback(), ConvexConcaveCollisionAlgorithm::ClearCache(), and ~BoxTriangleCallback().

const SimdVector3& BoxTriangleCallback::GetAabbMax ( ) const [inline]

Definition at line 60 of file ConvexConcaveCollisionAlgorithm.h.

References m_aabbMax.

Referenced by ConvexConcaveCollisionAlgorithm::ProcessCollision().

const SimdVector3& BoxTriangleCallback::GetAabbMin ( ) const [inline]

Definition at line 56 of file ConvexConcaveCollisionAlgorithm.h.

References m_aabbMin.

Referenced by ConvexConcaveCollisionAlgorithm::ProcessCollision().

void BoxTriangleCallback::ProcessTriangle | ( | SimdVector3 * | triangle,
 |  | int | partId,
 |  | int | triangleIndex
 | ) | [virtual]

Implements TriangleCallback.

Definition at line 70 of file ConvexConcaveCollisionAlgorithm.cpp.

References CollisionShape::IsConvex(), m_boxProxy, BroadphaseProxy::m_clientObject, m_collisionMarginTriangle, CollisionObject::m_collisionShape, m_dispatcher, CollisionAlgorithmConstructionInfo::m_dispatcher, m_dispatchInfoPtr, m_manifoldPtr, and m_triangleProxy.

void BoxTriangleCallback::SetTimeStepAndCounters | ( | float | collisionMarginTriangle,
 |  | const DispatcherInfo & | dispatchInfo
 | ) |

Definition at line 108 of file ConvexConcaveCollisionAlgorithm.cpp.

References CollisionShape::GetAabb(), SimdTransform::inverse(), m_aabbMax, m_aabbMin, m_boxProxy, BroadphaseProxy::m_clientObject, m_collisionMarginTriangle, CollisionObject::m_collisionShape, m_dispatchInfoPtr, m_triangleProxy, and CollisionObject::m_worldTransform.

Referenced by ConvexConcaveCollisionAlgorithm::ProcessCollision().

Member Data Documentation

SimdVector3 BoxTriangleCallback::m_aabbMax [private]

Definition at line 35 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by GetAabbMax(), and SetTimeStepAndCounters().

SimdVector3 BoxTriangleCallback::m_aabbMin [private]

Definition at line 34 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by GetAabbMin(), and SetTimeStepAndCounters().

BroadphaseProxy* BoxTriangleCallback::m_boxProxy [private]

Definition at line 31 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by ProcessTriangle(), and SetTimeStepAndCounters().

float BoxTriangleCallback::m_collisionMarginTriangle [private]

Definition at line 39 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by ProcessTriangle(), and SetTimeStepAndCounters().

Dispatcher* BoxTriangleCallback::m_dispatcher [private]

Definition at line 37 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by BoxTriangleCallback(), ClearCache(), ProcessTriangle(), and ~BoxTriangleCallback().

const DispatcherInfo* BoxTriangleCallback::m_dispatchInfoPtr [private]

Definition at line 38 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by ProcessTriangle(), and SetTimeStepAndCounters().

PersistentManifold* BoxTriangleCallback::m_manifoldPtr

Definition at line 44 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by BoxTriangleCallback(), ClearCache(), ConvexConcaveCollisionAlgorithm::ProcessCollision(), ProcessTriangle(), and ~BoxTriangleCallback().

int BoxTriangleCallback::m_triangleCount

Definition at line 42 of file ConvexConcaveCollisionAlgorithm.h.

BroadphaseProxy BoxTriangleCallback::m_triangleProxy [private]

Definition at line 32 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by ProcessTriangle(), and SetTimeStepAndCounters().

The documentation for this class was generated from the following files:
  • ConvexConcaveCollisionAlgorithm.h
  • ConvexConcaveCollisionAlgorithm.cpp
Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BoxTriangleCallback Member List

This is the complete list of members for BoxTriangleCallback, including all inherited members.

BoxTriangleCallback(Dispatcher *dispatcher, BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | BoxTriangleCallback |
ClearCache() | BoxTriangleCallback |
GetAabbMax() const | BoxTriangleCallback | [inline]
GetAabbMin() const | BoxTriangleCallback | [inline]
m_aabbMax | BoxTriangleCallback | [private]
m_aabbMin | BoxTriangleCallback | [private]
m_boxProxy | BoxTriangleCallback | [private]
m_collisionMarginTriangle | BoxTriangleCallback | [private]
m_dispatcher | BoxTriangleCallback | [private]
m_dispatchInfoPtr | BoxTriangleCallback | [private]
m_manifoldPtr | BoxTriangleCallback |
m_triangleCount | BoxTriangleCallback |
m_triangleProxy | BoxTriangleCallback | [private]
ProcessTriangle(SimdVector3 *triangle, int partId, int triangleIndex) | BoxTriangleCallback | [virtual]
SetTimeStepAndCounters(float collisionMarginTriangle, const DispatcherInfo &dispatchInfo) | BoxTriangleCallback |
~BoxTriangleCallback() | BoxTriangleCallback | [virtual]
~TriangleCallback() | TriangleCallback | [virtual]

Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseInterface Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BroadphaseInterface Class Reference

BroadphaseInterface for aabb-overlapping object pairs. More...

#include <BroadphaseInterface.h>

Inheritance diagram for BroadphaseInterface:

[legend]
List of all members.

Public Member Functions

virtual | ~BroadphaseInterface ()
virtual BroadphaseProxy * | CreateProxy (const SimdVector3 &min, const SimdVector3 &max, int shapeType, void *userPtr)=0
virtual void | DestroyProxy (BroadphaseProxy *proxy)=0
virtual void | SetAabb (BroadphaseProxy *proxy, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)=0
virtual void | CleanProxyFromPairs (BroadphaseProxy *proxy)=0
virtual void | DispatchAllCollisionPairs (Dispatcher &dispatcher, DispatcherInfo &dispatchInfo)=0

Detailed Description

BroadphaseInterface for aabb-overlapping object pairs.

Definition at line 27 of file BroadphaseInterface.h.

Constructor & Destructor Documentation

virtual BroadphaseInterface::~BroadphaseInterface ( ) [inline, virtual]

Definition at line 30 of file BroadphaseInterface.h.

Member Function Documentation

virtual void BroadphaseInterface::CleanProxyFromPairs ( BroadphaseProxy * proxy ) [pure virtual]

Implemented in SimpleBroadphase.

Referenced by CollisionWorld::RemoveCollisionObject(), and CollisionWorld::~CollisionWorld().

virtual BroadphaseProxy* BroadphaseInterface::CreateProxy | ( | const SimdVector3 & | min,
 |  | const SimdVector3 & | max,
 |  | int | shapeType,
 |  | void * | userPtr
 | ) | [pure virtual]

Implemented in AxisSweep3, and SimpleBroadphase.

Referenced by CollisionWorld::AddCollisionObject().

virtual void BroadphaseInterface::DestroyProxy ( BroadphaseProxy * proxy ) [pure virtual]

Implemented in AxisSweep3, and SimpleBroadphase.

Referenced by CollisionWorld::RemoveCollisionObject(), and CollisionWorld::~CollisionWorld().

virtual void BroadphaseInterface::DispatchAllCollisionPairs | ( | Dispatcher & | dispatcher,
 |  | DispatcherInfo & | dispatchInfo
 | ) | [pure virtual]

Implemented in SimpleBroadphase.

virtual void BroadphaseInterface::SetAabb | ( | BroadphaseProxy * | proxy,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | [pure virtual]

Implemented in AxisSweep3, and SimpleBroadphase.

Referenced by CollisionWorld::PerformDiscreteCollisionDetection().

The documentation for this class was generated from the following file:
  • BroadphaseInterface.h
Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BroadphaseInterface Member List

This is the complete list of members for BroadphaseInterface, including all inherited members.

CleanProxyFromPairs(BroadphaseProxy *proxy)=0 | BroadphaseInterface | [pure virtual]
CreateProxy(const SimdVector3 &min, const SimdVector3 &max, int shapeType, void *userPtr)=0 | BroadphaseInterface | [pure virtual]
DestroyProxy(BroadphaseProxy *proxy)=0 | BroadphaseInterface | [pure virtual]
DispatchAllCollisionPairs(Dispatcher &dispatcher, DispatcherInfo &dispatchInfo)=0 | BroadphaseInterface | [pure virtual]
SetAabb(BroadphaseProxy *proxy, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)=0 | BroadphaseInterface | [pure virtual]
~BroadphaseInterface() | BroadphaseInterface | [inline, virtual]

Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphasePair Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

BroadphasePair Struct Reference

contains a pair of aabb-overlapping objects More...

#include <BroadphaseProxy.h>

Collaboration diagram for BroadphasePair:

[legend]
List of all members.

Public Member Functions

BroadphasePair ()
BroadphasePair (const BroadphasePair &other)
BroadphasePair (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)

Public Attributes

BroadphaseProxy * m_pProxy0
BroadphaseProxy * m_pProxy1
CollisionAlgorithm * m_algorithms [SIMPLE_MAX_ALGORITHMS]

Detailed Description

contains a pair of aabb-overlapping objects

Definition at line 74 of file BroadphaseProxy.h.

Constructor & Destructor Documentation

BroadphasePair::BroadphasePair ( ) [inline]

Definition at line 76 of file BroadphaseProxy.h.

References m_algorithms, and SIMPLE_MAX_ALGORITHMS.

BroadphasePair::BroadphasePair ( const BroadphasePair & other ) [inline]

Definition at line 87 of file BroadphaseProxy.h.

References m_algorithms, and SIMPLE_MAX_ALGORITHMS.

BroadphasePair::BroadphasePair | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) | [inline]

Definition at line 96 of file BroadphaseProxy.h.

References m_algorithms, and SIMPLE_MAX_ALGORITHMS.

Member Data Documentation

CollisionAlgorithm* BroadphasePair::m_algorithms[SIMPLE_MAX_ALGORITHMS] [mutable]

Definition at line 112 of file BroadphaseProxy.h.

Referenced by SimpleBroadphase::AddOverlappingPair(), BroadphasePair(), SimpleBroadphase::CleanOverlappingPair(), and SimpleBroadphase::DispatchAllCollisionPairs().

BroadphaseProxy* BroadphasePair::m_pProxy0

Definition at line 109 of file BroadphaseProxy.h.

Referenced by SimpleBroadphase::CleanProxyFromPairs(), SimpleBroadphase::DispatchAllCollisionPairs(), SimpleBroadphase::FindPair(), SimpleBroadphase::RefreshOverlappingPairs(), and SimpleBroadphase::RemoveOverlappingPairsContainingProxy().

BroadphaseProxy* BroadphasePair::m_pProxy1

Definition at line 110 of file BroadphaseProxy.h.

Referenced by SimpleBroadphase::CleanProxyFromPairs(), SimpleBroadphase::DispatchAllCollisionPairs(), SimpleBroadphase::FindPair(), SimpleBroadphase::RefreshOverlappingPairs(), and SimpleBroadphase::RemoveOverlappingPairsContainingProxy().

The documentation for this struct was generated from the following file:
  • BroadphaseProxy.h
Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BroadphasePair Member List

This is the complete list of members for BroadphasePair, including all inherited members.

BroadphasePair() | BroadphasePair | [inline]
BroadphasePair(const BroadphasePair &other) | BroadphasePair | [inline]
BroadphasePair(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1) | BroadphasePair | [inline]
m_algorithms | BroadphasePair | [mutable]
m_pProxy0 | BroadphasePair |
m_pProxy1 | BroadphasePair |

Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BroadphaseProxy Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

BroadphaseProxy Struct Reference

BroadphaseProxy. More...

#include <BroadphaseProxy.h>

Inheritance diagram for BroadphaseProxy:

[legend]
List of all members.

Public Member Functions

BroadphaseProxy ()
BroadphaseProxy (int shapeType, void *userPtr)

Public Attributes

void * m_clientObject

Detailed Description

BroadphaseProxy.

Definition at line 51 of file BroadphaseProxy.h.

Constructor & Destructor Documentation

BroadphaseProxy::BroadphaseProxy ( ) [inline]

Definition at line 58 of file BroadphaseProxy.h.

BroadphaseProxy::BroadphaseProxy | ( | int | shapeType,
 |  | void * | userPtr
 | ) | [inline]

Definition at line 59 of file BroadphaseProxy.h.

Member Data Documentation

void* BroadphaseProxy::m_clientObject

Definition at line 55 of file BroadphaseProxy.h.

Referenced by AxisSweep3::AddHandle(), AxisSweep3::AxisSweep3(), BoxTriangleCallback::BoxTriangleCallback(), ConvexConvexAlgorithm::CalculateTimeOfImpact(), ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), ConvexConvexAlgorithm::ConvexConvexAlgorithm(), CollisionDispatcher::InternalFindAlgorithm(), CollisionDispatcher::NeedsCollision(), ConvexConvexAlgorithm::ProcessCollision(), ConvexConcaveCollisionAlgorithm::ProcessCollision(), BoxTriangleCallback::ProcessTriangle(), and BoxTriangleCallback::SetTimeStepAndCounters().

The documentation for this struct was generated from the following file:
  • BroadphaseProxy.h
Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BroadphaseProxy Member List

This is the complete list of members for BroadphaseProxy, including all inherited members.

BroadphaseProxy() | BroadphaseProxy | [inline]
BroadphaseProxy(int shapeType, void *userPtr) | BroadphaseProxy | [inline]
m_clientObject | BroadphaseProxy |

Generated on Wed May 24 13:59:57 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_AlgebraicPolynomialSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_AlgebraicPolynomialSolver Class Reference

BU_AlgebraicPolynomialSolver implements polynomial root finding by analytically solving algebraic equations. More...

#include <BU_AlgebraicPolynomialSolver.h>

Inheritance diagram for BU_AlgebraicPolynomialSolver:

[legend]
Collaboration diagram for BU_AlgebraicPolynomialSolver:

[legend]
List of all members.

Public Member Functions

BU_AlgebraicPolynomialSolver ()
int | Solve2Quadratic (SimdScalar p, SimdScalar q)
int | Solve2QuadraticFull (SimdScalar a, SimdScalar b, SimdScalar c)
int | Solve3Cubic (SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c)
int | Solve4Quartic (SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d)
SimdScalar | GetRoot (int i) const

Private Attributes

SimdScalar | m_roots [4]

Detailed Description

BU_AlgebraicPolynomialSolver implements polynomial root finding by analytically solving algebraic equations.

Polynomials up to 4rd degree are supported, Cardano's formula is used for 3rd degree

Definition at line 24 of file BU_AlgebraicPolynomialSolver.h.

Constructor & Destructor Documentation

BU_AlgebraicPolynomialSolver::BU_AlgebraicPolynomialSolver ( ) [inline]

Definition at line 27 of file BU_AlgebraicPolynomialSolver.h.

Member Function Documentation

SimdScalar BU_AlgebraicPolynomialSolver::GetRoot ( int i ) const [inline, virtual]

Implements BUM_PolynomialSolverInterface.

Definition at line 35 of file BU_AlgebraicPolynomialSolver.h.

References m_roots.

int BU_AlgebraicPolynomialSolver::Solve2Quadratic | ( | SimdScalar | p,
 |  | SimdScalar | q
 | ) |

Definition at line 21 of file BU_AlgebraicPolynomialSolver.cpp.

References m_roots, SIMD_EPSILON, SimdGreaterEqual(), and SimdSqrt().

Referenced by Solve4Quartic().

int BU_AlgebraicPolynomialSolver::Solve2QuadraticFull | ( | SimdScalar | a,
 |  | SimdScalar | b,
 |  | SimdScalar | c
 | ) |

Definition at line 45 of file BU_AlgebraicPolynomialSolver.cpp.

References m_roots, and SimdSqrt().

Referenced by Solve3Cubic(), and Solve4Quartic().

int BU_AlgebraicPolynomialSolver::Solve3Cubic | ( | SimdScalar | lead,
 |  | SimdScalar | a,
 |  | SimdScalar | b,
 |  | SimdScalar | c
 | ) | [virtual]

Implements BUM_PolynomialSolverInterface.

Definition at line 75 of file BU_AlgebraicPolynomialSolver.cpp.

References cubic_rt, m_roots, SIMD_2_PI, SIMD_EPSILON, SimdAcos(), SimdCos(), SimdEqual(), SimdSqrt(), and Solve2QuadraticFull().

Referenced by Solve4Quartic().

int BU_AlgebraicPolynomialSolver::Solve4Quartic | ( | SimdScalar | lead,
 |  | SimdScalar | a,
 |  | SimdScalar | b,
 |  | SimdScalar | c,
 |  | SimdScalar | d
 | ) | [virtual]

Implements BUM_PolynomialSolverInterface.

Definition at line 194 of file BU_AlgebraicPolynomialSolver.cpp.

References m_roots, SIMD_EPSILON, SimdEqual(), SimdSqrt(), Solve2Quadratic(), Solve2QuadraticFull(), and Solve3Cubic().

Member Data Documentation

SimdScalar BU_AlgebraicPolynomialSolver::m_roots[4] [private]

Definition at line 41 of file BU_AlgebraicPolynomialSolver.h.

Referenced by GetRoot(), Solve2Quadratic(), Solve2QuadraticFull(), Solve3Cubic(), and Solve4Quartic().

The documentation for this class was generated from the following files:
  • BU_AlgebraicPolynomialSolver.h
  • BU_AlgebraicPolynomialSolver.cpp
Generated on Wed May 24 13:59:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_AlgebraicPolynomialSolver Member List

This is the complete list of members for BU_AlgebraicPolynomialSolver, including all inherited members.

BU_AlgebraicPolynomialSolver() | BU_AlgebraicPolynomialSolver | [inline]
GetRoot(int i) const | BU_AlgebraicPolynomialSolver | [inline, virtual]
m_roots | BU_AlgebraicPolynomialSolver | [private]
Solve2Quadratic(SimdScalar p, SimdScalar q) | BU_AlgebraicPolynomialSolver |
Solve2QuadraticFull(SimdScalar a, SimdScalar b, SimdScalar c) | BU_AlgebraicPolynomialSolver |
Solve3Cubic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c) | BU_AlgebraicPolynomialSolver | [virtual]
Solve4Quartic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d) | BU_AlgebraicPolynomialSolver | [virtual]
~BUM_PolynomialSolverInterface() | BUM_PolynomialSolverInterface | [inline, virtual]

Generated on Wed May 24 13:59:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Collidable Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_Collidable Class Reference

#include <BU_Collidable.h>

Collaboration diagram for BU_Collidable:

[legend]
List of all members.

Public Member Functions

BU_Collidable (BU_MotionStateInterface &motion, PolyhedralConvexShape &shape, void *userPointer)
void * | GetUserPointer () const
BU_MotionStateInterface & GetMotionState ()
const BU_MotionStateInterface & | GetMotionState () const
const PolyhedralConvexShape & | GetShape () const

Private Attributes

BU_MotionStateInterface & m_motionState
PolyhedralConvexShape & m_shape
void * | m_userPointer

Detailed Description

Definition at line 25 of file BU_Collidable.h.

Constructor & Destructor Documentation

BU_Collidable::BU_Collidable | ( | BU_MotionStateInterface & | motion,
 |  | PolyhedralConvexShape & | shape,
 |  | void * | userPointer
 | ) |

Definition at line 22 of file BU_Collidable.cpp.

Member Function Documentation

const BU_MotionStateInterface& BU_Collidable::GetMotionState ( ) const [inline]

Definition at line 39 of file BU_Collidable.h.

References m_motionState.

BU_MotionStateInterface& BU_Collidable::GetMotionState ( ) [inline]

Definition at line 35 of file BU_Collidable.h.

References m_motionState.

const PolyhedralConvexShape& BU_Collidable::GetShape ( ) const [inline]

Definition at line 44 of file BU_Collidable.h.

References m_shape.

void* BU_Collidable::GetUserPointer ( ) const [inline]

Definition at line 30 of file BU_Collidable.h.

References m_userPointer.

Member Data Documentation

BU_MotionStateInterface& BU_Collidable::m_motionState [private]

Definition at line 47 of file BU_Collidable.h.

Referenced by GetMotionState().

PolyhedralConvexShape& BU_Collidable::m_shape [private]

Definition at line 52 of file BU_Collidable.h.

Referenced by GetShape().

void* BU_Collidable::m_userPointer [private]

Definition at line 53 of file BU_Collidable.h.

Referenced by GetUserPointer().

The documentation for this class was generated from the following files:
  • BU_Collidable.h
  • BU_Collidable.cpp
Generated on Wed May 24 13:59:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_Collidable Member List

This is the complete list of members for BU_Collidable, including all inherited members.

BU_Collidable(BU_MotionStateInterface &motion, PolyhedralConvexShape &shape, void *userPointer) | BU_Collidable |
GetMotionState() | BU_Collidable | [inline]
GetMotionState() const | BU_Collidable | [inline]
GetShape() const | BU_Collidable | [inline]
GetUserPointer() const | BU_Collidable | [inline]
m_motionState | BU_Collidable | [private]
m_shape | BU_Collidable | [private]
m_userPointer | BU_Collidable | [private]

Generated on Wed May 24 13:59:58 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_CollisionPair Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_CollisionPair Class Reference

BU_CollisionPair implements collision algorithm for algebraic time of impact calculation of feature based shapes. More...

#include <BU_CollisionPair.h>

Inheritance diagram for BU_CollisionPair:

[legend]
Collaboration diagram for BU_CollisionPair:

[legend]
List of all members.

Public Member Functions

BU_CollisionPair (const PolyhedralConvexShape *convexA, const PolyhedralConvexShape *convexB, SimdScalar tolerance=0.2f)
virtual bool | calcTimeOfImpact (const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)

Private Attributes

const PolyhedralConvexShape * | m_convexA
const PolyhedralConvexShape * | m_convexB
BU_Screwing m_screwing
SimdScalar m_tolerance

Detailed Description

BU_CollisionPair implements collision algorithm for algebraic time of impact calculation of feature based shapes.

Definition at line 30 of file BU_CollisionPair.h.

Constructor & Destructor Documentation

BU_CollisionPair::BU_CollisionPair | ( | const PolyhedralConvexShape * | convexA,
 |  | const PolyhedralConvexShape * | convexB,
 |  | SimdScalar | tolerance = 0.2f
 | ) |

Definition at line 31 of file BU_CollisionPair.cpp.

Member Function Documentation

bool BU_CollisionPair::calcTimeOfImpact | ( | const SimdTransform & | fromA,
 |  | const SimdTransform & | toA,
 |  | const SimdTransform & | fromB,
 |  | const SimdTransform & | toB,
 |  | CastResult & | result
 | ) | [virtual]

Definition at line 47 of file BU_CollisionPair.cpp.

References SimdTransformUtil::CalculateVelocity(), SimdTransform::getBasis(), SimdTransform::getOrigin(), SimdMatrix3x3::getRotation(), SimdTransform::getRotation(), SimdTransform::inverse(), SimdVector3::length(), SCREWEPSILON, SimdTransform::setOrigin(), SimdTransform::setRotation(), and SimdQuadWord::setValue().

Member Data Documentation

const PolyhedralConvexShape* BU_CollisionPair::m_convexA [private]

Definition at line 48 of file BU_CollisionPair.h.

const PolyhedralConvexShape* BU_CollisionPair::m_convexB [private]

Definition at line 49 of file BU_CollisionPair.h.

BU_Screwing BU_CollisionPair::m_screwing [private]

Definition at line 50 of file BU_CollisionPair.h.

SimdScalar BU_CollisionPair::m_tolerance [private]

Definition at line 51 of file BU_CollisionPair.h.

The documentation for this class was generated from the following files:
  • BU_CollisionPair.h
  • BU_CollisionPair.cpp
Generated on Wed May 24 13:59:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_CollisionPair Member List

This is the complete list of members for BU_CollisionPair, including all inherited members.

BU_CollisionPair(const PolyhedralConvexShape *convexA, const PolyhedralConvexShape *convexB, SimdScalar tolerance=0.2f) | BU_CollisionPair |
calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result) | BU_CollisionPair | [virtual]
ConvexCast::calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)=0 | ConvexCast | [pure virtual]
m_convexA | BU_CollisionPair | [private]
m_convexB | BU_CollisionPair | [private]
m_screwing | BU_CollisionPair | [private]
m_tolerance | BU_CollisionPair | [private]
~ConvexCast() | ConvexCast | [virtual]

Generated on Wed May 24 13:59:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_ContactJointNode Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_ContactJointNode Struct Reference

#include <BU_Joint.h>

Collaboration diagram for BU_ContactJointNode:

[legend]
List of all members.

Public Attributes

BU_Joint * joint
RigidBody * body

Detailed Description

Definition at line 23 of file BU_Joint.h.

Member Data Documentation

RigidBody* BU_ContactJointNode::body

Definition at line 25 of file BU_Joint.h.

Referenced by OdeConstraintSolver::ConvertConstraint(), and SolveInternal1().

BU_Joint* BU_ContactJointNode::joint

Definition at line 24 of file BU_Joint.h.

Referenced by OdeConstraintSolver::ConvertConstraint().

The documentation for this struct was generated from the following file:
  • BU_Joint.h
Generated on Wed May 24 13:59:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_ContactJointNode Member List

This is the complete list of members for BU_ContactJointNode, including all inherited members.

body | BU_ContactJointNode
joint | BU_ContactJointNode

Generated on Wed May 24 13:59:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_EdgeEdge Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_EdgeEdge Class Reference

BU_EdgeEdge implements algebraic time of impact calculation between two (angular + linear) moving edges. More...

#include <BU_EdgeEdge.h>

List of all members.

Public Member Functions

BU_EdgeEdge ()
bool | GetTimeOfImpact (const BU_Screwing &screwAB, const SimdPoint3 &a, const SimdVector3 &u, const SimdPoint3 &c, const SimdVector3 &v, SimdScalar &minTime, SimdScalar &lamda, SimdScalar &mu)

Private Member Functions

bool | Calc2DRotationPointPoint (const SimdPoint3 &rotPt, SimdScalar rotRadius, SimdScalar rotW, const SimdPoint3 &intersectPt, SimdScalar &minTime)
bool | GetTimeOfImpactGeneralCase (const BU_Screwing &screwAB, const SimdPoint3 &a, const SimdVector3 &u, const SimdPoint3 &c, const SimdVector3 &v, SimdScalar &minTime, SimdScalar &lamda, SimdScalar &mu)
bool | GetTimeOfImpactVertexEdge (const BU_Screwing &screwAB, const SimdPoint3 &a, const SimdVector3 &u, const SimdPoint3 &c, const SimdVector3 &v, SimdScalar &minTime, SimdScalar &lamda, SimdScalar &mu)

Detailed Description

BU_EdgeEdge implements algebraic time of impact calculation between two (angular + linear) moving edges.

Definition at line 30 of file BU_EdgeEdge.h.

Constructor & Destructor Documentation

BU_EdgeEdge::BU_EdgeEdge ( )

Definition at line 32 of file BU_EdgeEdge.cpp.

Member Function Documentation

bool BU_EdgeEdge::Calc2DRotationPointPoint | ( | const SimdPoint3 & | rotPt,
 |  | SimdScalar | rotRadius,
 |  | SimdScalar | rotW,
 |  | const SimdPoint3 & | intersectPt,
 |  | SimdScalar & | minTime
 | ) | [private]

Definition at line 520 of file BU_EdgeEdge.cpp.

References SimdVector3::dot(), SimdAcos(), SimdCos(), SimdSin(), SimdQuadWord::x(), and SimdQuadWord::y().

Referenced by GetTimeOfImpact().

bool BU_EdgeEdge::GetTimeOfImpact | ( | const BU_Screwing & | screwAB,
 |  | const SimdPoint3 & | a,
 |  | const SimdVector3 & | u,
 |  | const SimdPoint3 & | c,
 |  | const SimdVector3 & | v,
 |  | SimdScalar & | minTime,
 |  | SimdScalar & | lamda,
 |  | SimdScalar & | mu
 | ) |

Definition at line 37 of file BU_EdgeEdge.cpp.

References Calc2DRotationPointPoint(), BU_Screwing::GetS(), GetTimeOfImpactGeneralCase(), BU_Screwing::GetW(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::setX(), SimdQuadWord::setY(), SimdFuzzyZero(), SimdSqrt(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

bool BU_EdgeEdge::GetTimeOfImpactGeneralCase | ( | const BU_Screwing & | screwAB,
 |  | const SimdPoint3 & | a,
 |  | const SimdVector3 & | u,
 |  | const SimdPoint3 & | c,
 |  | const SimdVector3 & | v,
 |  | SimdScalar & | minTime,
 |  | SimdScalar & | lamda,
 |  | SimdScalar & | mu
 | ) | [private]

Definition at line 280 of file BU_EdgeEdge.cpp.

References BU_Polynomial, BU_Screwing::GetS(), BU_Screwing::GetW(), SimdAtan(), SimdFuzzyZero(), SimdTan(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by GetTimeOfImpact().

bool BU_EdgeEdge::GetTimeOfImpactVertexEdge | ( | const BU_Screwing & | screwAB,
 |  | const SimdPoint3 & | a,
 |  | const SimdVector3 & | u,
 |  | const SimdPoint3 & | c,
 |  | const SimdVector3 & | v,
 |  | SimdScalar & | minTime,
 |  | SimdScalar & | lamda,
 |  | SimdScalar & | mu
 | ) | [private]

Definition at line 565 of file BU_EdgeEdge.cpp.

The documentation for this class was generated from the following files:
  • BU_EdgeEdge.h
  • BU_EdgeEdge.cpp
Generated on Wed May 24 13:59:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_EdgeEdge Member List

This is the complete list of members for BU_EdgeEdge, including all inherited members.

BU_EdgeEdge() | BU_EdgeEdge |
Calc2DRotationPointPoint(const SimdPoint3 &rotPt, SimdScalar rotRadius, SimdScalar rotW, const SimdPoint3 &intersectPt, SimdScalar &minTime) | BU_EdgeEdge | [private]
GetTimeOfImpact(const BU_Screwing &screwAB, const SimdPoint3 &a, const SimdVector3 &u, const SimdPoint3 &c, const SimdVector3 &v, SimdScalar &minTime, SimdScalar &lamda, SimdScalar &mu) | BU_EdgeEdge |
GetTimeOfImpactGeneralCase(const BU_Screwing &screwAB, const SimdPoint3 &a, const SimdVector3 &u, const SimdPoint3 &c, const SimdVector3 &v, SimdScalar &minTime, SimdScalar &lamda, SimdScalar &mu) | BU_EdgeEdge | [private]
GetTimeOfImpactVertexEdge(const BU_Screwing &screwAB, const SimdPoint3 &a, const SimdVector3 &u, const SimdPoint3 &c, const SimdVector3 &v, SimdScalar &minTime, SimdScalar &lamda, SimdScalar &mu) | BU_EdgeEdge | [private]

Generated on Wed May 24 13:59:59 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_Joint Class Reference

#include <BU_Joint.h>

Inheritance diagram for BU_Joint:

[legend]
Collaboration diagram for BU_Joint:

[legend]
List of all members.

Public Member Functions

BU_Joint ()
virtual | ~BU_Joint ()
virtual void | GetInfo1 (Info1 *info)=0
virtual void | GetInfo2 (Info2 *info)=0

Public Attributes

int | flags
BU_ContactJointNode | node [2]
SimdScalar | lambda [6]

Classes

struct | Info1
struct | Info2

Detailed Description

Definition at line 30 of file BU_Joint.h.

Constructor & Destructor Documentation

BU_Joint::BU_Joint ( )

Definition at line 18 of file BU_Joint.cpp.

BU_Joint::~BU_Joint ( ) [virtual]

Definition at line 22 of file BU_Joint.cpp.

Member Function Documentation

virtual void BU_Joint::GetInfo1 ( Info1 * info ) [pure virtual]

Referenced by SolveInternal1().

virtual void BU_Joint::GetInfo2 ( Info2 * info ) [pure virtual]

Referenced by SolveInternal1().

Member Data Documentation

int BU_Joint::flags

Definition at line 87 of file BU_Joint.h.

Referenced by OdeConstraintSolver::ConvertConstraint().

SimdScalar BU_Joint::lambda[6]

Definition at line 89 of file BU_Joint.h.

Referenced by OdeConstraintSolver::ConvertConstraint().

BU_ContactJointNode BU_Joint::node[2]

Definition at line 88 of file BU_Joint.h.

Referenced by OdeConstraintSolver::ConvertConstraint(), and SolveInternal1().

The documentation for this class was generated from the following files:
  • BU_Joint.h
  • BU_Joint.cpp
Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_Joint Member List

This is the complete list of members for BU_Joint, including all inherited members.

BU_Joint() | BU_Joint |
flags | BU_Joint |
GetInfo1(Info1 *info)=0 | BU_Joint | [pure virtual]
GetInfo2(Info2 *info)=0 | BU_Joint | [pure virtual]
lambda | BU_Joint |
node | BU_Joint |
~BU_Joint() | BU_Joint | [virtual]

Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint::Info1 Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
BU_Joint::Info1

BU_Joint::Info1 Struct Reference

#include <BU_Joint.h>

List of all members.

Public Attributes

int | m
int | nub

Detailed Description

Definition at line 45 of file BU_Joint.h.

Member Data Documentation

int BU_Joint::Info1::m

Definition at line 46 of file BU_Joint.h.

Referenced by SolveInternal1().

int BU_Joint::Info1::nub

Definition at line 46 of file BU_Joint.h.

The documentation for this struct was generated from the following file:
  • BU_Joint.h
Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_Joint::Info1 Member List

This is the complete list of members for BU_Joint::Info1, including all inherited members.

m | BU_Joint::Info1
nub | BU_Joint::Info1

Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Joint::Info2 Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
BU_Joint::Info2

BU_Joint::Info2 Struct Reference

#include <BU_Joint.h>

List of all members.

Public Attributes

SimdScalar fps
SimdScalar erp
SimdScalar * J1l
SimdScalar * J1a
SimdScalar * J2l
SimdScalar * J2a
int | rowskip
SimdScalar * c
SimdScalar * cfm
SimdScalar * lo
SimdScalar * hi
int * | findex

Detailed Description

Definition at line 51 of file BU_Joint.h.

Member Data Documentation

SimdScalar* BU_Joint::Info2::c

Definition at line 68 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar * BU_Joint::Info2::cfm

Definition at line 68 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar BU_Joint::Info2::erp

Definition at line 54 of file BU_Joint.h.

Referenced by SolveInternal1().

int* BU_Joint::Info2::findex

Definition at line 77 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar BU_Joint::Info2::fps

Definition at line 54 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar * BU_Joint::Info2::hi

Definition at line 71 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar * BU_Joint::Info2::J1a

Definition at line 60 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar* BU_Joint::Info2::J1l

Definition at line 60 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar * BU_Joint::Info2::J2a

Definition at line 60 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar * BU_Joint::Info2::J2l

Definition at line 60 of file BU_Joint.h.

Referenced by SolveInternal1().

SimdScalar* BU_Joint::Info2::lo

Definition at line 71 of file BU_Joint.h.

Referenced by SolveInternal1().

int BU_Joint::Info2::rowskip

Definition at line 63 of file BU_Joint.h.

Referenced by SolveInternal1().

The documentation for this struct was generated from the following file:
  • BU_Joint.h
Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_Joint::Info2 Member List

This is the complete list of members for BU_Joint::Info2, including all inherited members.

c | BU_Joint::Info2
cfm | BU_Joint::Info2
erp | BU_Joint::Info2
findex | BU_Joint::Info2
fps | BU_Joint::Info2
hi | BU_Joint::Info2
J1a | BU_Joint::Info2
J1l | BU_Joint::Info2
J2a | BU_Joint::Info2
J2l | BU_Joint::Info2
lo | BU_Joint::Info2
rowskip | BU_Joint::Info2

Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_MotionStateInterface Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_MotionStateInterface Class Reference

#include <BU_MotionStateInterface.h>

Inheritance diagram for BU_MotionStateInterface:

[legend]
List of all members.

Public Member Functions

virtual | ~BU_MotionStateInterface ()
virtual void | SetTransform (const SimdTransform &trans)=0
virtual void | GetTransform (SimdTransform &trans) const =0
virtual void | SetPosition (const SimdPoint3 &position)=0
virtual void | GetPosition (SimdPoint3 &position) const =0
virtual void | SetOrientation (const SimdQuaternion &orientation)=0
virtual void | GetOrientation (SimdQuaternion &orientation) const =0
virtual void | SetBasis (const SimdMatrix3x3 &basis)=0
virtual void | GetBasis (SimdMatrix3x3 &basis) const =0
virtual void | SetLinearVelocity (const SimdVector3 &linvel)=0
virtual void | GetLinearVelocity (SimdVector3 &linvel) const =0
virtual void | GetAngularVelocity (SimdVector3 &angvel) const =0
virtual void | SetAngularVelocity (const SimdVector3 &angvel)=0

Detailed Description

Definition at line 25 of file BU_MotionStateInterface.h.

Constructor & Destructor Documentation

virtual BU_MotionStateInterface::~BU_MotionStateInterface ( ) [inline, virtual]

Definition at line 28 of file BU_MotionStateInterface.h.

Member Function Documentation

virtual void BU_MotionStateInterface::GetAngularVelocity ( SimdVector3 & angvel ) const [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::GetBasis ( SimdMatrix3x3 & basis ) const [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::GetLinearVelocity ( SimdVector3 & linvel ) const [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::GetOrientation ( SimdQuaternion & orientation ) const [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::GetPosition ( SimdPoint3 & position ) const [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::GetTransform ( SimdTransform & trans ) const [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::SetAngularVelocity ( const SimdVector3 & angvel ) [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::SetBasis ( const SimdMatrix3x3 & basis ) [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::SetLinearVelocity ( const SimdVector3 & linvel ) [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::SetOrientation ( const SimdQuaternion & orientation ) [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::SetPosition ( const SimdPoint3 & position ) [pure virtual]

Implemented in BU_StaticMotionState.

virtual void BU_MotionStateInterface::SetTransform ( const SimdTransform & trans ) [pure virtual]

Implemented in BU_StaticMotionState.

The documentation for this class was generated from the following file:
  • BU_MotionStateInterface.h
Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_MotionStateInterface Member List

This is the complete list of members for BU_MotionStateInterface, including all inherited members.

GetAngularVelocity(SimdVector3 &angvel) const =0 | BU_MotionStateInterface | [pure virtual]
GetBasis(SimdMatrix3x3 &basis) const =0 | BU_MotionStateInterface | [pure virtual]
GetLinearVelocity(SimdVector3 &linvel) const =0 | BU_MotionStateInterface | [pure virtual]
GetOrientation(SimdQuaternion &orientation) const =0 | BU_MotionStateInterface | [pure virtual]
GetPosition(SimdPoint3 &position) const =0 | BU_MotionStateInterface | [pure virtual]
GetTransform(SimdTransform &trans) const =0 | BU_MotionStateInterface | [pure virtual]
SetAngularVelocity(const SimdVector3 &angvel)=0 | BU_MotionStateInterface | [pure virtual]
SetBasis(const SimdMatrix3x3 &basis)=0 | BU_MotionStateInterface | [pure virtual]
SetLinearVelocity(const SimdVector3 &linvel)=0 | BU_MotionStateInterface | [pure virtual]
SetOrientation(const SimdQuaternion &orientation)=0 | BU_MotionStateInterface | [pure virtual]
SetPosition(const SimdPoint3 &position)=0 | BU_MotionStateInterface | [pure virtual]
SetTransform(const SimdTransform &trans)=0 | BU_MotionStateInterface | [pure virtual]
~BU_MotionStateInterface() | BU_MotionStateInterface | [inline, virtual]

Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Screwing Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_Screwing Class Reference

BU_Screwing implements screwing motion interpolation. More...

#include <BU_Screwing.h>

Collaboration diagram for BU_Screwing:

[legend]
List of all members.

Public Member Functions

BU_Screwing (const SimdVector3 &relLinVel, const SimdVector3 &relAngVel)
~BU_Screwing ()
SimdScalar | CalculateF (SimdScalar t) const
SimdPoint3 | InBetweenPosition (const SimdPoint3 &pt, SimdScalar t) const
SimdVector3 | InBetweenVector (const SimdVector3 &vec, SimdScalar t) const
SimdTransform | InBetweenTransform (const SimdTransform &tr, SimdScalar t) const
void | LocalMatrix (SimdTransform &t) const
const SimdVector3 & | GetU () const
const SimdVector3 & | GetO () const
const SimdScalar | GetS () const
const SimdScalar | GetW () const

Private Attributes

float | m_w
float | m_s
SimdVector3 m_u
SimdVector3 m_o

Detailed Description

BU_Screwing implements screwing motion interpolation.

Definition at line 29 of file BU_Screwing.h.

Constructor & Destructor Documentation

BU_Screwing::BU_Screwing | ( | const SimdVector3 & | relLinVel,
 |  | const SimdVector3 & | relAngVel
 | ) |

Definition at line 21 of file BU_Screwing.cpp.

References SimdVector3::cross(), SimdVector3::dot(), m_o, m_s, m_u, m_w, SimdVector3::normalize(), SCREWEPSILON, SimdCos(), SimdSin(), and SimdSqrt().

BU_Screwing::~BU_Screwing ( ) [inline]

Definition at line 36 of file BU_Screwing.h.

Member Function Documentation

SimdScalar BU_Screwing::CalculateF ( SimdScalar t ) const

Definition at line 188 of file BU_Screwing.cpp.

References m_w, and SimdTan().

Referenced by InBetweenPosition(), and InBetweenTransform().

const SimdVector3& BU_Screwing::GetO ( ) const [inline]

Definition at line 66 of file BU_Screwing.h.

References m_o.

const SimdScalar BU_Screwing::GetS ( ) const [inline]

Definition at line 67 of file BU_Screwing.h.

References m_s.

Referenced by BU_VertexPoly::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpact(), and BU_EdgeEdge::GetTimeOfImpactGeneralCase().

const SimdVector3& BU_Screwing::GetU ( ) const [inline]

Definition at line 65 of file BU_Screwing.h.

References m_u.

const SimdScalar BU_Screwing::GetW ( ) const [inline]

Definition at line 68 of file BU_Screwing.h.

References m_w.

Referenced by BU_VertexPoly::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpact(), and BU_EdgeEdge::GetTimeOfImpactGeneralCase().

SimdPoint3 BU_Screwing::InBetweenPosition | ( | const SimdPoint3 & | pt,
 |  | SimdScalar | t
 | ) | const [inline]

Definition at line 42 of file BU_Screwing.h.

References CalculateF(), m_s, m_w, SimdCos(), SimdSin(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdTransform BU_Screwing::InBetweenTransform | ( | const SimdTransform & | tr,
 |  | SimdScalar | t
 | ) | const

Definition at line 161 of file BU_Screwing.cpp.

References CalculateF(), SimdTransform::getBasis(), SimdTransform::getOrigin(), SimdMatrix3x3::getRotation(), m_s, m_w, SimdQuaternion::normalize(), SimdCos(), SimdSin(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by InBetweenVector().

SimdVector3 BU_Screwing::InBetweenVector | ( | const SimdVector3 & | vec,
 |  | SimdScalar | t
 | ) | const [inline]

Definition at line 50 of file BU_Screwing.h.

References InBetweenTransform(), LocalMatrix(), m_w, SimdCos(), and SimdSin().

void BU_Screwing::LocalMatrix ( SimdTransform & t ) const

Definition at line 102 of file BU_Screwing.cpp.

References m_o, m_u, SCREWEPSILON, SimdTransform::setBasis(), SimdTransform::setOrigin(), SimdSign(), and SimdSqrt().

Referenced by InBetweenVector().

Member Data Documentation

SimdVector3 BU_Screwing::m_o [private]

Definition at line 74 of file BU_Screwing.h.

Referenced by BU_Screwing(), GetO(), and LocalMatrix().

float BU_Screwing::m_s [private]

Definition at line 72 of file BU_Screwing.h.

Referenced by BU_Screwing(), GetS(), InBetweenPosition(), and InBetweenTransform().

SimdVector3 BU_Screwing::m_u [private]

Definition at line 73 of file BU_Screwing.h.

Referenced by BU_Screwing(), GetU(), and LocalMatrix().

float BU_Screwing::m_w [private]

Definition at line 71 of file BU_Screwing.h.

Referenced by BU_Screwing(), CalculateF(), GetW(), InBetweenPosition(), InBetweenTransform(), and InBetweenVector().

The documentation for this class was generated from the following files:
  • BU_Screwing.h
  • BU_Screwing.cpp
Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_Screwing Member List

This is the complete list of members for BU_Screwing, including all inherited members.

BU_Screwing(const SimdVector3 &relLinVel, const SimdVector3 &relAngVel) | BU_Screwing |
CalculateF(SimdScalar t) const | BU_Screwing |
GetO() const | BU_Screwing | [inline]
GetS() const | BU_Screwing | [inline]
GetU() const | BU_Screwing | [inline]
GetW() const | BU_Screwing | [inline]
InBetweenPosition(const SimdPoint3 &pt, SimdScalar t) const | BU_Screwing | [inline]
InBetweenTransform(const SimdTransform &tr, SimdScalar t) const | BU_Screwing |
InBetweenVector(const SimdVector3 &vec, SimdScalar t) const | BU_Screwing | [inline]
LocalMatrix(SimdTransform &t) const | BU_Screwing |
m_o | BU_Screwing | [private]
m_s | BU_Screwing | [private]
m_u | BU_Screwing | [private]
m_w | BU_Screwing | [private]
~BU_Screwing() | BU_Screwing | [inline]

Generated on Wed May 24 14:00:00 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_Simplex1to4 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_Simplex1to4 Class Reference

BU_Simplex1to4 implements feature based and implicit simplex of up to 4 vertices (tetrahedron, triangle, line, vertex). More...

#include <Simplex1to4Shape.h>

Inheritance diagram for BU_Simplex1to4:

[legend]
Collaboration diagram for BU_Simplex1to4:

[legend]
List of all members.

Public Member Functions

BU_Simplex1to4 ()
BU_Simplex1to4 (const SimdPoint3 &pt0)
BU_Simplex1to4 (const SimdPoint3 &pt0, const SimdPoint3 &pt1)
BU_Simplex1to4 (const SimdPoint3 &pt0, const SimdPoint3 &pt1, const SimdPoint3 &pt2)
BU_Simplex1to4 (const SimdPoint3 &pt0, const SimdPoint3 &pt1, const SimdPoint3 &pt2, const SimdPoint3 &pt3)
void | Reset ()
virtual int | GetShapeType () const
void | AddVertex (const SimdPoint3 &pt)
virtual int | GetNumVertices () const
virtual int | GetNumEdges () const
virtual void | GetEdge (int i, SimdPoint3 &pa, SimdPoint3 &pb) const
virtual void | GetVertex (int i, SimdPoint3 &vtx) const
virtual int | GetNumPlanes () const
virtual void | GetPlane (SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const
virtual int | GetIndex (int i) const
virtual bool | IsInside (const SimdPoint3 &pt, SimdScalar tolerance) const
virtual char * | GetName () const
GetName is for debugging.

Protected Attributes

int | m_numVertices
SimdPoint3 | m_vertices [4]

Detailed Description

BU_Simplex1to4 implements feature based and implicit simplex of up to 4 vertices (tetrahedron, triangle, line, vertex).

Definition at line 25 of file Simplex1to4Shape.h.

Constructor & Destructor Documentation

BU_Simplex1to4::BU_Simplex1to4 ( )

Definition at line 19 of file Simplex1to4Shape.cpp.

BU_Simplex1to4::BU_Simplex1to4 ( const SimdPoint3 & pt0 )

Definition at line 24 of file Simplex1to4Shape.cpp.

References AddVertex().

BU_Simplex1to4::BU_Simplex1to4 | ( | const SimdPoint3 & | pt0,
 |  | const SimdPoint3 & | pt1
 | ) |

Definition at line 30 of file Simplex1to4Shape.cpp.

References AddVertex().

BU_Simplex1to4::BU_Simplex1to4 | ( | const SimdPoint3 & | pt0,
 |  | const SimdPoint3 & | pt1,
 |  | const SimdPoint3 & | pt2
 | ) |

Definition at line 37 of file Simplex1to4Shape.cpp.

References AddVertex().

BU_Simplex1to4::BU_Simplex1to4 | ( | const SimdPoint3 & | pt0,
 |  | const SimdPoint3 & | pt1,
 |  | const SimdPoint3 & | pt2,
 |  | const SimdPoint3 & | pt3
 | ) |

Definition at line 45 of file Simplex1to4Shape.cpp.

References AddVertex().

Member Function Documentation

void BU_Simplex1to4::AddVertex ( const SimdPoint3 & pt )

Definition at line 58 of file Simplex1to4Shape.cpp.

References m_numVertices, and m_vertices.

Referenced by BU_Simplex1to4().

void BU_Simplex1to4::GetEdge | ( | int | i,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 88 of file Simplex1to4Shape.cpp.

References m_numVertices, and m_vertices.

int BU_Simplex1to4::GetIndex ( int i ) const [virtual]

Definition at line 184 of file Simplex1to4Shape.cpp.

virtual char* BU_Simplex1to4::GetName ( ) const [inline, virtual]

GetName is for debugging.

Implements CollisionShape.

Definition at line 71 of file Simplex1to4Shape.h.

int BU_Simplex1to4::GetNumEdges ( ) const [virtual]

Implements PolyhedralConvexShape.

Definition at line 69 of file Simplex1to4Shape.cpp.

References m_numVertices.

int BU_Simplex1to4::GetNumPlanes ( ) const [virtual]

Implements PolyhedralConvexShape.

Definition at line 157 of file Simplex1to4Shape.cpp.

References m_numVertices.

int BU_Simplex1to4::GetNumVertices ( ) const [virtual]

Implements PolyhedralConvexShape.

Definition at line 64 of file Simplex1to4Shape.cpp.

References m_numVertices.

void BU_Simplex1to4::GetPlane | ( | SimdVector3 & | planeNormal,
 |  | SimdPoint3 & | planeSupport,
 |  | int | i
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 179 of file Simplex1to4Shape.cpp.

virtual int BU_Simplex1to4::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 47 of file Simplex1to4Shape.h.

References TETRAHEDRAL_SHAPE_PROXYTYPE.

void BU_Simplex1to4::GetVertex | ( | int | i,
 |  | SimdPoint3 & | vtx
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 152 of file Simplex1to4Shape.cpp.

References m_vertices.

bool BU_Simplex1to4::IsInside | ( | const SimdPoint3 & | pt,
 |  | SimdScalar | tolerance
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 189 of file Simplex1to4Shape.cpp.

void BU_Simplex1to4::Reset ( ) [inline]

Definition at line 41 of file Simplex1to4Shape.h.

References m_numVertices.

Member Data Documentation

int BU_Simplex1to4::m_numVertices [protected]

Definition at line 29 of file Simplex1to4Shape.h.

Referenced by AddVertex(), GetEdge(), GetNumEdges(), GetNumPlanes(), GetNumVertices(), and Reset().

SimdPoint3 BU_Simplex1to4::m_vertices[4] [protected]

Definition at line 30 of file Simplex1to4Shape.h.

Referenced by AddVertex(), GetEdge(), and GetVertex().

The documentation for this class was generated from the following files:
  • Simplex1to4Shape.h
  • Simplex1to4Shape.cpp
Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_Simplex1to4 Member List

This is the complete list of members for BU_Simplex1to4, including all inherited members.

AddVertex(const SimdPoint3 &pt) | BU_Simplex1to4 |
BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | PolyhedralConvexShape | [virtual]
BU_Simplex1to4() | BU_Simplex1to4 |
BU_Simplex1to4(const SimdPoint3 &pt0) | BU_Simplex1to4 |
BU_Simplex1to4(const SimdPoint3 &pt0, const SimdPoint3 &pt1) | BU_Simplex1to4 |
BU_Simplex1to4(const SimdPoint3 &pt0, const SimdPoint3 &pt1, const SimdPoint3 &pt2) | BU_Simplex1to4 |
BU_Simplex1to4(const SimdPoint3 &pt0, const SimdPoint3 &pt1, const SimdPoint3 &pt2, const SimdPoint3 &pt3) | BU_Simplex1to4 |
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | PolyhedralConvexShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | BU_Simplex1to4 | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
GetIndex(int i) const | BU_Simplex1to4 | [virtual]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | BU_Simplex1to4 | [inline, virtual]
GetNumEdges() const | BU_Simplex1to4 | [virtual]
GetNumPlanes() const | BU_Simplex1to4 | [virtual]
GetNumVertices() const | BU_Simplex1to4 | [virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | BU_Simplex1to4 | [virtual]
GetShapeType() const | BU_Simplex1to4 | [inline, virtual]
GetVertex(int i, SimdPoint3 &vtx) const | BU_Simplex1to4 | [virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | BU_Simplex1to4 | [virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | PolyhedralConvexShape | [virtual]
m_localScaling | ConvexShape | [protected]
m_numVertices | BU_Simplex1to4 | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
m_vertices | BU_Simplex1to4 | [protected]
PolyhedralConvexShape() | PolyhedralConvexShape |
Reset() | BU_Simplex1to4 | [inline]
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_StaticMotionState Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_StaticMotionState Class Reference

#include <BU_StaticMotionState.h>

Inheritance diagram for BU_StaticMotionState:

[legend]
Collaboration diagram for BU_StaticMotionState:

[legend]
List of all members.

Public Member Functions

virtual | ~BU_StaticMotionState ()
virtual void | SetTransform (const SimdTransform &trans)
virtual void | GetTransform (SimdTransform &trans) const
virtual void | SetPosition (const SimdPoint3 &position)
virtual void | GetPosition (SimdPoint3 &position) const
virtual void | SetOrientation (const SimdQuaternion &orientation)
virtual void | GetOrientation (SimdQuaternion &orientation) const
virtual void | SetBasis (const SimdMatrix3x3 &basis)
virtual void | GetBasis (SimdMatrix3x3 &basis) const
virtual void | SetLinearVelocity (const SimdVector3 &linvel)
virtual void | GetLinearVelocity (SimdVector3 &linvel) const
virtual void | SetAngularVelocity (const SimdVector3 &angvel)
virtual void | GetAngularVelocity (SimdVector3 &angvel) const

Protected Attributes

SimdTransform m_trans
SimdVector3 m_angularVelocity
SimdVector3 m_linearVelocity

Detailed Description

Definition at line 23 of file BU_StaticMotionState.h.

Constructor & Destructor Documentation

virtual BU_StaticMotionState::~BU_StaticMotionState ( ) [inline, virtual]

Definition at line 26 of file BU_StaticMotionState.h.

Member Function Documentation

virtual void BU_StaticMotionState::GetAngularVelocity ( SimdVector3 & angvel ) const [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 76 of file BU_StaticMotionState.h.

References m_angularVelocity.

virtual void BU_StaticMotionState::GetBasis ( SimdMatrix3x3 & basis ) const [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 58 of file BU_StaticMotionState.h.

References SimdTransform::getBasis(), and m_trans.

virtual void BU_StaticMotionState::GetLinearVelocity ( SimdVector3 & linvel ) const [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 67 of file BU_StaticMotionState.h.

References m_linearVelocity.

virtual void BU_StaticMotionState::GetOrientation ( SimdQuaternion & orientation ) const [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 49 of file BU_StaticMotionState.h.

References SimdTransform::getRotation(), and m_trans.

virtual void BU_StaticMotionState::GetPosition ( SimdPoint3 & position ) const [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 40 of file BU_StaticMotionState.h.

References SimdTransform::getOrigin(), and m_trans.

virtual void BU_StaticMotionState::GetTransform ( SimdTransform & trans ) const [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 32 of file BU_StaticMotionState.h.

References m_trans.

virtual void BU_StaticMotionState::SetAngularVelocity ( const SimdVector3 & angvel ) [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 72 of file BU_StaticMotionState.h.

References m_angularVelocity.

virtual void BU_StaticMotionState::SetBasis ( const SimdMatrix3x3 & basis ) [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 54 of file BU_StaticMotionState.h.

References m_trans, and SimdTransform::setBasis().

virtual void BU_StaticMotionState::SetLinearVelocity ( const SimdVector3 & linvel ) [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 63 of file BU_StaticMotionState.h.

References m_linearVelocity.

virtual void BU_StaticMotionState::SetOrientation ( const SimdQuaternion & orientation ) [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 45 of file BU_StaticMotionState.h.

References m_trans, and SimdTransform::setRotation().

virtual void BU_StaticMotionState::SetPosition ( const SimdPoint3 & position ) [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 36 of file BU_StaticMotionState.h.

References m_trans, and SimdTransform::setOrigin().

virtual void BU_StaticMotionState::SetTransform ( const SimdTransform & trans ) [inline, virtual]

Implements BU_MotionStateInterface.

Definition at line 28 of file BU_StaticMotionState.h.

References m_trans.

Member Data Documentation

SimdVector3 BU_StaticMotionState::m_angularVelocity [protected]

Definition at line 86 of file BU_StaticMotionState.h.

Referenced by GetAngularVelocity(), and SetAngularVelocity().

SimdVector3 BU_StaticMotionState::m_linearVelocity [protected]

Definition at line 87 of file BU_StaticMotionState.h.

Referenced by GetLinearVelocity(), and SetLinearVelocity().

SimdTransform BU_StaticMotionState::m_trans [protected]

Definition at line 85 of file BU_StaticMotionState.h.

Referenced by GetBasis(), GetOrientation(), GetPosition(), GetTransform(), SetBasis(), SetOrientation(), SetPosition(), and SetTransform().

The documentation for this class was generated from the following file:
  • BU_StaticMotionState.h
Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_StaticMotionState Member List

This is the complete list of members for BU_StaticMotionState, including all inherited members.

GetAngularVelocity(SimdVector3 &angvel) const | BU_StaticMotionState | [inline, virtual]
GetBasis(SimdMatrix3x3 &basis) const | BU_StaticMotionState | [inline, virtual]
GetLinearVelocity(SimdVector3 &linvel) const | BU_StaticMotionState | [inline, virtual]
GetOrientation(SimdQuaternion &orientation) const | BU_StaticMotionState | [inline, virtual]
GetPosition(SimdPoint3 &position) const | BU_StaticMotionState | [inline, virtual]
GetTransform(SimdTransform &trans) const | BU_StaticMotionState | [inline, virtual]
m_angularVelocity | BU_StaticMotionState | [protected]
m_linearVelocity | BU_StaticMotionState | [protected]
m_trans | BU_StaticMotionState | [protected]
SetAngularVelocity(const SimdVector3 &angvel) | BU_StaticMotionState | [inline, virtual]
SetBasis(const SimdMatrix3x3 &basis) | BU_StaticMotionState | [inline, virtual]
SetLinearVelocity(const SimdVector3 &linvel) | BU_StaticMotionState | [inline, virtual]
SetOrientation(const SimdQuaternion &orientation) | BU_StaticMotionState | [inline, virtual]
SetPosition(const SimdPoint3 &position) | BU_StaticMotionState | [inline, virtual]
SetTransform(const SimdTransform &trans) | BU_StaticMotionState | [inline, virtual]
~BU_MotionStateInterface() | BU_MotionStateInterface | [inline, virtual]
~BU_StaticMotionState() | BU_StaticMotionState | [inline, virtual]

Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BU_VertexPoly Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BU_VertexPoly Class Reference

BU_VertexPoly implements algebraic time of impact calculation between vertex and a plane. More...

#include <BU_VertexPoly.h>

List of all members.

Public Member Functions

BU_VertexPoly ()
bool GetTimeOfImpact (const BU_Screwing &screwAB, const SimdPoint3 &vtx, const SimdVector4 &planeEq, SimdScalar &minTime, bool swapAB)

Detailed Description

BU_VertexPoly implements algebraic time of impact calculation between vertex and a plane.

Definition at line 27 of file BU_VertexPoly.h.

Constructor & Destructor Documentation

BU_VertexPoly::BU_VertexPoly ( )

Definition at line 36 of file BU_VertexPoly.cpp.

Member Function Documentation

bool BU_VertexPoly::GetTimeOfImpact | ( | const BU_Screwing & | screwAB,
 |  | const SimdPoint3 & | vtx,
 |  | const SimdVector4 & | planeEq,
 |  | SimdScalar & | minTime,
 |  | bool | swapAB
 | ) |

Definition at line 42 of file BU_VertexPoly.cpp.

References BU_Polynomial, SimdVector3::dot(), BU_Screwing::GetS(), BU_Screwing::GetW(), SimdAtan(), SimdTan(), TestFuzzyZero(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

The documentation for this class was generated from the following files:
  • BU_VertexPoly.h
  • BU_VertexPoly.cpp
Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BU_VertexPoly Member List

This is the complete list of members for BU_VertexPoly, including all inherited members.

BU_VertexPoly() | BU_VertexPoly
GetTimeOfImpact(const BU_Screwing &screwAB, const SimdPoint3 &vtx, const SimdVector4 &planeEq, SimdScalar &minTime, bool swapAB) | BU_VertexPoly

Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BUM_PolynomialSolverInterface Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BUM_PolynomialSolverInterface Class Reference

#include <BU_PolynomialSolverInterface.h>

Inheritance diagram for BUM_PolynomialSolverInterface:

[legend]
List of all members.

Public Member Functions

virtual | ~BUM_PolynomialSolverInterface ()
virtual int | Solve3Cubic (SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c)=0
virtual int | Solve4Quartic (SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d)=0
virtual SimdScalar | GetRoot (int i) const =0

Detailed Description

Definition at line 23 of file BU_PolynomialSolverInterface.h.

Constructor & Destructor Documentation

virtual BUM_PolynomialSolverInterface::~BUM_PolynomialSolverInterface ( ) [inline, virtual]

Definition at line 26 of file BU_PolynomialSolverInterface.h.

Member Function Documentation

virtual SimdScalar BUM_PolynomialSolverInterface::GetRoot ( int i ) const [pure virtual]

Implemented in BU_AlgebraicPolynomialSolver.

virtual int BUM_PolynomialSolverInterface::Solve3Cubic | ( | SimdScalar | lead,
 |  | SimdScalar | a,
 |  | SimdScalar | b,
 |  | SimdScalar | c
 | ) | [pure virtual]

Implemented in BU_AlgebraicPolynomialSolver.

virtual int BUM_PolynomialSolverInterface::Solve4Quartic | ( | SimdScalar | lead,
 |  | SimdScalar | a,
 |  | SimdScalar | b,
 |  | SimdScalar | c,
 |  | SimdScalar | d
 | ) | [pure virtual]

Implemented in BU_AlgebraicPolynomialSolver.

The documentation for this class was generated from the following file:
  • BU_PolynomialSolverInterface.h
Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BUM_PolynomialSolverInterface Member List

This is the complete list of members for BUM_PolynomialSolverInterface, including all inherited members.

GetRoot(int i) const =0 | BUM_PolynomialSolverInterface | [pure virtual]
Solve3Cubic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c)=0 | BUM_PolynomialSolverInterface | [pure virtual]
Solve4Quartic(SimdScalar lead, SimdScalar a, SimdScalar b, SimdScalar c, SimdScalar d)=0 | BUM_PolynomialSolverInterface | [pure virtual]
~BUM_PolynomialSolverInterface() | BUM_PolynomialSolverInterface | [inline, virtual]

Generated on Wed May 24 14:00:01 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BvhTriangleMeshShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

BvhTriangleMeshShape Class Reference

Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization. More...

#include <BvhTriangleMeshShape.h>

Inheritance diagram for BvhTriangleMeshShape:

[legend]
Collaboration diagram for BvhTriangleMeshShape:

[legend]
List of all members.

Public Member Functions

BvhTriangleMeshShape (StridingMeshInterface *meshInterface)
Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization.
virtual | ~BvhTriangleMeshShape ()
virtual void | ProcessAllTriangles (TriangleCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const
virtual char * | GetName () const
virtual void | setLocalScaling (const SimdVector3 &scaling)

Private Attributes

OptimizedBvh * m_bvh

Detailed Description

Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization.

Uses an interface to access the triangles to allow for sharing graphics/physics triangles.

Definition at line 24 of file BvhTriangleMeshShape.h.

Constructor & Destructor Documentation

BvhTriangleMeshShape::BvhTriangleMeshShape ( StridingMeshInterface * meshInterface )

Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization.

Uses an interface to access the triangles to allow for sharing graphics/physics triangles.

Definition at line 24 of file BvhTriangleMeshShape.cpp.

References OptimizedBvh::Build(), and m_bvh.

BvhTriangleMeshShape::~BvhTriangleMeshShape ( ) [virtual]

Definition at line 37 of file BvhTriangleMeshShape.cpp.

References m_bvh.

Member Function Documentation

virtual char* BvhTriangleMeshShape::GetName ( ) const [inline, virtual]

Reimplemented from TriangleMeshShape.

Definition at line 49 of file BvhTriangleMeshShape.h.

void BvhTriangleMeshShape::ProcessAllTriangles | ( | TriangleCallback * | callback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const [virtual]

Reimplemented from TriangleMeshShape.

Definition at line 43 of file BvhTriangleMeshShape.cpp.

References StridingMeshInterface::getLockedReadOnlyVertexIndexBase(), StridingMeshInterface::getScaling(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), m_bvh, TriangleMeshShape::m_meshInterface, OptimizedBvhNode::m_subPart, OptimizedBvhNode::m_triangleIndex, TriangleMeshShape::ProcessAllTriangles(), OptimizedBvh::ReportAabbOverlappingNodex(), and StridingMeshInterface::unLockReadOnlyVertexBase().

void BvhTriangleMeshShape::setLocalScaling ( const SimdVector3 & scaling ) [virtual]

Reimplemented from TriangleMeshShape.

Definition at line 128 of file BvhTriangleMeshShape.cpp.

References OptimizedBvh::Build(), TriangleMeshShape::getLocalScaling(), m_bvh, TriangleMeshShape::m_meshInterface, TriangleMeshShape::setLocalScaling(), and SIMD_EPSILON.

Member Data Documentation

OptimizedBvh* BvhTriangleMeshShape::m_bvh [private]

Definition at line 27 of file BvhTriangleMeshShape.h.

Referenced by BvhTriangleMeshShape(), ProcessAllTriangles(), setLocalScaling(), and ~BvhTriangleMeshShape().

The documentation for this class was generated from the following files:
  • BvhTriangleMeshShape.h
  • BvhTriangleMeshShape.cpp
Generated on Wed May 24 14:00:02 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

BvhTriangleMeshShape Member List

This is the complete list of members for BvhTriangleMeshShape, including all inherited members.

BvhTriangleMeshShape(StridingMeshInterface *meshInterface) | BvhTriangleMeshShape |
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | TriangleMeshShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | TriangleMeshShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | TriangleMeshShape | [virtual]
GetMargin() const | TriangleMeshShape | [inline, virtual]
GetName() const | BvhTriangleMeshShape | [inline, virtual]
GetShapeType() const | TriangleMeshShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | TriangleMeshShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | TriangleMeshShape | [inline, virtual]
m_bvh | BvhTriangleMeshShape | [private]
m_collisionMargin | TriangleMeshShape | [protected]
m_localAabbMax | TriangleMeshShape | [protected]
m_localAabbMin | TriangleMeshShape | [protected]
m_meshInterface | TriangleMeshShape | [protected]
m_tempDebug | CollisionShape |
ProcessAllTriangles(TriangleCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | BvhTriangleMeshShape | [virtual]
RecalcLocalAabb() | TriangleMeshShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | BvhTriangleMeshShape | [virtual]
SetMargin(float collisionMargin) | TriangleMeshShape | [inline, virtual]
TriangleMeshShape(StridingMeshInterface *meshInterface) | TriangleMeshShape |
~BvhTriangleMeshShape() | BvhTriangleMeshShape | [virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~TriangleMeshShape() | TriangleMeshShape | [virtual]

Generated on Wed May 24 14:00:02 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdConstructionInfo Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

CcdConstructionInfo Struct Reference

#include <CcdPhysicsController.h>

Collaboration diagram for CcdConstructionInfo:

[legend]
List of all members.

Public Member Functions

CcdConstructionInfo ()

Public Attributes

SimdVector3 m_localInertiaTensor
SimdVector3 m_gravity
SimdVector3 m_scaling
SimdScalar m_mass
SimdScalar m_restitution
SimdScalar m_friction
SimdScalar m_linearDamping
SimdScalar m_angularDamping
int | m_collisionFlags
CollisionShape * m_collisionShape
PHY_IMotionState * m_MotionState
CcdPhysicsEnvironment * m_physicsEnv
float | m_inertiaFactor

Detailed Description

Definition at line 42 of file CcdPhysicsController.h.

Constructor & Destructor Documentation

CcdConstructionInfo::CcdConstructionInfo ( ) [inline]

Definition at line 44 of file CcdPhysicsController.h.

Member Data Documentation

SimdScalar CcdConstructionInfo::m_angularDamping

Definition at line 66 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody().

int CcdConstructionInfo::m_collisionFlags

Definition at line 67 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody(), and CcdPhysicsEnvironment::CreateSphereController().

CollisionShape* CcdConstructionInfo::m_collisionShape

Definition at line 69 of file CcdPhysicsController.h.

Referenced by CcdPhysicsEnvironment::CreateConeController(), CcdPhysicsController::CreateRigidbody(), CcdPhysicsEnvironment::CreateSphereController(), and CcdPhysicsController::GetReplica().

SimdScalar CcdConstructionInfo::m_friction

Definition at line 64 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody().

SimdVector3 CcdConstructionInfo::m_gravity

Definition at line 60 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody().

float CcdConstructionInfo::m_inertiaFactor

Definition at line 73 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody(), and CcdPhysicsController::setScaling().

SimdScalar CcdConstructionInfo::m_linearDamping

Definition at line 65 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody().

SimdVector3 CcdConstructionInfo::m_localInertiaTensor

Definition at line 59 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody(), and CcdPhysicsController::setScaling().

SimdScalar CcdConstructionInfo::m_mass

Definition at line 62 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody(), and CcdPhysicsController::setScaling().

class PHY_IMotionState* CcdConstructionInfo::m_MotionState

Definition at line 70 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CcdPhysicsController(), CcdPhysicsEnvironment::CreateConeController(), CcdPhysicsController::CreateRigidbody(), and CcdPhysicsEnvironment::CreateSphereController().

CcdPhysicsEnvironment* CcdConstructionInfo::m_physicsEnv

Definition at line 72 of file CcdPhysicsController.h.

Referenced by CcdPhysicsEnvironment::CreateConeController(), CcdPhysicsEnvironment::CreateSphereController(), CcdPhysicsController::PostProcessReplica(), and CcdPhysicsController::~CcdPhysicsController().

SimdScalar CcdConstructionInfo::m_restitution

Definition at line 63 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::CreateRigidbody().

SimdVector3 CcdConstructionInfo::m_scaling

Definition at line 61 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController::setScaling().

The documentation for this struct was generated from the following file:
  • CcdPhysicsController.h
Generated on Wed May 24 14:00:02 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CcdConstructionInfo Member List

This is the complete list of members for CcdConstructionInfo, including all inherited members.

CcdConstructionInfo() | CcdConstructionInfo | [inline]
m_angularDamping | CcdConstructionInfo |
m_collisionFlags | CcdConstructionInfo |
m_collisionShape | CcdConstructionInfo |
m_friction | CcdConstructionInfo |
m_gravity | CcdConstructionInfo |
m_inertiaFactor | CcdConstructionInfo |
m_linearDamping | CcdConstructionInfo |
m_localInertiaTensor | CcdConstructionInfo |
m_mass | CcdConstructionInfo |
m_MotionState | CcdConstructionInfo |
m_physicsEnv | CcdConstructionInfo |
m_restitution | CcdConstructionInfo |
m_scaling | CcdConstructionInfo |

Generated on Wed May 24 14:00:02 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsController Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CcdPhysicsController Class Reference

CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution. More...

#include <CcdPhysicsController.h>

Inheritance diagram for CcdPhysicsController:

[legend]
Collaboration diagram for CcdPhysicsController:

[legend]
List of all members.

Public Member Functions

CcdPhysicsController (const CcdConstructionInfo &ci)
virtual | ~CcdPhysicsController ()
RigidBody * GetRigidBody ()
CollisionShape * GetCollisionShape ()
virtual bool | SynchronizeMotionStates (float time)
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding').
virtual void | WriteMotionStateToDynamics (bool nondynaonly)
WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding').
virtual void | WriteDynamicsToMotionState ()
virtual void | PostProcessReplica (class PHY_IMotionState *motionstate, class PHY_IPhysicsController *parentctrl)
virtual void | RelativeTranslate (float dlocX, float dlocY, float dlocZ, bool local)
virtual void | RelativeRotate (const float drot[9], bool local)
virtual void | getOrientation (float &quatImag0, float &quatImag1, float &quatImag2, float &quatReal)
virtual void | setOrientation (float quatImag0, float quatImag1, float quatImag2, float quatReal)
virtual void | setPosition (float posX, float posY, float posZ)
virtual void | getPosition (PHY__Vector3 &pos) const
virtual void | setScaling (float scaleX, float scaleY, float scaleZ)
virtual void | ApplyTorque (float torqueX, float torqueY, float torqueZ, bool local)
virtual void | ApplyForce (float forceX, float forceY, float forceZ, bool local)
virtual void | SetAngularVelocity (float ang_velX, float ang_velY, float ang_velZ, bool local)
virtual void | SetLinearVelocity (float lin_velX, float lin_velY, float lin_velZ, bool local)
virtual void | applyImpulse (float attachX, float attachY, float attachZ, float impulseX, float impulseY, float impulseZ)
virtual void | SetActive (bool active)
virtual void | GetLinearVelocity (float &linvX, float &linvY, float &linvZ)
virtual void | GetAngularVelocity (float &angVelX, float &angVelY, float &angVelZ)
virtual void | GetVelocity (const float posX, const float posY, const float posZ, float &linvX, float &linvY, float &linvZ)
virtual void | getReactionForce (float &forceX, float &forceY, float &forceZ)
virtual void | setRigidBody (bool rigid)
virtual void | resolveCombinedVelocities (float linvelX, float linvelY, float linvelZ, float angVelX, float angVelY, float angVelZ)
virtual void * | getNewClientInfo ()
virtual void | setNewClientInfo (void *clientinfo)
virtual PHY_IPhysicsController * | GetReplica ()
virtual void | calcXform ()
virtual void | SetMargin (float margin)
virtual float | GetMargin () const
bool | wantsSleeping ()
void | UpdateDeactivation (float timeStep)
void | SetAabb (const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)
PHY_IMotionState * GetMotionState ()
const class PHY_IMotionState * | GetMotionState () const

Static Public Member Functions

static SimdTransform | GetTransformFromMotionState (PHY_IMotionState *motionState)

Public Attributes

int | m_collisionDelay

Private Member Functions

void | GetWorldOrientation (SimdMatrix3x3 &mat)
void | CreateRigidbody ()

Private Attributes

RigidBody * m_body
PHY_IMotionState * m_MotionState
void * | m_newClientInfo
CcdConstructionInfo m_cci

Detailed Description

CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution.

Definition at line 80 of file CcdPhysicsController.h.

Constructor & Destructor Documentation

CcdPhysicsController::CcdPhysicsController ( const CcdConstructionInfo & ci )

Definition at line 43 of file CcdPhysicsController.cpp.

References CreateRigidbody(), RigidBody::getInvMass(), m_body, m_collisionDelay, CcdConstructionInfo::m_MotionState, m_MotionState, m_newClientInfo, RigidBody::setLinearVelocity(), and startVel.

CcdPhysicsController::~CcdPhysicsController ( ) [virtual]

Definition at line 104 of file CcdPhysicsController.cpp.

References m_body, m_cci, m_MotionState, CcdConstructionInfo::m_physicsEnv, and CcdPhysicsEnvironment::removeCcdPhysicsController().

Member Function Documentation

void CcdPhysicsController::ApplyForce | ( | float | forceX,
 |  | float | forceY,
 |  | float | forceZ,
 |  | bool | local
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 334 of file CcdPhysicsController.cpp.

References RigidBody::applyCentralForce(), SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), and m_body.

void CcdPhysicsController::applyImpulse | ( | float | attachX,
 |  | float | attachY,
 |  | float | attachZ,
 |  | float | impulseX,
 |  | float | impulseY,
 |  | float | impulseZ
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 381 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), RigidBody::applyImpulse(), SimdVector3::length2(), m_body, and SIMD_EPSILON.

void CcdPhysicsController::ApplyTorque | ( | float | torqueX,
 |  | float | torqueY,
 |  | float | torqueZ,
 |  | bool | local
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 323 of file CcdPhysicsController.cpp.

References RigidBody::applyTorque(), SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), and m_body.

virtual void CcdPhysicsController::calcXform ( ) [inline, virtual]

Implements PHY_IPhysicsController.

Definition at line 162 of file CcdPhysicsController.h.

void CcdPhysicsController::CreateRigidbody ( ) [private]

Definition at line 78 of file CcdPhysicsController.cpp.

References GetTransformFromMotionState(), CcdConstructionInfo::m_angularDamping, m_body, m_cci, CcdConstructionInfo::m_collisionFlags, CollisionObject::m_collisionFlags, CcdConstructionInfo::m_collisionShape, CollisionObject::m_collisionShape, CcdConstructionInfo::m_friction, CcdConstructionInfo::m_gravity, CcdConstructionInfo::m_inertiaFactor, CcdConstructionInfo::m_linearDamping, CcdConstructionInfo::m_localInertiaTensor, CcdConstructionInfo::m_mass, CcdConstructionInfo::m_MotionState, CcdConstructionInfo::m_restitution, RigidBody::setCenterOfMassTransform(), RigidBody::setDamping(), RigidBody::setGravity(), and RigidBody::setMassProps().

Referenced by CcdPhysicsController(), and PostProcessReplica().

void CcdPhysicsController::GetAngularVelocity | ( | float & | angVelX,
 |  | float & | angVelY,
 |  | float & | angVelZ
 | ) | [virtual]

Definition at line 410 of file CcdPhysicsController.cpp.

References RigidBody::getAngularVelocity(), m_body, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

CollisionShape* CcdPhysicsController::GetCollisionShape ( ) [inline]

Definition at line 105 of file CcdPhysicsController.h.

References RigidBody::GetCollisionShape(), and m_body.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), SynchronizeMotionStates(), and CcdPhysicsEnvironment::UpdateAabbs().

void CcdPhysicsController::GetLinearVelocity | ( | float & | linvX,
 |  | float & | linvY,
 |  | float & | linvZ
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 401 of file CcdPhysicsController.cpp.

References RigidBody::getLinearVelocity(), m_body, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

virtual float CcdPhysicsController::GetMargin ( ) const [inline, virtual]

Implements PHY_IPhysicsController.

Definition at line 164 of file CcdPhysicsController.h.

const class PHY_IMotionState* CcdPhysicsController::GetMotionState ( ) const [inline]

Definition at line 181 of file CcdPhysicsController.h.

References m_MotionState.

class PHY_IMotionState* CcdPhysicsController::GetMotionState ( ) [inline]

Definition at line 176 of file CcdPhysicsController.h.

References m_MotionState.

void * CcdPhysicsController::getNewClientInfo ( ) [virtual]

Implements PHY_IPhysicsController.

Definition at line 445 of file CcdPhysicsController.cpp.

References m_newClientInfo.

void CcdPhysicsController::getOrientation | ( | float & | quatImag0,
 |  | float & | quatImag1,
 |  | float & | quatImag2,
 |  | float & | quatReal
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 266 of file CcdPhysicsController.cpp.

References RigidBody::getCenterOfMassTransform(), SimdTransform::getRotation(), and m_body.

void CcdPhysicsController::getPosition ( PHY__Vector3 & pos ) const [virtual]

Implements PHY_IPhysicsController.

Definition at line 297 of file CcdPhysicsController.cpp.

References RigidBody::getCenterOfMassTransform(), SimdTransform::getOrigin(), m_body, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

void CcdPhysicsController::getReactionForce | ( | float & | forceX,
 |  | float & | forceY,
 |  | float & | forceZ
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 427 of file CcdPhysicsController.cpp.

PHY_IPhysicsController * CcdPhysicsController::GetReplica ( ) [virtual]

Reimplemented from PHY_IPhysicsController.

Definition at line 492 of file CcdPhysicsController.cpp.

References CONE_SHAPE_PROXYTYPE, CollisionShape::GetShapeType(), m_cci, and CcdConstructionInfo::m_collisionShape.

RigidBody* CcdPhysicsController::GetRigidBody ( ) [inline]

Definition at line 103 of file CcdPhysicsController.h.

References m_body.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CcdPhysicsEnvironment::createConstraint(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), CcdPhysicsEnvironment::removeCcdPhysicsController(), CcdPhysicsEnvironment::setGravity(), and CcdPhysicsEnvironment::UpdateAabbs().

SimdTransform CcdPhysicsController::GetTransformFromMotionState ( PHY_IMotionState * motionState ) [static]

Definition at line 64 of file CcdPhysicsController.cpp.

References PHY_IMotionState::getWorldOrientation(), PHY_IMotionState::getWorldPosition(), SimdTransform::setOrigin(), and SimdTransform::setRotation().

Referenced by CreateRigidbody().

void CcdPhysicsController::GetVelocity | ( | const float | posX,
 |  | const float | posY,
 |  | const float | posZ,
 |  | float & | linvX,
 |  | float & | linvY,
 |  | float & | linvZ
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 418 of file CcdPhysicsController.cpp.

References RigidBody::getCenterOfMassPosition(), RigidBody::getVelocityInLocalPoint(), m_body, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

void CcdPhysicsController::GetWorldOrientation ( SimdMatrix3x3 & mat ) [private]

Definition at line 258 of file CcdPhysicsController.cpp.

References PHY_IMotionState::getWorldOrientation(), m_MotionState, and SimdMatrix3x3::setRotation().

Referenced by RelativeRotate().

void CcdPhysicsController::PostProcessReplica | ( | class PHY_IMotionState * | motionstate,
 |  | class PHY_IPhysicsController * | parentctrl
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 169 of file CcdPhysicsController.cpp.

References CcdPhysicsEnvironment::addCcdPhysicsController(), CreateRigidbody(), m_body, m_cci, m_MotionState, and CcdConstructionInfo::m_physicsEnv.

void CcdPhysicsController::RelativeRotate | ( | const float | drot[9],
 |  | bool | local
 | ) | [virtual]

Definition at line 234 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), GetWorldOrientation(), SimdMatrix3x3::inverse(), m_body, SimdTransform::setBasis(), and RigidBody::setCenterOfMassTransform().

void CcdPhysicsController::RelativeTranslate | ( | float | dlocX,
 |  | float | dlocY,
 |  | float | dlocZ,
 |  | bool | local
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 214 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), SimdTransform::getOrigin(), m_body, RigidBody::setCenterOfMassTransform(), and SimdTransform::setOrigin().

void CcdPhysicsController::resolveCombinedVelocities | ( | float | linvelX,
 |  | float | linvelY,
 |  | float | linvelZ,
 |  | float | angVelX,
 |  | float | angVelY,
 |  | float | angVelZ
 | ) | [virtual]

Definition at line 293 of file CcdPhysicsController.cpp.

void CcdPhysicsController::SetAabb | ( | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) |

void CcdPhysicsController::SetActive ( bool active ) [virtual]

Implements PHY_IPhysicsController.

Definition at line 397 of file CcdPhysicsController.cpp.

void CcdPhysicsController::SetAngularVelocity | ( | float | ang_velX,
 |  | float | ang_velY,
 |  | float | ang_velZ,
 |  | bool | local
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 344 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), SimdVector3::length2(), m_body, RigidBody::setAngularVelocity(), and SIMD_EPSILON.

void CcdPhysicsController::SetLinearVelocity | ( | float | lin_velX,
 |  | float | lin_velY,
 |  | float | lin_velZ,
 |  | bool | local
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 363 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), SimdVector3::length2(), m_body, RigidBody::setLinearVelocity(), and SIMD_EPSILON.

virtual void CcdPhysicsController::SetMargin ( float margin ) [inline, virtual]

Implements PHY_IPhysicsController.

Definition at line 163 of file CcdPhysicsController.h.

void CcdPhysicsController::setNewClientInfo ( void * clientinfo ) [virtual]

Implements PHY_IPhysicsController.

Definition at line 449 of file CcdPhysicsController.cpp.

References m_newClientInfo.

void CcdPhysicsController::setOrientation | ( | float | quatImag0,
 |  | float | quatImag1,
 |  | float | quatImag2,
 |  | float | quatReal
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 274 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), RigidBody::getCenterOfMassTransform(), m_body, RigidBody::setCenterOfMassTransform(), and SimdTransform::setRotation().

void CcdPhysicsController::setPosition | ( | float | posX,
 |  | float | posY,
 |  | float | posZ
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 284 of file CcdPhysicsController.cpp.

References CollisionObject::activate(), RigidBody::getCenterOfMassTransform(), m_body, RigidBody::setCenterOfMassTransform(), and SimdTransform::setOrigin().

void CcdPhysicsController::setRigidBody ( bool rigid ) [virtual]

Implements PHY_IPhysicsController.

Definition at line 432 of file CcdPhysicsController.cpp.

References RigidBody::getInvInertiaDiagLocal(), m_body, RigidBody::setInvInertiaDiagLocal(), and RigidBody::updateInertiaTensor().

void CcdPhysicsController::setScaling | ( | float | scaleX,
 |  | float | scaleY,
 |  | float | scaleZ
 | ) | [virtual]

Implements PHY_IPhysicsController.

Definition at line 305 of file CcdPhysicsController.cpp.

References CollisionShape::CalculateLocalInertia(), RigidBody::GetCollisionShape(), m_body, m_cci, CcdConstructionInfo::m_inertiaFactor, CcdConstructionInfo::m_localInertiaTensor, CcdConstructionInfo::m_mass, CcdConstructionInfo::m_scaling, CollisionShape::setLocalScaling(), RigidBody::setMassProps(), SimdFuzzyZero(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

bool CcdPhysicsController::SynchronizeMotionStates ( float time ) [virtual]

SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding').

Implements PHY_IPhysicsController.

Definition at line 115 of file CcdPhysicsController.cpp.

References PHY_IMotionState::calculateWorldTransformations(), RigidBody::getCenterOfMassPosition(), GetCollisionShape(), RigidBody::getOrientation(), PHY_IMotionState::getWorldScaling(), CollisionObject::IsStatic(), m_body, m_MotionState, CollisionShape::setLocalScaling(), PHY_IMotionState::setWorldOrientation(), and PHY_IMotionState::setWorldPosition().

Referenced by CcdPhysicsEnvironment::SyncMotionStates().

void CcdPhysicsController::UpdateDeactivation ( float timeStep )

Definition at line 455 of file CcdPhysicsController.cpp.

References DISABLE_DEACTIVATION, gAngularSleepingTreshold, CollisionObject::GetActivationState(), RigidBody::getAngularVelocity(), RigidBody::getLinearVelocity(), gLinearSleepingTreshold, ISLAND_SLEEPING, SimdVector3::length2(), m_body, CollisionObject::m_deactivationTime, and CollisionObject::SetActivationState().

bool CcdPhysicsController::wantsSleeping ( )

Definition at line 472 of file CcdPhysicsController.cpp.

References DISABLE_DEACTIVATION, gDeactivationTime, gDisableDeactivation, CollisionObject::GetActivationState(), ISLAND_SLEEPING, m_body, CollisionObject::m_deactivationTime, and WANTS_DEACTIVATION.

void CcdPhysicsController::WriteDynamicsToMotionState ( ) [virtual]

Implements PHY_IPhysicsController.

Definition at line 165 of file CcdPhysicsController.cpp.

void CcdPhysicsController::WriteMotionStateToDynamics ( bool nondynaonly ) [virtual]

WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding').

Implements PHY_IPhysicsController.

Definition at line 161 of file CcdPhysicsController.cpp.

Member Data Documentation

RigidBody* CcdPhysicsController::m_body [private]

Definition at line 82 of file CcdPhysicsController.h.

Referenced by ApplyForce(), applyImpulse(), ApplyTorque(), CcdPhysicsController(), CreateRigidbody(), GetAngularVelocity(), GetCollisionShape(), GetLinearVelocity(), getOrientation(), getPosition(), GetRigidBody(), GetVelocity(), PostProcessReplica(), RelativeRotate(), RelativeTranslate(), SetAngularVelocity(), SetLinearVelocity(), setOrientation(), setPosition(), setRigidBody(), setScaling(), SynchronizeMotionStates(), UpdateDeactivation(), wantsSleeping(), and ~CcdPhysicsController().

CcdConstructionInfo CcdPhysicsController::m_cci [private]

Definition at line 88 of file CcdPhysicsController.h.

Referenced by CreateRigidbody(), GetReplica(), PostProcessReplica(), setScaling(), and ~CcdPhysicsController().

int CcdPhysicsController::m_collisionDelay

Definition at line 95 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController().

class PHY_IMotionState* CcdPhysicsController::m_MotionState [private]

Definition at line 83 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController(), GetMotionState(), GetWorldOrientation(), PostProcessReplica(), SynchronizeMotionStates(), and ~CcdPhysicsController().

void* CcdPhysicsController::m_newClientInfo [private]

Definition at line 86 of file CcdPhysicsController.h.

Referenced by CcdPhysicsController(), getNewClientInfo(), and setNewClientInfo().

The documentation for this class was generated from the following files:
  • CcdPhysicsController.h
  • CcdPhysicsController.cpp
Generated on Wed May 24 14:00:03 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CcdPhysicsController Member List

This is the complete list of members for CcdPhysicsController, including all inherited members.

ApplyForce(float forceX, float forceY, float forceZ, bool local) | CcdPhysicsController | [virtual]
applyImpulse(float attachX, float attachY, float attachZ, float impulseX, float impulseY, float impulseZ) | CcdPhysicsController | [virtual]
ApplyTorque(float torqueX, float torqueY, float torqueZ, bool local) | CcdPhysicsController | [virtual]
calcXform() | CcdPhysicsController | [inline, virtual]
CcdPhysicsController(const CcdConstructionInfo &ci) | CcdPhysicsController |
CreateRigidbody() | CcdPhysicsController | [private]
GetAngularVelocity(float &angVelX, float &angVelY, float &angVelZ) | CcdPhysicsController | [virtual]
GetCollisionShape() | CcdPhysicsController | [inline]
GetLinearVelocity(float &linvX, float &linvY, float &linvZ) | CcdPhysicsController | [virtual]
GetMargin() const | CcdPhysicsController | [inline, virtual]
GetMotionState() | CcdPhysicsController | [inline]
GetMotionState() const | CcdPhysicsController | [inline]
getNewClientInfo() | CcdPhysicsController | [virtual]
getOrientation(float &quatImag0, float &quatImag1, float &quatImag2, float &quatReal) | CcdPhysicsController | [virtual]
getPosition(PHY__Vector3 &pos) const | CcdPhysicsController | [virtual]
GetRadius() const | PHY_IPhysicsController | [inline, virtual]
getReactionForce(float &forceX, float &forceY, float &forceZ) | CcdPhysicsController | [virtual]
GetReplica() | CcdPhysicsController | [virtual]
GetRigidBody() | CcdPhysicsController | [inline]
GetTransformFromMotionState(PHY_IMotionState *motionState) | CcdPhysicsController | [static]
GetVelocity(const float posX, const float posY, const float posZ, float &linvX, float &linvY, float &linvZ) | CcdPhysicsController | [virtual]
GetWorldOrientation(SimdMatrix3x3 &mat) | CcdPhysicsController | [private]
GetWorldPosition(PHY__Vector3 &localpos) | PHY_IPhysicsController |
m_body | CcdPhysicsController | [private]
m_cci | CcdPhysicsController | [private]
m_collisionDelay | CcdPhysicsController |
m_MotionState | CcdPhysicsController | [private]
m_newClientInfo | CcdPhysicsController | [private]
PostProcessReplica(class PHY_IMotionState *motionstate, class PHY_IPhysicsController *parentctrl) | CcdPhysicsController | [virtual]
RelativeRotate(const float drot[9], bool local) | CcdPhysicsController | [virtual]
PHY_IPhysicsController::RelativeRotate(const float drot[12], bool local)=0 | PHY_IPhysicsController | [pure virtual]
RelativeTranslate(float dlocX, float dlocY, float dlocZ, bool local) | CcdPhysicsController | [virtual]
resolveCombinedVelocities(float linvelX, float linvelY, float linvelZ, float angVelX, float angVelY, float angVelZ) | CcdPhysicsController | [virtual]
SetAabb(const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) | CcdPhysicsController |
SetActive(bool active) | CcdPhysicsController | [virtual]
SetAngularVelocity(float ang_velX, float ang_velY, float ang_velZ, bool local) | CcdPhysicsController | [virtual]
SetLinearVelocity(float lin_velX, float lin_velY, float lin_velZ, bool local) | CcdPhysicsController | [virtual]
SetMargin(float margin) | CcdPhysicsController | [inline, virtual]
setNewClientInfo(void *clientinfo) | CcdPhysicsController | [virtual]
setOrientation(float quatImag0, float quatImag1, float quatImag2, float quatReal) | CcdPhysicsController | [virtual]
setPosition(float posX, float posY, float posZ) | CcdPhysicsController | [virtual]
setRigidBody(bool rigid) | CcdPhysicsController | [virtual]
setScaling(float scaleX, float scaleY, float scaleZ) | CcdPhysicsController | [virtual]
SynchronizeMotionStates(float time) | CcdPhysicsController | [virtual]
UpdateDeactivation(float timeStep) | CcdPhysicsController |
wantsSleeping() | CcdPhysicsController |
WriteDynamicsToMotionState() | CcdPhysicsController | [virtual]
WriteMotionStateToDynamics(bool nondynaonly) | CcdPhysicsController | [virtual]
~CcdPhysicsController() | CcdPhysicsController | [virtual]
~PHY_IPhysicsController() | PHY_IPhysicsController | [virtual]

Generated on Wed May 24 14:00:03 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CcdPhysicsEnvironment Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CcdPhysicsEnvironment Class Reference

CcdPhysicsEnvironment is experimental mainloop for physics simulation using optional continuous collision detection. More...

#include <CcdPhysicsEnvironment.h>

Inheritance diagram for CcdPhysicsEnvironment:

[legend]
Collaboration diagram for CcdPhysicsEnvironment:

[legend]
List of all members.

Public Member Functions

CcdPhysicsEnvironment (CollisionDispatcher *dispatcher=0, BroadphaseInterface *broadphase=0)
virtual | ~CcdPhysicsEnvironment ()
virtual void | setDebugDrawer (IDebugDraw *debugDrawer)
Perform an integration step of duration 'timeStep'.
virtual void | setNumIterations (int numIter)
virtual void | setNumTimeSubSteps (int numTimeSubSteps)
virtual void | setDeactivationTime (float dTime)
virtual void | setDeactivationLinearTreshold (float linTresh)
virtual void | setDeactivationAngularTreshold (float angTresh)
virtual void | setContactBreakingTreshold (float contactBreakingTreshold)
virtual void | setCcdMode (int ccdMode)
virtual void | setSolverType (int solverType)
virtual void | setSolverSorConstant (float sor)
virtual void | setSolverTau (float tau)
virtual void | setSolverDamping (float damping)
virtual void | setLinearAirDamping (float damping)
virtual void | setUseEpa (bool epa)
virtual void | beginFrame ()
virtual void | endFrame ()
virtual bool | proceedDeltaTime (double curTime, float timeStep)
Perform an integration step of duration 'timeStep'.
bool | proceedDeltaTimeOneStep (float timeStep)
Perform an integration step of duration 'timeStep'.
virtual void | setFixedTimeStep (bool useFixedTimeStep, float fixedTimeStep)
virtual float | getFixedTimeStep ()
virtual void | setDebugMode (int debugMode)
virtual void | setGravity (float x, float y, float z)
virtual int | createConstraint (class PHY_IPhysicsController *ctrl, class PHY_IPhysicsController *ctrl2, PHY_ConstraintType type, float pivotX, float pivotY, float pivotZ, float axisX, float axisY, float axisZ)
virtual void | removeConstraint (int constraintid)
virtual void | CallbackTriggers ()
virtual class PHY_IVehicle * | getVehicleConstraint (int constraintId)
TypedConstraint * | getConstraintById (int constraintId)
virtual PHY_IPhysicsController * | rayTest (PHY_IPhysicsController *ignoreClient, float fromX, float fromY, float fromZ, float toX, float toY, float toZ, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ)
virtual void | addSensor (PHY_IPhysicsController *ctrl)
virtual void | removeSensor (PHY_IPhysicsController *ctrl)
virtual void | addTouchCallback (int response_class, PHY_ResponseCallback callback, void *user)
virtual void | requestCollisionCallback (PHY_IPhysicsController *ctrl)
virtual void | removeCollisionCallback (PHY_IPhysicsController *ctrl)
virtual PHY_IPhysicsController * | CreateSphereController (float radius, const PHY__Vector3 &position)
virtual PHY_IPhysicsController * | CreateConeController (float coneradius, float coneheight)
virtual int | getNumContactPoints ()
virtual void | getContactPoint (int i, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ)
void | addCcdPhysicsController (CcdPhysicsController *ctrl)
void | removeCcdPhysicsController (CcdPhysicsController *ctrl)
BroadphaseInterface * GetBroadphase ()
CollisionDispatcher * GetDispatcher ()
const CollisionDispatcher * | GetDispatcher () const
bool | IsSatCollisionDetectionEnabled () const
void | EnableSatCollisionDetection (bool enableSat)
void | UpdateAabbs (float timeStep)
int | GetNumControllers ()
CcdPhysicsController * | GetPhysicsController (int index)
int | GetNumManifolds () const
const PersistentManifold * | GetManifold (int index) const

Public Attributes

std::vector< TypedConstraint * > | m_constraints

Private Member Functions

void | SyncMotionStates (float timeStep)

Private Attributes

SimdVector3 m_gravity
IDebugDraw * m_debugDrawer
int | m_numIterations
int | m_numTimeSubSteps
int | m_ccdMode
int | m_solverType
int | m_profileTimings
bool | m_enableSatCollisionDetection
ContactSolverInfo m_solverInfo
std::vector< CcdPhysicsController * > | m_controllers
std::vector< CcdPhysicsController * > | m_triggerControllers
PHY_ResponseCallback | m_triggerCallbacks [PHY_NUM_RESPONSE]
void * | m_triggerCallbacksUserPtrs [PHY_NUM_RESPONSE]
std::vector< WrapperVehicle * > | m_wrapperVehicles
CollisionWorld * m_collisionWorld
ConstraintSolver * m_solver
bool | m_scalingPropagated

Detailed Description

CcdPhysicsEnvironment is experimental mainloop for physics simulation using optional continuous collision detection.

Physics Environment takes care of stepping the simulation and is a container for physics entities. It stores rigidbodies,constraints, materials etc. A derived class may be able to 'construct' entities by loading and/or converting

Definition at line 46 of file CcdPhysicsEnvironment.h.

Constructor & Destructor Documentation

CcdPhysicsEnvironment::CcdPhysicsEnvironment | ( | CollisionDispatcher * | dispatcher = 0,
 |  | BroadphaseInterface * | broadphase = 0
 | ) |

Definition at line 325 of file CcdPhysicsEnvironment.cpp.

References m_triggerCallbacks, and PHY_NUM_RESPONSE.

CcdPhysicsEnvironment::~CcdPhysicsEnvironment ( ) [virtual]

Definition at line 1363 of file CcdPhysicsEnvironment.cpp.

References m_collisionWorld, and m_wrapperVehicles.

Member Function Documentation

void CcdPhysicsEnvironment::addCcdPhysicsController ( CcdPhysicsController * ctrl )

Definition at line 366 of file CcdPhysicsEnvironment.cpp.

References CollisionWorld::AddCollisionObject(), CollisionShape::GetAabb(), GetBroadphase(), RigidBody::getCenterOfMassTransform(), CcdPhysicsController::GetCollisionShape(), RigidBody::getLinearVelocity(), CcdPhysicsController::GetRigidBody(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), CollisionObject::m_broadphaseHandle, m_collisionWorld, m_controllers, m_gravity, CollisionObject::m_userPointer, RigidBody::setGravity(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by addSensor(), and CcdPhysicsController::PostProcessReplica().

void CcdPhysicsEnvironment::addSensor ( PHY_IPhysicsController * ctrl ) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1418 of file CcdPhysicsEnvironment.cpp.

References addCcdPhysicsController(), m_controllers, and requestCollisionCallback().

void CcdPhysicsEnvironment::addTouchCallback | ( | int | response_class,
 |  | PHY_ResponseCallback | callback,
 |  | void * | user
 | ) | [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1450 of file CcdPhysicsEnvironment.cpp.

References m_triggerCallbacks, and m_triggerCallbacksUserPtrs.

void CcdPhysicsEnvironment::beginFrame ( ) [virtual]

Definition at line 498 of file CcdPhysicsEnvironment.cpp.

void CcdPhysicsEnvironment::CallbackTriggers ( ) [virtual]

Definition at line 1491 of file CcdPhysicsEnvironment.cpp.

References PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), CollisionWorld::GetDispatcher(), CollisionDispatcher::GetManifoldByIndexInternal(), PersistentManifold::GetNumContacts(), CollisionDispatcher::GetNumManifolds(), getVehicleConstraint(), m_collisionWorld, m_triggerCallbacks, m_triggerCallbacksUserPtrs, m_triggerControllers, CollisionObject::m_userPointer, m_wrapperVehicles, and PHY_OBJECT_RESPONSE.

PHY_IPhysicsController * CcdPhysicsEnvironment::CreateConeController | ( | float | coneradius,
 |  | float | coneheight
 | ) | [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1657 of file CcdPhysicsEnvironment.cpp.

References CcdConstructionInfo::m_collisionShape, CcdConstructionInfo::m_MotionState, CcdConstructionInfo::m_physicsEnv, DefaultMotionState::m_worldTransform, and SimdTransform::setIdentity().

int CcdPhysicsEnvironment::createConstraint | ( | class PHY_IPhysicsController * | ctrl,
 |  | class PHY_IPhysicsController * | ctrl2,
 |  | PHY_ConstraintType | type,
 |  | float | pivotX,
 |  | float | pivotY,
 |  | float | pivotZ,
 |  | float | axisX,
 |  | float | axisY,
 |  | float | axisZ
 | ) | [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1138 of file CcdPhysicsEnvironment.cpp.

References ASSERT, SimdTransform::getBasis(), RigidBody::getCenterOfMassTransform(), CcdPhysicsController::GetRigidBody(), TypedConstraint::GetUserConstraintId(), SimdMatrix3x3::inverse(), SimdTransform::inverse(), m_constraints, m_wrapperVehicles, PHY_ANGULAR_CONSTRAINT, PHY_LINEHINGE_CONSTRAINT, PHY_POINT2POINT_CONSTRAINT, PHY_VEHICLE_CONSTRAINT, HingeConstraint::setAngularOnly(), TypedConstraint::SetUserConstraintId(), and TypedConstraint::SetUserConstraintType().

PHY_IPhysicsController * CcdPhysicsEnvironment::CreateSphereController | ( | float | radius,
 |  | const PHY__Vector3 & | position
 | ) | [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1637 of file CcdPhysicsEnvironment.cpp.

References CcdConstructionInfo::m_collisionFlags, CcdConstructionInfo::m_collisionShape, CcdConstructionInfo::m_MotionState, CcdConstructionInfo::m_physicsEnv, DefaultMotionState::m_worldTransform, CollisionObject::noContactResponse, SimdTransform::setIdentity(), and SimdTransform::setOrigin().

void CcdPhysicsEnvironment::EnableSatCollisionDetection ( bool enableSat ) [inline]

Definition at line 171 of file CcdPhysicsEnvironment.h.

References m_enableSatCollisionDetection.

virtual void CcdPhysicsEnvironment::endFrame ( ) [inline, virtual]

Definition at line 98 of file CcdPhysicsEnvironment.h.

BroadphaseInterface * CcdPhysicsEnvironment::GetBroadphase ( )

Definition at line 1346 of file CcdPhysicsEnvironment.cpp.

References CollisionWorld::GetBroadphase(), and m_collisionWorld.

Referenced by addCcdPhysicsController(), and UpdateAabbs().

TypedConstraint * CcdPhysicsEnvironment::getConstraintById ( int constraintId )

Definition at line 1402 of file CcdPhysicsEnvironment.cpp.

References TypedConstraint::GetUserConstraintId(), and m_constraints.

void CcdPhysicsEnvironment::getContactPoint | ( | int | i,
 |  | float & | hitX,
 |  | float & | hitY,
 |  | float & | hitZ,
 |  | float & | normalX,
 |  | float & | normalY,
 |  | float & | normalZ
 | ) | [virtual]

Definition at line 1338 of file CcdPhysicsEnvironment.cpp.

const CollisionDispatcher * CcdPhysicsEnvironment::GetDispatcher ( ) const

Definition at line 1353 of file CcdPhysicsEnvironment.cpp.

References CollisionWorld::GetDispatcher(), and m_collisionWorld.

CollisionDispatcher * CcdPhysicsEnvironment::GetDispatcher ( )

Definition at line 1358 of file CcdPhysicsEnvironment.cpp.

References CollisionWorld::GetDispatcher(), and m_collisionWorld.

Referenced by GetManifold(), and GetNumManifolds().

virtual float CcdPhysicsEnvironment::getFixedTimeStep ( ) [inline, virtual]

Definition at line 106 of file CcdPhysicsEnvironment.h.

const PersistentManifold * CcdPhysicsEnvironment::GetManifold ( int index ) const

Definition at line 1397 of file CcdPhysicsEnvironment.cpp.

References GetDispatcher(), and CollisionDispatcher::GetManifoldByIndexInternal().

int CcdPhysicsEnvironment::getNumContactPoints ( ) [virtual]

Definition at line 1333 of file CcdPhysicsEnvironment.cpp.

int CcdPhysicsEnvironment::GetNumControllers ( )

Definition at line 1380 of file CcdPhysicsEnvironment.cpp.

References m_controllers.

Referenced by proceedDeltaTimeOneStep().

int CcdPhysicsEnvironment::GetNumManifolds ( ) const

Definition at line 1392 of file CcdPhysicsEnvironment.cpp.

References GetDispatcher(), and CollisionDispatcher::GetNumManifolds().

CcdPhysicsController * CcdPhysicsEnvironment::GetPhysicsController ( int index )

Definition at line 1386 of file CcdPhysicsEnvironment.cpp.

References m_controllers.

virtual class PHY_IVehicle* CcdPhysicsEnvironment::getVehicleConstraint ( int constraintId ) [inline, virtual]

Definition at line 125 of file CcdPhysicsEnvironment.h.

Referenced by CallbackTriggers().

bool CcdPhysicsEnvironment::IsSatCollisionDetectionEnabled ( ) const [inline]

Definition at line 166 of file CcdPhysicsEnvironment.h.

References m_enableSatCollisionDetection.

bool CcdPhysicsEnvironment::proceedDeltaTime | ( | double | curTime,
 |  | float | timeStep
 | ) | [virtual]

Perform an integration step of duration 'timeStep'.

Implements PHY_IPhysicsEnvironment.

Definition at line 504 of file CcdPhysicsEnvironment.cpp.

References IDebugDraw::DBG_ProfileTimings, IDebugDraw::GetDebugMode(), m_debugDrawer, and m_profileTimings.

bool CcdPhysicsEnvironment::proceedDeltaTimeOneStep ( float timeStep )

Perform an integration step of duration 'timeStep'.

numsubstep,g);

solve all the contact points and contact friction

numsubstep,g);

Definition at line 591 of file CcdPhysicsEnvironment.cpp.

References RigidBody::applyForces(), IDebugDraw::DBG_NoDeactivation, gDisableDeactivation, CollisionObject::GetActivationState(), IDebugDraw::GetDebugMode(), GetNumControllers(), CcdPhysicsController::GetRigidBody(), RigidBody::integrateVelocities(), ISLAND_SLEEPING, CollisionObject::IsStatic(), m_controllers, m_debugDrawer, CollisionObject::m_interpolationWorldTransform, m_scalingPropagated, RigidBody::predictIntegratedTransform(), SimdFuzzyZero(), and SyncMotionStates().

PHY_IPhysicsController * CcdPhysicsEnvironment::rayTest | ( | PHY_IPhysicsController * | ignoreClient,
 |  | float | fromX,
 |  | float | fromY,
 |  | float | fromZ,
 |  | float | toX,
 |  | float | toY,
 |  | float | toZ,
 |  | float & | hitX,
 |  | float & | hitY,
 |  | float & | hitZ,
 |  | float & | normalX,
 |  | float & | normalY,
 |  | float & | normalZ
 | ) | [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1293 of file CcdPhysicsEnvironment.cpp.

References SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), CollisionWorld::RayResultCallback::HasHit(), CollisionWorld::ClosestRayResultCallback::m_collisionObject, m_collisionWorld, CollisionWorld::ClosestRayResultCallback::m_hitNormalWorld, CollisionWorld::ClosestRayResultCallback::m_hitPointWorld, CollisionObject::m_userPointer, and CollisionWorld::RayTest().

void CcdPhysicsEnvironment::removeCcdPhysicsController ( CcdPhysicsController * ctrl )

Definition at line 430 of file CcdPhysicsEnvironment.cpp.

References CcdPhysicsController::GetRigidBody(), TypedConstraint::GetRigidBodyA(), TypedConstraint::GetRigidBodyB(), TypedConstraint::GetUserConstraintId(), m_collisionWorld, m_constraints, m_controllers, m_triggerControllers, CollisionWorld::RemoveCollisionObject(), and removeConstraint().

Referenced by CcdPhysicsController::~CcdPhysicsController().

void CcdPhysicsEnvironment::removeCollisionCallback ( PHY_IPhysicsController * ctrl ) [virtual]

Definition at line 1433 of file CcdPhysicsEnvironment.cpp.

References m_triggerControllers.

Referenced by removeSensor().

void CcdPhysicsEnvironment::removeConstraint ( int constraintid ) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1245 of file CcdPhysicsEnvironment.cpp.

References TypedConstraint::GetUserConstraintId(), and m_constraints.

Referenced by removeCcdPhysicsController().

void CcdPhysicsEnvironment::removeSensor ( PHY_IPhysicsController * ctrl ) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1445 of file CcdPhysicsEnvironment.cpp.

References removeCollisionCallback().

void CcdPhysicsEnvironment::requestCollisionCallback ( PHY_IPhysicsController * ctrl ) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1482 of file CcdPhysicsEnvironment.cpp.

References m_triggerControllers.

Referenced by addSensor().

void CcdPhysicsEnvironment::setCcdMode ( int ccdMode ) [virtual]

Definition at line 966 of file CcdPhysicsEnvironment.cpp.

References m_ccdMode.

void CcdPhysicsEnvironment::setContactBreakingTreshold ( float contactBreakingTreshold ) [virtual]

Definition at line 959 of file CcdPhysicsEnvironment.cpp.

References gContactBreakingTreshold.

void CcdPhysicsEnvironment::setDeactivationAngularTreshold ( float angTresh ) [virtual]

Definition at line 955 of file CcdPhysicsEnvironment.cpp.

References gAngularSleepingTreshold.

void CcdPhysicsEnvironment::setDeactivationLinearTreshold ( float linTresh ) [virtual]

Definition at line 951 of file CcdPhysicsEnvironment.cpp.

References gLinearSleepingTreshold.

void CcdPhysicsEnvironment::setDeactivationTime ( float dTime ) [virtual]

Definition at line 947 of file CcdPhysicsEnvironment.cpp.

References gDeactivationTime.

virtual void CcdPhysicsEnvironment::setDebugDrawer ( IDebugDraw * debugDrawer ) [inline, virtual]

Perform an integration step of duration 'timeStep'.

Definition at line 75 of file CcdPhysicsEnvironment.h.

References m_debugDrawer.

void CcdPhysicsEnvironment::setDebugMode ( int debugMode ) [virtual]

Definition at line 936 of file CcdPhysicsEnvironment.cpp.

References m_debugDrawer, and IDebugDraw::SetDebugMode().

virtual void CcdPhysicsEnvironment::setFixedTimeStep | ( | bool | useFixedTimeStep,
 |  | float | fixedTimeStep
 | ) | [inline, virtual]

Definition at line 103 of file CcdPhysicsEnvironment.h.

void CcdPhysicsEnvironment::setGravity | ( | float | x,
 |  | float | y,
 |  | float | z
 | ) | [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 1048 of file CcdPhysicsEnvironment.cpp.

References CcdPhysicsController::GetRigidBody(), m_controllers, m_gravity, and RigidBody::setGravity().

void CcdPhysicsEnvironment::setLinearAirDamping ( float damping ) [virtual]

Definition at line 987 of file CcdPhysicsEnvironment.cpp.

References gLinearAirDamping.

void CcdPhysicsEnvironment::setNumIterations ( int numIter ) [virtual]

Definition at line 943 of file CcdPhysicsEnvironment.cpp.

References m_numIterations.

virtual void CcdPhysicsEnvironment::setNumTimeSubSteps ( int numTimeSubSteps ) [inline, virtual]

Definition at line 81 of file CcdPhysicsEnvironment.h.

References m_numTimeSubSteps.

void CcdPhysicsEnvironment::setSolverDamping ( float damping ) [virtual]

Definition at line 981 of file CcdPhysicsEnvironment.cpp.

References ContactSolverInfo::m_damping, and m_solverInfo.

void CcdPhysicsEnvironment::setSolverSorConstant ( float sor ) [virtual]

Definition at line 972 of file CcdPhysicsEnvironment.cpp.

References m_solverInfo, and ContactSolverInfo::m_sor.

void CcdPhysicsEnvironment::setSolverTau ( float tau ) [virtual]

Definition at line 977 of file CcdPhysicsEnvironment.cpp.

References m_solverInfo, and ContactSolverInfo::m_tau.

void CcdPhysicsEnvironment::setSolverType ( int solverType ) [virtual]

Definition at line 997 of file CcdPhysicsEnvironment.cpp.

References m_solver, and m_solverType.

void CcdPhysicsEnvironment::setUseEpa ( bool epa ) [virtual]

Definition at line 992 of file CcdPhysicsEnvironment.cpp.

References gUseEpa.

void CcdPhysicsEnvironment::SyncMotionStates ( float timeStep ) [private]

Definition at line 1031 of file CcdPhysicsEnvironment.cpp.

References m_controllers, and CcdPhysicsController::SynchronizeMotionStates().

Referenced by proceedDeltaTimeOneStep().

void CcdPhysicsEnvironment::UpdateAabbs ( float timeStep )

Definition at line 1560 of file CcdPhysicsEnvironment.cpp.

References ACTIVE_TAG, CollisionShape::CalculateTemporalAabb(), IDebugDraw::DBG_DrawAabb, DISABLE_DEACTIVATION, DrawAabb(), gContactBreakingTreshold, CollisionObject::GetActivationState(), GetBroadphase(), RigidBody::getCenterOfMassTransform(), CcdPhysicsController::GetCollisionShape(), IDebugDraw::GetDebugMode(), RigidBody::getLinearVelocity(), CcdPhysicsController::GetRigidBody(), CollisionObject::m_broadphaseHandle, m_controllers, m_debugDrawer, SimdQuadWord::setValue(), and WANTS_DEACTIVATION.

Member Data Documentation

int CcdPhysicsEnvironment::m_ccdMode [private]

Definition at line 56 of file CcdPhysicsEnvironment.h.

Referenced by setCcdMode().

class CollisionWorld* CcdPhysicsEnvironment::m_collisionWorld [private]

Definition at line 202 of file CcdPhysicsEnvironment.h.

Referenced by addCcdPhysicsController(), CallbackTriggers(), GetBroadphase(), GetDispatcher(), rayTest(), removeCcdPhysicsController(), and ~CcdPhysicsEnvironment().

std::vector<TypedConstraint*> CcdPhysicsEnvironment::m_constraints

Definition at line 186 of file CcdPhysicsEnvironment.h.

Referenced by createConstraint(), getConstraintById(), removeCcdPhysicsController(), and removeConstraint().

std::vector<CcdPhysicsController*> CcdPhysicsEnvironment::m_controllers [private]

Definition at line 193 of file CcdPhysicsEnvironment.h.

Referenced by addCcdPhysicsController(), addSensor(), GetNumControllers(), GetPhysicsController(), proceedDeltaTimeOneStep(), removeCcdPhysicsController(), setGravity(), SyncMotionStates(), and UpdateAabbs().

IDebugDraw* CcdPhysicsEnvironment::m_debugDrawer [private]

Definition at line 50 of file CcdPhysicsEnvironment.h.

Referenced by proceedDeltaTime(), proceedDeltaTimeOneStep(), setDebugDrawer(), setDebugMode(), and UpdateAabbs().

bool CcdPhysicsEnvironment::m_enableSatCollisionDetection [private]

Definition at line 59 of file CcdPhysicsEnvironment.h.

Referenced by EnableSatCollisionDetection(), and IsSatCollisionDetectionEnabled().

SimdVector3 CcdPhysicsEnvironment::m_gravity [private]

Definition at line 48 of file CcdPhysicsEnvironment.h.

Referenced by addCcdPhysicsController(), and setGravity().

int CcdPhysicsEnvironment::m_numIterations [private]

Definition at line 52 of file CcdPhysicsEnvironment.h.

Referenced by setNumIterations().

int CcdPhysicsEnvironment::m_numTimeSubSteps [private]

Definition at line 55 of file CcdPhysicsEnvironment.h.

Referenced by setNumTimeSubSteps().

int CcdPhysicsEnvironment::m_profileTimings [private]

Definition at line 58 of file CcdPhysicsEnvironment.h.

Referenced by proceedDeltaTime().

bool CcdPhysicsEnvironment::m_scalingPropagated [private]

Definition at line 206 of file CcdPhysicsEnvironment.h.

Referenced by proceedDeltaTimeOneStep().

class ConstraintSolver* CcdPhysicsEnvironment::m_solver [private]

Definition at line 204 of file CcdPhysicsEnvironment.h.

Referenced by setSolverType().

ContactSolverInfo CcdPhysicsEnvironment::m_solverInfo [private]

Definition at line 61 of file CcdPhysicsEnvironment.h.

Referenced by setSolverDamping(), setSolverSorConstant(), and setSolverTau().

int CcdPhysicsEnvironment::m_solverType [private]

Definition at line 57 of file CcdPhysicsEnvironment.h.

Referenced by setSolverType().

PHY_ResponseCallback CcdPhysicsEnvironment::m_triggerCallbacks[PHY_NUM_RESPONSE] [private]

Definition at line 197 of file CcdPhysicsEnvironment.h.

Referenced by addTouchCallback(), CallbackTriggers(), and CcdPhysicsEnvironment().

void* CcdPhysicsEnvironment::m_triggerCallbacksUserPtrs[PHY_NUM_RESPONSE] [private]

Definition at line 198 of file CcdPhysicsEnvironment.h.

Referenced by addTouchCallback(), and CallbackTriggers().

std::vector<CcdPhysicsController*> CcdPhysicsEnvironment::m_triggerControllers [private]

Definition at line 195 of file CcdPhysicsEnvironment.h.

Referenced by CallbackTriggers(), removeCcdPhysicsController(), removeCollisionCallback(), and requestCollisionCallback().

std::vector<WrapperVehicle*> CcdPhysicsEnvironment::m_wrapperVehicles [private]

Definition at line 200 of file CcdPhysicsEnvironment.h.

Referenced by CallbackTriggers(), createConstraint(), and ~CcdPhysicsEnvironment().

The documentation for this class was generated from the following files:
  • CcdPhysicsEnvironment.h
  • CcdPhysicsEnvironment.cpp
Generated on Wed May 24 14:00:03 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CcdPhysicsEnvironment Member List

This is the complete list of members for CcdPhysicsEnvironment, including all inherited members.

addCcdPhysicsController(CcdPhysicsController *ctrl) | CcdPhysicsEnvironment |
addSensor(PHY_IPhysicsController *ctrl) | CcdPhysicsEnvironment | [virtual]
addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user) | CcdPhysicsEnvironment | [virtual]
beginFrame() | CcdPhysicsEnvironment | [virtual]
CallbackTriggers() | CcdPhysicsEnvironment | [virtual]
CcdPhysicsEnvironment(CollisionDispatcher *dispatcher=0, BroadphaseInterface *broadphase=0) | CcdPhysicsEnvironment |
CreateConeController(float coneradius, float coneheight) | CcdPhysicsEnvironment | [virtual]
createConstraint(class PHY_IPhysicsController *ctrl, class PHY_IPhysicsController *ctrl2, PHY_ConstraintType type, float pivotX, float pivotY, float pivotZ, float axisX, float axisY, float axisZ) | CcdPhysicsEnvironment | [virtual]
CreateSphereController(float radius, const PHY__Vector3 &position) | CcdPhysicsEnvironment | [virtual]
EnableSatCollisionDetection(bool enableSat) | CcdPhysicsEnvironment | [inline]
endFrame() | CcdPhysicsEnvironment | [inline, virtual]
GetBroadphase() | CcdPhysicsEnvironment |
getConstraintById(int constraintId) | CcdPhysicsEnvironment |
getContactPoint(int i, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ) | CcdPhysicsEnvironment | [virtual]
GetDispatcher() | CcdPhysicsEnvironment |
GetDispatcher() const | CcdPhysicsEnvironment |
getFixedTimeStep() | CcdPhysicsEnvironment | [inline, virtual]
GetManifold(int index) const | CcdPhysicsEnvironment |
getNumContactPoints() | CcdPhysicsEnvironment | [virtual]
GetNumControllers() | CcdPhysicsEnvironment |
GetNumManifolds() const | CcdPhysicsEnvironment |
GetPhysicsController(int index) | CcdPhysicsEnvironment |
getVehicleConstraint(int constraintId) | CcdPhysicsEnvironment | [inline, virtual]
IsSatCollisionDetectionEnabled() const | CcdPhysicsEnvironment | [inline]
m_ccdMode | CcdPhysicsEnvironment | [private]
m_collisionWorld | CcdPhysicsEnvironment | [private]
m_constraints | CcdPhysicsEnvironment |
m_controllers | CcdPhysicsEnvironment | [private]
m_debugDrawer | CcdPhysicsEnvironment | [private]
m_enableSatCollisionDetection | CcdPhysicsEnvironment | [private]
m_gravity | CcdPhysicsEnvironment | [private]
m_numIterations | CcdPhysicsEnvironment | [private]
m_numTimeSubSteps | CcdPhysicsEnvironment | [private]
m_profileTimings | CcdPhysicsEnvironment | [private]
m_scalingPropagated | CcdPhysicsEnvironment | [private]
m_solver | CcdPhysicsEnvironment | [private]
m_solverInfo | CcdPhysicsEnvironment | [private]
m_solverType | CcdPhysicsEnvironment | [private]
m_triggerCallbacks | CcdPhysicsEnvironment | [private]
m_triggerCallbacksUserPtrs | CcdPhysicsEnvironment | [private]
m_triggerControllers | CcdPhysicsEnvironment | [private]
m_wrapperVehicles | CcdPhysicsEnvironment | [private]
proceedDeltaTime(double curTime, float timeStep) | CcdPhysicsEnvironment | [virtual]
proceedDeltaTimeOneStep(float timeStep) | CcdPhysicsEnvironment |
rayTest(PHY_IPhysicsController *ignoreClient, float fromX, float fromY, float fromZ, float toX, float toY, float toZ, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ) | CcdPhysicsEnvironment | [virtual]
removeCcdPhysicsController(CcdPhysicsController *ctrl) | CcdPhysicsEnvironment |
removeCollisionCallback(PHY_IPhysicsController *ctrl) | CcdPhysicsEnvironment | [virtual]
removeConstraint(int constraintid) | CcdPhysicsEnvironment | [virtual]
removeSensor(PHY_IPhysicsController *ctrl) | CcdPhysicsEnvironment | [virtual]
requestCollisionCallback(PHY_IPhysicsController *ctrl) | CcdPhysicsEnvironment | [virtual]
setCcdMode(int ccdMode) | CcdPhysicsEnvironment | [virtual]
setContactBreakingTreshold(float contactBreakingTreshold) | CcdPhysicsEnvironment | [virtual]
setDeactivationAngularTreshold(float angTresh) | CcdPhysicsEnvironment | [virtual]
setDeactivationLinearTreshold(float linTresh) | CcdPhysicsEnvironment | [virtual]
setDeactivationTime(float dTime) | CcdPhysicsEnvironment | [virtual]
setDebugDrawer(IDebugDraw *debugDrawer) | CcdPhysicsEnvironment | [inline, virtual]
setDebugMode(int debugMode) | CcdPhysicsEnvironment | [virtual]
setFixedTimeStep(bool useFixedTimeStep, float fixedTimeStep) | CcdPhysicsEnvironment | [inline, virtual]
setGravity(float x, float y, float z) | CcdPhysicsEnvironment | [virtual]
setLinearAirDamping(float damping) | CcdPhysicsEnvironment | [virtual]
setNumIterations(int numIter) | CcdPhysicsEnvironment | [virtual]
setNumTimeSubSteps(int numTimeSubSteps) | CcdPhysicsEnvironment | [inline, virtual]
setSolverDamping(float damping) | CcdPhysicsEnvironment | [virtual]
setSolverSorConstant(float sor) | CcdPhysicsEnvironment | [virtual]
setSolverTau(float tau) | CcdPhysicsEnvironment | [virtual]
setSolverType(int solverType) | CcdPhysicsEnvironment | [virtual]
setUseEpa(bool epa) | CcdPhysicsEnvironment | [virtual]
SyncMotionStates(float timeStep) | CcdPhysicsEnvironment | [private]
UpdateAabbs(float timeStep) | CcdPhysicsEnvironment |
~CcdPhysicsEnvironment() | CcdPhysicsEnvironment | [virtual]
~PHY_IPhysicsEnvironment() | PHY_IPhysicsEnvironment | [virtual]

Generated on Wed May 24 14:00:03 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithm Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionAlgorithm Class Reference

CollisionAlgorithm is an collision interface that is compatible with the Broadphase and Dispatcher. More...

#include <CollisionAlgorithm.h>

Inheritance diagram for CollisionAlgorithm:

[legend]
Collaboration diagram for CollisionAlgorithm:

[legend]
List of all members.

Public Member Functions

CollisionAlgorithm ()
CollisionAlgorithm (const CollisionAlgorithmConstructionInfo &ci)
virtual | ~CollisionAlgorithm ()
virtual void | ProcessCollision (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0
virtual float | CalculateTimeOfImpact (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0

Protected Member Functions

int | GetDispatcherId ()

Protected Attributes

Dispatcher * m_dispatcher

Detailed Description

CollisionAlgorithm is an collision interface that is compatible with the Broadphase and Dispatcher.

It is persistent over frames

Definition at line 42 of file CollisionAlgorithm.h.

Constructor & Destructor Documentation

CollisionAlgorithm::CollisionAlgorithm ( ) [inline]

Definition at line 54 of file CollisionAlgorithm.h.

CollisionAlgorithm::CollisionAlgorithm ( const CollisionAlgorithmConstructionInfo & ci )

Definition at line 19 of file CollisionAlgorithm.cpp.

References CollisionAlgorithmConstructionInfo::m_dispatcher, and m_dispatcher.

virtual CollisionAlgorithm::~CollisionAlgorithm ( ) [inline, virtual]

Definition at line 58 of file CollisionAlgorithm.h.

Member Function Documentation

virtual float CollisionAlgorithm::CalculateTimeOfImpact | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const struct DispatcherInfo & | dispatchInfo
 | ) | [pure virtual]

Referenced by SimpleBroadphase::DispatchAllCollisionPairs().

int CollisionAlgorithm::GetDispatcherId ( ) [protected]

virtual void CollisionAlgorithm::ProcessCollision | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const struct DispatcherInfo & | dispatchInfo
 | ) | [pure virtual]

Referenced by SimpleBroadphase::DispatchAllCollisionPairs().

Member Data Documentation

Dispatcher* CollisionAlgorithm::m_dispatcher [protected]

Definition at line 47 of file CollisionAlgorithm.h.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact(), CollisionAlgorithm(), ConvexConvexAlgorithm::ConvexConvexAlgorithm(), ConvexConvexAlgorithm::ProcessCollision(), ConvexConcaveCollisionAlgorithm::ProcessCollision(), and ConvexConvexAlgorithm::~ConvexConvexAlgorithm().

The documentation for this class was generated from the following files:
  • CollisionAlgorithm.h
  • CollisionAlgorithm.cpp
Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionAlgorithm Member List

This is the complete list of members for CollisionAlgorithm, including all inherited members.

CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
CollisionAlgorithm() | CollisionAlgorithm | [inline]
CollisionAlgorithm(const CollisionAlgorithmConstructionInfo &ci) | CollisionAlgorithm |
GetDispatcherId() | CollisionAlgorithm | [protected]
m_dispatcher | CollisionAlgorithm | [protected]
ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
~CollisionAlgorithm() | CollisionAlgorithm | [inline, virtual]

Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithmConstructionInfo Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionAlgorithmConstructionInfo Struct Reference

#include <CollisionAlgorithm.h>

Collaboration diagram for CollisionAlgorithmConstructionInfo:

[legend]
List of all members.

Public Member Functions

CollisionAlgorithmConstructionInfo ()
CollisionAlgorithmConstructionInfo (Dispatcher *dispatcher, int temp)
int GetDispatcherId ()

Public Attributes

Dispatcher * m_dispatcher

Detailed Description

Definition at line 22 of file CollisionAlgorithm.h.

Constructor & Destructor Documentation

CollisionAlgorithmConstructionInfo::CollisionAlgorithmConstructionInfo ( ) [inline]

Definition at line 24 of file CollisionAlgorithm.h.

CollisionAlgorithmConstructionInfo::CollisionAlgorithmConstructionInfo | ( | Dispatcher * | dispatcher,
 |  | int | temp
 | ) | [inline]

Definition at line 28 of file CollisionAlgorithm.h.

Member Function Documentation

int CollisionAlgorithmConstructionInfo::GetDispatcherId ( )

Member Data Documentation

Dispatcher* CollisionAlgorithmConstructionInfo::m_dispatcher

Definition at line 33 of file CollisionAlgorithm.h.

Referenced by CollisionAlgorithm::CollisionAlgorithm(), CollisionDispatcher::InternalFindAlgorithm(), and BoxTriangleCallback::ProcessTriangle().

The documentation for this struct was generated from the following file:
  • CollisionAlgorithm.h
Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionAlgorithmConstructionInfo Member List

This is the complete list of members for CollisionAlgorithmConstructionInfo, including all inherited members.

CollisionAlgorithmConstructionInfo() | CollisionAlgorithmConstructionInfo | [inline]
CollisionAlgorithmConstructionInfo(Dispatcher *dispatcher, int temp) | CollisionAlgorithmConstructionInfo | [inline]
GetDispatcherId() | CollisionAlgorithmConstructionInfo |
m_dispatcher | CollisionAlgorithmConstructionInfo |

Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionAlgorithmCreateFunc Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionAlgorithmCreateFunc Struct Reference

#include <CollisionDispatcher.h>

List of all members.

Public Member Functions

CollisionAlgorithmCreateFunc ()
virtual | ~CollisionAlgorithmCreateFunc ()
virtual CollisionAlgorithm * | CreateCollisionAlgorithm (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)

Public Attributes

bool | m_swapped

Detailed Description

Definition at line 32 of file CollisionDispatcher.h.

Constructor & Destructor Documentation

CollisionAlgorithmCreateFunc::CollisionAlgorithmCreateFunc ( ) [inline]

Definition at line 36 of file CollisionDispatcher.h.

virtual CollisionAlgorithmCreateFunc::~CollisionAlgorithmCreateFunc ( ) [inline, virtual]

Definition at line 40 of file CollisionDispatcher.h.

Member Function Documentation

virtual CollisionAlgorithm* CollisionAlgorithmCreateFunc::CreateCollisionAlgorithm | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) | [inline, virtual]

Definition at line 42 of file CollisionDispatcher.h.

Member Data Documentation

bool CollisionAlgorithmCreateFunc::m_swapped

Definition at line 34 of file CollisionDispatcher.h.

The documentation for this struct was generated from the following file:
  • CollisionDispatcher.h
Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionAlgorithmCreateFunc Member List

This is the complete list of members for CollisionAlgorithmCreateFunc, including all inherited members.

CollisionAlgorithmCreateFunc() | CollisionAlgorithmCreateFunc | [inline]
CreateCollisionAlgorithm(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1) | CollisionAlgorithmCreateFunc | [inline, virtual]
m_swapped | CollisionAlgorithmCreateFunc |
~CollisionAlgorithmCreateFunc() | CollisionAlgorithmCreateFunc | [inline, virtual]

Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionDispatcher Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionDispatcher Class Reference

CollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs. More...

#include <CollisionDispatcher.h>

Inheritance diagram for CollisionDispatcher:

[legend]
Collaboration diagram for CollisionDispatcher:

[legend]
List of all members.

Public Member Functions

UnionFind & GetUnionFind ()
int | GetNumManifolds () const
PersistentManifold * | GetManifoldByIndexInternal (int index)
const PersistentManifold * | GetManifoldByIndexInternal (int index) const
void | InitUnionFind (int n)
void | FindUnions ()
CollisionDispatcher ()
virtual | ~CollisionDispatcher ()
virtual PersistentManifold * | GetNewManifold (void *b0, void *b1)
virtual void | ReleaseManifold (PersistentManifold *manifold)
virtual void | BuildAndProcessIslands (int numBodies, IslandCallback *callback)
virtual ManifoldResult * | GetNewManifoldResult (CollisionObject *obj0, CollisionObject *obj1, PersistentManifold *manifold)
allows the user to get contact point callbacks
virtual void | ReleaseManifoldResult (ManifoldResult *)
allows the user to get contact point callbacks
virtual void | ClearManifold (PersistentManifold *manifold)
CollisionAlgorithm * | FindAlgorithm (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)
CollisionAlgorithm * | InternalFindAlgorithm (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)
virtual bool | NeedsCollision (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)
virtual bool | NeedsResponse (const CollisionObject &colObj0, const CollisionObject &colObj1)
virtual int | GetUniqueId ()

Public Attributes

int | m_count

Private Attributes

std::vector< PersistentManifold * > | m_manifoldsPtr
UnionFind m_unionFind
bool | m_useIslands
ManifoldResult m_defaultManifoldResult
CollisionAlgorithmCreateFunc * | m_doubleDispatch [MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]

Classes

struct | IslandCallback

Detailed Description

CollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs.

Time of Impact, Closest Points and Penetration Depth.

Definition at line 51 of file CollisionDispatcher.h.

Constructor & Destructor Documentation

CollisionDispatcher::CollisionDispatcher ( )

Definition at line 61 of file CollisionDispatcher.cpp.

References m_doubleDispatch, and MAX_BROADPHASE_COLLISION_TYPES.

virtual CollisionDispatcher::~CollisionDispatcher ( ) [inline, virtual]

Definition at line 102 of file CollisionDispatcher.h.

Member Function Documentation

void CollisionDispatcher::BuildAndProcessIslands | ( | int | numBodies,
 |  | IslandCallback * | callback
 | ) | [virtual]

Definition at line 125 of file CollisionDispatcher.cpp.

References ACTIVE_TAG, DISABLE_DEACTIVATION, PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), GetManifoldByIndexInternal(), GetNumManifolds(), ISLAND_SLEEPING, and NeedsResponse().

void CollisionDispatcher::ClearManifold ( PersistentManifold * manifold ) [virtual]

Implements Dispatcher.

Definition at line 93 of file CollisionDispatcher.cpp.

References PersistentManifold::ClearManifold().

Referenced by ReleaseManifold().

CollisionAlgorithm* CollisionDispatcher::FindAlgorithm | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) | [inline, virtual]

Implements Dispatcher.

Definition at line 120 of file CollisionDispatcher.h.

References InternalFindAlgorithm().

void CollisionDispatcher::FindUnions ( )

Definition at line 30 of file CollisionDispatcher.cpp.

References PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), GetManifoldByIndexInternal(), GetNumManifolds(), m_unionFind, m_useIslands, NeedsResponse(), and UnionFind::unite().

const PersistentManifold* CollisionDispatcher::GetManifoldByIndexInternal ( int index ) const [inline]

Definition at line 86 of file CollisionDispatcher.h.

References m_manifoldsPtr.

PersistentManifold* CollisionDispatcher::GetManifoldByIndexInternal ( int index ) [inline]

Definition at line 81 of file CollisionDispatcher.h.

References m_manifoldsPtr.

Referenced by BuildAndProcessIslands(), CcdPhysicsEnvironment::CallbackTriggers(), FindUnions(), and CcdPhysicsEnvironment::GetManifold().

PersistentManifold * CollisionDispatcher::GetNewManifold | ( | void * | b0,
 |  | void * | b1
 | ) | [virtual]

Implements Dispatcher.

Definition at line 79 of file CollisionDispatcher.cpp.

References gNumManifold, and m_manifoldsPtr.

ManifoldResult * CollisionDispatcher::GetNewManifoldResult | ( | CollisionObject * | obj0,
 |  | CollisionObject * | obj1,
 |  | PersistentManifold * | manifold
 | ) | [virtual]

allows the user to get contact point callbacks

Implements Dispatcher.

Definition at line 287 of file CollisionDispatcher.cpp.

References m_defaultManifoldResult.

int CollisionDispatcher::GetNumManifolds ( ) const [inline]

Definition at line 76 of file CollisionDispatcher.h.

References m_manifoldsPtr.

Referenced by BuildAndProcessIslands(), CcdPhysicsEnvironment::CallbackTriggers(), FindUnions(), and CcdPhysicsEnvironment::GetNumManifolds().

UnionFind& CollisionDispatcher::GetUnionFind ( ) [inline]

Definition at line 66 of file CollisionDispatcher.h.

References m_unionFind.

virtual int CollisionDispatcher::GetUniqueId ( ) [inline, virtual]

Implements Dispatcher.

Definition at line 132 of file CollisionDispatcher.h.

References RIGIDBODY_DISPATCHER.

void CollisionDispatcher::InitUnionFind ( int n ) [inline]

Definition at line 91 of file CollisionDispatcher.h.

References m_unionFind, m_useIslands, and UnionFind::reset().

Referenced by CollisionWorld::UpdateActivationState().

CollisionAlgorithm * CollisionDispatcher::InternalFindAlgorithm | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) |

Definition at line 226 of file CollisionDispatcher.cpp.

References CollisionShape::IsConvex(), BroadphaseProxy::m_clientObject, CollisionObject::m_collisionShape, and CollisionAlgorithmConstructionInfo::m_dispatcher.

Referenced by FindAlgorithm().

bool CollisionDispatcher::NeedsCollision | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) | [virtual]

Implements Dispatcher.

Definition at line 264 of file CollisionDispatcher.cpp.

References CollisionObject::GetActivationState(), CollisionObject::isStatic, BroadphaseProxy::m_clientObject, and CollisionObject::m_collisionFlags.

bool CollisionDispatcher::NeedsResponse | ( | const CollisionObject & | colObj0,
 |  | const CollisionObject & | colObj1
 | ) | [virtual]

Definition at line 255 of file CollisionDispatcher.cpp.

References CollisionObject::m_collisionFlags, and CollisionObject::noContactResponse.

Referenced by BuildAndProcessIslands(), and FindUnions().

void CollisionDispatcher::ReleaseManifold ( PersistentManifold * manifold ) [virtual]

Implements Dispatcher.

Definition at line 99 of file CollisionDispatcher.cpp.

References ClearManifold(), gNumManifold, and m_manifoldsPtr.

void CollisionDispatcher::ReleaseManifoldResult ( ManifoldResult * ) [virtual]

allows the user to get contact point callbacks

Implements Dispatcher.

Definition at line 297 of file CollisionDispatcher.cpp.

Member Data Documentation

int CollisionDispatcher::m_count

Definition at line 99 of file CollisionDispatcher.h.

ManifoldResult CollisionDispatcher::m_defaultManifoldResult [private]

Definition at line 60 of file CollisionDispatcher.h.

Referenced by GetNewManifoldResult().

CollisionAlgorithmCreateFunc* CollisionDispatcher::m_doubleDispatch[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES] [private]

Definition at line 62 of file CollisionDispatcher.h.

Referenced by CollisionDispatcher().

std::vector<PersistentManifold*> CollisionDispatcher::m_manifoldsPtr [private]

Definition at line 54 of file CollisionDispatcher.h.

Referenced by GetManifoldByIndexInternal(), GetNewManifold(), GetNumManifolds(), and ReleaseManifold().

UnionFind CollisionDispatcher::m_unionFind [private]

Definition at line 56 of file CollisionDispatcher.h.

Referenced by FindUnions(), GetUnionFind(), and InitUnionFind().

bool CollisionDispatcher::m_useIslands [private]

Definition at line 58 of file CollisionDispatcher.h.

Referenced by FindUnions(), and InitUnionFind().

The documentation for this class was generated from the following files:
  • CollisionDispatcher.h
  • CollisionDispatcher.cpp
Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionDispatcher Member List

This is the complete list of members for CollisionDispatcher, including all inherited members.

BuildAndProcessIslands(int numBodies, IslandCallback *callback) | CollisionDispatcher | [virtual]
ClearManifold(PersistentManifold *manifold) | CollisionDispatcher | [virtual]
CollisionDispatcher() | CollisionDispatcher |
FindAlgorithm(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1) | CollisionDispatcher | [inline, virtual]
FindUnions() | CollisionDispatcher |
GetManifoldByIndexInternal(int index) | CollisionDispatcher | [inline]
GetManifoldByIndexInternal(int index) const | CollisionDispatcher | [inline]
GetNewManifold(void *b0, void *b1) | CollisionDispatcher | [virtual]
GetNewManifoldResult(CollisionObject *obj0, CollisionObject *obj1, PersistentManifold *manifold) | CollisionDispatcher | [virtual]
GetNumManifolds() const | CollisionDispatcher | [inline]
GetUnionFind() | CollisionDispatcher | [inline]
GetUniqueId() | CollisionDispatcher | [inline, virtual]
InitUnionFind(int n) | CollisionDispatcher | [inline]
InternalFindAlgorithm(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1) | CollisionDispatcher |
m_count | CollisionDispatcher |
m_defaultManifoldResult | CollisionDispatcher | [private]
m_doubleDispatch | CollisionDispatcher | [private]
m_manifoldsPtr | CollisionDispatcher | [private]
m_unionFind | CollisionDispatcher | [private]
m_useIslands | CollisionDispatcher | [private]
NeedsCollision(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1) | CollisionDispatcher | [virtual]
NeedsResponse(const CollisionObject &colObj0, const CollisionObject &colObj1) | CollisionDispatcher | [virtual]
ReleaseManifold(PersistentManifold *manifold) | CollisionDispatcher | [virtual]
ReleaseManifoldResult(ManifoldResult *) | CollisionDispatcher | [virtual]
~CollisionDispatcher() | CollisionDispatcher | [inline, virtual]
~Dispatcher() | Dispatcher | [virtual]

Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionDispatcher::IslandCallback Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
CollisionDispatcher::IslandCallback

CollisionDispatcher::IslandCallback Struct Reference

#include <CollisionDispatcher.h>

List of all members.

Public Member Functions

virtual | ~IslandCallback ()
virtual void | ProcessIsland (PersistentManifold **manifolds, int numManifolds)=0

Detailed Description

Definition at line 68 of file CollisionDispatcher.h.

Constructor & Destructor Documentation

virtual CollisionDispatcher::IslandCallback::~IslandCallback ( ) [inline, virtual]

Definition at line 70 of file CollisionDispatcher.h.

Member Function Documentation

virtual void CollisionDispatcher::IslandCallback::ProcessIsland | ( | PersistentManifold ** | manifolds,
 |  | int | numManifolds
 | ) | [pure virtual]

The documentation for this struct was generated from the following file:
  • CollisionDispatcher.h
Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionDispatcher::IslandCallback Member List

This is the complete list of members for CollisionDispatcher::IslandCallback, including all inherited members.

ProcessIsland(PersistentManifold **manifolds, int numManifolds)=0 | CollisionDispatcher::IslandCallback | [pure virtual]
~IslandCallback() | CollisionDispatcher::IslandCallback | [inline, virtual]

Generated on Wed May 24 14:00:04 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionObject Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionObject Struct Reference

CollisionObject can be used to manage collision detection objects. More...

#include <CollisionObject.h>

Inheritance diagram for CollisionObject:

[legend]
Collaboration diagram for CollisionObject:

[legend]
List of all members.

Public Types

enum CollisionFlags {
isStatic = 1,
noContactResponse = 2
}

Public Member Functions

bool | mergesSimulationIslands () const
bool | IsStatic () const
bool | HasContactResponse ()
CollisionObject ()
void | SetCollisionShape (CollisionShape *collisionShape)
int | GetActivationState () const
void | SetActivationState (int newState)
void | ForceActivationState (int newState)
void | activate ()

Public Attributes

SimdTransform m_worldTransform
SimdTransform m_interpolationWorldTransform
int | m_collisionFlags
int | m_islandTag1
int | m_activationState1
float | m_deactivationTime
BroadphaseProxy * m_broadphaseHandle
CollisionShape * m_collisionShape
void * | m_userPointer
float | m_hitFraction
time of impact calculation
float | m_ccdSweptShereRadius
Swept sphere radius (0.0 by default), see ConvexConvexAlgorithm::.
float | m_ccdSquareMotionTreshold
Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionTreshold.

Detailed Description

CollisionObject can be used to manage collision detection objects.

CollisionObject maintains all information that is needed for a collision detection: Shape, Transform and AABB proxy. They can be added to the CollisionWorld.

Definition at line 33 of file CollisionObject.h.

Member Enumeration Documentation

enum CollisionObject::CollisionFlags

Enumerator:
isStatic
noContactResponse

Definition at line 41 of file CollisionObject.h.

Constructor & Destructor Documentation

CollisionObject::CollisionObject ( )

Definition at line 18 of file CollisionObject.cpp.

Referenced by HasContactResponse().

Member Function Documentation

void CollisionObject::activate ( )

Definition at line 43 of file CollisionObject.cpp.

References isStatic, m_collisionFlags, m_deactivationTime, and SetActivationState().

Referenced by CcdPhysicsController::applyImpulse(), CcdPhysicsController::RelativeRotate(), CcdPhysicsController::RelativeTranslate(), CcdPhysicsController::SetAngularVelocity(), CcdPhysicsController::SetLinearVelocity(), CcdPhysicsController::setOrientation(), and CcdPhysicsController::setPosition().

void CollisionObject::ForceActivationState ( int newState )

Definition at line 38 of file CollisionObject.cpp.

References m_activationState1.

int CollisionObject::GetActivationState ( ) const [inline]

Definition at line 89 of file CollisionObject.h.

References m_activationState1.

Referenced by CollisionDispatcher::NeedsCollision(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), CcdPhysicsEnvironment::UpdateAabbs(), CcdPhysicsController::UpdateDeactivation(), and CcdPhysicsController::wantsSleeping().

bool CollisionObject::HasContactResponse ( ) [inline]

Definition at line 74 of file CollisionObject.h.

References CollisionObject(), m_collisionFlags, and noContactResponse.

bool CollisionObject::IsStatic ( ) const [inline]

Definition at line 70 of file CollisionObject.h.

References isStatic, and m_collisionFlags.

Referenced by RigidBody::applyForces(), RigidBody::applyTorqueImpulse(), RigidBody::integrateVelocities(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), RigidBody::setAngularVelocity(), and CcdPhysicsController::SynchronizeMotionStates().

bool CollisionObject::mergesSimulationIslands ( ) const

Definition at line 52 of file CollisionObject.cpp.

References isStatic, and m_collisionFlags.

void CollisionObject::SetActivationState ( int newState )

Definition at line 32 of file CollisionObject.cpp.

References DISABLE_DEACTIVATION, and m_activationState1.

Referenced by activate(), and CcdPhysicsController::UpdateDeactivation().

void CollisionObject::SetCollisionShape ( CollisionShape * collisionShape ) [inline]

Definition at line 84 of file CollisionObject.h.

References m_collisionShape.

Member Data Documentation

int CollisionObject::m_activationState1

Definition at line 51 of file CollisionObject.h.

Referenced by ForceActivationState(), GetActivationState(), and SetActivationState().

BroadphaseProxy* CollisionObject::m_broadphaseHandle

Definition at line 54 of file CollisionObject.h.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CollisionWorld::AddCollisionObject(), CollisionWorld::RemoveCollisionObject(), CcdPhysicsEnvironment::UpdateAabbs(), and CollisionWorld::~CollisionWorld().

float CollisionObject::m_ccdSquareMotionTreshold

Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionTreshold.

Definition at line 66 of file CollisionObject.h.

float CollisionObject::m_ccdSweptShereRadius

Swept sphere radius (0.0 by default), see ConvexConvexAlgorithm::.

Definition at line 63 of file CollisionObject.h.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact().

int CollisionObject::m_collisionFlags

Definition at line 48 of file CollisionObject.h.

Referenced by activate(), CcdPhysicsController::CreateRigidbody(), HasContactResponse(), IsStatic(), mergesSimulationIslands(), CollisionDispatcher::NeedsCollision(), CollisionDispatcher::NeedsResponse(), and RigidBody::setMassProps().

CollisionShape* CollisionObject::m_collisionShape

Definition at line 55 of file CollisionObject.h.

Referenced by CollisionWorld::AddCollisionObject(), CcdPhysicsController::CreateRigidbody(), RigidBody::GetCollisionShape(), CollisionDispatcher::InternalFindAlgorithm(), ConvexConvexAlgorithm::ProcessCollision(), ConvexConcaveCollisionAlgorithm::ProcessCollision(), BoxTriangleCallback::ProcessTriangle(), CollisionWorld::RayTest(), SetCollisionShape(), and BoxTriangleCallback::SetTimeStepAndCounters().

float CollisionObject::m_deactivationTime

Definition at line 52 of file CollisionObject.h.

Referenced by activate(), CcdPhysicsController::UpdateDeactivation(), and CcdPhysicsController::wantsSleeping().

float CollisionObject::m_hitFraction

time of impact calculation

Definition at line 60 of file CollisionObject.h.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact(), ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), and CollisionWorld::UpdateActivationState().

SimdTransform CollisionObject::m_interpolationWorldTransform

Definition at line 39 of file CollisionObject.h.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact(), ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), and RigidBody::saveKinematicState().

int CollisionObject::m_islandTag1

Definition at line 50 of file CollisionObject.h.

Referenced by CollisionWorld::UpdateActivationState().

void* CollisionObject::m_userPointer

Definition at line 57 of file CollisionObject.h.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), FilterClosestRayResultCallback::AddSingleResult(), CcdPhysicsEnvironment::CallbackTriggers(), and CcdPhysicsEnvironment::rayTest().

SimdTransform CollisionObject::m_worldTransform

Definition at line 35 of file CollisionObject.h.

Referenced by CollisionWorld::AddCollisionObject(), ManifoldResult::AddContactPoint(), CollisionWorld::ClosestRayResultCallback::AddSingleResult(), ConvexConvexAlgorithm::CalculateTimeOfImpact(), ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), RigidBody::getAabb(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), RigidBody::getOrientation(), RigidBody::predictIntegratedTransform(), ConvexConvexAlgorithm::ProcessCollision(), CollisionWorld::RayTest(), RigidBody::RigidBody(), RigidBody::saveKinematicState(), RigidBody::setCenterOfMassTransform(), BoxTriangleCallback::SetTimeStepAndCounters(), RigidBody::translate(), and RigidBody::updateInertiaTensor().

The documentation for this struct was generated from the following files:
  • CollisionObject.h
  • CollisionObject.cpp
Generated on Wed May 24 14:00:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionObject Member List

This is the complete list of members for CollisionObject, including all inherited members.

activate() | CollisionObject |
CollisionFlags enum name | CollisionObject |
CollisionObject() | CollisionObject |
ForceActivationState(int newState) | CollisionObject |
GetActivationState() const | CollisionObject | [inline]
HasContactResponse() | CollisionObject | [inline]
isStatic enum value | CollisionObject |
IsStatic() const | CollisionObject | [inline]
m_activationState1 | CollisionObject |
m_broadphaseHandle | CollisionObject |
m_ccdSquareMotionTreshold | CollisionObject |
m_ccdSweptShereRadius | CollisionObject |
m_collisionFlags | CollisionObject |
m_collisionShape | CollisionObject |
m_deactivationTime | CollisionObject |
m_hitFraction | CollisionObject |
m_interpolationWorldTransform | CollisionObject |
m_islandTag1 | CollisionObject |
m_userPointer | CollisionObject |
m_worldTransform | CollisionObject |
mergesSimulationIslands() const | CollisionObject |
noContactResponse enum value | CollisionObject |
SetActivationState(int newState) | CollisionObject |
SetCollisionShape(CollisionShape *collisionShape) | CollisionObject | [inline]

Generated on Wed May 24 14:00:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionShape Class Reference

CollisionShape provides generic interface for collidable objects. More...

#include <CollisionShape.h>

Inheritance diagram for CollisionShape:

[legend]
List of all members.

Public Member Functions

CollisionShape ()
virtual | ~CollisionShape ()
virtual void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const =0
virtual void | GetBoundingSphere (SimdVector3 &center, SimdScalar &radius) const
virtual float | GetAngularMotionDisc () const
virtual int | GetShapeType () const =0
void | CalculateTemporalAabb (const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax)
CalculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0.
bool | IsPolyhedral () const
bool | IsConvex () const
bool | IsConcave () const
virtual void | setLocalScaling (const SimdVector3 &scaling)=0
virtual const SimdVector3 & | getLocalScaling () const =0
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)=0
virtual char * | GetName () const =0
const char * | GetExtraDebugInfo () const
void | SetExtraDebugInfo (const char *extraDebugInfo)
virtual void | SetMargin (float margin)=0
virtual float | GetMargin () const =0

Public Attributes

const char * | m_tempDebug

Detailed Description

CollisionShape provides generic interface for collidable objects.

Definition at line 26 of file CollisionShape.h.

Constructor & Destructor Documentation

CollisionShape::CollisionShape ( ) [inline]

Definition at line 31 of file CollisionShape.h.

virtual CollisionShape::~CollisionShape ( ) [inline, virtual]

Definition at line 35 of file CollisionShape.h.

Member Function Documentation

virtual void CollisionShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [pure virtual]

Implemented in BoxShape, ConeShape, EmptyShape, MinkowskiSumShape, MultiSphereShape, PolyhedralConvexShape, SphereShape, TriangleMeshShape, and TriangleShape.

Referenced by CcdPhysicsController::setScaling().

void CollisionShape::CalculateTemporalAabb | ( | const SimdTransform & | curTrans,
 |  | const SimdVector3 & | linvel,
 |  | const SimdVector3 & | angvel,
 |  | SimdScalar | timeStep,
 |  | SimdVector3 & | temporalAabbMin,
 |  | SimdVector3 & | temporalAabbMax
 | ) |

CalculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0.

.timeStep) result is conservative

Definition at line 39 of file CollisionShape.cpp.

References GetAabb(), GetAngularMotionDisc(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), SimdVector3::length(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by CcdPhysicsEnvironment::UpdateAabbs().

virtual void CollisionShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [pure virtual]

Implemented in BoxShape, ConvexShape, CylinderShape, EmptyShape, SphereShape, TriangleMeshShape, and TriangleShape.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CollisionWorld::AddCollisionObject(), CalculateTemporalAabb(), RigidBody::getAabb(), GetBoundingSphere(), CollisionWorld::RayTest(), and BoxTriangleCallback::SetTimeStepAndCounters().

float CollisionShape::GetAngularMotionDisc ( ) const [virtual]

Definition at line 30 of file CollisionShape.cpp.

References GetBoundingSphere(), and length().

Referenced by ContinuousConvexCollision::calcTimeOfImpact(), and CalculateTemporalAabb().

void CollisionShape::GetBoundingSphere | ( | SimdVector3 & | center,
 |  | SimdScalar & | radius
 | ) | const [virtual]

Definition at line 18 of file CollisionShape.cpp.

References GetAabb(), length(), and SimdTransform::setIdentity().

Referenced by GetAngularMotionDisc().

const char* CollisionShape::GetExtraDebugInfo ( ) const [inline]

Definition at line 73 of file CollisionShape.h.

References m_tempDebug.

virtual const SimdVector3& CollisionShape::getLocalScaling ( ) const [pure virtual]

Implemented in ConvexShape, EmptyShape, and TriangleMeshShape.

virtual float CollisionShape::GetMargin ( ) const [pure virtual]

Implemented in ConvexShape, EmptyShape, MinkowskiSumShape, SphereShape, and TriangleMeshShape.

virtual char* CollisionShape::GetName ( ) const [pure virtual]

Implemented in BoxShape, BvhTriangleMeshShape, ConeShape, ConvexHullShape, EmptyShape, MinkowskiSumShape, MultiSphereShape, BU_Simplex1to4, SphereShape, TriangleMeshShape, and TriangleShape.

virtual int CollisionShape::GetShapeType ( ) const [pure virtual]

Implemented in BoxShape, ConeShape, ConvexHullShape, CylinderShape, EmptyShape, MinkowskiSumShape, MultiSphereShape, BU_Simplex1to4, SphereShape, TriangleMeshShape, and TriangleShape.

Referenced by CollisionWorld::AddCollisionObject(), CcdPhysicsController::GetReplica(), IsConcave(), IsConvex(), and IsPolyhedral().

bool CollisionShape::IsConcave ( ) const [inline]

Definition at line 60 of file CollisionShape.h.

References CONCAVE_SHAPES_START_HERE, and GetShapeType().

bool CollisionShape::IsConvex ( ) const [inline]

Definition at line 56 of file CollisionShape.h.

References CONCAVE_SHAPES_START_HERE, and GetShapeType().

Referenced by CollisionDispatcher::InternalFindAlgorithm(), ConvexConcaveCollisionAlgorithm::ProcessCollision(), BoxTriangleCallback::ProcessTriangle(), and CollisionWorld::RayTest().

bool CollisionShape::IsPolyhedral ( ) const [inline]

Definition at line 51 of file CollisionShape.h.

References GetShapeType(), and IMPLICIT_CONVEX_SHAPES_START_HERE.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

void CollisionShape::SetExtraDebugInfo ( const char * extraDebugInfo ) [inline]

Definition at line 74 of file CollisionShape.h.

References m_tempDebug.

virtual void CollisionShape::setLocalScaling ( const SimdVector3 & scaling ) [pure virtual]

Implemented in BvhTriangleMeshShape, ConvexShape, EmptyShape, and TriangleMeshShape.

Referenced by CcdPhysicsController::setScaling(), and CcdPhysicsController::SynchronizeMotionStates().

virtual void CollisionShape::SetMargin ( float margin ) [pure virtual]

Implemented in ConvexShape, EmptyShape, SphereShape, and TriangleMeshShape.

Member Data Documentation

const char* CollisionShape::m_tempDebug

Definition at line 75 of file CollisionShape.h.

Referenced by GetExtraDebugInfo(), and SetExtraDebugInfo().

The documentation for this class was generated from the following files:
  • CollisionShape.h
  • CollisionShape.cpp
Generated on Wed May 24 14:00:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionShape Member List

This is the complete list of members for CollisionShape, including all inherited members.

CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia)=0 | CollisionShape | [pure virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const =0 | CollisionShape | [pure virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const =0 | CollisionShape | [pure virtual]
GetMargin() const =0 | CollisionShape | [pure virtual]
GetName() const =0 | CollisionShape | [pure virtual]
GetShapeType() const =0 | CollisionShape | [pure virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
m_tempDebug | CollisionShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling)=0 | CollisionShape | [pure virtual]
SetMargin(float margin)=0 | CollisionShape | [pure virtual]
~CollisionShape() | CollisionShape | [inline, virtual]

Generated on Wed May 24 14:00:05 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CollisionWorld Class Reference

CollisionWorld is interface and container for the collision detection. More...

#include <CollisionWorld.h>

Collaboration diagram for CollisionWorld:

[legend]
List of all members.

Public Member Functions

CollisionWorld (CollisionDispatcher *dispatcher, BroadphaseInterface *broadphase)
virtual | ~CollisionWorld ()
virtual void | UpdateActivationState ()
BroadphaseInterface * GetBroadphase ()
CollisionDispatcher * GetDispatcher ()
int | GetNumCollisionObjects () const
void | RayTest (const SimdVector3 &rayFromWorld, const SimdVector3 &rayToWorld, RayResultCallback &resultCallback)
void | AddCollisionObject (CollisionObject *collisionObject)
void | RemoveCollisionObject (CollisionObject *collisionObject)
virtual void | PerformDiscreteCollisionDetection ()

Private Attributes

std::vector< CollisionObject * > | m_collisionObjects
CollisionDispatcher * m_dispatcher
BroadphaseInterface * m_broadphase

Classes

struct | ClosestRayResultCallback
struct | LocalRayResult
struct | LocalShapeInfo
LocalShapeInfo gives extra information for complex shapes Currently, only TriangleMeshShape is available, so it just contains triangleIndex and subpart. More...
struct | RayResultCallback
RayResultCallback is used to report new raycast results. More...

Detailed Description

CollisionWorld is interface and container for the collision detection.

Definition at line 74 of file CollisionWorld.h.

Constructor & Destructor Documentation

CollisionWorld::CollisionWorld | ( | CollisionDispatcher * | dispatcher,
 |  | BroadphaseInterface * | broadphase
 | ) | [inline]

Definition at line 87 of file CollisionWorld.h.

CollisionWorld::~CollisionWorld ( ) [virtual]

Definition at line 30 of file CollisionWorld.cpp.

References BroadphaseInterface::CleanProxyFromPairs(), BroadphaseInterface::DestroyProxy(), GetBroadphase(), CollisionObject::m_broadphaseHandle, and m_collisionObjects.

Member Function Documentation

void CollisionWorld::AddCollisionObject ( CollisionObject * collisionObject )

Definition at line 108 of file CollisionWorld.cpp.

References BroadphaseInterface::CreateProxy(), CollisionShape::GetAabb(), GetBroadphase(), CollisionShape::GetShapeType(), CollisionObject::m_broadphaseHandle, m_collisionObjects, CollisionObject::m_collisionShape, and CollisionObject::m_worldTransform.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController().

BroadphaseInterface* CollisionWorld::GetBroadphase ( ) [inline]

Definition at line 97 of file CollisionWorld.h.

References m_broadphase.

Referenced by AddCollisionObject(), CcdPhysicsEnvironment::GetBroadphase(), RemoveCollisionObject(), and ~CollisionWorld().

CollisionDispatcher* CollisionWorld::GetDispatcher ( ) [inline]

Definition at line 102 of file CollisionWorld.h.

References m_dispatcher.

Referenced by CcdPhysicsEnvironment::CallbackTriggers(), and CcdPhysicsEnvironment::GetDispatcher().

int CollisionWorld::GetNumCollisionObjects ( ) const [inline]

Definition at line 190 of file CollisionWorld.h.

References m_collisionObjects.

void CollisionWorld::PerformDiscreteCollisionDetection ( ) [virtual]

Definition at line 132 of file CollisionWorld.cpp.

References m_broadphase, m_collisionObjects, DispatcherInfo::m_stepCount, DispatcherInfo::m_timeStep, and BroadphaseInterface::SetAabb().

void CollisionWorld::RayTest | ( | const SimdVector3 & | rayFromWorld,
 |  | const SimdVector3 & | rayToWorld,
 |  | RayResultCallback & | resultCallback
 | ) |

brute force go over all objects. Once there is a broadphase, use that, or add a raycast against aabb first.

Definition at line 182 of file CollisionWorld.cpp.

References CollisionWorld::RayResultCallback::AddSingleResult(), SubsimplexConvexCast::calcTimeOfImpact(), CollisionShape::GetAabb(), CollisionShape::IsConvex(), CollisionWorld::RayResultCallback::m_closestHitFraction, m_collisionObjects, CollisionObject::m_collisionShape, CollisionObject::m_worldTransform, SimdTransform::setIdentity(), SimdQuadWord::setMax(), SimdQuadWord::setMin(), SimdTransform::setOrigin(), and TestAabbAgainstAabb2().

Referenced by CcdPhysicsEnvironment::rayTest().

void CollisionWorld::RemoveCollisionObject ( CollisionObject * collisionObject )

Definition at line 151 of file CollisionWorld.cpp.

References BroadphaseInterface::CleanProxyFromPairs(), BroadphaseInterface::DestroyProxy(), GetBroadphase(), CollisionObject::m_broadphaseHandle, and m_collisionObjects.

Referenced by CcdPhysicsEnvironment::removeCcdPhysicsController().

void CollisionWorld::UpdateActivationState ( ) [virtual]

Definition at line 55 of file CollisionWorld.cpp.

References CollisionDispatcher::InitUnionFind(), m_collisionObjects, m_dispatcher, CollisionObject::m_hitFraction, and CollisionObject::m_islandTag1.

Member Data Documentation

BroadphaseInterface* CollisionWorld::m_broadphase [private]

Definition at line 83 of file CollisionWorld.h.

Referenced by GetBroadphase(), and PerformDiscreteCollisionDetection().

std::vector<CollisionObject*> CollisionWorld::m_collisionObjects [private]

Definition at line 79 of file CollisionWorld.h.

Referenced by AddCollisionObject(), GetNumCollisionObjects(), PerformDiscreteCollisionDetection(), RayTest(), RemoveCollisionObject(), UpdateActivationState(), and ~CollisionWorld().

CollisionDispatcher* CollisionWorld::m_dispatcher [private]

Definition at line 81 of file CollisionWorld.h.

Referenced by GetDispatcher(), and UpdateActivationState().

The documentation for this class was generated from the following files:
  • CollisionWorld.h
  • CollisionWorld.cpp
Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionWorld Member List

This is the complete list of members for CollisionWorld, including all inherited members.

AddCollisionObject(CollisionObject *collisionObject) | CollisionWorld |
CollisionWorld(CollisionDispatcher *dispatcher, BroadphaseInterface *broadphase) | CollisionWorld | [inline]
GetBroadphase() | CollisionWorld | [inline]
GetDispatcher() | CollisionWorld | [inline]
GetNumCollisionObjects() const | CollisionWorld | [inline]
m_broadphase | CollisionWorld | [private]
m_collisionObjects | CollisionWorld | [private]
m_dispatcher | CollisionWorld | [private]
PerformDiscreteCollisionDetection() | CollisionWorld | [virtual]
RayTest(const SimdVector3 &rayFromWorld, const SimdVector3 &rayToWorld, RayResultCallback &resultCallback) | CollisionWorld |
RemoveCollisionObject(CollisionObject *collisionObject) | CollisionWorld |
UpdateActivationState() | CollisionWorld | [virtual]
~CollisionWorld() | CollisionWorld | [virtual]

Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld::ClosestRayResultCallback Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
CollisionWorld::ClosestRayResultCallback

CollisionWorld::ClosestRayResultCallback Struct Reference

#include <CollisionWorld.h>

Inheritance diagram for CollisionWorld::ClosestRayResultCallback:

[legend]
Collaboration diagram for CollisionWorld::ClosestRayResultCallback:

[legend]
List of all members.

Public Member Functions

ClosestRayResultCallback (SimdVector3 rayFromWorld, SimdVector3 rayToWorld)
virtual float | AddSingleResult (const LocalRayResult &rayResult)

Public Attributes

SimdVector3 m_rayFromWorld
SimdVector3 m_rayToWorld
SimdVector3 m_hitNormalWorld
SimdVector3 m_hitPointWorld
const CollisionObject * | m_collisionObject

Detailed Description

Definition at line 157 of file CollisionWorld.h.

Constructor & Destructor Documentation

CollisionWorld::ClosestRayResultCallback::ClosestRayResultCallback | ( | SimdVector3 | rayFromWorld,
 |  | SimdVector3 | rayToWorld
 | ) | [inline]

Definition at line 159 of file CollisionWorld.h.

Member Function Documentation

virtual float CollisionWorld::ClosestRayResultCallback::AddSingleResult ( const LocalRayResult & rayResult ) [inline, virtual]

Implements CollisionWorld::RayResultCallback.

Reimplemented in FilterClosestRayResultCallback.

Definition at line 173 of file CollisionWorld.h.

References SimdTransform::getBasis(), CollisionWorld::RayResultCallback::m_closestHitFraction, CollisionWorld::LocalRayResult::m_collisionObject, m_collisionObject, CollisionWorld::LocalRayResult::m_hitFraction, CollisionWorld::LocalRayResult::m_hitNormalLocal, m_hitNormalWorld, m_hitPointWorld, m_rayFromWorld, m_rayToWorld, CollisionObject::m_worldTransform, and SimdVector3::setInterpolate3().

Member Data Documentation

const CollisionObject* CollisionWorld::ClosestRayResultCallback::m_collisionObject

Definition at line 171 of file CollisionWorld.h.

Referenced by AddSingleResult(), and CcdPhysicsEnvironment::rayTest().

SimdVector3 CollisionWorld::ClosestRayResultCallback::m_hitNormalWorld

Definition at line 169 of file CollisionWorld.h.

Referenced by AddSingleResult(), and CcdPhysicsEnvironment::rayTest().

SimdVector3 CollisionWorld::ClosestRayResultCallback::m_hitPointWorld

Definition at line 170 of file CollisionWorld.h.

Referenced by AddSingleResult(), and CcdPhysicsEnvironment::rayTest().

SimdVector3 CollisionWorld::ClosestRayResultCallback::m_rayFromWorld

Definition at line 166 of file CollisionWorld.h.

Referenced by AddSingleResult().

SimdVector3 CollisionWorld::ClosestRayResultCallback::m_rayToWorld

Definition at line 167 of file CollisionWorld.h.

Referenced by AddSingleResult().

The documentation for this struct was generated from the following file:
  • CollisionWorld.h
Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionWorld::ClosestRayResultCallback Member List

This is the complete list of members for CollisionWorld::ClosestRayResultCallback, including all inherited members.

AddSingleResult(const LocalRayResult &rayResult) | CollisionWorld::ClosestRayResultCallback | [inline, virtual]
ClosestRayResultCallback(SimdVector3 rayFromWorld, SimdVector3 rayToWorld) | CollisionWorld::ClosestRayResultCallback | [inline]
HasHit() | CollisionWorld::RayResultCallback | [inline]
m_closestHitFraction | CollisionWorld::RayResultCallback |
m_collisionObject | CollisionWorld::ClosestRayResultCallback |
m_hitNormalWorld | CollisionWorld::ClosestRayResultCallback |
m_hitPointWorld | CollisionWorld::ClosestRayResultCallback |
m_rayFromWorld | CollisionWorld::ClosestRayResultCallback |
m_rayToWorld | CollisionWorld::ClosestRayResultCallback |
RayResultCallback() | CollisionWorld::RayResultCallback | [inline]
~RayResultCallback() | CollisionWorld::RayResultCallback | [inline, virtual]

Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld::LocalRayResult Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
CollisionWorld::LocalRayResult

CollisionWorld::LocalRayResult Struct Reference

#include <CollisionWorld.h>

Collaboration diagram for CollisionWorld::LocalRayResult:

[legend]
List of all members.

Public Member Functions

LocalRayResult (const CollisionObject *collisionObject, LocalShapeInfo *localShapeInfo, const SimdVector3 &hitNormalLocal, float hitFraction)

Public Attributes

const CollisionObject * | m_collisionObject
LocalShapeInfo * m_localShapeInfo
const SimdVector3 & | m_hitNormalLocal
float | m_hitFraction

Detailed Description

Definition at line 118 of file CollisionWorld.h.

Constructor & Destructor Documentation

CollisionWorld::LocalRayResult::LocalRayResult | ( | const CollisionObject * | collisionObject,
 |  | LocalShapeInfo * | localShapeInfo,
 |  | const SimdVector3 & | hitNormalLocal,
 |  | float | hitFraction
 | ) | [inline]

Definition at line 120 of file CollisionWorld.h.

Member Data Documentation

const CollisionObject* CollisionWorld::LocalRayResult::m_collisionObject

Definition at line 131 of file CollisionWorld.h.

Referenced by CollisionWorld::ClosestRayResultCallback::AddSingleResult(), and FilterClosestRayResultCallback::AddSingleResult().

float CollisionWorld::LocalRayResult::m_hitFraction

Definition at line 134 of file CollisionWorld.h.

Referenced by CollisionWorld::ClosestRayResultCallback::AddSingleResult().

const SimdVector3& CollisionWorld::LocalRayResult::m_hitNormalLocal

Definition at line 133 of file CollisionWorld.h.

Referenced by CollisionWorld::ClosestRayResultCallback::AddSingleResult().

LocalShapeInfo* CollisionWorld::LocalRayResult::m_localShapeInfo

Definition at line 132 of file CollisionWorld.h.

The documentation for this struct was generated from the following file:
  • CollisionWorld.h
Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionWorld::LocalRayResult Member List

This is the complete list of members for CollisionWorld::LocalRayResult, including all inherited members.

LocalRayResult(const CollisionObject *collisionObject, LocalShapeInfo *localShapeInfo, const SimdVector3 &hitNormalLocal, float hitFraction) | CollisionWorld::LocalRayResult | [inline]
m_collisionObject | CollisionWorld::LocalRayResult |
m_hitFraction | CollisionWorld::LocalRayResult |
m_hitNormalLocal | CollisionWorld::LocalRayResult |
m_localShapeInfo | CollisionWorld::LocalRayResult |

Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld::LocalShapeInfo Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
CollisionWorld::LocalShapeInfo

CollisionWorld::LocalShapeInfo Struct Reference

LocalShapeInfo gives extra information for complex shapes Currently, only TriangleMeshShape is available, so it just contains triangleIndex and subpart. More...

#include <CollisionWorld.h>

List of all members.

Public Attributes

int | m_shapePart
int | m_triangleIndex

Detailed Description

LocalShapeInfo gives extra information for complex shapes Currently, only TriangleMeshShape is available, so it just contains triangleIndex and subpart.

Definition at line 109 of file CollisionWorld.h.

Member Data Documentation

int CollisionWorld::LocalShapeInfo::m_shapePart

Definition at line 111 of file CollisionWorld.h.

int CollisionWorld::LocalShapeInfo::m_triangleIndex

Definition at line 112 of file CollisionWorld.h.

The documentation for this struct was generated from the following file:
  • CollisionWorld.h
Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionWorld::LocalShapeInfo Member List

This is the complete list of members for CollisionWorld::LocalShapeInfo, including all inherited members.

m_shapePart | CollisionWorld::LocalShapeInfo
m_triangleIndex | CollisionWorld::LocalShapeInfo

Generated on Wed May 24 14:00:06 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CollisionWorld::RayResultCallback Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
CollisionWorld::RayResultCallback

CollisionWorld::RayResultCallback Struct Reference

RayResultCallback is used to report new raycast results. More...

#include <CollisionWorld.h>

Inheritance diagram for CollisionWorld::RayResultCallback:

[legend]
List of all members.

Public Member Functions

virtual | ~RayResultCallback ()
bool | HasHit ()
RayResultCallback ()
virtual float | AddSingleResult (const LocalRayResult &rayResult)=0

Public Attributes

float | m_closestHitFraction

Detailed Description

RayResultCallback is used to report new raycast results.

Definition at line 139 of file CollisionWorld.h.

Constructor & Destructor Documentation

virtual CollisionWorld::RayResultCallback::~RayResultCallback ( ) [inline, virtual]

Definition at line 141 of file CollisionWorld.h.

CollisionWorld::RayResultCallback::RayResultCallback ( ) [inline]

Definition at line 150 of file CollisionWorld.h.

Member Function Documentation

virtual float CollisionWorld::RayResultCallback::AddSingleResult ( const LocalRayResult & rayResult ) [pure virtual]

Implemented in CollisionWorld::ClosestRayResultCallback, and FilterClosestRayResultCallback.

Referenced by CollisionWorld::RayTest().

bool CollisionWorld::RayResultCallback::HasHit ( ) [inline]

Definition at line 145 of file CollisionWorld.h.

References m_closestHitFraction.

Referenced by CcdPhysicsEnvironment::rayTest().

Member Data Documentation

float CollisionWorld::RayResultCallback::m_closestHitFraction

Definition at line 144 of file CollisionWorld.h.

Referenced by CollisionWorld::ClosestRayResultCallback::AddSingleResult(), FilterClosestRayResultCallback::AddSingleResult(), HasHit(), and CollisionWorld::RayTest().

The documentation for this struct was generated from the following file:
  • CollisionWorld.h
Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CollisionWorld::RayResultCallback Member List

This is the complete list of members for CollisionWorld::RayResultCallback, including all inherited members.

AddSingleResult(const LocalRayResult &rayResult)=0 | CollisionWorld::RayResultCallback | [pure virtual]
HasHit() | CollisionWorld::RayResultCallback | [inline]
m_closestHitFraction | CollisionWorld::RayResultCallback |
RayResultCallback() | CollisionWorld::RayResultCallback | [inline]
~RayResultCallback() | CollisionWorld::RayResultCallback | [inline, virtual]

Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConeShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConeShape Class Reference

implements cone shape interface More...

#include <ConeShape.h>

Inheritance diagram for ConeShape:

[legend]
Collaboration diagram for ConeShape:

[legend]
List of all members.

Public Member Functions

ConeShape (SimdScalar radius, SimdScalar height)
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
float | GetRadius () const
float | GetHeight () const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual int | GetShapeType () const
virtual char * | GetName () const

Private Member Functions

SimdVector3 | ConeLocalSupport (const SimdVector3 &v) const

Private Attributes

float | m_sinAngle
float | m_radius
float | m_height

Detailed Description

implements cone shape interface

Definition at line 23 of file ConeShape.h.

Constructor & Destructor Documentation

ConeShape::ConeShape | ( | SimdScalar | radius,
 |  | SimdScalar | height
 | ) |

Definition at line 25 of file ConeShape.cpp.

References m_height, m_radius, and m_sinAngle.

Member Function Documentation

void ConeShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Implements ConvexShape.

Definition at line 74 of file ConeShape.cpp.

References ConeLocalSupport().

virtual void ConeShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [inline, virtual]

Implements CollisionShape.

Definition at line 45 of file ConeShape.h.

References ConvexShape::GetAabb(), ConvexShape::GetMargin(), SimdTransform::setIdentity(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdVector3 ConeShape::ConeLocalSupport ( const SimdVector3 & v ) const [private]

Definition at line 34 of file ConeShape.cpp.

References coneindices, m_radius, m_sinAngle, SIMD_EPSILON, and SimdSqrt().

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), LocalGetSupportingVertex(), and LocalGetSupportingVertexWithoutMargin().

float ConeShape::GetHeight ( ) const [inline]

Definition at line 42 of file ConeShape.h.

References m_height.

virtual char* ConeShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 75 of file ConeShape.h.

float ConeShape::GetRadius ( ) const [inline]

Definition at line 41 of file ConeShape.h.

References m_radius.

virtual int ConeShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 73 of file ConeShape.h.

References CONE_SHAPE_PROXYTYPE.

SimdVector3 ConeShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [virtual]

Reimplemented from ConvexShape.

Definition at line 84 of file ConeShape.cpp.

References ConeLocalSupport(), ConvexShape::GetMargin(), SimdVector3::normalize(), SimdQuadWord::setValue(), and SIMD_EPSILON.

SimdVector3 ConeShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Implements ConvexShape.

Definition at line 69 of file ConeShape.cpp.

References ConeLocalSupport().

Member Data Documentation

float ConeShape::m_height [private]

Definition at line 29 of file ConeShape.h.

Referenced by ConeShape(), and GetHeight().

float ConeShape::m_radius [private]

Definition at line 28 of file ConeShape.h.

Referenced by ConeLocalSupport(), ConeShape(), and GetRadius().

float ConeShape::m_sinAngle [private]

Definition at line 27 of file ConeShape.h.

Referenced by ConeLocalSupport(), and ConeShape().

The documentation for this class was generated from the following files:
  • ConeShape.h
  • ConeShape.cpp
Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConeShape Member List

This is the complete list of members for ConeShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | ConeShape | [virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | ConeShape | [inline, virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConeLocalSupport(const SimdVector3 &v) const | ConeShape | [private]
ConeShape(SimdScalar radius, SimdScalar height) | ConeShape |
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
GetHeight() const | ConeShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | ConeShape | [inline, virtual]
GetRadius() const | ConeShape | [inline]
GetShapeType() const | ConeShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConeShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | ConeShape | [virtual]
m_height | ConeShape | [private]
m_localScaling | ConvexShape | [protected]
m_radius | ConeShape | [private]
m_sinAngle | ConeShape | [private]
m_tempDebug | CollisionShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConstraintPersistentData Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConstraintPersistentData Struct Reference

#include <ContactConstraint.h>

Collaboration diagram for ConstraintPersistentData:

[legend]
List of all members.

Public Member Functions

ConstraintPersistentData ()

Public Attributes

float | m_appliedImpulse
total applied impulse during most recent frame
float | m_prevAppliedImpulse
float | m_accumulatedTangentImpulse0
float | m_accumulatedTangentImpulse1
float | m_jacDiagABInv
float | m_jacDiagABInvTangent0
float | m_jacDiagABInvTangent1
int | m_persistentLifeTime
float | m_restitution
float | m_penetration
SimdVector3 m_frictionWorldTangential0
SimdVector3 m_frictionWorldTangential1

Detailed Description

Definition at line 27 of file ContactConstraint.h.

Constructor & Destructor Documentation

ConstraintPersistentData::ConstraintPersistentData ( ) [inline]

Definition at line 29 of file ContactConstraint.h.

Member Data Documentation

float ConstraintPersistentData::m_accumulatedTangentImpulse0

Definition at line 45 of file ContactConstraint.h.

Referenced by resolveSingleFriction(), and SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_accumulatedTangentImpulse1

Definition at line 46 of file ContactConstraint.h.

Referenced by resolveSingleFriction(), and SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_appliedImpulse

total applied impulse during most recent frame

Definition at line 43 of file ContactConstraint.h.

Referenced by resolveSingleCollision(), resolveSingleFriction(), and SimpleConstraintSolver::Solve().

SimdVector3 ConstraintPersistentData::m_frictionWorldTangential0

Definition at line 54 of file ContactConstraint.h.

Referenced by resolveSingleFriction(), and SimpleConstraintSolver::Solve().

SimdVector3 ConstraintPersistentData::m_frictionWorldTangential1

Definition at line 55 of file ContactConstraint.h.

Referenced by resolveSingleFriction(), and SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_jacDiagABInv

Definition at line 48 of file ContactConstraint.h.

Referenced by resolveSingleCollision(), and SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_jacDiagABInvTangent0

Definition at line 49 of file ContactConstraint.h.

Referenced by resolveSingleFriction(), and SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_jacDiagABInvTangent1

Definition at line 50 of file ContactConstraint.h.

Referenced by resolveSingleFriction(), and SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_penetration

Definition at line 53 of file ContactConstraint.h.

Referenced by resolveSingleCollision(), and SimpleConstraintSolver::Solve().

int ConstraintPersistentData::m_persistentLifeTime

Definition at line 51 of file ContactConstraint.h.

Referenced by SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_prevAppliedImpulse

Definition at line 44 of file ContactConstraint.h.

Referenced by SimpleConstraintSolver::Solve().

float ConstraintPersistentData::m_restitution

Definition at line 52 of file ContactConstraint.h.

Referenced by resolveSingleCollision(), and SimpleConstraintSolver::Solve().

The documentation for this struct was generated from the following file:
  • ContactConstraint.h
Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConstraintPersistentData Member List

This is the complete list of members for ConstraintPersistentData, including all inherited members.

ConstraintPersistentData() | ConstraintPersistentData | [inline]
m_accumulatedTangentImpulse0 | ConstraintPersistentData |
m_accumulatedTangentImpulse1 | ConstraintPersistentData |
m_appliedImpulse | ConstraintPersistentData |
m_frictionWorldTangential0 | ConstraintPersistentData |
m_frictionWorldTangential1 | ConstraintPersistentData |
m_jacDiagABInv | ConstraintPersistentData |
m_jacDiagABInvTangent0 | ConstraintPersistentData |
m_jacDiagABInvTangent1 | ConstraintPersistentData |
m_penetration | ConstraintPersistentData |
m_persistentLifeTime | ConstraintPersistentData |
m_prevAppliedImpulse | ConstraintPersistentData |
m_restitution | ConstraintPersistentData |

Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConstraintSetting Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConstraintSetting Struct Reference

#include <Point2PointConstraint.h>

List of all members.

Public Member Functions

ConstraintSetting ()

Public Attributes

float | m_tau
float | m_damping

Detailed Description

Definition at line 26 of file Point2PointConstraint.h.

Constructor & Destructor Documentation

ConstraintSetting::ConstraintSetting ( ) [inline]

Definition at line 28 of file Point2PointConstraint.h.

Member Data Documentation

float ConstraintSetting::m_damping

Definition at line 34 of file Point2PointConstraint.h.

Referenced by Point2PointConstraint::SolveConstraint().

float ConstraintSetting::m_tau

Definition at line 33 of file Point2PointConstraint.h.

Referenced by Point2PointConstraint::SolveConstraint().

The documentation for this struct was generated from the following file:
  • Point2PointConstraint.h
Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConstraintSetting Member List

This is the complete list of members for ConstraintSetting, including all inherited members.

ConstraintSetting() | ConstraintSetting | [inline]
m_damping | ConstraintSetting |
m_tau | ConstraintSetting |

Generated on Wed May 24 14:00:07 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConstraintSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConstraintSolver Class Reference

ConstraintSolver provides solver interface. More...

#include <ConstraintSolver.h>

Inheritance diagram for ConstraintSolver:

[legend]
List of all members.

Public Member Functions

virtual | ~ConstraintSolver ()
virtual float | SolveGroup (PersistentManifold **manifold, int numManifolds, const ContactSolverInfo &info, class IDebugDraw *debugDrawer=0)=0

Detailed Description

ConstraintSolver provides solver interface.

Definition at line 27 of file ConstraintSolver.h.

Constructor & Destructor Documentation

virtual ConstraintSolver::~ConstraintSolver ( ) [inline, virtual]

Definition at line 32 of file ConstraintSolver.h.

Member Function Documentation

virtual float ConstraintSolver::SolveGroup | ( | PersistentManifold ** | manifold,
 |  | int | numManifolds,
 |  | const ContactSolverInfo & | info,
 |  | class IDebugDraw * | debugDrawer = 0
 | ) | [pure virtual]

Implemented in OdeConstraintSolver, and SimpleConstraintSolver.

The documentation for this class was generated from the following file:
  • ConstraintSolver.h
Generated on Wed May 24 14:00:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConstraintSolver Member List

This is the complete list of members for ConstraintSolver, including all inherited members.

SolveGroup(PersistentManifold **manifold, int numManifolds, const ContactSolverInfo &info, class IDebugDraw *debugDrawer=0)=0 | ConstraintSolver | [pure virtual]
~ConstraintSolver() | ConstraintSolver | [inline, virtual]

Generated on Wed May 24 14:00:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactJoint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ContactJoint Class Reference

#include <ContactJoint.h>

Inheritance diagram for ContactJoint:

[legend]
Collaboration diagram for ContactJoint:

[legend]
List of all members.

Public Member Functions

ContactJoint ()
ContactJoint (PersistentManifold *manifold, int index, bool swap, RigidBody *body0, RigidBody *body1)
virtual void | GetInfo1 (Info1 *info)
virtual void | GetInfo2 (Info2 *info)

Private Attributes

PersistentManifold * m_manifold
int | m_index
bool | m_swapBodies
RigidBody * m_body0
RigidBody * m_body1

Detailed Description

Definition at line 23 of file ContactJoint.h.

Constructor & Destructor Documentation

ContactJoint::ContactJoint ( ) [inline]

Definition at line 34 of file ContactJoint.h.

ContactJoint::ContactJoint | ( | PersistentManifold * | manifold,
 |  | int | index,
 |  | bool | swap,
 |  | RigidBody * | body0,
 |  | RigidBody * | body1
 | ) |

Definition at line 24 of file ContactJoint.cpp.

Member Function Documentation

void ContactJoint::GetInfo1 ( Info1 * info ) [virtual]

Definition at line 36 of file ContactJoint.cpp.

References m_numRows.

void ContactJoint::GetInfo2 ( Info2 * info ) [virtual]

Definition at line 85 of file ContactJoint.cpp.

References dCROSS, dPlaneSpace1(), FRICTION_CONSTANT, RigidBody::getCenterOfMassPosition(), PersistentManifold::GetContactPoint(), ManifoldPoint::GetDistance(), RigidBody::getFriction(), ManifoldPoint::GetPositionWorldOnA(), ManifoldPoint::GetPositionWorldOnB(), m_body0, m_body1, m_index, m_manifold, ManifoldPoint::m_normalWorldOnB, m_numRows, and m_swapBodies.

Member Data Documentation

RigidBody* ContactJoint::m_body0 [private]

Definition at line 28 of file ContactJoint.h.

Referenced by GetInfo2().

RigidBody* ContactJoint::m_body1 [private]

Definition at line 29 of file ContactJoint.h.

Referenced by GetInfo2().

int ContactJoint::m_index [private]

Definition at line 26 of file ContactJoint.h.

Referenced by GetInfo2().

PersistentManifold* ContactJoint::m_manifold [private]

Definition at line 25 of file ContactJoint.h.

Referenced by GetInfo2().

bool ContactJoint::m_swapBodies [private]

Definition at line 27 of file ContactJoint.h.

Referenced by GetInfo2().

The documentation for this class was generated from the following files:
  • ContactJoint.h
  • ContactJoint.cpp
Generated on Wed May 24 14:00:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ContactJoint Member List

This is the complete list of members for ContactJoint, including all inherited members.

BU_Joint() | BU_Joint |
ContactJoint() | ContactJoint | [inline]
ContactJoint(PersistentManifold *manifold, int index, bool swap, RigidBody *body0, RigidBody *body1) | ContactJoint |
flags | BU_Joint |
GetInfo1(Info1 *info) | ContactJoint | [virtual]
BU_Joint::GetInfo1(Info1 *info)=0 | BU_Joint | [pure virtual]
GetInfo2(Info2 *info) | ContactJoint | [virtual]
BU_Joint::GetInfo2(Info2 *info)=0 | BU_Joint | [pure virtual]
lambda | BU_Joint |
m_body0 | ContactJoint | [private]
m_body1 | ContactJoint | [private]
m_index | ContactJoint | [private]
m_manifold | ContactJoint | [private]
m_swapBodies | ContactJoint | [private]
node | BU_Joint |
~BU_Joint() | BU_Joint | [virtual]

Generated on Wed May 24 14:00:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContactSolverInfo Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

ContactSolverInfo Struct Reference

#include <ContactSolverInfo.h>

List of all members.

Public Member Functions

ContactSolverInfo ()

Public Attributes

float | m_tau
float | m_damping
float | m_friction
float | m_timeStep
float | m_restitution
int | m_numIterations
float | m_maxErrorReduction
float | m_sor
float | m_erp

Detailed Description

Definition at line 20 of file ContactSolverInfo.h.

Constructor & Destructor Documentation

ContactSolverInfo::ContactSolverInfo ( ) [inline]

Definition at line 23 of file ContactSolverInfo.h.

References m_damping, m_erp, m_friction, m_maxErrorReduction, m_numIterations, m_restitution, m_sor, and m_tau.

Member Data Documentation

float ContactSolverInfo::m_damping

Definition at line 36 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo(), resolveSingleCollision(), resolveSingleFriction(), CcdPhysicsEnvironment::setSolverDamping(), and SimpleConstraintSolver::Solve().

float ContactSolverInfo::m_erp

Definition at line 43 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo(), and resolveSingleCollision().

float ContactSolverInfo::m_friction

Definition at line 37 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo().

float ContactSolverInfo::m_maxErrorReduction

Definition at line 41 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo(), and SolveInternal1().

int ContactSolverInfo::m_numIterations

Definition at line 40 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo(), SimpleConstraintSolver::SolveGroup(), and SolveInternal1().

float ContactSolverInfo::m_restitution

Definition at line 39 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo().

float ContactSolverInfo::m_sor

Definition at line 42 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo(), CcdPhysicsEnvironment::setSolverSorConstant(), and SolveInternal1().

float ContactSolverInfo::m_tau

Definition at line 35 of file ContactSolverInfo.h.

Referenced by ContactSolverInfo(), and CcdPhysicsEnvironment::setSolverTau().

float ContactSolverInfo::m_timeStep

Definition at line 38 of file ContactSolverInfo.h.

Referenced by resolveSingleCollision(), SimpleConstraintSolver::Solve(), and SolveInternal1().

The documentation for this struct was generated from the following file:
  • ContactSolverInfo.h
Generated on Wed May 24 14:00:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ContactSolverInfo Member List

This is the complete list of members for ContactSolverInfo, including all inherited members.

ContactSolverInfo() | ContactSolverInfo | [inline]
m_damping | ContactSolverInfo |
m_erp | ContactSolverInfo |
m_friction | ContactSolverInfo |
m_maxErrorReduction | ContactSolverInfo |
m_numIterations | ContactSolverInfo |
m_restitution | ContactSolverInfo |
m_sor | ContactSolverInfo |
m_tau | ContactSolverInfo |
m_timeStep | ContactSolverInfo |

Generated on Wed May 24 14:00:08 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ContinuousConvexCollision Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ContinuousConvexCollision Class Reference

ContinuousConvexCollision implements angular and linear time of impact for convex objects. More...

#include <ContinuousConvexCollision.h>

Inheritance diagram for ContinuousConvexCollision:

[legend]
Collaboration diagram for ContinuousConvexCollision:

[legend]
List of all members.

Public Member Functions

ContinuousConvexCollision (ConvexShape *shapeA, ConvexShape *shapeB, SimplexSolverInterface *simplexSolver, ConvexPenetrationDepthSolver *penetrationDepthSolver)
virtual bool | calcTimeOfImpact (const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)

Private Attributes

SimplexSolverInterface * | m_simplexSolver
ConvexPenetrationDepthSolver * m_penetrationDepthSolver
ConvexShape * m_convexA
ConvexShape * m_convexB

Detailed Description

ContinuousConvexCollision implements angular and linear time of impact for convex objects.

Based on Brian Mirtich's Conservative Advancement idea (PhD thesis). Algorithm operates in worldspace, in order to keep inbetween motion globally consistent. It uses GJK at the moment. Future improvement would use minkowski sum / supporting vertex, merging innerloops

Definition at line 29 of file ContinuousConvexCollision.h.

Constructor & Destructor Documentation

ContinuousConvexCollision::ContinuousConvexCollision | ( | ConvexShape * | shapeA,
 |  | ConvexShape * | shapeB,
 |  | SimplexSolverInterface * | simplexSolver,
 |  | ConvexPenetrationDepthSolver * | penetrationDepthSolver
 | ) |

Definition at line 29 of file ContinuousConvexCollision.cpp.

Member Function Documentation

bool ContinuousConvexCollision::calcTimeOfImpact | ( | const SimdTransform & | fromA,
 |  | const SimdTransform & | toA,
 |  | const SimdTransform & | fromB,
 |  | const SimdTransform & | toB,
 |  | CastResult & | result
 | ) | [virtual]

compute linear and angular velocity for this interval, to interpolate

Definition at line 40 of file ContinuousConvexCollision.cpp.

References SimdTransformUtil::CalculateVelocity(), dot(), CollisionShape::GetAngularMotionDisc(), GjkPairDetector::GetClosestPoints(), SimdTransformUtil::IntegrateTransform(), SimdTransform::inverseTimes(), SimdVector3::length(), m_convexA, m_convexB, PointCollector::m_distance, PointCollector::m_hasResult, PointCollector::m_normalOnBInWorld, m_penetrationDepthSolver, PointCollector::m_pointInWorld, m_simplexSolver, MAX_ITERATIONS, SimdTransform::setIdentity(), GjkPairDetector::SetIgnoreMargin(), SphereShape::SetMargin(), and SimdQuadWord::setValue().

Member Data Documentation

ConvexShape* ContinuousConvexCollision::m_convexA [private]

Definition at line 33 of file ContinuousConvexCollision.h.

Referenced by calcTimeOfImpact().

ConvexShape* ContinuousConvexCollision::m_convexB [private]

Definition at line 34 of file ContinuousConvexCollision.h.

Referenced by calcTimeOfImpact().

ConvexPenetrationDepthSolver* ContinuousConvexCollision::m_penetrationDepthSolver [private]

Definition at line 32 of file ContinuousConvexCollision.h.

Referenced by calcTimeOfImpact().

SimplexSolverInterface* ContinuousConvexCollision::m_simplexSolver [private]

Definition at line 31 of file ContinuousConvexCollision.h.

Referenced by calcTimeOfImpact().

The documentation for this class was generated from the following files:
  • ContinuousConvexCollision.h
  • ContinuousConvexCollision.cpp
Generated on Wed May 24 14:00:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ContinuousConvexCollision Member List

This is the complete list of members for ContinuousConvexCollision, including all inherited members.

calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result) | ContinuousConvexCollision | [virtual]
ConvexCast::calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)=0 | ConvexCast | [pure virtual]
ContinuousConvexCollision(ConvexShape *shapeA, ConvexShape *shapeB, SimplexSolverInterface *simplexSolver, ConvexPenetrationDepthSolver *penetrationDepthSolver) | ContinuousConvexCollision |
m_convexA | ContinuousConvexCollision | [private]
m_convexB | ContinuousConvexCollision | [private]
m_penetrationDepthSolver | ContinuousConvexCollision | [private]
m_simplexSolver | ContinuousConvexCollision | [private]
~ConvexCast() | ConvexCast | [virtual]

Generated on Wed May 24 14:00:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexCast Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConvexCast Class Reference

ConvexCast is an interface for Casting. More...

#include <ConvexCast.h>

Inheritance diagram for ConvexCast:

[legend]
List of all members.

Public Member Functions

virtual | ~ConvexCast ()
virtual bool | calcTimeOfImpact (const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)=0
cast a convex against another convex object

Classes

struct | CastResult
RayResult stores the closest result alternatively, add a callback method to decide about closest/all results. More...

Detailed Description

ConvexCast is an interface for Casting.

Definition at line 27 of file ConvexCast.h.

Constructor & Destructor Documentation

ConvexCast::~ConvexCast ( ) [virtual]

Definition at line 18 of file ConvexCast.cpp.

Member Function Documentation

virtual bool ConvexCast::calcTimeOfImpact | ( | const SimdTransform & | fromA,
 |  | const SimdTransform & | toA,
 |  | const SimdTransform & | fromB,
 |  | const SimdTransform & | toB,
 |  | CastResult & | result
 | ) | [pure virtual]

cast a convex against another convex object

The documentation for this class was generated from the following files:
  • ConvexCast.h
  • ConvexCast.cpp
Generated on Wed May 24 14:00:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexCast Member List

This is the complete list of members for ConvexCast, including all inherited members.

calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)=0 | ConvexCast | [pure virtual]
~ConvexCast() | ConvexCast | [virtual]

Generated on Wed May 24 14:00:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexCast::CastResult Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
ConvexCast::CastResult

ConvexCast::CastResult Struct Reference

RayResult stores the closest result alternatively, add a callback method to decide about closest/all results. More...

#include <ConvexCast.h>

Collaboration diagram for ConvexCast::CastResult:

[legend]
List of all members.

Public Member Functions

virtual void | DebugDraw (SimdScalar fraction)
virtual void | DrawCoordSystem (const SimdTransform &trans)
CastResult ()
virtual | ~CastResult ()

Public Attributes

SimdVector3 m_normal
SimdScalar m_fraction
SimdTransform m_hitTransformA
SimdTransform m_hitTransformB
IDebugDraw * m_debugDrawer

Detailed Description

RayResult stores the closest result alternatively, add a callback method to decide about closest/all results.

Definition at line 36 of file ConvexCast.h.

Constructor & Destructor Documentation

ConvexCast::CastResult::CastResult ( ) [inline]

Definition at line 43 of file ConvexCast.h.

virtual ConvexCast::CastResult::~CastResult ( ) [inline, virtual]

Definition at line 50 of file ConvexCast.h.

Member Function Documentation

virtual void ConvexCast::CastResult::DebugDraw ( SimdScalar fraction ) [inline, virtual]

Definition at line 40 of file ConvexCast.h.

virtual void ConvexCast::CastResult::DrawCoordSystem ( const SimdTransform & trans ) [inline, virtual]

Definition at line 41 of file ConvexCast.h.

Member Data Documentation

IDebugDraw* ConvexCast::CastResult::m_debugDrawer

Definition at line 57 of file ConvexCast.h.

SimdScalar ConvexCast::CastResult::m_fraction

Definition at line 53 of file ConvexCast.h.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact().

SimdTransform ConvexCast::CastResult::m_hitTransformA

Definition at line 54 of file ConvexCast.h.

SimdTransform ConvexCast::CastResult::m_hitTransformB

Definition at line 55 of file ConvexCast.h.

SimdVector3 ConvexCast::CastResult::m_normal

Definition at line 50 of file ConvexCast.h.

The documentation for this struct was generated from the following file:
  • ConvexCast.h
Generated on Wed May 24 14:00:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexCast::CastResult Member List

This is the complete list of members for ConvexCast::CastResult, including all inherited members.

CastResult() | ConvexCast::CastResult | [inline]
DebugDraw(SimdScalar fraction) | ConvexCast::CastResult | [inline, virtual]
DrawCoordSystem(const SimdTransform &trans) | ConvexCast::CastResult | [inline, virtual]
m_debugDrawer | ConvexCast::CastResult |
m_fraction | ConvexCast::CastResult |
m_hitTransformA | ConvexCast::CastResult |
m_hitTransformB | ConvexCast::CastResult |
m_normal | ConvexCast::CastResult |
~CastResult() | ConvexCast::CastResult | [inline, virtual]

Generated on Wed May 24 14:00:09 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConcaveCollisionAlgorithm Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConvexConcaveCollisionAlgorithm Class Reference

ConvexConcaveCollisionAlgorithm supports collision between convex shapes and (concave) trianges meshes. More...

#include <ConvexConcaveCollisionAlgorithm.h>

Inheritance diagram for ConvexConcaveCollisionAlgorithm:

[legend]
Collaboration diagram for ConvexConcaveCollisionAlgorithm:

[legend]
List of all members.

Public Member Functions

ConvexConcaveCollisionAlgorithm (const CollisionAlgorithmConstructionInfo &ci, BroadphaseProxy *proxy0, BroadphaseProxy *proxy1)
virtual | ~ConvexConcaveCollisionAlgorithm ()
virtual void | ProcessCollision (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo)
float | CalculateTimeOfImpact (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo)
void | ClearCache ()

Private Attributes

BroadphaseProxy m_convex
BroadphaseProxy m_concave
BoxTriangleCallback m_boxTriangleCallback

Detailed Description

ConvexConcaveCollisionAlgorithm supports collision between convex shapes and (concave) trianges meshes.

Definition at line 71 of file ConvexConcaveCollisionAlgorithm.h.

Constructor & Destructor Documentation

ConvexConcaveCollisionAlgorithm::ConvexConcaveCollisionAlgorithm | ( | const CollisionAlgorithmConstructionInfo & | ci,
 |  | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1
 | ) |

Definition at line 29 of file ConvexConcaveCollisionAlgorithm.cpp.

ConvexConcaveCollisionAlgorithm::~ConvexConcaveCollisionAlgorithm ( ) [virtual]

Definition at line 36 of file ConvexConcaveCollisionAlgorithm.cpp.

Member Function Documentation

float ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const DispatcherInfo & | dispatchInfo
 | ) |

Definition at line 177 of file ConvexConcaveCollisionAlgorithm.cpp.

References SimdTransform::getOrigin(), BroadphaseProxy::m_clientObject, m_concave, m_convex, CollisionObject::m_hitFraction, CollisionObject::m_interpolationWorldTransform, CollisionObject::m_worldTransform, TriangleMeshShape::ProcessAllTriangles(), SIMD_INFINITY, and TRIANGLE_MESH_SHAPE_PROXYTYPE.

void ConvexConcaveCollisionAlgorithm::ClearCache ( )

Definition at line 134 of file ConvexConcaveCollisionAlgorithm.cpp.

References BoxTriangleCallback::ClearCache(), and m_boxTriangleCallback.

void ConvexConcaveCollisionAlgorithm::ProcessCollision | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const DispatcherInfo & | dispatchInfo
 | ) | [virtual]

Definition at line 140 of file ConvexConcaveCollisionAlgorithm.cpp.

References Dispatcher::ClearManifold(), BoxTriangleCallback::GetAabbMax(), BoxTriangleCallback::GetAabbMin(), TriangleMeshShape::GetMargin(), CollisionShape::IsConvex(), m_boxTriangleCallback, BroadphaseProxy::m_clientObject, CollisionObject::m_collisionShape, m_concave, m_convex, CollisionAlgorithm::m_dispatcher, BoxTriangleCallback::m_manifoldPtr, Dispatcher::NeedsCollision(), TriangleMeshShape::ProcessAllTriangles(), PersistentManifold::SetBodies(), BoxTriangleCallback::SetTimeStepAndCounters(), and TRIANGLE_MESH_SHAPE_PROXYTYPE.

Member Data Documentation

BoxTriangleCallback ConvexConcaveCollisionAlgorithm::m_boxTriangleCallback [private]

Definition at line 78 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by ClearCache(), and ProcessCollision().

BroadphaseProxy ConvexConcaveCollisionAlgorithm::m_concave [private]

Definition at line 76 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by CalculateTimeOfImpact(), and ProcessCollision().

BroadphaseProxy ConvexConcaveCollisionAlgorithm::m_convex [private]

Definition at line 74 of file ConvexConcaveCollisionAlgorithm.h.

Referenced by CalculateTimeOfImpact(), and ProcessCollision().

The documentation for this class was generated from the following files:
  • ConvexConcaveCollisionAlgorithm.h
  • ConvexConcaveCollisionAlgorithm.cpp
Generated on Wed May 24 14:00:10 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexConcaveCollisionAlgorithm Member List

This is the complete list of members for ConvexConcaveCollisionAlgorithm, including all inherited members.

CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo) | ConvexConcaveCollisionAlgorithm |
CollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
ClearCache() | ConvexConcaveCollisionAlgorithm |
CollisionAlgorithm() | CollisionAlgorithm | [inline]
CollisionAlgorithm(const CollisionAlgorithmConstructionInfo &ci) | CollisionAlgorithm |
ConvexConcaveCollisionAlgorithm(const CollisionAlgorithmConstructionInfo &ci, BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | ConvexConcaveCollisionAlgorithm |
GetDispatcherId() | CollisionAlgorithm | [protected]
m_boxTriangleCallback | ConvexConcaveCollisionAlgorithm | [private]
m_concave | ConvexConcaveCollisionAlgorithm | [private]
m_convex | ConvexConcaveCollisionAlgorithm | [private]
m_dispatcher | CollisionAlgorithm | [protected]
ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo) | ConvexConcaveCollisionAlgorithm | [virtual]
CollisionAlgorithm::ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
~CollisionAlgorithm() | CollisionAlgorithm | [inline, virtual]
~ConvexConcaveCollisionAlgorithm() | ConvexConcaveCollisionAlgorithm | [virtual]

Generated on Wed May 24 14:00:10 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexConvexAlgorithm Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConvexConvexAlgorithm Class Reference

ConvexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations. More...

#include <ConvexConvexAlgorithm.h>

Inheritance diagram for ConvexConvexAlgorithm:

[legend]
Collaboration diagram for ConvexConvexAlgorithm:

[legend]
List of all members.

Public Member Functions

void | CheckPenetrationDepthSolver ()
ConvexConvexAlgorithm (PersistentManifold *mf, const CollisionAlgorithmConstructionInfo &ci, BroadphaseProxy *proxy0, BroadphaseProxy *proxy1)
virtual | ~ConvexConvexAlgorithm ()
virtual void | ProcessCollision (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo)
virtual float | CalculateTimeOfImpact (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo)
void | SetLowLevelOfDetail (bool useLowLevel)
const PersistentManifold * | GetManifold ()

Public Attributes

BroadphaseProxy m_box0
BroadphaseProxy m_box1
bool | m_ownManifold
PersistentManifold * m_manifoldPtr
bool | m_lowLevelOfDetail

Private Attributes

VoronoiSimplexSolver m_simplexSolver
GjkPairDetector m_gjkPairDetector
bool | m_useEpa

Detailed Description

ConvexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations.

Definition at line 28 of file ConvexConvexAlgorithm.h.

Constructor & Destructor Documentation

ConvexConvexAlgorithm::ConvexConvexAlgorithm | ( | PersistentManifold * | mf,
 |  | const CollisionAlgorithmConstructionInfo & | ci,
 |  | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1
 | ) |

Definition at line 84 of file ConvexConvexAlgorithm.cpp.

References CheckPenetrationDepthSolver(), Dispatcher::GetNewManifold(), m_box0, m_box1, BroadphaseProxy::m_clientObject, CollisionAlgorithm::m_dispatcher, m_manifoldPtr, m_ownManifold, and Dispatcher::NeedsCollision().

ConvexConvexAlgorithm::~ConvexConvexAlgorithm ( ) [virtual]

Definition at line 108 of file ConvexConvexAlgorithm.cpp.

References CollisionAlgorithm::m_dispatcher, m_manifoldPtr, m_ownManifold, and Dispatcher::ReleaseManifold().

Member Function Documentation

float ConvexConvexAlgorithm::CalculateTimeOfImpact | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const DispatcherInfo & | dispatchInfo
 | ) | [virtual]

Rather then checking ALL pairs, only calculate TOI when motion exceeds treshold

Linear motion for one of objects needs to exceed m_ccdSquareMotionTreshold col0->m_worldTransform,

Convex0 against sphere for Convex1

Simplification, one object is simplified as a sphere

Sphere (for convex0) against Convex1

Simplification, one object is simplified as a sphere

Definition at line 331 of file ConvexConvexAlgorithm.cpp.

References GjkConvexCast::calcTimeOfImpact(), CheckPenetrationDepthSolver(), SimdTransform::getOrigin(), m_box0, m_box1, CollisionObject::m_ccdSweptShereRadius, BroadphaseProxy::m_clientObject, CollisionAlgorithm::m_dispatcher, ConvexCast::CastResult::m_fraction, CollisionObject::m_hitFraction, CollisionObject::m_interpolationWorldTransform, CollisionObject::m_worldTransform, and Dispatcher::NeedsCollision().

void ConvexConvexAlgorithm::CheckPenetrationDepthSolver ( )

Definition at line 153 of file ConvexConvexAlgorithm.cpp.

References gUseEpa, m_gjkPairDetector, m_useEpa, and GjkPairDetector::SetPenetrationDepthSolver().

Referenced by CalculateTimeOfImpact(), ConvexConvexAlgorithm(), and ProcessCollision().

const PersistentManifold* ConvexConvexAlgorithm::GetManifold ( ) [inline]

Definition at line 60 of file ConvexConvexAlgorithm.h.

References m_manifoldPtr.

void ConvexConvexAlgorithm::ProcessCollision | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const DispatcherInfo & | dispatchInfo
 | ) | [virtual]

Definition at line 240 of file ConvexConvexAlgorithm.cpp.

References CheckPenetrationDepthSolver(), Dispatcher::ClearManifold(), GjkPairDetector::GetClosestPoints(), PersistentManifold::GetContactBreakingTreshold(), ConvexShape::GetMargin(), Dispatcher::GetNewManifoldResult(), CollisionShape::IsPolyhedral(), m_box0, m_box1, BroadphaseProxy::m_clientObject, CollisionObject::m_collisionShape, Separation::m_contact, DispatcherInfo::m_debugDraw, CollisionAlgorithm::m_dispatcher, DispatcherInfo::m_enableSatConvex, Separation::m_featureA, Separation::m_featureB, m_gjkPairDetector, m_manifoldPtr, PolyhedralConvexShape::m_optionalHull, Separation::m_separator, CollisionObject::m_worldTransform, Dispatcher::NeedsCollision(), Hull::ProcessHullHull(), Dispatcher::ReleaseManifoldResult(), GjkPairDetector::SetMinkowskiA(), and GjkPairDetector::SetMinkowskiB().

void ConvexConvexAlgorithm::SetLowLevelOfDetail ( bool useLowLevel )

Definition at line 117 of file ConvexConvexAlgorithm.cpp.

References m_lowLevelOfDetail.

Member Data Documentation

BroadphaseProxy ConvexConvexAlgorithm::m_box0

Definition at line 35 of file ConvexConvexAlgorithm.h.

Referenced by CalculateTimeOfImpact(), ConvexConvexAlgorithm(), and ProcessCollision().

BroadphaseProxy ConvexConvexAlgorithm::m_box1

Definition at line 36 of file ConvexConvexAlgorithm.h.

Referenced by CalculateTimeOfImpact(), ConvexConvexAlgorithm(), and ProcessCollision().

GjkPairDetector ConvexConvexAlgorithm::m_gjkPairDetector [private]

Definition at line 32 of file ConvexConvexAlgorithm.h.

Referenced by CheckPenetrationDepthSolver(), and ProcessCollision().

bool ConvexConvexAlgorithm::m_lowLevelOfDetail

Definition at line 40 of file ConvexConvexAlgorithm.h.

Referenced by SetLowLevelOfDetail().

PersistentManifold* ConvexConvexAlgorithm::m_manifoldPtr

Definition at line 39 of file ConvexConvexAlgorithm.h.

Referenced by ConvexConvexAlgorithm(), GetManifold(), ProcessCollision(), and ~ConvexConvexAlgorithm().

bool ConvexConvexAlgorithm::m_ownManifold

Definition at line 38 of file ConvexConvexAlgorithm.h.

Referenced by ConvexConvexAlgorithm(), and ~ConvexConvexAlgorithm().

VoronoiSimplexSolver ConvexConvexAlgorithm::m_simplexSolver [private]

Definition at line 31 of file ConvexConvexAlgorithm.h.

bool ConvexConvexAlgorithm::m_useEpa [private]

Definition at line 33 of file ConvexConvexAlgorithm.h.

Referenced by CheckPenetrationDepthSolver().

The documentation for this class was generated from the following files:
  • ConvexConvexAlgorithm.h
  • ConvexConvexAlgorithm.cpp
Generated on Wed May 24 14:00:10 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexConvexAlgorithm Member List

This is the complete list of members for ConvexConvexAlgorithm, including all inherited members.

CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo) | ConvexConvexAlgorithm | [virtual]
CollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
CheckPenetrationDepthSolver() | ConvexConvexAlgorithm |
CollisionAlgorithm() | CollisionAlgorithm | [inline]
CollisionAlgorithm(const CollisionAlgorithmConstructionInfo &ci) | CollisionAlgorithm |
ConvexConvexAlgorithm(PersistentManifold *mf, const CollisionAlgorithmConstructionInfo &ci, BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | ConvexConvexAlgorithm |
GetDispatcherId() | CollisionAlgorithm | [protected]
GetManifold() | ConvexConvexAlgorithm | [inline]
m_box0 | ConvexConvexAlgorithm |
m_box1 | ConvexConvexAlgorithm |
m_dispatcher | CollisionAlgorithm | [protected]
m_gjkPairDetector | ConvexConvexAlgorithm | [private]
m_lowLevelOfDetail | ConvexConvexAlgorithm |
m_manifoldPtr | ConvexConvexAlgorithm |
m_ownManifold | ConvexConvexAlgorithm |
m_simplexSolver | ConvexConvexAlgorithm | [private]
m_useEpa | ConvexConvexAlgorithm | [private]
ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo) | ConvexConvexAlgorithm | [virtual]
CollisionAlgorithm::ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
SetLowLevelOfDetail(bool useLowLevel) | ConvexConvexAlgorithm |
~CollisionAlgorithm() | CollisionAlgorithm | [inline, virtual]
~ConvexConvexAlgorithm() | ConvexConvexAlgorithm | [virtual]

Generated on Wed May 24 14:00:10 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexHullShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConvexHullShape Class Reference

ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) No connectivity is needed. More...

#include <ConvexHullShape.h>

Inheritance diagram for ConvexHullShape:

[legend]
Collaboration diagram for ConvexHullShape:

[legend]
List of all members.

Public Member Functions

ConvexHullShape (SimdPoint3 *points, int numPoints)
void | AddPoint (const SimdPoint3 &point)
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
virtual int | GetShapeType () const
virtual char * | GetName () const
virtual int | GetNumVertices () const
virtual int | GetNumEdges () const
virtual void | GetEdge (int i, SimdPoint3 &pa, SimdPoint3 &pb) const
virtual void | GetVertex (int i, SimdPoint3 &vtx) const
virtual int | GetNumPlanes () const
virtual void | GetPlane (SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const
virtual bool | IsInside (const SimdPoint3 &pt, SimdScalar tolerance) const

Private Attributes

std::vector< SimdPoint3 > | m_points

Detailed Description

ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) No connectivity is needed.

LocalGetSupportingVertex iterates linearly though all vertices. on modern hardware, due to cache coherency this isn't that bad. Complex algorithms tend to trash the cash. (memory is much slower then the cpu)

Definition at line 28 of file ConvexHullShape.h.

Constructor & Destructor Documentation

ConvexHullShape::ConvexHullShape | ( | SimdPoint3 * | points,
 |  | int | numPoints
 | ) |

Definition at line 21 of file ConvexHullShape.cpp.

References m_points.

Member Function Documentation

void ConvexHullShape::AddPoint ( const SimdPoint3 & point ) [inline]

Definition at line 35 of file ConvexHullShape.h.

References m_points.

void ConvexHullShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Reimplemented from PolyhedralConvexShape.

Definition at line 59 of file ConvexHullShape.cpp.

References SimdVector3::dot(), ConvexShape::m_localScaling, and m_points.

void ConvexHullShape::GetEdge | ( | int | i,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 130 of file ConvexHullShape.cpp.

References ConvexShape::m_localScaling, and m_points.

virtual char* ConvexHullShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 47 of file ConvexHullShape.h.

int ConvexHullShape::GetNumEdges ( ) const [virtual]

Implements PolyhedralConvexShape.

Definition at line 125 of file ConvexHullShape.cpp.

References m_points.

int ConvexHullShape::GetNumPlanes ( ) const [virtual]

Implements PolyhedralConvexShape.

Definition at line 144 of file ConvexHullShape.cpp.

int ConvexHullShape::GetNumVertices ( ) const [virtual]

Implements PolyhedralConvexShape.

Definition at line 120 of file ConvexHullShape.cpp.

References m_points.

void ConvexHullShape::GetPlane | ( | SimdVector3 & | planeNormal,
 |  | SimdPoint3 & | planeSupport,
 |  | int | i
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 149 of file ConvexHullShape.cpp.

virtual int ConvexHullShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 44 of file ConvexHullShape.h.

References CONVEX_HULL_SHAPE_PROXYTYPE.

void ConvexHullShape::GetVertex | ( | int | i,
 |  | SimdPoint3 & | vtx
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 139 of file ConvexHullShape.cpp.

References ConvexShape::m_localScaling, and m_points.

bool ConvexHullShape::IsInside | ( | const SimdPoint3 & | pt,
 |  | SimdScalar | tolerance
 | ) | const [virtual]

Implements PolyhedralConvexShape.

Definition at line 155 of file ConvexHullShape.cpp.

SimdVector3 ConvexHullShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [virtual]

Reimplemented from ConvexShape.

Definition at line 93 of file ConvexHullShape.cpp.

References ConvexShape::GetMargin(), LocalGetSupportingVertexWithoutMargin(), SimdVector3::normalize(), SimdQuadWord::setValue(), and SIMD_EPSILON.

SimdVector3 ConvexHullShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Reimplemented from PolyhedralConvexShape.

Definition at line 28 of file ConvexHullShape.cpp.

References SimdVector3::dot(), SimdVector3::length2(), ConvexShape::m_localScaling, m_points, SimdQuadWord::setValue(), and SimdSqrt().

Referenced by LocalGetSupportingVertex().

Member Data Documentation

std::vector<SimdPoint3> ConvexHullShape::m_points [private]

Definition at line 30 of file ConvexHullShape.h.

Referenced by AddPoint(), BatchedUnitVectorGetSupportingVertexWithoutMargin(), ConvexHullShape(), GetEdge(), GetNumEdges(), GetNumVertices(), GetVertex(), and LocalGetSupportingVertexWithoutMargin().

The documentation for this class was generated from the following files:
  • ConvexHullShape.h
  • ConvexHullShape.cpp
Generated on Wed May 24 14:00:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexHullShape Member List

This is the complete list of members for ConvexHullShape, including all inherited members.

AddPoint(const SimdPoint3 &point) | ConvexHullShape | [inline]
BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | ConvexHullShape | [virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | PolyhedralConvexShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexHullShape(SimdPoint3 *points, int numPoints) | ConvexHullShape |
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | ConvexHullShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | ConvexHullShape | [inline, virtual]
GetNumEdges() const | ConvexHullShape | [virtual]
GetNumPlanes() const | ConvexHullShape | [virtual]
GetNumVertices() const | ConvexHullShape | [virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | ConvexHullShape | [virtual]
GetShapeType() const | ConvexHullShape | [inline, virtual]
GetVertex(int i, SimdPoint3 &vtx) const | ConvexHullShape | [virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | ConvexHullShape | [virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexHullShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | ConvexHullShape | [virtual]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_points | ConvexHullShape | [private]
m_tempDebug | CollisionShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexPenetrationDepthSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConvexPenetrationDepthSolver Class Reference

ConvexPenetrationDepthSolver provides an interface for penetration depth calculation. More...

#include <ConvexPenetrationDepthSolver.h>

Inheritance diagram for ConvexPenetrationDepthSolver:

[legend]
List of all members.

Public Member Functions

virtual | ~ConvexPenetrationDepthSolver ()
virtual bool | CalcPenDepth (SimplexSolverInterface &simplexSolver, ConvexShape *convexA, ConvexShape *convexB, const SimdTransform &transA, const SimdTransform &transB, SimdVector3 &v, SimdPoint3 &pa, SimdPoint3 &pb, class IDebugDraw *debugDraw)=0

Detailed Description

ConvexPenetrationDepthSolver provides an interface for penetration depth calculation.

Definition at line 27 of file ConvexPenetrationDepthSolver.h.

Constructor & Destructor Documentation

virtual ConvexPenetrationDepthSolver::~ConvexPenetrationDepthSolver ( ) [inline, virtual]

Definition at line 31 of file ConvexPenetrationDepthSolver.h.

Member Function Documentation

virtual bool ConvexPenetrationDepthSolver::CalcPenDepth | ( | SimplexSolverInterface & | simplexSolver,
 |  | ConvexShape * | convexA,
 |  | ConvexShape * | convexB,
 |  | const SimdTransform & | transA,
 |  | const SimdTransform & | transB,
 |  | SimdVector3 & | v,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb,
 |  | class IDebugDraw * | debugDraw
 | ) | [pure virtual]

Implemented in EpaPenetrationDepthSolver, and MinkowskiPenetrationDepthSolver.

The documentation for this class was generated from the following file:
  • ConvexPenetrationDepthSolver.h
Generated on Wed May 24 14:00:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexPenetrationDepthSolver Member List

This is the complete list of members for ConvexPenetrationDepthSolver, including all inherited members.

CalcPenDepth(SimplexSolverInterface &simplexSolver, ConvexShape *convexA, ConvexShape *convexB, const SimdTransform &transA, const SimdTransform &transB, SimdVector3 &v, SimdPoint3 &pa, SimdPoint3 &pb, class IDebugDraw *debugDraw)=0 | ConvexPenetrationDepthSolver | [pure virtual]
~ConvexPenetrationDepthSolver() | ConvexPenetrationDepthSolver | [inline, virtual]

Generated on Wed May 24 14:00:11 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ConvexShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ConvexShape Class Reference

ConvexShape is an abstract shape interface. More...

#include <ConvexShape.h>

Inheritance diagram for ConvexShape:

[legend]
Collaboration diagram for ConvexShape:

[legend]
List of all members.

Public Member Functions

ConvexShape ()
virtual | ~ConvexShape ()
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const =0
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const =0
void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
virtual void | GetAabbSlow (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
virtual void | setLocalScaling (const SimdVector3 &scaling)
virtual const SimdVector3 & | getLocalScaling () const
virtual void | SetMargin (float margin)
virtual float | GetMargin () const

Protected Attributes

SimdVector3 m_localScaling

Private Attributes

SimdScalar m_collisionMargin

Detailed Description

ConvexShape is an abstract shape interface.

The explicit part provides plane-equations, the implicit part provides GetClosestPoint interface. used in combination with GJK or ConvexCast

Definition at line 34 of file ConvexShape.h.

Constructor & Destructor Documentation

ConvexShape::ConvexShape ( )

Definition at line 23 of file ConvexShape.cpp.

ConvexShape::~ConvexShape ( ) [virtual]

Definition at line 18 of file ConvexShape.cpp.

Member Function Documentation

virtual void ConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [pure virtual]

Implemented in BoxShape, ConeShape, ConvexHullShape, CylinderShape, CylinderShapeX, CylinderShapeZ, MinkowskiSumShape, MultiSphereShape, PolyhedralConvexShape, SphereShape, and TriangleShape.

Referenced by MinkowskiPenetrationDepthSolver::CalcPenDepth().

void ConvexShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [inline, virtual]

GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.

Implements CollisionShape.

Reimplemented in BoxShape, CylinderShape, SphereShape, and TriangleShape.

Definition at line 50 of file ConvexShape.h.

References GetAabbSlow().

Referenced by PolyhedralConvexShape::CalculateLocalInertia(), and ConeShape::CalculateLocalInertia().

void ConvexShape::GetAabbSlow | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [virtual]

Definition at line 37 of file ConvexShape.cpp.

References SimdTransform::getBasis(), GetMargin(), and LocalGetSupportingVertex().

Referenced by TriangleShape::GetAabb(), CylinderShape::GetAabb(), and GetAabb().

virtual const SimdVector3& ConvexShape::getLocalScaling ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 61 of file ConvexShape.h.

References m_localScaling.

virtual float ConvexShape::GetMargin ( ) const [inline, virtual]

Implements CollisionShape.

Reimplemented in MinkowskiSumShape, and SphereShape.

Definition at line 71 of file ConvexShape.h.

References m_collisionMargin.

Referenced by BoxShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), MinkowskiPenetrationDepthSolver::CalcPenDepth(), PolyhedralConvexShape::CalculateLocalInertia(), ConeShape::CalculateLocalInertia(), BoxShape::GetAabb(), GetAabbSlow(), GjkPairDetector::GetClosestPoints(), SphereShape::GetMargin(), MinkowskiSumShape::GetMargin(), CylinderShape::LocalGetSupportingVertex(), LocalGetSupportingVertex(), ConvexHullShape::LocalGetSupportingVertex(), ConeShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertexWithoutMargin(), and ConvexConvexAlgorithm::ProcessCollision().

SimdVector3 ConvexShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [virtual]

Reimplemented in BoxShape, ConeShape, ConvexHullShape, CylinderShape, and SphereShape.

Definition at line 56 of file ConvexShape.cpp.

References GetMargin(), LocalGetSupportingVertexWithoutMargin(), SimdVector3::normalize(), SimdQuadWord::setValue(), and SIMD_EPSILON.

Referenced by SubsimplexConvexCast::calcTimeOfImpact(), GetAabbSlow(), and Epa::Initialize().

virtual SimdVector3 ConvexShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [pure virtual]

Implemented in BoxShape, ConeShape, ConvexHullShape, CylinderShape, CylinderShapeX, CylinderShapeZ, MinkowskiSumShape, MultiSphereShape, PolyhedralConvexShape, SphereShape, and TriangleShape.

Referenced by MinkowskiPenetrationDepthSolver::CalcPenDepth(), GjkPairDetector::GetClosestPoints(), LocalGetSupportingVertex(), and MinkowskiSumShape::LocalGetSupportingVertexWithoutMargin().

void ConvexShape::setLocalScaling ( const SimdVector3 & scaling ) [virtual]

Implements CollisionShape.

Definition at line 30 of file ConvexShape.cpp.

References m_localScaling.

virtual void ConvexShape::SetMargin ( float margin ) [inline, virtual]

Implements CollisionShape.

Reimplemented in SphereShape.

Definition at line 67 of file ConvexShape.h.

References m_collisionMargin.

Referenced by MultiSphereShape::MultiSphereShape(), and SphereShape::SetMargin().

Member Data Documentation

SimdScalar ConvexShape::m_collisionMargin [private]

Definition at line 76 of file ConvexShape.h.

Referenced by GetMargin(), and SetMargin().

SimdVector3 ConvexShape::m_localScaling [protected]

Definition at line 79 of file ConvexShape.h.

Referenced by ConvexHullShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), ConvexHullShape::GetEdge(), BoxShape::GetHalfExtents(), getLocalScaling(), SphereShape::GetMargin(), ConvexHullShape::GetVertex(), ConvexHullShape::LocalGetSupportingVertexWithoutMargin(), and setLocalScaling().

The documentation for this class was generated from the following files:
  • ConvexShape.h
  • ConvexShape.cpp
Generated on Wed May 24 14:00:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ConvexShape Member List

This is the complete list of members for ConvexShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const =0 | ConvexShape | [pure virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia)=0 | CollisionShape | [pure virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const =0 | CollisionShape | [pure virtual]
GetShapeType() const =0 | CollisionShape | [pure virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const =0 | ConvexShape | [pure virtual]
m_collisionMargin | ConvexShape | [private]
m_localScaling | ConvexShape | [protected]
m_tempDebug | CollisionShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CylinderShape Class Reference

implements cylinder shape interface More...

#include <CylinderShape.h>

Inheritance diagram for CylinderShape:

[legend]
Collaboration diagram for CylinderShape:

[legend]
List of all members.

Public Member Functions

CylinderShape (const SimdVector3 &halfExtents)
void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual int | GetShapeType () const

Detailed Description

implements cylinder shape interface

Definition at line 24 of file CylinderShape.h.

Constructor & Destructor Documentation

CylinderShape::CylinderShape ( const SimdVector3 & halfExtents )

Definition at line 18 of file CylinderShape.cpp.

Member Function Documentation

void CylinderShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Reimplemented from BoxShape.

Reimplemented in CylinderShapeX, and CylinderShapeZ.

Definition at line 169 of file CylinderShape.cpp.

References CylinderLocalSupportY(), and BoxShape::GetHalfExtents().

void CylinderShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [inline, virtual]

GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.

Reimplemented from BoxShape.

Definition at line 32 of file CylinderShape.h.

References ConvexShape::GetAabbSlow().

virtual int CylinderShape::GetShapeType ( ) const [inline, virtual]

Reimplemented from BoxShape.

Definition at line 64 of file CylinderShape.h.

References CYLINDER_SHAPE_PROXYTYPE.

virtual SimdVector3 CylinderShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [inline, virtual]

Reimplemented from BoxShape.

Definition at line 41 of file CylinderShape.h.

References ConvexShape::GetMargin(), LocalGetSupportingVertexWithoutMargin(), SimdVector3::normalize(), SimdQuadWord::setValue(), and SIMD_EPSILON.

SimdVector3 CylinderShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Reimplemented from BoxShape.

Reimplemented in CylinderShapeX, and CylinderShapeZ.

Definition at line 164 of file CylinderShape.cpp.

References CylinderLocalSupportY(), and BoxShape::GetHalfExtents().

Referenced by LocalGetSupportingVertex().

The documentation for this class was generated from the following files:
  • CylinderShape.h
  • CylinderShape.cpp
Generated on Wed May 24 14:00:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CylinderShape Member List

This is the complete list of members for CylinderShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | CylinderShape | [virtual]
BoxShape(const SimdVector3 &boxHalfExtents) | BoxShape | [inline]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | BoxShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
CylinderShape(const SimdVector3 &halfExtents) | CylinderShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | CylinderShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | BoxShape | [inline, virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
GetHalfExtents() const | BoxShape |
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | BoxShape | [inline, virtual]
GetNumEdges() const | BoxShape | [inline, virtual]
GetNumPlanes() const | BoxShape | [inline, virtual]
GetNumVertices() const | BoxShape | [inline, virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | BoxShape | [inline, virtual]
GetPlaneEquation(SimdVector4 &plane, int i) const | BoxShape | [inline, virtual]
GetShapeType() const | CylinderShape | [inline, virtual]
GetVertex(int i, SimdVector3 &vtx) const | BoxShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | BoxShape | [inline, virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | CylinderShape | [inline, virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | CylinderShape | [virtual]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~BoxShape() | BoxShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:12 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShapeX Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CylinderShapeX Class Reference

#include <CylinderShape.h>

Inheritance diagram for CylinderShapeX:

[legend]
Collaboration diagram for CylinderShapeX:

[legend]
List of all members.

Public Member Functions

CylinderShapeX (const SimdVector3 &halfExtents)
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const

Detailed Description

Definition at line 73 of file CylinderShape.h.

Constructor & Destructor Documentation

CylinderShapeX::CylinderShapeX ( const SimdVector3 & halfExtents )

Definition at line 25 of file CylinderShape.cpp.

Member Function Documentation

void CylinderShapeX::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Reimplemented from CylinderShape.

Definition at line 188 of file CylinderShape.cpp.

References CylinderLocalSupportX(), and BoxShape::GetHalfExtents().

SimdVector3 CylinderShapeX::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Reimplemented from CylinderShape.

Definition at line 154 of file CylinderShape.cpp.

References CylinderLocalSupportX(), and BoxShape::GetHalfExtents().

The documentation for this class was generated from the following files:
  • CylinderShape.h
  • CylinderShape.cpp
Generated on Wed May 24 14:00:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CylinderShapeX Member List

This is the complete list of members for CylinderShapeX, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | CylinderShapeX | [virtual]
BoxShape(const SimdVector3 &boxHalfExtents) | BoxShape | [inline]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | BoxShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
CylinderShape(const SimdVector3 &halfExtents) | CylinderShape |
CylinderShapeX(const SimdVector3 &halfExtents) | CylinderShapeX |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | CylinderShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | BoxShape | [inline, virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
GetHalfExtents() const | BoxShape |
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | BoxShape | [inline, virtual]
GetNumEdges() const | BoxShape | [inline, virtual]
GetNumPlanes() const | BoxShape | [inline, virtual]
GetNumVertices() const | BoxShape | [inline, virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | BoxShape | [inline, virtual]
GetPlaneEquation(SimdVector4 &plane, int i) const | BoxShape | [inline, virtual]
GetShapeType() const | CylinderShape | [inline, virtual]
GetVertex(int i, SimdVector3 &vtx) const | BoxShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | BoxShape | [inline, virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | CylinderShape | [inline, virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | CylinderShapeX | [virtual]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~BoxShape() | BoxShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: CylinderShapeZ Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

CylinderShapeZ Class Reference

#include <CylinderShape.h>

Inheritance diagram for CylinderShapeZ:

[legend]
Collaboration diagram for CylinderShapeZ:

[legend]
List of all members.

Public Member Functions

CylinderShapeZ (const SimdVector3 &halfExtents)
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const

Detailed Description

Definition at line 82 of file CylinderShape.h.

Constructor & Destructor Documentation

CylinderShapeZ::CylinderShapeZ ( const SimdVector3 & halfExtents )

Definition at line 31 of file CylinderShape.cpp.

Member Function Documentation

void CylinderShapeZ::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Reimplemented from CylinderShape.

Definition at line 177 of file CylinderShape.cpp.

References CylinderLocalSupportZ(), and BoxShape::GetHalfExtents().

SimdVector3 CylinderShapeZ::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Reimplemented from CylinderShape.

Definition at line 160 of file CylinderShape.cpp.

References CylinderLocalSupportZ(), and BoxShape::GetHalfExtents().

The documentation for this class was generated from the following files:
  • CylinderShape.h
  • CylinderShape.cpp
Generated on Wed May 24 14:00:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

CylinderShapeZ Member List

This is the complete list of members for CylinderShapeZ, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | CylinderShapeZ | [virtual]
BoxShape(const SimdVector3 &boxHalfExtents) | BoxShape | [inline]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | BoxShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
CylinderShape(const SimdVector3 &halfExtents) | CylinderShape |
CylinderShapeZ(const SimdVector3 &halfExtents) | CylinderShapeZ |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | CylinderShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | BoxShape | [inline, virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
GetHalfExtents() const | BoxShape |
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | BoxShape | [inline, virtual]
GetNumEdges() const | BoxShape | [inline, virtual]
GetNumPlanes() const | BoxShape | [inline, virtual]
GetNumVertices() const | BoxShape | [inline, virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | BoxShape | [inline, virtual]
GetPlaneEquation(SimdVector4 &plane, int i) const | BoxShape | [inline, virtual]
GetShapeType() const | CylinderShape | [inline, virtual]
GetVertex(int i, SimdVector3 &vtx) const | BoxShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | BoxShape | [inline, virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | CylinderShape | [inline, virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | CylinderShapeZ | [virtual]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~BoxShape() | BoxShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:13 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DefaultMotionState Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

DefaultMotionState Class Reference

DefaultMotionState implements standard motionstate, using SimdTransform. More...

#include <CcdPhysicsController.h>

Inheritance diagram for DefaultMotionState:

[legend]
Collaboration diagram for DefaultMotionState:

[legend]
List of all members.

Public Member Functions

DefaultMotionState ()
A small utility class, DefaultMotionState.
virtual | ~DefaultMotionState ()
virtual void | getWorldPosition (float &posX, float &posY, float &posZ)
virtual void | getWorldScaling (float &scaleX, float &scaleY, float &scaleZ)
virtual void | getWorldOrientation (float &quatIma0, float &quatIma1, float &quatIma2, float &quatReal)
virtual void | setWorldPosition (float posX, float posY, float posZ)
virtual void | setWorldOrientation (float quatIma0, float quatIma1, float quatIma2, float quatReal)
virtual void | calculateWorldTransformations ()

Public Attributes

SimdTransform m_worldTransform

Detailed Description

DefaultMotionState implements standard motionstate, using SimdTransform.

Definition at line 193 of file CcdPhysicsController.h.

Constructor & Destructor Documentation

DefaultMotionState::DefaultMotionState ( )

A small utility class, DefaultMotionState.

Definition at line 535 of file CcdPhysicsController.cpp.

References m_worldTransform, and SimdTransform::setIdentity().

DefaultMotionState::~DefaultMotionState ( ) [virtual]

Definition at line 541 of file CcdPhysicsController.cpp.

Member Function Documentation

void DefaultMotionState::calculateWorldTransformations ( ) [virtual]

Implements PHY_IMotionState.

Definition at line 580 of file CcdPhysicsController.cpp.

void DefaultMotionState::getWorldOrientation | ( | float & | quatIma0,
 |  | float & | quatIma1,
 |  | float & | quatIma2,
 |  | float & | quatReal
 | ) | [virtual]

Implements PHY_IMotionState.

Definition at line 560 of file CcdPhysicsController.cpp.

References SimdTransform::getRotation(), m_worldTransform, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

void DefaultMotionState::getWorldPosition | ( | float & | posX,
 |  | float & | posY,
 |  | float & | posZ
 | ) | [virtual]

Implements PHY_IMotionState.

Definition at line 546 of file CcdPhysicsController.cpp.

References SimdTransform::getOrigin(), m_worldTransform, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

void DefaultMotionState::getWorldScaling | ( | float & | scaleX,
 |  | float & | scaleY,
 |  | float & | scaleZ
 | ) | [virtual]

Implements PHY_IMotionState.

Definition at line 553 of file CcdPhysicsController.cpp.

void DefaultMotionState::setWorldOrientation | ( | float | quatIma0,
 |  | float | quatIma1,
 |  | float | quatIma2,
 |  | float | quatReal
 | ) | [virtual]

Implements PHY_IMotionState.

Definition at line 574 of file CcdPhysicsController.cpp.

References m_worldTransform, and SimdTransform::setRotation().

void DefaultMotionState::setWorldPosition | ( | float | posX,
 |  | float | posY,
 |  | float | posZ
 | ) | [virtual]

Implements PHY_IMotionState.

Definition at line 568 of file CcdPhysicsController.cpp.

References m_worldTransform, and SimdTransform::setOrigin().

Member Data Documentation

SimdTransform DefaultMotionState::m_worldTransform

Definition at line 210 of file CcdPhysicsController.h.

Referenced by CcdPhysicsEnvironment::CreateConeController(), CcdPhysicsEnvironment::CreateSphereController(), DefaultMotionState(), getWorldOrientation(), getWorldPosition(), setWorldOrientation(), and setWorldPosition().

The documentation for this class was generated from the following files:
  • CcdPhysicsController.h
  • CcdPhysicsController.cpp
Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

DefaultMotionState Member List

This is the complete list of members for DefaultMotionState, including all inherited members.

calculateWorldTransformations() | DefaultMotionState | [virtual]
DefaultMotionState() | DefaultMotionState |
getWorldOrientation(float &quatIma0, float &quatIma1, float &quatIma2, float &quatReal) | DefaultMotionState | [virtual]
getWorldPosition(float &posX, float &posY, float &posZ) | DefaultMotionState | [virtual]
getWorldScaling(float &scaleX, float &scaleY, float &scaleZ) | DefaultMotionState | [virtual]
m_worldTransform | DefaultMotionState |
setWorldOrientation(float quatIma0, float quatIma1, float quatIma2, float quatReal) | DefaultMotionState | [virtual]
setWorldPosition(float posX, float posY, float posZ) | DefaultMotionState | [virtual]
~DefaultMotionState() | DefaultMotionState | [virtual]
~PHY_IMotionState() | PHY_IMotionState | [virtual]

Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DiscreteCollisionDetectorInterface Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

DiscreteCollisionDetectorInterface Struct Reference

This interface is made to be used by an iterative approach to do TimeOfImpact calculations This interface allows to query for closest points and penetration depth between two (convex) objects the closest point is on the second object (B), and the normal points from the surface on B towards A. More...

#include <DiscreteCollisionDetectorInterface.h>

Inheritance diagram for DiscreteCollisionDetectorInterface:

[legend]
List of all members.

Public Member Functions

void | operator delete (void *ptr)
virtual | ~DiscreteCollisionDetectorInterface ()
virtual void | GetClosestPoints (const ClosestPointInput &input, Result &output, class IDebugDraw *debugDraw)=0
SimdScalar getCollisionMargin ()

Classes

struct | ClosestPointInput
struct | Result

Detailed Description

This interface is made to be used by an iterative approach to do TimeOfImpact calculations This interface allows to query for closest points and penetration depth between two (convex) objects the closest point is on the second object (B), and the normal points from the surface on B towards A.

distance is between closest points on B and closest point on A. So you can calculate closest point on A by taking closestPointInA = closestPointInB + m_distance * m_normalOnSurfaceB

Definition at line 28 of file DiscreteCollisionDetectorInterface.h.

Constructor & Destructor Documentation

virtual DiscreteCollisionDetectorInterface::~DiscreteCollisionDetectorInterface ( ) [inline, virtual]

Definition at line 52 of file DiscreteCollisionDetectorInterface.h.

Member Function Documentation

virtual void DiscreteCollisionDetectorInterface::GetClosestPoints | ( | const ClosestPointInput & | input,
 |  | Result & | output,
 |  | class IDebugDraw * | debugDraw
 | ) | [pure virtual]

SimdScalar DiscreteCollisionDetectorInterface::getCollisionMargin ( ) [inline]

Definition at line 60 of file DiscreteCollisionDetectorInterface.h.

void DiscreteCollisionDetectorInterface::operator delete ( void * ptr ) [inline]

Definition at line 30 of file DiscreteCollisionDetectorInterface.h.

The documentation for this struct was generated from the following file:
  • DiscreteCollisionDetectorInterface.h
Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

DiscreteCollisionDetectorInterface Member List

This is the complete list of members for DiscreteCollisionDetectorInterface, including all inherited members.

GetClosestPoints(const ClosestPointInput &input, Result &output, class IDebugDraw *debugDraw)=0 | DiscreteCollisionDetectorInterface | [pure virtual]
getCollisionMargin() | DiscreteCollisionDetectorInterface | [inline]
operator delete(void *ptr) | DiscreteCollisionDetectorInterface | [inline]
~DiscreteCollisionDetectorInterface() | DiscreteCollisionDetectorInterface | [inline, virtual]

Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DiscreteCollisionDetectorInterface::ClosestPointInput Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
DiscreteCollisionDetectorInterface::ClosestPointInput

DiscreteCollisionDetectorInterface::ClosestPointInput Struct Reference

#include <DiscreteCollisionDetectorInterface.h>

Collaboration diagram for DiscreteCollisionDetectorInterface::ClosestPointInput:

[legend]
List of all members.

Public Member Functions

ClosestPointInput ()

Public Attributes

SimdTransform m_transformA
SimdTransform m_transformB
SimdScalar m_maximumDistanceSquared

Detailed Description

Definition at line 40 of file DiscreteCollisionDetectorInterface.h.

Constructor & Destructor Documentation

DiscreteCollisionDetectorInterface::ClosestPointInput::ClosestPointInput ( ) [inline]

Definition at line 42 of file DiscreteCollisionDetectorInterface.h.

Member Data Documentation

SimdScalar DiscreteCollisionDetectorInterface::ClosestPointInput::m_maximumDistanceSquared

Definition at line 49 of file DiscreteCollisionDetectorInterface.h.

SimdTransform DiscreteCollisionDetectorInterface::ClosestPointInput::m_transformA

Definition at line 47 of file DiscreteCollisionDetectorInterface.h.

SimdTransform DiscreteCollisionDetectorInterface::ClosestPointInput::m_transformB

Definition at line 48 of file DiscreteCollisionDetectorInterface.h.

The documentation for this struct was generated from the following file:
  • DiscreteCollisionDetectorInterface.h
Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

DiscreteCollisionDetectorInterface::ClosestPointInput Member List

This is the complete list of members for DiscreteCollisionDetectorInterface::ClosestPointInput, including all inherited members.

ClosestPointInput() | DiscreteCollisionDetectorInterface::ClosestPointInput | [inline]
m_maximumDistanceSquared | DiscreteCollisionDetectorInterface::ClosestPointInput |
m_transformA | DiscreteCollisionDetectorInterface::ClosestPointInput |
m_transformB | DiscreteCollisionDetectorInterface::ClosestPointInput |

Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DiscreteCollisionDetectorInterface::Result Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
DiscreteCollisionDetectorInterface::Result

DiscreteCollisionDetectorInterface::Result Struct Reference

#include <DiscreteCollisionDetectorInterface.h>

Inheritance diagram for DiscreteCollisionDetectorInterface::Result:

[legend]
List of all members.

Public Member Functions

void | operator delete (void *ptr)
virtual | ~Result ()
virtual void | AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)=0

Detailed Description

Definition at line 32 of file DiscreteCollisionDetectorInterface.h.

Constructor & Destructor Documentation

virtual DiscreteCollisionDetectorInterface::Result::~Result ( ) [inline, virtual]

Definition at line 36 of file DiscreteCollisionDetectorInterface.h.

Member Function Documentation

virtual void DiscreteCollisionDetectorInterface::Result::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [pure virtual]

Implemented in FlippedContactResult, ManifoldResult, StorageResult, ManifoldContactAddResult, MyResult, and PointCollector.

Referenced by FlippedContactResult::AddContactPoint().

void DiscreteCollisionDetectorInterface::Result::operator delete ( void * ptr ) [inline]

Definition at line 34 of file DiscreteCollisionDetectorInterface.h.

The documentation for this struct was generated from the following file:
  • DiscreteCollisionDetectorInterface.h
Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

DiscreteCollisionDetectorInterface::Result Member List

This is the complete list of members for DiscreteCollisionDetectorInterface::Result, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)=0 | DiscreteCollisionDetectorInterface::Result | [pure virtual]
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]

Generated on Wed May 24 14:00:14 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Dispatcher Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Dispatcher Class Reference

Dispatcher can be used in combination with broadphase to dispatch overlapping pairs. More...

#include <Dispatcher.h>

Inheritance diagram for Dispatcher:

[legend]
List of all members.

Public Member Functions

virtual | ~Dispatcher ()
virtual CollisionAlgorithm * | FindAlgorithm (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)=0
virtual int | GetUniqueId ()=0
virtual PersistentManifold * | GetNewManifold (void *body0, void *body1)=0
virtual void | ReleaseManifold (PersistentManifold *manifold)=0
virtual void | ClearManifold (PersistentManifold *manifold)=0
virtual bool | NeedsCollision (BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)=0
virtual ManifoldResult * | GetNewManifoldResult (CollisionObject *obj0, CollisionObject *obj1, PersistentManifold *manifold)=0
virtual void | ReleaseManifoldResult (ManifoldResult *)=0

Detailed Description

Dispatcher can be used in combination with broadphase to dispatch overlapping pairs.

For example for pairwise collision detection or user callbacks (game logic).

Definition at line 61 of file Dispatcher.h.

Constructor & Destructor Documentation

Dispatcher::~Dispatcher ( ) [virtual]

Definition at line 18 of file Dispatcher.cpp.

Member Function Documentation

virtual void Dispatcher::ClearManifold ( PersistentManifold * manifold ) [pure virtual]

Implemented in CollisionDispatcher.

Referenced by BoxTriangleCallback::ClearCache(), ConvexConvexAlgorithm::ProcessCollision(), and ConvexConcaveCollisionAlgorithm::ProcessCollision().

virtual CollisionAlgorithm* Dispatcher::FindAlgorithm | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) | [pure virtual]

Implemented in CollisionDispatcher.

Referenced by SimpleBroadphase::DispatchAllCollisionPairs().

virtual PersistentManifold* Dispatcher::GetNewManifold | ( | void * | body0,
 |  | void * | body1
 | ) | [pure virtual]

Implemented in CollisionDispatcher.

Referenced by BoxTriangleCallback::BoxTriangleCallback(), and ConvexConvexAlgorithm::ConvexConvexAlgorithm().

virtual ManifoldResult* Dispatcher::GetNewManifoldResult | ( | CollisionObject * | obj0,
 |  | CollisionObject * | obj1,
 |  | PersistentManifold * | manifold
 | ) | [pure virtual]

Implemented in CollisionDispatcher.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

virtual int Dispatcher::GetUniqueId ( ) [pure virtual]

Implemented in CollisionDispatcher.

Referenced by SimpleBroadphase::DispatchAllCollisionPairs().

virtual bool Dispatcher::NeedsCollision | ( | BroadphaseProxy & | proxy0,
 |  | BroadphaseProxy & | proxy1
 | ) | [pure virtual]

Implemented in CollisionDispatcher.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact(), ConvexConvexAlgorithm::ConvexConvexAlgorithm(), ConvexConvexAlgorithm::ProcessCollision(), and ConvexConcaveCollisionAlgorithm::ProcessCollision().

virtual void Dispatcher::ReleaseManifold ( PersistentManifold * manifold ) [pure virtual]

Implemented in CollisionDispatcher.

Referenced by BoxTriangleCallback::~BoxTriangleCallback(), and ConvexConvexAlgorithm::~ConvexConvexAlgorithm().

virtual void Dispatcher::ReleaseManifoldResult ( ManifoldResult * ) [pure virtual]

Implemented in CollisionDispatcher.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

The documentation for this class was generated from the following files:
  • Dispatcher.h
  • Dispatcher.cpp
Generated on Wed May 24 14:00:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Dispatcher Member List

This is the complete list of members for Dispatcher, including all inherited members.

ClearManifold(PersistentManifold *manifold)=0 | Dispatcher | [pure virtual]
FindAlgorithm(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)=0 | Dispatcher | [pure virtual]
GetNewManifold(void *body0, void *body1)=0 | Dispatcher | [pure virtual]
GetNewManifoldResult(CollisionObject *obj0, CollisionObject *obj1, PersistentManifold *manifold)=0 | Dispatcher | [pure virtual]
GetUniqueId()=0 | Dispatcher | [pure virtual]
NeedsCollision(BroadphaseProxy &proxy0, BroadphaseProxy &proxy1)=0 | Dispatcher | [pure virtual]
ReleaseManifold(PersistentManifold *manifold)=0 | Dispatcher | [pure virtual]
ReleaseManifoldResult(ManifoldResult *)=0 | Dispatcher | [pure virtual]
~Dispatcher() | Dispatcher | [virtual]

Generated on Wed May 24 14:00:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: DispatcherInfo Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

DispatcherInfo Struct Reference

#include <Dispatcher.h>

Collaboration diagram for DispatcherInfo:

[legend]
List of all members.

Public Types

enum DispatchFunc {
DISPATCH_DISCRETE = 1,
DISPATCH_CONTINUOUS
}

Public Member Functions

DispatcherInfo ()

Public Attributes

float | m_timeStep
int | m_stepCount
int | m_dispatchFunc
float | m_timeOfImpact
bool | m_useContinuous
IDebugDraw * m_debugDraw
bool | m_enableSatConvex

Detailed Description

Definition at line 33 of file Dispatcher.h.

Member Enumeration Documentation

enum DispatcherInfo::DispatchFunc

Enumerator:
DISPATCH_DISCRETE
DISPATCH_CONTINUOUS

Definition at line 35 of file Dispatcher.h.

Constructor & Destructor Documentation

DispatcherInfo::DispatcherInfo ( ) [inline]

Definition at line 40 of file Dispatcher.h.

Member Data Documentation

class IDebugDraw* DispatcherInfo::m_debugDraw

Definition at line 54 of file Dispatcher.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

int DispatcherInfo::m_dispatchFunc

Definition at line 51 of file Dispatcher.h.

Referenced by SimpleBroadphase::DispatchAllCollisionPairs().

bool DispatcherInfo::m_enableSatConvex

Definition at line 55 of file Dispatcher.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

int DispatcherInfo::m_stepCount

Definition at line 50 of file Dispatcher.h.

Referenced by CollisionWorld::PerformDiscreteCollisionDetection().

float DispatcherInfo::m_timeOfImpact

Definition at line 52 of file Dispatcher.h.

Referenced by SimpleBroadphase::DispatchAllCollisionPairs().

float DispatcherInfo::m_timeStep

Definition at line 49 of file Dispatcher.h.

Referenced by CollisionWorld::PerformDiscreteCollisionDetection().

bool DispatcherInfo::m_useContinuous

Definition at line 53 of file Dispatcher.h.

The documentation for this struct was generated from the following file:
  • Dispatcher.h
Generated on Wed May 24 14:00:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

DispatcherInfo Member List

This is the complete list of members for DispatcherInfo, including all inherited members.

DISPATCH_CONTINUOUS enum value | DispatcherInfo |
DISPATCH_DISCRETE enum value | DispatcherInfo |
DispatcherInfo() | DispatcherInfo | [inline]
DispatchFunc enum name | DispatcherInfo |
m_debugDraw | DispatcherInfo |
m_dispatchFunc | DispatcherInfo |
m_enableSatConvex | DispatcherInfo |
m_stepCount | DispatcherInfo |
m_timeOfImpact | DispatcherInfo |
m_timeStep | DispatcherInfo |
m_useContinuous | DispatcherInfo |

Generated on Wed May 24 14:00:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyAlgorithm Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EmptyAlgorithm Class Reference

EmptyAlgorithm is a stub for unsupported collision pairs. More...

#include <EmptyCollisionAlgorithm.h>

Inheritance diagram for EmptyAlgorithm:

[legend]
Collaboration diagram for EmptyAlgorithm:

[legend]
List of all members.

Public Member Functions

EmptyAlgorithm (const CollisionAlgorithmConstructionInfo &ci)
virtual void | ProcessCollision (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo)
virtual float | CalculateTimeOfImpact (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo)

Detailed Description

EmptyAlgorithm is a stub for unsupported collision pairs.

The dispatcher can dispatch a persistent EmptyAlgorithm to avoid a search every frame.

Definition at line 24 of file EmptyCollisionAlgorithm.h.

Constructor & Destructor Documentation

EmptyAlgorithm::EmptyAlgorithm ( const CollisionAlgorithmConstructionInfo & ci )

Definition at line 20 of file EmptyCollisionAlgorithm.cpp.

Member Function Documentation

float EmptyAlgorithm::CalculateTimeOfImpact | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const DispatcherInfo & | dispatchInfo
 | ) | [virtual]

Definition at line 30 of file EmptyCollisionAlgorithm.cpp.

void EmptyAlgorithm::ProcessCollision | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1,
 |  | const DispatcherInfo & | dispatchInfo
 | ) | [virtual]

Definition at line 25 of file EmptyCollisionAlgorithm.cpp.

The documentation for this class was generated from the following files:
  • EmptyCollisionAlgorithm.h
  • EmptyCollisionAlgorithm.cpp
Generated on Wed May 24 14:00:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EmptyAlgorithm Member List

This is the complete list of members for EmptyAlgorithm, including all inherited members.

CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo) | EmptyAlgorithm | [virtual]
CollisionAlgorithm::CalculateTimeOfImpact(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
CollisionAlgorithm() | CollisionAlgorithm | [inline]
CollisionAlgorithm(const CollisionAlgorithmConstructionInfo &ci) | CollisionAlgorithm |
EmptyAlgorithm(const CollisionAlgorithmConstructionInfo &ci) | EmptyAlgorithm |
GetDispatcherId() | CollisionAlgorithm | [protected]
m_dispatcher | CollisionAlgorithm | [protected]
ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const DispatcherInfo &dispatchInfo) | EmptyAlgorithm | [virtual]
CollisionAlgorithm::ProcessCollision(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1, const struct DispatcherInfo &dispatchInfo)=0 | CollisionAlgorithm | [pure virtual]
~CollisionAlgorithm() | CollisionAlgorithm | [inline, virtual]

Generated on Wed May 24 14:00:15 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EmptyShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EmptyShape Class Reference

EmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime. More...

#include <EmptyShape.h>

Inheritance diagram for EmptyShape:

[legend]
Collaboration diagram for EmptyShape:

[legend]
List of all members.

Public Member Functions

EmptyShape ()
virtual | ~EmptyShape ()
void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
virtual void | setLocalScaling (const SimdVector3 &scaling)
virtual const SimdVector3 & | getLocalScaling () const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual int | GetShapeType () const
virtual void | SetMargin (float margin)
virtual float | GetMargin () const
virtual char * | GetName () const

Protected Attributes

SimdVector3 m_localScaling

Private Attributes

SimdScalar m_collisionMargin

Detailed Description

EmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime.

Definition at line 31 of file EmptyShape.h.

Constructor & Destructor Documentation

EmptyShape::EmptyShape ( )

Definition at line 22 of file EmptyShape.cpp.

EmptyShape::~EmptyShape ( ) [virtual]

Definition at line 27 of file EmptyShape.cpp.

Member Function Documentation

void EmptyShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

Implements CollisionShape.

Definition at line 43 of file EmptyShape.cpp.

void EmptyShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [virtual]

GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.

Implements CollisionShape.

Definition at line 33 of file EmptyShape.cpp.

References GetMargin(), and SimdTransform::getOrigin().

virtual const SimdVector3& EmptyShape::getLocalScaling ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 47 of file EmptyShape.h.

References m_localScaling.

virtual float EmptyShape::GetMargin ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 60 of file EmptyShape.h.

References m_collisionMargin.

Referenced by GetAabb().

virtual char* EmptyShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 64 of file EmptyShape.h.

virtual int EmptyShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 54 of file EmptyShape.h.

References EMPTY_SHAPE_PROXYTYPE.

virtual void EmptyShape::setLocalScaling ( const SimdVector3 & scaling ) [inline, virtual]

Implements CollisionShape.

Definition at line 43 of file EmptyShape.h.

References m_localScaling.

virtual void EmptyShape::SetMargin ( float margin ) [inline, virtual]

Implements CollisionShape.

Definition at line 56 of file EmptyShape.h.

References m_collisionMargin.

Member Data Documentation

SimdScalar EmptyShape::m_collisionMargin [private]

Definition at line 71 of file EmptyShape.h.

Referenced by GetMargin(), and SetMargin().

SimdVector3 EmptyShape::m_localScaling [protected]

Definition at line 73 of file EmptyShape.h.

Referenced by getLocalScaling(), and setLocalScaling().

The documentation for this class was generated from the following files:
  • EmptyShape.h
  • EmptyShape.cpp
Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EmptyShape Member List

This is the complete list of members for EmptyShape, including all inherited members.

CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | EmptyShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
EmptyShape() | EmptyShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | EmptyShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | EmptyShape | [inline, virtual]
GetMargin() const | EmptyShape | [inline, virtual]
GetName() const | EmptyShape | [inline, virtual]
GetShapeType() const | EmptyShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
m_collisionMargin | EmptyShape | [private]
m_localScaling | EmptyShape | [protected]
m_tempDebug | CollisionShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | EmptyShape | [inline, virtual]
SetMargin(float margin) | EmptyShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~EmptyShape() | EmptyShape | [virtual]

Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Epa Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Epa Class Reference

#include <Epa.h>

Collaboration diagram for Epa:

[legend]
List of all members.

Public Member Functions

Epa (ConvexShape *pConvexShapeA, ConvexShape *pConvexShapeB, const SimdTransform &transformA, const SimdTransform &transformB)
~Epa ()
bool | Initialize (SimplexSolverInterface &simplexSolver)
SimdScalar | CalcPenDepth (SimdPoint3 &wWitnessOnA, SimdPoint3 &wWitnessOnB)

Private Member Functions

Epa (const Epa &epa)
Prevents copying objects from this class.
const Epa & | operator= (const Epa &epa)
bool | TetrahedronContainsOrigin (SimdPoint3 *pPoints)
bool | TetrahedronContainsOrigin (const SimdPoint3 &point0, const SimdPoint3 &point1, const SimdPoint3 &point2, const SimdPoint3 &point3)

Private Attributes

std::vector< EpaFace * > | m_faceEntries
Priority queue.
ConvexShape * m_pConvexShapeA
ConvexShape * m_pConvexShapeB
SimdTransform m_transformA
SimdTransform m_transformB
EpaPolyhedron m_polyhedron

Detailed Description

Definition at line 25 of file Epa.h.

Constructor & Destructor Documentation

Epa::Epa ( const Epa & epa ) [private]

Prevents copying objects from this class.

Epa::Epa | ( | ConvexShape * | pConvexShapeA,
 |  | ConvexShape * | pConvexShapeB,
 |  | const SimdTransform & | transformA,
 |  | const SimdTransform & | transformB
 | ) |

Definition at line 43 of file Epa.cpp.

References EPA_MAX_FACE_ENTRIES, and m_faceEntries.

Epa::~Epa ( )

Definition at line 52 of file Epa.cpp.

Member Function Documentation

SimdScalar Epa::CalcPenDepth | ( | SimdPoint3 & | wWitnessOnA,
 |  | SimdPoint3 & | wWitnessOnB
 | ) |

Definition at line 392 of file Epa.cpp.

References EpaFace::CalcClosestPointOnA(), EpaFace::CalcClosestPointOnB(), CompareEpaFaceEntries(), SimdVector3::dot(), EPA_MAX_FACE_ENTRIES, SimdVector3::length(), SimdVector3::length2(), EpaFace::m_deleted, EpaFace::m_v, EpaFace::m_vSqrd, SIMD_INFINITY, and SimdMin.

bool Epa::Initialize ( SimplexSolverInterface & simplexSolver )

Definition at line 56 of file Epa.cpp.

References EpaPolyhedron::Create(), SimdVector3::cross(), SimdVector3::dot(), SimdTransform::getBasis(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), SimdVector3::length2(), ConvexShape::LocalGetSupportingVertex(), m_pConvexShapeA, m_pConvexShapeB, m_polyhedron, m_transformA, m_transformB, SimdVector3::normalize(), SimdVector3::rotate(), SimdQuadWord::setX(), SimdQuadWord::setY(), SimdQuadWord::setZ(), SIMD_EPSILON, SIMD_INFINITY, SIMD_RADS_PER_DEG, and TetrahedronContainsOrigin().

Referenced by EpaPenetrationDepthSolver::EpaPenDepth().

const Epa& Epa::operator= ( const Epa & epa ) [private]

bool Epa::TetrahedronContainsOrigin | ( | const SimdPoint3 & | point0,
 |  | const SimdPoint3 & | point1,
 |  | const SimdPoint3 & | point2,
 |  | const SimdPoint3 & | point3
 | ) | [private]

Definition at line 538 of file Epa.cpp.

References cross(), SimdVector3::dot(), and dot().

bool Epa::TetrahedronContainsOrigin ( SimdPoint3 * pPoints ) [private]

Definition at line 552 of file Epa.cpp.

Referenced by Initialize().

Member Data Documentation

std::vector< EpaFace* > Epa::m_faceEntries [private]

Priority queue.

Definition at line 52 of file Epa.h.

Referenced by Epa().

ConvexShape* Epa::m_pConvexShapeA [private]

Definition at line 54 of file Epa.h.

Referenced by Initialize().

ConvexShape* Epa::m_pConvexShapeB [private]

Definition at line 55 of file Epa.h.

Referenced by Initialize().

EpaPolyhedron Epa::m_polyhedron [private]

Definition at line 60 of file Epa.h.

Referenced by Initialize().

SimdTransform Epa::m_transformA [private]

Definition at line 57 of file Epa.h.

Referenced by Initialize().

SimdTransform Epa::m_transformB [private]

Definition at line 58 of file Epa.h.

Referenced by Initialize().

The documentation for this class was generated from the following files:
  • Epa.h
  • Epa.cpp
Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Epa Member List

This is the complete list of members for Epa, including all inherited members.

CalcPenDepth(SimdPoint3 &wWitnessOnA, SimdPoint3 &wWitnessOnB) | Epa |
Epa(const Epa &epa) | Epa | [private]
Epa(ConvexShape *pConvexShapeA, ConvexShape *pConvexShapeB, const SimdTransform &transformA, const SimdTransform &transformB) | Epa |
Initialize(SimplexSolverInterface &simplexSolver) | Epa |
m_faceEntries | Epa | [private]
m_pConvexShapeA | Epa | [private]
m_pConvexShapeB | Epa | [private]
m_polyhedron | Epa | [private]
m_transformA | Epa | [private]
m_transformB | Epa | [private]
operator=(const Epa &epa) | Epa | [private]
TetrahedronContainsOrigin(SimdPoint3 *pPoints) | Epa | [private]
TetrahedronContainsOrigin(const SimdPoint3 &point0, const SimdPoint3 &point1, const SimdPoint3 &point2, const SimdPoint3 &point3) | Epa | [private]
~Epa() | Epa |

Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaFace Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EpaFace Class Reference

Note : This class is not supposed to be a base class. More...

#include <EpaFace.h>

Collaboration diagram for EpaFace:

[legend]
List of all members.

Public Member Functions

EpaFace ()
~EpaFace ()
bool | Initialize ()
void | CalcClosestPoint ()
void | CalcClosestPointOnA (SimdVector3 &closestPointOnA)
void | CalcClosestPointOnB (SimdVector3 &closestPointOnB)
bool | IsAffinelyDependent () const
bool | IsClosestPointInternal () const
void | CollectVertices (EpaVertex **ppVertices)

Public Attributes

EpaHalfEdge * m_pHalfEdge
EpaVertex * | m_pVertices [3]
SimdVector3 m_v
SimdScalar m_vSqrd
SimdScalar m_determinant
SimdScalar | m_lambdas [2]
bool | m_deleted

Private Member Functions

EpaFace (const EpaFace &epaFace)
Prevents copying objects from this class.
const EpaFace & | operator= (const EpaFace &epaFace)

Detailed Description

Note : This class is not supposed to be a base class.

Definition at line 28 of file EpaFace.h.

Constructor & Destructor Documentation

EpaFace::EpaFace ( const EpaFace & epaFace ) [private]

Prevents copying objects from this class.

EpaFace::EpaFace ( )

Definition at line 31 of file EpaFace.cpp.

References m_pVertices.

EpaFace::~EpaFace ( )

Definition at line 36 of file EpaFace.cpp.

Member Function Documentation

void EpaFace::CalcClosestPoint ( )

Definition at line 143 of file EpaFace.cpp.

References SimdVector3::length2(), m_determinant, m_lambdas, EpaVertex::m_point, m_pVertices, m_v, and m_vSqrd.

Referenced by Initialize().

void EpaFace::CalcClosestPointOnA ( SimdVector3 & closestPointOnA )

Definition at line 154 of file EpaFace.cpp.

References m_determinant, m_lambdas, m_pVertices, and EpaVertex::m_wSupportPointOnA.

Referenced by Epa::CalcPenDepth().

void EpaFace::CalcClosestPointOnB ( SimdVector3 & closestPointOnB )

Definition at line 164 of file EpaFace.cpp.

References m_determinant, m_lambdas, m_pVertices, and EpaVertex::m_wSupportPointOnB.

Referenced by Epa::CalcPenDepth().

void EpaFace::CollectVertices ( EpaVertex ** ppVertices )

Definition at line 184 of file EpaFace.cpp.

References m_pHalfEdge, EpaHalfEdge::m_pNextCCW, and EpaHalfEdge::m_pVertex.

Referenced by Initialize().

bool EpaFace::Initialize ( )

Definition at line 40 of file EpaFace.cpp.

References CalcClosestPoint(), CollectVertices(), SimdVector3::dot(), IsAffinelyDependent(), SimdVector3::length2(), m_determinant, m_lambdas, m_pHalfEdge, EpaVertex::m_point, and m_pVertices.

Referenced by EpaPolyhedron::Create().

bool EpaFace::IsAffinelyDependent ( ) const

Definition at line 174 of file EpaFace.cpp.

References m_determinant, and SIMD_EPSILON.

Referenced by Initialize().

bool EpaFace::IsClosestPointInternal ( ) const

Definition at line 179 of file EpaFace.cpp.

References m_determinant, and m_lambdas.

const EpaFace& EpaFace::operator= ( const EpaFace & epaFace ) [private]

Member Data Documentation

bool EpaFace::m_deleted

Definition at line 79 of file EpaFace.h.

Referenced by Epa::CalcPenDepth(), EpaPolyhedron::DeleteFace(), EpaPolyhedron::DeleteVisibleFaces(), and EpaPolyhedron::Expand().

SimdScalar EpaFace::m_determinant

Definition at line 76 of file EpaFace.h.

Referenced by CalcClosestPoint(), CalcClosestPointOnA(), CalcClosestPointOnB(), Initialize(), IsAffinelyDependent(), and IsClosestPointInternal().

SimdScalar EpaFace::m_lambdas[2]

Definition at line 77 of file EpaFace.h.

Referenced by CalcClosestPoint(), CalcClosestPointOnA(), CalcClosestPointOnB(), Initialize(), and IsClosestPointInternal().

EpaHalfEdge* EpaFace::m_pHalfEdge

Definition at line 59 of file EpaFace.h.

Referenced by CollectVertices(), EpaPolyhedron::Create(), EpaPolyhedron::CreateConeFace(), EpaPolyhedron::DeleteVisibleFaces(), and Initialize().

EpaVertex* EpaFace::m_pVertices[3]

Definition at line 63 of file EpaFace.h.

Referenced by CalcClosestPoint(), CalcClosestPointOnA(), CalcClosestPointOnB(), EpaFace(), and Initialize().

SimdVector3 EpaFace::m_v

Definition at line 73 of file EpaFace.h.

Referenced by CalcClosestPoint(), Epa::CalcPenDepth(), and EpaPolyhedron::DeleteVisibleFaces().

SimdScalar EpaFace::m_vSqrd

Definition at line 74 of file EpaFace.h.

Referenced by CalcClosestPoint(), Epa::CalcPenDepth(), CompareEpaFaceEntries(), and EpaPolyhedron::DeleteVisibleFaces().

The documentation for this class was generated from the following files:
  • EpaFace.h
  • EpaFace.cpp
Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EpaFace Member List

This is the complete list of members for EpaFace, including all inherited members.

CalcClosestPoint() | EpaFace |
CalcClosestPointOnA(SimdVector3 &closestPointOnA) | EpaFace |
CalcClosestPointOnB(SimdVector3 &closestPointOnB) | EpaFace |
CollectVertices(EpaVertex **ppVertices) | EpaFace |
EpaFace(const EpaFace &epaFace) | EpaFace | [private]
EpaFace() | EpaFace |
Initialize() | EpaFace |
IsAffinelyDependent() const | EpaFace |
IsClosestPointInternal() const | EpaFace |
m_deleted | EpaFace |
m_determinant | EpaFace |
m_lambdas | EpaFace |
m_pHalfEdge | EpaFace |
m_pVertices | EpaFace |
m_v | EpaFace |
m_vSqrd | EpaFace |
operator=(const EpaFace &epaFace) | EpaFace | [private]
~EpaFace() | EpaFace |

Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaHalfEdge Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EpaHalfEdge Class Reference

Note : This class is not supposed to be a base class. More...

#include <EpaHalfEdge.h>

Collaboration diagram for EpaHalfEdge:

[legend]
List of all members.

Public Member Functions

EpaHalfEdge ()
~EpaHalfEdge ()

Public Attributes

EpaHalfEdge * m_pTwin
Twin half-edge link.
EpaHalfEdge * m_pNextCCW
Next half-edge in counter clock-wise ( CCW ) order.
EpaFace * m_pFace
Parent face link.
EpaVertex * m_pVertex
Origin vertex link.

Private Member Functions

EpaHalfEdge (const EpaHalfEdge &epaHalfEdge)
Prevents copying objects from this class.
const EpaHalfEdge & operator= (const EpaHalfEdge &epaHalfEdge)

Detailed Description

Note : This class is not supposed to be a base class.

Definition at line 24 of file EpaHalfEdge.h.

Constructor & Destructor Documentation

EpaHalfEdge::EpaHalfEdge ( const EpaHalfEdge & epaHalfEdge ) [private]

Prevents copying objects from this class.

EpaHalfEdge::EpaHalfEdge ( ) [inline]

Definition at line 34 of file EpaHalfEdge.h.

EpaHalfEdge::~EpaHalfEdge ( ) [inline]

Definition at line 38 of file EpaHalfEdge.h.

Member Function Documentation

const EpaHalfEdge& EpaHalfEdge::operator= ( const EpaHalfEdge & epaHalfEdge ) [private]

Member Data Documentation

EpaFace* EpaHalfEdge::m_pFace

Parent face link.

Definition at line 51 of file EpaHalfEdge.h.

Referenced by EpaPolyhedron::Create(), EpaPolyhedron::CreateConeFace(), and EpaPolyhedron::DeleteVisibleFaces().

EpaHalfEdge* EpaHalfEdge::m_pNextCCW

Next half-edge in counter clock-wise ( CCW ) order.

Definition at line 48 of file EpaHalfEdge.h.

Referenced by EpaFace::CollectVertices(), EpaPolyhedron::Create(), EpaPolyhedron::CreateConeFace(), and EpaPolyhedron::DeleteVisibleFaces().

EpaHalfEdge* EpaHalfEdge::m_pTwin

Twin half-edge link.

Definition at line 45 of file EpaHalfEdge.h.

Referenced by EpaPolyhedron::Create(), EpaPolyhedron::CreateConeFace(), and EpaPolyhedron::DeleteVisibleFaces().

EpaVertex* EpaHalfEdge::m_pVertex

Origin vertex link.

Definition at line 54 of file EpaHalfEdge.h.

Referenced by EpaFace::CollectVertices(), EpaPolyhedron::Create(), and EpaPolyhedron::CreateConeFace().

The documentation for this class was generated from the following file:
  • EpaHalfEdge.h
Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EpaHalfEdge Member List

This is the complete list of members for EpaHalfEdge, including all inherited members.

EpaHalfEdge(const EpaHalfEdge &epaHalfEdge) | EpaHalfEdge | [private]
EpaHalfEdge() | EpaHalfEdge | [inline]
m_pFace | EpaHalfEdge |
m_pNextCCW | EpaHalfEdge |
m_pTwin | EpaHalfEdge |
m_pVertex | EpaHalfEdge |
operator=(const EpaHalfEdge &epaHalfEdge) | EpaHalfEdge | [private]
~EpaHalfEdge() | EpaHalfEdge | [inline]

Generated on Wed May 24 14:00:16 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPenetrationDepthSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EpaPenetrationDepthSolver Class Reference

Note : This class is not supposed to be a base class. More...

#include <EpaPenetrationDepthSolver.h>

Inheritance diagram for EpaPenetrationDepthSolver:

[legend]
Collaboration diagram for EpaPenetrationDepthSolver:

[legend]
List of all members.

Public Member Functions

bool | CalcPenDepth (SimplexSolverInterface &simplexSolver, ConvexShape *pConvexA, ConvexShape *pConvexB, const SimdTransform &transformA, const SimdTransform &transformB, SimdVector3 &v, SimdPoint3 &wWitnessOnA, SimdPoint3 &wWitnessOnB, class IDebugDraw *debugDraw)

Private Member Functions

SimdScalar | EpaPenDepth (SimplexSolverInterface &simplexSolver, ConvexShape *pConvexA, ConvexShape *pConvexB, const SimdTransform &transformA, const SimdTransform &transformB, SimdPoint3 &wWitnessOnA, SimdPoint3 &wWitnessOnB)

Detailed Description

Note : This class is not supposed to be a base class.

Definition at line 29 of file EpaPenetrationDepthSolver.h.

Member Function Documentation

bool EpaPenetrationDepthSolver::CalcPenDepth | ( | SimplexSolverInterface & | simplexSolver,
 |  | ConvexShape * | pConvexA,
 |  | ConvexShape * | pConvexB,
 |  | const SimdTransform & | transformA,
 |  | const SimdTransform & | transformB,
 |  | SimdVector3 & | v,
 |  | SimdPoint3 & | wWitnessOnA,
 |  | SimdPoint3 & | wWitnessOnB,
 |  | class IDebugDraw * | debugDraw
 | ) | [virtual]

Implements ConvexPenetrationDepthSolver.

Definition at line 42 of file EpaPenetrationDepthSolver.cpp.

References EpaPenDepth().

SimdScalar EpaPenetrationDepthSolver::EpaPenDepth | ( | SimplexSolverInterface & | simplexSolver,
 |  | ConvexShape * | pConvexA,
 |  | ConvexShape * | pConvexB,
 |  | const SimdTransform & | transformA,
 |  | const SimdTransform & | transformB,
 |  | SimdPoint3 & | wWitnessOnA,
 |  | SimdPoint3 & | wWitnessOnB
 | ) | [private]

Definition at line 187 of file EpaPenetrationDepthSolver.cpp.

References Epa::Initialize().

Referenced by CalcPenDepth().

The documentation for this class was generated from the following files:
  • EpaPenetrationDepthSolver.h
  • EpaPenetrationDepthSolver.cpp
Generated on Wed May 24 14:00:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EpaPenetrationDepthSolver Member List

This is the complete list of members for EpaPenetrationDepthSolver, including all inherited members.

CalcPenDepth(SimplexSolverInterface &simplexSolver, ConvexShape *pConvexA, ConvexShape *pConvexB, const SimdTransform &transformA, const SimdTransform &transformB, SimdVector3 &v, SimdPoint3 &wWitnessOnA, SimdPoint3 &wWitnessOnB, class IDebugDraw *debugDraw) | EpaPenetrationDepthSolver | [virtual]
EpaPenDepth(SimplexSolverInterface &simplexSolver, ConvexShape *pConvexA, ConvexShape *pConvexB, const SimdTransform &transformA, const SimdTransform &transformB, SimdPoint3 &wWitnessOnA, SimdPoint3 &wWitnessOnB) | EpaPenetrationDepthSolver | [private]
~ConvexPenetrationDepthSolver() | ConvexPenetrationDepthSolver | [inline, virtual]

Generated on Wed May 24 14:00:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaPolyhedron Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EpaPolyhedron Class Reference

Note : This class is not supposed to be a base class. More...

#include <EpaPolyhedron.h>

List of all members.

Public Member Functions

EpaPolyhedron ()
~EpaPolyhedron ()
bool | Create (SimdPoint3 *pInitialPoints, SimdPoint3 *pSupportPointsOnA, SimdPoint3 *pSupportPointsOnB, const int nbInitialPoints)
void | Destroy ()
EpaFace * CreateFace ()
EpaHalfEdge * CreateHalfEdge ()
EpaVertex * | CreateVertex (const SimdPoint3 &wSupportPoint, const SimdPoint3 &wSupportPointOnA, const SimdPoint3 &wSupportPointOnB)
void | DeleteFace (EpaFace *pFace)
void | DestroyAllFaces ()
void | DestroyAllHalfEdges ()
void | DestroyAllVertices ()
bool | Expand (const SimdPoint3 &wSupportPoint, const SimdPoint3 &wSupportPointOnA, const SimdPoint3 &wSupportPointOnB, EpaFace *pFace, std::list< EpaFace * > &newFaces)
std::list< EpaFace * > & | GetFaces ()
int | GetNbFaces () const

Private Member Functions

EpaPolyhedron (const EpaPolyhedron &epaPolyhedron)
Prevents copying objects from this class.
const EpaPolyhedron & | operator= (const EpaPolyhedron &epaPolyhedron)
void | DeleteVisibleFaces (const SimdPoint3 &point, EpaFace *pFace, std::list< EpaHalfEdge * > &coneBaseTwinHalfEdges)
void | CreateCone (EpaVertex *pAppexVertex, std::list< EpaHalfEdge * > &baseTwinHalfEdges, std::list< EpaFace * > &newFaces)
EpaFace * | CreateConeFace (EpaVertex *pAppexVertex, EpaHalfEdge *pBaseTwinHalfEdge, std::list< EpaHalfEdge * > &halfEdgesToLink)

Private Attributes

int | m_nbFaces
This is the number of valid faces, m_faces list also contain deleted faces.
std::list< EpaFace * > | m_faces
std::list< EpaHalfEdge * > | m_halfEdges
std::list< EpaVertex * > | m_vertices

Detailed Description

Note : This class is not supposed to be a base class.

Definition at line 24 of file EpaPolyhedron.h.

Constructor & Destructor Documentation

EpaPolyhedron::EpaPolyhedron ( const EpaPolyhedron & epaPolyhedron ) [private]

Prevents copying objects from this class.

EpaPolyhedron::EpaPolyhedron ( )

Definition at line 36 of file EpaPolyhedron.cpp.

EpaPolyhedron::~EpaPolyhedron ( )

Definition at line 40 of file EpaPolyhedron.cpp.

References Destroy().

Member Function Documentation

bool EpaPolyhedron::Create | ( | SimdPoint3 * | pInitialPoints,
 |  | SimdPoint3 * | pSupportPointsOnA,
 |  | SimdPoint3 * | pSupportPointsOnB,
 |  | const int | nbInitialPoints
 | ) |

Definition at line 45 of file EpaPolyhedron.cpp.

References CreateFace(), CreateHalfEdge(), CreateVertex(), SimdVector3::cross(), Destroy(), dot(), EpaFace::Initialize(), EpaHalfEdge::m_pFace, EpaFace::m_pHalfEdge, EpaHalfEdge::m_pNextCCW, EpaHalfEdge::m_pTwin, EpaHalfEdge::m_pVertex, SimdVector3::normalize(), SIMD_INFINITY, and SimdEqual().

Referenced by Epa::Initialize().

void EpaPolyhedron::CreateCone | ( | EpaVertex * | pAppexVertex,
 |  | std::list< EpaHalfEdge * > & | baseTwinHalfEdges,
 |  | std::list< EpaFace * > & | newFaces
 | ) | [private]

Definition at line 635 of file EpaPolyhedron.cpp.

References CreateConeFace().

Referenced by Expand().

EpaFace * EpaPolyhedron::CreateConeFace | ( | EpaVertex * | pAppexVertex,
 |  | EpaHalfEdge * | pBaseTwinHalfEdge,
 |  | std::list< EpaHalfEdge * > & | halfEdgesToLink
 | ) | [private]

Definition at line 688 of file EpaPolyhedron.cpp.

References CreateFace(), CreateHalfEdge(), EpaHalfEdge::m_pFace, EpaFace::m_pHalfEdge, EpaHalfEdge::m_pNextCCW, EpaHalfEdge::m_pTwin, and EpaHalfEdge::m_pVertex.

Referenced by CreateCone().

EpaFace * EpaPolyhedron::CreateFace ( )

Definition at line 455 of file EpaPolyhedron.cpp.

References m_faces, and m_nbFaces.

Referenced by Create(), and CreateConeFace().

EpaHalfEdge * EpaPolyhedron::CreateHalfEdge ( )

Definition at line 467 of file EpaPolyhedron.cpp.

References m_halfEdges.

Referenced by Create(), and CreateConeFace().

EpaVertex * EpaPolyhedron::CreateVertex | ( | const SimdPoint3 & | wSupportPoint,
 |  | const SimdPoint3 & | wSupportPointOnA,
 |  | const SimdPoint3 & | wSupportPointOnB
 | ) |

Definition at line 477 of file EpaPolyhedron.cpp.

References m_vertices.

Referenced by Create(), and Expand().

void EpaPolyhedron::DeleteFace ( EpaFace * pFace )

Definition at line 489 of file EpaPolyhedron.cpp.

References EpaFace::m_deleted, and m_nbFaces.

Referenced by DeleteVisibleFaces().

void EpaPolyhedron::DeleteVisibleFaces | ( | const SimdPoint3 & | point,
 |  | EpaFace * | pFace,
 |  | std::list< EpaHalfEdge * > & | coneBaseTwinHalfEdges
 | ) | [private]

Definition at line 592 of file EpaPolyhedron.cpp.

References DeleteFace(), SimdVector3::dot(), dot(), EpaFace::m_deleted, EpaHalfEdge::m_pFace, EpaFace::m_pHalfEdge, EpaHalfEdge::m_pNextCCW, EpaHalfEdge::m_pTwin, EpaFace::m_v, and EpaFace::m_vSqrd.

Referenced by Expand().

void EpaPolyhedron::Destroy ( )

Definition at line 446 of file EpaPolyhedron.cpp.

Referenced by Create(), and ~EpaPolyhedron().

void EpaPolyhedron::DestroyAllFaces ( )

Definition at line 495 of file EpaPolyhedron.cpp.

References m_faces.

void EpaPolyhedron::DestroyAllHalfEdges ( )

Definition at line 509 of file EpaPolyhedron.cpp.

References m_halfEdges.

void EpaPolyhedron::DestroyAllVertices ( )

Definition at line 521 of file EpaPolyhedron.cpp.

References m_vertices.

bool EpaPolyhedron::Expand | ( | const SimdPoint3 & | wSupportPoint,
 |  | const SimdPoint3 & | wSupportPointOnA,
 |  | const SimdPoint3 & | wSupportPointOnB,
 |  | EpaFace * | pFace,
 |  | std::list< EpaFace * > & | newFaces
 | ) |

Definition at line 533 of file EpaPolyhedron.cpp.

References CreateCone(), CreateVertex(), DeleteVisibleFaces(), and EpaFace::m_deleted.

std::list< EpaFace * > & EpaPolyhedron::GetFaces ( )

Definition at line 582 of file EpaPolyhedron.cpp.

References m_faces.

int EpaPolyhedron::GetNbFaces ( ) const

Definition at line 587 of file EpaPolyhedron.cpp.

References m_faces.

const EpaPolyhedron& EpaPolyhedron::operator= ( const EpaPolyhedron & epaPolyhedron ) [private]

Member Data Documentation

std::list< EpaFace* > EpaPolyhedron::m_faces [private]

Definition at line 83 of file EpaPolyhedron.h.

Referenced by CreateFace(), DestroyAllFaces(), GetFaces(), and GetNbFaces().

std::list< EpaHalfEdge* > EpaPolyhedron::m_halfEdges [private]

Definition at line 84 of file EpaPolyhedron.h.

Referenced by CreateHalfEdge(), and DestroyAllHalfEdges().

int EpaPolyhedron::m_nbFaces [private]

This is the number of valid faces, m_faces list also contain deleted faces.

Definition at line 81 of file EpaPolyhedron.h.

Referenced by CreateFace(), and DeleteFace().

std::list< EpaVertex* > EpaPolyhedron::m_vertices [private]

Definition at line 85 of file EpaPolyhedron.h.

Referenced by CreateVertex(), and DestroyAllVertices().

The documentation for this class was generated from the following files:
  • EpaPolyhedron.h
  • EpaPolyhedron.cpp
Generated on Wed May 24 14:00:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EpaPolyhedron Member List

This is the complete list of members for EpaPolyhedron, including all inherited members.

Create(SimdPoint3 *pInitialPoints, SimdPoint3 *pSupportPointsOnA, SimdPoint3 *pSupportPointsOnB, const int nbInitialPoints) | EpaPolyhedron |
CreateCone(EpaVertex *pAppexVertex, std::list< EpaHalfEdge * > &baseTwinHalfEdges, std::list< EpaFace * > &newFaces) | EpaPolyhedron | [private]
CreateConeFace(EpaVertex *pAppexVertex, EpaHalfEdge *pBaseTwinHalfEdge, std::list< EpaHalfEdge * > &halfEdgesToLink) | EpaPolyhedron | [private]
CreateFace() | EpaPolyhedron |
CreateHalfEdge() | EpaPolyhedron |
CreateVertex(const SimdPoint3 &wSupportPoint, const SimdPoint3 &wSupportPointOnA, const SimdPoint3 &wSupportPointOnB) | EpaPolyhedron |
DeleteFace(EpaFace *pFace) | EpaPolyhedron |
DeleteVisibleFaces(const SimdPoint3 &point, EpaFace *pFace, std::list< EpaHalfEdge * > &coneBaseTwinHalfEdges) | EpaPolyhedron | [private]
Destroy() | EpaPolyhedron |
DestroyAllFaces() | EpaPolyhedron |
DestroyAllHalfEdges() | EpaPolyhedron |
DestroyAllVertices() | EpaPolyhedron |
EpaPolyhedron(const EpaPolyhedron &epaPolyhedron) | EpaPolyhedron | [private]
EpaPolyhedron() | EpaPolyhedron |
Expand(const SimdPoint3 &wSupportPoint, const SimdPoint3 &wSupportPointOnA, const SimdPoint3 &wSupportPointOnB, EpaFace *pFace, std::list< EpaFace * > &newFaces) | EpaPolyhedron |
GetFaces() | EpaPolyhedron |
GetNbFaces() const | EpaPolyhedron |
m_faces | EpaPolyhedron | [private]
m_halfEdges | EpaPolyhedron | [private]
m_nbFaces | EpaPolyhedron | [private]
m_vertices | EpaPolyhedron | [private]
operator=(const EpaPolyhedron &epaPolyhedron) | EpaPolyhedron | [private]
~EpaPolyhedron() | EpaPolyhedron |

Generated on Wed May 24 14:00:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: EpaVertex Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

EpaVertex Class Reference

Note : This class is not supposed to be a base class. More...

#include <EpaVertex.h>

Collaboration diagram for EpaVertex:

[legend]
List of all members.

Public Member Functions

EpaVertex (const SimdPoint3 &point)
EpaVertex (const SimdPoint3 &point, const SimdPoint3 &wSupportPointOnA, const SimdPoint3 &wSupportPointOnB)
~EpaVertex ()

Public Attributes

SimdPoint3 m_point
This is not necessary.
SimdPoint3 m_wSupportPointOnA
SimdPoint3 m_wSupportPointOnB

Private Member Functions

EpaVertex (const EpaVertex &epaVertex)
Prevents copying objects from this class.
const EpaVertex & operator= (const EpaVertex &epaVertex)

Detailed Description

Note : This class is not supposed to be a base class.

Definition at line 23 of file EpaVertex.h.

Constructor & Destructor Documentation

EpaVertex::EpaVertex ( const EpaVertex & epaVertex ) [private]

Prevents copying objects from this class.

EpaVertex::EpaVertex ( const SimdPoint3 & point ) [inline]

Definition at line 33 of file EpaVertex.h.

EpaVertex::EpaVertex | ( | const SimdPoint3 & | point,
 |  | const SimdPoint3 & | wSupportPointOnA,
 |  | const SimdPoint3 & | wSupportPointOnB
 | ) | [inline]

Definition at line 37 of file EpaVertex.h.

EpaVertex::~EpaVertex ( ) [inline]

Definition at line 45 of file EpaVertex.h.

Member Function Documentation

const EpaVertex& EpaVertex::operator= ( const EpaVertex & epaVertex ) [private]

Member Data Documentation

SimdPoint3 EpaVertex::m_point

This is not necessary.

Definition at line 54 of file EpaVertex.h.

Referenced by EpaFace::CalcClosestPoint(), and EpaFace::Initialize().

SimdPoint3 EpaVertex::m_wSupportPointOnA

Definition at line 56 of file EpaVertex.h.

Referenced by EpaFace::CalcClosestPointOnA().

SimdPoint3 EpaVertex::m_wSupportPointOnB

Definition at line 57 of file EpaVertex.h.

Referenced by EpaFace::CalcClosestPointOnB().

The documentation for this class was generated from the following file:
  • EpaVertex.h
Generated on Wed May 24 14:00:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

EpaVertex Member List

This is the complete list of members for EpaVertex, including all inherited members.

EpaVertex(const EpaVertex &epaVertex) | EpaVertex | [private]
EpaVertex(const SimdPoint3 &point) | EpaVertex | [inline]
EpaVertex(const SimdPoint3 &point, const SimdPoint3 &wSupportPointOnA, const SimdPoint3 &wSupportPointOnB) | EpaVertex | [inline]
m_point | EpaVertex |
m_wSupportPointOnA | EpaVertex |
m_wSupportPointOnB | EpaVertex |
operator=(const EpaVertex &epaVertex) | EpaVertex | [private]
~EpaVertex() | EpaVertex | [inline]

Generated on Wed May 24 14:00:17 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: FilterClosestRayResultCallback Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

FilterClosestRayResultCallback Struct Reference

Inheritance diagram for FilterClosestRayResultCallback:

[legend]
Collaboration diagram for FilterClosestRayResultCallback:

[legend]
List of all members.

Public Member Functions

FilterClosestRayResultCallback (PHY_IPhysicsController *ignoreClient, const SimdVector3 &rayFrom, const SimdVector3 &rayTo)
virtual | ~FilterClosestRayResultCallback ()
virtual float | AddSingleResult (const CollisionWorld::LocalRayResult &rayResult)

Public Attributes

PHY_IPhysicsController * m_ignoreClient

Detailed Description

Definition at line 1264 of file CcdPhysicsEnvironment.cpp.

Constructor & Destructor Documentation

FilterClosestRayResultCallback::FilterClosestRayResultCallback | ( | PHY_IPhysicsController * | ignoreClient,
 |  | const SimdVector3 & | rayFrom,
 |  | const SimdVector3 & | rayTo
 | ) | [inline]

Definition at line 1268 of file CcdPhysicsEnvironment.cpp.

virtual FilterClosestRayResultCallback::~FilterClosestRayResultCallback ( ) [inline, virtual]

Definition at line 1275 of file CcdPhysicsEnvironment.cpp.

Member Function Documentation

virtual float FilterClosestRayResultCallback::AddSingleResult ( const CollisionWorld::LocalRayResult & rayResult ) [inline, virtual]

Reimplemented from CollisionWorld::ClosestRayResultCallback.

Definition at line 1279 of file CcdPhysicsEnvironment.cpp.

References CollisionWorld::RayResultCallback::m_closestHitFraction, CollisionWorld::LocalRayResult::m_collisionObject, m_ignoreClient, and CollisionObject::m_userPointer.

Member Data Documentation

PHY_IPhysicsController* FilterClosestRayResultCallback::m_ignoreClient

Definition at line 1266 of file CcdPhysicsEnvironment.cpp.

Referenced by AddSingleResult().

The documentation for this struct was generated from the following file:
  • CcdPhysicsEnvironment.cpp
Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

FilterClosestRayResultCallback Member List

This is the complete list of members for FilterClosestRayResultCallback, including all inherited members.

AddSingleResult(const CollisionWorld::LocalRayResult &rayResult) | FilterClosestRayResultCallback | [inline, virtual]
ClosestRayResultCallback(SimdVector3 rayFromWorld, SimdVector3 rayToWorld) | CollisionWorld::ClosestRayResultCallback | [inline]
FilterClosestRayResultCallback(PHY_IPhysicsController *ignoreClient, const SimdVector3 &rayFrom, const SimdVector3 &rayTo) | FilterClosestRayResultCallback | [inline]
HasHit() | CollisionWorld::RayResultCallback | [inline]
m_closestHitFraction | CollisionWorld::RayResultCallback |
m_collisionObject | CollisionWorld::ClosestRayResultCallback |
m_hitNormalWorld | CollisionWorld::ClosestRayResultCallback |
m_hitPointWorld | CollisionWorld::ClosestRayResultCallback |
m_ignoreClient | FilterClosestRayResultCallback |
m_rayFromWorld | CollisionWorld::ClosestRayResultCallback |
m_rayToWorld | CollisionWorld::ClosestRayResultCallback |
RayResultCallback() | CollisionWorld::RayResultCallback | [inline]
~FilterClosestRayResultCallback() | FilterClosestRayResultCallback | [inline, virtual]
~RayResultCallback() | CollisionWorld::RayResultCallback | [inline, virtual]

Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: FlippedContactResult Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

FlippedContactResult Class Reference

Inheritance diagram for FlippedContactResult:

[legend]
Collaboration diagram for FlippedContactResult:

[legend]
List of all members.

Public Member Functions

FlippedContactResult (DiscreteCollisionDetectorInterface::Result *org)
virtual void AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)

Private Attributes

DiscreteCollisionDetectorInterface::Result * m_org

Detailed Description

Definition at line 124 of file ConvexConvexAlgorithm.cpp.

Constructor & Destructor Documentation

FlippedContactResult::FlippedContactResult ( DiscreteCollisionDetectorInterface::Result * org ) [inline]

Definition at line 130 of file ConvexConvexAlgorithm.cpp.

Member Function Documentation

virtual void FlippedContactResult::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [inline, virtual]

Implements DiscreteCollisionDetectorInterface::Result.

Definition at line 136 of file ConvexConvexAlgorithm.cpp.

References DiscreteCollisionDetectorInterface::Result::AddContactPoint(), and m_org.

Member Data Documentation

DiscreteCollisionDetectorInterface::Result* FlippedContactResult::m_org [private]

Definition at line 126 of file ConvexConvexAlgorithm.cpp.

Referenced by AddContactPoint().

The documentation for this class was generated from the following file:
  • ConvexConvexAlgorithm.cpp
Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

FlippedContactResult Member List

This is the complete list of members for FlippedContactResult, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth) | FlippedContactResult | [inline, virtual]
FlippedContactResult(DiscreteCollisionDetectorInterface::Result *org) | FlippedContactResult | [inline]
m_org | FlippedContactResult | [private]
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]

Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_Link Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

GEN_Link Class Reference

#include <GEN_List.h>

Collaboration diagram for GEN_Link:

[legend]
List of all members.

Public Member Functions

GEN_Link ()
GEN_Link (GEN_Link *next, GEN_Link *prev)
GEN_Link * | getNext () const
GEN_Link * | getPrev () const
bool | isHead () const
bool | isTail () const
void | insertBefore (GEN_Link *link)
void | insertAfter (GEN_Link *link)
void | remove ()

Private Attributes

GEN_Link * m_next
GEN_Link * m_prev

Detailed Description

Definition at line 20 of file GEN_List.h.

Constructor & Destructor Documentation

GEN_Link::GEN_Link ( ) [inline]

Definition at line 22 of file GEN_List.h.

GEN_Link::GEN_Link | ( | GEN_Link * | next,
 |  | GEN_Link * | prev
 | ) | [inline]

Definition at line 23 of file GEN_List.h.

Member Function Documentation

GEN_Link* GEN_Link::getNext ( ) const [inline]

Definition at line 25 of file GEN_List.h.

References m_next.

Referenced by GEN_List::getHead().

GEN_Link* GEN_Link::getPrev ( ) const [inline]

Definition at line 26 of file GEN_List.h.

References m_prev.

Referenced by GEN_List::getTail().

void GEN_Link::insertAfter ( GEN_Link * link ) [inline]

Definition at line 38 of file GEN_List.h.

References m_next, and m_prev.

Referenced by GEN_List::addHead().

void GEN_Link::insertBefore ( GEN_Link * link ) [inline]

Definition at line 31 of file GEN_List.h.

References m_next, and m_prev.

Referenced by GEN_List::addTail().

bool GEN_Link::isHead ( ) const [inline]

Definition at line 28 of file GEN_List.h.

References m_prev.

bool GEN_Link::isTail ( ) const [inline]

Definition at line 29 of file GEN_List.h.

References m_next.

void GEN_Link::remove ( ) [inline]

Definition at line 45 of file GEN_List.h.

References m_next, and m_prev.

Member Data Documentation

GEN_Link* GEN_Link::m_next [private]

Definition at line 51 of file GEN_List.h.

Referenced by getNext(), insertAfter(), insertBefore(), isTail(), and remove().

GEN_Link* GEN_Link::m_prev [private]

Definition at line 52 of file GEN_List.h.

Referenced by getPrev(), insertAfter(), insertBefore(), isHead(), and remove().

The documentation for this class was generated from the following file:
  • GEN_List.h
Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

GEN_Link Member List

This is the complete list of members for GEN_Link, including all inherited members.

GEN_Link() | GEN_Link | [inline]
GEN_Link(GEN_Link *next, GEN_Link *prev) | GEN_Link | [inline]
getNext() const | GEN_Link | [inline]
getPrev() const | GEN_Link | [inline]
insertAfter(GEN_Link *link) | GEN_Link | [inline]
insertBefore(GEN_Link *link) | GEN_Link | [inline]
isHead() const | GEN_Link | [inline]
isTail() const | GEN_Link | [inline]
m_next | GEN_Link | [private]
m_prev | GEN_Link | [private]
remove() | GEN_Link | [inline]

Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GEN_List Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

GEN_List Class Reference

#include <GEN_List.h>

Collaboration diagram for GEN_List:

[legend]
List of all members.

Public Member Functions

GEN_List ()
GEN_Link * | getHead () const
GEN_Link * | getTail () const
void | addHead (GEN_Link *link)
void | addTail (GEN_Link *link)

Private Attributes

GEN_Link m_head
GEN_Link m_tail

Detailed Description

Definition at line 55 of file GEN_List.h.

Constructor & Destructor Documentation

GEN_List::GEN_List ( ) [inline]

Definition at line 57 of file GEN_List.h.

Member Function Documentation

void GEN_List::addHead ( GEN_Link * link ) [inline]

Definition at line 62 of file GEN_List.h.

References GEN_Link::insertAfter(), and m_head.

void GEN_List::addTail ( GEN_Link * link ) [inline]

Definition at line 63 of file GEN_List.h.

References GEN_Link::insertBefore(), and m_tail.

GEN_Link* GEN_List::getHead ( ) const [inline]

Definition at line 59 of file GEN_List.h.

References GEN_Link::getNext(), and m_head.

GEN_Link* GEN_List::getTail ( ) const [inline]

Definition at line 60 of file GEN_List.h.

References GEN_Link::getPrev(), and m_tail.

Member Data Documentation

GEN_Link GEN_List::m_head [private]

Definition at line 66 of file GEN_List.h.

Referenced by addHead(), and getHead().

GEN_Link GEN_List::m_tail [private]

Definition at line 67 of file GEN_List.h.

Referenced by addTail(), and getTail().

The documentation for this class was generated from the following file:
  • GEN_List.h
Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

GEN_List Member List

This is the complete list of members for GEN_List, including all inherited members.

addHead(GEN_Link *link) | GEN_List | [inline]
addTail(GEN_Link *link) | GEN_List | [inline]
GEN_List() | GEN_List | [inline]
getHead() const | GEN_List | [inline]
getTail() const | GEN_List | [inline]
m_head | GEN_List | [private]
m_tail | GEN_List | [private]

Generated on Wed May 24 14:00:18 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkConvexCast Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

GjkConvexCast Class Reference

GjkConvexCast performs a raycast on a convex object using support mapping. More...

#include <GjkConvexCast.h>

Inheritance diagram for GjkConvexCast:

[legend]
Collaboration diagram for GjkConvexCast:

[legend]
List of all members.

Public Member Functions

GjkConvexCast (ConvexShape *convexA, ConvexShape *convexB, SimplexSolverInterface *simplexSolver)
virtual bool | calcTimeOfImpact (const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)
cast a convex against another convex object

Private Attributes

SimplexSolverInterface * | m_simplexSolver
ConvexShape * m_convexA
ConvexShape * m_convexB

Detailed Description

GjkConvexCast performs a raycast on a convex object using support mapping.

Definition at line 30 of file GjkConvexCast.h.

Constructor & Destructor Documentation

GjkConvexCast::GjkConvexCast | ( | ConvexShape * | convexA,
 |  | ConvexShape * | convexB,
 |  | SimplexSolverInterface * | simplexSolver
 | ) |

Definition at line 25 of file GjkConvexCast.cpp.

Member Function Documentation

bool GjkConvexCast::calcTimeOfImpact | ( | const SimdTransform & | fromA,
 |  | const SimdTransform & | toA,
 |  | const SimdTransform & | fromB,
 |  | const SimdTransform & | toB,
 |  | CastResult & | result
 | ) | [virtual]

cast a convex against another convex object

Definition at line 32 of file GjkConvexCast.cpp.

References SimdVector3::dot(), GjkPairDetector::GetClosestPoints(), SimdTransform::getOrigin(), SimdTransform::inverse(), length(), m_convexA, m_convexB, PointCollector::m_distance, PointCollector::m_hasResult, PointCollector::m_normalOnBInWorld, PointCollector::m_pointInWorld, m_simplexSolver, SimdTransform::setIdentity(), SphereShape::SetMargin(), SimdTransform::setOrigin(), MinkowskiSumShape::SetTransformA(), MinkowskiSumShape::SetTransformB(), SimdQuadWord::setValue(), and SIMD_EPSILON.

Referenced by ConvexConvexAlgorithm::CalculateTimeOfImpact().

Member Data Documentation

ConvexShape* GjkConvexCast::m_convexA [private]

Definition at line 33 of file GjkConvexCast.h.

Referenced by calcTimeOfImpact().

ConvexShape* GjkConvexCast::m_convexB [private]

Definition at line 34 of file GjkConvexCast.h.

Referenced by calcTimeOfImpact().

SimplexSolverInterface* GjkConvexCast::m_simplexSolver [private]

Definition at line 32 of file GjkConvexCast.h.

Referenced by calcTimeOfImpact().

The documentation for this class was generated from the following files:
  • GjkConvexCast.h
  • GjkConvexCast.cpp
Generated on Wed May 24 14:00:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

GjkConvexCast Member List

This is the complete list of members for GjkConvexCast, including all inherited members.

calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result) | GjkConvexCast | [virtual]
ConvexCast::calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)=0 | ConvexCast | [pure virtual]
GjkConvexCast(ConvexShape *convexA, ConvexShape *convexB, SimplexSolverInterface *simplexSolver) | GjkConvexCast |
m_convexA | GjkConvexCast | [private]
m_convexB | GjkConvexCast | [private]
m_simplexSolver | GjkConvexCast | [private]
~ConvexCast() | ConvexCast | [virtual]

Generated on Wed May 24 14:00:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: GjkPairDetector Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

GjkPairDetector Class Reference

GjkPairDetector uses GJK to implement the DiscreteCollisionDetectorInterface. More...

#include <GjkPairDetector.h>

Inheritance diagram for GjkPairDetector:

[legend]
Collaboration diagram for GjkPairDetector:

[legend]
List of all members.

Public Member Functions

GjkPairDetector (ConvexShape *objectA, ConvexShape *objectB, SimplexSolverInterface *simplexSolver, ConvexPenetrationDepthSolver *penetrationDepthSolver)
virtual | ~GjkPairDetector ()
virtual void | GetClosestPoints (const ClosestPointInput &input, Result &output, class IDebugDraw *debugDraw)
void | SetMinkowskiA (ConvexShape *minkA)
void | SetMinkowskiB (ConvexShape *minkB)
void | SetCachedSeperatingAxis (const SimdVector3 &seperatingAxis)
void | SetPenetrationDepthSolver (ConvexPenetrationDepthSolver *penetrationDepthSolver)
void | SetIgnoreMargin (bool ignoreMargin)

Private Attributes

SimdVector3 m_cachedSeparatingAxis
ConvexPenetrationDepthSolver * m_penetrationDepthSolver
SimplexSolverInterface * | m_simplexSolver
ConvexShape * m_minkowskiA
ConvexShape * m_minkowskiB
bool | m_ignoreMargin

Detailed Description

GjkPairDetector uses GJK to implement the DiscreteCollisionDetectorInterface.

Definition at line 32 of file GjkPairDetector.h.

Constructor & Destructor Documentation

GjkPairDetector::GjkPairDetector | ( | ConvexShape * | objectA,
 |  | ConvexShape * | objectB,
 |  | SimplexSolverInterface * | simplexSolver,
 |  | ConvexPenetrationDepthSolver * | penetrationDepthSolver
 | ) |

Definition at line 27 of file GjkPairDetector.cpp.

virtual GjkPairDetector::~GjkPairDetector ( ) [inline, virtual]

Definition at line 46 of file GjkPairDetector.h.

Member Function Documentation

void GjkPairDetector::GetClosestPoints | ( | const ClosestPointInput & | input,
 |  | Result & | output,
 |  | class IDebugDraw * | debugDraw
 | ) | [virtual]

Definition at line 37 of file GjkPairDetector.cpp.

References ASSERT, distance(), SimdVector3::dot(), ConvexShape::GetMargin(), length(), SimdVector3::length2(), ConvexShape::LocalGetSupportingVertexWithoutMargin(), m_cachedSeparatingAxis, m_ignoreMargin, m_minkowskiA, m_minkowskiB, m_penetrationDepthSolver, m_simplexSolver, rel_error2, SIMD_EPSILON, SIMD_INFINITY, and SimdSqrt().

Referenced by MinkowskiPenetrationDepthSolver::CalcPenDepth(), GjkConvexCast::calcTimeOfImpact(), ContinuousConvexCollision::calcTimeOfImpact(), and ConvexConvexAlgorithm::ProcessCollision().

void GjkPairDetector::SetCachedSeperatingAxis ( const SimdVector3 & seperatingAxis ) [inline]

Definition at line 59 of file GjkPairDetector.h.

References m_cachedSeparatingAxis.

void GjkPairDetector::SetIgnoreMargin ( bool ignoreMargin ) [inline]

Definition at line 69 of file GjkPairDetector.h.

References m_ignoreMargin.

Referenced by ContinuousConvexCollision::calcTimeOfImpact().

void GjkPairDetector::SetMinkowskiA ( ConvexShape * minkA ) [inline]

Definition at line 50 of file GjkPairDetector.h.

References m_minkowskiA.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

void GjkPairDetector::SetMinkowskiB ( ConvexShape * minkB ) [inline]

Definition at line 55 of file GjkPairDetector.h.

References m_minkowskiB.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

void GjkPairDetector::SetPenetrationDepthSolver ( ConvexPenetrationDepthSolver * penetrationDepthSolver ) [inline]

Definition at line 64 of file GjkPairDetector.h.

References m_penetrationDepthSolver.

Referenced by ConvexConvexAlgorithm::CheckPenetrationDepthSolver().

Member Data Documentation

SimdVector3 GjkPairDetector::m_cachedSeparatingAxis [private]

Definition at line 36 of file GjkPairDetector.h.

Referenced by GetClosestPoints(), and SetCachedSeperatingAxis().

bool GjkPairDetector::m_ignoreMargin [private]

Definition at line 41 of file GjkPairDetector.h.

Referenced by GetClosestPoints(), and SetIgnoreMargin().

ConvexShape* GjkPairDetector::m_minkowskiA [private]

Definition at line 39 of file GjkPairDetector.h.

Referenced by GetClosestPoints(), and SetMinkowskiA().

ConvexShape* GjkPairDetector::m_minkowskiB [private]

Definition at line 40 of file GjkPairDetector.h.

Referenced by GetClosestPoints(), and SetMinkowskiB().

ConvexPenetrationDepthSolver* GjkPairDetector::m_penetrationDepthSolver [private]

Definition at line 37 of file GjkPairDetector.h.

Referenced by GetClosestPoints(), and SetPenetrationDepthSolver().

SimplexSolverInterface* GjkPairDetector::m_simplexSolver [private]

Definition at line 38 of file GjkPairDetector.h.

Referenced by GetClosestPoints().

The documentation for this class was generated from the following files:
  • GjkPairDetector.h
  • GjkPairDetector.cpp
Generated on Wed May 24 14:00:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

GjkPairDetector Member List

This is the complete list of members for GjkPairDetector, including all inherited members.

GetClosestPoints(const ClosestPointInput &input, Result &output, class IDebugDraw *debugDraw) | GjkPairDetector | [virtual]
DiscreteCollisionDetectorInterface::GetClosestPoints(const ClosestPointInput &input, Result &output, class IDebugDraw *debugDraw)=0 | DiscreteCollisionDetectorInterface | [pure virtual]
getCollisionMargin() | DiscreteCollisionDetectorInterface | [inline]
GjkPairDetector(ConvexShape *objectA, ConvexShape *objectB, SimplexSolverInterface *simplexSolver, ConvexPenetrationDepthSolver *penetrationDepthSolver) | GjkPairDetector |
m_cachedSeparatingAxis | GjkPairDetector | [private]
m_ignoreMargin | GjkPairDetector | [private]
m_minkowskiA | GjkPairDetector | [private]
m_minkowskiB | GjkPairDetector | [private]
m_penetrationDepthSolver | GjkPairDetector | [private]
m_simplexSolver | GjkPairDetector | [private]
operator delete(void *ptr) | DiscreteCollisionDetectorInterface | [inline]
SetCachedSeperatingAxis(const SimdVector3 &seperatingAxis) | GjkPairDetector | [inline]
SetIgnoreMargin(bool ignoreMargin) | GjkPairDetector | [inline]
SetMinkowskiA(ConvexShape *minkA) | GjkPairDetector | [inline]
SetMinkowskiB(ConvexShape *minkB) | GjkPairDetector | [inline]
SetPenetrationDepthSolver(ConvexPenetrationDepthSolver *penetrationDepthSolver) | GjkPairDetector | [inline]
~DiscreteCollisionDetectorInterface() | DiscreteCollisionDetectorInterface | [inline, virtual]
~GjkPairDetector() | GjkPairDetector | [inline, virtual]

Generated on Wed May 24 14:00:19 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HingeConstraint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

HingeConstraint Class Reference

hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space axis defines the orientation of the hinge axis More...

#include <HingeConstraint.h>

Inheritance diagram for HingeConstraint:

[legend]
Collaboration diagram for HingeConstraint:

[legend]
List of all members.

Public Member Functions

HingeConstraint (RigidBody &rbA, RigidBody &rbB, const SimdVector3 &pivotInA, const SimdVector3 &pivotInB, SimdVector3 &axisInA, SimdVector3 &axisInB)
HingeConstraint (RigidBody &rbA, const SimdVector3 &pivotInA, SimdVector3 &axisInA)
HingeConstraint ()
virtual void | BuildJacobian ()
virtual void | SolveConstraint (SimdScalar timeStep)
void | UpdateRHS (SimdScalar timeStep)
const RigidBody & | GetRigidBodyA () const
const RigidBody & | GetRigidBodyB () const
void | setAngularOnly (bool angularOnly)

Private Attributes

JacobianEntry | m_jac [3]
JacobianEntry | m_jacAng [2]
SimdVector3 m_pivotInA
SimdVector3 m_pivotInB
SimdVector3 m_axisInA
SimdVector3 m_axisInB
bool | m_angularOnly

Detailed Description

hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space axis defines the orientation of the hinge axis

Definition at line 29 of file HingeConstraint.h.

Constructor & Destructor Documentation

HingeConstraint::HingeConstraint | ( | RigidBody & | rbA,
 |  | RigidBody & | rbB,
 |  | const SimdVector3 & | pivotInA,
 |  | const SimdVector3 & | pivotInB,
 |  | SimdVector3 & | axisInA,
 |  | SimdVector3 & | axisInB
 | ) |

Definition at line 27 of file HingeConstraint.cpp.

HingeConstraint::HingeConstraint | ( | RigidBody & | rbA,
 |  | const SimdVector3 & | pivotInA,
 |  | SimdVector3 & | axisInA
 | ) |

Definition at line 38 of file HingeConstraint.cpp.

HingeConstraint::HingeConstraint ( )

Definition at line 23 of file HingeConstraint.cpp.

Member Function Documentation

void HingeConstraint::BuildJacobian ( ) [virtual]

Implements TypedConstraint.

Definition at line 48 of file HingeConstraint.cpp.

References SimdTransform::getBasis(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), RigidBody::getInvInertiaDiagLocal(), RigidBody::getInvMass(), GetRigidBodyA(), m_angularOnly, m_axisInA, m_jac, m_jacAng, m_pivotInA, m_pivotInB, TypedConstraint::m_rbA, TypedConstraint::m_rbB, SimdPlaneSpace1(), and SimdMatrix3x3::transpose().

const RigidBody& HingeConstraint::GetRigidBodyA ( ) const [inline]

Reimplemented from TypedConstraint.

Definition at line 55 of file HingeConstraint.h.

References TypedConstraint::m_rbA.

Referenced by BuildJacobian(), and SolveConstraint().

const RigidBody& HingeConstraint::GetRigidBodyB ( ) const [inline]

Reimplemented from TypedConstraint.

Definition at line 59 of file HingeConstraint.h.

References TypedConstraint::m_rbB.

Referenced by SolveConstraint().

void HingeConstraint::setAngularOnly ( bool angularOnly ) [inline]

Definition at line 64 of file HingeConstraint.h.

References m_angularOnly.

Referenced by CcdPhysicsEnvironment::createConstraint().

void HingeConstraint::SolveConstraint ( SimdScalar timeStep ) [virtual]

solve angular part

Implements TypedConstraint.

Definition at line 95 of file HingeConstraint.cpp.

References RigidBody::applyImpulse(), RigidBody::applyTorqueImpulse(), RigidBody::ComputeAngularImpulseDenominator(), SimdVector3::cross(), dot(), SimdVector3::dot(), RigidBody::getAngularVelocity(), SimdTransform::getBasis(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), JacobianEntry::getDiagonal(), GetRigidBodyA(), GetRigidBodyB(), RigidBody::getVelocityInLocalPoint(), SimdVector3::length(), m_angularOnly, m_axisInA, m_axisInB, m_jac, m_pivotInA, m_pivotInB, TypedConstraint::m_rbA, TypedConstraint::m_rbB, and SimdVector3::normalized().

void HingeConstraint::UpdateRHS ( SimdScalar timeStep )

Definition at line 172 of file HingeConstraint.cpp.

Member Data Documentation

bool HingeConstraint::m_angularOnly [private]

Definition at line 39 of file HingeConstraint.h.

Referenced by BuildJacobian(), setAngularOnly(), and SolveConstraint().

SimdVector3 HingeConstraint::m_axisInA [private]

Definition at line 36 of file HingeConstraint.h.

Referenced by BuildJacobian(), and SolveConstraint().

SimdVector3 HingeConstraint::m_axisInB [private]

Definition at line 37 of file HingeConstraint.h.

Referenced by SolveConstraint().

JacobianEntry HingeConstraint::m_jac[3] [private]

Definition at line 31 of file HingeConstraint.h.

Referenced by BuildJacobian(), and SolveConstraint().

JacobianEntry HingeConstraint::m_jacAng[2] [private]

Definition at line 32 of file HingeConstraint.h.

Referenced by BuildJacobian().

SimdVector3 HingeConstraint::m_pivotInA [private]

Definition at line 34 of file HingeConstraint.h.

Referenced by BuildJacobian(), and SolveConstraint().

SimdVector3 HingeConstraint::m_pivotInB [private]

Definition at line 35 of file HingeConstraint.h.

Referenced by BuildJacobian(), and SolveConstraint().

The documentation for this class was generated from the following files:
  • HingeConstraint.h
  • HingeConstraint.cpp
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

HingeConstraint Member List

This is the complete list of members for HingeConstraint, including all inherited members.

BuildJacobian() | HingeConstraint | [virtual]
GetRigidBodyA() const | HingeConstraint | [inline]
GetRigidBodyB() const | HingeConstraint | [inline]
GetUserConstraintId() | TypedConstraint | [inline]
GetUserConstraintType() const | TypedConstraint | [inline]
HingeConstraint(RigidBody &rbA, RigidBody &rbB, const SimdVector3 &pivotInA, const SimdVector3 &pivotInB, SimdVector3 &axisInA, SimdVector3 &axisInB) | HingeConstraint |
HingeConstraint(RigidBody &rbA, const SimdVector3 &pivotInA, SimdVector3 &axisInA) | HingeConstraint |
HingeConstraint() | HingeConstraint |
m_angularOnly | HingeConstraint | [private]
m_axisInA | HingeConstraint | [private]
m_axisInB | HingeConstraint | [private]
m_jac | HingeConstraint | [private]
m_jacAng | HingeConstraint | [private]
m_pivotInA | HingeConstraint | [private]
m_pivotInB | HingeConstraint | [private]
m_rbA | TypedConstraint | [protected]
m_rbB | TypedConstraint | [protected]
setAngularOnly(bool angularOnly) | HingeConstraint | [inline]
SetUserConstraintId(int uid) | TypedConstraint | [inline]
SetUserConstraintType(int userConstraintType) | TypedConstraint | [inline]
SolveConstraint(SimdScalar timeStep) | HingeConstraint | [virtual]
TypedConstraint() | TypedConstraint |
TypedConstraint(RigidBody &rbA) | TypedConstraint |
TypedConstraint(RigidBody &rbA, RigidBody &rbB) | TypedConstraint |
UpdateRHS(SimdScalar timeStep) | HingeConstraint |
~TypedConstraint() | TypedConstraint | [inline, virtual]

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Hull Class Reference

Hull implements a convex collision detection algorithm based on Separating Axis Theorem (SAT). More...

#include <Hull.h>

Inheritance diagram for Hull:

[legend]
Collaboration diagram for Hull:

[legend]
List of all members.

Public Member Functions

Hull ()
~Hull ()
short | GetNumVertices () const
short | GetNumFaces () const
short | GetNumEdges () const
const Point3 & | GetVertex (short index) const
const Face & | GetFace (short index) const
const Edge & | GetEdge (short index) const
const Plane & | GetPlane (short index) const
short | GetFaceFirstEdge (short face) const
short | GetFaceNextEdge (short face, short prevEdge) const
short | GetEdgeVertex0 (short face, short edge) const
short | GetEdgeVertex1 (short face, short edge) const
short | GetEdgeOtherFace (short edge, short face) const
Point3 | GetFaceCentroid (short face) const
virtual void | ComputeInertia (const Transform &transform, Point3 &centerOfMass, Matrix33 &inertia, float totalMass) const
virtual Bounds3 | ComputeBounds (const Transform &transform) const

Static Public Member Functions

static void | ProcessHullHull (Separation &sep, const Hull &shapeA, const Hull &shapeB, const Transform &trA, const Transform &trB, HullContactCollector *collector)
static Hull * | MakeHull (int numPoints, const Point3 *pPoints)
static int | ClipFace (int numVerts, Point3 **ppVtxIn, Point3 **ppVtxOut, const Plane &plane)
Clips a face to the back of a plane.
static bool | GetSeparationHullHull (Separation &sep, const Point3 *pVertsA, const Point3 *pVertsB, const Transform &trA, const Transform &trB, const Hull &hullA, const Hull &hullB)
static int | AddContactsHullHull (Separation &sep, const Point3 *pVertsA, const Point3 *pVertsB, const Transform &trA, const Transform &trB, const Hull &hullA, const Hull &hullB, HullContactCollector *hullContactCollector)

Static Private Member Functions

static short | AllocTmpFace ()
static void | FreeTmpFace (short face)
static TmpFace * | GetTmpFace (short index)
static short | AllocTmpEdge ()
static void | FreeTmpEdge (short edge)
static TmpEdge * | GetTmpEdge (short index)
static short | MatchOrAddEdge (short vert0, short vert1, short face)
static void | UnmatchOrRemoveEdge (short edge, short face)
static short | AddTmpFace (short vert0, short vert1, short vert2)
static short | AddTmpFace (short numVerts, short *pVerts)
static short | AddTmpFace (short vert0, short numOtherVerts, short *pVerts)
static void | RemoveTmpFace (short face)
static bool | TmpFaceAddPoint (short point, short face)
static int | RemoveVisibleFaces (const Point3 &point)
static void | FillHole (short newVertex)
static Hull * | MakeHullFromTemp ()

Private Attributes

short | m_numVerts
short | m_numFaces
short | m_numEdges
Point3 * | m_pVerts
Face * m_pFaces
Edge * m_pEdges
Plane * | m_pPlanes

Static Private Attributes

static const int | kMaxVerts = 256
static const int | kMaxFaces = 256
static const int | kMaxEdges = 256
static const int | kTmpFaceMaxVerts = 64
static short | s_firstFreeTmpFace
static short | s_firstUsedTmpFace
static TmpFace * | s_pTmpFaces
static short | s_firstFreeTmpEdge
static short | s_firstUsedTmpEdge
static TmpEdge * | s_pTmpEdges
static const Point3 * | s_pPoints

Friends

class | ShapeCollider

Classes

struct | Edge
struct | Face
struct | TmpEdge
struct | TmpFace

Detailed Description

Hull implements a convex collision detection algorithm based on Separating Axis Theorem (SAT).

It is an alternative to GJK. It calculates the separating axis, and based on that it calculates the contact manifold (points) in one go. The separating axis calculation is approximated, not all edge-edge calculations are performed (performance reasons). Future idea is to combine this with GJK for polyhedra: GJK to calculate the separating axis, and Hull clipping code to calculate the full set of contacts.

Definition at line 32 of file Hull.h.

Constructor & Destructor Documentation

Hull::Hull ( )

Hull::~Hull ( )

Member Function Documentation

static int Hull::AddContactsHullHull | ( | Separation & | sep,
 |  | const Point3 * | pVertsA,
 |  | const Point3 * | pVertsB,
 |  | const Transform & | trA,
 |  | const Transform & | trB,
 |  | const Hull & | hullA,
 |  | const Hull & | hullB,
 |  | HullContactCollector * | hullContactCollector
 | ) | [static]

static short Hull::AddTmpFace | ( | short | vert0,
 |  | short | numOtherVerts,
 |  | short * | pVerts
 | ) | [static, private]

static short Hull::AddTmpFace | ( | short | numVerts,
 |  | short * | pVerts
 | ) | [static, private]

static short Hull::AddTmpFace | ( | short | vert0,
 |  | short | vert1,
 |  | short | vert2
 | ) | [static, private]

static short Hull::AllocTmpEdge ( ) [static, private]

static short Hull::AllocTmpFace ( ) [static, private]

static int Hull::ClipFace | ( | int | numVerts,
 |  | Point3 ** | ppVtxIn,
 |  | Point3 ** | ppVtxOut,
 |  | const Plane & | plane
 | ) | [static]

Clips a face to the back of a plane.

virtual Bounds3 Hull::ComputeBounds ( const Transform & transform ) const [virtual]

Implements Shape.

virtual void Hull::ComputeInertia | ( | const Transform & | transform,
 |  | Point3 & | centerOfMass,
 |  | Matrix33 & | inertia,
 |  | float | totalMass
 | ) | const [virtual]

Implements Shape.

static void Hull::FillHole ( short newVertex ) [static, private]

static void Hull::FreeTmpEdge ( short edge ) [static, private]

static void Hull::FreeTmpFace ( short face ) [static, private]

const Edge& Hull::GetEdge ( short index ) const

short Hull::GetEdgeOtherFace | ( | short | edge,
 |  | short | face
 | ) | const

short Hull::GetEdgeVertex0 | ( | short | face,
 |  | short | edge
 | ) | const

short Hull::GetEdgeVertex1 | ( | short | face,
 |  | short | edge
 | ) | const

const Face& Hull::GetFace ( short index ) const

Point3 Hull::GetFaceCentroid ( short face ) const

short Hull::GetFaceFirstEdge ( short face ) const

short Hull::GetFaceNextEdge | ( | short | face,
 |  | short | prevEdge
 | ) | const

short Hull::GetNumEdges ( ) const

short Hull::GetNumFaces ( ) const

short Hull::GetNumVertices ( ) const

const Plane& Hull::GetPlane ( short index ) const

static bool Hull::GetSeparationHullHull | ( | Separation & | sep,
 |  | const Point3 * | pVertsA,
 |  | const Point3 * | pVertsB,
 |  | const Transform & | trA,
 |  | const Transform & | trB,
 |  | const Hull & | hullA,
 |  | const Hull & | hullB
 | ) | [static]

static TmpEdge* Hull::GetTmpEdge ( short index ) [inline, static, private]

Definition at line 100 of file Hull.h.

References s_pTmpEdges.

static TmpFace* Hull::GetTmpFace ( short index ) [inline, static, private]

Definition at line 96 of file Hull.h.

References s_pTmpFaces.

const Point3& Hull::GetVertex ( short index ) const

static Hull* Hull::MakeHull | ( | int | numPoints,
 |  | const Point3 * | pPoints
 | ) | [static]

static Hull* Hull::MakeHullFromTemp ( ) [static, private]

static short Hull::MatchOrAddEdge | ( | short | vert0,
 |  | short | vert1,
 |  | short | face
 | ) | [static, private]

static void Hull::ProcessHullHull | ( | Separation & | sep,
 |  | const Hull & | shapeA,
 |  | const Hull & | shapeB,
 |  | const Transform & | trA,
 |  | const Transform & | trB,
 |  | HullContactCollector * | collector
 | ) | [static]

Referenced by ConvexConvexAlgorithm::ProcessCollision().

static void Hull::RemoveTmpFace ( short face ) [static, private]

static int Hull::RemoveVisibleFaces ( const Point3 & point ) [static, private]

static bool Hull::TmpFaceAddPoint | ( | short | point,
 |  | short | face
 | ) | [static, private]

static void Hull::UnmatchOrRemoveEdge | ( | short | edge,
 |  | short | face
 | ) | [static, private]

Friends And Related Function Documentation

friend class ShapeCollider [friend]

Definition at line 34 of file Hull.h.

Member Data Documentation

const int Hull::kMaxEdges = 256 [static, private]

Definition at line 53 of file Hull.h.

const int Hull::kMaxFaces = 256 [static, private]

Definition at line 52 of file Hull.h.

const int Hull::kMaxVerts = 256 [static, private]

Definition at line 51 of file Hull.h.

const int Hull::kTmpFaceMaxVerts = 64 [static, private]

Definition at line 65 of file Hull.h.

short Hull::m_numEdges [private]

Definition at line 57 of file Hull.h.

short Hull::m_numFaces [private]

Definition at line 56 of file Hull.h.

short Hull::m_numVerts [private]

Definition at line 55 of file Hull.h.

Edge* Hull::m_pEdges [private]

Definition at line 61 of file Hull.h.

Face* Hull::m_pFaces [private]

Definition at line 60 of file Hull.h.

Plane* Hull::m_pPlanes [private]

Definition at line 62 of file Hull.h.

Point3* Hull::m_pVerts [private]

Definition at line 59 of file Hull.h.

short Hull::s_firstFreeTmpEdge [static, private]

Definition at line 88 of file Hull.h.

short Hull::s_firstFreeTmpFace [static, private]

Definition at line 84 of file Hull.h.

short Hull::s_firstUsedTmpEdge [static, private]

Definition at line 89 of file Hull.h.

short Hull::s_firstUsedTmpFace [static, private]

Definition at line 85 of file Hull.h.

const Point3* Hull::s_pPoints [static, private]

Definition at line 92 of file Hull.h.

TmpEdge* Hull::s_pTmpEdges [static, private]

Definition at line 90 of file Hull.h.

Referenced by GetTmpEdge().

TmpFace* Hull::s_pTmpFaces [static, private]

Definition at line 86 of file Hull.h.

Referenced by GetTmpFace().

The documentation for this class was generated from the following file:
  • Hull.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Hull Member List

This is the complete list of members for Hull, including all inherited members.

AddContactsHullHull(Separation &sep, const Point3 *pVertsA, const Point3 *pVertsB, const Transform &trA, const Transform &trB, const Hull &hullA, const Hull &hullB, HullContactCollector *hullContactCollector) | Hull | [static]
AddTmpFace(short vert0, short vert1, short vert2) | Hull | [private, static]
AddTmpFace(short numVerts, short *pVerts) | Hull | [private, static]
AddTmpFace(short vert0, short numOtherVerts, short *pVerts) | Hull | [private, static]
AllocTmpEdge() | Hull | [private, static]
AllocTmpFace() | Hull | [private, static]
ClipFace(int numVerts, Point3 **ppVtxIn, Point3 **ppVtxOut, const Plane &plane) | Hull | [static]
ComputeBounds(const Transform &transform) const | Hull | [virtual]
ComputeInertia(const Transform &transform, Point3 &centerOfMass, Matrix33 &inertia, float totalMass) const | Hull | [virtual]
FillHole(short newVertex) | Hull | [private, static]
FreeTmpEdge(short edge) | Hull | [private, static]
FreeTmpFace(short face) | Hull | [private, static]
GetEdge(short index) const | Hull |
GetEdgeOtherFace(short edge, short face) const | Hull |
GetEdgeVertex0(short face, short edge) const | Hull |
GetEdgeVertex1(short face, short edge) const | Hull |
GetFace(short index) const | Hull |
GetFaceCentroid(short face) const | Hull |
GetFaceFirstEdge(short face) const | Hull |
GetFaceNextEdge(short face, short prevEdge) const | Hull |
GetNumEdges() const | Hull |
GetNumFaces() const | Hull |
GetNumVertices() const | Hull |
GetPlane(short index) const | Hull |
GetSeparationHullHull(Separation &sep, const Point3 *pVertsA, const Point3 *pVertsB, const Transform &trA, const Transform &trB, const Hull &hullA, const Hull &hullB) | Hull | [static]
GetTmpEdge(short index) | Hull | [inline, private, static]
GetTmpFace(short index) | Hull | [inline, private, static]
GetVertex(short index) const | Hull |
Hull() | Hull |
kMaxEdges | Hull | [private, static]
kMaxFaces | Hull | [private, static]
kMaxVerts | Hull | [private, static]
kTmpFaceMaxVerts | Hull | [private, static]
m_numEdges | Hull | [private]
m_numFaces | Hull | [private]
m_numVerts | Hull | [private]
m_pEdges | Hull | [private]
m_pFaces | Hull | [private]
m_pPlanes | Hull | [private]
m_pVerts | Hull | [private]
MakeHull(int numPoints, const Point3 *pPoints) | Hull | [static]
MakeHullFromTemp() | Hull | [private, static]
MatchOrAddEdge(short vert0, short vert1, short face) | Hull | [private, static]
ProcessHullHull(Separation &sep, const Hull &shapeA, const Hull &shapeB, const Transform &trA, const Transform &trB, HullContactCollector *collector) | Hull | [static]
RemoveTmpFace(short face) | Hull | [private, static]
RemoveVisibleFaces(const Point3 &point) | Hull | [private, static]
s_firstFreeTmpEdge | Hull | [private, static]
s_firstFreeTmpFace | Hull | [private, static]
s_firstUsedTmpEdge | Hull | [private, static]
s_firstUsedTmpFace | Hull | [private, static]
s_pPoints | Hull | [private, static]
s_pTmpEdges | Hull | [private, static]
s_pTmpFaces | Hull | [private, static]
Shape() | Shape |
ShapeCollider class | Hull | [friend]
TmpFaceAddPoint(short point, short face) | Hull | [private, static]
UnmatchOrRemoveEdge(short edge, short face) | Hull | [private, static]
~Hull() | Hull |
~Shape() | Shape | [virtual]

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull::Edge Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
Hull::Edge

Hull::Edge Struct Reference

#include <Hull.h>

List of all members.

Public Attributes

short | m_verts [2]
short | m_faces [2]
short | m_nextEdge [2]

Detailed Description

Definition at line 37 of file Hull.h.

Member Data Documentation

short Hull::Edge::m_faces[2]

Definition at line 40 of file Hull.h.

short Hull::Edge::m_nextEdge[2]

Definition at line 41 of file Hull.h.

short Hull::Edge::m_verts[2]

Definition at line 39 of file Hull.h.

The documentation for this struct was generated from the following file:
  • Hull.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Hull::Edge Member List

This is the complete list of members for Hull::Edge, including all inherited members.

m_faces | Hull::Edge
m_nextEdge | Hull::Edge
m_verts | Hull::Edge

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull::Face Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
Hull::Face

Hull::Face Struct Reference

#include <Hull.h>

List of all members.

Public Attributes

short | m_numEdges
short | m_firstEdge

Detailed Description

Definition at line 44 of file Hull.h.

Member Data Documentation

short Hull::Face::m_firstEdge

Definition at line 47 of file Hull.h.

short Hull::Face::m_numEdges

Definition at line 46 of file Hull.h.

The documentation for this struct was generated from the following file:
  • Hull.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Hull::Face Member List

This is the complete list of members for Hull::Face, including all inherited members.

m_firstEdge | Hull::Face
m_numEdges | Hull::Face

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull::TmpEdge Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
Hull::TmpEdge

Hull::TmpEdge Struct Reference

List of all members.

Public Attributes

short | m_index
short | m_next
short | m_verts [2]
short | m_faces [2]

Detailed Description

Definition at line 76 of file Hull.h.

Member Data Documentation

short Hull::TmpEdge::m_faces[2]

Definition at line 81 of file Hull.h.

short Hull::TmpEdge::m_index

Definition at line 78 of file Hull.h.

short Hull::TmpEdge::m_next

Definition at line 79 of file Hull.h.

short Hull::TmpEdge::m_verts[2]

Definition at line 80 of file Hull.h.

The documentation for this struct was generated from the following file:
  • Hull.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Hull::TmpEdge Member List

This is the complete list of members for Hull::TmpEdge, including all inherited members.

m_faces | Hull::TmpEdge
m_index | Hull::TmpEdge
m_next | Hull::TmpEdge
m_verts | Hull::TmpEdge

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hull::TmpFace Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members
Hull::TmpFace

Hull::TmpFace Struct Reference

List of all members.

Public Attributes

short | m_index
short | m_next
short | m_numVerts
short | m_verts [kTmpFaceMaxVerts]
short | m_edges [kTmpFaceMaxVerts]
Plane | m_plane

Detailed Description

Definition at line 66 of file Hull.h.

Member Data Documentation

short Hull::TmpFace::m_edges[kTmpFaceMaxVerts]

Definition at line 72 of file Hull.h.

short Hull::TmpFace::m_index

Definition at line 68 of file Hull.h.

short Hull::TmpFace::m_next

Definition at line 69 of file Hull.h.

short Hull::TmpFace::m_numVerts

Definition at line 70 of file Hull.h.

Plane Hull::TmpFace::m_plane

Definition at line 73 of file Hull.h.

short Hull::TmpFace::m_verts[kTmpFaceMaxVerts]

Definition at line 71 of file Hull.h.

The documentation for this struct was generated from the following file:
  • Hull.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Hull::TmpFace Member List

This is the complete list of members for Hull::TmpFace, including all inherited members.

m_edges | Hull::TmpFace
m_index | Hull::TmpFace
m_next | Hull::TmpFace
m_numVerts | Hull::TmpFace
m_plane | Hull::TmpFace
m_verts | Hull::TmpFace

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: HullContactCollector Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

HullContactCollector Class Reference

HullContactCollector collects the Hull computation to the contact point results. More...

#include <HullContactCollector.h>

List of all members.

Public Member Functions

virtual | ~HullContactCollector ()
virtual int | BatchAddContactGroup (const Separation &sep, int numContacts, const Vector3 &normalWorld, const Vector3 &tangent, const Point3 *positionsWorld, const float *depths)=0
virtual int | GetMaxNumContacts () const =0

Detailed Description

HullContactCollector collects the Hull computation to the contact point results.

Definition at line 26 of file HullContactCollector.h.

Constructor & Destructor Documentation

virtual HullContactCollector::~HullContactCollector ( ) [inline, virtual]

Definition at line 30 of file HullContactCollector.h.

Member Function Documentation

virtual int HullContactCollector::BatchAddContactGroup | ( | const Separation & | sep,
 |  | int | numContacts,
 |  | const Vector3 & | normalWorld,
 |  | const Vector3 & | tangent,
 |  | const Point3 * | positionsWorld,
 |  | const float * | depths
 | ) | [pure virtual]

virtual int HullContactCollector::GetMaxNumContacts ( ) const [pure virtual]

The documentation for this class was generated from the following file:
  • HullContactCollector.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

HullContactCollector Member List

This is the complete list of members for HullContactCollector, including all inherited members.

BatchAddContactGroup(const Separation &sep, int numContacts, const Vector3 &normalWorld, const Vector3 &tangent, const Point3 *positionsWorld, const float *depths)=0 | HullContactCollector | [pure virtual]
GetMaxNumContacts() const =0 | HullContactCollector | [pure virtual]
~HullContactCollector() | HullContactCollector | [inline, virtual]

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: IDebugDraw Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

IDebugDraw Class Reference

#include <IDebugDraw.h>

List of all members.

Public Types

enum DebugDrawModes {
DBG_NoDebug = 0,
DBG_DrawAabb = 1,
DBG_DrawText = 2,
DBG_DrawFeaturesText = 4,
DBG_DrawContactPoints = 8,
DBG_NoDeactivation = 16,
DBG_NoHelpText = 32,
DBG_DrawWireframe = 64,
DBG_ProfileTimings = 128,
DBG_EnableSatComparison = 256,
DBG_DisableBulletLCP = 512,
DBG_EnableCCD = 1024,
DBG_MAX_DEBUG_DRAW_MODE
}

Public Member Functions

virtual | ~IDebugDraw ()
virtual void | DrawLine (const SimdVector3 &from, const SimdVector3 &to, const SimdVector3 &color)=0
virtual void | DrawContactPoint (const SimdVector3 &PointOnB, const SimdVector3 &normalOnB, float distance, int lifeTime, const SimdVector3 &color)=0
virtual void | SetDebugMode (int debugMode)=0
virtual int | GetDebugMode () const =0

Detailed Description

Definition at line 34 of file IDebugDraw.h.

Member Enumeration Documentation

enum IDebugDraw::DebugDrawModes

Enumerator:
DBG_NoDebug
DBG_DrawAabb
DBG_DrawText
DBG_DrawFeaturesText
DBG_DrawContactPoints
DBG_NoDeactivation
DBG_NoHelpText
DBG_DrawWireframe
DBG_ProfileTimings
DBG_EnableSatComparison
DBG_DisableBulletLCP
DBG_EnableCCD
DBG_MAX_DEBUG_DRAW_MODE

Definition at line 38 of file IDebugDraw.h.

Constructor & Destructor Documentation

virtual IDebugDraw::~IDebugDraw ( ) [inline, virtual]

Definition at line 55 of file IDebugDraw.h.

Member Function Documentation

virtual void IDebugDraw::DrawContactPoint | ( | const SimdVector3 & | PointOnB,
 |  | const SimdVector3 & | normalOnB,
 |  | float | distance,
 |  | int | lifeTime,
 |  | const SimdVector3 & | color
 | ) | [pure virtual]

Referenced by OdeConstraintSolver::ConvertConstraint().

virtual void IDebugDraw::DrawLine | ( | const SimdVector3 & | from,
 |  | const SimdVector3 & | to,
 |  | const SimdVector3 & | color
 | ) | [pure virtual]

Referenced by DrawAabb().

virtual int IDebugDraw::GetDebugMode ( ) const [pure virtual]

Referenced by CcdPhysicsEnvironment::proceedDeltaTime(), CcdPhysicsEnvironment::proceedDeltaTimeOneStep(), and CcdPhysicsEnvironment::UpdateAabbs().

virtual void IDebugDraw::SetDebugMode ( int debugMode ) [pure virtual]

Referenced by CcdPhysicsEnvironment::setDebugMode().

The documentation for this class was generated from the following file:
  • IDebugDraw.h
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

IDebugDraw Member List

This is the complete list of members for IDebugDraw, including all inherited members.

DBG_DisableBulletLCP enum value | IDebugDraw |
DBG_DrawAabb enum value | IDebugDraw |
DBG_DrawContactPoints enum value | IDebugDraw |
DBG_DrawFeaturesText enum value | IDebugDraw |
DBG_DrawText enum value | IDebugDraw |
DBG_DrawWireframe enum value | IDebugDraw |
DBG_EnableCCD enum value | IDebugDraw |
DBG_EnableSatComparison enum value | IDebugDraw |
DBG_MAX_DEBUG_DRAW_MODE enum value | IDebugDraw |
DBG_NoDeactivation enum value | IDebugDraw |
DBG_NoDebug enum value | IDebugDraw |
DBG_NoHelpText enum value | IDebugDraw |
DBG_ProfileTimings enum value | IDebugDraw |
DebugDrawModes enum name | IDebugDraw |
DrawContactPoint(const SimdVector3 &PointOnB, const SimdVector3 &normalOnB, float distance, int lifeTime, const SimdVector3 &color)=0 | IDebugDraw | [pure virtual]
DrawLine(const SimdVector3 &from, const SimdVector3 &to, const SimdVector3 &color)=0 | IDebugDraw | [pure virtual]
GetDebugMode() const =0 | IDebugDraw | [pure virtual]
SetDebugMode(int debugMode)=0 | IDebugDraw | [pure virtual]
~IDebugDraw() | IDebugDraw | [inline, virtual]

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: IndexError Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

IndexError Struct Reference

List of all members.

Public Attributes

SimdScalar error
int | findex
int | index

Detailed Description

Definition at line 360 of file SorLcp.cpp.

Member Data Documentation

SimdScalar IndexError::error

Definition at line 361 of file SorLcp.cpp.

Referenced by SOR_LCP().

int IndexError::findex

Definition at line 362 of file SorLcp.cpp.

Referenced by SOR_LCP().

int IndexError::index

Definition at line 363 of file SorLcp.cpp.

Referenced by SOR_LCP().

The documentation for this struct was generated from the following file:
  • SorLcp.cpp
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

IndexError Member List

This is the complete list of members for IndexError, including all inherited members.

error | IndexError
findex | IndexError
index | IndexError

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: InternalTriangleIndexCallback Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

InternalTriangleIndexCallback Class Reference

#include <TriangleCallback.h>

List of all members.

Public Member Functions

virtual | ~InternalTriangleIndexCallback ()
virtual void | InternalProcessTriangleIndex (SimdVector3 *triangle, int partId, int triangleIndex)=0

Detailed Description

Definition at line 30 of file TriangleCallback.h.

Constructor & Destructor Documentation

InternalTriangleIndexCallback::~InternalTriangleIndexCallback ( ) [virtual]

Definition at line 24 of file TriangleCallback.cpp.

Member Function Documentation

virtual void InternalTriangleIndexCallback::InternalProcessTriangleIndex | ( | SimdVector3 * | triangle,
 |  | int | partId,
 |  | int | triangleIndex
 | ) | [pure virtual]

Referenced by StridingMeshInterface::InternalProcessAllTriangles().

The documentation for this class was generated from the following files:
  • TriangleCallback.h
  • TriangleCallback.cpp
Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

InternalTriangleIndexCallback Member List

This is the complete list of members for InternalTriangleIndexCallback, including all inherited members.

InternalProcessTriangleIndex(SimdVector3 *triangle, int partId, int triangleIndex)=0 | InternalTriangleIndexCallback | [pure virtual]
~InternalTriangleIndexCallback() | InternalTriangleIndexCallback | [virtual]

Generated on Wed May 24 14:00:20 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: JacobianEntry Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

JacobianEntry Class Reference

Jacobian entry is an abstraction that allows to describe constraints it can be used in combination with a constraint solver Can be used to relate the effect of an impulse to the constraint error. More...

#include <JacobianEntry.h>

Collaboration diagram for JacobianEntry:

[legend]
List of all members.

Public Member Functions

JacobianEntry ()
JacobianEntry (const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &rel_pos1, const SimdVector3 &rel_pos2, const SimdVector3 &jointAxis, const SimdVector3 &inertiaInvA, const SimdScalar massInvA, const SimdVector3 &inertiaInvB, const SimdScalar massInvB)
JacobianEntry (const SimdVector3 &jointAxis, const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &inertiaInvA, const SimdVector3 &inertiaInvB)
JacobianEntry (const SimdMatrix3x3 &world2A, const SimdVector3 &rel_pos1, const SimdVector3 &rel_pos2, const SimdVector3 &jointAxis, const SimdVector3 &inertiaInvA, const SimdScalar massInvA)
SimdScalar | getDiagonal () const
SimdScalar | getNonDiagonal (const JacobianEntry &jacB, const SimdScalar massInvA) const
SimdScalar | getNonDiagonal (const JacobianEntry &jacB, const SimdScalar massInvA, const SimdScalar massInvB) const
SimdScalar | getRelativeVelocity (const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &linvelB, const SimdVector3 &angvelB)

Public Attributes

SimdVector3 m_jointAxis
SimdVector3 m_aJ
SimdVector3 m_bJ
SimdVector3 m_0MinvJt
SimdVector3 m_1MinvJt
SimdScalar m_Adiag

Detailed Description

Jacobian entry is an abstraction that allows to describe constraints it can be used in combination with a constraint solver Can be used to relate the effect of an impulse to the constraint error.

Definition at line 31 of file JacobianEntry.h.

Constructor & Destructor Documentation

JacobianEntry::JacobianEntry ( ) [inline]

Definition at line 34 of file JacobianEntry.h.

JacobianEntry::JacobianEntry | ( | const SimdMatrix3x3 & | world2A,
 |  | const SimdMatrix3x3 & | world2B,
 |  | const SimdVector3 & | rel_pos1,
 |  | const SimdVector3 & | rel_pos2,
 |  | const SimdVector3 & | jointAxis,
 |  | const SimdVector3 & | inertiaInvA,
 |  | const SimdScalar | massInvA,
 |  | const SimdVector3 & | inertiaInvB,
 |  | const SimdScalar | massInvB
 | ) | [inline]

Definition at line 36 of file JacobianEntry.h.

References SimdVector3::cross(), SimdVector3::dot(), m_0MinvJt, m_1MinvJt, m_Adiag, m_aJ, m_bJ, and m_jointAxis.

JacobianEntry::JacobianEntry | ( | const SimdVector3 & | jointAxis,
 |  | const SimdMatrix3x3 & | world2A,
 |  | const SimdMatrix3x3 & | world2B,
 |  | const SimdVector3 & | inertiaInvA,
 |  | const SimdVector3 & | inertiaInvB
 | ) | [inline]

Definition at line 55 of file JacobianEntry.h.

References SimdVector3::dot(), m_0MinvJt, m_1MinvJt, m_Adiag, m_aJ, m_bJ, and m_jointAxis.

JacobianEntry::JacobianEntry | ( | const SimdMatrix3x3 & | world2A,
 |  | const SimdVector3 & | rel_pos1,
 |  | const SimdVector3 & | rel_pos2,
 |  | const SimdVector3 & | jointAxis,
 |  | const SimdVector3 & | inertiaInvA,
 |  | const SimdScalar | massInvA
 | ) | [inline]

Definition at line 70 of file JacobianEntry.h.

References SimdVector3::cross(), SimdVector3::dot(), m_0MinvJt, m_1MinvJt, m_Adiag, m_aJ, m_bJ, and m_jointAxis.

Member Function Documentation

SimdScalar JacobianEntry::getDiagonal ( ) const [inline]

Definition at line 85 of file JacobianEntry.h.

References m_Adiag.

Referenced by Solve2LinearConstraint::resolveBilateralPairConstraint(), Solve2LinearConstraint::resolveUnilateralPairConstraint(), Point2PointConstraint::SolveConstraint(), and HingeConstraint::SolveConstraint().

SimdScalar JacobianEntry::getNonDiagonal | ( | const JacobianEntry & | jacB,
 |  | const SimdScalar | massInvA,
 |  | const SimdScalar | massInvB
 | ) | const [inline]

Definition at line 99 of file JacobianEntry.h.

References m_0MinvJt, m_1MinvJt, m_aJ, m_bJ, and m_jointAxis.

SimdScalar JacobianEntry::getNonDiagonal | ( | const JacobianEntry & | jacB,
 |  | const SimdScalar | massInvA
 | ) | const [inline]

Definition at line 88 of file JacobianEntry.h.

References SimdVector3::dot(), m_0MinvJt, m_aJ, and m_jointAxis.

Referenced by Solve2LinearConstraint::resolveBilateralPairConstraint(), and Solve2LinearConstraint::resolveUnilateralPairConstraint().

SimdScalar JacobianEntry::getRelativeVelocity | ( | const SimdVector3 & | linvelA,
 |  | const SimdVector3 & | angvelA,
 |  | const SimdVector3 & | linvelB,
 |  | const SimdVector3 & | angvelB
 | ) | [inline]

Definition at line 111 of file JacobianEntry.h.

References m_aJ, m_bJ, m_jointAxis, and SIMD_EPSILON.

Member Data Documentation

SimdVector3 JacobianEntry::m_0MinvJt

Definition at line 127 of file JacobianEntry.h.

Referenced by getNonDiagonal(), and JacobianEntry().

SimdVector3 JacobianEntry::m_1MinvJt

Definition at line 128 of file JacobianEntry.h.

Referenced by getNonDiagonal(), and JacobianEntry().

SimdScalar JacobianEntry::m_Adiag

Definition at line 130 of file JacobianEntry.h.

Referenced by getDiagonal(), and JacobianEntry().

SimdVector3 JacobianEntry::m_aJ

Definition at line 125 of file JacobianEntry.h.

Referenced by getNonDiagonal(), getRelativeVelocity(), and JacobianEntry().

SimdVector3 JacobianEntry::m_bJ

Definition at line 126 of file JacobianEntry.h.

Referenced by getNonDiagonal(), getRelativeVelocity(), and JacobianEntry().

SimdVector3 JacobianEntry::m_jointAxis

Definition at line 124 of file JacobianEntry.h.

Referenced by getNonDiagonal(), getRelativeVelocity(), and JacobianEntry().

The documentation for this class was generated from the following file:
  • JacobianEntry.h
Generated on Wed May 24 14:00:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

JacobianEntry Member List

This is the complete list of members for JacobianEntry, including all inherited members.

getDiagonal() const | JacobianEntry | [inline]
getNonDiagonal(const JacobianEntry &jacB, const SimdScalar massInvA) const | JacobianEntry | [inline]
getNonDiagonal(const JacobianEntry &jacB, const SimdScalar massInvA, const SimdScalar massInvB) const | JacobianEntry | [inline]
getRelativeVelocity(const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &linvelB, const SimdVector3 &angvelB) | JacobianEntry | [inline]
JacobianEntry() | JacobianEntry | [inline]
JacobianEntry(const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &rel_pos1, const SimdVector3 &rel_pos2, const SimdVector3 &jointAxis, const SimdVector3 &inertiaInvA, const SimdScalar massInvA, const SimdVector3 &inertiaInvB, const SimdScalar massInvB) | JacobianEntry | [inline]
JacobianEntry(const SimdVector3 &jointAxis, const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &inertiaInvA, const SimdVector3 &inertiaInvB) | JacobianEntry | [inline]
JacobianEntry(const SimdMatrix3x3 &world2A, const SimdVector3 &rel_pos1, const SimdVector3 &rel_pos2, const SimdVector3 &jointAxis, const SimdVector3 &inertiaInvA, const SimdScalar massInvA) | JacobianEntry | [inline]
m_0MinvJt | JacobianEntry |
m_1MinvJt | JacobianEntry |
m_Adiag | JacobianEntry |
m_aJ | JacobianEntry |
m_bJ | JacobianEntry |
m_jointAxis | JacobianEntry |

Generated on Wed May 24 14:00:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldContactAddResult Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ManifoldContactAddResult Class Reference

#include <ManifoldContactAddResult.h>

Inheritance diagram for ManifoldContactAddResult:

[legend]
Collaboration diagram for ManifoldContactAddResult:

[legend]
List of all members.

Public Member Functions

ManifoldContactAddResult (SimdTransform transA, SimdTransform transB, PersistentManifold *manifoldPtr)
virtual void AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)

Private Attributes

PersistentManifold * m_manifoldPtr
SimdTransform m_transAInv
SimdTransform m_transBInv

Detailed Description

Definition at line 23 of file ManifoldContactAddResult.h.

Constructor & Destructor Documentation

ManifoldContactAddResult::ManifoldContactAddResult | ( | SimdTransform | transA,
 |  | SimdTransform | transB,
 |  | PersistentManifold * | manifoldPtr
 | ) |

Definition at line 19 of file ManifoldContactAddResult.cpp.

References SimdTransform::inverse(), m_transAInv, and m_transBInv.

Member Function Documentation

void ManifoldContactAddResult::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [virtual]

Implements DiscreteCollisionDetectorInterface::Result.

Definition at line 28 of file ManifoldContactAddResult.cpp.

References PersistentManifold::AddManifoldPoint(), PersistentManifold::GetCacheEntry(), PersistentManifold::GetContactBreakingTreshold(), m_manifoldPtr, m_transAInv, m_transBInv, and PersistentManifold::ReplaceContactPoint().

Member Data Documentation

PersistentManifold* ManifoldContactAddResult::m_manifoldPtr [private]

Definition at line 25 of file ManifoldContactAddResult.h.

Referenced by AddContactPoint().

SimdTransform ManifoldContactAddResult::m_transAInv [private]

Definition at line 26 of file ManifoldContactAddResult.h.

Referenced by AddContactPoint(), and ManifoldContactAddResult().

SimdTransform ManifoldContactAddResult::m_transBInv [private]

Definition at line 27 of file ManifoldContactAddResult.h.

Referenced by AddContactPoint(), and ManifoldContactAddResult().

The documentation for this class was generated from the following files:
  • ManifoldContactAddResult.h
  • ManifoldContactAddResult.cpp
Generated on Wed May 24 14:00:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ManifoldContactAddResult Member List

This is the complete list of members for ManifoldContactAddResult, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth) | ManifoldContactAddResult | [virtual]
m_manifoldPtr | ManifoldContactAddResult | [private]
m_transAInv | ManifoldContactAddResult | [private]
m_transBInv | ManifoldContactAddResult | [private]
ManifoldContactAddResult(SimdTransform transA, SimdTransform transB, PersistentManifold *manifoldPtr) | ManifoldContactAddResult |
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]

Generated on Wed May 24 14:00:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldPoint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ManifoldPoint Class Reference

ManifoldContactPoint collects and maintains persistent contactpoints. More...

#include <ManifoldPoint.h>

Collaboration diagram for ManifoldPoint:

[legend]
List of all members.

Public Member Functions

ManifoldPoint ()
ManifoldPoint (const SimdVector3 &pointA, const SimdVector3 &pointB, const SimdVector3 &normal, SimdScalar distance)
float | GetDistance () const
int | GetLifeTime () const
SimdVector3 GetPositionWorldOnA ()
const SimdVector3 & | GetPositionWorldOnB ()
void | SetDistance (float dist)

Public Attributes

SimdVector3 m_localPointA
SimdVector3 m_localPointB
SimdVector3 m_positionWorldOnB
SimdVector3 m_positionWorldOnA
m_positionWorldOnA is redundant information, see GetPositionWorldOnA(), but for clarity
SimdVector3 m_normalWorldOnB
float | m_distance1
void * | m_userPersistentData
int | m_lifeTime

Detailed Description

ManifoldContactPoint collects and maintains persistent contactpoints.

used to improve stability and performance of rigidbody dynamics response.

Definition at line 28 of file ManifoldPoint.h.

Constructor & Destructor Documentation

ManifoldPoint::ManifoldPoint ( ) [inline]

Definition at line 31 of file ManifoldPoint.h.

ManifoldPoint::ManifoldPoint | ( | const SimdVector3 & | pointA,
 |  | const SimdVector3 & | pointB,
 |  | const SimdVector3 & | normal,
 |  | SimdScalar | distance
 | ) | [inline]

Definition at line 36 of file ManifoldPoint.h.

Member Function Documentation

float ManifoldPoint::GetDistance ( ) const [inline]

Definition at line 66 of file ManifoldPoint.h.

References m_distance1.

Referenced by OdeConstraintSolver::ConvertConstraint(), ContactJoint::GetInfo2(), SimpleConstraintSolver::Solve(), and SimpleConstraintSolver::SolveFriction().

int ManifoldPoint::GetLifeTime ( ) const [inline]

Definition at line 70 of file ManifoldPoint.h.

References m_lifeTime.

Referenced by OdeConstraintSolver::ConvertConstraint(), and SimpleConstraintSolver::Solve().

SimdVector3 ManifoldPoint::GetPositionWorldOnA ( ) [inline]

Definition at line 75 of file ManifoldPoint.h.

References m_positionWorldOnA.

Referenced by ContactJoint::GetInfo2(), resolveSingleCollision(), resolveSingleFriction(), and SimpleConstraintSolver::Solve().

const SimdVector3& ManifoldPoint::GetPositionWorldOnB ( ) [inline]

Definition at line 80 of file ManifoldPoint.h.

References m_positionWorldOnB.

Referenced by ContactJoint::GetInfo2(), resolveSingleCollision(), resolveSingleFriction(), and SimpleConstraintSolver::Solve().

void ManifoldPoint::SetDistance ( float dist ) [inline]

Definition at line 85 of file ManifoldPoint.h.

References m_distance1.

Member Data Documentation

float ManifoldPoint::m_distance1

Definition at line 59 of file ManifoldPoint.h.

Referenced by GetDistance(), PersistentManifold::RefreshContactPoints(), SetDistance(), and PersistentManifold::ValidContactDistance().

int ManifoldPoint::m_lifeTime

Definition at line 64 of file ManifoldPoint.h.

Referenced by GetLifeTime(), and PersistentManifold::RefreshContactPoints().

SimdVector3 ManifoldPoint::m_localPointA

Definition at line 52 of file ManifoldPoint.h.

Referenced by PersistentManifold::GetCacheEntry(), PersistentManifold::RefreshContactPoints(), and PersistentManifold::SortCachedPoints().

SimdVector3 ManifoldPoint::m_localPointB

Definition at line 53 of file ManifoldPoint.h.

Referenced by PersistentManifold::RefreshContactPoints().

SimdVector3 ManifoldPoint::m_normalWorldOnB

Definition at line 57 of file ManifoldPoint.h.

Referenced by OdeConstraintSolver::ConvertConstraint(), ContactJoint::GetInfo2(), PersistentManifold::RefreshContactPoints(), resolveSingleCollision(), resolveSingleFriction(), and SimpleConstraintSolver::Solve().

SimdVector3 ManifoldPoint::m_positionWorldOnA

m_positionWorldOnA is redundant information, see GetPositionWorldOnA(), but for clarity

Definition at line 56 of file ManifoldPoint.h.

Referenced by GetPositionWorldOnA(), and PersistentManifold::RefreshContactPoints().

SimdVector3 ManifoldPoint::m_positionWorldOnB

Definition at line 54 of file ManifoldPoint.h.

Referenced by OdeConstraintSolver::ConvertConstraint(), GetPositionWorldOnB(), and PersistentManifold::RefreshContactPoints().

void* ManifoldPoint::m_userPersistentData

Definition at line 62 of file ManifoldPoint.h.

Referenced by PersistentManifold::ClearUserCache(), resolveSingleCollision(), resolveSingleFriction(), and SimpleConstraintSolver::Solve().

The documentation for this class was generated from the following file:
  • ManifoldPoint.h
Generated on Wed May 24 14:00:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ManifoldPoint Member List

This is the complete list of members for ManifoldPoint, including all inherited members.

GetDistance() const | ManifoldPoint | [inline]
GetLifeTime() const | ManifoldPoint | [inline]
GetPositionWorldOnA() | ManifoldPoint | [inline]
GetPositionWorldOnB() | ManifoldPoint | [inline]
m_distance1 | ManifoldPoint |
m_lifeTime | ManifoldPoint |
m_localPointA | ManifoldPoint |
m_localPointB | ManifoldPoint |
m_normalWorldOnB | ManifoldPoint |
m_positionWorldOnA | ManifoldPoint |
m_positionWorldOnB | ManifoldPoint |
m_userPersistentData | ManifoldPoint |
ManifoldPoint() | ManifoldPoint | [inline]
ManifoldPoint(const SimdVector3 &pointA, const SimdVector3 &pointB, const SimdVector3 &normal, SimdScalar distance) | ManifoldPoint | [inline]
SetDistance(float dist) | ManifoldPoint | [inline]

Generated on Wed May 24 14:00:21 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: ManifoldResult Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

ManifoldResult Class Reference

ManifoldResult is a helper class to manage contact results. More...

#include <ManifoldResult.h>

Inheritance diagram for ManifoldResult:

[legend]
Collaboration diagram for ManifoldResult:

[legend]
List of all members.

Public Member Functions

ManifoldResult (CollisionObject *body0, CollisionObject *body1, PersistentManifold *manifoldPtr)
virtual | ~ManifoldResult ()
virtual void | AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)

Private Attributes

PersistentManifold * m_manifoldPtr
CollisionObject * m_body0
CollisionObject * m_body1

Detailed Description

ManifoldResult is a helper class to manage contact results.

Definition at line 25 of file ManifoldResult.h.

Constructor & Destructor Documentation

ManifoldResult::ManifoldResult | ( | CollisionObject * | body0,
 |  | CollisionObject * | body1,
 |  | PersistentManifold * | manifoldPtr
 | ) |

Definition at line 21 of file ManifoldResult.cpp.

virtual ManifoldResult::~ManifoldResult ( ) [inline, virtual]

Definition at line 35 of file ManifoldResult.h.

Member Function Documentation

void ManifoldResult::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [virtual]

Implements DiscreteCollisionDetectorInterface::Result.

Definition at line 29 of file ManifoldResult.cpp.

References PersistentManifold::AddManifoldPoint(), PersistentManifold::GetCacheEntry(), PersistentManifold::GetContactBreakingTreshold(), SimdTransform::inverse(), m_body0, m_body1, m_manifoldPtr, and CollisionObject::m_worldTransform.

Member Data Documentation

CollisionObject* ManifoldResult::m_body0 [private]

Definition at line 28 of file ManifoldResult.h.

Referenced by AddContactPoint().

CollisionObject* ManifoldResult::m_body1 [private]

Definition at line 29 of file ManifoldResult.h.

Referenced by AddContactPoint().

PersistentManifold* ManifoldResult::m_manifoldPtr [private]

Definition at line 27 of file ManifoldResult.h.

Referenced by AddContactPoint().

The documentation for this class was generated from the following files:
  • ManifoldResult.h
  • ManifoldResult.cpp
Generated on Wed May 24 14:00:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

ManifoldResult Member List

This is the complete list of members for ManifoldResult, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth) | ManifoldResult | [virtual]
m_body0 | ManifoldResult | [private]
m_body1 | ManifoldResult | [private]
m_manifoldPtr | ManifoldResult | [private]
ManifoldResult(CollisionObject *body0, CollisionObject *body1, PersistentManifold *manifoldPtr) | ManifoldResult |
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
~ManifoldResult() | ManifoldResult | [inline, virtual]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]

Generated on Wed May 24 14:00:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MassProps Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

MassProps Struct Reference

#include <MassProps.h>

Collaboration diagram for MassProps:

[legend]
List of all members.

Public Member Functions

MassProps (float mass, const SimdVector3 &inertiaLocal)

Public Attributes

float m_mass
SimdVector3 m_inertiaLocal

Detailed Description

Definition at line 21 of file MassProps.h.

Constructor & Destructor Documentation

MassProps::MassProps | ( | float | mass,
 |  | const SimdVector3 & | inertiaLocal
 | ) | [inline]

Definition at line 22 of file MassProps.h.

Member Data Documentation

SimdVector3 MassProps::m_inertiaLocal

Definition at line 28 of file MassProps.h.

Referenced by RigidBody::RigidBody().

float MassProps::m_mass

Definition at line 27 of file MassProps.h.

Referenced by RigidBody::RigidBody().

The documentation for this struct was generated from the following file:
  • MassProps.h
Generated on Wed May 24 14:00:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

MassProps Member List

This is the complete list of members for MassProps, including all inherited members.

m_inertiaLocal | MassProps |
m_mass | MassProps |
MassProps(float mass, const SimdVector3 &inertiaLocal) | MassProps | [inline]

Generated on Wed May 24 14:00:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiPenetrationDepthSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

MinkowskiPenetrationDepthSolver Class Reference

MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation. More...

#include <MinkowskiPenetrationDepthSolver.h>

Inheritance diagram for MinkowskiPenetrationDepthSolver:

[legend]
Collaboration diagram for MinkowskiPenetrationDepthSolver:

[legend]
List of all members.

Public Member Functions

virtual bool CalcPenDepth (SimplexSolverInterface &simplexSolver, ConvexShape *convexA, ConvexShape *convexB, const SimdTransform &transA, const SimdTransform &transB, SimdVector3 &v, SimdPoint3 &pa, SimdPoint3 &pb, class IDebugDraw *debugDraw)

Detailed Description

MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation.

Implementation is based on sampling the depth using support mapping, and using GJK step to get the witness points.

Definition at line 23 of file MinkowskiPenetrationDepthSolver.h.

Member Function Documentation

bool MinkowskiPenetrationDepthSolver::CalcPenDepth | ( | SimplexSolverInterface & | simplexSolver,
 |  | ConvexShape * | convexA,
 |  | ConvexShape * | convexB,
 |  | const SimdTransform & | transA,
 |  | const SimdTransform & | transB,
 |  | SimdVector3 & | v,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb,
 |  | class IDebugDraw * | debugDraw
 | ) | [virtual]

Implements ConvexPenetrationDepthSolver.

Definition at line 92 of file MinkowskiPenetrationDepthSolver.cpp.

References ConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), SimdVector3::dot(), SimdTransform::getBasis(), GjkPairDetector::GetClosestPoints(), ConvexShape::GetMargin(), SimdTransform::getOrigin(), ConvexShape::LocalGetSupportingVertexWithoutMargin(), MyResult::m_depth, MyResult::m_hasResult, MyResult::m_pointInWorld, NUM_UNITSPHERE_POINTS, and SimdTransform::setOrigin().

The documentation for this class was generated from the following files:
  • MinkowskiPenetrationDepthSolver.h
  • MinkowskiPenetrationDepthSolver.cpp
Generated on Wed May 24 14:00:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

MinkowskiPenetrationDepthSolver Member List

This is the complete list of members for MinkowskiPenetrationDepthSolver, including all inherited members.

CalcPenDepth(SimplexSolverInterface &simplexSolver, ConvexShape *convexA, ConvexShape *convexB, const SimdTransform &transA, const SimdTransform &transB, SimdVector3 &v, SimdPoint3 &pa, SimdPoint3 &pb, class IDebugDraw *debugDraw) | MinkowskiPenetrationDepthSolver | [virtual]
~ConvexPenetrationDepthSolver() | ConvexPenetrationDepthSolver | [inline, virtual]

Generated on Wed May 24 14:00:22 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MinkowskiSumShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

MinkowskiSumShape Class Reference

MinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes. More...

#include <MinkowskiSumShape.h>

Inheritance diagram for MinkowskiSumShape:

[legend]
Collaboration diagram for MinkowskiSumShape:

[legend]
List of all members.

Public Member Functions

MinkowskiSumShape (ConvexShape *shapeA, ConvexShape *shapeB)
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
void | SetTransformA (const SimdTransform &transA)
void | SetTransformB (const SimdTransform &transB)
const SimdTransform & | GetTransformA () const
const SimdTransform & | GetTransformB () const
virtual int | GetShapeType () const
virtual float | GetMargin () const
const ConvexShape * | GetShapeA () const
const ConvexShape * | GetShapeB () const
virtual char * | GetName () const

Private Attributes

SimdTransform m_transA
SimdTransform m_transB
ConvexShape * m_shapeA
ConvexShape * m_shapeB

Detailed Description

MinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes.

Definition at line 23 of file MinkowskiSumShape.h.

Constructor & Destructor Documentation

MinkowskiSumShape::MinkowskiSumShape | ( | ConvexShape * | shapeA,
 |  | ConvexShape * | shapeB
 | ) |

Definition at line 19 of file MinkowskiSumShape.cpp.

References m_transA, m_transB, and SimdTransform::setIdentity().

Member Function Documentation

void MinkowskiSumShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Implements ConvexShape.

Definition at line 34 of file MinkowskiSumShape.cpp.

References LocalGetSupportingVertexWithoutMargin().

void MinkowskiSumShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

Implements CollisionShape.

Definition at line 52 of file MinkowskiSumShape.cpp.

References SimdQuadWord::setValue().

float MinkowskiSumShape::GetMargin ( ) const [virtual]

Reimplemented from ConvexShape.

Definition at line 46 of file MinkowskiSumShape.cpp.

References ConvexShape::GetMargin(), m_shapeA, and m_shapeB.

virtual char* MinkowskiSumShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 56 of file MinkowskiSumShape.h.

const ConvexShape* MinkowskiSumShape::GetShapeA ( ) const [inline]

Definition at line 53 of file MinkowskiSumShape.h.

References m_shapeA.

const ConvexShape* MinkowskiSumShape::GetShapeB ( ) const [inline]

Definition at line 54 of file MinkowskiSumShape.h.

References m_shapeB.

virtual int MinkowskiSumShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 49 of file MinkowskiSumShape.h.

References MINKOWSKI_SUM_SHAPE_PROXYTYPE.

const SimdTransform& MinkowskiSumShape::GetTransformA ( ) const [inline]

Definition at line 45 of file MinkowskiSumShape.h.

References m_transA.

const SimdTransform& MinkowskiSumShape::GetTransformB ( ) const [inline]

Definition at line 46 of file MinkowskiSumShape.h.

References m_transB.

SimdVector3 MinkowskiSumShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Implements ConvexShape.

Definition at line 27 of file MinkowskiSumShape.cpp.

References SimdTransform::getBasis(), ConvexShape::LocalGetSupportingVertexWithoutMargin(), m_shapeA, m_shapeB, m_transA, and m_transB.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin().

void MinkowskiSumShape::SetTransformA ( const SimdTransform & transA ) [inline]

Definition at line 42 of file MinkowskiSumShape.h.

References m_transA.

Referenced by GjkConvexCast::calcTimeOfImpact().

void MinkowskiSumShape::SetTransformB ( const SimdTransform & transB ) [inline]

Definition at line 43 of file MinkowskiSumShape.h.

References m_transB.

Referenced by SubsimplexConvexCast::calcTimeOfImpact(), and GjkConvexCast::calcTimeOfImpact().

Member Data Documentation

ConvexShape* MinkowskiSumShape::m_shapeA [private]

Definition at line 28 of file MinkowskiSumShape.h.

Referenced by GetMargin(), GetShapeA(), and LocalGetSupportingVertexWithoutMargin().

ConvexShape* MinkowskiSumShape::m_shapeB [private]

Definition at line 29 of file MinkowskiSumShape.h.

Referenced by GetMargin(), GetShapeB(), and LocalGetSupportingVertexWithoutMargin().

SimdTransform MinkowskiSumShape::m_transA [private]

Definition at line 26 of file MinkowskiSumShape.h.

Referenced by GetTransformA(), LocalGetSupportingVertexWithoutMargin(), MinkowskiSumShape(), and SetTransformA().

SimdTransform MinkowskiSumShape::m_transB [private]

Definition at line 27 of file MinkowskiSumShape.h.

Referenced by GetTransformB(), LocalGetSupportingVertexWithoutMargin(), MinkowskiSumShape(), and SetTransformB().

The documentation for this class was generated from the following files:
  • MinkowskiSumShape.h
  • MinkowskiSumShape.cpp
Generated on Wed May 24 14:00:23 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

MinkowskiSumShape Member List

This is the complete list of members for MinkowskiSumShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | MinkowskiSumShape | [virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | MinkowskiSumShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | MinkowskiSumShape | [virtual]
GetName() const | MinkowskiSumShape | [inline, virtual]
GetShapeA() const | MinkowskiSumShape | [inline]
GetShapeB() const | MinkowskiSumShape | [inline]
GetShapeType() const | MinkowskiSumShape | [inline, virtual]
GetTransformA() const | MinkowskiSumShape | [inline]
GetTransformB() const | MinkowskiSumShape | [inline]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | MinkowskiSumShape | [virtual]
m_localScaling | ConvexShape | [protected]
m_shapeA | MinkowskiSumShape | [private]
m_shapeB | MinkowskiSumShape | [private]
m_tempDebug | CollisionShape |
m_transA | MinkowskiSumShape | [private]
m_transB | MinkowskiSumShape | [private]
MinkowskiSumShape(ConvexShape *shapeA, ConvexShape *shapeB) | MinkowskiSumShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
SetTransformA(const SimdTransform &transA) | MinkowskiSumShape | [inline]
SetTransformB(const SimdTransform &transB) | MinkowskiSumShape | [inline]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:23 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MultiSphereShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

MultiSphereShape Class Reference

MultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex). More...

#include <MultiSphereShape.h>

Inheritance diagram for MultiSphereShape:

[legend]
Collaboration diagram for MultiSphereShape:

[legend]
List of all members.

Public Member Functions

MultiSphereShape (const SimdVector3 &inertiaHalfExtents, const SimdVector3 *positions, const SimdScalar *radi, int numSpheres)
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
CollisionShape Interface.
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
ConvexShape Interface.
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
virtual int | GetShapeType () const
virtual char * | GetName () const

Private Attributes

SimdVector3 | m_localPositions [MAX_NUM_SPHERES]
SimdScalar | m_radi [MAX_NUM_SPHERES]
SimdVector3 m_inertiaHalfExtents
int | m_numSpheres
float | m_minRadius

Detailed Description

MultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex).

Definition at line 25 of file MultiSphereShape.h.

Constructor & Destructor Documentation

MultiSphereShape::MultiSphereShape | ( | const SimdVector3 & | inertiaHalfExtents,
 |  | const SimdVector3 * | positions,
 |  | const SimdScalar * | radi,
 |  | int | numSpheres
 | ) |

Definition at line 20 of file MultiSphereShape.cpp.

References m_localPositions, m_minRadius, m_numSpheres, m_radi, and ConvexShape::SetMargin().

Member Function Documentation

void MultiSphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Implements ConvexShape.

Definition at line 82 of file MultiSphereShape.cpp.

References SimdVector3::dot(), m_localPositions, m_minRadius, m_numSpheres, and m_radi.

void MultiSphereShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

CollisionShape Interface.

Implements CollisionShape.

Definition at line 119 of file MultiSphereShape.cpp.

References CONVEX_DISTANCE_MARGIN, m_inertiaHalfExtents, and SimdTransform::setIdentity().

virtual char* MultiSphereShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 54 of file MultiSphereShape.h.

virtual int MultiSphereShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 52 of file MultiSphereShape.h.

References MULTI_SPHERE_SHAPE_PROXYTYPE.

SimdVector3 MultiSphereShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

ConvexShape Interface.

Implements ConvexShape.

Definition at line 40 of file MultiSphereShape.cpp.

References SimdVector3::dot(), SimdVector3::length2(), m_localPositions, m_minRadius, m_numSpheres, m_radi, SimdQuadWord::setValue(), and SimdSqrt().

Member Data Documentation

SimdVector3 MultiSphereShape::m_inertiaHalfExtents [private]

Definition at line 31 of file MultiSphereShape.h.

Referenced by CalculateLocalInertia().

SimdVector3 MultiSphereShape::m_localPositions[MAX_NUM_SPHERES] [private]

Definition at line 29 of file MultiSphereShape.h.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), LocalGetSupportingVertexWithoutMargin(), and MultiSphereShape().

float MultiSphereShape::m_minRadius [private]

Definition at line 34 of file MultiSphereShape.h.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), LocalGetSupportingVertexWithoutMargin(), and MultiSphereShape().

int MultiSphereShape::m_numSpheres [private]

Definition at line 33 of file MultiSphereShape.h.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), LocalGetSupportingVertexWithoutMargin(), and MultiSphereShape().

SimdScalar MultiSphereShape::m_radi[MAX_NUM_SPHERES] [private]

Definition at line 30 of file MultiSphereShape.h.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), LocalGetSupportingVertexWithoutMargin(), and MultiSphereShape().

The documentation for this class was generated from the following files:
  • MultiSphereShape.h
  • MultiSphereShape.cpp
Generated on Wed May 24 14:00:23 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

MultiSphereShape Member List

This is the complete list of members for MultiSphereShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | MultiSphereShape | [virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | MultiSphereShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | MultiSphereShape | [inline, virtual]
GetShapeType() const | MultiSphereShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | MultiSphereShape | [virtual]
m_inertiaHalfExtents | MultiSphereShape | [private]
m_localPositions | MultiSphereShape | [private]
m_localScaling | ConvexShape | [protected]
m_minRadius | MultiSphereShape | [private]
m_numSpheres | MultiSphereShape | [private]
m_radi | MultiSphereShape | [private]
m_tempDebug | CollisionShape |
MultiSphereShape(const SimdVector3 &inertiaHalfExtents, const SimdVector3 *positions, const SimdScalar *radi, int numSpheres) | MultiSphereShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:23 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MyResult Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

MyResult Struct Reference

Inheritance diagram for MyResult:

[legend]
Collaboration diagram for MyResult:

[legend]
List of all members.

Public Member Functions

MyResult ()
void | AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)

Public Attributes

SimdVector3 m_normalOnBInWorld
SimdVector3 m_pointInWorld
float | m_depth
bool | m_hasResult

Detailed Description

Definition at line 23 of file MinkowskiPenetrationDepthSolver.cpp.

Constructor & Destructor Documentation

MyResult::MyResult ( ) [inline]

Definition at line 26 of file MinkowskiPenetrationDepthSolver.cpp.

Member Function Documentation

void MyResult::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [inline, virtual]

Implements DiscreteCollisionDetectorInterface::Result.

Definition at line 35 of file MinkowskiPenetrationDepthSolver.cpp.

References m_depth, m_hasResult, m_normalOnBInWorld, and m_pointInWorld.

Member Data Documentation

float MyResult::m_depth

Definition at line 32 of file MinkowskiPenetrationDepthSolver.cpp.

Referenced by AddContactPoint(), and MinkowskiPenetrationDepthSolver::CalcPenDepth().

bool MyResult::m_hasResult

Definition at line 33 of file MinkowskiPenetrationDepthSolver.cpp.

Referenced by AddContactPoint(), and MinkowskiPenetrationDepthSolver::CalcPenDepth().

SimdVector3 MyResult::m_normalOnBInWorld

Definition at line 30 of file MinkowskiPenetrationDepthSolver.cpp.

Referenced by AddContactPoint().

SimdVector3 MyResult::m_pointInWorld

Definition at line 31 of file MinkowskiPenetrationDepthSolver.cpp.

Referenced by AddContactPoint(), and MinkowskiPenetrationDepthSolver::CalcPenDepth().

The documentation for this struct was generated from the following file:
  • MinkowskiPenetrationDepthSolver.cpp
Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

MyResult Member List

This is the complete list of members for MyResult, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth) | MyResult | [inline, virtual]
m_depth | MyResult |
m_hasResult | MyResult |
m_normalOnBInWorld | MyResult |
m_pointInWorld | MyResult |
MyResult() | MyResult | [inline]
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]

Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: MyTriangle Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

MyTriangle Struct Reference

#include <TriangleMesh.h>

Collaboration diagram for MyTriangle:

[legend]
List of all members.

Public Attributes

SimdVector3 m_vert0
SimdVector3 m_vert1
SimdVector3 m_vert2

Detailed Description

Definition at line 24 of file TriangleMesh.h.

Member Data Documentation

SimdVector3 MyTriangle::m_vert0

Definition at line 26 of file TriangleMesh.h.

Referenced by TriangleMesh::AddTriangle().

SimdVector3 MyTriangle::m_vert1

Definition at line 27 of file TriangleMesh.h.

Referenced by TriangleMesh::AddTriangle().

SimdVector3 MyTriangle::m_vert2

Definition at line 28 of file TriangleMesh.h.

Referenced by TriangleMesh::AddTriangle().

The documentation for this struct was generated from the following file:
  • TriangleMesh.h
Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

MyTriangle Member List

This is the complete list of members for MyTriangle, including all inherited members.

m_vert0 | MyTriangle
m_vert1 | MyTriangle
m_vert2 | MyTriangle

Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: NodeOverlapCallback Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

NodeOverlapCallback Class Reference

#include <OptimizedBvh.h>

List of all members.

Public Member Functions

virtual | ~NodeOverlapCallback ()
virtual void | ProcessNode (const OptimizedBvhNode *node)=0

Detailed Description

Definition at line 47 of file OptimizedBvh.h.

Constructor & Destructor Documentation

virtual NodeOverlapCallback::~NodeOverlapCallback ( ) [inline, virtual]

Definition at line 50 of file OptimizedBvh.h.

Member Function Documentation

virtual void NodeOverlapCallback::ProcessNode ( const OptimizedBvhNode * node ) [pure virtual]

Referenced by OptimizedBvh::ReportAabbOverlappingNodex(), OptimizedBvh::WalkStacklessTree(), and OptimizedBvh::WalkTree().

The documentation for this class was generated from the following file:
  • OptimizedBvh.h
Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

NodeOverlapCallback Member List

This is the complete list of members for NodeOverlapCallback, including all inherited members.

ProcessNode(const OptimizedBvhNode *node)=0 | NodeOverlapCallback | [pure virtual]
~NodeOverlapCallback() | NodeOverlapCallback | [inline, virtual]

Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OdeConstraintSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

OdeConstraintSolver Class Reference

OdeConstraintSolver is one of the available solvers for Bullet dynamics framework It uses the the unmodified version of quickstep solver from the open dynamics project. More...

#include <OdeConstraintSolver.h>

Inheritance diagram for OdeConstraintSolver:

[legend]
Collaboration diagram for OdeConstraintSolver:

[legend]
List of all members.

Public Member Functions

OdeConstraintSolver ()
virtual | ~OdeConstraintSolver ()
virtual float | SolveGroup (PersistentManifold **manifold, int numManifolds, const ContactSolverInfo &info, IDebugDraw *debugDrawer=0)
void | setConstraintForceMixing (float cfm)
setConstraintForceMixing, the cfm adds some positive value to the main diagonal This can improve convergence (make matrix positive semidefinite), but it can make the simulation look more 'springy'
void | setErrorReductionParamter (float erp)
setErrorReductionParamter sets the maximum amount of error reduction which limits energy addition during penetration depth recovery

Private Member Functions

int | ConvertBody (RigidBody *body, RigidBody **bodies, int &numBodies)
void | ConvertConstraint (PersistentManifold *manifold, BU_Joint **joints, int &numJoints, RigidBody **bodies, int _bodyId0, int _bodyId1, IDebugDraw *debugDrawer)

Private Attributes

int | m_CurBody
int | m_CurJoint
float | m_cfm
float | m_erp

Detailed Description

OdeConstraintSolver is one of the available solvers for Bullet dynamics framework It uses the the unmodified version of quickstep solver from the open dynamics project.

Definition at line 26 of file OdeConstraintSolver.h.

Constructor & Destructor Documentation

OdeConstraintSolver::OdeConstraintSolver ( )

Definition at line 56 of file OdeConstraintSolver.cpp.

virtual OdeConstraintSolver::~OdeConstraintSolver ( ) [inline, virtual]

Definition at line 45 of file OdeConstraintSolver.h.

Member Function Documentation

int OdeConstraintSolver::ConvertBody | ( | RigidBody * | body,
 |  | RigidBody ** | bodies,
 |  | int & | numBodies
 | ) | [private]

Definition at line 132 of file OdeConstraintSolver.cpp.

References dRfromQ1(), RigidBody::getInvInertiaDiagLocal(), RigidBody::getInvMass(), RigidBody::getOrientation(), RigidBody::m_facc, RigidBody::m_I, RigidBody::m_invI, RigidBody::m_R, RigidBody::m_tacc, and SimdQuadWord::setValue().

Referenced by SolveGroup().

void OdeConstraintSolver::ConvertConstraint | ( | PersistentManifold * | manifold,
 |  | BU_Joint ** | joints,
 |  | int & | numJoints,
 |  | RigidBody ** | bodies,
 |  | int | _bodyId0,
 |  | int | _bodyId1,
 |  | IDebugDraw * | debugDrawer
 | ) | [private]

Definition at line 194 of file OdeConstraintSolver.cpp.

References BU_ContactJointNode::body, IDebugDraw::DrawContactPoint(), BU_Joint::flags, PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), PersistentManifold::GetContactPoint(), ManifoldPoint::GetDistance(), ManifoldPoint::GetLifeTime(), PersistentManifold::GetNumContacts(), BU_ContactJointNode::joint, BU_Joint::lambda, m_CurJoint, ManifoldPoint::m_normalWorldOnB, ManifoldPoint::m_positionWorldOnB, MAX_JOINTS_1, BU_Joint::node, and PersistentManifold::RefreshContactPoints().

Referenced by SolveGroup().

void OdeConstraintSolver::setConstraintForceMixing ( float cfm ) [inline]

setConstraintForceMixing, the cfm adds some positive value to the main diagonal This can improve convergence (make matrix positive semidefinite), but it can make the simulation look more 'springy'

Definition at line 51 of file OdeConstraintSolver.h.

References m_cfm.

void OdeConstraintSolver::setErrorReductionParamter ( float erp ) [inline]

setErrorReductionParamter sets the maximum amount of error reduction which limits energy addition during penetration depth recovery

Definition at line 57 of file OdeConstraintSolver.h.

References m_erp.

float OdeConstraintSolver::SolveGroup | ( | PersistentManifold ** | manifold,
 |  | int | numManifolds,
 |  | const ContactSolverInfo & | info,
 |  | IDebugDraw * | debugDrawer = 0
 | ) | [virtual]

Implements ConstraintSolver.

Definition at line 69 of file OdeConstraintSolver.cpp.

References ConvertBody(), ConvertConstraint(), PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), PersistentManifold::GetNumContacts(), m_CurBody, m_CurJoint, and MAX_RIGIDBODIES.

Member Data Documentation

float OdeConstraintSolver::m_cfm [private]

Definition at line 33 of file OdeConstraintSolver.h.

Referenced by setConstraintForceMixing().

int OdeConstraintSolver::m_CurBody [private]

Definition at line 30 of file OdeConstraintSolver.h.

Referenced by SolveGroup().

int OdeConstraintSolver::m_CurJoint [private]

Definition at line 31 of file OdeConstraintSolver.h.

Referenced by ConvertConstraint(), and SolveGroup().

float OdeConstraintSolver::m_erp [private]

Definition at line 34 of file OdeConstraintSolver.h.

Referenced by setErrorReductionParamter().

The documentation for this class was generated from the following files:
  • OdeConstraintSolver.h
  • OdeConstraintSolver.cpp
Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

OdeConstraintSolver Member List

This is the complete list of members for OdeConstraintSolver, including all inherited members.

ConvertBody(RigidBody *body, RigidBody **bodies, int &numBodies) | OdeConstraintSolver | [private]
ConvertConstraint(PersistentManifold *manifold, BU_Joint **joints, int &numJoints, RigidBody **bodies, int _bodyId0, int _bodyId1, IDebugDraw *debugDrawer) | OdeConstraintSolver | [private]
m_cfm | OdeConstraintSolver | [private]
m_CurBody | OdeConstraintSolver | [private]
m_CurJoint | OdeConstraintSolver | [private]
m_erp | OdeConstraintSolver | [private]
OdeConstraintSolver() | OdeConstraintSolver |
setConstraintForceMixing(float cfm) | OdeConstraintSolver | [inline]
setErrorReductionParamter(float erp) | OdeConstraintSolver | [inline]
SolveGroup(PersistentManifold **manifold, int numManifolds, const ContactSolverInfo &info, IDebugDraw *debugDrawer=0) | OdeConstraintSolver | [virtual]
~ConstraintSolver() | ConstraintSolver | [inline, virtual]
~OdeConstraintSolver() | OdeConstraintSolver | [inline, virtual]

Generated on Wed May 24 14:00:24 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OptimizedBvh Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

OptimizedBvh Class Reference

OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU,GPU in future). More...

#include <OptimizedBvh.h>

Collaboration diagram for OptimizedBvh:

[legend]
List of all members.

Public Member Functions

OptimizedBvh ()
virtual | ~OptimizedBvh ()
void | Build (StridingMeshInterface *triangles)
OptimizedBvhNode * | BuildTree (NodeArray &leafNodes, int startIndex, int endIndex)
int | CalcSplittingAxis (NodeArray &leafNodes, int startIndex, int endIndex)
int | SortAndCalcSplittingIndex (NodeArray &leafNodes, int startIndex, int endIndex, int splitAxis)
void | WalkTree (OptimizedBvhNode *rootNode, NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const
void | WalkStacklessTree (OptimizedBvhNode *rootNode, NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const
int | GetNumNodes ()
void | ReportAabbOverlappingNodex (NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const
void | ReportSphereOverlappingNodex (NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const

Private Attributes

OptimizedBvhNode * m_rootNode1
OptimizedBvhNode * m_contiguousNodes
int | m_curNodeIndex
int | m_numNodes
NodeArray m_leafNodes

Detailed Description

OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU,GPU in future).

Definition at line 59 of file OptimizedBvh.h.

Constructor & Destructor Documentation

OptimizedBvh::OptimizedBvh ( ) [inline]

Definition at line 71 of file OptimizedBvh.h.

virtual OptimizedBvh::~OptimizedBvh ( ) [inline, virtual]

Definition at line 72 of file OptimizedBvh.h.

Member Function Documentation

void OptimizedBvh::Build ( StridingMeshInterface * triangles )

create the leafnodes first

Definition at line 22 of file OptimizedBvh.cpp.

References BuildTree(), StridingMeshInterface::InternalProcessAllTriangles(), OptimizedBvhNode::m_aabbMax, OptimizedBvhNode::m_aabbMin, m_contiguousNodes, m_curNodeIndex, OptimizedBvhNode::m_escapeIndex, m_leafNodes, OptimizedBvhNode::m_leftChild, OptimizedBvhNode::m_rightChild, m_rootNode1, OptimizedBvhNode::m_subPart, OptimizedBvhNode::m_triangleIndex, SimdQuadWord::setMax(), and SimdQuadWord::setMin().

Referenced by BvhTriangleMeshShape::BvhTriangleMeshShape(), and BvhTriangleMeshShape::setLocalScaling().

OptimizedBvhNode * OptimizedBvh::BuildTree | ( | NodeArray & | leafNodes,
 |  | int | startIndex,
 |  | int | endIndex
 | ) |

Definition at line 89 of file OptimizedBvh.cpp.

References CalcSplittingAxis(), OptimizedBvhNode::m_aabbMax, OptimizedBvhNode::m_aabbMin, m_contiguousNodes, m_curNodeIndex, OptimizedBvhNode::m_escapeIndex, OptimizedBvhNode::m_leftChild, OptimizedBvhNode::m_rightChild, SimdQuadWord::setMax(), SimdQuadWord::setMin(), SimdQuadWord::setValue(), and SortAndCalcSplittingIndex().

Referenced by Build().

int OptimizedBvh::CalcSplittingAxis | ( | NodeArray & | leafNodes,
 |  | int | startIndex,
 |  | int | endIndex
 | ) |

Definition at line 168 of file OptimizedBvh.cpp.

References SimdVector3::maxAxis().

Referenced by BuildTree().

int OptimizedBvh::GetNumNodes ( ) [inline]

Definition at line 89 of file OptimizedBvh.h.

References m_numNodes.

void OptimizedBvh::ReportAabbOverlappingNodex | ( | NodeOverlapCallback * | nodeCallback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const

Definition at line 197 of file OptimizedBvh.cpp.

References SimdVector3::length(), m_leafNodes, and NodeOverlapCallback::ProcessNode().

Referenced by BvhTriangleMeshShape::ProcessAllTriangles().

void OptimizedBvh::ReportSphereOverlappingNodex | ( | NodeOverlapCallback * | nodeCallback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const

Definition at line 272 of file OptimizedBvh.cpp.

int OptimizedBvh::SortAndCalcSplittingIndex | ( | NodeArray & | leafNodes,
 |  | int | startIndex,
 |  | int | endIndex,
 |  | int | splitAxis
 | ) |

Definition at line 130 of file OptimizedBvh.cpp.

Referenced by BuildTree().

void OptimizedBvh::WalkStacklessTree | ( | OptimizedBvhNode * | rootNode,
 |  | NodeOverlapCallback * | nodeCallback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const

Definition at line 233 of file OptimizedBvh.cpp.

References OptimizedBvhNode::m_aabbMax, OptimizedBvhNode::m_aabbMin, m_curNodeIndex, OptimizedBvhNode::m_escapeIndex, OptimizedBvhNode::m_leftChild, OptimizedBvhNode::m_rightChild, NodeOverlapCallback::ProcessNode(), and TestAabbAgainstAabb2().

void OptimizedBvh::WalkTree | ( | OptimizedBvhNode * | rootNode,
 |  | NodeOverlapCallback * | nodeCallback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const

Definition at line 213 of file OptimizedBvh.cpp.

References OptimizedBvhNode::m_aabbMax, OptimizedBvhNode::m_aabbMin, OptimizedBvhNode::m_leftChild, OptimizedBvhNode::m_rightChild, NodeOverlapCallback::ProcessNode(), and TestAabbAgainstAabb2().

Member Data Documentation

OptimizedBvhNode* OptimizedBvh::m_contiguousNodes [private]

Definition at line 63 of file OptimizedBvh.h.

Referenced by Build(), and BuildTree().

int OptimizedBvh::m_curNodeIndex [private]

Definition at line 64 of file OptimizedBvh.h.

Referenced by Build(), BuildTree(), and WalkStacklessTree().

NodeArray OptimizedBvh::m_leafNodes [private]

Definition at line 68 of file OptimizedBvh.h.

Referenced by Build(), and ReportAabbOverlappingNodex().

int OptimizedBvh::m_numNodes [private]

Definition at line 66 of file OptimizedBvh.h.

Referenced by GetNumNodes().

OptimizedBvhNode* OptimizedBvh::m_rootNode1 [private]

Definition at line 61 of file OptimizedBvh.h.

Referenced by Build().

The documentation for this class was generated from the following files:
  • OptimizedBvh.h
  • OptimizedBvh.cpp
Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

OptimizedBvh Member List

This is the complete list of members for OptimizedBvh, including all inherited members.

Build(StridingMeshInterface *triangles) | OptimizedBvh |
BuildTree(NodeArray &leafNodes, int startIndex, int endIndex) | OptimizedBvh |
CalcSplittingAxis(NodeArray &leafNodes, int startIndex, int endIndex) | OptimizedBvh |
GetNumNodes() | OptimizedBvh | [inline]
m_contiguousNodes | OptimizedBvh | [private]
m_curNodeIndex | OptimizedBvh | [private]
m_leafNodes | OptimizedBvh | [private]
m_numNodes | OptimizedBvh | [private]
m_rootNode1 | OptimizedBvh | [private]
OptimizedBvh() | OptimizedBvh | [inline]
ReportAabbOverlappingNodex(NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | OptimizedBvh |
ReportSphereOverlappingNodex(NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | OptimizedBvh |
SortAndCalcSplittingIndex(NodeArray &leafNodes, int startIndex, int endIndex, int splitAxis) | OptimizedBvh |
WalkStacklessTree(OptimizedBvhNode *rootNode, NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | OptimizedBvh |
WalkTree(OptimizedBvhNode *rootNode, NodeOverlapCallback *nodeCallback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | OptimizedBvh |
~OptimizedBvh() | OptimizedBvh | [inline, virtual]

Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: OptimizedBvhNode Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

OptimizedBvhNode Struct Reference

OptimizedBvhNode contains both internal and leaf node information. More...

#include <OptimizedBvh.h>

Collaboration diagram for OptimizedBvhNode:

[legend]
List of all members.

Public Attributes

SimdVector3 m_aabbMin
SimdVector3 m_aabbMax
OptimizedBvhNode * m_leftChild
OptimizedBvhNode * m_rightChild
int | m_escapeIndex
int | m_subPart
int | m_triangleIndex

Detailed Description

OptimizedBvhNode contains both internal and leaf node information.

It hasn't been optimized yet for storage. Some obvious optimizations are: Removal of the pointers (can already be done, they are not used for traversal) and storing aabbmin/max as quantized integers. 'subpart' doesn't need an integer either. It allows to re-use graphics triangle meshes stored in a non-uniform way (like batches/subparts of triangle-fans

Definition at line 29 of file OptimizedBvh.h.

Member Data Documentation

SimdVector3 OptimizedBvhNode::m_aabbMax

Definition at line 33 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), OptimizedBvh::WalkStacklessTree(), and OptimizedBvh::WalkTree().

SimdVector3 OptimizedBvhNode::m_aabbMin

Definition at line 32 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), OptimizedBvh::WalkStacklessTree(), and OptimizedBvh::WalkTree().

int OptimizedBvhNode::m_escapeIndex

Definition at line 39 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), and OptimizedBvh::WalkStacklessTree().

OptimizedBvhNode* OptimizedBvhNode::m_leftChild

Definition at line 36 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), OptimizedBvh::WalkStacklessTree(), and OptimizedBvh::WalkTree().

OptimizedBvhNode* OptimizedBvhNode::m_rightChild

Definition at line 37 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), OptimizedBvh::WalkStacklessTree(), and OptimizedBvh::WalkTree().

int OptimizedBvhNode::m_subPart

Definition at line 42 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), and BvhTriangleMeshShape::ProcessAllTriangles().

int OptimizedBvhNode::m_triangleIndex

Definition at line 43 of file OptimizedBvh.h.

Referenced by OptimizedBvh::Build(), and BvhTriangleMeshShape::ProcessAllTriangles().

The documentation for this struct was generated from the following file:
  • OptimizedBvh.h
Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

OptimizedBvhNode Member List

This is the complete list of members for OptimizedBvhNode, including all inherited members.

m_aabbMax | OptimizedBvhNode
m_aabbMin | OptimizedBvhNode
m_escapeIndex | OptimizedBvhNode
m_leftChild | OptimizedBvhNode
m_rightChild | OptimizedBvhNode
m_subPart | OptimizedBvhNode
m_triangleIndex | OptimizedBvhNode

Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PersistentManifold Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

PersistentManifold Class Reference

PersistentManifold maintains contact points, and reduces them to 4. More...

#include <PersistentManifold.h>

Collaboration diagram for PersistentManifold:

[legend]
List of all members.

Public Member Functions

PersistentManifold ()
PersistentManifold (void *body0, void *body1)
void * | GetBody0 ()
void * | GetBody1 ()
const void * | GetBody0 () const
const void * | GetBody1 () const
void | SetBodies (void *body0, void *body1)
void | ClearUserCache (ManifoldPoint &pt)
int | GetNumContacts () const
const ManifoldPoint & | GetContactPoint (int index) const
ManifoldPoint & | GetContactPoint (int index)
float | GetContactBreakingTreshold () const
todo: get this margin from the current physics / collision environment
int | GetCacheEntry (const ManifoldPoint &newPoint) const
void | AddManifoldPoint (const ManifoldPoint &newPoint)
void | RemoveContactPoint (int index)
void | ReplaceContactPoint (const ManifoldPoint &newPoint, int insertIndex)
bool | ValidContactDistance (const ManifoldPoint &pt) const
void | RefreshContactPoints (const SimdTransform &trA, const SimdTransform &trB)
calculated new worldspace coordinates and depth, and reject points that exceed the collision margin
void | ClearManifold ()

Public Attributes

int | m_index1

Private Member Functions

int | SortCachedPoints (const ManifoldPoint &pt)
sort cached points so most isolated points come first
int | FindContactPoint (const ManifoldPoint *unUsed, int numUnused, const ManifoldPoint &pt)

Private Attributes

ManifoldPoint | m_pointCache [MANIFOLD_CACHE_SIZE]
void * | m_body0
this two body pointers can point to the physics rigidbody class.
void * | m_body1
int | m_cachedPoints

Detailed Description

PersistentManifold maintains contact points, and reduces them to 4.

It does contact filtering/contact reduction.

Definition at line 39 of file PersistentManifold.h.

Constructor & Destructor Documentation

PersistentManifold::PersistentManifold ( )

Definition at line 25 of file PersistentManifold.cpp.

PersistentManifold::PersistentManifold | ( | void * | body0,
 |  | void * | body1
 | ) | [inline]

Definition at line 62 of file PersistentManifold.h.

Member Function Documentation

void PersistentManifold::AddManifoldPoint ( const ManifoldPoint & newPoint )

Definition at line 157 of file PersistentManifold.cpp.

References GetNumContacts(), m_cachedPoints, MANIFOLD_CACHE_SIZE, ReplaceContactPoint(), SortCachedPoints(), and ValidContactDistance().

Referenced by ManifoldResult::AddContactPoint(), and ManifoldContactAddResult::AddContactPoint().

void PersistentManifold::ClearManifold ( )

Definition at line 34 of file PersistentManifold.cpp.

References ClearUserCache(), m_cachedPoints, and m_pointCache.

Referenced by CollisionDispatcher::ClearManifold().

void PersistentManifold::ClearUserCache ( ManifoldPoint & pt )

Definition at line 57 of file PersistentManifold.cpp.

References gContactCallback, m_cachedPoints, m_pointCache, and ManifoldPoint::m_userPersistentData.

Referenced by ClearManifold().

int PersistentManifold::FindContactPoint | ( | const ManifoldPoint * | unUsed,
 |  | int | numUnused,
 |  | const ManifoldPoint & | pt
 | ) | [private]

const void* PersistentManifold::GetBody0 ( ) const [inline]

Definition at line 70 of file PersistentManifold.h.

void* PersistentManifold::GetBody0 ( ) [inline]

Definition at line 67 of file PersistentManifold.h.

Referenced by CollisionDispatcher::BuildAndProcessIslands(), CcdPhysicsEnvironment::CallbackTriggers(), OdeConstraintSolver::ConvertConstraint(), CollisionDispatcher::FindUnions(), SimpleConstraintSolver::Solve(), SimpleConstraintSolver::SolveFriction(), and OdeConstraintSolver::SolveGroup().

const void* PersistentManifold::GetBody1 ( ) const [inline]

Definition at line 71 of file PersistentManifold.h.

void* PersistentManifold::GetBody1 ( ) [inline]

Definition at line 68 of file PersistentManifold.h.

Referenced by CollisionDispatcher::BuildAndProcessIslands(), CcdPhysicsEnvironment::CallbackTriggers(), OdeConstraintSolver::ConvertConstraint(), CollisionDispatcher::FindUnions(), SimpleConstraintSolver::Solve(), SimpleConstraintSolver::SolveFriction(), and OdeConstraintSolver::SolveGroup().

int PersistentManifold::GetCacheEntry ( const ManifoldPoint & newPoint ) const

Definition at line 137 of file PersistentManifold.cpp.

References GetContactBreakingTreshold(), GetNumContacts(), ManifoldPoint::m_localPointA, and m_pointCache.

Referenced by ManifoldResult::AddContactPoint(), and ManifoldContactAddResult::AddContactPoint().

float PersistentManifold::GetContactBreakingTreshold ( ) const

todo: get this margin from the current physics / collision environment

Definition at line 181 of file PersistentManifold.cpp.

References gContactBreakingTreshold.

Referenced by ManifoldResult::AddContactPoint(), ManifoldContactAddResult::AddContactPoint(), GetCacheEntry(), ConvexConvexAlgorithm::ProcessCollision(), and RefreshContactPoints().

ManifoldPoint& PersistentManifold::GetContactPoint ( int index ) [inline]

Definition at line 93 of file PersistentManifold.h.

References ASSERT.

const ManifoldPoint& PersistentManifold::GetContactPoint ( int index ) const [inline]

Definition at line 87 of file PersistentManifold.h.

References ASSERT.

Referenced by OdeConstraintSolver::ConvertConstraint(), ContactJoint::GetInfo2(), SimpleConstraintSolver::Solve(), and SimpleConstraintSolver::SolveFriction().

int PersistentManifold::GetNumContacts ( ) const [inline]

Definition at line 85 of file PersistentManifold.h.

Referenced by AddManifoldPoint(), CcdPhysicsEnvironment::CallbackTriggers(), OdeConstraintSolver::ConvertConstraint(), GetCacheEntry(), RefreshContactPoints(), SimpleConstraintSolver::Solve(), SimpleConstraintSolver::SolveFriction(), and OdeConstraintSolver::SolveGroup().

void PersistentManifold::RefreshContactPoints | ( | const SimdTransform & | trA,
 |  | const SimdTransform & | trB
 | ) |

calculated new worldspace coordinates and depth, and reject points that exceed the collision margin

first refresh worldspace positions and distance

then

Definition at line 186 of file PersistentManifold.cpp.

References SimdVector3::dot(), dot(), GetContactBreakingTreshold(), GetNumContacts(), ManifoldPoint::m_distance1, ManifoldPoint::m_lifeTime, ManifoldPoint::m_localPointA, ManifoldPoint::m_localPointB, ManifoldPoint::m_normalWorldOnB, m_pointCache, ManifoldPoint::m_positionWorldOnA, ManifoldPoint::m_positionWorldOnB, RemoveContactPoint(), and ValidContactDistance().

Referenced by OdeConstraintSolver::ConvertConstraint(), and SimpleConstraintSolver::Solve().

void PersistentManifold::RemoveContactPoint ( int index ) [inline]

Definition at line 106 of file PersistentManifold.h.

Referenced by RefreshContactPoints().

void PersistentManifold::ReplaceContactPoint | ( | const ManifoldPoint & | newPoint,
 |  | int | insertIndex
 | ) | [inline]

Definition at line 116 of file PersistentManifold.h.

Referenced by ManifoldContactAddResult::AddContactPoint(), and AddManifoldPoint().

void PersistentManifold::SetBodies | ( | void * | body0,
 |  | void * | body1
 | ) | [inline]

Definition at line 73 of file PersistentManifold.h.

Referenced by ConvexConcaveCollisionAlgorithm::ProcessCollision().

int PersistentManifold::SortCachedPoints ( const ManifoldPoint & pt ) [private]

sort cached points so most isolated points come first

Definition at line 95 of file PersistentManifold.cpp.

References SimdVector4::closestAxis4(), SimdVector3::cross(), cross(), SimdVector3::length2(), ManifoldPoint::m_localPointA, and m_pointCache.

Referenced by AddManifoldPoint().

bool PersistentManifold::ValidContactDistance ( const ManifoldPoint & pt ) const [inline]

Definition at line 125 of file PersistentManifold.h.

References ManifoldPoint::m_distance1.

Referenced by AddManifoldPoint(), and RefreshContactPoints().

Member Data Documentation

void* PersistentManifold::m_body0 [private]

this two body pointers can point to the physics rigidbody class.

void* will allow any rigidbody class

Definition at line 46 of file PersistentManifold.h.

void* PersistentManifold::m_body1 [private]

Definition at line 47 of file PersistentManifold.h.

int PersistentManifold::m_cachedPoints [private]

Definition at line 48 of file PersistentManifold.h.

Referenced by AddManifoldPoint(), ClearManifold(), and ClearUserCache().

int PersistentManifold::m_index1

Definition at line 58 of file PersistentManifold.h.

ManifoldPoint PersistentManifold::m_pointCache[MANIFOLD_CACHE_SIZE] [private]

Definition at line 42 of file PersistentManifold.h.

Referenced by ClearManifold(), ClearUserCache(), GetCacheEntry(), RefreshContactPoints(), and SortCachedPoints().

The documentation for this class was generated from the following files:
  • PersistentManifold.h
  • PersistentManifold.cpp
Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PersistentManifold Member List

This is the complete list of members for PersistentManifold, including all inherited members.

AddManifoldPoint(const ManifoldPoint &newPoint) | PersistentManifold |
ClearManifold() | PersistentManifold |
ClearUserCache(ManifoldPoint &pt) | PersistentManifold |
FindContactPoint(const ManifoldPoint *unUsed, int numUnused, const ManifoldPoint &pt) | PersistentManifold | [private]
GetBody0() | PersistentManifold | [inline]
GetBody0() const | PersistentManifold | [inline]
GetBody1() | PersistentManifold | [inline]
GetBody1() const | PersistentManifold | [inline]
GetCacheEntry(const ManifoldPoint &newPoint) const | PersistentManifold |
GetContactBreakingTreshold() const | PersistentManifold |
GetContactPoint(int index) const | PersistentManifold | [inline]
GetContactPoint(int index) | PersistentManifold | [inline]
GetNumContacts() const | PersistentManifold | [inline]
m_body0 | PersistentManifold | [private]
m_body1 | PersistentManifold | [private]
m_cachedPoints | PersistentManifold | [private]
m_index1 | PersistentManifold |
m_pointCache | PersistentManifold | [private]
PersistentManifold() | PersistentManifold |
PersistentManifold(void *body0, void *body1) | PersistentManifold | [inline]
RefreshContactPoints(const SimdTransform &trA, const SimdTransform &trB) | PersistentManifold |
RemoveContactPoint(int index) | PersistentManifold | [inline]
ReplaceContactPoint(const ManifoldPoint &newPoint, int insertIndex) | PersistentManifold | [inline]
SetBodies(void *body0, void *body1) | PersistentManifold | [inline]
SortCachedPoints(const ManifoldPoint &pt) | PersistentManifold | [private]
ValidContactDistance(const ManifoldPoint &pt) const | PersistentManifold | [inline]

Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY__Vector3 Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY__Vector3 Struct Reference

#include <PHY_DynamicTypes.h>

List of all members.

Public Member Functions

operator const float * () const
operator float * ()

Public Attributes

float m_vec [4]

Detailed Description

Definition at line 26 of file PHY_DynamicTypes.h.

Member Function Documentation

PHY__Vector3::operator const float * ( ) const [inline]

Definition at line 29 of file PHY_DynamicTypes.h.

References m_vec.

PHY__Vector3::operator float * ( ) [inline]

Definition at line 33 of file PHY_DynamicTypes.h.

References m_vec.

Member Data Documentation

float PHY__Vector3::m_vec[4]

Definition at line 28 of file PHY_DynamicTypes.h.

Referenced by operator const float *(), and operator float *().

The documentation for this struct was generated from the following file:
  • PHY_DynamicTypes.h
Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY__Vector3 Member List

This is the complete list of members for PHY__Vector3, including all inherited members.

m_vec | PHY__Vector3 |
operator const float *() const | PHY__Vector3 | [inline]
operator float *() | PHY__Vector3 | [inline]

Generated on Wed May 24 14:00:25 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_CollData Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_CollData Struct Reference

#include <PHY_DynamicTypes.h>

Collaboration diagram for PHY_CollData:

[legend]
List of all members.

Public Attributes

PHY__Vector3 m_point1
PHY__Vector3 m_point2
PHY__Vector3 m_normal

Detailed Description

Definition at line 51 of file PHY_DynamicTypes.h.

Member Data Documentation

PHY__Vector3 PHY_CollData::m_normal

Definition at line 54 of file PHY_DynamicTypes.h.

PHY__Vector3 PHY_CollData::m_point1

Definition at line 52 of file PHY_DynamicTypes.h.

PHY__Vector3 PHY_CollData::m_point2

Definition at line 53 of file PHY_DynamicTypes.h.

The documentation for this struct was generated from the following file:
  • PHY_DynamicTypes.h
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_CollData Member List

This is the complete list of members for PHY_CollData, including all inherited members.

m_normal | PHY_CollData
m_point1 | PHY_CollData
m_point2 | PHY_CollData

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IMotionState Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IMotionState Class Reference

PHY_IMotionState is the Interface to explicitly synchronize the world transformation. More...

#include <PHY_IMotionState.h>

Inheritance diagram for PHY_IMotionState:

[legend]
List of all members.

Public Member Functions

virtual | ~PHY_IMotionState ()
virtual void | getWorldPosition (float &posX, float &posY, float &posZ)=0
virtual void | getWorldScaling (float &scaleX, float &scaleY, float &scaleZ)=0
virtual void | getWorldOrientation (float &quatIma0, float &quatIma1, float &quatIma2, float &quatReal)=0
virtual void | setWorldPosition (float posX, float posY, float posZ)=0
virtual void | setWorldOrientation (float quatIma0, float quatIma1, float quatIma2, float quatReal)=0
virtual void | calculateWorldTransformations ()=0

Detailed Description

PHY_IMotionState is the Interface to explicitly synchronize the world transformation.

Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided.

Definition at line 24 of file PHY_IMotionState.h.

Constructor & Destructor Documentation

PHY_IMotionState::~PHY_IMotionState ( ) [virtual]

Definition at line 19 of file PHY_IMotionState.cpp.

Member Function Documentation

virtual void PHY_IMotionState::calculateWorldTransformations ( ) [pure virtual]

Implemented in DefaultMotionState.

Referenced by CcdPhysicsController::SynchronizeMotionStates().

virtual void PHY_IMotionState::getWorldOrientation | ( | float & | quatIma0,
 |  | float & | quatIma1,
 |  | float & | quatIma2,
 |  | float & | quatReal
 | ) | [pure virtual]

Implemented in DefaultMotionState.

Referenced by CcdPhysicsController::GetTransformFromMotionState(), and CcdPhysicsController::GetWorldOrientation().

virtual void PHY_IMotionState::getWorldPosition | ( | float & | posX,
 |  | float & | posY,
 |  | float & | posZ
 | ) | [pure virtual]

Implemented in DefaultMotionState.

Referenced by CcdPhysicsController::GetTransformFromMotionState().

virtual void PHY_IMotionState::getWorldScaling | ( | float & | scaleX,
 |  | float & | scaleY,
 |  | float & | scaleZ
 | ) | [pure virtual]

Implemented in DefaultMotionState.

Referenced by CcdPhysicsController::SynchronizeMotionStates().

virtual void PHY_IMotionState::setWorldOrientation | ( | float | quatIma0,
 |  | float | quatIma1,
 |  | float | quatIma2,
 |  | float | quatReal
 | ) | [pure virtual]

Implemented in DefaultMotionState.

Referenced by CcdPhysicsController::SynchronizeMotionStates().

virtual void PHY_IMotionState::setWorldPosition | ( | float | posX,
 |  | float | posY,
 |  | float | posZ
 | ) | [pure virtual]

Implemented in DefaultMotionState.

Referenced by CcdPhysicsController::SynchronizeMotionStates().

The documentation for this class was generated from the following files:
  • PHY_IMotionState.h
  • PHY_IMotionState.cpp
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IMotionState Member List

This is the complete list of members for PHY_IMotionState, including all inherited members.

calculateWorldTransformations()=0 | PHY_IMotionState | [pure virtual]
getWorldOrientation(float &quatIma0, float &quatIma1, float &quatIma2, float &quatReal)=0 | PHY_IMotionState | [pure virtual]
getWorldPosition(float &posX, float &posY, float &posZ)=0 | PHY_IMotionState | [pure virtual]
getWorldScaling(float &scaleX, float &scaleY, float &scaleZ)=0 | PHY_IMotionState | [pure virtual]
setWorldOrientation(float quatIma0, float quatIma1, float quatIma2, float quatReal)=0 | PHY_IMotionState | [pure virtual]
setWorldPosition(float posX, float posY, float posZ)=0 | PHY_IMotionState | [pure virtual]
~PHY_IMotionState() | PHY_IMotionState | [virtual]

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsController Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IPhysicsController Class Reference

PHY_IPhysicsController is the abstract simplified Interface to a physical object. More...

#include <PHY_IPhysicsController.h>

Inheritance diagram for PHY_IPhysicsController:

[legend]
List of all members.

Public Member Functions

virtual | ~PHY_IPhysicsController ()
virtual bool | SynchronizeMotionStates (float time)=0
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding').
virtual void | WriteMotionStateToDynamics (bool nondynaonly)=0
WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding').
virtual void | WriteDynamicsToMotionState ()=0
virtual void | PostProcessReplica (class PHY_IMotionState *motionstate, class PHY_IPhysicsController *parentctrl)=0
virtual void | RelativeTranslate (float dlocX, float dlocY, float dlocZ, bool local)=0
virtual void | RelativeRotate (const float drot[12], bool local)=0
virtual void | getOrientation (float &quatImag0, float &quatImag1, float &quatImag2, float &quatReal)=0
virtual void | setOrientation (float quatImag0, float quatImag1, float quatImag2, float quatReal)=0
virtual void | setPosition (float posX, float posY, float posZ)=0
virtual void | getPosition (PHY__Vector3 &pos) const =0
virtual void | setScaling (float scaleX, float scaleY, float scaleZ)=0
virtual void | ApplyTorque (float torqueX, float torqueY, float torqueZ, bool local)=0
virtual void | ApplyForce (float forceX, float forceY, float forceZ, bool local)=0
virtual void | SetAngularVelocity (float ang_velX, float ang_velY, float ang_velZ, bool local)=0
virtual void | SetLinearVelocity (float lin_velX, float lin_velY, float lin_velZ, bool local)=0
virtual void | applyImpulse (float attachX, float attachY, float attachZ, float impulseX, float impulseY, float impulseZ)=0
virtual void | SetActive (bool active)=0
virtual void | GetLinearVelocity (float &linvX, float &linvY, float &linvZ)=0
virtual void | GetVelocity (const float posX, const float posY, const float posZ, float &linvX, float &linvY, float &linvZ)=0
virtual void | getReactionForce (float &forceX, float &forceY, float &forceZ)=0
virtual void | setRigidBody (bool rigid)=0
virtual void * | getNewClientInfo ()=0
virtual void | setNewClientInfo (void *clientinfo)=0
virtual PHY_IPhysicsController * | GetReplica ()
virtual void | calcXform ()=0
virtual void | SetMargin (float margin)=0
virtual float | GetMargin () const =0
virtual float | GetRadius () const
PHY__Vector3 | GetWorldPosition (PHY__Vector3 &localpos)

Detailed Description

PHY_IPhysicsController is the abstract simplified Interface to a physical object.

It contains the IMotionState and IDeformableMesh Interfaces.

Definition at line 28 of file PHY_IPhysicsController.h.

Constructor & Destructor Documentation

PHY_IPhysicsController::~PHY_IPhysicsController ( ) [virtual]

Definition at line 19 of file PHY_IPhysicsController.cpp.

Member Function Documentation

virtual void PHY_IPhysicsController::ApplyForce | ( | float | forceX,
 |  | float | forceY,
 |  | float | forceZ,
 |  | bool | local
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::applyImpulse | ( | float | attachX,
 |  | float | attachY,
 |  | float | attachZ,
 |  | float | impulseX,
 |  | float | impulseY,
 |  | float | impulseZ
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::ApplyTorque | ( | float | torqueX,
 |  | float | torqueY,
 |  | float | torqueZ,
 |  | bool | local
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::calcXform ( ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::GetLinearVelocity | ( | float & | linvX,
 |  | float & | linvY,
 |  | float & | linvZ
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual float PHY_IPhysicsController::GetMargin ( ) const [pure virtual]

Implemented in CcdPhysicsController.

virtual void* PHY_IPhysicsController::getNewClientInfo ( ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::getOrientation | ( | float & | quatImag0,
 |  | float & | quatImag1,
 |  | float & | quatImag2,
 |  | float & | quatReal
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::getPosition ( PHY__Vector3 & pos ) const [pure virtual]

Implemented in CcdPhysicsController.

virtual float PHY_IPhysicsController::GetRadius ( ) const [inline, virtual]

Definition at line 82 of file PHY_IPhysicsController.h.

virtual void PHY_IPhysicsController::getReactionForce | ( | float & | forceX,
 |  | float & | forceY,
 |  | float & | forceZ
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual PHY_IPhysicsController* PHY_IPhysicsController::GetReplica ( ) [inline, virtual]

Reimplemented in CcdPhysicsController.

Definition at line 77 of file PHY_IPhysicsController.h.

virtual void PHY_IPhysicsController::GetVelocity | ( | const float | posX,
 |  | const float | posY,
 |  | const float | posZ,
 |  | float & | linvX,
 |  | float & | linvY,
 |  | float & | linvZ
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

PHY__Vector3 PHY_IPhysicsController::GetWorldPosition ( PHY__Vector3 & localpos )

virtual void PHY_IPhysicsController::PostProcessReplica | ( | class PHY_IMotionState * | motionstate,
 |  | class PHY_IPhysicsController * | parentctrl
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::RelativeRotate | ( | const float | drot[12],
 |  | bool | local
 | ) | [pure virtual]

virtual void PHY_IPhysicsController::RelativeTranslate | ( | float | dlocX,
 |  | float | dlocY,
 |  | float | dlocZ,
 |  | bool | local
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::SetActive ( bool active ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::SetAngularVelocity | ( | float | ang_velX,
 |  | float | ang_velY,
 |  | float | ang_velZ,
 |  | bool | local
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::SetLinearVelocity | ( | float | lin_velX,
 |  | float | lin_velY,
 |  | float | lin_velZ,
 |  | bool | local
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::SetMargin ( float margin ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::setNewClientInfo ( void * clientinfo ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::setOrientation | ( | float | quatImag0,
 |  | float | quatImag1,
 |  | float | quatImag2,
 |  | float | quatReal
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::setPosition | ( | float | posX,
 |  | float | posY,
 |  | float | posZ
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::setRigidBody ( bool rigid ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::setScaling | ( | float | scaleX,
 |  | float | scaleY,
 |  | float | scaleZ
 | ) | [pure virtual]

Implemented in CcdPhysicsController.

virtual bool PHY_IPhysicsController::SynchronizeMotionStates ( float time ) [pure virtual]

SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding').

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::WriteDynamicsToMotionState ( ) [pure virtual]

Implemented in CcdPhysicsController.

virtual void PHY_IPhysicsController::WriteMotionStateToDynamics ( bool nondynaonly ) [pure virtual]

WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding').

Implemented in CcdPhysicsController.

The documentation for this class was generated from the following files:
  • PHY_IPhysicsController.h
  • PHY_IPhysicsController.cpp
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IPhysicsController Member List

This is the complete list of members for PHY_IPhysicsController, including all inherited members.

ApplyForce(float forceX, float forceY, float forceZ, bool local)=0 | PHY_IPhysicsController | [pure virtual]
applyImpulse(float attachX, float attachY, float attachZ, float impulseX, float impulseY, float impulseZ)=0 | PHY_IPhysicsController | [pure virtual]
ApplyTorque(float torqueX, float torqueY, float torqueZ, bool local)=0 | PHY_IPhysicsController | [pure virtual]
calcXform()=0 | PHY_IPhysicsController | [pure virtual]
GetLinearVelocity(float &linvX, float &linvY, float &linvZ)=0 | PHY_IPhysicsController | [pure virtual]
GetMargin() const =0 | PHY_IPhysicsController | [pure virtual]
getNewClientInfo()=0 | PHY_IPhysicsController | [pure virtual]
getOrientation(float &quatImag0, float &quatImag1, float &quatImag2, float &quatReal)=0 | PHY_IPhysicsController | [pure virtual]
getPosition(PHY__Vector3 &pos) const =0 | PHY_IPhysicsController | [pure virtual]
GetRadius() const | PHY_IPhysicsController | [inline, virtual]
getReactionForce(float &forceX, float &forceY, float &forceZ)=0 | PHY_IPhysicsController | [pure virtual]
GetReplica() | PHY_IPhysicsController | [inline, virtual]
GetVelocity(const float posX, const float posY, const float posZ, float &linvX, float &linvY, float &linvZ)=0 | PHY_IPhysicsController | [pure virtual]
GetWorldPosition(PHY__Vector3 &localpos) | PHY_IPhysicsController |
PostProcessReplica(class PHY_IMotionState *motionstate, class PHY_IPhysicsController *parentctrl)=0 | PHY_IPhysicsController | [pure virtual]
RelativeRotate(const float drot[12], bool local)=0 | PHY_IPhysicsController | [pure virtual]
RelativeTranslate(float dlocX, float dlocY, float dlocZ, bool local)=0 | PHY_IPhysicsController | [pure virtual]
SetActive(bool active)=0 | PHY_IPhysicsController | [pure virtual]
SetAngularVelocity(float ang_velX, float ang_velY, float ang_velZ, bool local)=0 | PHY_IPhysicsController | [pure virtual]
SetLinearVelocity(float lin_velX, float lin_velY, float lin_velZ, bool local)=0 | PHY_IPhysicsController | [pure virtual]
SetMargin(float margin)=0 | PHY_IPhysicsController | [pure virtual]
setNewClientInfo(void *clientinfo)=0 | PHY_IPhysicsController | [pure virtual]
setOrientation(float quatImag0, float quatImag1, float quatImag2, float quatReal)=0 | PHY_IPhysicsController | [pure virtual]
setPosition(float posX, float posY, float posZ)=0 | PHY_IPhysicsController | [pure virtual]
setRigidBody(bool rigid)=0 | PHY_IPhysicsController | [pure virtual]
setScaling(float scaleX, float scaleY, float scaleZ)=0 | PHY_IPhysicsController | [pure virtual]
SynchronizeMotionStates(float time)=0 | PHY_IPhysicsController | [pure virtual]
WriteDynamicsToMotionState()=0 | PHY_IPhysicsController | [pure virtual]
WriteMotionStateToDynamics(bool nondynaonly)=0 | PHY_IPhysicsController | [pure virtual]
~PHY_IPhysicsController() | PHY_IPhysicsController | [virtual]

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IPhysicsEnvironment Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IPhysicsEnvironment Class Reference

Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc. More...

#include <PHY_IPhysicsEnvironment.h>

Inheritance diagram for PHY_IPhysicsEnvironment:

[legend]
List of all members.

Public Member Functions

virtual | ~PHY_IPhysicsEnvironment ()
Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.
virtual bool | proceedDeltaTime (double curTime, float timeStep)=0
Perform an integration step of duration 'timeStep'.
virtual void | setGravity (float x, float y, float z)=0
virtual int | createConstraint (class PHY_IPhysicsController *ctrl, class PHY_IPhysicsController *ctrl2, PHY_ConstraintType type, float pivotX, float pivotY, float pivotZ, float axisX, float axisY, float axisZ)=0
virtual void | removeConstraint (int constraintid)=0
virtual PHY_IPhysicsController * | rayTest (PHY_IPhysicsController *ignoreClient, float fromX, float fromY, float fromZ, float toX, float toY, float toZ, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ)=0
virtual void | addSensor (PHY_IPhysicsController *ctrl)=0
virtual void | removeSensor (PHY_IPhysicsController *ctrl)=0
virtual void | addTouchCallback (int response_class, PHY_ResponseCallback callback, void *user)=0
virtual void | requestCollisionCallback (PHY_IPhysicsController *ctrl)=0
virtual PHY_IPhysicsController * | CreateSphereController (float radius, const PHY__Vector3 &position)=0
virtual PHY_IPhysicsController * | CreateConeController (float coneradius, float coneheight)=0

Detailed Description

Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.

) A derived class may be able to 'construct' entities by loading and/or converting

Definition at line 27 of file PHY_IPhysicsEnvironment.h.

Constructor & Destructor Documentation

PHY_IPhysicsEnvironment::~PHY_IPhysicsEnvironment ( ) [virtual]

Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc.

) A derived class may be able to 'construct' entities by loading and/or converting

Definition at line 23 of file PHY_IPhysicsEnvironment.cpp.

Member Function Documentation

virtual void PHY_IPhysicsEnvironment::addSensor ( PHY_IPhysicsController * ctrl ) [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual void PHY_IPhysicsEnvironment::addTouchCallback | ( | int | response_class,
 |  | PHY_ResponseCallback | callback,
 |  | void * | user
 | ) | [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual PHY_IPhysicsController* PHY_IPhysicsEnvironment::CreateConeController | ( | float | coneradius,
 |  | float | coneheight
 | ) | [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual int PHY_IPhysicsEnvironment::createConstraint | ( | class PHY_IPhysicsController * | ctrl,
 |  | class PHY_IPhysicsController * | ctrl2,
 |  | PHY_ConstraintType | type,
 |  | float | pivotX,
 |  | float | pivotY,
 |  | float | pivotZ,
 |  | float | axisX,
 |  | float | axisY,
 |  | float | axisZ
 | ) | [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual PHY_IPhysicsController* PHY_IPhysicsEnvironment::CreateSphereController | ( | float | radius,
 |  | const PHY__Vector3 & | position
 | ) | [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual bool PHY_IPhysicsEnvironment::proceedDeltaTime | ( | double | curTime,
 |  | float | timeStep
 | ) | [pure virtual]

Perform an integration step of duration 'timeStep'.

Implemented in CcdPhysicsEnvironment.

virtual PHY_IPhysicsController* PHY_IPhysicsEnvironment::rayTest | ( | PHY_IPhysicsController * | ignoreClient,
 |  | float | fromX,
 |  | float | fromY,
 |  | float | fromZ,
 |  | float | toX,
 |  | float | toY,
 |  | float | toZ,
 |  | float & | hitX,
 |  | float & | hitY,
 |  | float & | hitZ,
 |  | float & | normalX,
 |  | float & | normalY,
 |  | float & | normalZ
 | ) | [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual void PHY_IPhysicsEnvironment::removeConstraint ( int constraintid ) [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual void PHY_IPhysicsEnvironment::removeSensor ( PHY_IPhysicsController * ctrl ) [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual void PHY_IPhysicsEnvironment::requestCollisionCallback ( PHY_IPhysicsController * ctrl ) [pure virtual]

Implemented in CcdPhysicsEnvironment.

virtual void PHY_IPhysicsEnvironment::setGravity | ( | float | x,
 |  | float | y,
 |  | float | z
 | ) | [pure virtual]

Implemented in CcdPhysicsEnvironment.

The documentation for this class was generated from the following files:
  • PHY_IPhysicsEnvironment.h
  • PHY_IPhysicsEnvironment.cpp
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IPhysicsEnvironment Member List

This is the complete list of members for PHY_IPhysicsEnvironment, including all inherited members.

addSensor(PHY_IPhysicsController *ctrl)=0 | PHY_IPhysicsEnvironment | [pure virtual]
addTouchCallback(int response_class, PHY_ResponseCallback callback, void *user)=0 | PHY_IPhysicsEnvironment | [pure virtual]
CreateConeController(float coneradius, float coneheight)=0 | PHY_IPhysicsEnvironment | [pure virtual]
createConstraint(class PHY_IPhysicsController *ctrl, class PHY_IPhysicsController *ctrl2, PHY_ConstraintType type, float pivotX, float pivotY, float pivotZ, float axisX, float axisY, float axisZ)=0 | PHY_IPhysicsEnvironment | [pure virtual]
CreateSphereController(float radius, const PHY__Vector3 &position)=0 | PHY_IPhysicsEnvironment | [pure virtual]
proceedDeltaTime(double curTime, float timeStep)=0 | PHY_IPhysicsEnvironment | [pure virtual]
rayTest(PHY_IPhysicsController *ignoreClient, float fromX, float fromY, float fromZ, float toX, float toY, float toZ, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ)=0 | PHY_IPhysicsEnvironment | [pure virtual]
removeConstraint(int constraintid)=0 | PHY_IPhysicsEnvironment | [pure virtual]
removeSensor(PHY_IPhysicsController *ctrl)=0 | PHY_IPhysicsEnvironment | [pure virtual]
requestCollisionCallback(PHY_IPhysicsController *ctrl)=0 | PHY_IPhysicsEnvironment | [pure virtual]
setGravity(float x, float y, float z)=0 | PHY_IPhysicsEnvironment | [pure virtual]
~PHY_IPhysicsEnvironment() | PHY_IPhysicsEnvironment | [virtual]

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_IVehicle Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IVehicle Class Reference

#include <PHY_IVehicle.h>

List of all members.

Public Member Functions

virtual | ~PHY_IVehicle ()
virtual void | AddWheel (PHY_IMotionState *motionState, PHY__Vector3 connectionPoint, PHY__Vector3 downDirection, PHY__Vector3 axleDirection, float suspensionRestLength, float wheelRadius, bool hasSteering)=0
virtual int | GetNumWheels () const =0
virtual void | GetWheelPosition (int wheelIndex, float &posX, float &posY, float &posZ) const =0
virtual void | GetWheelOrientationQuaternion (int wheelIndex, float &quatX, float &quatY, float &quatZ, float &quatW) const =0
virtual float | GetWheelRotation (int wheelIndex) const =0
virtual int | GetUserConstraintId () const =0
virtual int | GetUserConstraintType () const =0
virtual void | SetSteeringValue (float steering, int wheelIndex)=0
virtual void | ApplyEngineForce (float force, int wheelIndex)=0
virtual void | ApplyBraking (float braking, int wheelIndex)=0

Detailed Description

Definition at line 25 of file PHY_IVehicle.h.

Constructor & Destructor Documentation

PHY_IVehicle::~PHY_IVehicle ( ) [virtual]

Definition at line 20 of file PHY_IVehicle.cpp.

Member Function Documentation

virtual void PHY_IVehicle::AddWheel | ( | PHY_IMotionState * | motionState,
 |  | PHY__Vector3 | connectionPoint,
 |  | PHY__Vector3 | downDirection,
 |  | PHY__Vector3 | axleDirection,
 |  | float | suspensionRestLength,
 |  | float | wheelRadius,
 |  | bool | hasSteering
 | ) | [pure virtual]

virtual void PHY_IVehicle::ApplyBraking | ( | float | braking,
 |  | int | wheelIndex
 | ) | [pure virtual]

virtual void PHY_IVehicle::ApplyEngineForce | ( | float | force,
 |  | int | wheelIndex
 | ) | [pure virtual]

virtual int PHY_IVehicle::GetNumWheels ( ) const [pure virtual]

virtual int PHY_IVehicle::GetUserConstraintId ( ) const [pure virtual]

virtual int PHY_IVehicle::GetUserConstraintType ( ) const [pure virtual]

virtual void PHY_IVehicle::GetWheelOrientationQuaternion | ( | int | wheelIndex,
 |  | float & | quatX,
 |  | float & | quatY,
 |  | float & | quatZ,
 |  | float & | quatW
 | ) | const [pure virtual]

virtual void PHY_IVehicle::GetWheelPosition | ( | int | wheelIndex,
 |  | float & | posX,
 |  | float & | posY,
 |  | float & | posZ
 | ) | const [pure virtual]

virtual float PHY_IVehicle::GetWheelRotation ( int wheelIndex ) const [pure virtual]

virtual void PHY_IVehicle::SetSteeringValue | ( | float | steering,
 |  | int | wheelIndex
 | ) | [pure virtual]

The documentation for this class was generated from the following files:
  • PHY_IVehicle.h
  • PHY_IVehicle.cpp
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_IVehicle Member List

This is the complete list of members for PHY_IVehicle, including all inherited members.

AddWheel(PHY_IMotionState *motionState, PHY__Vector3 connectionPoint, PHY__Vector3 downDirection, PHY__Vector3 axleDirection, float suspensionRestLength, float wheelRadius, bool hasSteering)=0 | PHY_IVehicle | [pure virtual]
ApplyBraking(float braking, int wheelIndex)=0 | PHY_IVehicle | [pure virtual]
ApplyEngineForce(float force, int wheelIndex)=0 | PHY_IVehicle | [pure virtual]
GetNumWheels() const =0 | PHY_IVehicle | [pure virtual]
GetUserConstraintId() const =0 | PHY_IVehicle | [pure virtual]
GetUserConstraintType() const =0 | PHY_IVehicle | [pure virtual]
GetWheelOrientationQuaternion(int wheelIndex, float &quatX, float &quatY, float &quatZ, float &quatW) const =0 | PHY_IVehicle | [pure virtual]
GetWheelPosition(int wheelIndex, float &posX, float &posY, float &posZ) const =0 | PHY_IVehicle | [pure virtual]
GetWheelRotation(int wheelIndex) const =0 | PHY_IVehicle | [pure virtual]
SetSteeringValue(float steering, int wheelIndex)=0 | PHY_IVehicle | [pure virtual]
~PHY_IVehicle() | PHY_IVehicle | [virtual]

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_MaterialProps Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_MaterialProps Struct Reference

#include <PHY_Pro.h>

List of all members.

Public Attributes

float | m_restitution
float | m_friction
float | m_fh_spring
float | m_fh_damping
float | m_fh_distance
bool | m_fh_normal

Detailed Description

Definition at line 37 of file PHY_Pro.h.

Member Data Documentation

float PHY_MaterialProps::m_fh_damping

Definition at line 41 of file PHY_Pro.h.

float PHY_MaterialProps::m_fh_distance

Definition at line 42 of file PHY_Pro.h.

bool PHY_MaterialProps::m_fh_normal

Definition at line 43 of file PHY_Pro.h.

float PHY_MaterialProps::m_fh_spring

Definition at line 40 of file PHY_Pro.h.

float PHY_MaterialProps::m_friction

Definition at line 39 of file PHY_Pro.h.

float PHY_MaterialProps::m_restitution

Definition at line 38 of file PHY_Pro.h.

The documentation for this struct was generated from the following file:
  • PHY_Pro.h
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_MaterialProps Member List

This is the complete list of members for PHY_MaterialProps, including all inherited members.

m_fh_damping | PHY_MaterialProps
m_fh_distance | PHY_MaterialProps
m_fh_normal | PHY_MaterialProps
m_fh_spring | PHY_MaterialProps
m_friction | PHY_MaterialProps
m_restitution | PHY_MaterialProps

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PHY_ShapeProps Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

PHY_ShapeProps Struct Reference

#include <PHY_Pro.h>

Collaboration diagram for PHY_ShapeProps:

[legend]
List of all members.

Public Attributes

float | m_mass
float | m_inertia
float | m_lin_drag
float | m_ang_drag
float | m_friction_scaling [3]
bool | m_do_anisotropic
bool | m_do_fh
bool | m_do_rot_fh
CollisionShape * m_shape

Detailed Description

Definition at line 23 of file PHY_Pro.h.

Member Data Documentation

float PHY_ShapeProps::m_ang_drag

Definition at line 27 of file PHY_Pro.h.

bool PHY_ShapeProps::m_do_anisotropic

Definition at line 29 of file PHY_Pro.h.

bool PHY_ShapeProps::m_do_fh

Definition at line 30 of file PHY_Pro.h.

bool PHY_ShapeProps::m_do_rot_fh

Definition at line 31 of file PHY_Pro.h.

float PHY_ShapeProps::m_friction_scaling[3]

Definition at line 28 of file PHY_Pro.h.

float PHY_ShapeProps::m_inertia

Definition at line 25 of file PHY_Pro.h.

float PHY_ShapeProps::m_lin_drag

Definition at line 26 of file PHY_Pro.h.

float PHY_ShapeProps::m_mass

Definition at line 24 of file PHY_Pro.h.

CollisionShape* PHY_ShapeProps::m_shape

Definition at line 32 of file PHY_Pro.h.

The documentation for this struct was generated from the following file:
  • PHY_Pro.h
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PHY_ShapeProps Member List

This is the complete list of members for PHY_ShapeProps, including all inherited members.

m_ang_drag | PHY_ShapeProps
m_do_anisotropic | PHY_ShapeProps
m_do_fh | PHY_ShapeProps
m_do_rot_fh | PHY_ShapeProps
m_friction_scaling | PHY_ShapeProps
m_inertia | PHY_ShapeProps
m_lin_drag | PHY_ShapeProps
m_mass | PHY_ShapeProps
m_shape | PHY_ShapeProps

Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Point2 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Point2 Class Reference

#include <Vector.h>

Detailed Description

Definition at line 341 of file Vector.h.

The documentation for this class was generated from the following file:
  • Vector.h
Generated on Wed May 24 14:00:26 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Point2PointConstraint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Point2PointConstraint Class Reference

point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space More...

#include <Point2PointConstraint.h>

Inheritance diagram for Point2PointConstraint:

[legend]
Collaboration diagram for Point2PointConstraint:

[legend]
List of all members.

Public Member Functions

Point2PointConstraint (RigidBody &rbA, RigidBody &rbB, const SimdVector3 &pivotInA, const SimdVector3 &pivotInB)
Point2PointConstraint (RigidBody &rbA, const SimdVector3 &pivotInA)
Point2PointConstraint ()
virtual void | BuildJacobian ()
virtual void | SolveConstraint (SimdScalar timeStep)
void | UpdateRHS (SimdScalar timeStep)
void | SetPivotA (const SimdVector3 &pivotA)
void | SetPivotB (const SimdVector3 &pivotB)

Public Attributes

ConstraintSetting m_setting

Private Attributes

JacobianEntry | m_jac [3]
SimdVector3 m_pivotInA
SimdVector3 m_pivotInB

Detailed Description

point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space

Definition at line 38 of file Point2PointConstraint.h.

Constructor & Destructor Documentation

Point2PointConstraint::Point2PointConstraint | ( | RigidBody & | rbA,
 |  | RigidBody & | rbB,
 |  | const SimdVector3 & | pivotInA,
 |  | const SimdVector3 & | pivotInB
 | ) |

Definition at line 28 of file Point2PointConstraint.cpp.

Point2PointConstraint::Point2PointConstraint | ( | RigidBody & | rbA,
 |  | const SimdVector3 & | pivotInA
 | ) |

Definition at line 35 of file Point2PointConstraint.cpp.

Point2PointConstraint::Point2PointConstraint ( )

Definition at line 24 of file Point2PointConstraint.cpp.

Member Function Documentation

void Point2PointConstraint::BuildJacobian ( ) [virtual]

Implements TypedConstraint.

Definition at line 41 of file Point2PointConstraint.cpp.

References SimdTransform::getBasis(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), RigidBody::getInvInertiaDiagLocal(), RigidBody::getInvMass(), m_jac, m_pivotInA, m_pivotInB, TypedConstraint::m_rbA, TypedConstraint::m_rbB, and SimdMatrix3x3::transpose().

void Point2PointConstraint::SetPivotA ( const SimdVector3 & pivotA ) [inline]

Definition at line 64 of file Point2PointConstraint.h.

References m_pivotInA.

void Point2PointConstraint::SetPivotB ( const SimdVector3 & pivotB ) [inline]

Definition at line 69 of file Point2PointConstraint.h.

References m_pivotInB.

void Point2PointConstraint::SolveConstraint ( SimdScalar timeStep ) [virtual]

Implements TypedConstraint.

Definition at line 63 of file Point2PointConstraint.cpp.

References RigidBody::applyImpulse(), dot(), SimdVector3::dot(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), JacobianEntry::getDiagonal(), RigidBody::getVelocityInLocalPoint(), ConstraintSetting::m_damping, m_jac, m_pivotInA, m_pivotInB, TypedConstraint::m_rbA, TypedConstraint::m_rbB, m_setting, and ConstraintSetting::m_tau.

void Point2PointConstraint::UpdateRHS ( SimdScalar timeStep )

Definition at line 110 of file Point2PointConstraint.cpp.

Member Data Documentation

JacobianEntry Point2PointConstraint::m_jac[3] [private]

Definition at line 40 of file Point2PointConstraint.h.

Referenced by BuildJacobian(), and SolveConstraint().

SimdVector3 Point2PointConstraint::m_pivotInA [private]

Definition at line 42 of file Point2PointConstraint.h.

Referenced by BuildJacobian(), SetPivotA(), and SolveConstraint().

SimdVector3 Point2PointConstraint::m_pivotInB [private]

Definition at line 43 of file Point2PointConstraint.h.

Referenced by BuildJacobian(), SetPivotB(), and SolveConstraint().

ConstraintSetting Point2PointConstraint::m_setting

Definition at line 49 of file Point2PointConstraint.h.

Referenced by SolveConstraint().

The documentation for this class was generated from the following files:
  • Point2PointConstraint.h
  • Point2PointConstraint.cpp
Generated on Wed May 24 14:00:27 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Point2PointConstraint Member List

This is the complete list of members for Point2PointConstraint, including all inherited members.

BuildJacobian() | Point2PointConstraint | [virtual]
GetRigidBodyA() const | TypedConstraint | [inline]
GetRigidBodyB() const | TypedConstraint | [inline]
GetUserConstraintId() | TypedConstraint | [inline]
GetUserConstraintType() const | TypedConstraint | [inline]
m_jac | Point2PointConstraint | [private]
m_pivotInA | Point2PointConstraint | [private]
m_pivotInB | Point2PointConstraint | [private]
m_rbA | TypedConstraint | [protected]
m_rbB | TypedConstraint | [protected]
m_setting | Point2PointConstraint |
Point2PointConstraint(RigidBody &rbA, RigidBody &rbB, const SimdVector3 &pivotInA, const SimdVector3 &pivotInB) | Point2PointConstraint |
Point2PointConstraint(RigidBody &rbA, const SimdVector3 &pivotInA) | Point2PointConstraint |
Point2PointConstraint() | Point2PointConstraint |
SetPivotA(const SimdVector3 &pivotA) | Point2PointConstraint | [inline]
SetPivotB(const SimdVector3 &pivotB) | Point2PointConstraint | [inline]
SetUserConstraintId(int uid) | TypedConstraint | [inline]
SetUserConstraintType(int userConstraintType) | TypedConstraint | [inline]
SolveConstraint(SimdScalar timeStep) | Point2PointConstraint | [virtual]
TypedConstraint() | TypedConstraint |
TypedConstraint(RigidBody &rbA) | TypedConstraint |
TypedConstraint(RigidBody &rbA, RigidBody &rbB) | TypedConstraint |
UpdateRHS(SimdScalar timeStep) | Point2PointConstraint |
~TypedConstraint() | TypedConstraint | [inline, virtual]

Generated on Wed May 24 14:00:27 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PointCollector Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

PointCollector Struct Reference

#include <PointCollector.h>

Inheritance diagram for PointCollector:

[legend]
Collaboration diagram for PointCollector:

[legend]
List of all members.

Public Member Functions

PointCollector ()
virtual void | AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)

Public Attributes

SimdVector3 m_normalOnBInWorld
SimdVector3 m_pointInWorld
SimdScalar m_distance
bool | m_hasResult

Detailed Description

Definition at line 23 of file PointCollector.h.

Constructor & Destructor Documentation

PointCollector::PointCollector ( ) [inline]

Definition at line 33 of file PointCollector.h.

Member Function Documentation

virtual void PointCollector::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [inline, virtual]

Implements DiscreteCollisionDetectorInterface::Result.

Definition at line 38 of file PointCollector.h.

References m_distance, m_hasResult, m_normalOnBInWorld, and m_pointInWorld.

Member Data Documentation

SimdScalar PointCollector::m_distance

Definition at line 29 of file PointCollector.h.

Referenced by AddContactPoint(), GjkConvexCast::calcTimeOfImpact(), and ContinuousConvexCollision::calcTimeOfImpact().

bool PointCollector::m_hasResult

Definition at line 31 of file PointCollector.h.

Referenced by AddContactPoint(), GjkConvexCast::calcTimeOfImpact(), and ContinuousConvexCollision::calcTimeOfImpact().

SimdVector3 PointCollector::m_normalOnBInWorld

Definition at line 27 of file PointCollector.h.

Referenced by AddContactPoint(), GjkConvexCast::calcTimeOfImpact(), and ContinuousConvexCollision::calcTimeOfImpact().

SimdVector3 PointCollector::m_pointInWorld

Definition at line 28 of file PointCollector.h.

Referenced by AddContactPoint(), GjkConvexCast::calcTimeOfImpact(), and ContinuousConvexCollision::calcTimeOfImpact().

The documentation for this struct was generated from the following file:
  • PointCollector.h
Generated on Wed May 24 14:00:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PointCollector Member List

This is the complete list of members for PointCollector, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth) | PointCollector | [inline, virtual]
m_distance | PointCollector |
m_hasResult | PointCollector |
m_normalOnBInWorld | PointCollector |
m_pointInWorld | PointCollector |
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
PointCollector() | PointCollector | [inline]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]

Generated on Wed May 24 14:00:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: PolyhedralConvexShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

PolyhedralConvexShape Class Reference

PolyhedralConvexShape is an interface class for feature based (vertex/edge/face) convex shapes. More...

#include <PolyhedralConvexShape.h>

Inheritance diagram for PolyhedralConvexShape:

[legend]
Collaboration diagram for PolyhedralConvexShape:

[legend]
List of all members.

Public Member Functions

PolyhedralConvexShape ()
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual int | GetNumVertices () const =0
virtual int | GetNumEdges () const =0
virtual void | GetEdge (int i, SimdPoint3 &pa, SimdPoint3 &pb) const =0
virtual void | GetVertex (int i, SimdPoint3 &vtx) const =0
virtual int | GetNumPlanes () const =0
virtual void | GetPlane (SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const =0
virtual bool | IsInside (const SimdPoint3 &pt, SimdScalar tolerance) const =0

Public Attributes

Hull * m_optionalHull
optional Hull is for optional Separating Axis Test Hull collision detection, see Hull.cpp

Detailed Description

PolyhedralConvexShape is an interface class for feature based (vertex/edge/face) convex shapes.

Definition at line 25 of file PolyhedralConvexShape.h.

Constructor & Destructor Documentation

PolyhedralConvexShape::PolyhedralConvexShape ( )

Definition at line 18 of file PolyhedralConvexShape.cpp.

Member Function Documentation

void PolyhedralConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Implements ConvexShape.

Reimplemented in BoxShape, ConvexHullShape, CylinderShape, CylinderShapeX, CylinderShapeZ, and TriangleShape.

Definition at line 62 of file PolyhedralConvexShape.cpp.

References SimdVector3::dot(), GetNumVertices(), and GetVertex().

void PolyhedralConvexShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

Implements CollisionShape.

Reimplemented in BoxShape, and TriangleShape.

Definition at line 90 of file PolyhedralConvexShape.cpp.

References ConvexShape::GetAabb(), ConvexShape::GetMargin(), SimdTransform::setIdentity(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

virtual void PolyhedralConvexShape::GetEdge | ( | int | i,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb
 | ) | const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

virtual int PolyhedralConvexShape::GetNumEdges ( ) const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

virtual int PolyhedralConvexShape::GetNumPlanes ( ) const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

virtual int PolyhedralConvexShape::GetNumVertices ( ) const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), and LocalGetSupportingVertexWithoutMargin().

virtual void PolyhedralConvexShape::GetPlane | ( | SimdVector3 & | planeNormal,
 |  | SimdPoint3 & | planeSupport,
 |  | int | i
 | ) | const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

virtual void PolyhedralConvexShape::GetVertex | ( | int | i,
 |  | SimdPoint3 & | vtx
 | ) | const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), and LocalGetSupportingVertexWithoutMargin().

virtual bool PolyhedralConvexShape::IsInside | ( | const SimdPoint3 & | pt,
 |  | SimdScalar | tolerance
 | ) | const [pure virtual]

Implemented in BoxShape, ConvexHullShape, BU_Simplex1to4, and TriangleShape.

SimdVector3 PolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Implements ConvexShape.

Reimplemented in BoxShape, ConvexHullShape, CylinderShape, CylinderShapeX, CylinderShapeZ, and TriangleShape.

Definition at line 26 of file PolyhedralConvexShape.cpp.

References SimdVector3::dot(), GetNumVertices(), GetVertex(), SimdVector3::length2(), SimdQuadWord::setValue(), and SimdSqrt().

Member Data Documentation

class Hull* PolyhedralConvexShape::m_optionalHull

optional Hull is for optional Separating Axis Test Hull collision detection, see Hull.cpp

Definition at line 51 of file PolyhedralConvexShape.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

The documentation for this class was generated from the following files:
  • PolyhedralConvexShape.h
  • PolyhedralConvexShape.cpp
Generated on Wed May 24 14:00:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

PolyhedralConvexShape Member List

This is the complete list of members for PolyhedralConvexShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | PolyhedralConvexShape | [virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | PolyhedralConvexShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const =0 | PolyhedralConvexShape | [pure virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const =0 | CollisionShape | [pure virtual]
GetNumEdges() const =0 | PolyhedralConvexShape | [pure virtual]
GetNumPlanes() const =0 | PolyhedralConvexShape | [pure virtual]
GetNumVertices() const =0 | PolyhedralConvexShape | [pure virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const =0 | PolyhedralConvexShape | [pure virtual]
GetShapeType() const =0 | CollisionShape | [pure virtual]
GetVertex(int i, SimdPoint3 &vtx) const =0 | PolyhedralConvexShape | [pure virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const =0 | PolyhedralConvexShape | [pure virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | PolyhedralConvexShape | [virtual]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Quat Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Quat Class Reference

#include <Quat.h>

List of all members.

Public Member Functions

BULLET_ALIGNED_NEW_AND_DELETE | Quat ()
Quat (const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w)
Quat (const Vector3 &axis, const Scalar &angle)
Quat (const Maths::IdentityTag &)
Quat (const __m128 b)
Quat (const Vector3 &v)
Quat (const Vector4 &v)
Quat (const Matrix33 &m)
Quat (const float *p)
const Quat & | operator= (const Quat &v)
const Quat & | operator= (const Maths::IdentityTag &)
void | operator+= (const Quat &b)
void | operator-= (const Quat &b)
void | operator *= (const Quat &b)
void | operator *= (const Scalar &s)
const Vector3 | Rotate (const Vector3 &v) const
void | GetAngleAxis (Vector3 &axis, Scalar &angle) const
bool | IsFinite () const

Friends

const Quat | operator- (const Quat &a)
const Quat | operator+ (const Quat &a, const Quat &b)
const Quat | operator- (const Quat &a, const Quat &b)
const Quat | operator * (const Quat &a, const Quat &b)
const Quat | operator * (const Quat &a, const Scalar &s)
const Quat | operator * (const Scalar &s, const Quat &a)
const Quat | Inv (const Quat &a)
const Scalar | Dot (const Quat &a, const Quat &b)
const Scalar | Length (const Quat &a)
const Quat | Normalize (const Quat &a)
const Scalar | LengthFast (const Quat &a)
const Quat | NormalizeFast (const Quat &a)
const Quat | Slerp (const Quat &a, const Quat &b, const Scalar &t)
const Quat | Lerp (const Quat &a, const Quat &b, const Scalar &t)

Detailed Description

Definition at line 25 of file Quat.h.

Constructor & Destructor Documentation

BULLET_ALIGNED_NEW_AND_DELETE Quat::Quat ( )

Quat::Quat | ( | const Scalar & | x,
 |  | const Scalar & | y,
 |  | const Scalar & | z,
 |  | const Scalar & | w
 | ) |

Quat::Quat | ( | const Vector3 & | axis,
 |  | const Scalar & | angle
 | ) |

Quat::Quat ( const Maths::IdentityTag & )

Quat::Quat ( const __m128 b ) [explicit]

Quat::Quat ( const Vector3 & v ) [explicit]

Quat::Quat ( const Vector4 & v ) [explicit]

Quat::Quat ( const Matrix33 & m ) [explicit]

Quat::Quat ( const float * p ) [explicit]

Member Function Documentation

void Quat::GetAngleAxis | ( | Vector3 & | axis,
 |  | Scalar & | angle
 | ) | const

bool Quat::IsFinite ( ) const

void Quat::operator *= ( const Scalar & s )

void Quat::operator *= ( const Quat & b )

void Quat::operator+= ( const Quat & b )

void Quat::operator-= ( const Quat & b )

const Quat& Quat::operator= ( const Maths::IdentityTag & )

const Quat& Quat::operator= ( const Quat & v )

const Vector3 Quat::Rotate ( const Vector3 & v ) const

Friends And Related Function Documentation

const Scalar Dot | ( | const Quat & | a,
 |  | const Quat & | b
 | ) | [friend]

const Quat Inv ( const Quat & a ) [friend]

const Scalar Length ( const Quat & a ) [friend]

const Scalar LengthFast ( const Quat & a ) [friend]

const Quat Lerp | ( | const Quat & | a,
 |  | const Quat & | b,
 |  | const Scalar & | t
 | ) | [friend]

const Quat Normalize ( const Quat & a ) [friend]

const Quat NormalizeFast ( const Quat & a ) [friend]

const Quat operator * | ( | const Scalar & | s,
 |  | const Quat & | a
 | ) | [friend]

const Quat operator * | ( | const Quat & | a,
 |  | const Scalar & | s
 | ) | [friend]

const Quat operator * | ( | const Quat & | a,
 |  | const Quat & | b
 | ) | [friend]

const Quat operator+ | ( | const Quat & | a,
 |  | const Quat & | b
 | ) | [friend]

const Quat operator- | ( | const Quat & | a,
 |  | const Quat & | b
 | ) | [friend]

const Quat operator- ( const Quat & a ) [friend]

const Quat Slerp | ( | const Quat & | a,
 |  | const Quat & | b,
 |  | const Scalar & | t
 | ) | [friend]

The documentation for this class was generated from the following file:
  • Quat.h
Generated on Wed May 24 14:00:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Quat Member List

This is the complete list of members for Quat, including all inherited members.

Dot(const Quat &a, const Quat &b) | Quat | [friend]
GetAngleAxis(Vector3 &axis, Scalar &angle) const | Quat |
Inv(const Quat &a) | Quat | [friend]
IsFinite() const | Quat |
Length(const Quat &a) | Quat | [friend]
LengthFast(const Quat &a) | Quat | [friend]
Lerp(const Quat &a, const Quat &b, const Scalar &t) | Quat | [friend]
Normalize(const Quat &a) | Quat | [friend]
NormalizeFast(const Quat &a) | Quat | [friend]
operator *(const Quat &a, const Quat &b) | Quat | [friend]
operator *(const Quat &a, const Scalar &s) | Quat | [friend]
operator *(const Scalar &s, const Quat &a) | Quat | [friend]
operator *=(const Quat &b) | Quat |
operator *=(const Scalar &s) | Quat |
operator+(const Quat &a, const Quat &b) | Quat | [friend]
operator+=(const Quat &b) | Quat |
operator-(const Quat &a) | Quat | [friend]
operator-(const Quat &a, const Quat &b) | Quat | [friend]
operator-=(const Quat &b) | Quat |
operator=(const Quat &v) | Quat |
operator=(const Maths::IdentityTag &) | Quat |
Quat() | Quat |
Quat(const Scalar &x, const Scalar &y, const Scalar &z, const Scalar &w) | Quat |
Quat(const Vector3 &axis, const Scalar &angle) | Quat |
Quat(const Maths::IdentityTag &) | Quat |
Quat(const __m128 b) | Quat | [explicit]
Quat(const Vector3 &v) | Quat | [explicit]
Quat(const Vector4 &v) | Quat | [explicit]
Quat(const Matrix33 &m) | Quat | [explicit]
Quat(const float *p) | Quat | [explicit]
Rotate(const Vector3 &v) const | Quat |
Slerp(const Quat &a, const Quat &b, const Scalar &t) | Quat | [friend]

Generated on Wed May 24 14:00:28 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: RigidBody Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

RigidBody Class Reference

RigidBody class for RigidBody Dynamics. More...

#include <RigidBody.h>

Inheritance diagram for RigidBody:

[legend]
Collaboration diagram for RigidBody:

[legend]
List of all members.

Public Member Functions

RigidBody (const MassProps &massProps, SimdScalar linearDamping, SimdScalar angularDamping, SimdScalar friction, SimdScalar restitution)
void | proceedToTransform (const SimdTransform &newTrans)
void | predictIntegratedTransform (SimdScalar step, SimdTransform &predictedTransform) const
continuous collision detection needs prediction
void | saveKinematicState (SimdScalar step)
void | applyForces (SimdScalar step)
void | setGravity (const SimdVector3 &acceleration)
void | setDamping (SimdScalar lin_damping, SimdScalar ang_damping)
const CollisionShape * | GetCollisionShape () const
CollisionShape * GetCollisionShape ()
void | setMassProps (SimdScalar mass, const SimdVector3 &inertia)
SimdScalar | getInvMass () const
const SimdMatrix3x3 & | getInvInertiaTensorWorld () const
void | integrateVelocities (SimdScalar step)
void | setCenterOfMassTransform (const SimdTransform &xform)
void | applyCentralForce (const SimdVector3 &force)
const SimdVector3 & | getInvInertiaDiagLocal ()
void | setInvInertiaDiagLocal (const SimdVector3 &diagInvInertia)
void | applyTorque (const SimdVector3 &torque)
void | applyForce (const SimdVector3 &force, const SimdVector3 &rel_pos)
void | applyCentralImpulse (const SimdVector3 &impulse)
void | applyTorqueImpulse (const SimdVector3 &torque)
void | applyImpulse (const SimdVector3 &impulse, const SimdVector3 &rel_pos)
void | clearForces ()
void | updateInertiaTensor ()
const SimdPoint3 & | getCenterOfMassPosition () const
SimdQuaternion | getOrientation () const
const SimdTransform & | getCenterOfMassTransform () const
const SimdVector3 & | getLinearVelocity () const
const SimdVector3 & | getAngularVelocity () const
void | setLinearVelocity (const SimdVector3 &lin_vel)
void | setAngularVelocity (const SimdVector3 &ang_vel)
SimdVector3 | getVelocityInLocalPoint (const SimdVector3 &rel_pos) const
void | translate (const SimdVector3 &v)
void | getAabb (SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
void | setRestitution (float rest)
float | getRestitution () const
void | setFriction (float frict)
float | getFriction () const
float | ComputeImpulseDenominator (const SimdPoint3 &pos, const SimdVector3 &normal) const
float | ComputeAngularImpulseDenominator (const SimdVector3 &axis) const
const BroadphaseProxy * | GetBroadphaseProxy () const
BroadphaseProxy * GetBroadphaseProxy ()
void | SetBroadphaseProxy (BroadphaseProxy *broadphaseProxy)

Public Attributes

dMatrix3 m_R
for ode solver-binding
dMatrix3 m_I
dMatrix3 m_invI
int | m_odeTag
float | m_padding [1024]
SimdVector3 m_tacc
SimdVector3 m_facc
int | m_debugBodyId

Private Attributes

SimdMatrix3x3 m_invInertiaTensorWorld
SimdVector3 m_gravity
SimdVector3 m_invInertiaLocal
SimdVector3 m_totalForce
SimdVector3 m_totalTorque
SimdVector3 m_linearVelocity
SimdVector3 m_angularVelocity
SimdScalar m_linearDamping
SimdScalar m_angularDamping
SimdScalar m_inverseMass
SimdScalar m_friction
SimdScalar m_restitution
SimdScalar m_kinematicTimeStep
BroadphaseProxy * m_broadphaseProxy

Detailed Description

RigidBody class for RigidBody Dynamics.

Definition at line 39 of file RigidBody.h.

Constructor & Destructor Documentation

RigidBody::RigidBody | ( | const MassProps & | massProps,
 |  | SimdScalar | linearDamping,
 |  | SimdScalar | angularDamping,
 |  | SimdScalar | friction,
 |  | SimdScalar | restitution
 | ) |

Definition at line 26 of file RigidBody.cpp.

References m_debugBodyId, MassProps::m_inertiaLocal, MassProps::m_mass, CollisionObject::m_worldTransform, setDamping(), SimdTransform::setIdentity(), setMassProps(), uniqueId, and updateInertiaTensor().

Member Function Documentation

void RigidBody::applyCentralForce ( const SimdVector3 & force ) [inline]

Definition at line 79 of file RigidBody.h.

References m_totalForce.

Referenced by applyForce(), CcdPhysicsController::ApplyForce(), and applyForces().

void RigidBody::applyCentralImpulse ( const SimdVector3 & impulse ) [inline]

Definition at line 105 of file RigidBody.h.

References m_inverseMass, and m_linearVelocity.

Referenced by applyImpulse().

void RigidBody::applyForce | ( | const SimdVector3 & | force,
 |  | const SimdVector3 & | rel_pos
 | ) | [inline]

Definition at line 99 of file RigidBody.h.

References applyCentralForce(), applyTorque(), and SimdVector3::cross().

void RigidBody::applyForces ( SimdScalar step )

Definition at line 109 of file RigidBody.cpp.

References applyCentralForce(), GEN_clamped(), gLinearAirDamping, CollisionObject::IsStatic(), SimdVector3::length(), m_angularDamping, m_angularVelocity, m_gravity, m_linearDamping, m_linearVelocity, SimdVector3::normalized(), and SimdQuadWord::setValue().

Referenced by CcdPhysicsEnvironment::proceedDeltaTimeOneStep().

void RigidBody::applyImpulse | ( | const SimdVector3 & | impulse,
 |  | const SimdVector3 & | rel_pos
 | ) | [inline]

Definition at line 117 of file RigidBody.h.

References applyCentralImpulse(), applyTorqueImpulse(), SimdVector3::cross(), and m_inverseMass.

Referenced by CcdPhysicsController::applyImpulse(), resolveSingleCollision(), resolveSingleFriction(), SimpleConstraintSolver::Solve(), Point2PointConstraint::SolveConstraint(), and HingeConstraint::SolveConstraint().

void RigidBody::applyTorque ( const SimdVector3 & torque ) [inline]

Definition at line 94 of file RigidBody.h.

References m_totalTorque.

Referenced by applyForce(), and CcdPhysicsController::ApplyTorque().

void RigidBody::applyTorqueImpulse ( const SimdVector3 & torque ) [inline]

Definition at line 110 of file RigidBody.h.

References CollisionObject::IsStatic(), m_angularVelocity, and m_invInertiaTensorWorld.

Referenced by applyImpulse(), and HingeConstraint::SolveConstraint().

void RigidBody::clearForces ( ) [inline]

Definition at line 126 of file RigidBody.h.

References m_totalForce, m_totalTorque, and SimdQuadWord::setValue().

Referenced by integrateVelocities().

float RigidBody::ComputeAngularImpulseDenominator ( const SimdVector3 & axis ) const [inline]

Definition at line 206 of file RigidBody.h.

References SimdVector3::dot(), and getInvInertiaTensorWorld().

Referenced by HingeConstraint::SolveConstraint().

float RigidBody::ComputeImpulseDenominator | ( | const SimdPoint3 & | pos,
 |  | const SimdVector3 & | normal
 | ) | const [inline]

Definition at line 194 of file RigidBody.h.

References cross(), SimdVector3::dot(), getCenterOfMassPosition(), getInvInertiaTensorWorld(), and m_inverseMass.

Referenced by SimpleConstraintSolver::Solve().

void RigidBody::getAabb | ( | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const

Definition at line 77 of file RigidBody.cpp.

References CollisionShape::GetAabb(), GetCollisionShape(), and CollisionObject::m_worldTransform.

const SimdVector3& RigidBody::getAngularVelocity ( ) const [inline]

Definition at line 145 of file RigidBody.h.

References m_angularVelocity.

Referenced by CcdPhysicsController::GetAngularVelocity(), resolveSingleBilateral(), HingeConstraint::SolveConstraint(), SolveInternal1(), and CcdPhysicsController::UpdateDeactivation().

BroadphaseProxy* RigidBody::GetBroadphaseProxy ( ) [inline]

Definition at line 248 of file RigidBody.h.

const BroadphaseProxy* RigidBody::GetBroadphaseProxy ( ) const [inline]

Definition at line 244 of file RigidBody.h.

const SimdPoint3& RigidBody::getCenterOfMassPosition ( ) const [inline]

Definition at line 134 of file RigidBody.h.

References SimdTransform::getOrigin(), and CollisionObject::m_worldTransform.

Referenced by Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), ComputeImpulseDenominator(), ContactJoint::GetInfo2(), CcdPhysicsController::GetVelocity(), resolveSingleBilateral(), resolveSingleCollision(), resolveSingleFriction(), SimpleConstraintSolver::Solve(), Point2PointConstraint::SolveConstraint(), HingeConstraint::SolveConstraint(), and CcdPhysicsController::SynchronizeMotionStates().

const SimdTransform& RigidBody::getCenterOfMassTransform ( ) const [inline]

Definition at line 139 of file RigidBody.h.

References CollisionObject::m_worldTransform.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CcdPhysicsController::ApplyForce(), CcdPhysicsController::ApplyTorque(), Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), CcdPhysicsEnvironment::createConstraint(), CcdPhysicsController::getOrientation(), CcdPhysicsController::getPosition(), CcdPhysicsController::RelativeRotate(), CcdPhysicsController::RelativeTranslate(), resolveSingleBilateral(), CcdPhysicsController::SetAngularVelocity(), CcdPhysicsController::SetLinearVelocity(), CcdPhysicsController::setOrientation(), CcdPhysicsController::setPosition(), SimpleConstraintSolver::Solve(), Point2PointConstraint::SolveConstraint(), HingeConstraint::SolveConstraint(), and CcdPhysicsEnvironment::UpdateAabbs().

CollisionShape* RigidBody::GetCollisionShape ( ) [inline]

Definition at line 64 of file RigidBody.h.

References CollisionObject::m_collisionShape.

const CollisionShape* RigidBody::GetCollisionShape ( ) const [inline]

Definition at line 60 of file RigidBody.h.

References CollisionObject::m_collisionShape.

Referenced by getAabb(), CcdPhysicsController::GetCollisionShape(), and CcdPhysicsController::setScaling().

float RigidBody::getFriction ( ) const [inline]

Definition at line 188 of file RigidBody.h.

References m_friction.

Referenced by calculateCombinedFriction(), and ContactJoint::GetInfo2().

const SimdVector3& RigidBody::getInvInertiaDiagLocal ( ) [inline]

Definition at line 84 of file RigidBody.h.

References m_invInertiaLocal.

Referenced by Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), OdeConstraintSolver::ConvertBody(), resolveSingleBilateral(), CcdPhysicsController::setRigidBody(), and SimpleConstraintSolver::Solve().

const SimdMatrix3x3& RigidBody::getInvInertiaTensorWorld ( ) const [inline]

Definition at line 71 of file RigidBody.h.

References m_invInertiaTensorWorld.

Referenced by ComputeAngularImpulseDenominator(), and ComputeImpulseDenominator().

SimdScalar RigidBody::getInvMass ( ) const [inline]

Definition at line 70 of file RigidBody.h.

References m_inverseMass.

Referenced by Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), CcdPhysicsController::CcdPhysicsController(), compute_invM_JT(), OdeConstraintSolver::ConvertBody(), resolveSingleBilateral(), SimpleConstraintSolver::Solve(), and SolveInternal1().

const SimdVector3& RigidBody::getLinearVelocity ( ) const [inline]

Definition at line 142 of file RigidBody.h.

References m_linearVelocity.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CcdPhysicsController::GetLinearVelocity(), resolveSingleBilateral(), SolveInternal1(), CcdPhysicsEnvironment::UpdateAabbs(), and CcdPhysicsController::UpdateDeactivation().

SimdQuaternion RigidBody::getOrientation ( ) const

Definition at line 205 of file RigidBody.cpp.

References SimdTransform::getBasis(), SimdMatrix3x3::getRotation(), and CollisionObject::m_worldTransform.

Referenced by OdeConstraintSolver::ConvertBody(), and CcdPhysicsController::SynchronizeMotionStates().

float RigidBody::getRestitution ( ) const [inline]

Definition at line 180 of file RigidBody.h.

References m_restitution.

Referenced by resolveSingleCollision(), and SimpleConstraintSolver::Solve().

SimdVector3 RigidBody::getVelocityInLocalPoint ( const SimdVector3 & rel_pos ) const [inline]

Definition at line 158 of file RigidBody.h.

References SimdVector3::cross(), m_angularVelocity, and m_linearVelocity.

Referenced by CcdPhysicsController::GetVelocity(), Solve2LinearConstraint::resolveBilateralPairConstraint(), resolveSingleBilateral(), resolveSingleCollision(), resolveSingleFriction(), Solve2LinearConstraint::resolveUnilateralPairConstraint(), SimpleConstraintSolver::Solve(), Point2PointConstraint::SolveConstraint(), and HingeConstraint::SolveConstraint().

void RigidBody::integrateVelocities ( SimdScalar step )

clamp angular velocity. collision calculations will fail on higher angular velocities

Definition at line 186 of file RigidBody.cpp.

References clearForces(), CollisionObject::IsStatic(), SimdVector3::length(), m_angularVelocity, m_inverseMass, m_invInertiaTensorWorld, m_linearVelocity, m_totalForce, m_totalTorque, MAX_ANGVEL, and SIMD_HALF_PI.

Referenced by CcdPhysicsEnvironment::proceedDeltaTimeOneStep().

void RigidBody::predictIntegratedTransform | ( | SimdScalar | step,
 |  | SimdTransform & | predictedTransform
 | ) | const

continuous collision detection needs prediction

Definition at line 56 of file RigidBody.cpp.

References SimdTransformUtil::IntegrateTransform(), m_angularVelocity, m_linearVelocity, and CollisionObject::m_worldTransform.

Referenced by CcdPhysicsEnvironment::proceedDeltaTimeOneStep().

void RigidBody::proceedToTransform ( const SimdTransform & newTrans )

Definition at line 153 of file RigidBody.cpp.

References setCenterOfMassTransform().

void RigidBody::saveKinematicState ( SimdScalar step )

Definition at line 61 of file RigidBody.cpp.

References SimdTransformUtil::CalculateVelocity(), m_angularVelocity, CollisionObject::m_interpolationWorldTransform, m_kinematicTimeStep, m_linearVelocity, and CollisionObject::m_worldTransform.

void RigidBody::setAngularVelocity ( const SimdVector3 & ang_vel ) [inline]

Definition at line 151 of file RigidBody.h.

References CollisionObject::IsStatic(), and m_angularVelocity.

Referenced by CcdPhysicsController::SetAngularVelocity(), and SolveInternal1().

void RigidBody::SetBroadphaseProxy ( BroadphaseProxy * broadphaseProxy ) [inline]

Definition at line 252 of file RigidBody.h.

void RigidBody::setCenterOfMassTransform ( const SimdTransform & xform )

Definition at line 213 of file RigidBody.cpp.

References CollisionObject::m_worldTransform, and updateInertiaTensor().

Referenced by CcdPhysicsController::CreateRigidbody(), proceedToTransform(), CcdPhysicsController::RelativeRotate(), CcdPhysicsController::RelativeTranslate(), CcdPhysicsController::setOrientation(), and CcdPhysicsController::setPosition().

void RigidBody::setDamping | ( | SimdScalar | lin_damping,
 |  | SimdScalar | ang_damping
 | ) |

Definition at line 98 of file RigidBody.cpp.

References GEN_clamped(), m_angularDamping, and m_linearDamping.

Referenced by CcdPhysicsController::CreateRigidbody(), and RigidBody().

void RigidBody::setFriction ( float frict ) [inline]

Definition at line 184 of file RigidBody.h.

References m_friction.

void RigidBody::setGravity ( const SimdVector3 & acceleration )

Definition at line 85 of file RigidBody.cpp.

References m_gravity, and m_inverseMass.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CcdPhysicsController::CreateRigidbody(), and CcdPhysicsEnvironment::setGravity().

void RigidBody::setInvInertiaDiagLocal ( const SimdVector3 & diagInvInertia ) [inline]

Definition at line 89 of file RigidBody.h.

References m_invInertiaLocal.

Referenced by CcdPhysicsController::setRigidBody().

void RigidBody::setLinearVelocity ( const SimdVector3 & lin_vel )

Definition at line 49 of file RigidBody.cpp.

References m_linearVelocity.

Referenced by CcdPhysicsController::CcdPhysicsController(), CcdPhysicsController::SetLinearVelocity(), and SolveInternal1().

void RigidBody::setMassProps | ( | SimdScalar | mass,
 |  | const SimdVector3 & | inertia
 | ) |

Definition at line 159 of file RigidBody.cpp.

References CollisionObject::isStatic, CollisionObject::m_collisionFlags, m_inverseMass, m_invInertiaLocal, and SimdQuadWord::setValue().

Referenced by CcdPhysicsController::CreateRigidbody(), RigidBody(), CcdPhysicsController::setScaling(), and TypedConstraint::TypedConstraint().

void RigidBody::setRestitution ( float rest ) [inline]

Definition at line 176 of file RigidBody.h.

References m_restitution.

void RigidBody::translate ( const SimdVector3 & v ) [inline]

Definition at line 167 of file RigidBody.h.

References SimdTransform::getOrigin(), and CollisionObject::m_worldTransform.

void RigidBody::updateInertiaTensor ( )

Definition at line 180 of file RigidBody.cpp.

References SimdTransform::getBasis(), m_invInertiaLocal, m_invInertiaTensorWorld, CollisionObject::m_worldTransform, SimdMatrix3x3::scaled(), and SimdMatrix3x3::transpose().

Referenced by RigidBody(), setCenterOfMassTransform(), and CcdPhysicsController::setRigidBody().

Member Data Documentation

SimdScalar RigidBody::m_angularDamping [private]

Definition at line 228 of file RigidBody.h.

Referenced by applyForces(), and setDamping().

SimdVector3 RigidBody::m_angularVelocity [private]

Definition at line 225 of file RigidBody.h.

Referenced by applyForces(), applyTorqueImpulse(), getAngularVelocity(), getVelocityInLocalPoint(), integrateVelocities(), predictIntegratedTransform(), saveKinematicState(), and setAngularVelocity().

BroadphaseProxy* RigidBody::m_broadphaseProxy [private]

Definition at line 236 of file RigidBody.h.

int RigidBody::m_debugBodyId

Definition at line 269 of file RigidBody.h.

Referenced by RigidBody().

SimdVector3 RigidBody::m_facc

Definition at line 266 of file RigidBody.h.

Referenced by OdeConstraintSolver::ConvertBody(), and SolveInternal1().

SimdScalar RigidBody::m_friction [private]

Definition at line 231 of file RigidBody.h.

Referenced by getFriction(), and setFriction().

SimdVector3 RigidBody::m_gravity [private]

Definition at line 217 of file RigidBody.h.

Referenced by applyForces(), and setGravity().

dMatrix3 RigidBody::m_I

Definition at line 260 of file RigidBody.h.

Referenced by OdeConstraintSolver::ConvertBody().

SimdScalar RigidBody::m_inverseMass [private]

Definition at line 229 of file RigidBody.h.

Referenced by applyCentralImpulse(), applyImpulse(), ComputeImpulseDenominator(), getInvMass(), integrateVelocities(), setGravity(), and setMassProps().

dMatrix3 RigidBody::m_invI

Definition at line 261 of file RigidBody.h.

Referenced by OdeConstraintSolver::ConvertBody().

SimdVector3 RigidBody::m_invInertiaLocal [private]

Definition at line 218 of file RigidBody.h.

Referenced by getInvInertiaDiagLocal(), setInvInertiaDiagLocal(), setMassProps(), and updateInertiaTensor().

SimdMatrix3x3 RigidBody::m_invInertiaTensorWorld [private]

Definition at line 216 of file RigidBody.h.

Referenced by applyTorqueImpulse(), getInvInertiaTensorWorld(), integrateVelocities(), and updateInertiaTensor().

SimdScalar RigidBody::m_kinematicTimeStep [private]

Definition at line 234 of file RigidBody.h.

Referenced by saveKinematicState().

SimdScalar RigidBody::m_linearDamping [private]

Definition at line 227 of file RigidBody.h.

Referenced by applyForces(), and setDamping().

SimdVector3 RigidBody::m_linearVelocity [private]

Definition at line 223 of file RigidBody.h.

Referenced by applyCentralImpulse(), applyForces(), getLinearVelocity(), getVelocityInLocalPoint(), integrateVelocities(), predictIntegratedTransform(), saveKinematicState(), and setLinearVelocity().

int RigidBody::m_odeTag

Definition at line 263 of file RigidBody.h.

Referenced by SolveInternal1().

float RigidBody::m_padding[1024]

Definition at line 264 of file RigidBody.h.

dMatrix3 RigidBody::m_R

for ode solver-binding

Definition at line 259 of file RigidBody.h.

Referenced by OdeConstraintSolver::ConvertBody().

SimdScalar RigidBody::m_restitution [private]

Definition at line 232 of file RigidBody.h.

Referenced by getRestitution(), and setRestitution().

SimdVector3 RigidBody::m_tacc

Definition at line 265 of file RigidBody.h.

Referenced by OdeConstraintSolver::ConvertBody(), and SolveInternal1().

SimdVector3 RigidBody::m_totalForce [private]

Definition at line 219 of file RigidBody.h.

Referenced by applyCentralForce(), clearForces(), and integrateVelocities().

SimdVector3 RigidBody::m_totalTorque [private]

Definition at line 220 of file RigidBody.h.

Referenced by applyTorque(), clearForces(), and integrateVelocities().

The documentation for this class was generated from the following files:
  • RigidBody.h
  • RigidBody.cpp
Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

RigidBody Member List

This is the complete list of members for RigidBody, including all inherited members.

activate() | CollisionObject |
applyCentralForce(const SimdVector3 &force) | RigidBody | [inline]
applyCentralImpulse(const SimdVector3 &impulse) | RigidBody | [inline]
applyForce(const SimdVector3 &force, const SimdVector3 &rel_pos) | RigidBody | [inline]
applyForces(SimdScalar step) | RigidBody |
applyImpulse(const SimdVector3 &impulse, const SimdVector3 &rel_pos) | RigidBody | [inline]
applyTorque(const SimdVector3 &torque) | RigidBody | [inline]
applyTorqueImpulse(const SimdVector3 &torque) | RigidBody | [inline]
clearForces() | RigidBody | [inline]
CollisionFlags enum name | CollisionObject |
CollisionObject() | CollisionObject |
ComputeAngularImpulseDenominator(const SimdVector3 &axis) const | RigidBody | [inline]
ComputeImpulseDenominator(const SimdPoint3 &pos, const SimdVector3 &normal) const | RigidBody | [inline]
ForceActivationState(int newState) | CollisionObject |
getAabb(SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | RigidBody |
GetActivationState() const | CollisionObject | [inline]
getAngularVelocity() const | RigidBody | [inline]
GetBroadphaseProxy() const | RigidBody | [inline]
GetBroadphaseProxy() | RigidBody | [inline]
getCenterOfMassPosition() const | RigidBody | [inline]
getCenterOfMassTransform() const | RigidBody | [inline]
GetCollisionShape() const | RigidBody | [inline]
GetCollisionShape() | RigidBody | [inline]
getFriction() const | RigidBody | [inline]
getInvInertiaDiagLocal() | RigidBody | [inline]
getInvInertiaTensorWorld() const | RigidBody | [inline]
getInvMass() const | RigidBody | [inline]
getLinearVelocity() const | RigidBody | [inline]
getOrientation() const | RigidBody |
getRestitution() const | RigidBody | [inline]
getVelocityInLocalPoint(const SimdVector3 &rel_pos) const | RigidBody | [inline]
HasContactResponse() | CollisionObject | [inline]
integrateVelocities(SimdScalar step) | RigidBody |
isStatic enum value | CollisionObject |
IsStatic() const | CollisionObject | [inline]
m_activationState1 | CollisionObject |
m_angularDamping | RigidBody | [private]
m_angularVelocity | RigidBody | [private]
m_broadphaseHandle | CollisionObject |
m_broadphaseProxy | RigidBody | [private]
m_ccdSquareMotionTreshold | CollisionObject |
m_ccdSweptShereRadius | CollisionObject |
m_collisionFlags | CollisionObject |
m_collisionShape | CollisionObject |
m_deactivationTime | CollisionObject |
m_debugBodyId | RigidBody |
m_facc | RigidBody |
m_friction | RigidBody | [private]
m_gravity | RigidBody | [private]
m_hitFraction | CollisionObject |
m_I | RigidBody |
m_interpolationWorldTransform | CollisionObject |
m_inverseMass | RigidBody | [private]
m_invI | RigidBody |
m_invInertiaLocal | RigidBody | [private]
m_invInertiaTensorWorld | RigidBody | [private]
m_islandTag1 | CollisionObject |
m_kinematicTimeStep | RigidBody | [private]
m_linearDamping | RigidBody | [private]
m_linearVelocity | RigidBody | [private]
m_odeTag | RigidBody |
m_padding | RigidBody |
m_R | RigidBody |
m_restitution | RigidBody | [private]
m_tacc | RigidBody |
m_totalForce | RigidBody | [private]
m_totalTorque | RigidBody | [private]
m_userPointer | CollisionObject |
m_worldTransform | CollisionObject |
mergesSimulationIslands() const | CollisionObject |
noContactResponse enum value | CollisionObject |
predictIntegratedTransform(SimdScalar step, SimdTransform &predictedTransform) const | RigidBody |
proceedToTransform(const SimdTransform &newTrans) | RigidBody |
RigidBody(const MassProps &massProps, SimdScalar linearDamping, SimdScalar angularDamping, SimdScalar friction, SimdScalar restitution) | RigidBody |
saveKinematicState(SimdScalar step) | RigidBody |
SetActivationState(int newState) | CollisionObject |
setAngularVelocity(const SimdVector3 &ang_vel) | RigidBody | [inline]
SetBroadphaseProxy(BroadphaseProxy *broadphaseProxy) | RigidBody | [inline]
setCenterOfMassTransform(const SimdTransform &xform) | RigidBody |
SetCollisionShape(CollisionShape *collisionShape) | CollisionObject | [inline]
setDamping(SimdScalar lin_damping, SimdScalar ang_damping) | RigidBody |
setFriction(float frict) | RigidBody | [inline]
setGravity(const SimdVector3 &acceleration) | RigidBody |
setInvInertiaDiagLocal(const SimdVector3 &diagInvInertia) | RigidBody | [inline]
setLinearVelocity(const SimdVector3 &lin_vel) | RigidBody |
setMassProps(SimdScalar mass, const SimdVector3 &inertia) | RigidBody |
setRestitution(float rest) | RigidBody | [inline]
translate(const SimdVector3 &v) | RigidBody | [inline]
updateInertiaTensor() | RigidBody |

Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Separation Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

Separation Struct Reference

#include <Shape.h>

List of all members.

Public Types

enum {
kFeatureNone,
kFeatureA,
kFeatureB,
kFeatureBoth
}

Public Attributes

short | m_featureA
short | m_featureB
float | m_dist
Vector3 | m_axis
short | m_separator
short | m_contact

Detailed Description

Definition at line 29 of file Shape.h.

Member Enumeration Documentation

anonymous enum

Enumerator:
kFeatureNone
kFeatureA
kFeatureB
kFeatureBoth

Definition at line 38 of file Shape.h.

Member Data Documentation

Vector3 Separation::m_axis

Definition at line 35 of file Shape.h.

short Separation::m_contact

Definition at line 48 of file Shape.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

float Separation::m_dist

Definition at line 34 of file Shape.h.

short Separation::m_featureA

Definition at line 32 of file Shape.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

short Separation::m_featureB

Definition at line 33 of file Shape.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

short Separation::m_separator

Definition at line 45 of file Shape.h.

Referenced by ConvexConvexAlgorithm::ProcessCollision().

The documentation for this struct was generated from the following file:
  • Shape.h
Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Separation Member List

This is the complete list of members for Separation, including all inherited members.

kFeatureA enum value | Separation
kFeatureB enum value | Separation
kFeatureBoth enum value | Separation
kFeatureNone enum value | Separation
m_axis | Separation
m_contact | Separation
m_dist | Separation
m_featureA | Separation
m_featureB | Separation
m_separator | Separation

Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Shape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Shape Class Reference

Shape provides a interface for Hull class (convex hull calculation). More...

#include <Shape.h>

Inheritance diagram for Shape:

[legend]
List of all members.

Public Member Functions

Shape ()
virtual | ~Shape ()
virtual void | ComputeInertia (const Transform &transform, Point3 &centerOfMass, Matrix33 &inertia, float totalMass) const =0
virtual Bounds3 | ComputeBounds (const Transform &transform) const =0

Detailed Description

Shape provides a interface for Hull class (convex hull calculation).

Definition at line 52 of file Shape.h.

Constructor & Destructor Documentation

Shape::Shape ( )

virtual Shape::~Shape ( ) [virtual]

Member Function Documentation

virtual Bounds3 Shape::ComputeBounds ( const Transform & transform ) const [pure virtual]

Implemented in Hull.

virtual void Shape::ComputeInertia | ( | const Transform & | transform,
 |  | Point3 & | centerOfMass,
 |  | Matrix33 & | inertia,
 |  | float | totalMass
 | ) | const [pure virtual]

Implemented in Hull.

The documentation for this class was generated from the following file:
  • Shape.h
Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Shape Member List

This is the complete list of members for Shape, including all inherited members.

ComputeBounds(const Transform &transform) const =0 | Shape | [pure virtual]
ComputeInertia(const Transform &transform, Point3 &centerOfMass, Matrix33 &inertia, float totalMass) const =0 | Shape | [pure virtual]
Shape() | Shape |
~Shape() | Shape | [virtual]

Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdMatrix3x3 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdMatrix3x3 Class Reference

#include <SimdMatrix3x3.h>

Collaboration diagram for SimdMatrix3x3:

[legend]
List of all members.

Public Member Functions

SimdMatrix3x3 ()
SimdMatrix3x3 (const SimdQuaternion &q)
SimdMatrix3x3 (const SimdScalar &xx, const SimdScalar &xy, const SimdScalar &xz, const SimdScalar &yx, const SimdScalar &yy, const SimdScalar &yz, const SimdScalar &zx, const SimdScalar &zy, const SimdScalar &zz)
SimdVector3 | getColumn (int i) const
const SimdVector3 & | getRow (int i) const
SIMD_FORCE_INLINE SimdVector3 & | operator[] (int i)
const SimdVector3 & | operator[] (int i) const
SimdMatrix3x3 & | operator *= (const SimdMatrix3x3 &m)
void | setFromOpenGLSubMatrix (const SimdScalar *m)
void | setValue (const SimdScalar &xx, const SimdScalar &xy, const SimdScalar &xz, const SimdScalar &yx, const SimdScalar &yy, const SimdScalar &yz, const SimdScalar &zx, const SimdScalar &zy, const SimdScalar &zz)
void | setRotation (const SimdQuaternion &q)
void | setEulerYPR (const SimdScalar &yaw, const SimdScalar &pitch, const SimdScalar &roll)
void | setEulerZYX (SimdScalar eulerX, SimdScalar eulerY, SimdScalar eulerZ)
setEulerZYX
void | setIdentity ()
void | getOpenGLSubMatrix (SimdScalar *m) const
void | getRotation (SimdQuaternion &q) const
void | getEuler (SimdScalar &yaw, SimdScalar &pitch, SimdScalar &roll) const
SimdVector3 | getScaling () const
SimdMatrix3x3 | scaled (const SimdVector3 &s) const
SimdScalar | determinant () const
SimdMatrix3x3 | adjoint () const
SimdMatrix3x3 | absolute () const
SimdMatrix3x3 | transpose () const
SimdMatrix3x3 | inverse () const
SimdMatrix3x3 | transposeTimes (const SimdMatrix3x3 &m) const
SimdMatrix3x3 | timesTranspose (const SimdMatrix3x3 &m) const
SimdScalar | tdot (int c, const SimdVector3 &v) const

Protected Member Functions

SimdScalar | cofac (int r1, int c1, int r2, int c2) const

Protected Attributes

SimdVector3 | m_el [3]

Detailed Description

Definition at line 25 of file SimdMatrix3x3.h.

Constructor & Destructor Documentation

SimdMatrix3x3::SimdMatrix3x3 ( ) [inline]

Definition at line 27 of file SimdMatrix3x3.h.

Referenced by absolute(), adjoint(), inverse(), scaled(), timesTranspose(), transpose(), and transposeTimes().

SimdMatrix3x3::SimdMatrix3x3 ( const SimdQuaternion & q ) [inline, explicit]

Definition at line 31 of file SimdMatrix3x3.h.

References setRotation().

SimdMatrix3x3::SimdMatrix3x3 | ( | const SimdScalar & | xx,
 |  | const SimdScalar & | xy,
 |  | const SimdScalar & | xz,
 |  | const SimdScalar & | yx,
 |  | const SimdScalar & | yy,
 |  | const SimdScalar & | yz,
 |  | const SimdScalar & | zx,
 |  | const SimdScalar & | zy,
 |  | const SimdScalar & | zz
 | ) | [inline]

Definition at line 39 of file SimdMatrix3x3.h.

References setValue().

Member Function Documentation

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMatrix3x3::absolute ( ) const

Definition at line 297 of file SimdMatrix3x3.h.

References SimdFabs(), and SimdMatrix3x3().

Referenced by TriangleMeshShape::GetAabb(), and BoxShape::GetAabb().

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMatrix3x3::adjoint ( ) const

Definition at line 314 of file SimdMatrix3x3.h.

References cofac(), and SimdMatrix3x3().

SimdScalar SimdMatrix3x3::cofac | ( | int | r1,
 |  | int | c1,
 |  | int | r2,
 |  | int | c2
 | ) | const [inline, protected]

Definition at line 272 of file SimdMatrix3x3.h.

Referenced by adjoint(), and inverse().

SIMD_FORCE_INLINE SimdScalar SimdMatrix3x3::determinant ( ) const

Definition at line 290 of file SimdMatrix3x3.h.

References triple().

SimdVector3 SimdMatrix3x3::getColumn ( int i ) const [inline]

Definition at line 48 of file SimdMatrix3x3.h.

References m_el.

void SimdMatrix3x3::getEuler | ( | SimdScalar & | yaw,
 |  | SimdScalar & | pitch,
 |  | SimdScalar & | roll
 | ) | const [inline]

Definition at line 219 of file SimdMatrix3x3.h.

References SIMD_2_PI, SimdAsin(), and SimdAtan2().

void SimdMatrix3x3::getOpenGLSubMatrix ( SimdScalar * m ) const [inline]

Definition at line 169 of file SimdMatrix3x3.h.

References m_el.

Referenced by SimdTransform::getOpenGLMatrix().

void SimdMatrix3x3::getRotation ( SimdQuaternion & q ) const [inline]

Definition at line 185 of file SimdMatrix3x3.h.

References m_el, and SimdSqrt().

Referenced by BU_CollisionPair::calcTimeOfImpact(), SimdTransformUtil::CalculateVelocity(), RigidBody::getOrientation(), SimdTransform::getRotation(), and BU_Screwing::InBetweenTransform().

const SimdVector3& SimdMatrix3x3::getRow ( int i ) const [inline]

Definition at line 53 of file SimdMatrix3x3.h.

References m_el.

SimdVector3 SimdMatrix3x3::getScaling ( ) const [inline]

Definition at line 242 of file SimdMatrix3x3.h.

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMatrix3x3::inverse ( ) const

Definition at line 322 of file SimdMatrix3x3.h.

References cofac(), and SimdMatrix3x3().

Referenced by SimdTransformUtil::CalculateVelocity(), CcdPhysicsEnvironment::createConstraint(), SimdTransform::inverse(), SimdTransform::inverseTimes(), SimdTransform::multInverseLeft(), and CcdPhysicsController::RelativeRotate().

SIMD_FORCE_INLINE SimdMatrix3x3 & SimdMatrix3x3::operator *= ( const SimdMatrix3x3 & m )

Definition at line 281 of file SimdMatrix3x3.h.

References setValue(), SIMD_FORCE_INLINE, and tdot().

const SimdVector3& SimdMatrix3x3::operator[] ( int i ) const [inline]

Definition at line 65 of file SimdMatrix3x3.h.

References m_el.

SIMD_FORCE_INLINE SimdVector3& SimdMatrix3x3::operator[] ( int i ) [inline]

Definition at line 59 of file SimdMatrix3x3.h.

References m_el.

SimdMatrix3x3 SimdMatrix3x3::scaled ( const SimdVector3 & s ) const [inline]

Definition at line 250 of file SimdMatrix3x3.h.

References SimdMatrix3x3().

Referenced by SimdTransform::scale(), and RigidBody::updateInertiaTensor().

void SimdMatrix3x3::setEulerYPR | ( | const SimdScalar & | yaw,
 |  | const SimdScalar & | pitch,
 |  | const SimdScalar & | roll
 | ) | [inline]

Definition at line 118 of file SimdMatrix3x3.h.

References setValue(), SimdCos(), and SimdSin().

void SimdMatrix3x3::setEulerZYX | ( | SimdScalar | eulerX,
 |  | SimdScalar | eulerY,
 |  | SimdScalar | eulerZ
 | ) | [inline]

setEulerZYX

Parameters:
euler a const reference to a SimdVector3 of euler angles These angles are used to produce a rotation matrix. The euler angles are applied in ZYX order. I.e a vector is first rotated about X then Y and then Z

Definition at line 145 of file SimdMatrix3x3.h.

References setValue(), SimdCos(), and SimdSin().

void SimdMatrix3x3::setFromOpenGLSubMatrix ( const SimdScalar * m ) [inline]

Definition at line 74 of file SimdMatrix3x3.h.

References m_el.

Referenced by SimdTransform::setFromOpenGLMatrix().

void SimdMatrix3x3::setIdentity ( ) [inline]

Definition at line 162 of file SimdMatrix3x3.h.

References setValue().

Referenced by SimdTransform::setIdentity().

void SimdMatrix3x3::setRotation ( const SimdQuaternion & q ) [inline]

Definition at line 102 of file SimdMatrix3x3.h.

References SimdQuaternion::length2(), and setValue().

Referenced by CcdPhysicsController::GetWorldOrientation(), SimdTransform::setRotation(), and SimdMatrix3x3().

void SimdMatrix3x3::setValue | ( | const SimdScalar & | xx,
 |  | const SimdScalar & | xy,
 |  | const SimdScalar & | xz,
 |  | const SimdScalar & | yx,
 |  | const SimdScalar & | yy,
 |  | const SimdScalar & | yz,
 |  | const SimdScalar & | zx,
 |  | const SimdScalar & | zy,
 |  | const SimdScalar & | zz
 | ) | [inline]

Definition at line 87 of file SimdMatrix3x3.h.

References m_el.

Referenced by operator *=(), setEulerYPR(), setEulerZYX(), setIdentity(), setRotation(), SimdTransform::setValue(), and SimdMatrix3x3().

SimdScalar SimdMatrix3x3::tdot | ( | int | c,
 |  | const SimdVector3 & | v
 | ) | const [inline]

Definition at line 266 of file SimdMatrix3x3.h.

Referenced by operator *(), and operator *=().

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMatrix3x3::timesTranspose ( const SimdMatrix3x3 & m ) const

Definition at line 349 of file SimdMatrix3x3.h.

References dot(), and SimdMatrix3x3().

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMatrix3x3::transpose ( ) const

Definition at line 306 of file SimdMatrix3x3.h.

References SimdMatrix3x3().

Referenced by Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), SimdTransform::inverse(), SimdTransform::invXform(), resolveSingleBilateral(), SimpleConstraintSolver::Solve(), and RigidBody::updateInertiaTensor().

SIMD_FORCE_INLINE SimdMatrix3x3 SimdMatrix3x3::transposeTimes ( const SimdMatrix3x3 & m ) const

Definition at line 334 of file SimdMatrix3x3.h.

References SimdMatrix3x3().

Referenced by SimdTransform::inverseTimes().

Member Data Documentation

SimdVector3 SimdMatrix3x3::m_el[3] [protected]

Definition at line 277 of file SimdMatrix3x3.h.

Referenced by getColumn(), getOpenGLSubMatrix(), getRotation(), getRow(), operator[](), setFromOpenGLSubMatrix(), and setValue().

The documentation for this class was generated from the following file:
  • SimdMatrix3x3.h
Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdMatrix3x3 Member List

This is the complete list of members for SimdMatrix3x3, including all inherited members.

absolute() const | SimdMatrix3x3 |
adjoint() const | SimdMatrix3x3 |
cofac(int r1, int c1, int r2, int c2) const | SimdMatrix3x3 | [inline, protected]
determinant() const | SimdMatrix3x3 |
getColumn(int i) const | SimdMatrix3x3 | [inline]
getEuler(SimdScalar &yaw, SimdScalar &pitch, SimdScalar &roll) const | SimdMatrix3x3 | [inline]
getOpenGLSubMatrix(SimdScalar *m) const | SimdMatrix3x3 | [inline]
getRotation(SimdQuaternion &q) const | SimdMatrix3x3 | [inline]
getRow(int i) const | SimdMatrix3x3 | [inline]
getScaling() const | SimdMatrix3x3 | [inline]
inverse() const | SimdMatrix3x3 |
m_el | SimdMatrix3x3 | [protected]
operator *=(const SimdMatrix3x3 &m) | SimdMatrix3x3 |
operator[](int i) | SimdMatrix3x3 | [inline]
operator[](int i) const | SimdMatrix3x3 | [inline]
scaled(const SimdVector3 &s) const | SimdMatrix3x3 | [inline]
setEulerYPR(const SimdScalar &yaw, const SimdScalar &pitch, const SimdScalar &roll) | SimdMatrix3x3 | [inline]
setEulerZYX(SimdScalar eulerX, SimdScalar eulerY, SimdScalar eulerZ) | SimdMatrix3x3 | [inline]
setFromOpenGLSubMatrix(const SimdScalar *m) | SimdMatrix3x3 | [inline]
setIdentity() | SimdMatrix3x3 | [inline]
setRotation(const SimdQuaternion &q) | SimdMatrix3x3 | [inline]
setValue(const SimdScalar &xx, const SimdScalar &xy, const SimdScalar &xz, const SimdScalar &yx, const SimdScalar &yy, const SimdScalar &yz, const SimdScalar &zx, const SimdScalar &zy, const SimdScalar &zz) | SimdMatrix3x3 | [inline]
SimdMatrix3x3() | SimdMatrix3x3 | [inline]
SimdMatrix3x3(const SimdQuaternion &q) | SimdMatrix3x3 | [inline, explicit]
SimdMatrix3x3(const SimdScalar &xx, const SimdScalar &xy, const SimdScalar &xz, const SimdScalar &yx, const SimdScalar &yy, const SimdScalar &yz, const SimdScalar &zx, const SimdScalar &zy, const SimdScalar &zz) | SimdMatrix3x3 | [inline]
tdot(int c, const SimdVector3 &v) const | SimdMatrix3x3 | [inline]
timesTranspose(const SimdMatrix3x3 &m) const | SimdMatrix3x3 |
transpose() const | SimdMatrix3x3 |
transposeTimes(const SimdMatrix3x3 &m) const | SimdMatrix3x3 |

Generated on Wed May 24 14:00:29 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdQuadWord Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdQuadWord Class Reference

#include <SimdQuadWord.h>

Inheritance diagram for SimdQuadWord:

[legend]
List of all members.

Public Member Functions

SIMD_FORCE_INLINE SimdScalar & | operator[] (int i)
SIMD_FORCE_INLINE const SimdScalar & | operator[] (int i) const
SIMD_FORCE_INLINE const SimdScalar & | getX () const
SIMD_FORCE_INLINE const SimdScalar & | getY () const
SIMD_FORCE_INLINE const SimdScalar & | getZ () const
SIMD_FORCE_INLINE void | setX (float x)
SIMD_FORCE_INLINE void | setY (float y)
SIMD_FORCE_INLINE void | setZ (float z)
SIMD_FORCE_INLINE const SimdScalar & | x () const
SIMD_FORCE_INLINE const SimdScalar & | y () const
SIMD_FORCE_INLINE const SimdScalar & | z () const
operator SimdScalar * ()
operator const SimdScalar * () const
SIMD_FORCE_INLINE void | setValue (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z)
SIMD_FORCE_INLINE void | setValue (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w)
SIMD_FORCE_INLINE | SimdQuadWord ()
SIMD_FORCE_INLINE | SimdQuadWord (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z)
SIMD_FORCE_INLINE | SimdQuadWord (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w)
SIMD_FORCE_INLINE void | setMax (const SimdQuadWord &other)
SIMD_FORCE_INLINE void | setMin (const SimdQuadWord &other)

Protected Member Functions

ATTRIBUTE_ALIGNED16 (SimdScalar m_x)

Protected Attributes

SimdScalar m_y
SimdScalar m_z
SimdScalar m_unusedW

Detailed Description

Definition at line 25 of file SimdQuadWord.h.

Constructor & Destructor Documentation

SIMD_FORCE_INLINE SimdQuadWord::SimdQuadWord ( ) [inline]

Definition at line 82 of file SimdQuadWord.h.

SIMD_FORCE_INLINE SimdQuadWord::SimdQuadWord | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z
 | ) | [inline]

Definition at line 87 of file SimdQuadWord.h.

SIMD_FORCE_INLINE SimdQuadWord::SimdQuadWord | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z,
 |  | const SimdScalar & | w
 | ) | [inline]

Definition at line 94 of file SimdQuadWord.h.

Member Function Documentation

SimdQuadWord::ATTRIBUTE_ALIGNED16 ( SimdScalar m_x ) [protected]

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::getX ( ) const [inline]

Definition at line 38 of file SimdQuadWord.h.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CollisionShape::CalculateTemporalAabb(), BoxShape::GetPlane(), BU_EdgeEdge::GetTimeOfImpact(), Epa::Initialize(), StridingMeshInterface::InternalProcessAllTriangles(), BvhTriangleMeshShape::ProcessAllTriangles(), AxisSweep3::Quantize(), and CcdPhysicsEnvironment::rayTest().

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::getY ( ) const [inline]

Definition at line 40 of file SimdQuadWord.h.

References m_y.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CollisionShape::CalculateTemporalAabb(), BoxShape::GetPlane(), BU_EdgeEdge::GetTimeOfImpact(), Epa::Initialize(), StridingMeshInterface::InternalProcessAllTriangles(), BvhTriangleMeshShape::ProcessAllTriangles(), AxisSweep3::Quantize(), and CcdPhysicsEnvironment::rayTest().

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::getZ ( ) const [inline]

Definition at line 42 of file SimdQuadWord.h.

References m_z.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), CollisionShape::CalculateTemporalAabb(), BoxShape::GetPlane(), Epa::Initialize(), StridingMeshInterface::InternalProcessAllTriangles(), BvhTriangleMeshShape::ProcessAllTriangles(), AxisSweep3::Quantize(), and CcdPhysicsEnvironment::rayTest().

SimdQuadWord::operator const SimdScalar * ( ) const [inline]

Definition at line 58 of file SimdQuadWord.h.

SimdQuadWord::operator SimdScalar * ( ) [inline]

Definition at line 57 of file SimdQuadWord.h.

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::operator[] ( int i ) const [inline]

Definition at line 36 of file SimdQuadWord.h.

SIMD_FORCE_INLINE SimdScalar& SimdQuadWord::operator[] ( int i ) [inline]

Definition at line 35 of file SimdQuadWord.h.

SIMD_FORCE_INLINE void SimdQuadWord::setMax ( const SimdQuadWord & other ) [inline]

Definition at line 100 of file SimdQuadWord.h.

References m_unusedW, m_y, and m_z.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), AxisSweep3::Quantize(), and CollisionWorld::RayTest().

SIMD_FORCE_INLINE void SimdQuadWord::setMin ( const SimdQuadWord & other ) [inline]

Definition at line 115 of file SimdQuadWord.h.

References m_unusedW, m_y, and m_z.

Referenced by OptimizedBvh::Build(), OptimizedBvh::BuildTree(), AxisSweep3::Quantize(), and CollisionWorld::RayTest().

SIMD_FORCE_INLINE void SimdQuadWord::setValue | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z,
 |  | const SimdScalar & | w
 | ) | [inline]

Definition at line 74 of file SimdQuadWord.h.

References m_unusedW, m_y, and m_z.

SIMD_FORCE_INLINE void SimdQuadWord::setValue | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z
 | ) | [inline]

Definition at line 60 of file SimdQuadWord.h.

References m_y, and m_z.

Referenced by RigidBody::applyForces(), SphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), BoxShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), OptimizedBvh::BuildTree(), SubsimplexConvexCast::calcTimeOfImpact(), GjkConvexCast::calcTimeOfImpact(), ContinuousConvexCollision::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), TriangleShape::CalculateLocalInertia(), TriangleMeshShape::CalculateLocalInertia(), MinkowskiSumShape::CalculateLocalInertia(), RigidBody::clearForces(), OdeConstraintSolver::ConvertBody(), SphereShape::LocalGetSupportingVertex(), CylinderShape::LocalGetSupportingVertex(), ConvexShape::LocalGetSupportingVertex(), ConvexHullShape::LocalGetSupportingVertex(), ConeShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertex(), PolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(), MultiSphereShape::LocalGetSupportingVertexWithoutMargin(), ConvexHullShape::LocalGetSupportingVertexWithoutMargin(), SimdQuaternion::operator *=(), SimdQuaternion::setEuler(), SimdTransform::setIdentity(), RigidBody::setMassProps(), SimdQuaternion::setRotation(), SimdTransform::setValue(), CcdPhysicsEnvironment::UpdateAabbs(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

SIMD_FORCE_INLINE void SimdQuadWord::setX ( float x ) [inline]

Definition at line 44 of file SimdQuadWord.h.

Referenced by BU_EdgeEdge::GetTimeOfImpact(), and Epa::Initialize().

SIMD_FORCE_INLINE void SimdQuadWord::setY ( float y ) [inline]

Definition at line 46 of file SimdQuadWord.h.

References m_y.

Referenced by BU_EdgeEdge::GetTimeOfImpact(), and Epa::Initialize().

SIMD_FORCE_INLINE void SimdQuadWord::setZ ( float z ) [inline]

Definition at line 48 of file SimdQuadWord.h.

References m_z.

Referenced by Epa::Initialize().

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::x ( ) const [inline]

Definition at line 50 of file SimdQuadWord.h.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), BoxShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), BU_EdgeEdge::Calc2DRotationPointPoint(), PolyhedralConvexShape::CalculateLocalInertia(), ConeShape::CalculateLocalInertia(), BoxShape::CalculateLocalInertia(), CollisionShape::CalculateTemporalAabb(), SimdTransformUtil::CalculateVelocity(), SimdVector3::cross(), SimdVector3::dot(), CcdPhysicsController::GetAngularVelocity(), CcdPhysicsController::GetLinearVelocity(), BoxShape::GetPlaneEquation(), CcdPhysicsController::getPosition(), BU_VertexPoly::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpactGeneralCase(), CcdPhysicsController::GetVelocity(), BoxShape::GetVertex(), DefaultMotionState::getWorldOrientation(), DefaultMotionState::getWorldPosition(), BU_Screwing::InBetweenPosition(), BU_Screwing::InBetweenTransform(), SimdTransformUtil::IntegrateTransform(), BoxShape::IsInside(), SimdVector3::lerp(), BoxShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertexWithoutMargin(), operator *(), SimdQuaternion::operator *(), SimdVector3::operator *=(), SimdQuaternion::operator *=(), operator+(), SimdQuaternion::operator+(), SimdVector3::operator+=(), SimdQuaternion::operator+=(), operator-(), SimdQuaternion::operator-(), SimdVector3::operator-=(), SimdQuaternion::operator-=(), operator/(), SimdVector3::rotate(), SimdVector3::setInterpolate3(), SimdQuaternion::setRotation(), CcdPhysicsController::setScaling(), SimdQuaternion::slerp(), and SimdVector3::triple().

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::y ( ) const [inline]

Definition at line 52 of file SimdQuadWord.h.

References m_y.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), BoxShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), BU_EdgeEdge::Calc2DRotationPointPoint(), PolyhedralConvexShape::CalculateLocalInertia(), ConeShape::CalculateLocalInertia(), BoxShape::CalculateLocalInertia(), CollisionShape::CalculateTemporalAabb(), SimdTransformUtil::CalculateVelocity(), SimdVector3::cross(), SimdVector3::dot(), CcdPhysicsController::GetAngularVelocity(), CcdPhysicsController::GetLinearVelocity(), BoxShape::GetPlaneEquation(), CcdPhysicsController::getPosition(), BU_VertexPoly::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpactGeneralCase(), CcdPhysicsController::GetVelocity(), BoxShape::GetVertex(), DefaultMotionState::getWorldOrientation(), DefaultMotionState::getWorldPosition(), BU_Screwing::InBetweenPosition(), BU_Screwing::InBetweenTransform(), SimdTransformUtil::IntegrateTransform(), BoxShape::IsInside(), SimdVector3::lerp(), BoxShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertexWithoutMargin(), operator *(), SimdQuaternion::operator *(), SimdVector3::operator *=(), SimdQuaternion::operator *=(), operator+(), SimdQuaternion::operator+(), SimdVector3::operator+=(), SimdQuaternion::operator+=(), operator-(), SimdQuaternion::operator-(), SimdVector3::operator-=(), SimdQuaternion::operator-=(), operator/(), SimdVector3::rotate(), SimdVector3::setInterpolate3(), SimdQuaternion::setRotation(), CcdPhysicsController::setScaling(), SimdQuaternion::slerp(), and SimdVector3::triple().

SIMD_FORCE_INLINE const SimdScalar& SimdQuadWord::z ( ) const [inline]

Definition at line 54 of file SimdQuadWord.h.

References m_z.

Referenced by CcdPhysicsEnvironment::addCcdPhysicsController(), BoxShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), PolyhedralConvexShape::CalculateLocalInertia(), ConeShape::CalculateLocalInertia(), BoxShape::CalculateLocalInertia(), CollisionShape::CalculateTemporalAabb(), SimdTransformUtil::CalculateVelocity(), SimdVector3::cross(), SimdVector3::dot(), CcdPhysicsController::GetAngularVelocity(), CcdPhysicsController::GetLinearVelocity(), BoxShape::GetPlaneEquation(), CcdPhysicsController::getPosition(), BU_VertexPoly::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpact(), BU_EdgeEdge::GetTimeOfImpactGeneralCase(), CcdPhysicsController::GetVelocity(), BoxShape::GetVertex(), DefaultMotionState::getWorldOrientation(), DefaultMotionState::getWorldPosition(), BU_Screwing::InBetweenPosition(), BU_Screwing::InBetweenTransform(), SimdTransformUtil::IntegrateTransform(), BoxShape::IsInside(), SimdVector3::lerp(), BoxShape::LocalGetSupportingVertex(), BoxShape::LocalGetSupportingVertexWithoutMargin(), operator *(), SimdQuaternion::operator *(), SimdVector3::operator *=(), SimdQuaternion::operator *=(), operator+(), SimdQuaternion::operator+(), SimdVector3::operator+=(), SimdQuaternion::operator+=(), operator-(), SimdQuaternion::operator-(), SimdVector3::operator-=(), SimdQuaternion::operator-=(), operator/(), SimdVector3::setInterpolate3(), SimdQuaternion::setRotation(), CcdPhysicsController::setScaling(), SimdQuaternion::slerp(), and SimdVector3::triple().

Member Data Documentation

SimdScalar SimdQuadWord::m_unusedW [protected]

Definition at line 31 of file SimdQuadWord.h.

Referenced by SimdVector4::absolute4(), SimdQuaternion::dot(), SimdQuaternion::getAngle(), SimdVector4::getW(), SimdQuaternion::inverse(), SimdVector4::maxAxis4(), SimdVector4::minAxis4(), SimdQuaternion::operator *(), SimdQuaternion::operator *=(), SimdQuaternion::operator+=(), SimdQuaternion::operator-=(), setMax(), setMin(), setValue(), SimdVector4::SimdVector4(), and SimdQuaternion::slerp().

SimdScalar SimdQuadWord::m_y [protected]

Definition at line 29 of file SimdQuadWord.h.

Referenced by SimdVector3::absolute(), SimdVector4::absolute4(), SimdVector3::cross(), SimdVector3::dot(), SimdQuaternion::dot(), getY(), SimdQuaternion::inverse(), SimdVector3::lerp(), SimdVector3::maxAxis(), SimdVector4::maxAxis4(), SimdVector3::minAxis(), SimdVector4::minAxis4(), SimdVector3::operator *=(), SimdQuaternion::operator *=(), SimdVector3::operator+=(), SimdQuaternion::operator+=(), SimdVector3::operator-=(), SimdQuaternion::operator-=(), SimdVector3::setInterpolate3(), setMax(), setMin(), setValue(), setY(), SimdQuaternion::slerp(), SimdVector3::triple(), and y().

SimdScalar SimdQuadWord::m_z [protected]

Definition at line 30 of file SimdQuadWord.h.

Referenced by SimdVector3::absolute(), SimdVector4::absolute4(), SimdVector3::cross(), SimdVector3::dot(), SimdQuaternion::dot(), getZ(), SimdQuaternion::inverse(), SimdVector3::lerp(), SimdVector3::maxAxis(), SimdVector4::maxAxis4(), SimdVector3::minAxis(), SimdVector4::minAxis4(), SimdVector3::operator *=(), SimdQuaternion::operator *=(), SimdVector3::operator+=(), SimdQuaternion::operator+=(), SimdVector3::operator-=(), SimdQuaternion::operator-=(), SimdVector3::setInterpolate3(), setMax(), setMin(), setValue(), setZ(), SimdQuaternion::slerp(), SimdVector3::triple(), and z().

The documentation for this class was generated from the following file:
  • SimdQuadWord.h
Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdQuadWord Member List

This is the complete list of members for SimdQuadWord, including all inherited members.

ATTRIBUTE_ALIGNED16(SimdScalar m_x) | SimdQuadWord | [protected]
getX() const | SimdQuadWord | [inline]
getY() const | SimdQuadWord | [inline]
getZ() const | SimdQuadWord | [inline]
m_unusedW | SimdQuadWord | [protected]
m_y | SimdQuadWord | [protected]
m_z | SimdQuadWord | [protected]
operator const SimdScalar *() const | SimdQuadWord | [inline]
operator SimdScalar *() | SimdQuadWord | [inline]
operator[](int i) | SimdQuadWord | [inline]
operator[](int i) const | SimdQuadWord | [inline]
setMax(const SimdQuadWord &other) | SimdQuadWord | [inline]
setMin(const SimdQuadWord &other) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
setX(float x) | SimdQuadWord | [inline]
setY(float y) | SimdQuadWord | [inline]
setZ(float z) | SimdQuadWord | [inline]
SimdQuadWord() | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
x() const | SimdQuadWord | [inline]
y() const | SimdQuadWord | [inline]
z() const | SimdQuadWord | [inline]

Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdQuaternion Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdQuaternion Class Reference

#include <SimdQuaternion.h>

Inheritance diagram for SimdQuaternion:

[legend]
Collaboration diagram for SimdQuaternion:

[legend]
List of all members.

Public Member Functions

SimdQuaternion ()
SimdQuaternion (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w)
SimdQuaternion (const SimdVector3 &axis, const SimdScalar &angle)
SimdQuaternion (const SimdScalar &yaw, const SimdScalar &pitch, const SimdScalar &roll)
void | setRotation (const SimdVector3 &axis, const SimdScalar &angle)
void | setEuler (const SimdScalar &yaw, const SimdScalar &pitch, const SimdScalar &roll)
SimdQuaternion & | operator+= (const SimdQuaternion &q)
SimdQuaternion & | operator-= (const SimdQuaternion &q)
SimdQuaternion & | operator *= (const SimdScalar &s)
SimdQuaternion & | operator *= (const SimdQuaternion &q)
SimdScalar | dot (const SimdQuaternion &q) const
SimdScalar | length2 () const
SimdScalar | length () const
SimdQuaternion & normalize ()
SIMD_FORCE_INLINE SimdQuaternion | operator * (const SimdScalar &s) const
SimdQuaternion | operator/ (const SimdScalar &s) const
SimdQuaternion & | operator/= (const SimdScalar &s)
SimdQuaternion | normalized () const
SimdScalar | angle (const SimdQuaternion &q) const
SimdScalar | getAngle () const
SimdQuaternion | inverse () const
SIMD_FORCE_INLINE SimdQuaternion | operator+ (const SimdQuaternion &q2) const
SIMD_FORCE_INLINE SimdQuaternion | operator- (const SimdQuaternion &q2) const
SIMD_FORCE_INLINE SimdQuaternion | operator- () const
SIMD_FORCE_INLINE SimdQuaternion | farthest (const SimdQuaternion &qd) const
SimdQuaternion | slerp (const SimdQuaternion &q, const SimdScalar &t) const

Detailed Description

Definition at line 22 of file SimdQuaternion.h.

Constructor & Destructor Documentation

SimdQuaternion::SimdQuaternion ( ) [inline]

Definition at line 24 of file SimdQuaternion.h.

Referenced by inverse(), operator *(), operator *(), operator+(), operator-(), operator-(), and slerp().

SimdQuaternion::SimdQuaternion | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z,
 |  | const SimdScalar & | w
 | ) | [inline]

Definition at line 29 of file SimdQuaternion.h.

SimdQuaternion::SimdQuaternion | ( | const SimdVector3 & | axis,
 |  | const SimdScalar & | angle
 | ) | [inline]

Definition at line 33 of file SimdQuaternion.h.

References setRotation().

SimdQuaternion::SimdQuaternion | ( | const SimdScalar & | yaw,
 |  | const SimdScalar & | pitch,
 |  | const SimdScalar & | roll
 | ) | [inline]

Definition at line 38 of file SimdQuaternion.h.

References setEuler().

Member Function Documentation

SimdScalar SimdQuaternion::angle ( const SimdQuaternion & q ) const [inline]

Definition at line 144 of file SimdQuaternion.h.

References dot(), length2(), SimdAcos(), and SimdSqrt().

Referenced by angle(), and slerp().

SimdScalar SimdQuaternion::dot ( const SimdQuaternion & q ) const [inline]

Definition at line 97 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, and SimdQuadWord::m_z.

Referenced by angle(), dot(), farthest(), and length2().

SIMD_FORCE_INLINE SimdQuaternion SimdQuaternion::farthest ( const SimdQuaternion & qd ) const [inline]

Definition at line 184 of file SimdQuaternion.h.

References dot().

Referenced by SimdTransformUtil::CalculateVelocity().

SimdScalar SimdQuaternion::getAngle ( ) const [inline]

Definition at line 151 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, and SimdAcos().

Referenced by SimdTransformUtil::CalculateVelocity().

SimdQuaternion SimdQuaternion::inverse ( ) const [inline]

Definition at line 159 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, SimdQuadWord::m_z, and SimdQuaternion().

Referenced by SimdTransformUtil::CalculateVelocity(), and inverse().

SimdScalar SimdQuaternion::length ( ) const [inline]

Definition at line 107 of file SimdQuaternion.h.

References length2(), and SimdSqrt().

Referenced by length(), normalize(), and normalized().

SimdScalar SimdQuaternion::length2 ( ) const [inline]

Definition at line 102 of file SimdQuaternion.h.

References dot().

Referenced by angle(), length(), and SimdMatrix3x3::setRotation().

SimdQuaternion& SimdQuaternion::normalize ( ) [inline]

Definition at line 112 of file SimdQuaternion.h.

References length().

Referenced by BU_Screwing::InBetweenTransform(), and SimdTransformUtil::IntegrateTransform().

SimdQuaternion SimdQuaternion::normalized ( ) const [inline]

Definition at line 139 of file SimdQuaternion.h.

References length().

SIMD_FORCE_INLINE SimdQuaternion SimdQuaternion::operator * ( const SimdScalar & s ) const [inline]

Definition at line 118 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdQuaternion& SimdQuaternion::operator *= ( const SimdQuaternion & q ) [inline]

Definition at line 88 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::setValue(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdQuaternion& SimdQuaternion::operator *= ( const SimdScalar & s ) [inline]

Definition at line 81 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, and SimdQuadWord::m_z.

SIMD_FORCE_INLINE SimdQuaternion SimdQuaternion::operator+ ( const SimdQuaternion & q2 ) const [inline]

Definition at line 165 of file SimdQuaternion.h.

References SIMD_FORCE_INLINE, SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdQuaternion& SimdQuaternion::operator+= ( const SimdQuaternion & q ) [inline]

Definition at line 69 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdQuaternion SimdQuaternion::operator- ( ) const [inline]

Definition at line 178 of file SimdQuaternion.h.

References SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdQuaternion SimdQuaternion::operator- ( const SimdQuaternion & q2 ) const [inline]

Definition at line 172 of file SimdQuaternion.h.

References SimdQuaternion(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdQuaternion& SimdQuaternion::operator-= ( const SimdQuaternion & q ) [inline]

Definition at line 75 of file SimdQuaternion.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SimdQuaternion SimdQuaternion::operator/ ( const SimdScalar & s ) const [inline]

Definition at line 125 of file SimdQuaternion.h.

SimdQuaternion& SimdQuaternion::operator/= ( const SimdScalar & s ) [inline]

Definition at line 132 of file SimdQuaternion.h.

void SimdQuaternion::setEuler | ( | const SimdScalar & | yaw,
 |  | const SimdScalar & | pitch,
 |  | const SimdScalar & | roll
 | ) | [inline]

Definition at line 52 of file SimdQuaternion.h.

References SimdQuadWord::setValue(), SimdCos(), and SimdSin().

Referenced by SimdQuaternion().

void SimdQuaternion::setRotation | ( | const SimdVector3 & | axis,
 |  | const SimdScalar & | angle
 | ) | [inline]

Definition at line 43 of file SimdQuaternion.h.

References SimdVector3::length(), SimdQuadWord::setValue(), SimdCos(), SimdSin(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by SimdQuaternion().

SimdQuaternion SimdQuaternion::slerp | ( | const SimdQuaternion & | q,
 |  | const SimdScalar & | t
 | ) | const [inline]

Definition at line 194 of file SimdQuaternion.h.

References angle(), SimdQuadWord::m_unusedW, SimdQuadWord::m_y, SimdQuadWord::m_z, SIMD_FORCE_INLINE, SimdQuaternion(), SimdSin(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by slerp().

The documentation for this class was generated from the following file:
  • SimdQuaternion.h
Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdQuaternion Member List

This is the complete list of members for SimdQuaternion, including all inherited members.

angle(const SimdQuaternion &q) const | SimdQuaternion | [inline]
ATTRIBUTE_ALIGNED16(SimdScalar m_x) | SimdQuadWord | [protected]
dot(const SimdQuaternion &q) const | SimdQuaternion | [inline]
farthest(const SimdQuaternion &qd) const | SimdQuaternion | [inline]
getAngle() const | SimdQuaternion | [inline]
getX() const | SimdQuadWord | [inline]
getY() const | SimdQuadWord | [inline]
getZ() const | SimdQuadWord | [inline]
inverse() const | SimdQuaternion | [inline]
length() const | SimdQuaternion | [inline]
length2() const | SimdQuaternion | [inline]
m_unusedW | SimdQuadWord | [protected]
m_y | SimdQuadWord | [protected]
m_z | SimdQuadWord | [protected]
normalize() | SimdQuaternion | [inline]
normalized() const | SimdQuaternion | [inline]
operator *(const SimdScalar &s) const | SimdQuaternion | [inline]
operator *=(const SimdScalar &s) | SimdQuaternion | [inline]
operator *=(const SimdQuaternion &q) | SimdQuaternion | [inline]
operator const SimdScalar *() const | SimdQuadWord | [inline]
operator SimdScalar *() | SimdQuadWord | [inline]
operator+(const SimdQuaternion &q2) const | SimdQuaternion | [inline]
operator+=(const SimdQuaternion &q) | SimdQuaternion | [inline]
operator-(const SimdQuaternion &q2) const | SimdQuaternion | [inline]
operator-() const | SimdQuaternion | [inline]
operator-=(const SimdQuaternion &q) | SimdQuaternion | [inline]
operator/(const SimdScalar &s) const | SimdQuaternion | [inline]
operator/=(const SimdScalar &s) | SimdQuaternion | [inline]
operator[](int i) | SimdQuadWord | [inline]
operator[](int i) const | SimdQuadWord | [inline]
setEuler(const SimdScalar &yaw, const SimdScalar &pitch, const SimdScalar &roll) | SimdQuaternion | [inline]
setMax(const SimdQuadWord &other) | SimdQuadWord | [inline]
setMin(const SimdQuadWord &other) | SimdQuadWord | [inline]
setRotation(const SimdVector3 &axis, const SimdScalar &angle) | SimdQuaternion | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
setX(float x) | SimdQuadWord | [inline]
setY(float y) | SimdQuadWord | [inline]
setZ(float z) | SimdQuadWord | [inline]
SimdQuadWord() | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
SimdQuaternion() | SimdQuaternion | [inline]
SimdQuaternion(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuaternion | [inline]
SimdQuaternion(const SimdVector3 &axis, const SimdScalar &angle) | SimdQuaternion | [inline]
SimdQuaternion(const SimdScalar &yaw, const SimdScalar &pitch, const SimdScalar &roll) | SimdQuaternion | [inline]
slerp(const SimdQuaternion &q, const SimdScalar &t) const | SimdQuaternion | [inline]
x() const | SimdQuadWord | [inline]
y() const | SimdQuadWord | [inline]
z() const | SimdQuadWord | [inline]

Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdTransform Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdTransform Class Reference

#include <SimdTransform.h>

Collaboration diagram for SimdTransform:

[legend]
List of all members.

Public Member Functions

SimdTransform ()
SIMD_FORCE_INLINE | SimdTransform (const SimdQuaternion &q, const SimdVector3 &c=SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0)))
SIMD_FORCE_INLINE | SimdTransform (const SimdMatrix3x3 &b, const SimdVector3 &c=SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0)), unsigned int type=AFFINE)
SIMD_FORCE_INLINE void | mult (const SimdTransform &t1, const SimdTransform &t2)
void | multInverseLeft (const SimdTransform &t1, const SimdTransform &t2)
SIMD_FORCE_INLINE SimdVector3 | operator() (const SimdVector3 &x) const
SIMD_FORCE_INLINE SimdVector3 | operator * (const SimdVector3 &x) const
SIMD_FORCE_INLINE SimdMatrix3x3 & | getBasis ()
SIMD_FORCE_INLINE const SimdMatrix3x3 & | getBasis () const
SIMD_FORCE_INLINE SimdVector3 & | getOrigin ()
SIMD_FORCE_INLINE const SimdVector3 & | getOrigin () const
SimdQuaternion | getRotation () const
template<typename Scalar2>
void | setValue (const Scalar2 *m)
void | setFromOpenGLMatrix (const SimdScalar *m)
void | getOpenGLMatrix (SimdScalar *m) const
SIMD_FORCE_INLINE void | setOrigin (const SimdVector3 &origin)
SIMD_FORCE_INLINE SimdVector3 | invXform (const SimdVector3 &inVec) const
SIMD_FORCE_INLINE void | setBasis (const SimdMatrix3x3 &basis)
SIMD_FORCE_INLINE void | setRotation (const SimdQuaternion &q)
SIMD_FORCE_INLINE void | scale (const SimdVector3 &scaling)
void | setIdentity ()
SIMD_FORCE_INLINE bool | isIdentity () const
SimdTransform & | operator *= (const SimdTransform &t)
SimdTransform | inverse () const
SimdTransform | inverseTimes (const SimdTransform &t) const
SimdTransform | operator * (const SimdTransform &t) const

Private Types

enum {
TRANSLATION = 0x01,
ROTATION = 0x02,
RIGID = TRANSLATION | ROTATION,
SCALING = 0x04,
LINEAR = ROTATION | SCALING,
AFFINE = TRANSLATION | LINEAR
}

Private Attributes

SimdMatrix3x3 m_basis
SimdVector3 m_origin
unsigned int | m_type

Detailed Description

Definition at line 25 of file SimdTransform.h.

Member Enumeration Documentation

anonymous enum [private]

Enumerator:
TRANSLATION
ROTATION
RIGID
SCALING
LINEAR
AFFINE

Definition at line 26 of file SimdTransform.h.

Constructor & Destructor Documentation

SimdTransform::SimdTransform ( ) [inline]

Definition at line 36 of file SimdTransform.h.

Referenced by inverse(), inverseTimes(), and operator *().

SIMD_FORCE_INLINE SimdTransform::SimdTransform | ( | const SimdQuaternion & | q,
 |  | const SimdVector3 & | c = SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0))
 | ) | [inline, explicit]

Definition at line 41 of file SimdTransform.h.

SIMD_FORCE_INLINE SimdTransform::SimdTransform | ( | const SimdMatrix3x3 & | b,
 |  | const SimdVector3 & | c = SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0)),
 |  | unsigned int | type = AFFINE
 | ) | [inline, explicit]

Definition at line 48 of file SimdTransform.h.

Member Function Documentation

SIMD_FORCE_INLINE const SimdMatrix3x3& SimdTransform::getBasis ( ) const [inline]

Definition at line 90 of file SimdTransform.h.

References m_basis.

SIMD_FORCE_INLINE SimdMatrix3x3& SimdTransform::getBasis ( ) [inline]

Definition at line 89 of file SimdTransform.h.

References m_basis.

Referenced by CollisionWorld::ClosestRayResultCallback::AddSingleResult(), CcdPhysicsController::ApplyForce(), CcdPhysicsController::ApplyTorque(), Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), MinkowskiPenetrationDepthSolver::CalcPenDepth(), SubsimplexConvexCast::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), SimdTransformUtil::CalculateVelocity(), CcdPhysicsEnvironment::createConstraint(), TriangleMeshShape::GetAabb(), BoxShape::GetAabb(), ConvexShape::GetAabbSlow(), BU_StaticMotionState::GetBasis(), RigidBody::getOrientation(), BU_Screwing::InBetweenTransform(), Epa::Initialize(), MinkowskiSumShape::LocalGetSupportingVertexWithoutMargin(), CcdPhysicsController::RelativeRotate(), CcdPhysicsController::RelativeTranslate(), resolveSingleBilateral(), CcdPhysicsController::SetAngularVelocity(), CcdPhysicsController::SetLinearVelocity(), SimpleConstraintSolver::Solve(), HingeConstraint::SolveConstraint(), SupportVertexCallback::SupportVertexCallback(), and RigidBody::updateInertiaTensor().

void SimdTransform::getOpenGLMatrix ( SimdScalar * m ) const [inline]

Definition at line 117 of file SimdTransform.h.

References SimdMatrix3x3::getOpenGLSubMatrix(), m_basis, and m_origin.

SIMD_FORCE_INLINE const SimdVector3& SimdTransform::getOrigin ( ) const [inline]

Definition at line 93 of file SimdTransform.h.

References m_origin.

SIMD_FORCE_INLINE SimdVector3& SimdTransform::getOrigin ( ) [inline]

Definition at line 92 of file SimdTransform.h.

References m_origin.

Referenced by MinkowskiPenetrationDepthSolver::CalcPenDepth(), SubsimplexConvexCast::calcTimeOfImpact(), GjkConvexCast::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), ConvexConvexAlgorithm::CalculateTimeOfImpact(), ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), SimdTransformUtil::CalculateVelocity(), SphereShape::GetAabb(), EmptyShape::GetAabb(), BoxShape::GetAabb(), RigidBody::getCenterOfMassPosition(), CcdPhysicsController::getPosition(), BU_StaticMotionState::GetPosition(), DefaultMotionState::getWorldPosition(), BU_Screwing::InBetweenTransform(), SimdTransformUtil::IntegrateTransform(), CcdPhysicsController::RelativeTranslate(), and RigidBody::translate().

SimdQuaternion SimdTransform::getRotation ( ) const [inline]

Definition at line 95 of file SimdTransform.h.

References SimdMatrix3x3::getRotation(), and m_basis.

Referenced by BU_CollisionPair::calcTimeOfImpact(), SimdTransformUtil::CalculateVelocity(), CcdPhysicsController::getOrientation(), BU_StaticMotionState::GetOrientation(), DefaultMotionState::getWorldOrientation(), and SimdTransformUtil::IntegrateTransform().

SimdTransform SimdTransform::inverse ( ) const [inline]

Definition at line 171 of file SimdTransform.h.

References SimdMatrix3x3::inverse(), m_basis, m_origin, m_type, SCALING, SimdTransform(), and SimdMatrix3x3::transpose().

Referenced by ManifoldResult::AddContactPoint(), SubsimplexConvexCast::calcTimeOfImpact(), GjkConvexCast::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), CcdPhysicsEnvironment::createConstraint(), ManifoldContactAddResult::ManifoldContactAddResult(), and BoxTriangleCallback::SetTimeStepAndCounters().

SIMD_FORCE_INLINE SimdTransform SimdTransform::inverseTimes ( const SimdTransform & t ) const

Definition at line 205 of file SimdTransform.h.

References SimdMatrix3x3::inverse(), m_basis, m_type, SCALING, SIMD_FORCE_INLINE, SimdTransform(), and SimdMatrix3x3::transposeTimes().

Referenced by ContinuousConvexCollision::calcTimeOfImpact().

SIMD_FORCE_INLINE SimdVector3 SimdTransform::invXform ( const SimdVector3 & inVec ) const

Definition at line 198 of file SimdTransform.h.

References m_basis, m_origin, SIMD_FORCE_INLINE, and SimdMatrix3x3::transpose().

SIMD_FORCE_INLINE bool SimdTransform::isIdentity ( ) const [inline]

Definition at line 161 of file SimdTransform.h.

References m_type.

SIMD_FORCE_INLINE void SimdTransform::mult | ( | const SimdTransform & | t1,
 |  | const SimdTransform & | t2
 | ) | [inline]

Definition at line 57 of file SimdTransform.h.

References m_basis, m_origin, and m_type.

void SimdTransform::multInverseLeft | ( | const SimdTransform & | t1,
 |  | const SimdTransform & | t2
 | ) | [inline]

Definition at line 63 of file SimdTransform.h.

References SimdMatrix3x3::inverse(), m_basis, m_origin, m_type, SCALING, and SimdMultTransposeLeft().

SIMD_FORCE_INLINE SimdTransform SimdTransform::operator * ( const SimdTransform & t ) const

Definition at line 222 of file SimdTransform.h.

References m_type, and SimdTransform().

SIMD_FORCE_INLINE SimdVector3 SimdTransform::operator * ( const SimdVector3 & x ) const [inline]

Definition at line 84 of file SimdTransform.h.

SimdTransform& SimdTransform::operator *= ( const SimdTransform & t ) [inline]

Definition at line 163 of file SimdTransform.h.

References m_basis, m_origin, and m_type.

SIMD_FORCE_INLINE SimdVector3 SimdTransform::operator() ( const SimdVector3 & x ) const [inline]

Definition at line 77 of file SimdTransform.h.

References dot(), m_basis, and m_origin.

SIMD_FORCE_INLINE void SimdTransform::scale ( const SimdVector3 & scaling ) [inline]

Definition at line 148 of file SimdTransform.h.

References m_basis, m_type, SimdMatrix3x3::scaled(), and SCALING.

SIMD_FORCE_INLINE void SimdTransform::setBasis ( const SimdMatrix3x3 & basis ) [inline]

Definition at line 136 of file SimdTransform.h.

References LINEAR, m_basis, and m_type.

Referenced by BU_Screwing::LocalMatrix(), CcdPhysicsController::RelativeRotate(), and BU_StaticMotionState::SetBasis().

void SimdTransform::setFromOpenGLMatrix ( const SimdScalar * m ) [inline]

Definition at line 109 of file SimdTransform.h.

References m_basis, m_origin, and SimdMatrix3x3::setFromOpenGLSubMatrix().

void SimdTransform::setIdentity ( ) [inline]

Definition at line 154 of file SimdTransform.h.

References m_basis, m_origin, m_type, SimdMatrix3x3::setIdentity(), and SimdQuadWord::setValue().

Referenced by GjkConvexCast::calcTimeOfImpact(), ContinuousConvexCollision::calcTimeOfImpact(), PolyhedralConvexShape::CalculateLocalInertia(), MultiSphereShape::CalculateLocalInertia(), ConeShape::CalculateLocalInertia(), CcdPhysicsEnvironment::CreateConeController(), CcdPhysicsEnvironment::CreateSphereController(), DefaultMotionState::DefaultMotionState(), CollisionShape::GetBoundingSphere(), TriangleMeshShape::LocalGetSupportingVertex(), MinkowskiSumShape::MinkowskiSumShape(), CollisionWorld::RayTest(), and RigidBody::RigidBody().

SIMD_FORCE_INLINE void SimdTransform::setOrigin ( const SimdVector3 & origin ) [inline]

Definition at line 126 of file SimdTransform.h.

References m_origin, m_type, and TRANSLATION.

Referenced by MinkowskiPenetrationDepthSolver::CalcPenDepth(), GjkConvexCast::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), CcdPhysicsEnvironment::CreateSphereController(), CcdPhysicsController::GetTransformFromMotionState(), SimdTransformUtil::IntegrateTransform(), BU_Screwing::LocalMatrix(), CollisionWorld::RayTest(), CcdPhysicsController::RelativeTranslate(), CcdPhysicsController::setPosition(), BU_StaticMotionState::SetPosition(), and DefaultMotionState::setWorldPosition().

SIMD_FORCE_INLINE void SimdTransform::setRotation ( const SimdQuaternion & q ) [inline]

Definition at line 142 of file SimdTransform.h.

References LINEAR, m_basis, m_type, ROTATION, and SimdMatrix3x3::setRotation().

Referenced by BU_CollisionPair::calcTimeOfImpact(), CcdPhysicsController::GetTransformFromMotionState(), SimdTransformUtil::IntegrateTransform(), CcdPhysicsController::setOrientation(), BU_StaticMotionState::SetOrientation(), and DefaultMotionState::setWorldOrientation().

template<typename Scalar2>
void SimdTransform::setValue ( const Scalar2 * m ) [inline]

Definition at line 101 of file SimdTransform.h.

References AFFINE, m_basis, m_origin, m_type, SimdQuadWord::setValue(), and SimdMatrix3x3::setValue().

Member Data Documentation

SimdMatrix3x3 SimdTransform::m_basis [private]

Definition at line 191 of file SimdTransform.h.

Referenced by getBasis(), getOpenGLMatrix(), getRotation(), inverse(), inverseTimes(), invXform(), mult(), multInverseLeft(), operator *=(), operator()(), scale(), setBasis(), setFromOpenGLMatrix(), setIdentity(), setRotation(), and setValue().

SimdVector3 SimdTransform::m_origin [private]

Definition at line 192 of file SimdTransform.h.

Referenced by getOpenGLMatrix(), getOrigin(), inverse(), invXform(), mult(), multInverseLeft(), operator *=(), operator()(), setFromOpenGLMatrix(), setIdentity(), setOrigin(), and setValue().

unsigned int SimdTransform::m_type [private]

Definition at line 193 of file SimdTransform.h.

Referenced by inverse(), inverseTimes(), isIdentity(), mult(), multInverseLeft(), operator *(), operator *=(), scale(), setBasis(), setIdentity(), setOrigin(), setRotation(), and setValue().

The documentation for this class was generated from the following file:
  • SimdTransform.h
Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdTransform Member List

This is the complete list of members for SimdTransform, including all inherited members.

AFFINE enum value | SimdTransform | [private]
getBasis() | SimdTransform | [inline]
getBasis() const | SimdTransform | [inline]
getOpenGLMatrix(SimdScalar *m) const | SimdTransform | [inline]
getOrigin() | SimdTransform | [inline]
getOrigin() const | SimdTransform | [inline]
getRotation() const | SimdTransform | [inline]
inverse() const | SimdTransform | [inline]
inverseTimes(const SimdTransform &t) const | SimdTransform |
invXform(const SimdVector3 &inVec) const | SimdTransform |
isIdentity() const | SimdTransform | [inline]
LINEAR enum value | SimdTransform | [private]
m_basis | SimdTransform | [private]
m_origin | SimdTransform | [private]
m_type | SimdTransform | [private]
mult(const SimdTransform &t1, const SimdTransform &t2) | SimdTransform | [inline]
multInverseLeft(const SimdTransform &t1, const SimdTransform &t2) | SimdTransform | [inline]
operator *(const SimdVector3 &x) const | SimdTransform | [inline]
operator *(const SimdTransform &t) const | SimdTransform |
operator *=(const SimdTransform &t) | SimdTransform | [inline]
operator()(const SimdVector3 &x) const | SimdTransform | [inline]
RIGID enum value | SimdTransform | [private]
ROTATION enum value | SimdTransform | [private]
scale(const SimdVector3 &scaling) | SimdTransform | [inline]
SCALING enum value | SimdTransform | [private]
setBasis(const SimdMatrix3x3 &basis) | SimdTransform | [inline]
setFromOpenGLMatrix(const SimdScalar *m) | SimdTransform | [inline]
setIdentity() | SimdTransform | [inline]
setOrigin(const SimdVector3 &origin) | SimdTransform | [inline]
setRotation(const SimdQuaternion &q) | SimdTransform | [inline]
setValue(const Scalar2 *m) | SimdTransform | [inline]
SimdTransform() | SimdTransform | [inline]
SimdTransform(const SimdQuaternion &q, const SimdVector3 &c=SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0))) | SimdTransform | [inline, explicit]
SimdTransform(const SimdMatrix3x3 &b, const SimdVector3 &c=SimdVector3(SimdScalar(0), SimdScalar(0), SimdScalar(0)), unsigned int type=AFFINE) | SimdTransform | [inline, explicit]
TRANSLATION enum value | SimdTransform | [private]

Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdTransformUtil Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdTransformUtil Class Reference

Utils related to temporal transforms. More...

#include <SimdTransformUtil.h>

List of all members.

Static Public Member Functions

static void | IntegrateTransform (const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdTransform &predictedTransform)
static void | CalculateVelocity (const SimdTransform &transform0, const SimdTransform &transform1, SimdScalar timeStep, SimdVector3 &linVel, SimdVector3 &angVel)

Detailed Description

Utils related to temporal transforms.

Definition at line 60 of file SimdTransformUtil.h.

Member Function Documentation

static void SimdTransformUtil::CalculateVelocity | ( | const SimdTransform & | transform0,
 |  | const SimdTransform & | transform1,
 |  | SimdScalar | timeStep,
 |  | SimdVector3 & | linVel,
 |  | SimdVector3 & | angVel
 | ) | [inline, static]

Definition at line 101 of file SimdTransformUtil.h.

References angle(), SimdQuaternion::farthest(), SimdQuaternion::getAngle(), SimdTransform::getBasis(), SimdTransform::getOrigin(), SimdMatrix3x3::getRotation(), SimdTransform::getRotation(), SimdMatrix3x3::inverse(), SimdQuaternion::inverse(), SimdVector3::length2(), SIMD_EPSILON, SimdSqrt(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by ContinuousConvexCollision::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), and RigidBody::saveKinematicState().

static void SimdTransformUtil::IntegrateTransform | ( | const SimdTransform & | curTrans,
 |  | const SimdVector3 & | linvel,
 |  | const SimdVector3 & | angvel,
 |  | SimdScalar | timeStep,
 |  | SimdTransform & | predictedTransform
 | ) | [inline, static]

Definition at line 65 of file SimdTransformUtil.h.

References ANGULAR_MOTION_TRESHOLD, SimdTransform::getOrigin(), SimdTransform::getRotation(), SimdVector3::length(), SimdQuaternion::normalize(), SimdTransform::setOrigin(), SimdTransform::setRotation(), SimdCos(), SimdSin(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by ContinuousConvexCollision::calcTimeOfImpact(), and RigidBody::predictIntegratedTransform().

The documentation for this class was generated from the following file:
  • SimdTransformUtil.h
Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdTransformUtil Member List

This is the complete list of members for SimdTransformUtil, including all inherited members.

CalculateVelocity(const SimdTransform &transform0, const SimdTransform &transform1, SimdScalar timeStep, SimdVector3 &linVel, SimdVector3 &angVel) | SimdTransformUtil | [inline, static]
IntegrateTransform(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdTransform &predictedTransform) | SimdTransformUtil | [inline, static]

Generated on Wed May 24 14:00:30 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdVector3 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdVector3 Class Reference

SimdVector3 is 16byte aligned, and has an extra unused component m_w this extra component can be used by derived classes (Quaternion?) or by user. More...

#include <SimdVector3.h>

Inheritance diagram for SimdVector3:

[legend]
Collaboration diagram for SimdVector3:

[legend]
List of all members.

Public Member Functions

SIMD_FORCE_INLINE | SimdVector3 ()
SIMD_FORCE_INLINE | SimdVector3 (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z)
SIMD_FORCE_INLINE SimdVector3 & | operator+= (const SimdVector3 &v)
SIMD_FORCE_INLINE SimdVector3 & | operator-= (const SimdVector3 &v)
SIMD_FORCE_INLINE SimdVector3 & | operator *= (const SimdScalar &s)
SIMD_FORCE_INLINE SimdVector3 & | operator/= (const SimdScalar &s)
SIMD_FORCE_INLINE SimdScalar | dot (const SimdVector3 &v) const
SIMD_FORCE_INLINE SimdScalar | length2 () const
SIMD_FORCE_INLINE SimdScalar | length () const
SIMD_FORCE_INLINE SimdScalar | distance2 (const SimdVector3 &v) const
SIMD_FORCE_INLINE SimdScalar | distance (const SimdVector3 &v) const
SIMD_FORCE_INLINE SimdVector3 & | normalize ()
SIMD_FORCE_INLINE SimdVector3 | normalized () const
SIMD_FORCE_INLINE SimdVector3 | rotate (const SimdVector3 &wAxis, const SimdScalar angle)
SIMD_FORCE_INLINE SimdScalar | angle (const SimdVector3 &v) const
SIMD_FORCE_INLINE SimdVector3 | absolute () const
SIMD_FORCE_INLINE SimdVector3 | cross (const SimdVector3 &v) const
SIMD_FORCE_INLINE SimdScalar | triple (const SimdVector3 &v1, const SimdVector3 &v2) const
SIMD_FORCE_INLINE int | minAxis () const
SIMD_FORCE_INLINE int | maxAxis () const
SIMD_FORCE_INLINE int | furthestAxis () const
SIMD_FORCE_INLINE int | closestAxis () const
SIMD_FORCE_INLINE void | setInterpolate3 (const SimdVector3 &v0, const SimdVector3 &v1, SimdScalar rt)
SIMD_FORCE_INLINE SimdVector3 | lerp (const SimdVector3 &v, const SimdScalar &t) const
SIMD_FORCE_INLINE SimdVector3 & | operator *= (const SimdVector3 &v)

Detailed Description

SimdVector3 is 16byte aligned, and has an extra unused component m_w this extra component can be used by derived classes (Quaternion?) or by user.

Definition at line 25 of file SimdVector3.h.

Constructor & Destructor Documentation

SIMD_FORCE_INLINE SimdVector3::SimdVector3 ( ) [inline]

Definition at line 29 of file SimdVector3.h.

Referenced by absolute(), cross(), lerp(), operator *(), operator+(), operator-(), and operator/().

SIMD_FORCE_INLINE SimdVector3::SimdVector3 | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z
 | ) | [inline]

Definition at line 33 of file SimdVector3.h.

Member Function Documentation

SIMD_FORCE_INLINE SimdVector3 SimdVector3::absolute ( ) const [inline]

Definition at line 106 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdFabs(), and SimdVector3().

Referenced by closestAxis(), and furthestAxis().

SIMD_FORCE_INLINE SimdScalar SimdVector3::angle ( const SimdVector3 & v ) const [inline]

Definition at line 99 of file SimdVector3.h.

References dot(), length2(), SimdAcos(), and SimdSqrt().

Referenced by angle().

SIMD_FORCE_INLINE int SimdVector3::closestAxis ( ) const [inline]

Definition at line 144 of file SimdVector3.h.

References absolute(), and maxAxis().

SIMD_FORCE_INLINE SimdVector3 SimdVector3::cross ( const SimdVector3 & v ) const [inline]

Definition at line 114 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by RigidBody::applyForce(), RigidBody::applyImpulse(), BU_Screwing::BU_Screwing(), EpaPolyhedron::Create(), cross(), RigidBody::getVelocityInLocalPoint(), Epa::Initialize(), TriangleShape::IsInside(), JacobianEntry::JacobianEntry(), TriangleRaycastCallback::ProcessTriangle(), rotate(), HingeConstraint::SolveConstraint(), and PersistentManifold::SortCachedPoints().

SIMD_FORCE_INLINE SimdScalar SimdVector3::distance ( const SimdVector3 & v ) const

Definition at line 282 of file SimdVector3.h.

Referenced by distance().

SIMD_FORCE_INLINE SimdScalar SimdVector3::distance2 ( const SimdVector3 & v ) const

Definition at line 277 of file SimdVector3.h.

Referenced by distance2().

SIMD_FORCE_INLINE SimdScalar SimdVector3::dot ( const SimdVector3 & v ) const [inline]

Definition at line 71 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by angle(), TriangleShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), PolyhedralConvexShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), MultiSphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), ConvexHullShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), BU_Screwing::BU_Screwing(), BU_EdgeEdge::Calc2DRotationPointPoint(), MinkowskiPenetrationDepthSolver::CalcPenDepth(), Epa::CalcPenDepth(), SubsimplexConvexCast::calcTimeOfImpact(), GjkConvexCast::calcTimeOfImpact(), VoronoiSimplexSolver::ClosestPtPointTriangle(), RigidBody::ComputeAngularImpulseDenominator(), RigidBody::ComputeImpulseDenominator(), EpaPolyhedron::DeleteVisibleFaces(), dot(), GjkPairDetector::GetClosestPoints(), JacobianEntry::getNonDiagonal(), BU_VertexPoly::GetTimeOfImpact(), EpaFace::Initialize(), Epa::Initialize(), TriangleShape::IsInside(), JacobianEntry::JacobianEntry(), length2(), TriangleShape::LocalGetSupportingVertexWithoutMargin(), PolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(), MultiSphereShape::LocalGetSupportingVertexWithoutMargin(), ConvexHullShape::LocalGetSupportingVertexWithoutMargin(), SupportVertexCallback::ProcessTriangle(), TriangleRaycastCallback::ProcessTriangle(), PersistentManifold::RefreshContactPoints(), Solve2LinearConstraint::resolveBilateralPairConstraint(), resolveSingleCollision(), resolveSingleFriction(), Solve2LinearConstraint::resolveUnilateralPairConstraint(), rotate(), Point2PointConstraint::SolveConstraint(), HingeConstraint::SolveConstraint(), Epa::TetrahedronContainsOrigin(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

SIMD_FORCE_INLINE int SimdVector3::furthestAxis ( ) const [inline]

Definition at line 139 of file SimdVector3.h.

References absolute(), and minAxis().

SIMD_FORCE_INLINE SimdScalar SimdVector3::length ( ) const [inline]

Definition at line 81 of file SimdVector3.h.

References length2(), and SimdSqrt().

Referenced by RigidBody::applyForces(), Epa::CalcPenDepth(), ContinuousConvexCollision::calcTimeOfImpact(), BU_CollisionPair::calcTimeOfImpact(), CollisionShape::CalculateTemporalAabb(), SimdTransformUtil::IntegrateTransform(), RigidBody::integrateVelocities(), normalize(), normalized(), OptimizedBvh::ReportAabbOverlappingNodex(), Solve2LinearConstraint::resolveBilateralPairConstraint(), Solve2LinearConstraint::resolveUnilateralPairConstraint(), SimdQuaternion::setRotation(), and HingeConstraint::SolveConstraint().

SIMD_FORCE_INLINE SimdScalar SimdVector3::length2 ( ) const [inline]

Definition at line 76 of file SimdVector3.h.

References dot().

Referenced by angle(), CcdPhysicsController::applyImpulse(), EpaFace::CalcClosestPoint(), Epa::CalcPenDepth(), SimdTransformUtil::CalculateVelocity(), GjkPairDetector::GetClosestPoints(), EpaFace::Initialize(), Epa::Initialize(), length(), PolyhedralConvexShape::LocalGetSupportingVertexWithoutMargin(), MultiSphereShape::LocalGetSupportingVertexWithoutMargin(), ConvexHullShape::LocalGetSupportingVertexWithoutMargin(), VoronoiSimplexSolver::maxVertex(), TriangleRaycastCallback::ProcessTriangle(), resolveSingleBilateral(), CcdPhysicsController::SetAngularVelocity(), CcdPhysicsController::SetLinearVelocity(), PersistentManifold::SortCachedPoints(), and CcdPhysicsController::UpdateDeactivation().

SIMD_FORCE_INLINE SimdVector3 SimdVector3::lerp | ( | const SimdVector3 & | v,
 |  | const SimdScalar & | t
 | ) | const [inline]

Definition at line 159 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdVector3(), SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by lerp().

SIMD_FORCE_INLINE int SimdVector3::maxAxis ( ) const [inline]

Definition at line 134 of file SimdVector3.h.

References SimdQuadWord::m_y, and SimdQuadWord::m_z.

Referenced by TriangleShape::BatchedUnitVectorGetSupportingVertexWithoutMargin(), OptimizedBvh::CalcSplittingAxis(), closestAxis(), and TriangleShape::LocalGetSupportingVertexWithoutMargin().

SIMD_FORCE_INLINE int SimdVector3::minAxis ( ) const [inline]

Definition at line 129 of file SimdVector3.h.

References SimdQuadWord::m_y, and SimdQuadWord::m_z.

Referenced by furthestAxis().

SIMD_FORCE_INLINE SimdVector3& SimdVector3::normalize ( ) [inline]

Definition at line 90 of file SimdVector3.h.

References length().

Referenced by BU_Screwing::BU_Screwing(), TriangleShape::CalcNormal(), EpaPolyhedron::Create(), Epa::Initialize(), TriangleShape::IsInside(), SphereShape::LocalGetSupportingVertex(), CylinderShape::LocalGetSupportingVertex(), ConvexShape::LocalGetSupportingVertex(), ConvexHullShape::LocalGetSupportingVertex(), ConeShape::LocalGetSupportingVertex(), and BoxShape::LocalGetSupportingVertex().

SIMD_FORCE_INLINE SimdVector3 SimdVector3::normalized ( ) const

Definition at line 287 of file SimdVector3.h.

References length().

Referenced by RigidBody::applyForces(), and HingeConstraint::SolveConstraint().

SIMD_FORCE_INLINE SimdVector3& SimdVector3::operator *= ( const SimdVector3 & v ) [inline]

Definition at line 167 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3& SimdVector3::operator *= ( const SimdScalar & s ) [inline]

Definition at line 59 of file SimdVector3.h.

References SimdQuadWord::m_y, and SimdQuadWord::m_z.

SIMD_FORCE_INLINE SimdVector3& SimdVector3::operator+= ( const SimdVector3 & v ) [inline]

Definition at line 45 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3& SimdVector3::operator-= ( const SimdVector3 & v ) [inline]

Definition at line 53 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

SIMD_FORCE_INLINE SimdVector3& SimdVector3::operator/= ( const SimdScalar & s ) [inline]

Definition at line 65 of file SimdVector3.h.

SIMD_FORCE_INLINE SimdVector3 SimdVector3::rotate | ( | const SimdVector3 & | wAxis,
 |  | const SimdScalar | angle
 | ) |

Definition at line 292 of file SimdVector3.h.

References cross(), dot(), SimdCos(), SimdSin(), SimdQuadWord::x(), and SimdQuadWord::y().

Referenced by Epa::Initialize().

SIMD_FORCE_INLINE void SimdVector3::setInterpolate3 | ( | const SimdVector3 & | v0,
 |  | const SimdVector3 & | v1,
 |  | SimdScalar | rt
 | ) | [inline]

Definition at line 149 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by CollisionWorld::ClosestRayResultCallback::AddSingleResult(), and TriangleRaycastCallback::ProcessTriangle().

SIMD_FORCE_INLINE SimdScalar SimdVector3::triple | ( | const SimdVector3 & | v1,
 |  | const SimdVector3 & | v2
 | ) | const [inline]

Definition at line 122 of file SimdVector3.h.

References SimdQuadWord::m_y, SimdQuadWord::m_z, SimdQuadWord::x(), SimdQuadWord::y(), and SimdQuadWord::z().

Referenced by triple().

The documentation for this class was generated from the following file:
  • SimdVector3.h
Generated on Wed May 24 14:00:31 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdVector3 Member List

This is the complete list of members for SimdVector3, including all inherited members.

absolute() const | SimdVector3 | [inline]
angle(const SimdVector3 &v) const | SimdVector3 | [inline]
ATTRIBUTE_ALIGNED16(SimdScalar m_x) | SimdQuadWord | [protected]
closestAxis() const | SimdVector3 | [inline]
cross(const SimdVector3 &v) const | SimdVector3 | [inline]
distance(const SimdVector3 &v) const | SimdVector3 |
distance2(const SimdVector3 &v) const | SimdVector3 |
dot(const SimdVector3 &v) const | SimdVector3 | [inline]
furthestAxis() const | SimdVector3 | [inline]
getX() const | SimdQuadWord | [inline]
getY() const | SimdQuadWord | [inline]
getZ() const | SimdQuadWord | [inline]
length() const | SimdVector3 | [inline]
length2() const | SimdVector3 | [inline]
lerp(const SimdVector3 &v, const SimdScalar &t) const | SimdVector3 | [inline]
m_unusedW | SimdQuadWord | [protected]
m_y | SimdQuadWord | [protected]
m_z | SimdQuadWord | [protected]
maxAxis() const | SimdVector3 | [inline]
minAxis() const | SimdVector3 | [inline]
normalize() | SimdVector3 | [inline]
normalized() const | SimdVector3 |
operator *=(const SimdScalar &s) | SimdVector3 | [inline]
operator *=(const SimdVector3 &v) | SimdVector3 | [inline]
operator const SimdScalar *() const | SimdQuadWord | [inline]
operator SimdScalar *() | SimdQuadWord | [inline]
operator+=(const SimdVector3 &v) | SimdVector3 | [inline]
operator-=(const SimdVector3 &v) | SimdVector3 | [inline]
operator/=(const SimdScalar &s) | SimdVector3 | [inline]
operator[](int i) | SimdQuadWord | [inline]
operator[](int i) const | SimdQuadWord | [inline]
rotate(const SimdVector3 &wAxis, const SimdScalar angle) | SimdVector3 |
setInterpolate3(const SimdVector3 &v0, const SimdVector3 &v1, SimdScalar rt) | SimdVector3 | [inline]
setMax(const SimdQuadWord &other) | SimdQuadWord | [inline]
setMin(const SimdQuadWord &other) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
setX(float x) | SimdQuadWord | [inline]
setY(float y) | SimdQuadWord | [inline]
setZ(float z) | SimdQuadWord | [inline]
SimdQuadWord() | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
SimdVector3() | SimdVector3 | [inline]
SimdVector3(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdVector3 | [inline]
triple(const SimdVector3 &v1, const SimdVector3 &v2) const | SimdVector3 | [inline]
x() const | SimdQuadWord | [inline]
y() const | SimdQuadWord | [inline]
z() const | SimdQuadWord | [inline]

Generated on Wed May 24 14:00:31 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimdVector4 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimdVector4 Class Reference

#include <SimdVector3.h>

Inheritance diagram for SimdVector4:

[legend]
Collaboration diagram for SimdVector4:

[legend]
List of all members.

Public Member Functions

SIMD_FORCE_INLINE | SimdVector4 ()
SIMD_FORCE_INLINE | SimdVector4 (const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w)
SIMD_FORCE_INLINE SimdVector4 | absolute4 () const
float | getW () const
SIMD_FORCE_INLINE int | maxAxis4 () const
SIMD_FORCE_INLINE int | minAxis4 () const
SIMD_FORCE_INLINE int | closestAxis4 () const

Detailed Description

Definition at line 305 of file SimdVector3.h.

Constructor & Destructor Documentation

SIMD_FORCE_INLINE SimdVector4::SimdVector4 ( ) [inline]

Definition at line 309 of file SimdVector3.h.

Referenced by absolute4().

SIMD_FORCE_INLINE SimdVector4::SimdVector4 | ( | const SimdScalar & | x,
 |  | const SimdScalar & | y,
 |  | const SimdScalar & | z,
 |  | const SimdScalar & | w
 | ) | [inline]

Definition at line 312 of file SimdVector3.h.

References SimdQuadWord::m_unusedW.

Member Function Documentation

SIMD_FORCE_INLINE SimdVector4 SimdVector4::absolute4 ( ) const [inline]

Definition at line 319 of file SimdVector3.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, SimdQuadWord::m_z, SimdFabs(), and SimdVector4().

Referenced by closestAxis4().

SIMD_FORCE_INLINE int SimdVector4::closestAxis4 ( ) const [inline]

Definition at line 396 of file SimdVector3.h.

References absolute4(), and maxAxis4().

Referenced by PersistentManifold::SortCachedPoints().

float SimdVector4::getW ( ) const [inline]

Definition at line 330 of file SimdVector3.h.

References SimdQuadWord::m_unusedW.

SIMD_FORCE_INLINE int SimdVector4::maxAxis4 ( ) const [inline]

Definition at line 333 of file SimdVector3.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, and SimdQuadWord::m_z.

Referenced by closestAxis4().

SIMD_FORCE_INLINE int SimdVector4::minAxis4 ( ) const [inline]

Definition at line 366 of file SimdVector3.h.

References SimdQuadWord::m_unusedW, SimdQuadWord::m_y, and SimdQuadWord::m_z.

The documentation for this class was generated from the following file:
  • SimdVector3.h
Generated on Wed May 24 14:00:31 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimdVector4 Member List

This is the complete list of members for SimdVector4, including all inherited members.

absolute() const | SimdVector3 | [inline]
absolute4() const | SimdVector4 | [inline]
angle(const SimdVector3 &v) const | SimdVector3 | [inline]
ATTRIBUTE_ALIGNED16(SimdScalar m_x) | SimdQuadWord | [protected]
closestAxis() const | SimdVector3 | [inline]
closestAxis4() const | SimdVector4 | [inline]
cross(const SimdVector3 &v) const | SimdVector3 | [inline]
distance(const SimdVector3 &v) const | SimdVector3 |
distance2(const SimdVector3 &v) const | SimdVector3 |
dot(const SimdVector3 &v) const | SimdVector3 | [inline]
furthestAxis() const | SimdVector3 | [inline]
getW() const | SimdVector4 | [inline]
getX() const | SimdQuadWord | [inline]
getY() const | SimdQuadWord | [inline]
getZ() const | SimdQuadWord | [inline]
length() const | SimdVector3 | [inline]
length2() const | SimdVector3 | [inline]
lerp(const SimdVector3 &v, const SimdScalar &t) const | SimdVector3 | [inline]
m_unusedW | SimdQuadWord | [protected]
m_y | SimdQuadWord | [protected]
m_z | SimdQuadWord | [protected]
maxAxis() const | SimdVector3 | [inline]
maxAxis4() const | SimdVector4 | [inline]
minAxis() const | SimdVector3 | [inline]
minAxis4() const | SimdVector4 | [inline]
normalize() | SimdVector3 | [inline]
normalized() const | SimdVector3 |
operator *=(const SimdScalar &s) | SimdVector3 | [inline]
operator *=(const SimdVector3 &v) | SimdVector3 | [inline]
operator const SimdScalar *() const | SimdQuadWord | [inline]
operator SimdScalar *() | SimdQuadWord | [inline]
operator+=(const SimdVector3 &v) | SimdVector3 | [inline]
operator-=(const SimdVector3 &v) | SimdVector3 | [inline]
operator/=(const SimdScalar &s) | SimdVector3 | [inline]
operator[](int i) | SimdQuadWord | [inline]
operator[](int i) const | SimdQuadWord | [inline]
rotate(const SimdVector3 &wAxis, const SimdScalar angle) | SimdVector3 |
setInterpolate3(const SimdVector3 &v0, const SimdVector3 &v1, SimdScalar rt) | SimdVector3 | [inline]
setMax(const SimdQuadWord &other) | SimdQuadWord | [inline]
setMin(const SimdQuadWord &other) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
setValue(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
setX(float x) | SimdQuadWord | [inline]
setY(float y) | SimdQuadWord | [inline]
setZ(float z) | SimdQuadWord | [inline]
SimdQuadWord() | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdQuadWord | [inline]
SimdQuadWord(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdQuadWord | [inline]
SimdVector3() | SimdVector3 | [inline]
SimdVector3(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z) | SimdVector3 | [inline]
SimdVector4() | SimdVector4 | [inline]
SimdVector4(const SimdScalar &x, const SimdScalar &y, const SimdScalar &z, const SimdScalar &w) | SimdVector4 | [inline]
triple(const SimdVector3 &v1, const SimdVector3 &v2) const | SimdVector3 | [inline]
x() const | SimdQuadWord | [inline]
y() const | SimdQuadWord | [inline]
z() const | SimdQuadWord | [inline]

Generated on Wed May 24 14:00:31 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleBroadphase Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimpleBroadphase Class Reference

SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks. More...

#include <SimpleBroadphase.h>

Inheritance diagram for SimpleBroadphase:

[legend]
Collaboration diagram for SimpleBroadphase:

[legend]
List of all members.

Public Member Functions

SimpleBroadphase (int maxProxies=4096, int maxOverlap=8192)
virtual | ~SimpleBroadphase ()
virtual BroadphaseProxy * | CreateProxy (const SimdVector3 &min, const SimdVector3 &max, int shapeType, void *userPtr)
virtual void | DestroyProxy (BroadphaseProxy *proxy)
virtual void | SetAabb (BroadphaseProxy *proxy, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax)
virtual void | CleanProxyFromPairs (BroadphaseProxy *proxy)
virtual void | DispatchAllCollisionPairs (Dispatcher &dispatcher, DispatcherInfo &dispatchInfo)

Protected Member Functions

void | RemoveOverlappingPair (BroadphasePair &pair)
void | CleanOverlappingPair (BroadphasePair &pair)
void | RemoveOverlappingPairsContainingProxy (BroadphaseProxy *proxy)
void | AddOverlappingPair (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1)
BroadphasePair * | FindPair (BroadphaseProxy *proxy0, BroadphaseProxy *proxy1)
virtual void | RefreshOverlappingPairs ()

Private Member Functions

SimpleBroadphaseProxy * | GetSimpleProxyFromProxy (BroadphaseProxy *proxy)
bool | AabbOverlap (SimpleBroadphaseProxy *proxy0, SimpleBroadphaseProxy *proxy1)
void | validate ()

Private Attributes

SimpleBroadphaseProxy * m_proxies
int * | m_freeProxies
int | m_firstFreeProxy
SimpleBroadphaseProxy ** m_pProxies
int | m_numProxies
bool | m_blockedForChanges
BroadphasePair * m_OverlappingPairs
int | m_NumOverlapBroadphasePair
int | m_maxProxies
int | m_maxOverlap

Detailed Description

SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks.

Definition at line 43 of file SimpleBroadphase.h.

Constructor & Destructor Documentation

SimpleBroadphase::SimpleBroadphase | ( | int | maxProxies = 4096,
 |  | int | maxOverlap = 8192
 | ) |

Definition at line 38 of file SimpleBroadphase.cpp.

References m_freeProxies, m_maxProxies, m_OverlappingPairs, m_pProxies, and m_proxies.

Referenced by GetSimpleProxyFromProxy().

SimpleBroadphase::~SimpleBroadphase ( ) [virtual]

Definition at line 60 of file SimpleBroadphase.cpp.

References m_freeProxies, m_OverlappingPairs, m_pProxies, and m_proxies.

Referenced by GetSimpleProxyFromProxy().

Member Function Documentation

bool SimpleBroadphase::AabbOverlap | ( | SimpleBroadphaseProxy * | proxy0,
 |  | SimpleBroadphaseProxy * | proxy1
 | ) | [private]

Definition at line 235 of file SimpleBroadphase.cpp.

References SimpleBroadphaseProxy::m_max, and SimpleBroadphaseProxy::m_min.

Referenced by GetSimpleProxyFromProxy(), and RefreshOverlappingPairs().

void SimpleBroadphase::AddOverlappingPair | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1
 | ) | [protected]

Definition at line 179 of file SimpleBroadphase.cpp.

References BroadphasePair::m_algorithms, m_maxOverlap, m_NumOverlapBroadphasePair, m_OverlappingPairs, and SIMPLE_MAX_ALGORITHMS.

Referenced by GetSimpleProxyFromProxy(), RefreshOverlappingPairs(), AxisSweep3::SortMaxUp(), and AxisSweep3::SortMinDown().

void SimpleBroadphase::CleanOverlappingPair ( BroadphasePair & pair ) [protected]

Definition at line 151 of file SimpleBroadphase.cpp.

References BroadphasePair::m_algorithms, and SIMPLE_MAX_ALGORITHMS.

Referenced by CleanProxyFromPairs(), GetSimpleProxyFromProxy(), and RemoveOverlappingPair().

void SimpleBroadphase::CleanProxyFromPairs ( BroadphaseProxy * proxy ) [virtual]

Implements BroadphaseInterface.

Definition at line 166 of file SimpleBroadphase.cpp.

References CleanOverlappingPair(), m_NumOverlapBroadphasePair, m_OverlappingPairs, BroadphasePair::m_pProxy0, and BroadphasePair::m_pProxy1.

Referenced by GetSimpleProxyFromProxy().

BroadphaseProxy * SimpleBroadphase::CreateProxy | ( | const SimdVector3 & | min,
 |  | const SimdVector3 & | max,
 |  | int | shapeType,
 |  | void * | userPtr
 | ) | [virtual]

Implements BroadphaseInterface.

Reimplemented in AxisSweep3.

Definition at line 77 of file SimpleBroadphase.cpp.

References m_firstFreeProxy, m_freeProxies, m_maxProxies, m_numProxies, m_pProxies, and m_proxies.

Referenced by GetSimpleProxyFromProxy().

void SimpleBroadphase::DestroyProxy ( BroadphaseProxy * proxy ) [virtual]

Implements BroadphaseInterface.

Reimplemented in AxisSweep3.

Definition at line 116 of file SimpleBroadphase.cpp.

References m_firstFreeProxy, m_freeProxies, m_maxProxies, m_numProxies, m_pProxies, m_proxies, and RemoveOverlappingPairsContainingProxy().

Referenced by GetSimpleProxyFromProxy().

void SimpleBroadphase::DispatchAllCollisionPairs | ( | Dispatcher & | dispatcher,
 |  | DispatcherInfo & | dispatchInfo
 | ) | [virtual]

Implements BroadphaseInterface.

Definition at line 283 of file SimpleBroadphase.cpp.

References CollisionAlgorithm::CalculateTimeOfImpact(), DispatcherInfo::DISPATCH_DISCRETE, Dispatcher::FindAlgorithm(), Dispatcher::GetUniqueId(), BroadphasePair::m_algorithms, m_blockedForChanges, DispatcherInfo::m_dispatchFunc, m_NumOverlapBroadphasePair, m_OverlappingPairs, BroadphasePair::m_pProxy0, BroadphasePair::m_pProxy1, DispatcherInfo::m_timeOfImpact, CollisionAlgorithm::ProcessCollision(), and RefreshOverlappingPairs().

Referenced by GetSimpleProxyFromProxy().

BroadphasePair * SimpleBroadphase::FindPair | ( | BroadphaseProxy * | proxy0,
 |  | BroadphaseProxy * | proxy1
 | ) | [protected]

Definition at line 208 of file SimpleBroadphase.cpp.

References m_NumOverlapBroadphasePair, m_OverlappingPairs, BroadphasePair::m_pProxy0, and BroadphasePair::m_pProxy1.

Referenced by GetSimpleProxyFromProxy(), RefreshOverlappingPairs(), AxisSweep3::SortMaxDown(), and AxisSweep3::SortMinUp().

SimpleBroadphaseProxy* SimpleBroadphase::GetSimpleProxyFromProxy ( BroadphaseProxy * proxy ) [inline, private]

Definition at line 62 of file SimpleBroadphase.h.

References AabbOverlap(), AddOverlappingPair(), CleanOverlappingPair(), CleanProxyFromPairs(), CreateProxy(), DestroyProxy(), DispatchAllCollisionPairs(), FindPair(), RefreshOverlappingPairs(), RemoveOverlappingPair(), RemoveOverlappingPairsContainingProxy(), SetAabb(), SimpleBroadphase(), validate(), and ~SimpleBroadphase().

Referenced by RefreshOverlappingPairs(), and SetAabb().

void SimpleBroadphase::RefreshOverlappingPairs ( ) [protected, virtual]

Reimplemented in AxisSweep3.

Definition at line 242 of file SimpleBroadphase.cpp.

References AabbOverlap(), AddOverlappingPair(), FindPair(), GetSimpleProxyFromProxy(), m_NumOverlapBroadphasePair, m_numProxies, m_OverlappingPairs, m_pProxies, BroadphasePair::m_pProxy0, BroadphasePair::m_pProxy1, and RemoveOverlappingPair().

Referenced by DispatchAllCollisionPairs(), and GetSimpleProxyFromProxy().

void SimpleBroadphase::RemoveOverlappingPair ( BroadphasePair & pair ) [protected]

Definition at line 226 of file SimpleBroadphase.cpp.

References CleanOverlappingPair(), m_NumOverlapBroadphasePair, and m_OverlappingPairs.

Referenced by GetSimpleProxyFromProxy(), RefreshOverlappingPairs(), RemoveOverlappingPairsContainingProxy(), AxisSweep3::SortMaxDown(), and AxisSweep3::SortMinUp().

void SimpleBroadphase::RemoveOverlappingPairsContainingProxy ( BroadphaseProxy * proxy ) [protected]

Definition at line 102 of file SimpleBroadphase.cpp.

References m_NumOverlapBroadphasePair, m_OverlappingPairs, BroadphasePair::m_pProxy0, BroadphasePair::m_pProxy1, and RemoveOverlappingPair().

Referenced by DestroyProxy(), GetSimpleProxyFromProxy(), and AxisSweep3::RemoveHandle().

void SimpleBroadphase::SetAabb | ( | BroadphaseProxy * | proxy,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | [virtual]

Implements BroadphaseInterface.

Reimplemented in AxisSweep3.

Definition at line 144 of file SimpleBroadphase.cpp.

References GetSimpleProxyFromProxy(), SimpleBroadphaseProxy::m_max, and SimpleBroadphaseProxy::m_min.

Referenced by GetSimpleProxyFromProxy().

void SimpleBroadphase::validate ( ) [private]

Definition at line 26 of file SimpleBroadphase.cpp.

References m_numProxies, and m_pProxies.

Referenced by GetSimpleProxyFromProxy().

Member Data Documentation

bool SimpleBroadphase::m_blockedForChanges [private]

Definition at line 54 of file SimpleBroadphase.h.

Referenced by DispatchAllCollisionPairs().

int SimpleBroadphase::m_firstFreeProxy [private]

Definition at line 48 of file SimpleBroadphase.h.

Referenced by CreateProxy(), and DestroyProxy().

int* SimpleBroadphase::m_freeProxies [private]

Definition at line 47 of file SimpleBroadphase.h.

Referenced by CreateProxy(), DestroyProxy(), SimpleBroadphase(), and ~SimpleBroadphase().

int SimpleBroadphase::m_maxOverlap [private]

Definition at line 60 of file SimpleBroadphase.h.

Referenced by AddOverlappingPair().

int SimpleBroadphase::m_maxProxies [private]

Definition at line 59 of file SimpleBroadphase.h.

Referenced by CreateProxy(), DestroyProxy(), and SimpleBroadphase().

int SimpleBroadphase::m_NumOverlapBroadphasePair [private]

Definition at line 57 of file SimpleBroadphase.h.

Referenced by AddOverlappingPair(), CleanProxyFromPairs(), DispatchAllCollisionPairs(), FindPair(), RefreshOverlappingPairs(), RemoveOverlappingPair(), and RemoveOverlappingPairsContainingProxy().

int SimpleBroadphase::m_numProxies [private]

Definition at line 51 of file SimpleBroadphase.h.

Referenced by CreateProxy(), DestroyProxy(), RefreshOverlappingPairs(), and validate().

BroadphasePair* SimpleBroadphase::m_OverlappingPairs [private]

Definition at line 56 of file SimpleBroadphase.h.

Referenced by AddOverlappingPair(), CleanProxyFromPairs(), DispatchAllCollisionPairs(), FindPair(), RefreshOverlappingPairs(), RemoveOverlappingPair(), RemoveOverlappingPairsContainingProxy(), SimpleBroadphase(), and ~SimpleBroadphase().

SimpleBroadphaseProxy** SimpleBroadphase::m_pProxies [private]

Definition at line 50 of file SimpleBroadphase.h.

Referenced by CreateProxy(), DestroyProxy(), RefreshOverlappingPairs(), SimpleBroadphase(), validate(), and ~SimpleBroadphase().

SimpleBroadphaseProxy* SimpleBroadphase::m_proxies [private]

Definition at line 46 of file SimpleBroadphase.h.

Referenced by CreateProxy(), DestroyProxy(), SimpleBroadphase(), and ~SimpleBroadphase().

The documentation for this class was generated from the following files:
  • SimpleBroadphase.h
  • SimpleBroadphase.cpp
Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimpleBroadphase Member List

This is the complete list of members for SimpleBroadphase, including all inherited members.

AabbOverlap(SimpleBroadphaseProxy *proxy0, SimpleBroadphaseProxy *proxy1) | SimpleBroadphase | [private]
AddOverlappingPair(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | SimpleBroadphase | [protected]
CleanOverlappingPair(BroadphasePair &pair) | SimpleBroadphase | [protected]
CleanProxyFromPairs(BroadphaseProxy *proxy) | SimpleBroadphase | [virtual]
CreateProxy(const SimdVector3 &min, const SimdVector3 &max, int shapeType, void *userPtr) | SimpleBroadphase | [virtual]
DestroyProxy(BroadphaseProxy *proxy) | SimpleBroadphase | [virtual]
DispatchAllCollisionPairs(Dispatcher &dispatcher, DispatcherInfo &dispatchInfo) | SimpleBroadphase | [virtual]
FindPair(BroadphaseProxy *proxy0, BroadphaseProxy *proxy1) | SimpleBroadphase | [protected]
GetSimpleProxyFromProxy(BroadphaseProxy *proxy) | SimpleBroadphase | [inline, private]
m_blockedForChanges | SimpleBroadphase | [private]
m_firstFreeProxy | SimpleBroadphase | [private]
m_freeProxies | SimpleBroadphase | [private]
m_maxOverlap | SimpleBroadphase | [private]
m_maxProxies | SimpleBroadphase | [private]
m_NumOverlapBroadphasePair | SimpleBroadphase | [private]
m_numProxies | SimpleBroadphase | [private]
m_OverlappingPairs | SimpleBroadphase | [private]
m_pProxies | SimpleBroadphase | [private]
m_proxies | SimpleBroadphase | [private]
RefreshOverlappingPairs() | SimpleBroadphase | [protected, virtual]
RemoveOverlappingPair(BroadphasePair &pair) | SimpleBroadphase | [protected]
RemoveOverlappingPairsContainingProxy(BroadphaseProxy *proxy) | SimpleBroadphase | [protected]
SetAabb(BroadphaseProxy *proxy, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) | SimpleBroadphase | [virtual]
SimpleBroadphase(int maxProxies=4096, int maxOverlap=8192) | SimpleBroadphase |
validate() | SimpleBroadphase | [private]
~BroadphaseInterface() | BroadphaseInterface | [inline, virtual]
~SimpleBroadphase() | SimpleBroadphase | [virtual]

Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleBroadphaseProxy Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimpleBroadphaseProxy Struct Reference

#include <SimpleBroadphase.h>

Inheritance diagram for SimpleBroadphaseProxy:

[legend]
Collaboration diagram for SimpleBroadphaseProxy:

[legend]
List of all members.

Public Member Functions

SimpleBroadphaseProxy ()
SimpleBroadphaseProxy (const SimdPoint3 &minpt, const SimdPoint3 &maxpt, int shapeType, void *userPtr)

Public Attributes

SimdVector3 m_min
SimdVector3 m_max

Detailed Description

Definition at line 26 of file SimpleBroadphase.h.

Constructor & Destructor Documentation

SimpleBroadphaseProxy::SimpleBroadphaseProxy ( ) [inline]

Definition at line 31 of file SimpleBroadphase.h.

SimpleBroadphaseProxy::SimpleBroadphaseProxy | ( | const SimdPoint3 & | minpt,
 |  | const SimdPoint3 & | maxpt,
 |  | int | shapeType,
 |  | void * | userPtr
 | ) | [inline]

Definition at line 33 of file SimpleBroadphase.h.

Member Data Documentation

SimdVector3 SimpleBroadphaseProxy::m_max

Definition at line 29 of file SimpleBroadphase.h.

Referenced by SimpleBroadphase::AabbOverlap(), and SimpleBroadphase::SetAabb().

SimdVector3 SimpleBroadphaseProxy::m_min

Definition at line 28 of file SimpleBroadphase.h.

Referenced by SimpleBroadphase::AabbOverlap(), and SimpleBroadphase::SetAabb().

The documentation for this struct was generated from the following file:
  • SimpleBroadphase.h
Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimpleBroadphaseProxy Member List

This is the complete list of members for SimpleBroadphaseProxy, including all inherited members.

BroadphaseProxy() | BroadphaseProxy | [inline]
BroadphaseProxy(int shapeType, void *userPtr) | BroadphaseProxy | [inline]
m_clientObject | BroadphaseProxy |
m_max | SimpleBroadphaseProxy |
m_min | SimpleBroadphaseProxy |
SimpleBroadphaseProxy() | SimpleBroadphaseProxy | [inline]
SimpleBroadphaseProxy(const SimdPoint3 &minpt, const SimdPoint3 &maxpt, int shapeType, void *userPtr) | SimpleBroadphaseProxy | [inline]

Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SimpleConstraintSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SimpleConstraintSolver Class Reference

SimpleConstraintSolver uses a Propagation Method and Sequentially applies impulses The approach is the 3D version of Erin Catto's GDC 2006 tutorial. More...

#include <SimpleConstraintSolver.h>

Inheritance diagram for SimpleConstraintSolver:

[legend]
Collaboration diagram for SimpleConstraintSolver:

[legend]
List of all members.

Public Member Functions

SimpleConstraintSolver ()
virtual | ~SimpleConstraintSolver ()
virtual float | SolveGroup (PersistentManifold **manifold, int numManifolds, const ContactSolverInfo &info, IDebugDraw *debugDrawer=0)
SimpleConstraintSolver Sequentially applies impulses.

Private Member Functions

float | Solve (PersistentManifold *manifold, const ContactSolverInfo &info, int iter, IDebugDraw *debugDrawer)
float | SolveFriction (PersistentManifold *manifoldPtr, const ContactSolverInfo &info, int iter, IDebugDraw *debugDrawer)

Detailed Description

SimpleConstraintSolver uses a Propagation Method and Sequentially applies impulses The approach is the 3D version of Erin Catto's GDC 2006 tutorial.

See http://www.gphysics.com Although Sequential Impulse is more intuitive, it is mathematically equivalent to Projected Successive Overrelaxation (iterative LCP) Applies impulses for combined restitution and penetration recovery and to simulate friction

Definition at line 26 of file SimpleConstraintSolver.h.

Constructor & Destructor Documentation

SimpleConstraintSolver::SimpleConstraintSolver ( )

Definition at line 48 of file SimpleConstraintSolver.cpp.

References gContactCallback, and MyContactDestroyedCallback().

virtual SimpleConstraintSolver::~SimpleConstraintSolver ( ) [inline, virtual]

Definition at line 36 of file SimpleConstraintSolver.h.

Member Function Documentation

float SimpleConstraintSolver::Solve | ( | PersistentManifold * | manifold,
 |  | const ContactSolverInfo & | info,
 |  | int | iter,
 |  | IDebugDraw * | debugDrawer
 | ) | [private]

Definition at line 116 of file SimpleConstraintSolver.cpp.

References RigidBody::applyImpulse(), RigidBody::ComputeImpulseDenominator(), SimdTransform::getBasis(), PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), RigidBody::getCenterOfMassPosition(), RigidBody::getCenterOfMassTransform(), PersistentManifold::GetContactPoint(), ManifoldPoint::GetDistance(), RigidBody::getInvInertiaDiagLocal(), RigidBody::getInvMass(), ManifoldPoint::GetLifeTime(), PersistentManifold::GetNumContacts(), ManifoldPoint::GetPositionWorldOnA(), ManifoldPoint::GetPositionWorldOnB(), RigidBody::getRestitution(), RigidBody::getVelocityInLocalPoint(), ConstraintPersistentData::m_accumulatedTangentImpulse0, ConstraintPersistentData::m_accumulatedTangentImpulse1, ConstraintPersistentData::m_appliedImpulse, ContactSolverInfo::m_damping, ConstraintPersistentData::m_frictionWorldTangential0, ConstraintPersistentData::m_frictionWorldTangential1, ConstraintPersistentData::m_jacDiagABInv, ConstraintPersistentData::m_jacDiagABInvTangent0, ConstraintPersistentData::m_jacDiagABInvTangent1, ManifoldPoint::m_normalWorldOnB, ConstraintPersistentData::m_penetration, ConstraintPersistentData::m_persistentLifeTime, ConstraintPersistentData::m_prevAppliedImpulse, ConstraintPersistentData::m_restitution, ContactSolverInfo::m_timeStep, ManifoldPoint::m_userPersistentData, NO_FRICTION_WARMSTART, PersistentManifold::RefreshContactPoints(), restitutionCurve(), SimdPlaneSpace1(), totalCpd, and SimdMatrix3x3::transpose().

Referenced by SolveGroup().

float SimpleConstraintSolver::SolveFriction | ( | PersistentManifold * | manifoldPtr,
 |  | const ContactSolverInfo & | info,
 |  | int | iter,
 |  | IDebugDraw * | debugDrawer
 | ) | [private]

Definition at line 297 of file SimpleConstraintSolver.cpp.

References PersistentManifold::GetBody0(), PersistentManifold::GetBody1(), PersistentManifold::GetContactPoint(), ManifoldPoint::GetDistance(), PersistentManifold::GetNumContacts(), and resolveSingleFriction().

Referenced by SolveGroup().

float SimpleConstraintSolver::SolveGroup | ( | PersistentManifold ** | manifold,
 |  | int | numManifolds,
 |  | const ContactSolverInfo & | info,
 |  | IDebugDraw * | debugDrawer = 0
 | ) | [virtual]

SimpleConstraintSolver Sequentially applies impulses.

Implements ConstraintSolver.

Definition at line 55 of file SimpleConstraintSolver.cpp.

References ContactSolverInfo::m_numIterations, Solve(), and SolveFriction().

The documentation for this class was generated from the following files:
  • SimpleConstraintSolver.h
  • SimpleConstraintSolver.cpp
Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SimpleConstraintSolver Member List

This is the complete list of members for SimpleConstraintSolver, including all inherited members.

SimpleConstraintSolver() | SimpleConstraintSolver |
Solve(PersistentManifold *manifold, const ContactSolverInfo &info, int iter, IDebugDraw *debugDrawer) | SimpleConstraintSolver | [private]
SolveFriction(PersistentManifold *manifoldPtr, const ContactSolverInfo &info, int iter, IDebugDraw *debugDrawer) | SimpleConstraintSolver | [private]
SolveGroup(PersistentManifold **manifold, int numManifolds, const ContactSolverInfo &info, IDebugDraw *debugDrawer=0) | SimpleConstraintSolver | [virtual]
~ConstraintSolver() | ConstraintSolver | [inline, virtual]
~SimpleConstraintSolver() | SimpleConstraintSolver | [inline, virtual]

Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Solve2LinearConstraint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Solve2LinearConstraint Class Reference

constraint class used for lateral tyre friction. More...

#include <Solve2LinearConstraint.h>

List of all members.

Public Member Functions

Solve2LinearConstraint (SimdScalar tau, SimdScalar damping)
void | resolveUnilateralPairConstraint (RigidBody *body0, RigidBody *body1, const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &invInertiaADiag, const SimdScalar invMassA, const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &rel_posA1, const SimdVector3 &invInertiaBDiag, const SimdScalar invMassB, const SimdVector3 &linvelB, const SimdVector3 &angvelB, const SimdVector3 &rel_posA2, SimdScalar depthA, const SimdVector3 &normalA, const SimdVector3 &rel_posB1, const SimdVector3 &rel_posB2, SimdScalar depthB, const SimdVector3 &normalB, SimdScalar &imp0, SimdScalar &imp1)
void | resolveBilateralPairConstraint (RigidBody *body0, RigidBody *body1, const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &invInertiaADiag, const SimdScalar invMassA, const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &rel_posA1, const SimdVector3 &invInertiaBDiag, const SimdScalar invMassB, const SimdVector3 &linvelB, const SimdVector3 &angvelB, const SimdVector3 &rel_posA2, SimdScalar depthA, const SimdVector3 &normalA, const SimdVector3 &rel_posB1, const SimdVector3 &rel_posB2, SimdScalar depthB, const SimdVector3 &normalB, SimdScalar &imp0, SimdScalar &imp1)
void | resolveAngularConstraint (const SimdMatrix3x3 &invInertiaAWS, const SimdScalar invMassA, const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &rel_posA1, const SimdMatrix3x3 &invInertiaBWS, const SimdScalar invMassB, const SimdVector3 &linvelB, const SimdVector3 &angvelB, const SimdVector3 &rel_posA2, SimdScalar depthA, const SimdVector3 &normalA, const SimdVector3 &rel_posB1, const SimdVector3 &rel_posB2, SimdScalar depthB, const SimdVector3 &normalB, SimdScalar &imp0, SimdScalar &imp1)

Private Attributes

SimdScalar m_tau
SimdScalar m_damping

Detailed Description

constraint class used for lateral tyre friction.

Definition at line 28 of file Solve2LinearConstraint.h.

Constructor & Destructor Documentation

Solve2LinearConstraint::Solve2LinearConstraint | ( | SimdScalar | tau,
 |  | SimdScalar | damping
 | ) | [inline]

Definition at line 35 of file Solve2LinearConstraint.h.

References m_damping, and m_tau.

Member Function Documentation

void Solve2LinearConstraint::resolveAngularConstraint | ( | const SimdMatrix3x3 & | invInertiaAWS,
 |  | const SimdScalar | invMassA,
 |  | const SimdVector3 & | linvelA,
 |  | const SimdVector3 & | angvelA,
 |  | const SimdVector3 & | rel_posA1,
 |  | const SimdMatrix3x3 & | invInertiaBWS,
 |  | const SimdScalar | invMassB,
 |  | const SimdVector3 & | linvelB,
 |  | const SimdVector3 & | angvelB,
 |  | const SimdVector3 & | rel_posA2,
 |  | SimdScalar | depthA,
 |  | const SimdVector3 & | normalA,
 |  | const SimdVector3 & | rel_posB1,
 |  | const SimdVector3 & | rel_posB2,
 |  | SimdScalar | depthB,
 |  | const SimdVector3 & | normalB,
 |  | SimdScalar & | imp0,
 |  | SimdScalar & | imp1
 | ) |

Definition at line 225 of file Solve2LinearConstraint.cpp.

void Solve2LinearConstraint::resolveBilateralPairConstraint | ( | RigidBody * | body0,
 |  | RigidBody * | body1,
 |  | const SimdMatrix3x3 & | world2A,
 |  | const SimdMatrix3x3 & | world2B,
 |  | const SimdVector3 & | invInertiaADiag,
 |  | const SimdScalar | invMassA,
 |  | const SimdVector3 & | linvelA,
 |  | const SimdVector3 & | angvelA,
 |  | const SimdVector3 & | rel_posA1,
 |  | const SimdVector3 & | invInertiaBDiag,
 |  | const SimdScalar | invMassB,
 |  | const SimdVector3 & | linvelB,
 |  | const SimdVector3 & | angvelB,
 |  | const SimdVector3 & | rel_posA2,
 |  | SimdScalar | depthA,
 |  | const SimdVector3 & | normalA,
 |  | const SimdVector3 & | rel_posB1,
 |  | const SimdVector3 & | rel_posB2,
 |  | SimdScalar | depthB,
 |  | const SimdVector3 & | normalB,
 |  | SimdScalar & | imp0,
 |  | SimdScalar & | imp1
 | ) |

Definition at line 108 of file Solve2LinearConstraint.cpp.

References ASSERT, SimdVector3::dot(), JacobianEntry::getDiagonal(), JacobianEntry::getNonDiagonal(), RigidBody::getVelocityInLocalPoint(), SimdVector3::length(), m_damping, m_tau, and SIMD_EPSILON.

void Solve2LinearConstraint::resolveUnilateralPairConstraint | ( | RigidBody * | body0,
 |  | RigidBody * | body1,
 |  | const SimdMatrix3x3 & | world2A,
 |  | const SimdMatrix3x3 & | world2B,
 |  | const SimdVector3 & | invInertiaADiag,
 |  | const SimdScalar | invMassA,
 |  | const SimdVector3 & | linvelA,
 |  | const SimdVector3 & | angvelA,
 |  | const SimdVector3 & | rel_posA1,
 |  | const SimdVector3 & | invInertiaBDiag,
 |  | const SimdScalar | invMassB,
 |  | const SimdVector3 & | linvelB,
 |  | const SimdVector3 & | angvelB,
 |  | const SimdVector3 & | rel_posA2,
 |  | SimdScalar | depthA,
 |  | const SimdVector3 & | normalA,
 |  | const SimdVector3 & | rel_posB1,
 |  | const SimdVector3 & | rel_posB2,
 |  | SimdScalar | depthB,
 |  | const SimdVector3 & | normalB,
 |  | SimdScalar & | imp0,
 |  | SimdScalar & | imp1
 | ) |

Definition at line 25 of file Solve2LinearConstraint.cpp.

References ASSERT, SimdVector3::dot(), JacobianEntry::getDiagonal(), JacobianEntry::getNonDiagonal(), RigidBody::getVelocityInLocalPoint(), SimdVector3::length(), m_damping, m_tau, and SIMD_EPSILON.

Member Data Documentation

SimdScalar Solve2LinearConstraint::m_damping [private]

Definition at line 31 of file Solve2LinearConstraint.h.

Referenced by resolveBilateralPairConstraint(), resolveUnilateralPairConstraint(), and Solve2LinearConstraint().

SimdScalar Solve2LinearConstraint::m_tau [private]

Definition at line 30 of file Solve2LinearConstraint.h.

Referenced by resolveBilateralPairConstraint(), resolveUnilateralPairConstraint(), and Solve2LinearConstraint().

The documentation for this class was generated from the following files:
  • Solve2LinearConstraint.h
  • Solve2LinearConstraint.cpp
Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

Solve2LinearConstraint Member List

This is the complete list of members for Solve2LinearConstraint, including all inherited members.

m_damping | Solve2LinearConstraint | [private]
m_tau | Solve2LinearConstraint | [private]
resolveAngularConstraint(const SimdMatrix3x3 &invInertiaAWS, const SimdScalar invMassA, const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &rel_posA1, const SimdMatrix3x3 &invInertiaBWS, const SimdScalar invMassB, const SimdVector3 &linvelB, const SimdVector3 &angvelB, const SimdVector3 &rel_posA2, SimdScalar depthA, const SimdVector3 &normalA, const SimdVector3 &rel_posB1, const SimdVector3 &rel_posB2, SimdScalar depthB, const SimdVector3 &normalB, SimdScalar &imp0, SimdScalar &imp1) | Solve2LinearConstraint |
resolveBilateralPairConstraint(RigidBody *body0, RigidBody *body1, const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &invInertiaADiag, const SimdScalar invMassA, const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &rel_posA1, const SimdVector3 &invInertiaBDiag, const SimdScalar invMassB, const SimdVector3 &linvelB, const SimdVector3 &angvelB, const SimdVector3 &rel_posA2, SimdScalar depthA, const SimdVector3 &normalA, const SimdVector3 &rel_posB1, const SimdVector3 &rel_posB2, SimdScalar depthB, const SimdVector3 &normalB, SimdScalar &imp0, SimdScalar &imp1) | Solve2LinearConstraint |
resolveUnilateralPairConstraint(RigidBody *body0, RigidBody *body1, const SimdMatrix3x3 &world2A, const SimdMatrix3x3 &world2B, const SimdVector3 &invInertiaADiag, const SimdScalar invMassA, const SimdVector3 &linvelA, const SimdVector3 &angvelA, const SimdVector3 &rel_posA1, const SimdVector3 &invInertiaBDiag, const SimdScalar invMassB, const SimdVector3 &linvelB, const SimdVector3 &angvelB, const SimdVector3 &rel_posA2, SimdScalar depthA, const SimdVector3 &normalA, const SimdVector3 &rel_posB1, const SimdVector3 &rel_posB2, SimdScalar depthB, const SimdVector3 &normalB, SimdScalar &imp0, SimdScalar &imp1) | Solve2LinearConstraint |
Solve2LinearConstraint(SimdScalar tau, SimdScalar damping) | Solve2LinearConstraint | [inline]

Generated on Wed May 24 14:00:32 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SphereShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SphereShape Class Reference

SphereShape implements an implicit (getSupportingVertex) Sphere. More...

#include <SphereShape.h>

Inheritance diagram for SphereShape:

[legend]
Collaboration diagram for SphereShape:

[legend]
List of all members.

Public Member Functions

SphereShape (SimdScalar radius)
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
virtual int | GetShapeType () const
SimdScalar | GetRadius () const
virtual char * | GetName () const
virtual void | SetMargin (float margin)
virtual float | GetMargin () const

Private Attributes

SimdScalar m_radius

Detailed Description

SphereShape implements an implicit (getSupportingVertex) Sphere.

Definition at line 23 of file SphereShape.h.

Constructor & Destructor Documentation

SphereShape::SphereShape ( SimdScalar radius )

Definition at line 22 of file SphereShape.cpp.

Member Function Documentation

void SphereShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [virtual]

Implements ConvexShape.

Definition at line 32 of file SphereShape.cpp.

References SimdQuadWord::setValue().

void SphereShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

Implements CollisionShape.

Definition at line 68 of file SphereShape.cpp.

References GetMargin().

void SphereShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [virtual]

GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.

Reimplemented from ConvexShape.

Definition at line 58 of file SphereShape.cpp.

References GetMargin(), and SimdTransform::getOrigin().

virtual float SphereShape::GetMargin ( ) const [inline, virtual]

Reimplemented from ConvexShape.

Definition at line 53 of file SphereShape.h.

References ConvexShape::GetMargin(), ConvexShape::m_localScaling, and m_radius.

Referenced by CalculateLocalInertia(), GetAabb(), and LocalGetSupportingVertex().

virtual char* SphereShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 47 of file SphereShape.h.

SimdScalar SphereShape::GetRadius ( ) const [inline]

Definition at line 44 of file SphereShape.h.

References m_radius.

virtual int SphereShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 42 of file SphereShape.h.

References SPHERE_SHAPE_PROXYTYPE.

SimdVector3 SphereShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [virtual]

Reimplemented from ConvexShape.

Definition at line 41 of file SphereShape.cpp.

References GetMargin(), LocalGetSupportingVertexWithoutMargin(), SimdVector3::normalize(), SimdQuadWord::setValue(), and SIMD_EPSILON.

SimdVector3 SphereShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [virtual]

Implements ConvexShape.

Definition at line 27 of file SphereShape.cpp.

Referenced by LocalGetSupportingVertex().

virtual void SphereShape::SetMargin ( float margin ) [inline, virtual]

Reimplemented from ConvexShape.

Definition at line 49 of file SphereShape.h.

References ConvexShape::SetMargin().

Referenced by GjkConvexCast::calcTimeOfImpact(), and ContinuousConvexCollision::calcTimeOfImpact().

Member Data Documentation

SimdScalar SphereShape::m_radius [private]

Definition at line 26 of file SphereShape.h.

Referenced by GetMargin(), and GetRadius().

The documentation for this class was generated from the following files:
  • SphereShape.h
  • SphereShape.cpp
Generated on Wed May 24 14:00:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SphereShape Member List

This is the complete list of members for SphereShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | SphereShape | [virtual]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | SphereShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | SphereShape | [virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | SphereShape | [inline, virtual]
GetName() const | SphereShape | [inline, virtual]
GetRadius() const | SphereShape | [inline]
GetShapeType() const | SphereShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | SphereShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | SphereShape | [virtual]
m_localScaling | ConvexShape | [protected]
m_radius | SphereShape | [private]
m_tempDebug | CollisionShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | SphereShape | [inline, virtual]
SphereShape(SimdScalar radius) | SphereShape |
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: StorageResult Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

StorageResult Struct Reference

#include <DiscreteCollisionDetectorInterface.h>

Inheritance diagram for StorageResult:

[legend]
Collaboration diagram for StorageResult:

[legend]
List of all members.

Public Member Functions

StorageResult ()
virtual | ~StorageResult ()
virtual void | AddContactPoint (const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth)

Public Attributes

SimdVector3 m_normalOnSurfaceB
SimdVector3 m_closestPointInB
SimdScalar m_distance

Detailed Description

Definition at line 63 of file DiscreteCollisionDetectorInterface.h.

Constructor & Destructor Documentation

StorageResult::StorageResult ( ) [inline]

Definition at line 69 of file DiscreteCollisionDetectorInterface.h.

virtual StorageResult::~StorageResult ( ) [inline, virtual]

Definition at line 73 of file DiscreteCollisionDetectorInterface.h.

Member Function Documentation

virtual void StorageResult::AddContactPoint | ( | const SimdVector3 & | normalOnBInWorld,
 |  | const SimdVector3 & | pointInWorld,
 |  | float | depth
 | ) | [inline, virtual]

Implements DiscreteCollisionDetectorInterface::Result.

Definition at line 75 of file DiscreteCollisionDetectorInterface.h.

References m_closestPointInB, m_distance, and m_normalOnSurfaceB.

Member Data Documentation

SimdVector3 StorageResult::m_closestPointInB

Definition at line 66 of file DiscreteCollisionDetectorInterface.h.

Referenced by AddContactPoint().

SimdScalar StorageResult::m_distance

Definition at line 67 of file DiscreteCollisionDetectorInterface.h.

Referenced by AddContactPoint().

SimdVector3 StorageResult::m_normalOnSurfaceB

Definition at line 65 of file DiscreteCollisionDetectorInterface.h.

Referenced by AddContactPoint().

The documentation for this struct was generated from the following file:
  • DiscreteCollisionDetectorInterface.h
Generated on Wed May 24 14:00:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

StorageResult Member List

This is the complete list of members for StorageResult, including all inherited members.

AddContactPoint(const SimdVector3 &normalOnBInWorld, const SimdVector3 &pointInWorld, float depth) | StorageResult | [inline, virtual]
m_closestPointInB | StorageResult |
m_distance | StorageResult |
m_normalOnSurfaceB | StorageResult |
operator delete(void *ptr) | DiscreteCollisionDetectorInterface::Result | [inline]
StorageResult() | StorageResult | [inline]
~Result() | DiscreteCollisionDetectorInterface::Result | [inline, virtual]
~StorageResult() | StorageResult | [inline, virtual]

Generated on Wed May 24 14:00:33 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: StridingMeshInterface Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

StridingMeshInterface Class Reference

StridingMeshInterface is the interface class for high performance access to triangle meshes It allows for sharing graphics and collision meshes. More...

#include <StridingMeshInterface.h>

Inheritance diagram for StridingMeshInterface:

[legend]
Collaboration diagram for StridingMeshInterface:

[legend]
List of all members.

Public Member Functions

StridingMeshInterface ()
virtual | ~StridingMeshInterface ()
void | InternalProcessAllTriangles (InternalTriangleIndexCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const
virtual void | getLockedVertexIndexBase (unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0)=0
get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished
virtual void | getLockedReadOnlyVertexIndexBase (const unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, const unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) const =0
virtual void | unLockVertexBase (int subpart)=0
unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
virtual void | unLockReadOnlyVertexBase (int subpart) const =0
virtual int | getNumSubParts () const =0
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices
virtual void | preallocateVertices (int numverts)=0
virtual void | preallocateIndices (int numindices)=0
const SimdVector3 & | getScaling () const
void | setScaling (const SimdVector3 &scaling)

Protected Attributes

SimdVector3 m_scaling

Detailed Description

StridingMeshInterface is the interface class for high performance access to triangle meshes It allows for sharing graphics and collision meshes.

Also it provides locking/unlocking of graphics meshes that are in gpu memory.

Definition at line 34 of file StridingMeshInterface.h.

Constructor & Destructor Documentation

StridingMeshInterface::StridingMeshInterface ( ) [inline]

Definition at line 41 of file StridingMeshInterface.h.

StridingMeshInterface::~StridingMeshInterface ( ) [virtual]

Definition at line 18 of file StridingMeshInterface.cpp.

Member Function Documentation

virtual void StridingMeshInterface::getLockedReadOnlyVertexIndexBase | ( | const unsigned char ** | vertexbase,
 |  | int & | numverts,
 |  | PHY_ScalarType & | type,
 |  | int & | stride,
 |  | const unsigned char ** | indexbase,
 |  | int & | indexstride,
 |  | int & | numfaces,
 |  | PHY_ScalarType & | indicestype,
 |  | int | subpart = 0
 | ) | const [pure virtual]

Implemented in TriangleIndexVertexArray, and TriangleMesh.

Referenced by InternalProcessAllTriangles(), and BvhTriangleMeshShape::ProcessAllTriangles().

virtual void StridingMeshInterface::getLockedVertexIndexBase | ( | unsigned char ** | vertexbase,
 |  | int & | numverts,
 |  | PHY_ScalarType & | type,
 |  | int & | stride,
 |  | unsigned char ** | indexbase,
 |  | int & | indexstride,
 |  | int & | numfaces,
 |  | PHY_ScalarType & | indicestype,
 |  | int | subpart = 0
 | ) | [pure virtual]

get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished

Implemented in TriangleIndexVertexArray, and TriangleMesh.

virtual int StridingMeshInterface::getNumSubParts ( ) const [pure virtual]

getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices

Implemented in TriangleIndexVertexArray, and TriangleMesh.

Referenced by InternalProcessAllTriangles().

const SimdVector3& StridingMeshInterface::getScaling ( ) const [inline]

Definition at line 76 of file StridingMeshInterface.h.

References m_scaling.

Referenced by TriangleMeshShape::getLocalScaling(), InternalProcessAllTriangles(), and BvhTriangleMeshShape::ProcessAllTriangles().

void StridingMeshInterface::InternalProcessAllTriangles | ( | InternalTriangleIndexCallback * | callback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const

Definition at line 24 of file StridingMeshInterface.cpp.

References ASSERT, getLockedReadOnlyVertexIndexBase(), getNumSubParts(), getScaling(), SimdQuadWord::getX(), SimdQuadWord::getY(), SimdQuadWord::getZ(), InternalTriangleIndexCallback::InternalProcessTriangleIndex(), PHY_INTEGER, and unLockReadOnlyVertexBase().

Referenced by OptimizedBvh::Build(), and TriangleMeshShape::ProcessAllTriangles().

virtual void StridingMeshInterface::preallocateIndices ( int numindices ) [pure virtual]

Implemented in TriangleIndexVertexArray, and TriangleMesh.

virtual void StridingMeshInterface::preallocateVertices ( int numverts ) [pure virtual]

Implemented in TriangleIndexVertexArray, and TriangleMesh.

void StridingMeshInterface::setScaling ( const SimdVector3 & scaling ) [inline]

Definition at line 79 of file StridingMeshInterface.h.

References m_scaling.

Referenced by TriangleMeshShape::setLocalScaling().

virtual void StridingMeshInterface::unLockReadOnlyVertexBase ( int subpart ) const [pure virtual]

Implemented in TriangleIndexVertexArray, and TriangleMesh.

Referenced by InternalProcessAllTriangles(), and BvhTriangleMeshShape::ProcessAllTriangles().

virtual void StridingMeshInterface::unLockVertexBase ( int subpart ) [pure virtual]

unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished

Implemented in TriangleIndexVertexArray, and TriangleMesh.

Member Data Documentation

SimdVector3 StridingMeshInterface::m_scaling [protected]

Definition at line 38 of file StridingMeshInterface.h.

Referenced by getScaling(), and setScaling().

The documentation for this class was generated from the following files:
  • StridingMeshInterface.h
  • StridingMeshInterface.cpp
Generated on Wed May 24 14:00:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

StridingMeshInterface Member List

This is the complete list of members for StridingMeshInterface, including all inherited members.

getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, const unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) const =0 | StridingMeshInterface | [pure virtual]
getLockedVertexIndexBase(unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0)=0 | StridingMeshInterface | [pure virtual]
getNumSubParts() const =0 | StridingMeshInterface | [pure virtual]
getScaling() const | StridingMeshInterface | [inline]
InternalProcessAllTriangles(InternalTriangleIndexCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | StridingMeshInterface |
m_scaling | StridingMeshInterface | [protected]
preallocateIndices(int numindices)=0 | StridingMeshInterface | [pure virtual]
preallocateVertices(int numverts)=0 | StridingMeshInterface | [pure virtual]
setScaling(const SimdVector3 &scaling) | StridingMeshInterface | [inline]
StridingMeshInterface() | StridingMeshInterface | [inline]
unLockReadOnlyVertexBase(int subpart) const =0 | StridingMeshInterface | [pure virtual]
unLockVertexBase(int subpart)=0 | StridingMeshInterface | [pure virtual]
~StridingMeshInterface() | StridingMeshInterface | [virtual]

Generated on Wed May 24 14:00:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SubSimplexClosestResult Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

SubSimplexClosestResult Struct Reference

#include <VoronoiSimplexSolver.h>

Collaboration diagram for SubSimplexClosestResult:

[legend]
List of all members.

Public Member Functions

void | Reset ()
bool | IsValid ()
void | SetBarycentricCoordinates (float a=0.f, float b=0.f, float c=0.f, float d=0.f)

Public Attributes

SimdPoint3 m_closestPointOnSimplex
UsageBitfield m_usedVertices
float | m_barycentricCoords [4]
bool | m_degenerate

Detailed Description

Definition at line 51 of file VoronoiSimplexSolver.h.

Member Function Documentation

bool SubSimplexClosestResult::IsValid ( ) [inline]

Definition at line 67 of file VoronoiSimplexSolver.h.

References m_barycentricCoords.

Referenced by VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

void SubSimplexClosestResult::Reset ( ) [inline]

Definition at line 61 of file VoronoiSimplexSolver.h.

References m_degenerate, m_usedVertices, UsageBitfield::reset(), and SetBarycentricCoordinates().

Referenced by VoronoiSimplexSolver::reset(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

void SubSimplexClosestResult::SetBarycentricCoordinates | ( | float | a = 0.f,
 |  | float | b = 0.f,
 |  | float | c = 0.f,
 |  | float | d = 0.f
 | ) | [inline]

Definition at line 77 of file VoronoiSimplexSolver.h.

References m_barycentricCoords.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ClosestPtPointTriangle(), Reset(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

Member Data Documentation

float SubSimplexClosestResult::m_barycentricCoords[4]

Definition at line 58 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), IsValid(), SetBarycentricCoordinates(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

SimdPoint3 SubSimplexClosestResult::m_closestPointOnSimplex

Definition at line 53 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), and VoronoiSimplexSolver::ClosestPtPointTriangle().

bool SubSimplexClosestResult::m_degenerate

Definition at line 59 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), Reset(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

UsageBitfield SubSimplexClosestResult::m_usedVertices

Definition at line 57 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ClosestPtPointTriangle(), Reset(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

The documentation for this struct was generated from the following file:
  • VoronoiSimplexSolver.h
Generated on Wed May 24 14:00:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SubSimplexClosestResult Member List

This is the complete list of members for SubSimplexClosestResult, including all inherited members.

IsValid() | SubSimplexClosestResult | [inline]
m_barycentricCoords | SubSimplexClosestResult |
m_closestPointOnSimplex | SubSimplexClosestResult |
m_degenerate | SubSimplexClosestResult |
m_usedVertices | SubSimplexClosestResult |
Reset() | SubSimplexClosestResult | [inline]
SetBarycentricCoordinates(float a=0.f, float b=0.f, float c=0.f, float d=0.f) | SubSimplexClosestResult | [inline]

Generated on Wed May 24 14:00:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SubsimplexConvexCast Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SubsimplexConvexCast Class Reference

SubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against General Convex Objects with Application to Continuous Collision Detection" GJK based Ray Cast, optimized version Objects should not start in overlap, otherwise results are not defined. More...

#include <SubSimplexConvexCast.h>

Inheritance diagram for SubsimplexConvexCast:

[legend]
Collaboration diagram for SubsimplexConvexCast:

[legend]
List of all members.

Public Member Functions

SubsimplexConvexCast (ConvexShape *shapeA, ConvexShape *shapeB, SimplexSolverInterface *simplexSolver)
virtual bool | calcTimeOfImpact (const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)
SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (sweep) between two moving objects.

Private Attributes

SimplexSolverInterface * | m_simplexSolver
ConvexShape * m_convexA
ConvexShape * m_convexB

Detailed Description

SubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against General Convex Objects with Application to Continuous Collision Detection" GJK based Ray Cast, optimized version Objects should not start in overlap, otherwise results are not defined.

Definition at line 28 of file SubSimplexConvexCast.h.

Constructor & Destructor Documentation

SubsimplexConvexCast::SubsimplexConvexCast | ( | ConvexShape * | shapeA,
 |  | ConvexShape * | shapeB,
 |  | SimplexSolverInterface * | simplexSolver
 | ) |

Definition at line 23 of file SubSimplexConvexCast.cpp.

Member Function Documentation

bool SubsimplexConvexCast::calcTimeOfImpact | ( | const SimdTransform & | fromA,
 |  | const SimdTransform & | toA,
 |  | const SimdTransform & | fromB,
 |  | const SimdTransform & | toB,
 |  | CastResult & | result
 | ) | [virtual]

SimsimplexConvexCast calculateTimeOfImpact calculates the time of impact+normal for the linear cast (sweep) between two moving objects.

Precondition is that objects should not penetration/overlap at the start from the interval. Overlap can be tested using GjkPairDetector.

Definition at line 32 of file SubSimplexConvexCast.cpp.

References SimdVector3::dot(), SimdTransform::getBasis(), SimdTransform::getOrigin(), SimdTransform::inverse(), ConvexShape::LocalGetSupportingVertex(), m_convexA, m_convexB, m_simplexSolver, MAX_ITERATIONS, MinkowskiSumShape::SetTransformB(), SimdQuadWord::setValue(), and SIMD_EPSILON.

Referenced by CollisionWorld::RayTest().

Member Data Documentation

ConvexShape* SubsimplexConvexCast::m_convexA [private]

Definition at line 31 of file SubSimplexConvexCast.h.

Referenced by calcTimeOfImpact().

ConvexShape* SubsimplexConvexCast::m_convexB [private]

Definition at line 32 of file SubSimplexConvexCast.h.

Referenced by calcTimeOfImpact().

SimplexSolverInterface* SubsimplexConvexCast::m_simplexSolver [private]

Definition at line 30 of file SubSimplexConvexCast.h.

Referenced by calcTimeOfImpact().

The documentation for this class was generated from the following files:
  • SubSimplexConvexCast.h
  • SubSimplexConvexCast.cpp
Generated on Wed May 24 14:00:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SubsimplexConvexCast Member List

This is the complete list of members for SubsimplexConvexCast, including all inherited members.

calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result) | SubsimplexConvexCast | [virtual]
ConvexCast::calcTimeOfImpact(const SimdTransform &fromA, const SimdTransform &toA, const SimdTransform &fromB, const SimdTransform &toB, CastResult &result)=0 | ConvexCast | [pure virtual]
m_convexA | SubsimplexConvexCast | [private]
m_convexB | SubsimplexConvexCast | [private]
m_simplexSolver | SubsimplexConvexCast | [private]
SubsimplexConvexCast(ConvexShape *shapeA, ConvexShape *shapeB, SimplexSolverInterface *simplexSolver) | SubsimplexConvexCast |
~ConvexCast() | ConvexCast | [virtual]

Generated on Wed May 24 14:00:34 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: SupportVertexCallback Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

SupportVertexCallback Class Reference

Inheritance diagram for SupportVertexCallback:

[legend]
Collaboration diagram for SupportVertexCallback:

[legend]
List of all members.

Public Member Functions

SupportVertexCallback (const SimdVector3 &supportVecWorld, const SimdTransform &trans)
virtual void ProcessTriangle (SimdVector3 *triangle, int partId, int triangleIndex)
SimdVector3 GetSupportVertexWorldSpace ()
SimdVector3 GetSupportVertexLocal ()

Public Attributes

SimdTransform m_worldTrans
SimdScalar m_maxDot
SimdVector3 m_supportVecLocal

Private Attributes

SimdVector3 m_supportVertexLocal

Detailed Description

Definition at line 78 of file TriangleMeshShape.cpp.

Constructor & Destructor Documentation

SupportVertexCallback::SupportVertexCallback | ( | const SimdVector3 & | supportVecWorld,
 |  | const SimdTransform & | trans
 | ) | [inline]

Definition at line 88 of file TriangleMeshShape.cpp.

References SimdTransform::getBasis(), m_supportVecLocal, and m_worldTrans.

Member Function Documentation

SimdVector3 SupportVertexCallback::GetSupportVertexLocal ( ) [inline]

Definition at line 113 of file TriangleMeshShape.cpp.

References m_supportVertexLocal.

Referenced by TriangleMeshShape::LocalGetSupportingVertex().

SimdVector3 SupportVertexCallback::GetSupportVertexWorldSpace ( ) [inline]

Definition at line 108 of file TriangleMeshShape.cpp.

References m_supportVertexLocal, and m_worldTrans.

virtual void SupportVertexCallback::ProcessTriangle | ( | SimdVector3 * | triangle,
 |  | int | partId,
 |  | int | triangleIndex
 | ) | [inline, virtual]

Implements TriangleCallback.

Definition at line 95 of file TriangleMeshShape.cpp.

References SimdVector3::dot(), dot(), m_maxDot, m_supportVecLocal, and m_supportVertexLocal.

Member Data Documentation

SimdScalar SupportVertexCallback::m_maxDot

Definition at line 85 of file TriangleMeshShape.cpp.

Referenced by ProcessTriangle().

SimdVector3 SupportVertexCallback::m_supportVecLocal

Definition at line 86 of file TriangleMeshShape.cpp.

Referenced by ProcessTriangle(), and SupportVertexCallback().

SimdVector3 SupportVertexCallback::m_supportVertexLocal [private]

Definition at line 81 of file TriangleMeshShape.cpp.

Referenced by GetSupportVertexLocal(), GetSupportVertexWorldSpace(), and ProcessTriangle().

SimdTransform SupportVertexCallback::m_worldTrans

Definition at line 84 of file TriangleMeshShape.cpp.

Referenced by GetSupportVertexWorldSpace(), and SupportVertexCallback().

The documentation for this class was generated from the following file:
  • TriangleMeshShape.cpp
Generated on Wed May 24 14:00:35 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

SupportVertexCallback Member List

This is the complete list of members for SupportVertexCallback, including all inherited members.

GetSupportVertexLocal() | SupportVertexCallback | [inline]
GetSupportVertexWorldSpace() | SupportVertexCallback | [inline]
m_maxDot | SupportVertexCallback |
m_supportVecLocal | SupportVertexCallback |
m_supportVertexLocal | SupportVertexCallback | [private]
m_worldTrans | SupportVertexCallback |
ProcessTriangle(SimdVector3 *triangle, int partId, int triangleIndex) | SupportVertexCallback | [inline, virtual]
SupportVertexCallback(const SimdVector3 &supportVecWorld, const SimdTransform &trans) | SupportVertexCallback | [inline]
~TriangleCallback() | TriangleCallback | [virtual]

Generated on Wed May 24 14:00:35 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleCallback Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TriangleCallback Class Reference

#include <TriangleCallback.h>

Inheritance diagram for TriangleCallback:

[legend]
List of all members.

Public Member Functions

virtual | ~TriangleCallback ()
virtual void | ProcessTriangle (SimdVector3 *triangle, int partId, int triangleIndex)=0

Detailed Description

Definition at line 22 of file TriangleCallback.h.

Constructor & Destructor Documentation

TriangleCallback::~TriangleCallback ( ) [virtual]

Definition at line 18 of file TriangleCallback.cpp.

Member Function Documentation

virtual void TriangleCallback::ProcessTriangle | ( | SimdVector3 * | triangle,
 |  | int | partId,
 |  | int | triangleIndex
 | ) | [pure virtual]

Implemented in BoxTriangleCallback, SupportVertexCallback, and TriangleRaycastCallback.

The documentation for this class was generated from the following files:
  • TriangleCallback.h
  • TriangleCallback.cpp
Generated on Wed May 24 14:00:35 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TriangleCallback Member List

This is the complete list of members for TriangleCallback, including all inherited members.

ProcessTriangle(SimdVector3 *triangle, int partId, int triangleIndex)=0 | TriangleCallback | [pure virtual]
~TriangleCallback() | TriangleCallback | [virtual]

Generated on Wed May 24 14:00:35 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleIndexVertexArray Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TriangleIndexVertexArray Class Reference

#include <TriangleIndexVertexArray.h>

Inheritance diagram for TriangleIndexVertexArray:

[legend]
Collaboration diagram for TriangleIndexVertexArray:

[legend]
List of all members.

Public Member Functions

TriangleIndexVertexArray (int numTriangleIndices, int *triangleIndexBase, int triangleIndexStride, int numVertices, float *vertexBase, int vertexStride)
virtual void | getLockedVertexIndexBase (unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &vertexStride, unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0)
get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished
virtual void | getLockedReadOnlyVertexIndexBase (const unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &vertexStride, const unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) const
virtual void | unLockVertexBase (int subpart)
unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
virtual void | unLockReadOnlyVertexBase (int subpart) const
virtual int | getNumSubParts () const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices
virtual void | preallocateVertices (int numverts)
virtual void | preallocateIndices (int numindices)

Private Attributes

int | m_numTriangleIndices
int * | m_triangleIndexBase
int | m_triangleIndexStride
int | m_numVertices
float * | m_vertexBase
int | m_vertexStride

Detailed Description

Definition at line 19 of file TriangleIndexVertexArray.h.

Constructor & Destructor Documentation

TriangleIndexVertexArray::TriangleIndexVertexArray | ( | int | numTriangleIndices,
 |  | int * | triangleIndexBase,
 |  | int | triangleIndexStride,
 |  | int | numVertices,
 |  | float * | vertexBase,
 |  | int | vertexStride
 | ) |

Definition at line 18 of file TriangleIndexVertexArray.cpp.

Member Function Documentation

void TriangleIndexVertexArray::getLockedReadOnlyVertexIndexBase | ( | const unsigned char ** | vertexbase,
 |  | int & | numverts,
 |  | PHY_ScalarType & | type,
 |  | int & | vertexStride,
 |  | const unsigned char ** | indexbase,
 |  | int & | indexstride,
 |  | int & | numfaces,
 |  | PHY_ScalarType & | indicestype,
 |  | int | subpart = 0
 | ) | const [virtual]

Implements StridingMeshInterface.

Definition at line 41 of file TriangleIndexVertexArray.cpp.

References m_numTriangleIndices, m_numVertices, m_triangleIndexBase, m_triangleIndexStride, m_vertexBase, m_vertexStride, PHY_FLOAT, and PHY_INTEGER.

void TriangleIndexVertexArray::getLockedVertexIndexBase | ( | unsigned char ** | vertexbase,
 |  | int & | numverts,
 |  | PHY_ScalarType & | type,
 |  | int & | vertexStride,
 |  | unsigned char ** | indexbase,
 |  | int & | indexstride,
 |  | int & | numfaces,
 |  | PHY_ScalarType & | indicestype,
 |  | int | subpart = 0
 | ) | [virtual]

get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished

Implements StridingMeshInterface.

Definition at line 28 of file TriangleIndexVertexArray.cpp.

References m_numTriangleIndices, m_numVertices, m_triangleIndexBase, m_triangleIndexStride, m_vertexBase, m_vertexStride, PHY_FLOAT, and PHY_INTEGER.

virtual int TriangleIndexVertexArray::getNumSubParts ( ) const [inline, virtual]

getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices

Implements StridingMeshInterface.

Definition at line 45 of file TriangleIndexVertexArray.h.

virtual void TriangleIndexVertexArray::preallocateIndices ( int numindices ) [inline, virtual]

Implements StridingMeshInterface.

Definition at line 48 of file TriangleIndexVertexArray.h.

virtual void TriangleIndexVertexArray::preallocateVertices ( int numverts ) [inline, virtual]

Implements StridingMeshInterface.

Definition at line 47 of file TriangleIndexVertexArray.h.

virtual void TriangleIndexVertexArray::unLockReadOnlyVertexBase ( int subpart ) const [inline, virtual]

Implements StridingMeshInterface.

Definition at line 41 of file TriangleIndexVertexArray.h.

virtual void TriangleIndexVertexArray::unLockVertexBase ( int subpart ) [inline, virtual]

unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished

Implements StridingMeshInterface.

Definition at line 39 of file TriangleIndexVertexArray.h.

Member Data Documentation

int TriangleIndexVertexArray::m_numTriangleIndices [private]

Definition at line 22 of file TriangleIndexVertexArray.h.

Referenced by getLockedReadOnlyVertexIndexBase(), and getLockedVertexIndexBase().

int TriangleIndexVertexArray::m_numVertices [private]

Definition at line 25 of file TriangleIndexVertexArray.h.

Referenced by getLockedReadOnlyVertexIndexBase(), and getLockedVertexIndexBase().

int* TriangleIndexVertexArray::m_triangleIndexBase [private]

Definition at line 23 of file TriangleIndexVertexArray.h.

Referenced by getLockedReadOnlyVertexIndexBase(), and getLockedVertexIndexBase().

int TriangleIndexVertexArray::m_triangleIndexStride [private]

Definition at line 24 of file TriangleIndexVertexArray.h.

Referenced by getLockedReadOnlyVertexIndexBase(), and getLockedVertexIndexBase().

float* TriangleIndexVertexArray::m_vertexBase [private]

Definition at line 26 of file TriangleIndexVertexArray.h.

Referenced by getLockedReadOnlyVertexIndexBase(), and getLockedVertexIndexBase().

int TriangleIndexVertexArray::m_vertexStride [private]

Definition at line 27 of file TriangleIndexVertexArray.h.

Referenced by getLockedReadOnlyVertexIndexBase(), and getLockedVertexIndexBase().

The documentation for this class was generated from the following files:
  • TriangleIndexVertexArray.h
  • TriangleIndexVertexArray.cpp
Generated on Wed May 24 14:00:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TriangleIndexVertexArray Member List

This is the complete list of members for TriangleIndexVertexArray, including all inherited members.

getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &vertexStride, const unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) const | TriangleIndexVertexArray | [virtual]
getLockedVertexIndexBase(unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &vertexStride, unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) | TriangleIndexVertexArray | [virtual]
getNumSubParts() const | TriangleIndexVertexArray | [inline, virtual]
getScaling() const | StridingMeshInterface | [inline]
InternalProcessAllTriangles(InternalTriangleIndexCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | StridingMeshInterface |
m_numTriangleIndices | TriangleIndexVertexArray | [private]
m_numVertices | TriangleIndexVertexArray | [private]
m_scaling | StridingMeshInterface | [protected]
m_triangleIndexBase | TriangleIndexVertexArray | [private]
m_triangleIndexStride | TriangleIndexVertexArray | [private]
m_vertexBase | TriangleIndexVertexArray | [private]
m_vertexStride | TriangleIndexVertexArray | [private]
preallocateIndices(int numindices) | TriangleIndexVertexArray | [inline, virtual]
preallocateVertices(int numverts) | TriangleIndexVertexArray | [inline, virtual]
setScaling(const SimdVector3 &scaling) | StridingMeshInterface | [inline]
StridingMeshInterface() | StridingMeshInterface | [inline]
TriangleIndexVertexArray(int numTriangleIndices, int *triangleIndexBase, int triangleIndexStride, int numVertices, float *vertexBase, int vertexStride) | TriangleIndexVertexArray |
unLockReadOnlyVertexBase(int subpart) const | TriangleIndexVertexArray | [inline, virtual]
unLockVertexBase(int subpart) | TriangleIndexVertexArray | [inline, virtual]
~StridingMeshInterface() | StridingMeshInterface | [virtual]

Generated on Wed May 24 14:00:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMesh Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TriangleMesh Class Reference

TriangleMesh provides storage for a concave triangle mesh. It can be used as data for the TriangleMeshShape. More...

#include <TriangleMesh.h>

Inheritance diagram for TriangleMesh:

[legend]
Collaboration diagram for TriangleMesh:

[legend]
List of all members.

Public Member Functions

TriangleMesh ()
void | AddTriangle (const SimdVector3 &vertex0, const SimdVector3 &vertex1, const SimdVector3 &vertex2)
virtual void | getLockedVertexIndexBase (unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0)
get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished
virtual void | getLockedReadOnlyVertexIndexBase (const unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, const unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) const
virtual void | unLockVertexBase (int subpart)
unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
virtual void | unLockReadOnlyVertexBase (int subpart) const
virtual int | getNumSubParts () const
getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices
virtual void | preallocateVertices (int numverts)
virtual void | preallocateIndices (int numindices)

Private Attributes

std::vector< MyTriangle > | m_triangles

Detailed Description

TriangleMesh provides storage for a concave triangle mesh. It can be used as data for the TriangleMeshShape.

Definition at line 32 of file TriangleMesh.h.

Constructor & Destructor Documentation

TriangleMesh::TriangleMesh ( )

Definition at line 21 of file TriangleMesh.cpp.

Member Function Documentation

void TriangleMesh::AddTriangle | ( | const SimdVector3 & | vertex0,
 |  | const SimdVector3 & | vertex1,
 |  | const SimdVector3 & | vertex2
 | ) | [inline]

Definition at line 40 of file TriangleMesh.h.

References m_triangles, MyTriangle::m_vert0, MyTriangle::m_vert1, and MyTriangle::m_vert2.

void TriangleMesh::getLockedReadOnlyVertexIndexBase | ( | const unsigned char ** | vertexbase,
 |  | int & | numverts,
 |  | PHY_ScalarType & | type,
 |  | int & | stride,
 |  | const unsigned char ** | indexbase,
 |  | int & | indexstride,
 |  | int & | numfaces,
 |  | PHY_ScalarType & | indicestype,
 |  | int | subpart = 0
 | ) | const [virtual]

Implements StridingMeshInterface.

Definition at line 41 of file TriangleMesh.cpp.

References m_triangles, myindices, PHY_FLOAT, and PHY_INTEGER.

void TriangleMesh::getLockedVertexIndexBase | ( | unsigned char ** | vertexbase,
 |  | int & | numverts,
 |  | PHY_ScalarType & | type,
 |  | int & | stride,
 |  | unsigned char ** | indexbase,
 |  | int & | indexstride,
 |  | int & | numfaces,
 |  | PHY_ScalarType & | indicestype,
 |  | int | subpart = 0
 | ) | [virtual]

get read and write access to a subpart of a triangle mesh this subpart has a continuous array of vertices and indices in this way the mesh can be handled as chunks of memory with striding very similar to OpenGL vertexarray support make a call to unLockVertexBase when the read and write access is finished

Implements StridingMeshInterface.

Definition at line 26 of file TriangleMesh.cpp.

References m_triangles, myindices, PHY_FLOAT, and PHY_INTEGER.

int TriangleMesh::getNumSubParts ( ) const [virtual]

getNumSubParts returns the number of seperate subparts each subpart has a continuous array of vertices and indices

Implements StridingMeshInterface.

Definition at line 58 of file TriangleMesh.cpp.

References m_triangles.

virtual void TriangleMesh::preallocateIndices ( int numindices ) [inline, virtual]

Implements StridingMeshInterface.

Definition at line 67 of file TriangleMesh.h.

virtual void TriangleMesh::preallocateVertices ( int numverts ) [inline, virtual]

Implements StridingMeshInterface.

Definition at line 66 of file TriangleMesh.h.

virtual void TriangleMesh::unLockReadOnlyVertexBase ( int subpart ) const [inline, virtual]

Implements StridingMeshInterface.

Definition at line 60 of file TriangleMesh.h.

virtual void TriangleMesh::unLockVertexBase ( int subpart ) [inline, virtual]

unLockVertexBase finishes the access to a subpart of the triangle mesh make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished

Implements StridingMeshInterface.

Definition at line 58 of file TriangleMesh.h.

Member Data Documentation

std::vector<MyTriangle> TriangleMesh::m_triangles [private]

Definition at line 34 of file TriangleMesh.h.

Referenced by AddTriangle(), getLockedReadOnlyVertexIndexBase(), getLockedVertexIndexBase(), and getNumSubParts().

The documentation for this class was generated from the following files:
  • TriangleMesh.h
  • TriangleMesh.cpp
Generated on Wed May 24 14:00:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TriangleMesh Member List

This is the complete list of members for TriangleMesh, including all inherited members.

AddTriangle(const SimdVector3 &vertex0, const SimdVector3 &vertex1, const SimdVector3 &vertex2) | TriangleMesh | [inline]
getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, const unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) const | TriangleMesh | [virtual]
getLockedVertexIndexBase(unsigned char **vertexbase, int &numverts, PHY_ScalarType &type, int &stride, unsigned char **indexbase, int &indexstride, int &numfaces, PHY_ScalarType &indicestype, int subpart=0) | TriangleMesh | [virtual]
getNumSubParts() const | TriangleMesh | [virtual]
getScaling() const | StridingMeshInterface | [inline]
InternalProcessAllTriangles(InternalTriangleIndexCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | StridingMeshInterface |
m_scaling | StridingMeshInterface | [protected]
m_triangles | TriangleMesh | [private]
preallocateIndices(int numindices) | TriangleMesh | [inline, virtual]
preallocateVertices(int numverts) | TriangleMesh | [inline, virtual]
setScaling(const SimdVector3 &scaling) | StridingMeshInterface | [inline]
StridingMeshInterface() | StridingMeshInterface | [inline]
TriangleMesh() | TriangleMesh |
unLockReadOnlyVertexBase(int subpart) const | TriangleMesh | [inline, virtual]
unLockVertexBase(int subpart) | TriangleMesh | [inline, virtual]
~StridingMeshInterface() | StridingMeshInterface | [virtual]

Generated on Wed May 24 14:00:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleMeshShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TriangleMeshShape Class Reference

Concave triangle mesh. Uses an interface to access the triangles to allow for sharing graphics/physics triangles. More...

#include <TriangleMeshShape.h>

Inheritance diagram for TriangleMeshShape:

[legend]
Collaboration diagram for TriangleMeshShape:

[legend]
List of all members.

Public Member Functions

TriangleMeshShape (StridingMeshInterface *meshInterface)
virtual | ~TriangleMeshShape ()
virtual SimdVector3 | LocalGetSupportingVertex (const SimdVector3 &vec) const
virtual SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &vec) const
void | RecalcLocalAabb ()
virtual int | GetShapeType () const
virtual void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
virtual void | ProcessAllTriangles (TriangleCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual void | setLocalScaling (const SimdVector3 &scaling)
virtual const SimdVector3 & | getLocalScaling () const
virtual char * | GetName () const
virtual float | GetMargin () const
virtual void | SetMargin (float collisionMargin)

Protected Attributes

StridingMeshInterface * m_meshInterface
SimdVector3 m_localAabbMin
SimdVector3 m_localAabbMax
float | m_collisionMargin

Detailed Description

Concave triangle mesh. Uses an interface to access the triangles to allow for sharing graphics/physics triangles.

Definition at line 28 of file TriangleMeshShape.h.

Constructor & Destructor Documentation

TriangleMeshShape::TriangleMeshShape ( StridingMeshInterface * meshInterface )

Definition at line 25 of file TriangleMeshShape.cpp.

References RecalcLocalAabb().

TriangleMeshShape::~TriangleMeshShape ( ) [virtual]

Definition at line 33 of file TriangleMeshShape.cpp.

Member Function Documentation

void TriangleMeshShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [virtual]

Implements CollisionShape.

Definition at line 178 of file TriangleMeshShape.cpp.

References SimdQuadWord::setValue().

void TriangleMeshShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [virtual]

Implements CollisionShape.

Definition at line 41 of file TriangleMeshShape.cpp.

References SimdMatrix3x3::absolute(), dot(), SimdTransform::getBasis(), GetMargin(), m_localAabbMax, and m_localAabbMin.

const SimdVector3 & TriangleMeshShape::getLocalScaling ( ) const [virtual]

Implements CollisionShape.

Definition at line 127 of file TriangleMeshShape.cpp.

References StridingMeshInterface::getScaling(), and m_meshInterface.

Referenced by BvhTriangleMeshShape::setLocalScaling().

virtual float TriangleMeshShape::GetMargin ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 72 of file TriangleMeshShape.h.

References m_collisionMargin.

Referenced by GetAabb(), and ConvexConcaveCollisionAlgorithm::ProcessCollision().

virtual char* TriangleMeshShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Reimplemented in BvhTriangleMeshShape.

Definition at line 69 of file TriangleMeshShape.h.

virtual int TriangleMeshShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 53 of file TriangleMeshShape.h.

References TRIANGLE_MESH_SHAPE_PROXYTYPE.

SimdVector3 TriangleMeshShape::LocalGetSupportingVertex ( const SimdVector3 & vec ) const [virtual]

Definition at line 186 of file TriangleMeshShape.cpp.

References SupportVertexCallback::GetSupportVertexLocal(), ProcessAllTriangles(), and SimdTransform::setIdentity().

Referenced by LocalGetSupportingVertexWithoutMargin(), and RecalcLocalAabb().

virtual SimdVector3 TriangleMeshShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & vec ) const [inline, virtual]

Definition at line 45 of file TriangleMeshShape.h.

References LocalGetSupportingVertex().

void TriangleMeshShape::ProcessAllTriangles | ( | TriangleCallback * | callback,
 |  | const SimdVector3 & | aabbMin,
 |  | const SimdVector3 & | aabbMax
 | ) | const [virtual]

Reimplemented in BvhTriangleMeshShape.

Definition at line 140 of file TriangleMeshShape.cpp.

References StridingMeshInterface::InternalProcessAllTriangles(), m_meshInterface, and TestTriangleAgainstAabb2().

Referenced by ConvexConcaveCollisionAlgorithm::CalculateTimeOfImpact(), LocalGetSupportingVertex(), BvhTriangleMeshShape::ProcessAllTriangles(), and ConvexConcaveCollisionAlgorithm::ProcessCollision().

void TriangleMeshShape::RecalcLocalAabb ( )

Definition at line 62 of file TriangleMeshShape.cpp.

References LocalGetSupportingVertex(), m_collisionMargin, m_localAabbMax, and m_localAabbMin.

Referenced by setLocalScaling(), and TriangleMeshShape().

void TriangleMeshShape::setLocalScaling ( const SimdVector3 & scaling ) [virtual]

Implements CollisionShape.

Reimplemented in BvhTriangleMeshShape.

Definition at line 121 of file TriangleMeshShape.cpp.

References m_meshInterface, RecalcLocalAabb(), and StridingMeshInterface::setScaling().

Referenced by BvhTriangleMeshShape::setLocalScaling().

virtual void TriangleMeshShape::SetMargin ( float collisionMargin ) [inline, virtual]

Implements CollisionShape.

Definition at line 75 of file TriangleMeshShape.h.

References m_collisionMargin.

Member Data Documentation

float TriangleMeshShape::m_collisionMargin [protected]

Definition at line 34 of file TriangleMeshShape.h.

Referenced by GetMargin(), RecalcLocalAabb(), and SetMargin().

SimdVector3 TriangleMeshShape::m_localAabbMax [protected]

Definition at line 33 of file TriangleMeshShape.h.

Referenced by GetAabb(), and RecalcLocalAabb().

SimdVector3 TriangleMeshShape::m_localAabbMin [protected]

Definition at line 32 of file TriangleMeshShape.h.

Referenced by GetAabb(), and RecalcLocalAabb().

StridingMeshInterface* TriangleMeshShape::m_meshInterface [protected]

Definition at line 31 of file TriangleMeshShape.h.

Referenced by getLocalScaling(), ProcessAllTriangles(), BvhTriangleMeshShape::ProcessAllTriangles(), setLocalScaling(), and BvhTriangleMeshShape::setLocalScaling().

The documentation for this class was generated from the following files:
  • TriangleMeshShape.h
  • TriangleMeshShape.cpp
Generated on Wed May 24 14:00:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TriangleMeshShape Member List

This is the complete list of members for TriangleMeshShape, including all inherited members.

CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | TriangleMeshShape | [virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | TriangleMeshShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | TriangleMeshShape | [virtual]
GetMargin() const | TriangleMeshShape | [inline, virtual]
GetName() const | TriangleMeshShape | [inline, virtual]
GetShapeType() const | TriangleMeshShape | [inline, virtual]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | TriangleMeshShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &vec) const | TriangleMeshShape | [inline, virtual]
m_collisionMargin | TriangleMeshShape | [protected]
m_localAabbMax | TriangleMeshShape | [protected]
m_localAabbMin | TriangleMeshShape | [protected]
m_meshInterface | TriangleMeshShape | [protected]
m_tempDebug | CollisionShape |
ProcessAllTriangles(TriangleCallback *callback, const SimdVector3 &aabbMin, const SimdVector3 &aabbMax) const | TriangleMeshShape | [virtual]
RecalcLocalAabb() | TriangleMeshShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | TriangleMeshShape | [virtual]
SetMargin(float collisionMargin) | TriangleMeshShape | [inline, virtual]
TriangleMeshShape(StridingMeshInterface *meshInterface) | TriangleMeshShape |
~CollisionShape() | CollisionShape | [inline, virtual]
~TriangleMeshShape() | TriangleMeshShape | [virtual]

Generated on Wed May 24 14:00:37 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleRaycastCallback Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TriangleRaycastCallback Class Reference

#include <RaycastCallback.h>

Inheritance diagram for TriangleRaycastCallback:

[legend]
Collaboration diagram for TriangleRaycastCallback:

[legend]
List of all members.

Public Member Functions

TriangleRaycastCallback (const SimdVector3 &from, const SimdVector3 &to)
virtual void | ProcessTriangle (SimdVector3 *triangle, int partId, int triangleIndex)
virtual float | ReportHit (const SimdVector3 &hitNormalLocal, float hitFraction, int partId, int triangleIndex)=0

Public Attributes

SimdVector3 m_from
SimdVector3 m_to
float | m_hitFraction

Detailed Description

Definition at line 23 of file RaycastCallback.h.

Constructor & Destructor Documentation

TriangleRaycastCallback::TriangleRaycastCallback | ( | const SimdVector3 & | from,
 |  | const SimdVector3 & | to
 | ) |

Definition at line 19 of file RaycastCallback.cpp.

Member Function Documentation

void TriangleRaycastCallback::ProcessTriangle | ( | SimdVector3 * | triangle,
 |  | int | partId,
 |  | int | triangleIndex
 | ) | [virtual]

Implements TriangleCallback.

Definition at line 30 of file RaycastCallback.cpp.

References SimdVector3::cross(), distance(), SimdVector3::dot(), SimdVector3::length2(), m_from, m_hitFraction, m_to, ReportHit(), and SimdVector3::setInterpolate3().

virtual float TriangleRaycastCallback::ReportHit | ( | const SimdVector3 & | hitNormalLocal,
 |  | float | hitFraction,
 |  | int | partId,
 |  | int | triangleIndex
 | ) | [pure virtual]

Referenced by ProcessTriangle().

Member Data Documentation

SimdVector3 TriangleRaycastCallback::m_from

Definition at line 28 of file RaycastCallback.h.

Referenced by ProcessTriangle().

float TriangleRaycastCallback::m_hitFraction

Definition at line 31 of file RaycastCallback.h.

Referenced by ProcessTriangle().

SimdVector3 TriangleRaycastCallback::m_to

Definition at line 29 of file RaycastCallback.h.

Referenced by ProcessTriangle().

The documentation for this class was generated from the following files:
  • RaycastCallback.h
  • RaycastCallback.cpp
Generated on Wed May 24 14:00:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TriangleRaycastCallback Member List

This is the complete list of members for TriangleRaycastCallback, including all inherited members.

m_from | TriangleRaycastCallback |
m_hitFraction | TriangleRaycastCallback |
m_to | TriangleRaycastCallback |
ProcessTriangle(SimdVector3 *triangle, int partId, int triangleIndex) | TriangleRaycastCallback | [virtual]
ReportHit(const SimdVector3 &hitNormalLocal, float hitFraction, int partId, int triangleIndex)=0 | TriangleRaycastCallback | [pure virtual]
TriangleRaycastCallback(const SimdVector3 &from, const SimdVector3 &to) | TriangleRaycastCallback |
~TriangleCallback() | TriangleCallback | [virtual]

Generated on Wed May 24 14:00:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TriangleShape Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TriangleShape Class Reference

#include <TriangleShape.h>

Inheritance diagram for TriangleShape:

[legend]
Collaboration diagram for TriangleShape:

[legend]
List of all members.

Public Member Functions

virtual int | GetNumVertices () const
const SimdVector3 & | GetVertexPtr (int index) const
virtual void | GetVertex (int index, SimdVector3 &vert) const
virtual int | GetShapeType () const
virtual int | GetNumEdges () const
virtual void | GetEdge (int i, SimdPoint3 &pa, SimdPoint3 &pb) const
virtual void | GetAabb (const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const
GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.
SimdVector3 | LocalGetSupportingVertexWithoutMargin (const SimdVector3 &dir) const
virtual void | BatchedUnitVectorGetSupportingVertexWithoutMargin (const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const
TriangleShape (const SimdVector3 &p0, const SimdVector3 &p1, const SimdVector3 &p2)
virtual void | GetPlane (SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const
virtual int | GetNumPlanes () const
void | CalcNormal (SimdVector3 &normal) const
virtual void | GetPlaneEquation (int i, SimdVector3 &planeNormal, SimdPoint3 &planeSupport) const
virtual void | CalculateLocalInertia (SimdScalar mass, SimdVector3 &inertia)
virtual bool | IsInside (const SimdPoint3 &pt, SimdScalar tolerance) const
virtual char * | GetName () const

Public Attributes

SimdVector3 | m_vertices1 [3]

Detailed Description

Definition at line 22 of file TriangleShape.h.

Constructor & Destructor Documentation

TriangleShape::TriangleShape | ( | const SimdVector3 & | p0,
 |  | const SimdVector3 & | p1,
 |  | const SimdVector3 & | p2
 | ) | [inline]

Definition at line 86 of file TriangleShape.h.

References m_vertices1.

Member Function Documentation

virtual void TriangleShape::BatchedUnitVectorGetSupportingVertexWithoutMargin | ( | const SimdVector3 * | vectors,
 |  | SimdVector3 * | supportVerticesOut,
 |  | int | numVectors
 | ) | const [inline, virtual]

Reimplemented from PolyhedralConvexShape.

Definition at line 73 of file TriangleShape.h.

References SimdVector3::dot(), m_vertices1, and SimdVector3::maxAxis().

void TriangleShape::CalcNormal ( SimdVector3 & normal ) const [inline]

Definition at line 105 of file TriangleShape.h.

References cross(), m_vertices1, and SimdVector3::normalize().

Referenced by GetPlaneEquation(), and IsInside().

virtual void TriangleShape::CalculateLocalInertia | ( | SimdScalar | mass,
 |  | SimdVector3 & | inertia
 | ) | [inline, virtual]

Reimplemented from PolyhedralConvexShape.

Definition at line 117 of file TriangleShape.h.

References ASSERT, and SimdQuadWord::setValue().

virtual void TriangleShape::GetAabb | ( | const SimdTransform & | t,
 |  | SimdVector3 & | aabbMin,
 |  | SimdVector3 & | aabbMax
 | ) | const [inline, virtual]

GetAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version.

Reimplemented from ConvexShape.

Definition at line 60 of file TriangleShape.h.

References ConvexShape::GetAabbSlow().

virtual void TriangleShape::GetEdge | ( | int | i,
 |  | SimdPoint3 & | pa,
 |  | SimdPoint3 & | pb
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 54 of file TriangleShape.h.

References GetVertex().

Referenced by IsInside().

virtual char* TriangleShape::GetName ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 155 of file TriangleShape.h.

virtual int TriangleShape::GetNumEdges ( ) const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 49 of file TriangleShape.h.

virtual int TriangleShape::GetNumPlanes ( ) const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 100 of file TriangleShape.h.

virtual int TriangleShape::GetNumVertices ( ) const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 31 of file TriangleShape.h.

virtual void TriangleShape::GetPlane | ( | SimdVector3 & | planeNormal,
 |  | SimdPoint3 & | planeSupport,
 |  | int | i
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 95 of file TriangleShape.h.

References GetPlaneEquation().

virtual void TriangleShape::GetPlaneEquation | ( | int | i,
 |  | SimdVector3 & | planeNormal,
 |  | SimdPoint3 & | planeSupport
 | ) | const [inline, virtual]

Definition at line 111 of file TriangleShape.h.

References CalcNormal(), and m_vertices1.

Referenced by GetPlane().

virtual int TriangleShape::GetShapeType ( ) const [inline, virtual]

Implements CollisionShape.

Definition at line 44 of file TriangleShape.h.

References TRIANGLE_SHAPE_PROXYTYPE.

virtual void TriangleShape::GetVertex | ( | int | index,
 |  | SimdVector3 & | vert
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 40 of file TriangleShape.h.

References m_vertices1.

Referenced by GetEdge().

const SimdVector3& TriangleShape::GetVertexPtr ( int index ) const [inline]

Definition at line 36 of file TriangleShape.h.

References m_vertices1.

virtual bool TriangleShape::IsInside | ( | const SimdPoint3 & | pt,
 |  | SimdScalar | tolerance
 | ) | const [inline, virtual]

Implements PolyhedralConvexShape.

Definition at line 123 of file TriangleShape.h.

References CalcNormal(), SimdVector3::cross(), SimdVector3::dot(), GetEdge(), m_vertices1, and SimdVector3::normalize().

SimdVector3 TriangleShape::LocalGetSupportingVertexWithoutMargin ( const SimdVector3 & dir ) const [inline, virtual]

Reimplemented from PolyhedralConvexShape.

Definition at line 66 of file TriangleShape.h.

References SimdVector3::dot(), m_vertices1, and SimdVector3::maxAxis().

Member Data Documentation

SimdVector3 TriangleShape::m_vertices1[3]

Definition at line 28 of file TriangleShape.h.

Referenced by BatchedUnitVectorGetSupportingVertexWithoutMargin(), CalcNormal(), GetPlaneEquation(), GetVertex(), GetVertexPtr(), IsInside(), LocalGetSupportingVertexWithoutMargin(), and TriangleShape().

The documentation for this class was generated from the following file:
  • TriangleShape.h
Generated on Wed May 24 14:00:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TriangleShape Member List

This is the complete list of members for TriangleShape, including all inherited members.

BatchedUnitVectorGetSupportingVertexWithoutMargin(const SimdVector3 *vectors, SimdVector3 *supportVerticesOut, int numVectors) const | TriangleShape | [inline, virtual]
CalcNormal(SimdVector3 &normal) const | TriangleShape | [inline]
CalculateLocalInertia(SimdScalar mass, SimdVector3 &inertia) | TriangleShape | [inline, virtual]
CalculateTemporalAabb(const SimdTransform &curTrans, const SimdVector3 &linvel, const SimdVector3 &angvel, SimdScalar timeStep, SimdVector3 &temporalAabbMin, SimdVector3 &temporalAabbMax) | CollisionShape |
CollisionShape() | CollisionShape | [inline]
ConvexShape() | ConvexShape |
GetAabb(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | TriangleShape | [inline, virtual]
GetAabbSlow(const SimdTransform &t, SimdVector3 &aabbMin, SimdVector3 &aabbMax) const | ConvexShape | [virtual]
GetAngularMotionDisc() const | CollisionShape | [virtual]
GetBoundingSphere(SimdVector3 &center, SimdScalar &radius) const | CollisionShape | [virtual]
GetEdge(int i, SimdPoint3 &pa, SimdPoint3 &pb) const | TriangleShape | [inline, virtual]
GetExtraDebugInfo() const | CollisionShape | [inline]
getLocalScaling() const | ConvexShape | [inline, virtual]
GetMargin() const | ConvexShape | [inline, virtual]
GetName() const | TriangleShape | [inline, virtual]
GetNumEdges() const | TriangleShape | [inline, virtual]
GetNumPlanes() const | TriangleShape | [inline, virtual]
GetNumVertices() const | TriangleShape | [inline, virtual]
GetPlane(SimdVector3 &planeNormal, SimdPoint3 &planeSupport, int i) const | TriangleShape | [inline, virtual]
GetPlaneEquation(int i, SimdVector3 &planeNormal, SimdPoint3 &planeSupport) const | TriangleShape | [inline, virtual]
GetShapeType() const | TriangleShape | [inline, virtual]
GetVertex(int index, SimdVector3 &vert) const | TriangleShape | [inline, virtual]
GetVertexPtr(int index) const | TriangleShape | [inline]
IsConcave() const | CollisionShape | [inline]
IsConvex() const | CollisionShape | [inline]
IsInside(const SimdPoint3 &pt, SimdScalar tolerance) const | TriangleShape | [inline, virtual]
IsPolyhedral() const | CollisionShape | [inline]
LocalGetSupportingVertex(const SimdVector3 &vec) const | ConvexShape | [virtual]
LocalGetSupportingVertexWithoutMargin(const SimdVector3 &dir) const | TriangleShape | [inline, virtual]
m_localScaling | ConvexShape | [protected]
m_optionalHull | PolyhedralConvexShape |
m_tempDebug | CollisionShape |
m_vertices1 | TriangleShape |
PolyhedralConvexShape() | PolyhedralConvexShape |
SetExtraDebugInfo(const char *extraDebugInfo) | CollisionShape | [inline]
setLocalScaling(const SimdVector3 &scaling) | ConvexShape | [virtual]
SetMargin(float margin) | ConvexShape | [inline, virtual]
TriangleShape(const SimdVector3 &p0, const SimdVector3 &p1, const SimdVector3 &p2) | TriangleShape | [inline]
~CollisionShape() | CollisionShape | [inline, virtual]
~ConvexShape() | ConvexShape | [virtual]

Generated on Wed May 24 14:00:38 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: TypedConstraint Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

TypedConstraint Class Reference

#include <TypedConstraint.h>

Inheritance diagram for TypedConstraint:

[legend]
Collaboration diagram for TypedConstraint:

[legend]
List of all members.

Public Member Functions

TypedConstraint ()
virtual | ~TypedConstraint ()
TypedConstraint (RigidBody &rbA)
TypedConstraint (RigidBody &rbA, RigidBody &rbB)
virtual void | BuildJacobian ()=0
virtual void | SolveConstraint (SimdScalar timeStep)=0
const RigidBody & | GetRigidBodyA () const
const RigidBody & | GetRigidBodyB () const
int | GetUserConstraintType () const
void | SetUserConstraintType (int userConstraintType)
void | SetUserConstraintId (int uid)
int | GetUserConstraintId ()

Protected Attributes

RigidBody & m_rbA
RigidBody & m_rbB

Private Attributes

int | m_userConstraintType
int | m_userConstraintId

Detailed Description

Definition at line 23 of file TypedConstraint.h.

Constructor & Destructor Documentation

TypedConstraint::TypedConstraint ( )

Definition at line 23 of file TypedConstraint.cpp.

References s_fixed(), and RigidBody::setMassProps().

virtual TypedConstraint::~TypedConstraint ( ) [inline, virtual]

Definition at line 35 of file TypedConstraint.h.

TypedConstraint::TypedConstraint ( RigidBody & rbA )

Definition at line 31 of file TypedConstraint.cpp.

References s_fixed(), and RigidBody::setMassProps().

TypedConstraint::TypedConstraint | ( | RigidBody & | rbA,
 |  | RigidBody & | rbB
 | ) |

Definition at line 42 of file TypedConstraint.cpp.

References s_fixed(), and RigidBody::setMassProps().

Member Function Documentation

virtual void TypedConstraint::BuildJacobian ( ) [pure virtual]

Implemented in HingeConstraint, and Point2PointConstraint.

const RigidBody& TypedConstraint::GetRigidBodyA ( ) const [inline]

Reimplemented in HingeConstraint.

Definition at line 44 of file TypedConstraint.h.

References m_rbA.

Referenced by CcdPhysicsEnvironment::removeCcdPhysicsController().

const RigidBody& TypedConstraint::GetRigidBodyB ( ) const [inline]

Reimplemented in HingeConstraint.

Definition at line 48 of file TypedConstraint.h.

References m_rbB.

Referenced by CcdPhysicsEnvironment::removeCcdPhysicsController().

int TypedConstraint::GetUserConstraintId ( ) [inline]

Definition at line 68 of file TypedConstraint.h.

References m_userConstraintId.

Referenced by CcdPhysicsEnvironment::createConstraint(), CcdPhysicsEnvironment::getConstraintById(), CcdPhysicsEnvironment::removeCcdPhysicsController(), and CcdPhysicsEnvironment::removeConstraint().

int TypedConstraint::GetUserConstraintType ( ) const [inline]

Definition at line 53 of file TypedConstraint.h.

References m_userConstraintType.

void TypedConstraint::SetUserConstraintId ( int uid ) [inline]

Definition at line 63 of file TypedConstraint.h.

References m_userConstraintId.

Referenced by CcdPhysicsEnvironment::createConstraint().

void TypedConstraint::SetUserConstraintType ( int userConstraintType ) [inline]

Definition at line 58 of file TypedConstraint.h.

References m_userConstraintType.

Referenced by CcdPhysicsEnvironment::createConstraint().

virtual void TypedConstraint::SolveConstraint ( SimdScalar timeStep ) [pure virtual]

Implemented in HingeConstraint, and Point2PointConstraint.

Member Data Documentation

RigidBody& TypedConstraint::m_rbA [protected]

Definition at line 29 of file TypedConstraint.h.

Referenced by Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), GetRigidBodyA(), HingeConstraint::GetRigidBodyA(), Point2PointConstraint::SolveConstraint(), and HingeConstraint::SolveConstraint().

RigidBody& TypedConstraint::m_rbB [protected]

Definition at line 30 of file TypedConstraint.h.

Referenced by Point2PointConstraint::BuildJacobian(), HingeConstraint::BuildJacobian(), GetRigidBodyB(), HingeConstraint::GetRigidBodyB(), Point2PointConstraint::SolveConstraint(), and HingeConstraint::SolveConstraint().

int TypedConstraint::m_userConstraintId [private]

Definition at line 26 of file TypedConstraint.h.

Referenced by GetUserConstraintId(), and SetUserConstraintId().

int TypedConstraint::m_userConstraintType [private]

Definition at line 25 of file TypedConstraint.h.

Referenced by GetUserConstraintType(), and SetUserConstraintType().

The documentation for this class was generated from the following files:
  • TypedConstraint.h
  • TypedConstraint.cpp
Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

TypedConstraint Member List

This is the complete list of members for TypedConstraint, including all inherited members.

BuildJacobian()=0 | TypedConstraint | [pure virtual]
GetRigidBodyA() const | TypedConstraint | [inline]
GetRigidBodyB() const | TypedConstraint | [inline]
GetUserConstraintId() | TypedConstraint | [inline]
GetUserConstraintType() const | TypedConstraint | [inline]
m_rbA | TypedConstraint | [protected]
m_rbB | TypedConstraint | [protected]
m_userConstraintId | TypedConstraint | [private]
m_userConstraintType | TypedConstraint | [private]
SetUserConstraintId(int uid) | TypedConstraint | [inline]
SetUserConstraintType(int userConstraintType) | TypedConstraint | [inline]
SolveConstraint(SimdScalar timeStep)=0 | TypedConstraint | [pure virtual]
TypedConstraint() | TypedConstraint |
TypedConstraint(RigidBody &rbA) | TypedConstraint |
TypedConstraint(RigidBody &rbA, RigidBody &rbB) | TypedConstraint |
~TypedConstraint() | TypedConstraint | [inline, virtual]

Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: UnionFind Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

UnionFind Class Reference

UnionFind calculates connected subsets. More...

#include <UnionFind.h>

List of all members.

Public Member Functions

int | find (int x)
UnionFind ()
~UnionFind ()
void | reset (int N)
int | find (int p, int q)
void | unite (int p, int q)
void | Allocate (int N)
void | Free ()

Private Attributes

int * | m_id
int * | m_sz
int | m_N

Detailed Description

UnionFind calculates connected subsets.

Definition at line 20 of file UnionFind.h.

Constructor & Destructor Documentation

UnionFind::UnionFind ( )

Definition at line 41 of file UnionFind.cpp.

UnionFind::~UnionFind ( )

Definition at line 35 of file UnionFind.cpp.

References Free().

Member Function Documentation

void UnionFind::Allocate ( int N )

Definition at line 49 of file UnionFind.cpp.

References Free(), m_id, m_N, and m_sz.

Referenced by reset().

int UnionFind::find | ( | int | p,
 |  | int | q
 | ) |

Definition at line 82 of file UnionFind.cpp.

References find().

int UnionFind::find ( int x )

Definition at line 20 of file UnionFind.cpp.

References m_id, and m_N.

Referenced by find(), and unite().

void UnionFind::Free ( )

Definition at line 60 of file UnionFind.cpp.

References m_id, m_N, and m_sz.

Referenced by Allocate(), and ~UnionFind().

void UnionFind::reset ( int N )

Definition at line 71 of file UnionFind.cpp.

References Allocate(), m_id, m_N, and m_sz.

Referenced by CollisionDispatcher::InitUnionFind().

void UnionFind::unite | ( | int | p,
 |  | int | q
 | ) |

Definition at line 87 of file UnionFind.cpp.

References find(), m_id, and m_sz.

Referenced by CollisionDispatcher::FindUnions().

Member Data Documentation

int* UnionFind::m_id [private]

Definition at line 23 of file UnionFind.h.

Referenced by Allocate(), find(), Free(), reset(), and unite().

int UnionFind::m_N [private]

Definition at line 25 of file UnionFind.h.

Referenced by Allocate(), find(), Free(), and reset().

int* UnionFind::m_sz [private]

Definition at line 24 of file UnionFind.h.

Referenced by Allocate(), Free(), reset(), and unite().

The documentation for this class was generated from the following files:
  • UnionFind.h
  • UnionFind.cpp
Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

UnionFind Member List

This is the complete list of members for UnionFind, including all inherited members.

Allocate(int N) | UnionFind |
find(int x) | UnionFind |
find(int p, int q) | UnionFind |
Free() | UnionFind |
m_id | UnionFind | [private]
m_N | UnionFind | [private]
m_sz | UnionFind | [private]
reset(int N) | UnionFind |
UnionFind() | UnionFind |
unite(int p, int q) | UnionFind |
~UnionFind() | UnionFind |

Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: UsageBitfield Struct Reference

  • Class List
  • Class Hierarchy
  • Class Members

UsageBitfield Struct Reference

#include <VoronoiSimplexSolver.h>

List of all members.

Public Member Functions

UsageBitfield ()
void | reset ()

Public Attributes

unsigned short | usedVertexA: 1
unsigned short | usedVertexB: 1
unsigned short | usedVertexC: 1
unsigned short | usedVertexD: 1
unsigned short | unused1: 1
unsigned short | unused2: 1
unsigned short | unused3: 1
unsigned short | unused4: 1

Detailed Description

Definition at line 27 of file VoronoiSimplexSolver.h.

Constructor & Destructor Documentation

UsageBitfield::UsageBitfield ( ) [inline]

Definition at line 28 of file VoronoiSimplexSolver.h.

References reset().

Member Function Documentation

void UsageBitfield::reset ( ) [inline]

Definition at line 33 of file VoronoiSimplexSolver.h.

References usedVertexA, usedVertexB, usedVertexC, and usedVertexD.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ClosestPtPointTriangle(), SubSimplexClosestResult::Reset(), and UsageBitfield().

Member Data Documentation

unsigned short UsageBitfield::unused1

Definition at line 44 of file VoronoiSimplexSolver.h.

unsigned short UsageBitfield::unused2

Definition at line 45 of file VoronoiSimplexSolver.h.

unsigned short UsageBitfield::unused3

Definition at line 46 of file VoronoiSimplexSolver.h.

unsigned short UsageBitfield::unused4

Definition at line 47 of file VoronoiSimplexSolver.h.

unsigned short UsageBitfield::usedVertexA

Definition at line 40 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ClosestPtPointTriangle(), VoronoiSimplexSolver::ReduceVertices(), reset(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

unsigned short UsageBitfield::usedVertexB

Definition at line 41 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ClosestPtPointTriangle(), VoronoiSimplexSolver::ReduceVertices(), reset(), and VoronoiSimplexSolver::UpdateClosestVectorAndPoints().

unsigned short UsageBitfield::usedVertexC

Definition at line 42 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ClosestPtPointTriangle(), VoronoiSimplexSolver::ReduceVertices(), and reset().

unsigned short UsageBitfield::usedVertexD

Definition at line 43 of file VoronoiSimplexSolver.h.

Referenced by VoronoiSimplexSolver::ClosestPtPointTetrahedron(), VoronoiSimplexSolver::ReduceVertices(), and reset().

The documentation for this struct was generated from the following file:
  • VoronoiSimplexSolver.h
Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

UsageBitfield Member List

This is the complete list of members for UsageBitfield, including all inherited members.

reset() | UsageBitfield | [inline]
unused1 | UsageBitfield |
unused2 | UsageBitfield |
unused3 | UsageBitfield |
unused4 | UsageBitfield |
UsageBitfield() | UsageBitfield | [inline]
usedVertexA | UsageBitfield |
usedVertexB | UsageBitfield |
usedVertexC | UsageBitfield |
usedVertexD | UsageBitfield |

Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Vector2 Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

Vector2 Class Reference

#include <Vector.h>

Detailed Description

Definition at line 333 of file Vector.h.

The documentation for this class was generated from the following file:
  • Vector.h
Generated on Wed May 24 14:00:39 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: VoronoiSimplexSolver Class Reference

  • Class List
  • Class Hierarchy
  • Class Members

VoronoiSimplexSolver Class Reference

VoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin. More...

#include <VoronoiSimplexSolver.h>

Collaboration diagram for VoronoiSimplexSolver:

[legend]
List of all members.

Public Member Functions

void | removeVertex (int index)
void | ReduceVertices (const UsageBitfield &usedVerts)
bool | UpdateClosestVectorAndPoints ()
bool | ClosestPtPointTetrahedron (const SimdPoint3 &p, const SimdPoint3 &a, const SimdPoint3 &b, const SimdPoint3 &c, const SimdPoint3 &d, SubSimplexClosestResult &finalResult)
int | PointOutsideOfPlane (const SimdPoint3 &p, const SimdPoint3 &a, const SimdPoint3 &b, const SimdPoint3 &c, const SimdPoint3 &d)
Test if point p and d lie on opposite sides of plane through abc.
bool | ClosestPtPointTriangle (const SimdPoint3 &p, const SimdPoint3 &a, const SimdPoint3 &b, const SimdPoint3 &c, SubSimplexClosestResult &result)
void | reset ()
void | addVertex (const SimdVector3 &w, const SimdPoint3 &p, const SimdPoint3 &q)
bool | closest (SimdVector3 &v)
SimdScalar maxVertex ()
bool | fullSimplex () const
int | getSimplex (SimdPoint3 *pBuf, SimdPoint3 *qBuf, SimdVector3 *yBuf) const
bool | inSimplex (const SimdVector3 &w)
void | backup_closest (SimdVector3 &v)
bool | emptySimplex () const
void | compute_points (SimdPoint3 &p1, SimdPoint3 &p2)
int | numVertices () const

Public Attributes

int | m_numVertices
SimdVector3 | m_simplexVectorW [VORONOI_SIMPLEX_MAX_VERTS]
SimdPoint3 | m_simplexPointsP [VORONOI_SIMPLEX_MAX_VERTS]
SimdPoint3 | m_simplexPointsQ [VORONOI_SIMPLEX_MAX_VERTS]
SimdPoint3 m_cachedP1
SimdPoint3 m_cachedP2
SimdVector3 m_cachedV
SimdVector3 m_lastW
bool | m_cachedValidClosest
SubSimplexClosestResult m_cachedBC
bool | m_needsUpdate

Detailed Description

VoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin.

Can be used with GJK, as an alternative to Johnson distance algorithm.

Definition at line 90 of file VoronoiSimplexSolver.h.

Member Function Documentation

void VoronoiSimplexSolver::addVertex | ( | const SimdVector3 & | w,
 |  | const SimdPoint3 & | p,
 |  | const SimdPoint3 & | q
 | ) |

Definition at line 80 of file VoronoiSimplexSolver.cpp.

References m_lastW, m_needsUpdate, m_numVertices, m_simplexPointsP, m_simplexPointsQ, and m_simplexVectorW.

void VoronoiSimplexSolver::backup_closest ( SimdVector3 & v )

Definition at line 307 of file VoronoiSimplexSolver.cpp.

References m_cachedV.

bool VoronoiSimplexSolver::closest ( SimdVector3 & v )

Definition at line 247 of file VoronoiSimplexSolver.cpp.

References m_cachedV, and UpdateClosestVectorAndPoints().

bool VoronoiSimplexSolver::ClosestPtPointTetrahedron | ( | const SimdPoint3 & | p,
 |  | const SimdPoint3 & | a,
 |  | const SimdPoint3 & | b,
 |  | const SimdPoint3 & | c,
 |  | const SimdPoint3 & | d,
 |  | SubSimplexClosestResult & | finalResult
 | ) |

Definition at line 449 of file VoronoiSimplexSolver.cpp.

References ClosestPtPointTriangle(), dot(), SubSimplexClosestResult::m_barycentricCoords, SubSimplexClosestResult::m_closestPointOnSimplex, SubSimplexClosestResult::m_degenerate, SubSimplexClosestResult::m_usedVertices, PointOutsideOfPlane(), UsageBitfield::reset(), SubSimplexClosestResult::SetBarycentricCoordinates(), UsageBitfield::usedVertexA, UsageBitfield::usedVertexB, UsageBitfield::usedVertexC, UsageBitfield::usedVertexD, VERTA, VERTB, and VERTC.

Referenced by UpdateClosestVectorAndPoints().

bool VoronoiSimplexSolver::ClosestPtPointTriangle | ( | const SimdPoint3 & | p,
 |  | const SimdPoint3 & | a,
 |  | const SimdPoint3 & | b,
 |  | const SimdPoint3 & | c,
 |  | SubSimplexClosestResult & | result
 | ) |

Definition at line 330 of file VoronoiSimplexSolver.cpp.

References SimdVector3::dot(), SubSimplexClosestResult::m_closestPointOnSimplex, SubSimplexClosestResult::m_usedVertices, UsageBitfield::reset(), SubSimplexClosestResult::SetBarycentricCoordinates(), UsageBitfield::usedVertexA, UsageBitfield::usedVertexB, and UsageBitfield::usedVertexC.

Referenced by ClosestPtPointTetrahedron(), and UpdateClosestVectorAndPoints().

void VoronoiSimplexSolver::compute_points | ( | SimdPoint3 & | p1,
 |  | SimdPoint3 & | p2
 | ) |

Definition at line 319 of file VoronoiSimplexSolver.cpp.

References m_cachedP1, m_cachedP2, and UpdateClosestVectorAndPoints().

bool VoronoiSimplexSolver::emptySimplex ( ) const

Definition at line 313 of file VoronoiSimplexSolver.cpp.

References numVertices().

bool VoronoiSimplexSolver::fullSimplex ( ) const [inline]

Definition at line 134 of file VoronoiSimplexSolver.h.

References m_numVertices.

int VoronoiSimplexSolver::getSimplex | ( | SimdPoint3 * | pBuf,
 |  | SimdPoint3 * | qBuf,
 |  | SimdVector3 * | yBuf
 | ) | const

Definition at line 272 of file VoronoiSimplexSolver.cpp.

References m_simplexPointsP, m_simplexPointsQ, m_simplexVectorW, and numVertices().

bool VoronoiSimplexSolver::inSimplex ( const SimdVector3 & w )

Definition at line 287 of file VoronoiSimplexSolver.cpp.

References m_lastW, m_simplexVectorW, and numVertices().

SimdScalar VoronoiSimplexSolver::maxVertex ( )

Definition at line 256 of file VoronoiSimplexSolver.cpp.

References SimdVector3::length2(), m_simplexVectorW, and numVertices().

int VoronoiSimplexSolver::numVertices ( ) const [inline]

Definition at line 149 of file VoronoiSimplexSolver.h.

References m_numVertices.

Referenced by emptySimplex(), getSimplex(), inSimplex(), maxVertex(), ReduceVertices(), and UpdateClosestVectorAndPoints().

int VoronoiSimplexSolver::PointOutsideOfPlane | ( | const SimdPoint3 & | p,
 |  | const SimdPoint3 & | a,
 |  | const SimdPoint3 & | b,
 |  | const SimdPoint3 & | c,
 |  | const SimdPoint3 & | d
 | ) |

Test if point p and d lie on opposite sides of plane through abc.

Definition at line 430 of file VoronoiSimplexSolver.cpp.

References cross(), and dot().

Referenced by ClosestPtPointTetrahedron().

void VoronoiSimplexSolver::ReduceVertices ( const UsageBitfield & usedVerts )

Definition at line 47 of file VoronoiSimplexSolver.cpp.

References numVertices(), removeVertex(), UsageBitfield::usedVertexA, UsageBitfield::usedVertexB, UsageBitfield::usedVertexC, and UsageBitfield::usedVertexD.

Referenced by UpdateClosestVectorAndPoints().

void VoronoiSimplexSolver::removeVertex ( int index )

Definition at line 37 of file VoronoiSimplexSolver.cpp.

References m_numVertices, m_simplexPointsP, m_simplexPointsQ, and m_simplexVectorW.

Referenced by ReduceVertices().

void VoronoiSimplexSolver::reset ( )

Definition at line 68 of file VoronoiSimplexSolver.cpp.

References m_cachedBC, m_cachedValidClosest, m_lastW, m_needsUpdate, m_numVertices, and SubSimplexClosestResult::Reset().

bool VoronoiSimplexSolver::UpdateClosestVectorAndPoints ( )

Definition at line 92 of file VoronoiSimplexSolver.cpp.

References ClosestPtPointTetrahedron(), ClosestPtPointTriangle(), SimdVector3::dot(), SubSimplexClosestResult::IsValid(), SubSimplexClosestResult::m_barycentricCoords, m_cachedBC, m_cachedP1, m_cachedP2, m_cachedV, m_cachedValidClosest, SubSimplexClosestResult::m_degenerate, m_needsUpdate, m_simplexPointsP, m_simplexPointsQ, m_simplexVectorW, SubSimplexClosestResult::m_usedVertices, numVertices(), ReduceVertices(), SubSimplexClosestResult::Reset(), SubSimplexClosestResult::SetBarycentricCoordinates(), SimdQuadWord::setValue(), UsageBitfield::usedVertexA, and UsageBitfield::usedVertexB.

Referenced by closest(), and compute_points().

Member Data Documentation

SubSimplexClosestResult VoronoiSimplexSolver::m_cachedBC

Definition at line 111 of file VoronoiSimplexSolver.h.

Referenced by reset(), and UpdateClosestVectorAndPoints().

SimdPoint3 VoronoiSimplexSolver::m_cachedP1

Definition at line 105 of file VoronoiSimplexSolver.h.

Referenced by compute_points(), and UpdateClosestVectorAndPoints().

SimdPoint3 VoronoiSimplexSolver::m_cachedP2

Definition at line 106 of file VoronoiSimplexSolver.h.

Referenced by compute_points(), and UpdateClosestVectorAndPoints().

SimdVector3 VoronoiSimplexSolver::m_cachedV

Definition at line 107 of file VoronoiSimplexSolver.h.

Referenced by backup_closest(), closest(), and UpdateClosestVectorAndPoints().

bool VoronoiSimplexSolver::m_cachedValidClosest

Definition at line 109 of file VoronoiSimplexSolver.h.

Referenced by reset(), and UpdateClosestVectorAndPoints().

SimdVector3 VoronoiSimplexSolver::m_lastW

Definition at line 108 of file VoronoiSimplexSolver.h.

Referenced by addVertex(), inSimplex(), and reset().

bool VoronoiSimplexSolver::m_needsUpdate

Definition at line 113 of file VoronoiSimplexSolver.h.

Referenced by addVertex(), reset(), and UpdateClosestVectorAndPoints().

int VoronoiSimplexSolver::m_numVertices

Definition at line 97 of file VoronoiSimplexSolver.h.

Referenced by addVertex(), fullSimplex(), numVertices(), removeVertex(), and reset().

SimdPoint3 VoronoiSimplexSolver::m_simplexPointsP[VORONOI_SIMPLEX_MAX_VERTS]

Definition at line 100 of file VoronoiSimplexSolver.h.

Referenced by addVertex(), getSimplex(), removeVertex(), and UpdateClosestVectorAndPoints().

SimdPoint3 VoronoiSimplexSolver::m_simplexPointsQ[VORONOI_SIMPLEX_MAX_VERTS]

Definition at line 101 of file VoronoiSimplexSolver.h.

Referenced by addVertex(), getSimplex(), removeVertex(), and UpdateClosestVectorAndPoints().

SimdVector3 VoronoiSimplexSolver::m_simplexVectorW[VORONOI_SIMPLEX_MAX_VERTS]

Definition at line 99 of file VoronoiSimplexSolver.h.

Referenced by addVertex(), getSimplex(), inSimplex(), maxVertex(), removeVertex(), and UpdateClosestVectorAndPoints().

The documentation for this class was generated from the following files:
  • VoronoiSimplexSolver.h
  • VoronoiSimplexSolver.cpp
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Member List

  • Class List
  • Class Hierarchy
  • Class Members

VoronoiSimplexSolver Member List

This is the complete list of members for VoronoiSimplexSolver, including all inherited members.

addVertex(const SimdVector3 &w, const SimdPoint3 &p, const SimdPoint3 &q) | VoronoiSimplexSolver |
backup_closest(SimdVector3 &v) | VoronoiSimplexSolver |
closest(SimdVector3 &v) | VoronoiSimplexSolver |
ClosestPtPointTetrahedron(const SimdPoint3 &p, const SimdPoint3 &a, const SimdPoint3 &b, const SimdPoint3 &c, const SimdPoint3 &d, SubSimplexClosestResult &finalResult) | VoronoiSimplexSolver |
ClosestPtPointTriangle(const SimdPoint3 &p, const SimdPoint3 &a, const SimdPoint3 &b, const SimdPoint3 &c, SubSimplexClosestResult &result) | VoronoiSimplexSolver |
compute_points(SimdPoint3 &p1, SimdPoint3 &p2) | VoronoiSimplexSolver |
emptySimplex() const | VoronoiSimplexSolver |
fullSimplex() const | VoronoiSimplexSolver | [inline]
getSimplex(SimdPoint3 *pBuf, SimdPoint3 *qBuf, SimdVector3 *yBuf) const | VoronoiSimplexSolver |
inSimplex(const SimdVector3 &w) | VoronoiSimplexSolver |
m_cachedBC | VoronoiSimplexSolver |
m_cachedP1 | VoronoiSimplexSolver |
m_cachedP2 | VoronoiSimplexSolver |
m_cachedV | VoronoiSimplexSolver |
m_cachedValidClosest | VoronoiSimplexSolver |
m_lastW | VoronoiSimplexSolver |
m_needsUpdate | VoronoiSimplexSolver |
m_numVertices | VoronoiSimplexSolver |
m_simplexPointsP | VoronoiSimplexSolver |
m_simplexPointsQ | VoronoiSimplexSolver |
m_simplexVectorW | VoronoiSimplexSolver |
maxVertex() | VoronoiSimplexSolver |
numVertices() const | VoronoiSimplexSolver | [inline]
PointOutsideOfPlane(const SimdPoint3 &p, const SimdPoint3 &a, const SimdPoint3 &b, const SimdPoint3 &c, const SimdPoint3 &d) | VoronoiSimplexSolver |
ReduceVertices(const UsageBitfield &usedVerts) | VoronoiSimplexSolver |
removeVertex(int index) | VoronoiSimplexSolver |
reset() | VoronoiSimplexSolver |
UpdateClosestVectorAndPoints() | VoronoiSimplexSolver |

Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- a -

  • AabbOverlap() : SimpleBroadphase
  • absolute() : SimdVector3, SimdMatrix3x3
  • absolute4() : SimdVector4
  • activate() : CollisionObject
  • addCcdPhysicsController() : CcdPhysicsEnvironment
  • AddCollisionObject() : CollisionWorld
  • AddContactPoint() : PointCollector, MyResult, ManifoldContactAddResult, StorageResult, DiscreteCollisionDetectorInterface::Result, ManifoldResult, FlippedContactResult
  • AddContactsHullHull() : Hull
  • AddHandle() : AxisSweep3
  • addHead() : GEN_List
  • AddManifoldPoint() : PersistentManifold
  • AddOverlappingPair() : SimpleBroadphase
  • AddPoint() : ConvexHullShape
  • addSensor() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • AddSingleResult() : FilterClosestRayResultCallback, CollisionWorld::ClosestRayResultCallback, CollisionWorld::RayResultCallback
  • addTail() : GEN_List
  • AddTmpFace() : Hull
  • addTouchCallback() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • AddTriangle() : TriangleMesh
  • AddVertex() : BU_Simplex1to4
  • addVertex() : VoronoiSimplexSolver
  • AddWheel() : PHY_IVehicle
  • adjoint() : SimdMatrix3x3
  • AFFINE : SimdTransform
  • Allocate() : UnionFind
  • AllocHandle() : AxisSweep3
  • AllocTmpEdge() : Hull
  • AllocTmpFace() : Hull
  • angle() : SimdVector3, SimdQuaternion
  • ApplyBraking() : PHY_IVehicle
  • applyCentralForce() : RigidBody
  • applyCentralImpulse() : RigidBody
  • ApplyEngineForce() : PHY_IVehicle
  • ApplyForce() : PHY_IPhysicsController, CcdPhysicsController
  • applyForce() : RigidBody
  • applyForces() : RigidBody
  • applyImpulse() : PHY_IPhysicsController, CcdPhysicsController, RigidBody
  • ApplyTorque() : PHY_IPhysicsController, CcdPhysicsController
  • applyTorque() : RigidBody
  • applyTorqueImpulse() : RigidBody
  • ATTRIBUTE_ALIGNED16() : SimdQuadWord
  • AxisSweep3() : AxisSweep3
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- j -

  • J1a : BU_Joint::Info2
  • J1l : BU_Joint::Info2
  • J2a : BU_Joint::Info2
  • J2l : BU_Joint::Info2
  • JacobianEntry() : JacobianEntry
  • joint : BU_ContactJointNode
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- k -

  • kFeatureA : Separation
  • kFeatureB : Separation
  • kFeatureBoth : Separation
  • kFeatureNone : Separation
  • kMaxEdges : Hull
  • kMaxFaces : Hull
  • kMaxVerts : Hull
  • kTmpFaceMaxVerts : Hull
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- l -

  • lambda : BU_Joint
  • Length : Quat
  • length() : SimdVector3, SimdQuaternion
  • length2() : SimdVector3, SimdQuaternion
  • LengthFast : Quat
  • lerp() : SimdVector3
  • Lerp : Quat
  • LINEAR : SimdTransform
  • lo : BU_Joint::Info2
  • LocalGetSupportingVertex() : TriangleMeshShape, SphereShape, CylinderShape, ConvexShape, ConvexHullShape, ConeShape, BoxShape
  • LocalGetSupportingVertexWithoutMargin() : TriangleShape, TriangleMeshShape, SphereShape, PolyhedralConvexShape, MultiSphereShape, MinkowskiSumShape, CylinderShapeZ, CylinderShapeX, CylinderShape, ConvexShape, ConvexHullShape, ConeShape, BoxShape
  • LocalMatrix() : BU_Screwing
  • LocalRayResult() : CollisionWorld::LocalRayResult
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- m -

  • m : BU_Joint::Info1
  • m_0MinvJt : JacobianEntry
  • m_1MinvJt : JacobianEntry
  • m_aabbMax : OptimizedBvhNode, BoxTriangleCallback
  • m_aabbMin : OptimizedBvhNode, BoxTriangleCallback
  • m_accumulatedTangentImpulse0 : ConstraintPersistentData
  • m_accumulatedTangentImpulse1 : ConstraintPersistentData
  • m_activationState1 : CollisionObject
  • m_Adiag : JacobianEntry
  • m_aJ : JacobianEntry
  • m_algorithms : BroadphasePair
  • m_ang_drag : PHY_ShapeProps
  • m_angularDamping : CcdConstructionInfo, RigidBody
  • m_angularOnly : HingeConstraint
  • m_angularVelocity : RigidBody, BU_StaticMotionState
  • m_appliedImpulse : ConstraintPersistentData
  • m_axis : Separation
  • m_axisInA : HingeConstraint
  • m_axisInB : HingeConstraint
  • m_barycentricCoords : SubSimplexClosestResult
  • m_basis : SimdTransform
  • m_bJ : JacobianEntry
  • m_blockedForChanges : SimpleBroadphase
  • m_body : CcdPhysicsController
  • m_body0 : ContactJoint, PersistentManifold, ManifoldResult
  • m_body1 : ContactJoint, PersistentManifold, ManifoldResult
  • m_box0 : ConvexConvexAlgorithm
  • m_box1 : ConvexConvexAlgorithm
  • m_boxHalfExtents1 : BoxShape
  • m_boxProxy : BoxTriangleCallback
  • m_boxTriangleCallback : ConvexConcaveCollisionAlgorithm
  • m_broadphase : CollisionWorld
  • m_broadphaseHandle : CollisionObject
  • m_broadphaseProxy : RigidBody
  • m_bvh : BvhTriangleMeshShape
  • m_cachedBC : VoronoiSimplexSolver
  • m_cachedP1 : VoronoiSimplexSolver
  • m_cachedP2 : VoronoiSimplexSolver
  • m_cachedPoints : PersistentManifold
  • m_cachedSeparatingAxis : GjkPairDetector
  • m_cachedV : VoronoiSimplexSolver
  • m_cachedValidClosest : VoronoiSimplexSolver
  • m_ccdMode : CcdPhysicsEnvironment
  • m_ccdSquareMotionTreshold : CollisionObject
  • m_ccdSweptShereRadius : CollisionObject
  • m_cci : CcdPhysicsController
  • m_cfm : OdeConstraintSolver
  • m_clientObject : BroadphaseProxy
  • m_closestHitFraction : CollisionWorld::RayResultCallback
  • m_closestPointInB : StorageResult
  • m_closestPointOnSimplex : SubSimplexClosestResult
  • m_collisionDelay : CcdPhysicsController
  • m_collisionFlags : CcdConstructionInfo, CollisionObject
  • m_collisionMargin : TriangleMeshShape, EmptyShape, ConvexShape
  • m_collisionMarginTriangle : BoxTriangleCallback
  • m_collisionObject : CollisionWorld::ClosestRayResultCallback, CollisionWorld::LocalRayResult
  • m_collisionObjects : CollisionWorld
  • m_collisionShape : CcdConstructionInfo, CollisionObject
  • m_collisionWorld : CcdPhysicsEnvironment
  • m_concave : ConvexConcaveCollisionAlgorithm
  • m_constraints : CcdPhysicsEnvironment
  • m_contact : Separation
  • m_contiguousNodes : OptimizedBvh
  • m_controllers : CcdPhysicsEnvironment
  • m_convex : ConvexConcaveCollisionAlgorithm
  • m_convexA : SubsimplexConvexCast, GjkConvexCast, ContinuousConvexCollision, BU_CollisionPair
  • m_convexB : SubsimplexConvexCast, GjkConvexCast, ContinuousConvexCollision, BU_CollisionPair
  • m_count : CollisionDispatcher
  • m_CurBody : OdeConstraintSolver
  • m_CurJoint : OdeConstraintSolver
  • m_curNodeIndex : OptimizedBvh
  • m_damping : Solve2LinearConstraint, ConstraintSetting, ContactSolverInfo
  • m_deactivationTime : CollisionObject
  • m_debugBodyId : RigidBody
  • m_debugDraw : DispatcherInfo
  • m_debugDrawer : CcdPhysicsEnvironment, ConvexCast::CastResult
  • m_defaultManifoldResult : CollisionDispatcher
  • m_degenerate : SubSimplexClosestResult
  • m_deleted : EpaFace
  • m_depth : MyResult
  • m_determinant : EpaFace
  • m_dispatcher : BoxTriangleCallback, CollisionWorld, CollisionAlgorithm, CollisionAlgorithmConstructionInfo
  • m_dispatchFunc : DispatcherInfo
  • m_dispatchInfoPtr : BoxTriangleCallback
  • m_dist : Separation
  • m_distance : PointCollector, StorageResult
  • m_distance1 : ManifoldPoint
  • m_do_anisotropic : PHY_ShapeProps
  • m_do_fh : PHY_ShapeProps
  • m_do_rot_fh : PHY_ShapeProps
  • m_doubleDispatch : CollisionDispatcher
  • m_edges : Hull::TmpFace
  • m_el : SimdMatrix3x3
  • m_enableSatCollisionDetection : CcdPhysicsEnvironment
  • m_enableSatConvex : DispatcherInfo
  • m_erp : OdeConstraintSolver, ContactSolverInfo
  • m_escapeIndex : OptimizedBvhNode
  • m_facc : RigidBody
  • m_faceEntries : Epa
  • m_faces : Hull::TmpEdge, Hull::Edge, EpaPolyhedron
  • m_featureA : Separation
  • m_featureB : Separation
  • m_fh_damping : PHY_MaterialProps
  • m_fh_distance : PHY_MaterialProps
  • m_fh_normal : PHY_MaterialProps
  • m_fh_spring : PHY_MaterialProps
  • m_firstEdge : Hull::Face
  • m_firstFreeHandle : AxisSweep3
  • m_firstFreeProxy : SimpleBroadphase
  • m_fraction : ConvexCast::CastResult
  • m_freeProxies : SimpleBroadphase
  • m_friction : PHY_MaterialProps, CcdConstructionInfo, RigidBody, ContactSolverInfo
  • m_friction_scaling : PHY_ShapeProps
  • m_frictionWorldTangential0 : ConstraintPersistentData
  • m_frictionWorldTangential1 : ConstraintPersistentData
  • m_from : TriangleRaycastCallback
  • m_gjkPairDetector : ConvexConvexAlgorithm
  • m_gravity : CcdPhysicsEnvironment, CcdConstructionInfo, RigidBody
  • m_halfEdges : EpaPolyhedron
  • m_handle : AxisSweep3::Edge
  • m_handleId : AxisSweep3::Handle
  • m_hasResult : PointCollector, MyResult
  • m_head : GEN_List
  • m_height : ConeShape
  • m_hitFraction : TriangleRaycastCallback, CollisionWorld::LocalRayResult, CollisionObject
  • m_hitNormalLocal : CollisionWorld::LocalRayResult
  • m_hitNormalWorld : CollisionWorld::ClosestRayResultCallback
  • m_hitPointWorld : CollisionWorld::ClosestRayResultCallback
  • m_hitTransformA : ConvexCast::CastResult
  • m_hitTransformB : ConvexCast::CastResult
  • m_I : RigidBody
  • m_id : UnionFind
  • m_ignoreClient : FilterClosestRayResultCallback
  • m_ignoreMargin : GjkPairDetector
  • m_index : ContactJoint, Hull::TmpEdge, Hull::TmpFace
  • m_index1 : PersistentManifold
  • m_inertia : PHY_ShapeProps
  • m_inertiaFactor : CcdConstructionInfo
  • m_inertiaHalfExtents : MultiSphereShape
  • m_inertiaLocal : MassProps
  • m_interpolationWorldTransform : CollisionObject
  • m_inverseMass : RigidBody
  • m_invI : RigidBody
  • m_invInertiaLocal : RigidBody
  • m_invInertiaTensorWorld : RigidBody
  • m_islandTag1 : CollisionObject
  • m_jac : Point2PointConstraint, HingeConstraint
  • m_jacAng : HingeConstraint
  • m_jacDiagABInv : ConstraintPersistentData
  • m_jacDiagABInvTangent0 : ConstraintPersistentData
  • m_jacDiagABInvTangent1 : ConstraintPersistentData
  • m_jointAxis : JacobianEntry
  • m_kinematicTimeStep : RigidBody
  • m_lambdas : EpaFace
  • m_lastW : VoronoiSimplexSolver
  • m_leafNodes : OptimizedBvh
  • m_leftChild : OptimizedBvhNode
  • m_lifeTime : ManifoldPoint
  • m_lin_drag : PHY_ShapeProps
  • m_linearDamping : CcdConstructionInfo, RigidBody
  • m_linearVelocity : RigidBody, BU_StaticMotionState
  • m_localAabbMax : TriangleMeshShape
  • m_localAabbMin : TriangleMeshShape
  • m_localInertiaTensor : CcdConstructionInfo
  • m_localPointA : ManifoldPoint
  • m_localPointB : ManifoldPoint
  • m_localPositions : MultiSphereShape
  • m_localScaling : EmptyShape, ConvexShape
  • m_localShapeInfo : CollisionWorld::LocalRayResult
  • m_lowLevelOfDetail : ConvexConvexAlgorithm
  • m_manifold : ContactJoint
  • m_manifoldPtr : ManifoldContactAddResult, ManifoldResult, ConvexConvexAlgorithm, BoxTriangleCallback
  • m_manifoldsPtr : CollisionDispatcher
  • m_mass : PHY_ShapeProps, CcdConstructionInfo, MassProps
  • m_max : SimpleBroadphaseProxy
  • m_maxDot : SupportVertexCallback
  • m_maxEdges : AxisSweep3::Handle
  • m_maxErrorReduction : ContactSolverInfo
  • m_maxHandles : AxisSweep3
  • m_maximumDistanceSquared : DiscreteCollisionDetectorInterface::ClosestPointInput
  • m_maxOverlap : SimpleBroadphase
  • m_maxProxies : SimpleBroadphase
  • m_meshInterface : TriangleMeshShape
  • m_min : SimpleBroadphaseProxy
  • m_minEdges : AxisSweep3::Handle
  • m_minkowskiA : GjkPairDetector
  • m_minkowskiB : GjkPairDetector
  • m_minRadius : MultiSphereShape
  • m_motionState : BU_Collidable
  • m_MotionState : CcdPhysicsController, CcdConstructionInfo
  • m_N : UnionFind
  • m_nbFaces : EpaPolyhedron
  • m_needsUpdate : VoronoiSimplexSolver
  • m_newClientInfo : CcdPhysicsController
  • m_next : GEN_Link, Hull::TmpEdge, Hull::TmpFace
  • m_nextEdge : Hull::Edge
  • m_normal : PHY_CollData, ConvexCast::CastResult
  • m_normalOnBInWorld : PointCollector, MyResult
  • m_normalOnSurfaceB : StorageResult
  • m_normalWorldOnB : ManifoldPoint
  • m_numEdges : Hull, Hull::Face
  • m_numFaces : Hull
  • m_numHandles : AxisSweep3
  • m_numIterations : CcdPhysicsEnvironment, ContactSolverInfo
  • m_numNodes : OptimizedBvh
  • m_NumOverlapBroadphasePair : SimpleBroadphase
  • m_numProxies : SimpleBroadphase
  • m_numSpheres : MultiSphereShape
  • m_numTimeSubSteps : CcdPhysicsEnvironment
  • m_numTriangleIndices : TriangleIndexVertexArray
  • m_numVertices : VoronoiSimplexSolver, TriangleIndexVertexArray, BU_Simplex1to4
  • m_numVerts : Hull::TmpFace, Hull
  • m_o : BU_Screwing
  • m_odeTag : RigidBody
  • m_optionalHull : PolyhedralConvexShape
  • m_org : FlippedContactResult
  • m_origin : SimdTransform
  • m_OverlappingPairs : SimpleBroadphase
  • m_ownManifold : ConvexConvexAlgorithm
  • m_pad : AxisSweep3::Handle
  • m_padding : RigidBody
  • m_pConvexShapeA : Epa
  • m_pConvexShapeB : Epa
  • m_pEdges : Hull, AxisSweep3
  • m_penetration : ConstraintPersistentData
  • m_penetrationDepthSolver : GjkPairDetector, ContinuousConvexCollision
  • m_persistentLifeTime : ConstraintPersistentData
  • m_pFace : EpaHalfEdge
  • m_pFaces : Hull
  • m_pHalfEdge : EpaFace
  • m_pHandles : AxisSweep3
  • m_physicsEnv : CcdConstructionInfo
  • m_pivotInA : Point2PointConstraint, HingeConstraint
  • m_pivotInB : Point2PointConstraint, HingeConstraint
  • m_plane : Hull::TmpFace
  • m_pNextCCW : EpaHalfEdge
  • m_point : EpaVertex
  • m_point1 : PHY_CollData
  • m_point2 : PHY_CollData
  • m_pointCache : PersistentManifold
  • m_pointInWorld : PointCollector, MyResult
  • m_points : ConvexHullShape
  • m_polyhedron : Epa
  • m_pos : AxisSweep3::Edge
  • m_positionWorldOnA : ManifoldPoint
  • m_positionWorldOnB : ManifoldPoint
  • m_pPlanes : Hull
  • m_pProxies : SimpleBroadphase
  • m_pProxy0 : BroadphasePair
  • m_pProxy1 : BroadphasePair
  • m_prev : GEN_Link
  • m_prevAppliedImpulse : ConstraintPersistentData
  • m_profileTimings : CcdPhysicsEnvironment
  • m_proxies : SimpleBroadphase
  • m_pTwin : EpaHalfEdge
  • m_pVertex : EpaHalfEdge
  • m_pVertices : EpaFace
  • m_pVerts : Hull
  • m_quantize : AxisSweep3
  • m_R : RigidBody
  • m_radi : MultiSphereShape
  • m_radius : SphereShape, ConeShape
  • m_rayFromWorld : CollisionWorld::ClosestRayResultCallback
  • m_rayToWorld : CollisionWorld::ClosestRayResultCallback
  • m_rbA : TypedConstraint
  • m_rbB : TypedConstraint
  • m_restitution : PHY_MaterialProps, CcdConstructionInfo, RigidBody, ContactSolverInfo, ConstraintPersistentData
  • m_rightChild : OptimizedBvhNode
  • m_rootNode1 : OptimizedBvh
  • m_roots : BU_AlgebraicPolynomialSolver
  • m_s : BU_Screwing
  • m_scaling : CcdConstructionInfo, StridingMeshInterface
  • m_scalingPropagated : CcdPhysicsEnvironment
  • m_screwing : BU_CollisionPair
  • m_separator : Separation
  • m_setting : Point2PointConstraint
  • m_shape : PHY_ShapeProps, BU_Collidable
  • m_shapeA : MinkowskiSumShape
  • m_shapeB : MinkowskiSumShape
  • m_shapePart : CollisionWorld::LocalShapeInfo
  • m_simplexPointsP : VoronoiSimplexSolver
  • m_simplexPointsQ : VoronoiSimplexSolver
  • m_simplexSolver : SubsimplexConvexCast, GjkPairDetector, GjkConvexCast, ContinuousConvexCollision, ConvexConvexAlgorithm
  • m_simplexVectorW : VoronoiSimplexSolver
  • m_sinAngle : ConeShape
  • m_solver : CcdPhysicsEnvironment
  • m_solverInfo : CcdPhysicsEnvironment
  • m_solverType : CcdPhysicsEnvironment
  • m_sor : ContactSolverInfo
  • m_stepCount : DispatcherInfo
  • m_subPart : OptimizedBvhNode
  • m_supportVecLocal : SupportVertexCallback
  • m_supportVertexLocal : SupportVertexCallback
  • m_swapBodies : ContactJoint
  • m_swapped : CollisionAlgorithmCreateFunc
  • m_sz : UnionFind
  • m_tacc : RigidBody
  • m_tail : GEN_List
  • m_tau : Solve2LinearConstraint, ConstraintSetting, ContactSolverInfo
  • m_tempDebug : CollisionShape
  • m_timeOfImpact : DispatcherInfo
  • m_timeStep : ContactSolverInfo, DispatcherInfo
  • m_to : TriangleRaycastCallback
  • m_tolerance : BU_CollisionPair
  • m_totalForce : RigidBody
  • m_totalTorque : RigidBody
  • m_trans : BU_StaticMotionState
  • m_transA : MinkowskiSumShape
  • m_transAInv : ManifoldContactAddResult
  • m_transB : MinkowskiSumShape
  • m_transBInv : ManifoldContactAddResult
  • m_transformA : Epa, DiscreteCollisionDetectorInterface::ClosestPointInput
  • m_transformB : Epa, DiscreteCollisionDetectorInterface::ClosestPointInput
  • m_triangleCount : BoxTriangleCallback
  • m_triangleIndex : OptimizedBvhNode, CollisionWorld::LocalShapeInfo
  • m_triangleIndexBase : TriangleIndexVertexArray
  • m_triangleIndexStride : TriangleIndexVertexArray
  • m_triangleProxy : BoxTriangleCallback
  • m_triangles : TriangleMesh
  • m_triggerCallbacks : CcdPhysicsEnvironment
  • m_triggerCallbacksUserPtrs : CcdPhysicsEnvironment
  • m_triggerControllers : CcdPhysicsEnvironment
  • m_type : SimdTransform
  • m_u : BU_Screwing
  • m_unionFind : CollisionDispatcher
  • m_unusedW : SimdQuadWord
  • m_useContinuous : DispatcherInfo
  • m_usedVertices : SubSimplexClosestResult
  • m_useEpa : ConvexConvexAlgorithm
  • m_useIslands : CollisionDispatcher
  • m_userConstraintId : TypedConstraint
  • m_userConstraintType : TypedConstraint
  • m_userPersistentData : ManifoldPoint
  • m_userPointer : BU_Collidable, CollisionObject
  • m_v : EpaFace
  • m_vec : PHY__Vector3
  • m_vert0 : MyTriangle
  • m_vert1 : MyTriangle
  • m_vert2 : MyTriangle
  • m_vertexBase : TriangleIndexVertexArray
  • m_vertexStride : TriangleIndexVertexArray
  • m_vertices : EpaPolyhedron, BU_Simplex1to4
  • m_vertices1 : TriangleShape
  • m_verts : Hull::TmpEdge, Hull::TmpFace, Hull::Edge
  • m_vSqrd : EpaFace
  • m_w : BU_Screwing
  • m_worldAabbMax : AxisSweep3
  • m_worldAabbMin : AxisSweep3
  • m_worldTrans : SupportVertexCallback
  • m_worldTransform : DefaultMotionState, CollisionObject
  • m_wrapperVehicles : CcdPhysicsEnvironment
  • m_wSupportPointOnA : EpaVertex
  • m_wSupportPointOnB : EpaVertex
  • m_y : SimdQuadWord
  • m_z : SimdQuadWord
  • MakeHull() : Hull
  • MakeHullFromTemp() : Hull
  • ManifoldContactAddResult() : ManifoldContactAddResult
  • ManifoldPoint() : ManifoldPoint
  • ManifoldResult() : ManifoldResult
  • MassProps() : MassProps
  • MatchOrAddEdge() : Hull
  • maxAxis() : SimdVector3
  • maxAxis4() : SimdVector4
  • maxVertex() : VoronoiSimplexSolver
  • mergesSimulationIslands() : CollisionObject
  • minAxis() : SimdVector3
  • minAxis4() : SimdVector4
  • MinkowskiSumShape() : MinkowskiSumShape
  • mult() : SimdTransform
  • multInverseLeft() : SimdTransform
  • MultiSphereShape() : MultiSphereShape
  • MyResult() : MyResult
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- n -

  • NeedsCollision() : CollisionDispatcher, Dispatcher
  • NeedsResponse() : CollisionDispatcher
  • noContactResponse : CollisionObject
  • node : BU_Joint
  • Normalize : Quat
  • normalize() : SimdVector3, SimdQuaternion
  • normalized() : SimdVector3, SimdQuaternion
  • NormalizeFast : Quat
  • nub : BU_Joint::Info1
  • numVertices() : VoronoiSimplexSolver
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- o -

  • OdeConstraintSolver() : OdeConstraintSolver
  • operator * : SimdTransform, SimdQuaternion, Quat
  • operator *=() : SimdVector3, SimdTransform, SimdQuaternion, SimdMatrix3x3, Quat
  • operator const float *() : PHY__Vector3
  • operator const SimdScalar *() : SimdQuadWord
  • operator delete() : DiscreteCollisionDetectorInterface::Result, DiscreteCollisionDetectorInterface
  • operator float *() : PHY__Vector3
  • operator SimdScalar *() : SimdQuadWord
  • operator()() : SimdTransform
  • operator+ : SimdQuaternion, Quat
  • operator+=() : SimdVector3, SimdQuaternion, Quat
  • operator- : SimdQuaternion, Quat
  • operator-=() : SimdVector3, SimdQuaternion, Quat
  • operator/() : SimdQuaternion
  • operator/=() : SimdVector3, SimdQuaternion
  • operator=() : Quat, EpaVertex, EpaPolyhedron, EpaHalfEdge, EpaFace, Epa
  • operator[]() : SimdQuadWord, SimdMatrix3x3
  • OptimizedBvh() : OptimizedBvh
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- z -

  • z() : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- ~ -

  • ~AxisSweep3() : AxisSweep3
  • ~BoxShape() : BoxShape
  • ~BoxTriangleCallback() : BoxTriangleCallback
  • ~BroadphaseInterface() : BroadphaseInterface
  • ~BU_Joint() : BU_Joint
  • ~BU_MotionStateInterface() : BU_MotionStateInterface
  • ~BU_Screwing() : BU_Screwing
  • ~BU_StaticMotionState() : BU_StaticMotionState
  • ~BUM_PolynomialSolverInterface() : BUM_PolynomialSolverInterface
  • ~BvhTriangleMeshShape() : BvhTriangleMeshShape
  • ~CastResult() : ConvexCast::CastResult
  • ~CcdPhysicsController() : CcdPhysicsController
  • ~CcdPhysicsEnvironment() : CcdPhysicsEnvironment
  • ~CollisionAlgorithm() : CollisionAlgorithm
  • ~CollisionAlgorithmCreateFunc() : CollisionAlgorithmCreateFunc
  • ~CollisionDispatcher() : CollisionDispatcher
  • ~CollisionShape() : CollisionShape
  • ~CollisionWorld() : CollisionWorld
  • ~ConstraintSolver() : ConstraintSolver
  • ~ConvexCast() : ConvexCast
  • ~ConvexConcaveCollisionAlgorithm() : ConvexConcaveCollisionAlgorithm
  • ~ConvexConvexAlgorithm() : ConvexConvexAlgorithm
  • ~ConvexPenetrationDepthSolver() : ConvexPenetrationDepthSolver
  • ~ConvexShape() : ConvexShape
  • ~DefaultMotionState() : DefaultMotionState
  • ~DiscreteCollisionDetectorInterface() : DiscreteCollisionDetectorInterface
  • ~Dispatcher() : Dispatcher
  • ~EmptyShape() : EmptyShape
  • ~Epa() : Epa
  • ~EpaFace() : EpaFace
  • ~EpaHalfEdge() : EpaHalfEdge
  • ~EpaPolyhedron() : EpaPolyhedron
  • ~EpaVertex() : EpaVertex
  • ~FilterClosestRayResultCallback() : FilterClosestRayResultCallback
  • ~GjkPairDetector() : GjkPairDetector
  • ~Hull() : Hull
  • ~HullContactCollector() : HullContactCollector
  • ~IDebugDraw() : IDebugDraw
  • ~InternalTriangleIndexCallback() : InternalTriangleIndexCallback
  • ~IslandCallback() : CollisionDispatcher::IslandCallback
  • ~ManifoldResult() : ManifoldResult
  • ~NodeOverlapCallback() : NodeOverlapCallback
  • ~OdeConstraintSolver() : OdeConstraintSolver
  • ~OptimizedBvh() : OptimizedBvh
  • ~PHY_IMotionState() : PHY_IMotionState
  • ~PHY_IPhysicsController() : PHY_IPhysicsController
  • ~PHY_IPhysicsEnvironment() : PHY_IPhysicsEnvironment
  • ~PHY_IVehicle() : PHY_IVehicle
  • ~RayResultCallback() : CollisionWorld::RayResultCallback
  • ~Result() : DiscreteCollisionDetectorInterface::Result
  • ~Shape() : Shape
  • ~SimpleBroadphase() : SimpleBroadphase
  • ~SimpleConstraintSolver() : SimpleConstraintSolver
  • ~StorageResult() : StorageResult
  • ~StridingMeshInterface() : StridingMeshInterface
  • ~TriangleCallback() : TriangleCallback
  • ~TriangleMeshShape() : TriangleMeshShape
  • ~TypedConstraint() : TypedConstraint
  • ~UnionFind() : UnionFind
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- b -

  • backup_closest() : VoronoiSimplexSolver
  • BatchAddContactGroup() : HullContactCollector
  • BatchedUnitVectorGetSupportingVertexWithoutMargin() : TriangleShape, SphereShape, PolyhedralConvexShape, MultiSphereShape, MinkowskiSumShape, CylinderShapeZ, CylinderShapeX, CylinderShape, ConvexShape, ConvexHullShape, ConeShape, BoxShape
  • beginFrame() : CcdPhysicsEnvironment
  • body : BU_ContactJointNode
  • BoxShape() : BoxShape
  • BoxTriangleCallback() : BoxTriangleCallback
  • BroadphasePair() : BroadphasePair
  • BroadphaseProxy() : BroadphaseProxy
  • BU_AlgebraicPolynomialSolver() : BU_AlgebraicPolynomialSolver
  • BU_Collidable() : BU_Collidable
  • BU_CollisionPair() : BU_CollisionPair
  • BU_EdgeEdge() : BU_EdgeEdge
  • BU_Joint() : BU_Joint
  • BU_Screwing() : BU_Screwing
  • BU_Simplex1to4() : BU_Simplex1to4
  • BU_VertexPoly() : BU_VertexPoly
  • Build() : OptimizedBvh
  • BuildAndProcessIslands() : CollisionDispatcher
  • BuildJacobian() : TypedConstraint, Point2PointConstraint, HingeConstraint
  • BuildTree() : OptimizedBvh
  • BvhTriangleMeshShape() : BvhTriangleMeshShape
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- c -

  • c : BU_Joint::Info2
  • Calc2DRotationPointPoint() : BU_EdgeEdge
  • CalcClosestPoint() : EpaFace
  • CalcClosestPointOnA() : EpaFace
  • CalcClosestPointOnB() : EpaFace
  • CalcNormal() : TriangleShape
  • CalcPenDepth() : MinkowskiPenetrationDepthSolver, EpaPenetrationDepthSolver, Epa, ConvexPenetrationDepthSolver
  • CalcSplittingAxis() : OptimizedBvh
  • calcTimeOfImpact() : SubsimplexConvexCast, GjkConvexCast, ConvexCast, ContinuousConvexCollision, BU_CollisionPair
  • CalculateF() : BU_Screwing
  • CalculateLocalInertia() : TriangleShape, TriangleMeshShape, SphereShape, PolyhedralConvexShape, MultiSphereShape, MinkowskiSumShape, EmptyShape, ConeShape, CollisionShape, BoxShape
  • CalculateTemporalAabb() : CollisionShape
  • CalculateTimeOfImpact() : EmptyAlgorithm, ConvexConvexAlgorithm, ConvexConcaveCollisionAlgorithm, CollisionAlgorithm
  • CalculateVelocity() : SimdTransformUtil
  • calculateWorldTransformations() : PHY_IMotionState, DefaultMotionState
  • calcXform() : PHY_IPhysicsController, CcdPhysicsController
  • CallbackTriggers() : CcdPhysicsEnvironment
  • CastResult() : ConvexCast::CastResult
  • CcdConstructionInfo() : CcdConstructionInfo
  • CcdPhysicsController() : CcdPhysicsController
  • CcdPhysicsEnvironment() : CcdPhysicsEnvironment
  • cfm : BU_Joint::Info2
  • CheckPenetrationDepthSolver() : ConvexConvexAlgorithm
  • CleanOverlappingPair() : SimpleBroadphase
  • CleanProxyFromPairs() : SimpleBroadphase, BroadphaseInterface
  • ClearCache() : ConvexConcaveCollisionAlgorithm, BoxTriangleCallback
  • clearForces() : RigidBody
  • ClearManifold() : PersistentManifold, CollisionDispatcher, Dispatcher
  • ClearUserCache() : PersistentManifold
  • ClipFace() : Hull
  • closest() : VoronoiSimplexSolver
  • closestAxis() : SimdVector3
  • closestAxis4() : SimdVector4
  • ClosestPointInput() : DiscreteCollisionDetectorInterface::ClosestPointInput
  • ClosestPtPointTetrahedron() : VoronoiSimplexSolver
  • ClosestPtPointTriangle() : VoronoiSimplexSolver
  • ClosestRayResultCallback() : CollisionWorld::ClosestRayResultCallback
  • cofac() : SimdMatrix3x3
  • CollectVertices() : EpaFace
  • CollisionAlgorithm() : CollisionAlgorithm
  • CollisionAlgorithmConstructionInfo() : CollisionAlgorithmConstructionInfo
  • CollisionAlgorithmCreateFunc() : CollisionAlgorithmCreateFunc
  • CollisionDispatcher() : CollisionDispatcher
  • CollisionFlags : CollisionObject
  • CollisionObject() : CollisionObject
  • CollisionShape() : CollisionShape
  • CollisionWorld() : CollisionWorld
  • compute_points() : VoronoiSimplexSolver
  • ComputeAngularImpulseDenominator() : RigidBody
  • ComputeBounds() : Shape, Hull
  • ComputeImpulseDenominator() : RigidBody
  • ComputeInertia() : Shape, Hull
  • ConeLocalSupport() : ConeShape
  • ConeShape() : ConeShape
  • ConstraintPersistentData() : ConstraintPersistentData
  • ConstraintSetting() : ConstraintSetting
  • ContactJoint() : ContactJoint
  • ContactSolverInfo() : ContactSolverInfo
  • ContinuousConvexCollision() : ContinuousConvexCollision
  • ConvertBody() : OdeConstraintSolver
  • ConvertConstraint() : OdeConstraintSolver
  • ConvexConcaveCollisionAlgorithm() : ConvexConcaveCollisionAlgorithm
  • ConvexConvexAlgorithm() : ConvexConvexAlgorithm
  • ConvexHullShape() : ConvexHullShape
  • ConvexShape() : ConvexShape
  • Create() : EpaPolyhedron
  • CreateCollisionAlgorithm() : CollisionAlgorithmCreateFunc
  • CreateCone() : EpaPolyhedron
  • CreateConeController() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • CreateConeFace() : EpaPolyhedron
  • createConstraint() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • CreateFace() : EpaPolyhedron
  • CreateHalfEdge() : EpaPolyhedron
  • CreateProxy() : SimpleBroadphase, BroadphaseInterface, AxisSweep3
  • CreateRigidbody() : CcdPhysicsController
  • CreateSphereController() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • CreateVertex() : EpaPolyhedron
  • cross() : SimdVector3
  • CylinderShape() : CylinderShape
  • CylinderShapeX() : CylinderShapeX
  • CylinderShapeZ() : CylinderShapeZ
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- d -

  • DBG_DisableBulletLCP : IDebugDraw
  • DBG_DrawAabb : IDebugDraw
  • DBG_DrawContactPoints : IDebugDraw
  • DBG_DrawFeaturesText : IDebugDraw
  • DBG_DrawText : IDebugDraw
  • DBG_DrawWireframe : IDebugDraw
  • DBG_EnableCCD : IDebugDraw
  • DBG_EnableSatComparison : IDebugDraw
  • DBG_MAX_DEBUG_DRAW_MODE : IDebugDraw
  • DBG_NoDeactivation : IDebugDraw
  • DBG_NoDebug : IDebugDraw
  • DBG_NoHelpText : IDebugDraw
  • DBG_ProfileTimings : IDebugDraw
  • DebugDraw() : ConvexCast::CastResult
  • DebugDrawModes : IDebugDraw
  • DefaultMotionState() : DefaultMotionState
  • DeleteFace() : EpaPolyhedron
  • DeleteVisibleFaces() : EpaPolyhedron
  • Destroy() : EpaPolyhedron
  • DestroyAllFaces() : EpaPolyhedron
  • DestroyAllHalfEdges() : EpaPolyhedron
  • DestroyAllVertices() : EpaPolyhedron
  • DestroyProxy() : SimpleBroadphase, BroadphaseInterface, AxisSweep3
  • determinant() : SimdMatrix3x3
  • DISPATCH_CONTINUOUS : DispatcherInfo
  • DISPATCH_DISCRETE : DispatcherInfo
  • DispatchAllCollisionPairs() : SimpleBroadphase, BroadphaseInterface
  • DispatcherInfo() : DispatcherInfo
  • DispatchFunc : DispatcherInfo
  • distance() : SimdVector3
  • distance2() : SimdVector3
  • Dot : Quat
  • dot() : SimdVector3, SimdQuaternion
  • DrawContactPoint() : IDebugDraw
  • DrawCoordSystem() : ConvexCast::CastResult
  • DrawLine() : IDebugDraw
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- e -

  • EmptyAlgorithm() : EmptyAlgorithm
  • EmptyShape() : EmptyShape
  • emptySimplex() : VoronoiSimplexSolver
  • EnableSatCollisionDetection() : CcdPhysicsEnvironment
  • endFrame() : CcdPhysicsEnvironment
  • Epa() : Epa
  • EpaFace() : EpaFace
  • EpaHalfEdge() : EpaHalfEdge
  • EpaPenDepth() : EpaPenetrationDepthSolver
  • EpaPolyhedron() : EpaPolyhedron
  • EpaVertex() : EpaVertex
  • erp : BU_Joint::Info2
  • error : IndexError
  • Expand() : EpaPolyhedron
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- f -

  • farthest() : SimdQuaternion
  • FillHole() : Hull
  • FilterClosestRayResultCallback() : FilterClosestRayResultCallback
  • find() : UnionFind
  • FindAlgorithm() : CollisionDispatcher, Dispatcher
  • FindContactPoint() : PersistentManifold
  • findex : BU_Joint::Info2, IndexError
  • FindPair() : SimpleBroadphase
  • FindUnions() : CollisionDispatcher
  • flags : BU_Joint
  • FlippedContactResult() : FlippedContactResult
  • ForceActivationState() : CollisionObject
  • fps : BU_Joint::Info2
  • Free() : UnionFind
  • FreeHandle() : AxisSweep3
  • FreeTmpEdge() : Hull
  • FreeTmpFace() : Hull
  • fullSimplex() : VoronoiSimplexSolver
  • furthestAxis() : SimdVector3
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- g -

  • GEN_Link() : GEN_Link
  • GEN_List() : GEN_List
  • GetAabb() : TriangleShape, TriangleMeshShape, SphereShape, EmptyShape, CylinderShape, ConvexShape, CollisionShape, BoxShape
  • getAabb() : RigidBody
  • GetAabbMax() : BoxTriangleCallback
  • GetAabbMin() : BoxTriangleCallback
  • GetAabbSlow() : ConvexShape
  • GetActivationState() : CollisionObject
  • getAngle() : SimdQuaternion
  • GetAngleAxis() : Quat
  • GetAngularMotionDisc() : CollisionShape
  • GetAngularVelocity() : CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • getAngularVelocity() : RigidBody
  • GetBasis() : BU_StaticMotionState, BU_MotionStateInterface
  • getBasis() : SimdTransform
  • GetBody0() : PersistentManifold
  • GetBody1() : PersistentManifold
  • GetBoundingSphere() : CollisionShape
  • GetBroadphase() : CcdPhysicsEnvironment, CollisionWorld
  • GetBroadphaseProxy() : RigidBody
  • GetCacheEntry() : PersistentManifold
  • getCenterOfMassPosition() : RigidBody
  • getCenterOfMassTransform() : RigidBody
  • GetClosestPoints() : GjkPairDetector, DiscreteCollisionDetectorInterface
  • getCollisionMargin() : DiscreteCollisionDetectorInterface
  • GetCollisionShape() : CcdPhysicsController, RigidBody
  • getColumn() : SimdMatrix3x3
  • getConstraintById() : CcdPhysicsEnvironment
  • GetContactBreakingTreshold() : PersistentManifold
  • getContactPoint() : CcdPhysicsEnvironment
  • GetContactPoint() : PersistentManifold
  • GetDebugMode() : IDebugDraw
  • getDiagonal() : JacobianEntry
  • GetDispatcher() : CcdPhysicsEnvironment, CollisionWorld
  • GetDispatcherId() : CollisionAlgorithm, CollisionAlgorithmConstructionInfo
  • GetDistance() : ManifoldPoint
  • GetEdge() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetEdgeOtherFace() : Hull
  • GetEdgeVertex0() : Hull
  • GetEdgeVertex1() : Hull
  • getEuler() : SimdMatrix3x3
  • GetExtraDebugInfo() : CollisionShape
  • GetFace() : Hull
  • GetFaceCentroid() : Hull
  • GetFaceFirstEdge() : Hull
  • GetFaceNextEdge() : Hull
  • GetFaces() : EpaPolyhedron
  • getFixedTimeStep() : CcdPhysicsEnvironment
  • getFriction() : RigidBody
  • GetHalfExtents() : BoxShape
  • GetHandle() : AxisSweep3
  • getHead() : GEN_List
  • GetHeight() : ConeShape
  • GetIndex() : BU_Simplex1to4
  • GetInfo1() : ContactJoint, BU_Joint
  • GetInfo2() : ContactJoint, BU_Joint
  • getInvInertiaDiagLocal() : RigidBody
  • getInvInertiaTensorWorld() : RigidBody
  • getInvMass() : RigidBody
  • GetLifeTime() : ManifoldPoint
  • GetLinearVelocity() : PHY_IPhysicsController, CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • getLinearVelocity() : RigidBody
  • getLocalScaling() : TriangleMeshShape, EmptyShape, ConvexShape, CollisionShape
  • getLockedReadOnlyVertexIndexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • getLockedVertexIndexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • GetManifold() : CcdPhysicsEnvironment, ConvexConvexAlgorithm
  • GetManifoldByIndexInternal() : CollisionDispatcher
  • GetMargin() : PHY_IPhysicsController, CcdPhysicsController, TriangleMeshShape, SphereShape, MinkowskiSumShape, EmptyShape, ConvexShape, CollisionShape
  • GetMaxNumContacts() : HullContactCollector
  • GetMotionState() : CcdPhysicsController, BU_Collidable
  • GetName() : TriangleShape, TriangleMeshShape, SphereShape, BU_Simplex1to4, MultiSphereShape, MinkowskiSumShape, EmptyShape, ConvexHullShape, ConeShape, CollisionShape, BvhTriangleMeshShape, BoxShape
  • GetNbFaces() : EpaPolyhedron
  • getNewClientInfo() : PHY_IPhysicsController, CcdPhysicsController
  • GetNewManifold() : CollisionDispatcher, Dispatcher
  • GetNewManifoldResult() : CollisionDispatcher, Dispatcher
  • getNext() : GEN_Link
  • GetNextFree() : AxisSweep3::Handle
  • getNonDiagonal() : JacobianEntry
  • GetNumCollisionObjects() : CollisionWorld
  • getNumContactPoints() : CcdPhysicsEnvironment
  • GetNumContacts() : PersistentManifold
  • GetNumControllers() : CcdPhysicsEnvironment
  • GetNumEdges() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetNumFaces() : Hull
  • GetNumManifolds() : CcdPhysicsEnvironment, CollisionDispatcher
  • GetNumNodes() : OptimizedBvh
  • GetNumPlanes() : TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • getNumSubParts() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • GetNumVertices() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetNumWheels() : PHY_IVehicle
  • GetO() : BU_Screwing
  • getOpenGLMatrix() : SimdTransform
  • getOpenGLSubMatrix() : SimdMatrix3x3
  • GetOrientation() : BU_StaticMotionState, BU_MotionStateInterface
  • getOrientation() : PHY_IPhysicsController, CcdPhysicsController, RigidBody
  • getOrigin() : SimdTransform
  • GetPhysicsController() : CcdPhysicsEnvironment
  • GetPlane() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetPlaneEquation() : TriangleShape, BoxShape
  • getPosition() : PHY_IPhysicsController, CcdPhysicsController
  • GetPosition() : BU_StaticMotionState, BU_MotionStateInterface
  • GetPositionWorldOnA() : ManifoldPoint
  • GetPositionWorldOnB() : ManifoldPoint
  • getPrev() : GEN_Link
  • GetRadius() : PHY_IPhysicsController, SphereShape, ConeShape
  • getReactionForce() : PHY_IPhysicsController, CcdPhysicsController
  • getRelativeVelocity() : JacobianEntry
  • GetReplica() : PHY_IPhysicsController, CcdPhysicsController
  • getRestitution() : RigidBody
  • GetRigidBody() : CcdPhysicsController
  • GetRigidBodyA() : TypedConstraint, HingeConstraint
  • GetRigidBodyB() : TypedConstraint, HingeConstraint
  • GetRoot() : BUM_PolynomialSolverInterface, BU_AlgebraicPolynomialSolver
  • getRotation() : SimdTransform, SimdMatrix3x3
  • getRow() : SimdMatrix3x3
  • GetS() : BU_Screwing
  • getScaling() : SimdMatrix3x3, StridingMeshInterface
  • GetSeparationHullHull() : Hull
  • GetShape() : BU_Collidable
  • GetShapeA() : MinkowskiSumShape
  • GetShapeB() : MinkowskiSumShape
  • GetShapeType() : TriangleShape, TriangleMeshShape, SphereShape, BU_Simplex1to4, MultiSphereShape, MinkowskiSumShape, EmptyShape, CylinderShape, ConvexHullShape, ConeShape, CollisionShape, BoxShape
  • GetSimpleProxyFromProxy() : SimpleBroadphase
  • getSimplex() : VoronoiSimplexSolver
  • GetSupportVertexLocal() : SupportVertexCallback
  • GetSupportVertexWorldSpace() : SupportVertexCallback
  • getTail() : GEN_List
  • GetTimeOfImpact() : BU_VertexPoly, BU_EdgeEdge
  • GetTimeOfImpactGeneralCase() : BU_EdgeEdge
  • GetTimeOfImpactVertexEdge() : BU_EdgeEdge
  • GetTmpEdge() : Hull
  • GetTmpFace() : Hull
  • GetTransform() : BU_StaticMotionState, BU_MotionStateInterface
  • GetTransformA() : MinkowskiSumShape
  • GetTransformB() : MinkowskiSumShape
  • GetTransformFromMotionState() : CcdPhysicsController
  • GetU() : BU_Screwing
  • GetUnionFind() : CollisionDispatcher
  • GetUniqueId() : CollisionDispatcher, Dispatcher
  • GetUserConstraintId() : PHY_IVehicle, TypedConstraint
  • GetUserConstraintType() : PHY_IVehicle, TypedConstraint
  • GetUserPointer() : BU_Collidable
  • getVehicleConstraint() : CcdPhysicsEnvironment
  • GetVelocity() : PHY_IPhysicsController, CcdPhysicsController
  • getVelocityInLocalPoint() : RigidBody
  • GetVertex() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetVertexPtr() : TriangleShape
  • getW() : SimdVector4
  • GetW() : BU_Screwing
  • GetWheelOrientationQuaternion() : PHY_IVehicle
  • GetWheelPosition() : PHY_IVehicle
  • GetWheelRotation() : PHY_IVehicle
  • GetWorldOrientation() : CcdPhysicsController
  • getWorldOrientation() : PHY_IMotionState, DefaultMotionState
  • getWorldPosition() : PHY_IMotionState, DefaultMotionState
  • GetWorldPosition() : PHY_IPhysicsController
  • getWorldScaling() : PHY_IMotionState, DefaultMotionState
  • getX() : SimdQuadWord
  • getY() : SimdQuadWord
  • getZ() : SimdQuadWord
  • GjkConvexCast() : GjkConvexCast
  • GjkPairDetector() : GjkPairDetector
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- h -

  • HasContactResponse() : CollisionObject
  • HasHit() : CollisionWorld::RayResultCallback
  • hi : BU_Joint::Info2
  • HingeConstraint() : HingeConstraint
  • Hull() : Hull
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- i -

  • InBetweenPosition() : BU_Screwing
  • InBetweenTransform() : BU_Screwing
  • InBetweenVector() : BU_Screwing
  • index : IndexError
  • Initialize() : EpaFace, Epa
  • InitUnionFind() : CollisionDispatcher
  • insertAfter() : GEN_Link
  • insertBefore() : GEN_Link
  • inSimplex() : VoronoiSimplexSolver
  • IntegrateTransform() : SimdTransformUtil
  • integrateVelocities() : RigidBody
  • InternalFindAlgorithm() : CollisionDispatcher
  • InternalProcessAllTriangles() : StridingMeshInterface
  • InternalProcessTriangleIndex() : InternalTriangleIndexCallback
  • Inv : Quat
  • inverse() : SimdTransform, SimdQuaternion, SimdMatrix3x3
  • inverseTimes() : SimdTransform
  • invXform() : SimdTransform
  • IsAffinelyDependent() : EpaFace
  • IsClosestPointInternal() : EpaFace
  • IsConcave() : CollisionShape
  • IsConvex() : CollisionShape
  • IsFinite() : Quat
  • isHead() : GEN_Link
  • isIdentity() : SimdTransform
  • IsInside() : TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • IsMax() : AxisSweep3::Edge
  • IsPolyhedral() : CollisionShape
  • IsSatCollisionDetectionEnabled() : CcdPhysicsEnvironment
  • isStatic : CollisionObject
  • IsStatic() : CollisionObject
  • isTail() : GEN_Link
  • IsValid() : SubSimplexClosestResult
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- p -

  • PerformDiscreteCollisionDetection() : CollisionWorld
  • PersistentManifold() : PersistentManifold
  • Point2PointConstraint() : Point2PointConstraint
  • PointCollector() : PointCollector
  • PointOutsideOfPlane() : VoronoiSimplexSolver
  • PolyhedralConvexShape() : PolyhedralConvexShape
  • PostProcessReplica() : PHY_IPhysicsController, CcdPhysicsController
  • preallocateIndices() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • preallocateVertices() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • predictIntegratedTransform() : RigidBody
  • proceedDeltaTime() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • proceedDeltaTimeOneStep() : CcdPhysicsEnvironment
  • proceedToTransform() : RigidBody
  • ProcessAllTriangles() : TriangleMeshShape, BvhTriangleMeshShape
  • ProcessCollision() : EmptyAlgorithm, ConvexConvexAlgorithm, ConvexConcaveCollisionAlgorithm, CollisionAlgorithm
  • ProcessHullHull() : Hull
  • ProcessIsland() : CollisionDispatcher::IslandCallback
  • ProcessNode() : NodeOverlapCallback
  • ProcessTriangle() : TriangleRaycastCallback, SupportVertexCallback, TriangleCallback, BoxTriangleCallback
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- q -

  • Quantize() : AxisSweep3
  • Quat() : Quat
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- r -

  • RayResultCallback() : CollisionWorld::RayResultCallback
  • rayTest() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • RayTest() : CollisionWorld
  • RecalcLocalAabb() : TriangleMeshShape
  • ReduceVertices() : VoronoiSimplexSolver
  • RefreshContactPoints() : PersistentManifold
  • RefreshOverlappingPairs() : SimpleBroadphase, AxisSweep3
  • RelativeRotate() : PHY_IPhysicsController, CcdPhysicsController
  • RelativeTranslate() : PHY_IPhysicsController, CcdPhysicsController
  • ReleaseManifold() : CollisionDispatcher, Dispatcher
  • ReleaseManifoldResult() : CollisionDispatcher, Dispatcher
  • remove() : GEN_Link
  • removeCcdPhysicsController() : CcdPhysicsEnvironment
  • removeCollisionCallback() : CcdPhysicsEnvironment
  • RemoveCollisionObject() : CollisionWorld
  • removeConstraint() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • RemoveContactPoint() : PersistentManifold
  • RemoveHandle() : AxisSweep3
  • RemoveOverlappingPair() : SimpleBroadphase
  • RemoveOverlappingPairsContainingProxy() : SimpleBroadphase
  • removeSensor() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • RemoveTmpFace() : Hull
  • removeVertex() : VoronoiSimplexSolver
  • RemoveVisibleFaces() : Hull
  • ReplaceContactPoint() : PersistentManifold
  • ReportAabbOverlappingNodex() : OptimizedBvh
  • ReportHit() : TriangleRaycastCallback
  • ReportSphereOverlappingNodex() : OptimizedBvh
  • requestCollisionCallback() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • reset() : VoronoiSimplexSolver, UsageBitfield, UnionFind
  • Reset() : SubSimplexClosestResult, BU_Simplex1to4
  • resolveAngularConstraint() : Solve2LinearConstraint
  • resolveBilateralPairConstraint() : Solve2LinearConstraint
  • resolveCombinedVelocities() : CcdPhysicsController
  • resolveUnilateralPairConstraint() : Solve2LinearConstraint
  • RIGID : SimdTransform
  • RigidBody() : RigidBody
  • rotate() : SimdVector3
  • Rotate() : Quat
  • ROTATION : SimdTransform
  • rowskip : BU_Joint::Info2
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- s -

  • s_firstFreeTmpEdge : Hull
  • s_firstFreeTmpFace : Hull
  • s_firstUsedTmpEdge : Hull
  • s_firstUsedTmpFace : Hull
  • s_pPoints : Hull
  • s_pTmpEdges : Hull
  • s_pTmpFaces : Hull
  • saveKinematicState() : RigidBody
  • scale() : SimdTransform
  • scaled() : SimdMatrix3x3
  • SCALING : SimdTransform
  • SetAabb() : CcdPhysicsController, SimpleBroadphase, BroadphaseInterface, AxisSweep3
  • SetActivationState() : CollisionObject
  • SetActive() : PHY_IPhysicsController, CcdPhysicsController
  • setAngularOnly() : HingeConstraint
  • SetAngularVelocity() : PHY_IPhysicsController, CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • setAngularVelocity() : RigidBody
  • SetBarycentricCoordinates() : SubSimplexClosestResult
  • setBasis() : SimdTransform
  • SetBasis() : BU_StaticMotionState, BU_MotionStateInterface
  • SetBodies() : PersistentManifold
  • SetBroadphaseProxy() : RigidBody
  • SetCachedSeperatingAxis() : GjkPairDetector
  • setCcdMode() : CcdPhysicsEnvironment
  • setCenterOfMassTransform() : RigidBody
  • SetCollisionShape() : CollisionObject
  • setConstraintForceMixing() : OdeConstraintSolver
  • setContactBreakingTreshold() : CcdPhysicsEnvironment
  • setDamping() : RigidBody
  • setDeactivationAngularTreshold() : CcdPhysicsEnvironment
  • setDeactivationLinearTreshold() : CcdPhysicsEnvironment
  • setDeactivationTime() : CcdPhysicsEnvironment
  • setDebugDrawer() : CcdPhysicsEnvironment
  • setDebugMode() : CcdPhysicsEnvironment
  • SetDebugMode() : IDebugDraw
  • SetDistance() : ManifoldPoint
  • setErrorReductionParamter() : OdeConstraintSolver
  • setEuler() : SimdQuaternion
  • setEulerYPR() : SimdMatrix3x3
  • setEulerZYX() : SimdMatrix3x3
  • SetExtraDebugInfo() : CollisionShape
  • setFixedTimeStep() : CcdPhysicsEnvironment
  • setFriction() : RigidBody
  • setFromOpenGLMatrix() : SimdTransform
  • setFromOpenGLSubMatrix() : SimdMatrix3x3
  • setGravity() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment, RigidBody
  • setIdentity() : SimdTransform, SimdMatrix3x3
  • SetIgnoreMargin() : GjkPairDetector
  • setInterpolate3() : SimdVector3
  • setInvInertiaDiagLocal() : RigidBody
  • setLinearAirDamping() : CcdPhysicsEnvironment
  • SetLinearVelocity() : PHY_IPhysicsController, CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • setLinearVelocity() : RigidBody
  • setLocalScaling() : TriangleMeshShape, EmptyShape, ConvexShape, CollisionShape, BvhTriangleMeshShape
  • SetLowLevelOfDetail() : ConvexConvexAlgorithm
  • SetMargin() : PHY_IPhysicsController, CcdPhysicsController, TriangleMeshShape, SphereShape, EmptyShape, ConvexShape, CollisionShape
  • setMassProps() : RigidBody
  • setMax() : SimdQuadWord
  • setMin() : SimdQuadWord
  • SetMinkowskiA() : GjkPairDetector
  • SetMinkowskiB() : GjkPairDetector
  • setNewClientInfo() : PHY_IPhysicsController, CcdPhysicsController
  • SetNextFree() : AxisSweep3::Handle
  • setNumIterations() : CcdPhysicsEnvironment
  • setNumTimeSubSteps() : CcdPhysicsEnvironment
  • setOrientation() : PHY_IPhysicsController, CcdPhysicsController
  • SetOrientation() : BU_StaticMotionState, BU_MotionStateInterface
  • setOrigin() : SimdTransform
  • SetPenetrationDepthSolver() : GjkPairDetector
  • SetPivotA() : Point2PointConstraint
  • SetPivotB() : Point2PointConstraint
  • SetPosition() : BU_StaticMotionState, BU_MotionStateInterface
  • setPosition() : PHY_IPhysicsController, CcdPhysicsController
  • setRestitution() : RigidBody
  • setRigidBody() : PHY_IPhysicsController, CcdPhysicsController
  • setRotation() : SimdTransform, SimdQuaternion, SimdMatrix3x3
  • setScaling() : PHY_IPhysicsController, CcdPhysicsController, StridingMeshInterface
  • setSolverDamping() : CcdPhysicsEnvironment
  • setSolverSorConstant() : CcdPhysicsEnvironment
  • setSolverTau() : CcdPhysicsEnvironment
  • setSolverType() : CcdPhysicsEnvironment
  • SetSteeringValue() : PHY_IVehicle
  • SetTimeStepAndCounters() : BoxTriangleCallback
  • SetTransform() : BU_StaticMotionState, BU_MotionStateInterface
  • SetTransformA() : MinkowskiSumShape
  • SetTransformB() : MinkowskiSumShape
  • setUseEpa() : CcdPhysicsEnvironment
  • SetUserConstraintId() : TypedConstraint
  • SetUserConstraintType() : TypedConstraint
  • setValue() : SimdTransform, SimdQuadWord, SimdMatrix3x3
  • setWorldOrientation() : PHY_IMotionState, DefaultMotionState
  • setWorldPosition() : PHY_IMotionState, DefaultMotionState
  • setX() : SimdQuadWord
  • setY() : SimdQuadWord
  • setZ() : SimdQuadWord
  • Shape() : Shape
  • ShapeCollider : Hull
  • SimdMatrix3x3() : SimdMatrix3x3
  • SimdQuadWord() : SimdQuadWord
  • SimdQuaternion() : SimdQuaternion
  • SimdTransform() : SimdTransform
  • SimdVector3() : SimdVector3
  • SimdVector4() : SimdVector4
  • SimpleBroadphase() : SimpleBroadphase
  • SimpleBroadphaseProxy() : SimpleBroadphaseProxy
  • SimpleConstraintSolver() : SimpleConstraintSolver
  • slerp() : SimdQuaternion
  • Slerp : Quat
  • Solve() : SimpleConstraintSolver
  • Solve2LinearConstraint() : Solve2LinearConstraint
  • Solve2Quadratic() : BU_AlgebraicPolynomialSolver
  • Solve2QuadraticFull() : BU_AlgebraicPolynomialSolver
  • Solve3Cubic() : BUM_PolynomialSolverInterface, BU_AlgebraicPolynomialSolver
  • Solve4Quartic() : BUM_PolynomialSolverInterface, BU_AlgebraicPolynomialSolver
  • SolveConstraint() : TypedConstraint, Point2PointConstraint, HingeConstraint
  • SolveFriction() : SimpleConstraintSolver
  • SolveGroup() : SimpleConstraintSolver, OdeConstraintSolver, ConstraintSolver
  • SortAndCalcSplittingIndex() : OptimizedBvh
  • SortCachedPoints() : PersistentManifold
  • SortMaxDown() : AxisSweep3
  • SortMaxUp() : AxisSweep3
  • SortMinDown() : AxisSweep3
  • SortMinUp() : AxisSweep3
  • SphereShape() : SphereShape
  • StorageResult() : StorageResult
  • StridingMeshInterface() : StridingMeshInterface
  • SubsimplexConvexCast() : SubsimplexConvexCast
  • SupportVertexCallback() : SupportVertexCallback
  • SynchronizeMotionStates() : PHY_IPhysicsController, CcdPhysicsController
  • SyncMotionStates() : CcdPhysicsEnvironment
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- t -

  • tdot() : SimdMatrix3x3
  • TestOverlap() : AxisSweep3
  • TetrahedronContainsOrigin() : Epa
  • timesTranspose() : SimdMatrix3x3
  • TmpFaceAddPoint() : Hull
  • translate() : RigidBody
  • TRANSLATION : SimdTransform
  • transpose() : SimdMatrix3x3
  • transposeTimes() : SimdMatrix3x3
  • TriangleIndexVertexArray() : TriangleIndexVertexArray
  • TriangleMesh() : TriangleMesh
  • TriangleMeshShape() : TriangleMeshShape
  • TriangleRaycastCallback() : TriangleRaycastCallback
  • TriangleShape() : TriangleShape
  • triple() : SimdVector3
  • TypedConstraint() : TypedConstraint
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- u -

  • UnionFind() : UnionFind
  • unite() : UnionFind
  • unLockReadOnlyVertexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • unLockVertexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • UnmatchOrRemoveEdge() : Hull
  • unused1 : UsageBitfield
  • unused2 : UsageBitfield
  • unused3 : UsageBitfield
  • unused4 : UsageBitfield
  • UpdateAabbs() : CcdPhysicsEnvironment
  • UpdateActivationState() : CollisionWorld
  • UpdateClosestVectorAndPoints() : VoronoiSimplexSolver
  • UpdateDeactivation() : CcdPhysicsController
  • UpdateHandle() : AxisSweep3
  • updateInertiaTensor() : RigidBody
  • UpdateRHS() : Point2PointConstraint, HingeConstraint
  • UsageBitfield() : UsageBitfield
  • usedVertexA : UsageBitfield
  • usedVertexB : UsageBitfield
  • usedVertexC : UsageBitfield
  • usedVertexD : UsageBitfield
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- v -

  • validate() : SimpleBroadphase
  • ValidContactDistance() : PersistentManifold
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- w -

  • WalkStacklessTree() : OptimizedBvh
  • WalkTree() : OptimizedBvh
  • wantsSleeping() : CcdPhysicsController
  • WriteDynamicsToMotionState() : PHY_IPhysicsController, CcdPhysicsController
  • WriteMotionStateToDynamics() : PHY_IPhysicsController, CcdPhysicsController
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- x -

  • x() : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

Here is a list of all class members with links to the classes they belong to:

- y -

  • y() : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Enumerations

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions

  • CollisionFlags : CollisionObject
  • DebugDrawModes : IDebugDraw
  • DispatchFunc : DispatcherInfo
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Enumerator

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions

  • AFFINE : SimdTransform
  • DBG_DisableBulletLCP : IDebugDraw
  • DBG_DrawAabb : IDebugDraw
  • DBG_DrawContactPoints : IDebugDraw
  • DBG_DrawFeaturesText : IDebugDraw
  • DBG_DrawText : IDebugDraw
  • DBG_DrawWireframe : IDebugDraw
  • DBG_EnableCCD : IDebugDraw
  • DBG_EnableSatComparison : IDebugDraw
  • DBG_MAX_DEBUG_DRAW_MODE : IDebugDraw
  • DBG_NoDeactivation : IDebugDraw
  • DBG_NoDebug : IDebugDraw
  • DBG_NoHelpText : IDebugDraw
  • DBG_ProfileTimings : IDebugDraw
  • DISPATCH_CONTINUOUS : DispatcherInfo
  • DISPATCH_DISCRETE : DispatcherInfo
  • isStatic : CollisionObject
  • kFeatureA : Separation
  • kFeatureB : Separation
  • kFeatureBoth : Separation
  • kFeatureNone : Separation
  • LINEAR : SimdTransform
  • noContactResponse : CollisionObject
  • RIGID : SimdTransform
  • ROTATION : SimdTransform
  • SCALING : SimdTransform
  • TRANSLATION : SimdTransform
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- a -

  • AabbOverlap() : SimpleBroadphase
  • absolute() : SimdVector3, SimdMatrix3x3
  • absolute4() : SimdVector4
  • activate() : CollisionObject
  • addCcdPhysicsController() : CcdPhysicsEnvironment
  • AddCollisionObject() : CollisionWorld
  • AddContactPoint() : PointCollector, MyResult, ManifoldContactAddResult, StorageResult, DiscreteCollisionDetectorInterface::Result, ManifoldResult, FlippedContactResult
  • AddContactsHullHull() : Hull
  • AddHandle() : AxisSweep3
  • addHead() : GEN_List
  • AddManifoldPoint() : PersistentManifold
  • AddOverlappingPair() : SimpleBroadphase
  • AddPoint() : ConvexHullShape
  • addSensor() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • AddSingleResult() : FilterClosestRayResultCallback, CollisionWorld::ClosestRayResultCallback, CollisionWorld::RayResultCallback
  • addTail() : GEN_List
  • AddTmpFace() : Hull
  • addTouchCallback() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • AddTriangle() : TriangleMesh
  • AddVertex() : BU_Simplex1to4
  • addVertex() : VoronoiSimplexSolver
  • AddWheel() : PHY_IVehicle
  • adjoint() : SimdMatrix3x3
  • Allocate() : UnionFind
  • AllocHandle() : AxisSweep3
  • AllocTmpEdge() : Hull
  • AllocTmpFace() : Hull
  • angle() : SimdVector3, SimdQuaternion
  • ApplyBraking() : PHY_IVehicle
  • applyCentralForce() : RigidBody
  • applyCentralImpulse() : RigidBody
  • ApplyEngineForce() : PHY_IVehicle
  • ApplyForce() : PHY_IPhysicsController, CcdPhysicsController
  • applyForce() : RigidBody
  • applyForces() : RigidBody
  • applyImpulse() : PHY_IPhysicsController, CcdPhysicsController, RigidBody
  • ApplyTorque() : PHY_IPhysicsController, CcdPhysicsController
  • applyTorque() : RigidBody
  • applyTorqueImpulse() : RigidBody
  • ATTRIBUTE_ALIGNED16() : SimdQuadWord
  • AxisSweep3() : AxisSweep3
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- j -

  • JacobianEntry() : JacobianEntry
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- l -

  • length() : SimdVector3, SimdQuaternion
  • length2() : SimdVector3, SimdQuaternion
  • lerp() : SimdVector3
  • LocalGetSupportingVertex() : TriangleMeshShape, SphereShape, CylinderShape, ConvexShape, ConvexHullShape, ConeShape, BoxShape
  • LocalGetSupportingVertexWithoutMargin() : TriangleShape, TriangleMeshShape, SphereShape, PolyhedralConvexShape, MultiSphereShape, MinkowskiSumShape, CylinderShapeZ, CylinderShapeX, CylinderShape, ConvexShape, ConvexHullShape, ConeShape, BoxShape
  • LocalMatrix() : BU_Screwing
  • LocalRayResult() : CollisionWorld::LocalRayResult
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- m -

  • MakeHull() : Hull
  • MakeHullFromTemp() : Hull
  • ManifoldContactAddResult() : ManifoldContactAddResult
  • ManifoldPoint() : ManifoldPoint
  • ManifoldResult() : ManifoldResult
  • MassProps() : MassProps
  • MatchOrAddEdge() : Hull
  • maxAxis() : SimdVector3
  • maxAxis4() : SimdVector4
  • maxVertex() : VoronoiSimplexSolver
  • mergesSimulationIslands() : CollisionObject
  • minAxis() : SimdVector3
  • minAxis4() : SimdVector4
  • MinkowskiSumShape() : MinkowskiSumShape
  • mult() : SimdTransform
  • multInverseLeft() : SimdTransform
  • MultiSphereShape() : MultiSphereShape
  • MyResult() : MyResult
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- n -

  • NeedsCollision() : CollisionDispatcher, Dispatcher
  • NeedsResponse() : CollisionDispatcher
  • normalize() : SimdVector3, SimdQuaternion
  • normalized() : SimdVector3, SimdQuaternion
  • numVertices() : VoronoiSimplexSolver
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- o -

  • OdeConstraintSolver() : OdeConstraintSolver
  • operator *() : SimdTransform, SimdQuaternion, Quat
  • operator *=() : SimdVector3, SimdTransform, SimdQuaternion, SimdMatrix3x3, Quat
  • operator const float *() : PHY__Vector3
  • operator const SimdScalar *() : SimdQuadWord
  • operator delete() : DiscreteCollisionDetectorInterface::Result, DiscreteCollisionDetectorInterface
  • operator float *() : PHY__Vector3
  • operator SimdScalar *() : SimdQuadWord
  • operator()() : SimdTransform
  • operator+() : SimdQuaternion, Quat
  • operator+=() : SimdVector3, SimdQuaternion, Quat
  • operator-() : SimdQuaternion, Quat
  • operator-=() : SimdVector3, SimdQuaternion, Quat
  • operator/() : SimdQuaternion
  • operator/=() : SimdVector3, SimdQuaternion
  • operator=() : Quat, EpaVertex, EpaPolyhedron, EpaHalfEdge, EpaFace, Epa
  • operator[]() : SimdQuadWord, SimdMatrix3x3
  • OptimizedBvh() : OptimizedBvh
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- z -

  • z() : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- ~ -

  • ~AxisSweep3() : AxisSweep3
  • ~BoxShape() : BoxShape
  • ~BoxTriangleCallback() : BoxTriangleCallback
  • ~BroadphaseInterface() : BroadphaseInterface
  • ~BU_Joint() : BU_Joint
  • ~BU_MotionStateInterface() : BU_MotionStateInterface
  • ~BU_Screwing() : BU_Screwing
  • ~BU_StaticMotionState() : BU_StaticMotionState
  • ~BUM_PolynomialSolverInterface() : BUM_PolynomialSolverInterface
  • ~BvhTriangleMeshShape() : BvhTriangleMeshShape
  • ~CastResult() : ConvexCast::CastResult
  • ~CcdPhysicsController() : CcdPhysicsController
  • ~CcdPhysicsEnvironment() : CcdPhysicsEnvironment
  • ~CollisionAlgorithm() : CollisionAlgorithm
  • ~CollisionAlgorithmCreateFunc() : CollisionAlgorithmCreateFunc
  • ~CollisionDispatcher() : CollisionDispatcher
  • ~CollisionShape() : CollisionShape
  • ~CollisionWorld() : CollisionWorld
  • ~ConstraintSolver() : ConstraintSolver
  • ~ConvexCast() : ConvexCast
  • ~ConvexConcaveCollisionAlgorithm() : ConvexConcaveCollisionAlgorithm
  • ~ConvexConvexAlgorithm() : ConvexConvexAlgorithm
  • ~ConvexPenetrationDepthSolver() : ConvexPenetrationDepthSolver
  • ~ConvexShape() : ConvexShape
  • ~DefaultMotionState() : DefaultMotionState
  • ~DiscreteCollisionDetectorInterface() : DiscreteCollisionDetectorInterface
  • ~Dispatcher() : Dispatcher
  • ~EmptyShape() : EmptyShape
  • ~Epa() : Epa
  • ~EpaFace() : EpaFace
  • ~EpaHalfEdge() : EpaHalfEdge
  • ~EpaPolyhedron() : EpaPolyhedron
  • ~EpaVertex() : EpaVertex
  • ~FilterClosestRayResultCallback() : FilterClosestRayResultCallback
  • ~GjkPairDetector() : GjkPairDetector
  • ~Hull() : Hull
  • ~HullContactCollector() : HullContactCollector
  • ~IDebugDraw() : IDebugDraw
  • ~InternalTriangleIndexCallback() : InternalTriangleIndexCallback
  • ~IslandCallback() : CollisionDispatcher::IslandCallback
  • ~ManifoldResult() : ManifoldResult
  • ~NodeOverlapCallback() : NodeOverlapCallback
  • ~OdeConstraintSolver() : OdeConstraintSolver
  • ~OptimizedBvh() : OptimizedBvh
  • ~PHY_IMotionState() : PHY_IMotionState
  • ~PHY_IPhysicsController() : PHY_IPhysicsController
  • ~PHY_IPhysicsEnvironment() : PHY_IPhysicsEnvironment
  • ~PHY_IVehicle() : PHY_IVehicle
  • ~RayResultCallback() : CollisionWorld::RayResultCallback
  • ~Result() : DiscreteCollisionDetectorInterface::Result
  • ~Shape() : Shape
  • ~SimpleBroadphase() : SimpleBroadphase
  • ~SimpleConstraintSolver() : SimpleConstraintSolver
  • ~StorageResult() : StorageResult
  • ~StridingMeshInterface() : StridingMeshInterface
  • ~TriangleCallback() : TriangleCallback
  • ~TriangleMeshShape() : TriangleMeshShape
  • ~TypedConstraint() : TypedConstraint
  • ~UnionFind() : UnionFind
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- b -

  • backup_closest() : VoronoiSimplexSolver
  • BatchAddContactGroup() : HullContactCollector
  • BatchedUnitVectorGetSupportingVertexWithoutMargin() : TriangleShape, SphereShape, PolyhedralConvexShape, MultiSphereShape, MinkowskiSumShape, CylinderShapeZ, CylinderShapeX, CylinderShape, ConvexShape, ConvexHullShape, ConeShape, BoxShape
  • beginFrame() : CcdPhysicsEnvironment
  • BoxShape() : BoxShape
  • BoxTriangleCallback() : BoxTriangleCallback
  • BroadphasePair() : BroadphasePair
  • BroadphaseProxy() : BroadphaseProxy
  • BU_AlgebraicPolynomialSolver() : BU_AlgebraicPolynomialSolver
  • BU_Collidable() : BU_Collidable
  • BU_CollisionPair() : BU_CollisionPair
  • BU_EdgeEdge() : BU_EdgeEdge
  • BU_Joint() : BU_Joint
  • BU_Screwing() : BU_Screwing
  • BU_Simplex1to4() : BU_Simplex1to4
  • BU_VertexPoly() : BU_VertexPoly
  • Build() : OptimizedBvh
  • BuildAndProcessIslands() : CollisionDispatcher
  • BuildJacobian() : TypedConstraint, Point2PointConstraint, HingeConstraint
  • BuildTree() : OptimizedBvh
  • BvhTriangleMeshShape() : BvhTriangleMeshShape
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- c -

  • Calc2DRotationPointPoint() : BU_EdgeEdge
  • CalcClosestPoint() : EpaFace
  • CalcClosestPointOnA() : EpaFace
  • CalcClosestPointOnB() : EpaFace
  • CalcNormal() : TriangleShape
  • CalcPenDepth() : MinkowskiPenetrationDepthSolver, EpaPenetrationDepthSolver, Epa, ConvexPenetrationDepthSolver
  • CalcSplittingAxis() : OptimizedBvh
  • calcTimeOfImpact() : SubsimplexConvexCast, GjkConvexCast, ConvexCast, ContinuousConvexCollision, BU_CollisionPair
  • CalculateF() : BU_Screwing
  • CalculateLocalInertia() : TriangleShape, TriangleMeshShape, SphereShape, PolyhedralConvexShape, MultiSphereShape, MinkowskiSumShape, EmptyShape, ConeShape, CollisionShape, BoxShape
  • CalculateTemporalAabb() : CollisionShape
  • CalculateTimeOfImpact() : EmptyAlgorithm, ConvexConvexAlgorithm, ConvexConcaveCollisionAlgorithm, CollisionAlgorithm
  • CalculateVelocity() : SimdTransformUtil
  • calculateWorldTransformations() : PHY_IMotionState, DefaultMotionState
  • calcXform() : PHY_IPhysicsController, CcdPhysicsController
  • CallbackTriggers() : CcdPhysicsEnvironment
  • CastResult() : ConvexCast::CastResult
  • CcdConstructionInfo() : CcdConstructionInfo
  • CcdPhysicsController() : CcdPhysicsController
  • CcdPhysicsEnvironment() : CcdPhysicsEnvironment
  • CheckPenetrationDepthSolver() : ConvexConvexAlgorithm
  • CleanOverlappingPair() : SimpleBroadphase
  • CleanProxyFromPairs() : SimpleBroadphase, BroadphaseInterface
  • ClearCache() : ConvexConcaveCollisionAlgorithm, BoxTriangleCallback
  • clearForces() : RigidBody
  • ClearManifold() : PersistentManifold, CollisionDispatcher, Dispatcher
  • ClearUserCache() : PersistentManifold
  • ClipFace() : Hull
  • closest() : VoronoiSimplexSolver
  • closestAxis() : SimdVector3
  • closestAxis4() : SimdVector4
  • ClosestPointInput() : DiscreteCollisionDetectorInterface::ClosestPointInput
  • ClosestPtPointTetrahedron() : VoronoiSimplexSolver
  • ClosestPtPointTriangle() : VoronoiSimplexSolver
  • ClosestRayResultCallback() : CollisionWorld::ClosestRayResultCallback
  • cofac() : SimdMatrix3x3
  • CollectVertices() : EpaFace
  • CollisionAlgorithm() : CollisionAlgorithm
  • CollisionAlgorithmConstructionInfo() : CollisionAlgorithmConstructionInfo
  • CollisionAlgorithmCreateFunc() : CollisionAlgorithmCreateFunc
  • CollisionDispatcher() : CollisionDispatcher
  • CollisionObject() : CollisionObject
  • CollisionShape() : CollisionShape
  • CollisionWorld() : CollisionWorld
  • compute_points() : VoronoiSimplexSolver
  • ComputeAngularImpulseDenominator() : RigidBody
  • ComputeBounds() : Shape, Hull
  • ComputeImpulseDenominator() : RigidBody
  • ComputeInertia() : Shape, Hull
  • ConeLocalSupport() : ConeShape
  • ConeShape() : ConeShape
  • ConstraintPersistentData() : ConstraintPersistentData
  • ConstraintSetting() : ConstraintSetting
  • ContactJoint() : ContactJoint
  • ContactSolverInfo() : ContactSolverInfo
  • ContinuousConvexCollision() : ContinuousConvexCollision
  • ConvertBody() : OdeConstraintSolver
  • ConvertConstraint() : OdeConstraintSolver
  • ConvexConcaveCollisionAlgorithm() : ConvexConcaveCollisionAlgorithm
  • ConvexConvexAlgorithm() : ConvexConvexAlgorithm
  • ConvexHullShape() : ConvexHullShape
  • ConvexShape() : ConvexShape
  • Create() : EpaPolyhedron
  • CreateCollisionAlgorithm() : CollisionAlgorithmCreateFunc
  • CreateCone() : EpaPolyhedron
  • CreateConeController() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • CreateConeFace() : EpaPolyhedron
  • createConstraint() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • CreateFace() : EpaPolyhedron
  • CreateHalfEdge() : EpaPolyhedron
  • CreateProxy() : SimpleBroadphase, BroadphaseInterface, AxisSweep3
  • CreateRigidbody() : CcdPhysicsController
  • CreateSphereController() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • CreateVertex() : EpaPolyhedron
  • cross() : SimdVector3
  • CylinderShape() : CylinderShape
  • CylinderShapeX() : CylinderShapeX
  • CylinderShapeZ() : CylinderShapeZ
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- d -

  • DebugDraw() : ConvexCast::CastResult
  • DefaultMotionState() : DefaultMotionState
  • DeleteFace() : EpaPolyhedron
  • DeleteVisibleFaces() : EpaPolyhedron
  • Destroy() : EpaPolyhedron
  • DestroyAllFaces() : EpaPolyhedron
  • DestroyAllHalfEdges() : EpaPolyhedron
  • DestroyAllVertices() : EpaPolyhedron
  • DestroyProxy() : SimpleBroadphase, BroadphaseInterface, AxisSweep3
  • determinant() : SimdMatrix3x3
  • DispatchAllCollisionPairs() : SimpleBroadphase, BroadphaseInterface
  • DispatcherInfo() : DispatcherInfo
  • distance() : SimdVector3
  • distance2() : SimdVector3
  • dot() : SimdVector3, SimdQuaternion
  • DrawContactPoint() : IDebugDraw
  • DrawCoordSystem() : ConvexCast::CastResult
  • DrawLine() : IDebugDraw
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- e -

  • EmptyAlgorithm() : EmptyAlgorithm
  • EmptyShape() : EmptyShape
  • emptySimplex() : VoronoiSimplexSolver
  • EnableSatCollisionDetection() : CcdPhysicsEnvironment
  • endFrame() : CcdPhysicsEnvironment
  • Epa() : Epa
  • EpaFace() : EpaFace
  • EpaHalfEdge() : EpaHalfEdge
  • EpaPenDepth() : EpaPenetrationDepthSolver
  • EpaPolyhedron() : EpaPolyhedron
  • EpaVertex() : EpaVertex
  • Expand() : EpaPolyhedron
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- f -

  • farthest() : SimdQuaternion
  • FillHole() : Hull
  • FilterClosestRayResultCallback() : FilterClosestRayResultCallback
  • find() : UnionFind
  • FindAlgorithm() : CollisionDispatcher, Dispatcher
  • FindContactPoint() : PersistentManifold
  • FindPair() : SimpleBroadphase
  • FindUnions() : CollisionDispatcher
  • FlippedContactResult() : FlippedContactResult
  • ForceActivationState() : CollisionObject
  • Free() : UnionFind
  • FreeHandle() : AxisSweep3
  • FreeTmpEdge() : Hull
  • FreeTmpFace() : Hull
  • fullSimplex() : VoronoiSimplexSolver
  • furthestAxis() : SimdVector3
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- g -

  • GEN_Link() : GEN_Link
  • GEN_List() : GEN_List
  • GetAabb() : TriangleShape, TriangleMeshShape, SphereShape, EmptyShape, CylinderShape, ConvexShape, CollisionShape, BoxShape
  • getAabb() : RigidBody
  • GetAabbMax() : BoxTriangleCallback
  • GetAabbMin() : BoxTriangleCallback
  • GetAabbSlow() : ConvexShape
  • GetActivationState() : CollisionObject
  • getAngle() : SimdQuaternion
  • GetAngleAxis() : Quat
  • GetAngularMotionDisc() : CollisionShape
  • GetAngularVelocity() : CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • getAngularVelocity() : RigidBody
  • GetBasis() : BU_StaticMotionState, BU_MotionStateInterface
  • getBasis() : SimdTransform
  • GetBody0() : PersistentManifold
  • GetBody1() : PersistentManifold
  • GetBoundingSphere() : CollisionShape
  • GetBroadphase() : CcdPhysicsEnvironment, CollisionWorld
  • GetBroadphaseProxy() : RigidBody
  • GetCacheEntry() : PersistentManifold
  • getCenterOfMassPosition() : RigidBody
  • getCenterOfMassTransform() : RigidBody
  • GetClosestPoints() : GjkPairDetector, DiscreteCollisionDetectorInterface
  • getCollisionMargin() : DiscreteCollisionDetectorInterface
  • GetCollisionShape() : CcdPhysicsController, RigidBody
  • getColumn() : SimdMatrix3x3
  • getConstraintById() : CcdPhysicsEnvironment
  • GetContactBreakingTreshold() : PersistentManifold
  • getContactPoint() : CcdPhysicsEnvironment
  • GetContactPoint() : PersistentManifold
  • GetDebugMode() : IDebugDraw
  • getDiagonal() : JacobianEntry
  • GetDispatcher() : CcdPhysicsEnvironment, CollisionWorld
  • GetDispatcherId() : CollisionAlgorithm, CollisionAlgorithmConstructionInfo
  • GetDistance() : ManifoldPoint
  • GetEdge() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetEdgeOtherFace() : Hull
  • GetEdgeVertex0() : Hull
  • GetEdgeVertex1() : Hull
  • getEuler() : SimdMatrix3x3
  • GetExtraDebugInfo() : CollisionShape
  • GetFace() : Hull
  • GetFaceCentroid() : Hull
  • GetFaceFirstEdge() : Hull
  • GetFaceNextEdge() : Hull
  • GetFaces() : EpaPolyhedron
  • getFixedTimeStep() : CcdPhysicsEnvironment
  • getFriction() : RigidBody
  • GetHalfExtents() : BoxShape
  • GetHandle() : AxisSweep3
  • getHead() : GEN_List
  • GetHeight() : ConeShape
  • GetIndex() : BU_Simplex1to4
  • GetInfo1() : ContactJoint, BU_Joint
  • GetInfo2() : ContactJoint, BU_Joint
  • getInvInertiaDiagLocal() : RigidBody
  • getInvInertiaTensorWorld() : RigidBody
  • getInvMass() : RigidBody
  • GetLifeTime() : ManifoldPoint
  • GetLinearVelocity() : PHY_IPhysicsController, CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • getLinearVelocity() : RigidBody
  • getLocalScaling() : TriangleMeshShape, EmptyShape, ConvexShape, CollisionShape
  • getLockedReadOnlyVertexIndexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • getLockedVertexIndexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • GetManifold() : CcdPhysicsEnvironment, ConvexConvexAlgorithm
  • GetManifoldByIndexInternal() : CollisionDispatcher
  • GetMargin() : PHY_IPhysicsController, CcdPhysicsController, TriangleMeshShape, SphereShape, MinkowskiSumShape, EmptyShape, ConvexShape, CollisionShape
  • GetMaxNumContacts() : HullContactCollector
  • GetMotionState() : CcdPhysicsController, BU_Collidable
  • GetName() : TriangleShape, TriangleMeshShape, SphereShape, BU_Simplex1to4, MultiSphereShape, MinkowskiSumShape, EmptyShape, ConvexHullShape, ConeShape, CollisionShape, BvhTriangleMeshShape, BoxShape
  • GetNbFaces() : EpaPolyhedron
  • getNewClientInfo() : PHY_IPhysicsController, CcdPhysicsController
  • GetNewManifold() : CollisionDispatcher, Dispatcher
  • GetNewManifoldResult() : CollisionDispatcher, Dispatcher
  • getNext() : GEN_Link
  • GetNextFree() : AxisSweep3::Handle
  • getNonDiagonal() : JacobianEntry
  • GetNumCollisionObjects() : CollisionWorld
  • getNumContactPoints() : CcdPhysicsEnvironment
  • GetNumContacts() : PersistentManifold
  • GetNumControllers() : CcdPhysicsEnvironment
  • GetNumEdges() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetNumFaces() : Hull
  • GetNumManifolds() : CcdPhysicsEnvironment, CollisionDispatcher
  • GetNumNodes() : OptimizedBvh
  • GetNumPlanes() : TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • getNumSubParts() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • GetNumVertices() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetNumWheels() : PHY_IVehicle
  • GetO() : BU_Screwing
  • getOpenGLMatrix() : SimdTransform
  • getOpenGLSubMatrix() : SimdMatrix3x3
  • GetOrientation() : BU_StaticMotionState, BU_MotionStateInterface
  • getOrientation() : PHY_IPhysicsController, CcdPhysicsController, RigidBody
  • getOrigin() : SimdTransform
  • GetPhysicsController() : CcdPhysicsEnvironment
  • GetPlane() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetPlaneEquation() : TriangleShape, BoxShape
  • getPosition() : PHY_IPhysicsController, CcdPhysicsController
  • GetPosition() : BU_StaticMotionState, BU_MotionStateInterface
  • GetPositionWorldOnA() : ManifoldPoint
  • GetPositionWorldOnB() : ManifoldPoint
  • getPrev() : GEN_Link
  • GetRadius() : PHY_IPhysicsController, SphereShape, ConeShape
  • getReactionForce() : PHY_IPhysicsController, CcdPhysicsController
  • getRelativeVelocity() : JacobianEntry
  • GetReplica() : PHY_IPhysicsController, CcdPhysicsController
  • getRestitution() : RigidBody
  • GetRigidBody() : CcdPhysicsController
  • GetRigidBodyA() : TypedConstraint, HingeConstraint
  • GetRigidBodyB() : TypedConstraint, HingeConstraint
  • GetRoot() : BUM_PolynomialSolverInterface, BU_AlgebraicPolynomialSolver
  • getRotation() : SimdTransform, SimdMatrix3x3
  • getRow() : SimdMatrix3x3
  • GetS() : BU_Screwing
  • getScaling() : SimdMatrix3x3, StridingMeshInterface
  • GetSeparationHullHull() : Hull
  • GetShape() : BU_Collidable
  • GetShapeA() : MinkowskiSumShape
  • GetShapeB() : MinkowskiSumShape
  • GetShapeType() : TriangleShape, TriangleMeshShape, SphereShape, BU_Simplex1to4, MultiSphereShape, MinkowskiSumShape, EmptyShape, CylinderShape, ConvexHullShape, ConeShape, CollisionShape, BoxShape
  • GetSimpleProxyFromProxy() : SimpleBroadphase
  • getSimplex() : VoronoiSimplexSolver
  • GetSupportVertexLocal() : SupportVertexCallback
  • GetSupportVertexWorldSpace() : SupportVertexCallback
  • getTail() : GEN_List
  • GetTimeOfImpact() : BU_VertexPoly, BU_EdgeEdge
  • GetTimeOfImpactGeneralCase() : BU_EdgeEdge
  • GetTimeOfImpactVertexEdge() : BU_EdgeEdge
  • GetTmpEdge() : Hull
  • GetTmpFace() : Hull
  • GetTransform() : BU_StaticMotionState, BU_MotionStateInterface
  • GetTransformA() : MinkowskiSumShape
  • GetTransformB() : MinkowskiSumShape
  • GetTransformFromMotionState() : CcdPhysicsController
  • GetU() : BU_Screwing
  • GetUnionFind() : CollisionDispatcher
  • GetUniqueId() : CollisionDispatcher, Dispatcher
  • GetUserConstraintId() : PHY_IVehicle, TypedConstraint
  • GetUserConstraintType() : PHY_IVehicle, TypedConstraint
  • GetUserPointer() : BU_Collidable
  • getVehicleConstraint() : CcdPhysicsEnvironment
  • GetVelocity() : PHY_IPhysicsController, CcdPhysicsController
  • getVelocityInLocalPoint() : RigidBody
  • GetVertex() : Hull, TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • GetVertexPtr() : TriangleShape
  • getW() : SimdVector4
  • GetW() : BU_Screwing
  • GetWheelOrientationQuaternion() : PHY_IVehicle
  • GetWheelPosition() : PHY_IVehicle
  • GetWheelRotation() : PHY_IVehicle
  • GetWorldOrientation() : CcdPhysicsController
  • getWorldOrientation() : PHY_IMotionState, DefaultMotionState
  • getWorldPosition() : PHY_IMotionState, DefaultMotionState
  • GetWorldPosition() : PHY_IPhysicsController
  • getWorldScaling() : PHY_IMotionState, DefaultMotionState
  • getX() : SimdQuadWord
  • getY() : SimdQuadWord
  • getZ() : SimdQuadWord
  • GjkConvexCast() : GjkConvexCast
  • GjkPairDetector() : GjkPairDetector
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- h -

  • HasContactResponse() : CollisionObject
  • HasHit() : CollisionWorld::RayResultCallback
  • HingeConstraint() : HingeConstraint
  • Hull() : Hull
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- i -

  • InBetweenPosition() : BU_Screwing
  • InBetweenTransform() : BU_Screwing
  • InBetweenVector() : BU_Screwing
  • Initialize() : EpaFace, Epa
  • InitUnionFind() : CollisionDispatcher
  • insertAfter() : GEN_Link
  • insertBefore() : GEN_Link
  • inSimplex() : VoronoiSimplexSolver
  • IntegrateTransform() : SimdTransformUtil
  • integrateVelocities() : RigidBody
  • InternalFindAlgorithm() : CollisionDispatcher
  • InternalProcessAllTriangles() : StridingMeshInterface
  • InternalProcessTriangleIndex() : InternalTriangleIndexCallback
  • inverse() : SimdTransform, SimdQuaternion, SimdMatrix3x3
  • inverseTimes() : SimdTransform
  • invXform() : SimdTransform
  • IsAffinelyDependent() : EpaFace
  • IsClosestPointInternal() : EpaFace
  • IsConcave() : CollisionShape
  • IsConvex() : CollisionShape
  • IsFinite() : Quat
  • isHead() : GEN_Link
  • isIdentity() : SimdTransform
  • IsInside() : TriangleShape, BU_Simplex1to4, PolyhedralConvexShape, ConvexHullShape, BoxShape
  • IsMax() : AxisSweep3::Edge
  • IsPolyhedral() : CollisionShape
  • IsSatCollisionDetectionEnabled() : CcdPhysicsEnvironment
  • IsStatic() : CollisionObject
  • isTail() : GEN_Link
  • IsValid() : SubSimplexClosestResult
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- p -

  • PerformDiscreteCollisionDetection() : CollisionWorld
  • PersistentManifold() : PersistentManifold
  • Point2PointConstraint() : Point2PointConstraint
  • PointCollector() : PointCollector
  • PointOutsideOfPlane() : VoronoiSimplexSolver
  • PolyhedralConvexShape() : PolyhedralConvexShape
  • PostProcessReplica() : PHY_IPhysicsController, CcdPhysicsController
  • preallocateIndices() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • preallocateVertices() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • predictIntegratedTransform() : RigidBody
  • proceedDeltaTime() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • proceedDeltaTimeOneStep() : CcdPhysicsEnvironment
  • proceedToTransform() : RigidBody
  • ProcessAllTriangles() : TriangleMeshShape, BvhTriangleMeshShape
  • ProcessCollision() : EmptyAlgorithm, ConvexConvexAlgorithm, ConvexConcaveCollisionAlgorithm, CollisionAlgorithm
  • ProcessHullHull() : Hull
  • ProcessIsland() : CollisionDispatcher::IslandCallback
  • ProcessNode() : NodeOverlapCallback
  • ProcessTriangle() : TriangleRaycastCallback, SupportVertexCallback, TriangleCallback, BoxTriangleCallback
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- q -

  • Quantize() : AxisSweep3
  • Quat() : Quat
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- r -

  • RayResultCallback() : CollisionWorld::RayResultCallback
  • rayTest() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • RayTest() : CollisionWorld
  • RecalcLocalAabb() : TriangleMeshShape
  • ReduceVertices() : VoronoiSimplexSolver
  • RefreshContactPoints() : PersistentManifold
  • RefreshOverlappingPairs() : SimpleBroadphase, AxisSweep3
  • RelativeRotate() : PHY_IPhysicsController, CcdPhysicsController
  • RelativeTranslate() : PHY_IPhysicsController, CcdPhysicsController
  • ReleaseManifold() : CollisionDispatcher, Dispatcher
  • ReleaseManifoldResult() : CollisionDispatcher, Dispatcher
  • remove() : GEN_Link
  • removeCcdPhysicsController() : CcdPhysicsEnvironment
  • removeCollisionCallback() : CcdPhysicsEnvironment
  • RemoveCollisionObject() : CollisionWorld
  • removeConstraint() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • RemoveContactPoint() : PersistentManifold
  • RemoveHandle() : AxisSweep3
  • RemoveOverlappingPair() : SimpleBroadphase
  • RemoveOverlappingPairsContainingProxy() : SimpleBroadphase
  • removeSensor() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • RemoveTmpFace() : Hull
  • removeVertex() : VoronoiSimplexSolver
  • RemoveVisibleFaces() : Hull
  • ReplaceContactPoint() : PersistentManifold
  • ReportAabbOverlappingNodex() : OptimizedBvh
  • ReportHit() : TriangleRaycastCallback
  • ReportSphereOverlappingNodex() : OptimizedBvh
  • requestCollisionCallback() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment
  • reset() : VoronoiSimplexSolver, UsageBitfield, UnionFind
  • Reset() : SubSimplexClosestResult, BU_Simplex1to4
  • resolveAngularConstraint() : Solve2LinearConstraint
  • resolveBilateralPairConstraint() : Solve2LinearConstraint
  • resolveCombinedVelocities() : CcdPhysicsController
  • resolveUnilateralPairConstraint() : Solve2LinearConstraint
  • RigidBody() : RigidBody
  • rotate() : SimdVector3
  • Rotate() : Quat
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- s -

  • saveKinematicState() : RigidBody
  • scale() : SimdTransform
  • scaled() : SimdMatrix3x3
  • SetAabb() : CcdPhysicsController, SimpleBroadphase, BroadphaseInterface, AxisSweep3
  • SetActivationState() : CollisionObject
  • SetActive() : PHY_IPhysicsController, CcdPhysicsController
  • setAngularOnly() : HingeConstraint
  • SetAngularVelocity() : PHY_IPhysicsController, CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • setAngularVelocity() : RigidBody
  • SetBarycentricCoordinates() : SubSimplexClosestResult
  • setBasis() : SimdTransform
  • SetBasis() : BU_StaticMotionState, BU_MotionStateInterface
  • SetBodies() : PersistentManifold
  • SetBroadphaseProxy() : RigidBody
  • SetCachedSeperatingAxis() : GjkPairDetector
  • setCcdMode() : CcdPhysicsEnvironment
  • setCenterOfMassTransform() : RigidBody
  • SetCollisionShape() : CollisionObject
  • setConstraintForceMixing() : OdeConstraintSolver
  • setContactBreakingTreshold() : CcdPhysicsEnvironment
  • setDamping() : RigidBody
  • setDeactivationAngularTreshold() : CcdPhysicsEnvironment
  • setDeactivationLinearTreshold() : CcdPhysicsEnvironment
  • setDeactivationTime() : CcdPhysicsEnvironment
  • setDebugDrawer() : CcdPhysicsEnvironment
  • setDebugMode() : CcdPhysicsEnvironment
  • SetDebugMode() : IDebugDraw
  • SetDistance() : ManifoldPoint
  • setErrorReductionParamter() : OdeConstraintSolver
  • setEuler() : SimdQuaternion
  • setEulerYPR() : SimdMatrix3x3
  • setEulerZYX() : SimdMatrix3x3
  • SetExtraDebugInfo() : CollisionShape
  • setFixedTimeStep() : CcdPhysicsEnvironment
  • setFriction() : RigidBody
  • setFromOpenGLMatrix() : SimdTransform
  • setFromOpenGLSubMatrix() : SimdMatrix3x3
  • setGravity() : PHY_IPhysicsEnvironment, CcdPhysicsEnvironment, RigidBody
  • setIdentity() : SimdTransform, SimdMatrix3x3
  • SetIgnoreMargin() : GjkPairDetector
  • setInterpolate3() : SimdVector3
  • setInvInertiaDiagLocal() : RigidBody
  • setLinearAirDamping() : CcdPhysicsEnvironment
  • SetLinearVelocity() : PHY_IPhysicsController, CcdPhysicsController, BU_StaticMotionState, BU_MotionStateInterface
  • setLinearVelocity() : RigidBody
  • setLocalScaling() : TriangleMeshShape, EmptyShape, ConvexShape, CollisionShape, BvhTriangleMeshShape
  • SetLowLevelOfDetail() : ConvexConvexAlgorithm
  • SetMargin() : PHY_IPhysicsController, CcdPhysicsController, TriangleMeshShape, SphereShape, EmptyShape, ConvexShape, CollisionShape
  • setMassProps() : RigidBody
  • setMax() : SimdQuadWord
  • setMin() : SimdQuadWord
  • SetMinkowskiA() : GjkPairDetector
  • SetMinkowskiB() : GjkPairDetector
  • setNewClientInfo() : PHY_IPhysicsController, CcdPhysicsController
  • SetNextFree() : AxisSweep3::Handle
  • setNumIterations() : CcdPhysicsEnvironment
  • setNumTimeSubSteps() : CcdPhysicsEnvironment
  • setOrientation() : PHY_IPhysicsController, CcdPhysicsController
  • SetOrientation() : BU_StaticMotionState, BU_MotionStateInterface
  • setOrigin() : SimdTransform
  • SetPenetrationDepthSolver() : GjkPairDetector
  • SetPivotA() : Point2PointConstraint
  • SetPivotB() : Point2PointConstraint
  • SetPosition() : BU_StaticMotionState, BU_MotionStateInterface
  • setPosition() : PHY_IPhysicsController, CcdPhysicsController
  • setRestitution() : RigidBody
  • setRigidBody() : PHY_IPhysicsController, CcdPhysicsController
  • setRotation() : SimdTransform, SimdQuaternion, SimdMatrix3x3
  • setScaling() : PHY_IPhysicsController, CcdPhysicsController, StridingMeshInterface
  • setSolverDamping() : CcdPhysicsEnvironment
  • setSolverSorConstant() : CcdPhysicsEnvironment
  • setSolverTau() : CcdPhysicsEnvironment
  • setSolverType() : CcdPhysicsEnvironment
  • SetSteeringValue() : PHY_IVehicle
  • SetTimeStepAndCounters() : BoxTriangleCallback
  • SetTransform() : BU_StaticMotionState, BU_MotionStateInterface
  • SetTransformA() : MinkowskiSumShape
  • SetTransformB() : MinkowskiSumShape
  • setUseEpa() : CcdPhysicsEnvironment
  • SetUserConstraintId() : TypedConstraint
  • SetUserConstraintType() : TypedConstraint
  • setValue() : SimdTransform, SimdQuadWord, SimdMatrix3x3
  • setWorldOrientation() : PHY_IMotionState, DefaultMotionState
  • setWorldPosition() : PHY_IMotionState, DefaultMotionState
  • setX() : SimdQuadWord
  • setY() : SimdQuadWord
  • setZ() : SimdQuadWord
  • Shape() : Shape
  • SimdMatrix3x3() : SimdMatrix3x3
  • SimdQuadWord() : SimdQuadWord
  • SimdQuaternion() : SimdQuaternion
  • SimdTransform() : SimdTransform
  • SimdVector3() : SimdVector3
  • SimdVector4() : SimdVector4
  • SimpleBroadphase() : SimpleBroadphase
  • SimpleBroadphaseProxy() : SimpleBroadphaseProxy
  • SimpleConstraintSolver() : SimpleConstraintSolver
  • slerp() : SimdQuaternion
  • Solve() : SimpleConstraintSolver
  • Solve2LinearConstraint() : Solve2LinearConstraint
  • Solve2Quadratic() : BU_AlgebraicPolynomialSolver
  • Solve2QuadraticFull() : BU_AlgebraicPolynomialSolver
  • Solve3Cubic() : BUM_PolynomialSolverInterface, BU_AlgebraicPolynomialSolver
  • Solve4Quartic() : BUM_PolynomialSolverInterface, BU_AlgebraicPolynomialSolver
  • SolveConstraint() : TypedConstraint, Point2PointConstraint, HingeConstraint
  • SolveFriction() : SimpleConstraintSolver
  • SolveGroup() : SimpleConstraintSolver, OdeConstraintSolver, ConstraintSolver
  • SortAndCalcSplittingIndex() : OptimizedBvh
  • SortCachedPoints() : PersistentManifold
  • SortMaxDown() : AxisSweep3
  • SortMaxUp() : AxisSweep3
  • SortMinDown() : AxisSweep3
  • SortMinUp() : AxisSweep3
  • SphereShape() : SphereShape
  • StorageResult() : StorageResult
  • StridingMeshInterface() : StridingMeshInterface
  • SubsimplexConvexCast() : SubsimplexConvexCast
  • SupportVertexCallback() : SupportVertexCallback
  • SynchronizeMotionStates() : PHY_IPhysicsController, CcdPhysicsController
  • SyncMotionStates() : CcdPhysicsEnvironment
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- t -

  • tdot() : SimdMatrix3x3
  • TestOverlap() : AxisSweep3
  • TetrahedronContainsOrigin() : Epa
  • timesTranspose() : SimdMatrix3x3
  • TmpFaceAddPoint() : Hull
  • translate() : RigidBody
  • transpose() : SimdMatrix3x3
  • transposeTimes() : SimdMatrix3x3
  • TriangleIndexVertexArray() : TriangleIndexVertexArray
  • TriangleMesh() : TriangleMesh
  • TriangleMeshShape() : TriangleMeshShape
  • TriangleRaycastCallback() : TriangleRaycastCallback
  • TriangleShape() : TriangleShape
  • triple() : SimdVector3
  • TypedConstraint() : TypedConstraint
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- u -

  • UnionFind() : UnionFind
  • unite() : UnionFind
  • unLockReadOnlyVertexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • unLockVertexBase() : TriangleMesh, TriangleIndexVertexArray, StridingMeshInterface
  • UnmatchOrRemoveEdge() : Hull
  • UpdateAabbs() : CcdPhysicsEnvironment
  • UpdateActivationState() : CollisionWorld
  • UpdateClosestVectorAndPoints() : VoronoiSimplexSolver
  • UpdateDeactivation() : CcdPhysicsController
  • UpdateHandle() : AxisSweep3
  • updateInertiaTensor() : RigidBody
  • UpdateRHS() : Point2PointConstraint, HingeConstraint
  • UsageBitfield() : UsageBitfield
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- v -

  • validate() : SimpleBroadphase
  • ValidContactDistance() : PersistentManifold
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- w -

  • WalkStacklessTree() : OptimizedBvh
  • WalkTree() : OptimizedBvh
  • wantsSleeping() : CcdPhysicsController
  • WriteDynamicsToMotionState() : PHY_IPhysicsController, CcdPhysicsController
  • WriteMotionStateToDynamics() : PHY_IPhysicsController, CcdPhysicsController
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- x -

  • x() : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • l
  • m
  • n
  • o
  • p
  • q
  • r
  • s
  • t
  • u
  • v
  • w
  • x
  • y
  • z
  • ~

- y -

  • y() : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Related Functions

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions

  • Dot : Quat
  • Inv : Quat
  • Length : Quat
  • LengthFast : Quat
  • Lerp : Quat
  • Normalize : Quat
  • NormalizeFast : Quat
  • operator * : SimdTransform, SimdQuaternion, Quat
  • operator+ : SimdQuaternion, Quat
  • operator- : SimdQuaternion, Quat
  • ShapeCollider : Hull
  • Slerp : Quat
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- b -

  • body : BU_ContactJointNode
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- j -

  • J1a : BU_Joint::Info2
  • J1l : BU_Joint::Info2
  • J2a : BU_Joint::Info2
  • J2l : BU_Joint::Info2
  • joint : BU_ContactJointNode
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- k -

  • kMaxEdges : Hull
  • kMaxFaces : Hull
  • kMaxVerts : Hull
  • kTmpFaceMaxVerts : Hull
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- l -

  • lambda : BU_Joint
  • lo : BU_Joint::Info2
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- m -

  • m : BU_Joint::Info1
  • m_0MinvJt : JacobianEntry
  • m_1MinvJt : JacobianEntry
  • m_aabbMax : OptimizedBvhNode, BoxTriangleCallback
  • m_aabbMin : OptimizedBvhNode, BoxTriangleCallback
  • m_accumulatedTangentImpulse0 : ConstraintPersistentData
  • m_accumulatedTangentImpulse1 : ConstraintPersistentData
  • m_activationState1 : CollisionObject
  • m_Adiag : JacobianEntry
  • m_aJ : JacobianEntry
  • m_algorithms : BroadphasePair
  • m_ang_drag : PHY_ShapeProps
  • m_angularDamping : CcdConstructionInfo, RigidBody
  • m_angularOnly : HingeConstraint
  • m_angularVelocity : RigidBody, BU_StaticMotionState
  • m_appliedImpulse : ConstraintPersistentData
  • m_axis : Separation
  • m_axisInA : HingeConstraint
  • m_axisInB : HingeConstraint
  • m_barycentricCoords : SubSimplexClosestResult
  • m_basis : SimdTransform
  • m_bJ : JacobianEntry
  • m_blockedForChanges : SimpleBroadphase
  • m_body : CcdPhysicsController
  • m_body0 : ContactJoint, PersistentManifold, ManifoldResult
  • m_body1 : ContactJoint, PersistentManifold, ManifoldResult
  • m_box0 : ConvexConvexAlgorithm
  • m_box1 : ConvexConvexAlgorithm
  • m_boxHalfExtents1 : BoxShape
  • m_boxProxy : BoxTriangleCallback
  • m_boxTriangleCallback : ConvexConcaveCollisionAlgorithm
  • m_broadphase : CollisionWorld
  • m_broadphaseHandle : CollisionObject
  • m_broadphaseProxy : RigidBody
  • m_bvh : BvhTriangleMeshShape
  • m_cachedBC : VoronoiSimplexSolver
  • m_cachedP1 : VoronoiSimplexSolver
  • m_cachedP2 : VoronoiSimplexSolver
  • m_cachedPoints : PersistentManifold
  • m_cachedSeparatingAxis : GjkPairDetector
  • m_cachedV : VoronoiSimplexSolver
  • m_cachedValidClosest : VoronoiSimplexSolver
  • m_ccdMode : CcdPhysicsEnvironment
  • m_ccdSquareMotionTreshold : CollisionObject
  • m_ccdSweptShereRadius : CollisionObject
  • m_cci : CcdPhysicsController
  • m_cfm : OdeConstraintSolver
  • m_clientObject : BroadphaseProxy
  • m_closestHitFraction : CollisionWorld::RayResultCallback
  • m_closestPointInB : StorageResult
  • m_closestPointOnSimplex : SubSimplexClosestResult
  • m_collisionDelay : CcdPhysicsController
  • m_collisionFlags : CcdConstructionInfo, CollisionObject
  • m_collisionMargin : TriangleMeshShape, EmptyShape, ConvexShape
  • m_collisionMarginTriangle : BoxTriangleCallback
  • m_collisionObject : CollisionWorld::ClosestRayResultCallback, CollisionWorld::LocalRayResult
  • m_collisionObjects : CollisionWorld
  • m_collisionShape : CcdConstructionInfo, CollisionObject
  • m_collisionWorld : CcdPhysicsEnvironment
  • m_concave : ConvexConcaveCollisionAlgorithm
  • m_constraints : CcdPhysicsEnvironment
  • m_contact : Separation
  • m_contiguousNodes : OptimizedBvh
  • m_controllers : CcdPhysicsEnvironment
  • m_convex : ConvexConcaveCollisionAlgorithm
  • m_convexA : SubsimplexConvexCast, GjkConvexCast, ContinuousConvexCollision, BU_CollisionPair
  • m_convexB : SubsimplexConvexCast, GjkConvexCast, ContinuousConvexCollision, BU_CollisionPair
  • m_count : CollisionDispatcher
  • m_CurBody : OdeConstraintSolver
  • m_CurJoint : OdeConstraintSolver
  • m_curNodeIndex : OptimizedBvh
  • m_damping : Solve2LinearConstraint, ConstraintSetting, ContactSolverInfo
  • m_deactivationTime : CollisionObject
  • m_debugBodyId : RigidBody
  • m_debugDraw : DispatcherInfo
  • m_debugDrawer : CcdPhysicsEnvironment, ConvexCast::CastResult
  • m_defaultManifoldResult : CollisionDispatcher
  • m_degenerate : SubSimplexClosestResult
  • m_deleted : EpaFace
  • m_depth : MyResult
  • m_determinant : EpaFace
  • m_dispatcher : BoxTriangleCallback, CollisionWorld, CollisionAlgorithm, CollisionAlgorithmConstructionInfo
  • m_dispatchFunc : DispatcherInfo
  • m_dispatchInfoPtr : BoxTriangleCallback
  • m_dist : Separation
  • m_distance : PointCollector, StorageResult
  • m_distance1 : ManifoldPoint
  • m_do_anisotropic : PHY_ShapeProps
  • m_do_fh : PHY_ShapeProps
  • m_do_rot_fh : PHY_ShapeProps
  • m_doubleDispatch : CollisionDispatcher
  • m_edges : Hull::TmpFace
  • m_el : SimdMatrix3x3
  • m_enableSatCollisionDetection : CcdPhysicsEnvironment
  • m_enableSatConvex : DispatcherInfo
  • m_erp : OdeConstraintSolver, ContactSolverInfo
  • m_escapeIndex : OptimizedBvhNode
  • m_facc : RigidBody
  • m_faceEntries : Epa
  • m_faces : Hull::TmpEdge, Hull::Edge, EpaPolyhedron
  • m_featureA : Separation
  • m_featureB : Separation
  • m_fh_damping : PHY_MaterialProps
  • m_fh_distance : PHY_MaterialProps
  • m_fh_normal : PHY_MaterialProps
  • m_fh_spring : PHY_MaterialProps
  • m_firstEdge : Hull::Face
  • m_firstFreeHandle : AxisSweep3
  • m_firstFreeProxy : SimpleBroadphase
  • m_fraction : ConvexCast::CastResult
  • m_freeProxies : SimpleBroadphase
  • m_friction : PHY_MaterialProps, CcdConstructionInfo, RigidBody, ContactSolverInfo
  • m_friction_scaling : PHY_ShapeProps
  • m_frictionWorldTangential0 : ConstraintPersistentData
  • m_frictionWorldTangential1 : ConstraintPersistentData
  • m_from : TriangleRaycastCallback
  • m_gjkPairDetector : ConvexConvexAlgorithm
  • m_gravity : CcdPhysicsEnvironment, CcdConstructionInfo, RigidBody
  • m_halfEdges : EpaPolyhedron
  • m_handle : AxisSweep3::Edge
  • m_handleId : AxisSweep3::Handle
  • m_hasResult : PointCollector, MyResult
  • m_head : GEN_List
  • m_height : ConeShape
  • m_hitFraction : TriangleRaycastCallback, CollisionWorld::LocalRayResult, CollisionObject
  • m_hitNormalLocal : CollisionWorld::LocalRayResult
  • m_hitNormalWorld : CollisionWorld::ClosestRayResultCallback
  • m_hitPointWorld : CollisionWorld::ClosestRayResultCallback
  • m_hitTransformA : ConvexCast::CastResult
  • m_hitTransformB : ConvexCast::CastResult
  • m_I : RigidBody
  • m_id : UnionFind
  • m_ignoreClient : FilterClosestRayResultCallback
  • m_ignoreMargin : GjkPairDetector
  • m_index : ContactJoint, Hull::TmpEdge, Hull::TmpFace
  • m_index1 : PersistentManifold
  • m_inertia : PHY_ShapeProps
  • m_inertiaFactor : CcdConstructionInfo
  • m_inertiaHalfExtents : MultiSphereShape
  • m_inertiaLocal : MassProps
  • m_interpolationWorldTransform : CollisionObject
  • m_inverseMass : RigidBody
  • m_invI : RigidBody
  • m_invInertiaLocal : RigidBody
  • m_invInertiaTensorWorld : RigidBody
  • m_islandTag1 : CollisionObject
  • m_jac : Point2PointConstraint, HingeConstraint
  • m_jacAng : HingeConstraint
  • m_jacDiagABInv : ConstraintPersistentData
  • m_jacDiagABInvTangent0 : ConstraintPersistentData
  • m_jacDiagABInvTangent1 : ConstraintPersistentData
  • m_jointAxis : JacobianEntry
  • m_kinematicTimeStep : RigidBody
  • m_lambdas : EpaFace
  • m_lastW : VoronoiSimplexSolver
  • m_leafNodes : OptimizedBvh
  • m_leftChild : OptimizedBvhNode
  • m_lifeTime : ManifoldPoint
  • m_lin_drag : PHY_ShapeProps
  • m_linearDamping : CcdConstructionInfo, RigidBody
  • m_linearVelocity : RigidBody, BU_StaticMotionState
  • m_localAabbMax : TriangleMeshShape
  • m_localAabbMin : TriangleMeshShape
  • m_localInertiaTensor : CcdConstructionInfo
  • m_localPointA : ManifoldPoint
  • m_localPointB : ManifoldPoint
  • m_localPositions : MultiSphereShape
  • m_localScaling : EmptyShape, ConvexShape
  • m_localShapeInfo : CollisionWorld::LocalRayResult
  • m_lowLevelOfDetail : ConvexConvexAlgorithm
  • m_manifold : ContactJoint
  • m_manifoldPtr : ManifoldContactAddResult, ManifoldResult, ConvexConvexAlgorithm, BoxTriangleCallback
  • m_manifoldsPtr : CollisionDispatcher
  • m_mass : PHY_ShapeProps, CcdConstructionInfo, MassProps
  • m_max : SimpleBroadphaseProxy
  • m_maxDot : SupportVertexCallback
  • m_maxEdges : AxisSweep3::Handle
  • m_maxErrorReduction : ContactSolverInfo
  • m_maxHandles : AxisSweep3
  • m_maximumDistanceSquared : DiscreteCollisionDetectorInterface::ClosestPointInput
  • m_maxOverlap : SimpleBroadphase
  • m_maxProxies : SimpleBroadphase
  • m_meshInterface : TriangleMeshShape
  • m_min : SimpleBroadphaseProxy
  • m_minEdges : AxisSweep3::Handle
  • m_minkowskiA : GjkPairDetector
  • m_minkowskiB : GjkPairDetector
  • m_minRadius : MultiSphereShape
  • m_motionState : BU_Collidable
  • m_MotionState : CcdPhysicsController, CcdConstructionInfo
  • m_N : UnionFind
  • m_nbFaces : EpaPolyhedron
  • m_needsUpdate : VoronoiSimplexSolver
  • m_newClientInfo : CcdPhysicsController
  • m_next : GEN_Link, Hull::TmpEdge, Hull::TmpFace
  • m_nextEdge : Hull::Edge
  • m_normal : PHY_CollData, ConvexCast::CastResult
  • m_normalOnBInWorld : PointCollector, MyResult
  • m_normalOnSurfaceB : StorageResult
  • m_normalWorldOnB : ManifoldPoint
  • m_numEdges : Hull, Hull::Face
  • m_numFaces : Hull
  • m_numHandles : AxisSweep3
  • m_numIterations : CcdPhysicsEnvironment, ContactSolverInfo
  • m_numNodes : OptimizedBvh
  • m_NumOverlapBroadphasePair : SimpleBroadphase
  • m_numProxies : SimpleBroadphase
  • m_numSpheres : MultiSphereShape
  • m_numTimeSubSteps : CcdPhysicsEnvironment
  • m_numTriangleIndices : TriangleIndexVertexArray
  • m_numVertices : VoronoiSimplexSolver, TriangleIndexVertexArray, BU_Simplex1to4
  • m_numVerts : Hull::TmpFace, Hull
  • m_o : BU_Screwing
  • m_odeTag : RigidBody
  • m_optionalHull : PolyhedralConvexShape
  • m_org : FlippedContactResult
  • m_origin : SimdTransform
  • m_OverlappingPairs : SimpleBroadphase
  • m_ownManifold : ConvexConvexAlgorithm
  • m_pad : AxisSweep3::Handle
  • m_padding : RigidBody
  • m_pConvexShapeA : Epa
  • m_pConvexShapeB : Epa
  • m_pEdges : Hull, AxisSweep3
  • m_penetration : ConstraintPersistentData
  • m_penetrationDepthSolver : GjkPairDetector, ContinuousConvexCollision
  • m_persistentLifeTime : ConstraintPersistentData
  • m_pFace : EpaHalfEdge
  • m_pFaces : Hull
  • m_pHalfEdge : EpaFace
  • m_pHandles : AxisSweep3
  • m_physicsEnv : CcdConstructionInfo
  • m_pivotInA : Point2PointConstraint, HingeConstraint
  • m_pivotInB : Point2PointConstraint, HingeConstraint
  • m_plane : Hull::TmpFace
  • m_pNextCCW : EpaHalfEdge
  • m_point : EpaVertex
  • m_point1 : PHY_CollData
  • m_point2 : PHY_CollData
  • m_pointCache : PersistentManifold
  • m_pointInWorld : PointCollector, MyResult
  • m_points : ConvexHullShape
  • m_polyhedron : Epa
  • m_pos : AxisSweep3::Edge
  • m_positionWorldOnA : ManifoldPoint
  • m_positionWorldOnB : ManifoldPoint
  • m_pPlanes : Hull
  • m_pProxies : SimpleBroadphase
  • m_pProxy0 : BroadphasePair
  • m_pProxy1 : BroadphasePair
  • m_prev : GEN_Link
  • m_prevAppliedImpulse : ConstraintPersistentData
  • m_profileTimings : CcdPhysicsEnvironment
  • m_proxies : SimpleBroadphase
  • m_pTwin : EpaHalfEdge
  • m_pVertex : EpaHalfEdge
  • m_pVertices : EpaFace
  • m_pVerts : Hull
  • m_quantize : AxisSweep3
  • m_R : RigidBody
  • m_radi : MultiSphereShape
  • m_radius : SphereShape, ConeShape
  • m_rayFromWorld : CollisionWorld::ClosestRayResultCallback
  • m_rayToWorld : CollisionWorld::ClosestRayResultCallback
  • m_rbA : TypedConstraint
  • m_rbB : TypedConstraint
  • m_restitution : PHY_MaterialProps, CcdConstructionInfo, RigidBody, ContactSolverInfo, ConstraintPersistentData
  • m_rightChild : OptimizedBvhNode
  • m_rootNode1 : OptimizedBvh
  • m_roots : BU_AlgebraicPolynomialSolver
  • m_s : BU_Screwing
  • m_scaling : CcdConstructionInfo, StridingMeshInterface
  • m_scalingPropagated : CcdPhysicsEnvironment
  • m_screwing : BU_CollisionPair
  • m_separator : Separation
  • m_setting : Point2PointConstraint
  • m_shape : PHY_ShapeProps, BU_Collidable
  • m_shapeA : MinkowskiSumShape
  • m_shapeB : MinkowskiSumShape
  • m_shapePart : CollisionWorld::LocalShapeInfo
  • m_simplexPointsP : VoronoiSimplexSolver
  • m_simplexPointsQ : VoronoiSimplexSolver
  • m_simplexSolver : SubsimplexConvexCast, GjkPairDetector, GjkConvexCast, ContinuousConvexCollision, ConvexConvexAlgorithm
  • m_simplexVectorW : VoronoiSimplexSolver
  • m_sinAngle : ConeShape
  • m_solver : CcdPhysicsEnvironment
  • m_solverInfo : CcdPhysicsEnvironment
  • m_solverType : CcdPhysicsEnvironment
  • m_sor : ContactSolverInfo
  • m_stepCount : DispatcherInfo
  • m_subPart : OptimizedBvhNode
  • m_supportVecLocal : SupportVertexCallback
  • m_supportVertexLocal : SupportVertexCallback
  • m_swapBodies : ContactJoint
  • m_swapped : CollisionAlgorithmCreateFunc
  • m_sz : UnionFind
  • m_tacc : RigidBody
  • m_tail : GEN_List
  • m_tau : Solve2LinearConstraint, ConstraintSetting, ContactSolverInfo
  • m_tempDebug : CollisionShape
  • m_timeOfImpact : DispatcherInfo
  • m_timeStep : ContactSolverInfo, DispatcherInfo
  • m_to : TriangleRaycastCallback
  • m_tolerance : BU_CollisionPair
  • m_totalForce : RigidBody
  • m_totalTorque : RigidBody
  • m_trans : BU_StaticMotionState
  • m_transA : MinkowskiSumShape
  • m_transAInv : ManifoldContactAddResult
  • m_transB : MinkowskiSumShape
  • m_transBInv : ManifoldContactAddResult
  • m_transformA : Epa, DiscreteCollisionDetectorInterface::ClosestPointInput
  • m_transformB : Epa, DiscreteCollisionDetectorInterface::ClosestPointInput
  • m_triangleCount : BoxTriangleCallback
  • m_triangleIndex : OptimizedBvhNode, CollisionWorld::LocalShapeInfo
  • m_triangleIndexBase : TriangleIndexVertexArray
  • m_triangleIndexStride : TriangleIndexVertexArray
  • m_triangleProxy : BoxTriangleCallback
  • m_triangles : TriangleMesh
  • m_triggerCallbacks : CcdPhysicsEnvironment
  • m_triggerCallbacksUserPtrs : CcdPhysicsEnvironment
  • m_triggerControllers : CcdPhysicsEnvironment
  • m_type : SimdTransform
  • m_u : BU_Screwing
  • m_unionFind : CollisionDispatcher
  • m_unusedW : SimdQuadWord
  • m_useContinuous : DispatcherInfo
  • m_usedVertices : SubSimplexClosestResult
  • m_useEpa : ConvexConvexAlgorithm
  • m_useIslands : CollisionDispatcher
  • m_userConstraintId : TypedConstraint
  • m_userConstraintType : TypedConstraint
  • m_userPersistentData : ManifoldPoint
  • m_userPointer : BU_Collidable, CollisionObject
  • m_v : EpaFace
  • m_vec : PHY__Vector3
  • m_vert0 : MyTriangle
  • m_vert1 : MyTriangle
  • m_vert2 : MyTriangle
  • m_vertexBase : TriangleIndexVertexArray
  • m_vertexStride : TriangleIndexVertexArray
  • m_vertices : EpaPolyhedron, BU_Simplex1to4
  • m_vertices1 : TriangleShape
  • m_verts : Hull::TmpEdge, Hull::TmpFace, Hull::Edge
  • m_vSqrd : EpaFace
  • m_w : BU_Screwing
  • m_worldAabbMax : AxisSweep3
  • m_worldAabbMin : AxisSweep3
  • m_worldTrans : SupportVertexCallback
  • m_worldTransform : DefaultMotionState, CollisionObject
  • m_wrapperVehicles : CcdPhysicsEnvironment
  • m_wSupportPointOnA : EpaVertex
  • m_wSupportPointOnB : EpaVertex
  • m_y : SimdQuadWord
  • m_z : SimdQuadWord
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- n -

  • node : BU_Joint
  • nub : BU_Joint::Info1
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- c -

  • c : BU_Joint::Info2
  • cfm : BU_Joint::Info2
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- e -

  • erp : BU_Joint::Info2
  • error : IndexError
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- f -

  • findex : BU_Joint::Info2, IndexError
  • flags : BU_Joint
  • fps : BU_Joint::Info2
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- h -

  • hi : BU_Joint::Info2
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- i -

  • index : IndexError
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- r -

  • rowskip : BU_Joint::Info2
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- s -

  • s_firstFreeTmpEdge : Hull
  • s_firstFreeTmpFace : Hull
  • s_firstUsedTmpEdge : Hull
  • s_firstUsedTmpFace : Hull
  • s_pPoints : Hull
  • s_pTmpEdges : Hull
  • s_pTmpFaces : Hull
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members - Variables

  • Class List
  • Class Hierarchy
  • Class Members
  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • b
  • c
  • e
  • f
  • h
  • i
  • j
  • k
  • l
  • m
  • n
  • r
  • s
  • u

- u -

  • unused1 : UsageBitfield
  • unused2 : UsageBitfield
  • unused3 : UsageBitfield
  • unused4 : UsageBitfield
  • usedVertexA : UsageBitfield
  • usedVertexB : UsageBitfield
  • usedVertexC : UsageBitfield
  • usedVertexD : UsageBitfield
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Maths Namespace Reference

  • Namespace List
  • Namespace Members

Maths Namespace Reference

Enumerations

enum | ZeroTag
enum | UnitXTag
enum | UnitYTag
enum | UnitZTag
enum | UnitWTag
enum | UnitNegXTag
enum | UnitNegYTag
enum | UnitNegZTag
enum | UnitNegWTag
enum | IdentityTag
enum | RotateXTag
enum | RotateYTag
enum | RotateZTag
enum | ScaleTag
enum | SkewTag

Variables

static const enum Maths::ZeroTag | Zero
static const enum Maths::UnitXTag | UnitX
static const enum Maths::UnitYTag | UnitY
static const enum Maths::UnitZTag | UnitZ
static const enum Maths::UnitWTag | UnitW
static const enum Maths::UnitNegXTag | UnitNegX
static const enum Maths::UnitNegYTag | UnitNegY
static const enum Maths::UnitNegZTag | UnitNegZ
static const enum Maths::UnitNegWTag | UnitNegW
static const enum Maths::IdentityTag | Identity
static const enum Maths::RotateXTag | RotateX
static const enum Maths::RotateYTag | RotateY
static const enum Maths::RotateZTag | RotateZ
static const enum Maths::ScaleTag | Scale
static const enum Maths::SkewTag | Skew

Enumeration Type Documentation

enum Maths::IdentityTag

Definition at line 37 of file VectorBase.h.

enum Maths::RotateXTag

Definition at line 38 of file VectorBase.h.

enum Maths::RotateYTag

Definition at line 39 of file VectorBase.h.

enum Maths::RotateZTag

Definition at line 40 of file VectorBase.h.

enum Maths::ScaleTag

Definition at line 41 of file VectorBase.h.

enum Maths::SkewTag

Definition at line 42 of file VectorBase.h.

enum Maths::UnitNegWTag

Definition at line 35 of file VectorBase.h.

enum Maths::UnitNegXTag

Definition at line 32 of file VectorBase.h.

enum Maths::UnitNegYTag

Definition at line 33 of file VectorBase.h.

enum Maths::UnitNegZTag

Definition at line 34 of file VectorBase.h.

enum Maths::UnitWTag

Definition at line 31 of file VectorBase.h.

enum Maths::UnitXTag

Definition at line 28 of file VectorBase.h.

enum Maths::UnitYTag

Definition at line 29 of file VectorBase.h.

enum Maths::UnitZTag

Definition at line 30 of file VectorBase.h.

enum Maths::ZeroTag

Definition at line 27 of file VectorBase.h.

Variable Documentation

const enum Maths::IdentityTag Maths::Identity [static]

const enum Maths::RotateXTag Maths::RotateX [static]

const enum Maths::RotateYTag Maths::RotateY [static]

const enum Maths::RotateZTag Maths::RotateZ [static]

const enum Maths::ScaleTag Maths::Scale [static]

const enum Maths::SkewTag Maths::Skew [static]

const enum Maths::UnitNegWTag Maths::UnitNegW [static]

const enum Maths::UnitNegXTag Maths::UnitNegX [static]

const enum Maths::UnitNegYTag Maths::UnitNegY [static]

const enum Maths::UnitNegZTag Maths::UnitNegZ [static]

const enum Maths::UnitWTag Maths::UnitW [static]

const enum Maths::UnitXTag Maths::UnitX [static]

const enum Maths::UnitYTag Maths::UnitY [static]

const enum Maths::UnitZTag Maths::UnitZ [static]

const enum Maths::ZeroTag Maths::Zero [static]

Referenced by __declspec().

Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- _ -

  • __declspec() : VectorBase.h, Vector.h, Scalar.h
  • _R : OdeConstraintSolver.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- l -

  • length() : SimdQuaternion.h
  • lerp() : SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- m -

  • m_numRows : ContactJoint.cpp
  • M_SQRT12 : ContactJoint.cpp
  • MANIFOLD_CACHE_SIZE : PersistentManifold.h
  • MAX_ANGVEL : RigidBody.cpp
  • MAX_BROADPHASE_COLLISION_TYPES : BroadphaseProxy.h
  • MAX_ITERATIONS : SubSimplexConvexCast.cpp, ContinuousConvexCollision.cpp
  • MAX_JOINTS_1 : OdeConstraintSolver.cpp
  • MAX_NUM_SPHERES : MultiSphereShape.h
  • MAX_RIGIDBODIES : RigidBody.h
  • maxdist2 : GjkPairDetector.cpp
  • maxIterations : OptimizedBvh.cpp
  • MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • MINKOWSKI_SUM_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • MULTI_SPHERE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • multiply_J() : SorLcp.cpp
  • MyContactDestroyedCallback() : SimpleConstraintSolver.cpp
  • myindices : TriangleMesh.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- n -

  • NO_FRICTION_WARMSTART : SimpleConstraintSolver.cpp
  • NO_VIRTUAL_INTERFACE : SimplexSolverInterface.h
  • NodeArray : OptimizedBvh.h
  • NUM_UNITSPHERE_POINTS : MinkowskiPenetrationDepthSolver.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- o -

  • operator *() : SimdVector3.h, SimdQuaternion.h, SimdMatrix3x3.h
  • operator+() : SimdVector3.h
  • operator-() : SimdVector3.h, SimdQuaternion.h
  • operator/() : SimdVector3.h
  • operator==() : SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- z -

  • Zero : VectorBase.h
  • ZeroTag : VectorBase.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- a -

  • ACTIVE_TAG : CollisionObject.h
  • ALLOCA : SorLcp.cpp
  • angle() : SimdVector3.h, SimdQuaternion.h
  • ANGULAR_MOTION_TRESHOLD : SimdTransformUtil.h
  • ASSERT : SimdScalar.h
  • ASSERT2 : ContactConstraint.cpp
  • ATTRIBUTE_ALIGNED : EmptyCollisionAlgorithm.h
  • ATTRIBUTE_ALIGNED16 : SimdScalar.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- b -

  • BOX_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • BroadphaseNativeTypes : BroadphaseProxy.h
  • BU_Polynomial : BU_VertexPoly.cpp, BU_EdgeEdge.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- c -

  • calculateCombinedFriction() : ContactConstraint.cpp
  • CATCH_DEGENERATE_TETRAHEDRON : VoronoiSimplexSolver.cpp
  • CollisionDispatcherId : Dispatcher.h
  • CompareEpaFaceEntries() : Epa.h, Epa.cpp
  • compute_invM_JT() : SorLcp.cpp
  • CONCAVE_SHAPES_START_HERE : BroadphaseProxy.h
  • CONE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • coneindices : ConeShape.cpp
  • contactDamping : ContactConstraint.cpp
  • ContactDestroyedCallback : PersistentManifold.h
  • contactTau : ContactConstraint.cpp
  • CONVEX_DISTANCE_MARGIN : NarrowPhaseCollision/CollisionMargin.h, CollisionShapes/CollisionMargin.h
  • CONVEX_HULL_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • CONVEX_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • cross() : SimdVector3.h
  • cubic_rt : BU_AlgebraicPolynomialSolver.cpp
  • CYLINDER_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • CylinderLocalSupportX() : CylinderShape.cpp
  • CylinderLocalSupportY() : CylinderShape.cpp
  • CylinderLocalSupportZ() : CylinderShape.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- d -

  • dAASSERT : SorLcp.cpp
  • dALLOCA16 : SorLcp.cpp
  • dCROSS : ContactJoint.cpp, SorLcp.cpp
  • dDOT1() : SorLcp.cpp
  • dDOT14 : SorLcp.cpp
  • dDOTpq : SorLcp.cpp
  • dEFFICIENT_SIZE : SorLcp.cpp
  • dIASSERT : SorLcp.cpp
  • dInfinity : SorLcp.cpp
  • DISABLE_DEACTIVATION : CollisionObject.h
  • disableCcd : ConvexConvexAlgorithm.cpp
  • distance() : SimdVector3.h
  • distance2() : SimdVector3.h
  • dMatrix3 : RigidBody.h, SorLcp.cpp
  • dMULTIPLY0_331 : SorLcp.cpp
  • dMULTIPLY0_331NEW : SorLcp.cpp
  • dMULTIPLY0_333 : SorLcp.cpp
  • dMULTIPLY2_333 : SorLcp.cpp
  • dMULTIPLYADD0_331 : SorLcp.cpp
  • dMULTIPLYOP0_331 : SorLcp.cpp
  • dMULTIPLYOP0_333 : SorLcp.cpp
  • dMULTIPLYOP2_333 : SorLcp.cpp
  • DO_THE_FRICTION_2 : ContactJoint.cpp
  • dot() : SimdVector3.h, SimdQuaternion.h
  • dPlaneSpace1() : ContactJoint.cpp
  • dQuaternion : OdeConstraintSolver.cpp
  • dRand2() : SorLcp.cpp
  • dRandInt2() : SorLcp.h, SorLcp.cpp
  • DrawAabb() : CcdPhysicsEnvironment.cpp
  • dRealAllocaArray : SorLcp.cpp
  • dRealArray : SorLcp.cpp
  • dRealMutablePtr : SorLcp.cpp
  • dRealPtr : SorLcp.cpp
  • dRecip : SorLcp.cpp
  • dRecipSqrt : ContactJoint.cpp
  • dRfromQ1() : OdeConstraintSolver.cpp
  • dSetValue1() : SorLcp.cpp
  • dSetZero1() : SorLcp.cpp
  • dVector3 : BU_Joint.h
  • dVector4 : SorLcp.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- e -

  • EDGEEDGE : BU_CollisionPair.cpp
  • EFFICIENT_ALIGNMENT : SorLcp.cpp
  • EMPTY_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • EPA_MAX_FACE_ENTRIES : Epa.h
  • EPA_MAX_RELATIVE_ERROR : Epa.h, Epa.cpp
  • EPA_MAX_RELATIVE_ERROR_SQRD : Epa.h, Epa.cpp
  • EPA_POLYHEDRON_USE_PLANES : EpaCommon.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- f -

  • FORCE_VELOCITY_DAMPING : RigidBody.cpp
  • FRICTION_CONSTANT : ContactJoint.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- g -

  • g_GJKMaxRelError : EpaPenetrationDepthSolver.h, EpaPenetrationDepthSolver.cpp
  • g_GJKMaxRelErrorSqrd : EpaPenetrationDepthSolver.h, EpaPenetrationDepthSolver.cpp
  • gAngularSleepingTreshold : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gBoxBoxUseGjk : ConvexConvexAlgorithm.cpp
  • gConstraintUid : CcdPhysicsEnvironment.cpp
  • gContactBreakingTreshold : PersistentManifold.h, PersistentManifold.cpp
  • gContactCallback : PersistentManifold.h, PersistentManifold.cpp
  • gDeactivationTime : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gDisableConvexCollision : ConvexConvexAlgorithm.cpp
  • gDisableDeactivation : CcdPhysicsController.h, CcdPhysicsController.cpp
  • GEN_clamp() : GEN_MinMax.h
  • GEN_clamped() : GEN_MinMax.h
  • GEN_max() : GEN_MinMax.h
  • GEN_min() : GEN_MinMax.h
  • GEN_rand() : GEN_random.h
  • GEN_RAND_MAX : GEN_random.h
  • GEN_set_max() : GEN_MinMax.h
  • GEN_set_min() : GEN_MinMax.h
  • GEN_srand() : GEN_random.h
  • gForceBoxBox : ConvexConvexAlgorithm.cpp
  • gJointArray : OdeConstraintSolver.cpp
  • gLinearAirDamping : RigidBody.h, RigidBody.cpp
  • gLinearSleepingTreshold : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gNumManifold : CollisionDispatcher.cpp
  • gPenetrationDepthSolver : ConvexConvexAlgorithm.cpp
  • gUseEpa : RigidBody.h, ConvexConvexAlgorithm.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- i -

  • Identity : VectorBase.h
  • IdentityTag : VectorBase.h
  • IMPLICIT_CONVEX_SHAPES_START_HERE : BroadphaseProxy.h
  • inverse() : SimdQuaternion.h
  • ISLAND_SLEEPING : CollisionObject.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- p -

  • penetrationResolveFactor : SimpleConstraintSolver.cpp
  • PHY_ANGULAR_CONSTRAINT : PHY_DynamicTypes.h
  • PHY_CAMERA_RESPONSE : PHY_DynamicTypes.h
  • PHY_CollData : PHY_DynamicTypes.h
  • PHY_CONCAVE_FIXEDBODY : PHY_DynamicTypes.h
  • PHY_CONCAVE_KINEMATICBODY : PHY_DynamicTypes.h
  • PHY_CONCAVE_PHANTOMBODY : PHY_DynamicTypes.h
  • PHY_CONCAVE_RIGIDBODY : PHY_DynamicTypes.h
  • PHY_ConstraintType : PHY_DynamicTypes.h
  • PHY_CONVEX_FIXEDBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_KINEMATICBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_PHANTOMBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_RIGIDBODY : PHY_DynamicTypes.h
  • PHY_DOUBLE : StridingMeshInterface.h
  • PHY_FH_RESPONSE : PHY_DynamicTypes.h
  • PHY_FIXEDPOINT88 : StridingMeshInterface.h
  • PHY_FLOAT : StridingMeshInterface.h
  • PHY_INTEGER : StridingMeshInterface.h
  • PHY_LINEHINGE_CONSTRAINT : PHY_DynamicTypes.h
  • PHY_NUM_RESPONSE : PHY_DynamicTypes.h
  • PHY_OBJECT_RESPONSE : PHY_DynamicTypes.h
  • PHY_PhysicsType : PHY_DynamicTypes.h
  • PHY_POINT2POINT_CONSTRAINT : PHY_DynamicTypes.h
  • PHY_ResponseCallback : PHY_DynamicTypes.h
  • PHY_ScalarType : StridingMeshInterface.h
  • PHY_SENSOR_RESPONSE : PHY_DynamicTypes.h
  • PHY_SHORT : StridingMeshInterface.h
  • PHY_STATIC_RESPONSE : PHY_DynamicTypes.h
  • PHY_Vector3 : PHY_DynamicTypes.h
  • PHY_VEHICLE_CONSTRAINT : PHY_DynamicTypes.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- r -

  • RANDOMLY_REORDER_CONSTRAINTS : SorLcp.cpp
  • REAL : SorLcp.cpp
  • rel_error : GjkPairDetector.cpp
  • rel_error2 : GjkPairDetector.cpp
  • resolveSingleBilateral() : ContactConstraint.h, ContactConstraint.cpp
  • resolveSingleCollision() : ContactConstraint.h, ContactConstraint.cpp
  • resolveSingleFriction() : ContactConstraint.h, ContactConstraint.cpp
  • restitutionCurve() : SimpleConstraintSolver.cpp
  • RIGIDBODY_DISPATCHER : Dispatcher.h
  • RotateX : VectorBase.h
  • RotateXTag : VectorBase.h
  • RotateY : VectorBase.h
  • RotateYTag : VectorBase.h
  • RotateZ : VectorBase.h
  • RotateZTag : VectorBase.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- s -

  • s_fixed() : TypedConstraint.cpp
  • Scale : VectorBase.h
  • ScaleTag : VectorBase.h
  • SCREWEPSILON : BU_Screwing.h
  • seed2 : SorLcp.cpp
  • SIMD_2_PI : SimdScalar.h
  • SIMD_DEGS_PER_RAD : SimdScalar.h
  • SIMD_EPSILON : SimdScalar.h
  • SIMD_FORCE_INLINE : SimdScalar.h
  • SIMD_HALF_PI : SimdScalar.h
  • SIMD_INFINITY : SimdScalar.h
  • SIMD_PI : SimdScalar.h
  • SIMD_RADS_PER_DEG : SimdScalar.h
  • SimdAcos() : SimdScalar.h
  • SimdAsin() : SimdScalar.h
  • SimdAtan() : SimdScalar.h
  • SimdAtan2() : SimdScalar.h
  • SimdCos() : SimdScalar.h
  • SimdDegrees() : SimdScalar.h
  • SimdEqual() : SimdScalar.h
  • SimdExp() : SimdScalar.h
  • SimdFabs() : SimdScalar.h
  • SimdFuzzyZero() : SimdScalar.h
  • SimdGreaterEqual() : SimdScalar.h
  • SimdLog() : SimdScalar.h
  • SimdMax : SimdMinMax.h, AabbUtil2.h
  • SimdMin : SimdMinMax.h, AabbUtil2.h
  • SimdMultTransposeLeft() : SimdMatrix3x3.h
  • SimdPlaneSpace1() : SimdTransformUtil.h
  • SimdPoint3 : SimdPoint3.h
  • SimdPow() : SimdScalar.h
  • SimdRadians() : SimdScalar.h
  • SimdRecipSqrt : SimdTransformUtil.h
  • SimdScalar : SimdScalar.h
  • SimdSetMax() : SimdMinMax.h
  • SimdSetMin() : SimdMinMax.h
  • SimdSign() : SimdScalar.h
  • SimdSin() : SimdScalar.h
  • SimdSqrt() : SimdScalar.h
  • SIMDSQRT12 : SimdTransformUtil.h
  • SimdTan() : SimdScalar.h
  • SIMPLE_MAX_ALGORITHMS : BroadphaseProxy.h
  • SimplexSolverInterface : SimplexSolverInterface.h
  • Skew : VectorBase.h
  • SkewTag : VectorBase.h
  • slerp() : SimdQuaternion.h
  • SolveInternal1() : SorLcp.h, SorLcp.cpp
  • SOR_LCP() : SorLcp.cpp
  • sPenetrationDirections : MinkowskiPenetrationDepthSolver.cpp
  • SPHERE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • startVel : CcdPhysicsController.cpp
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- t -

  • TestAabbAgainstAabb2() : AabbUtil2.h
  • TestFuzzyZero() : BU_VertexPoly.cpp
  • TestTriangleAgainstAabb2() : AabbUtil2.h
  • TETRAHEDRAL_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • totalCpd : SimpleConstraintSolver.cpp
  • TRIANGLE_MESH_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • TRIANGLE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • triple() : SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- u -

  • uniqueId : RigidBody.cpp
  • UnitNegW : VectorBase.h
  • UnitNegWTag : VectorBase.h
  • UnitNegX : VectorBase.h
  • UnitNegXTag : VectorBase.h
  • UnitNegY : VectorBase.h
  • UnitNegYTag : VectorBase.h
  • UnitNegZ : VectorBase.h
  • UnitNegZTag : VectorBase.h
  • UnitW : VectorBase.h
  • UnitWTag : VectorBase.h
  • UnitX : VectorBase.h
  • UnitXTag : VectorBase.h
  • UnitY : VectorBase.h
  • UnitYTag : VectorBase.h
  • UnitZ : VectorBase.h
  • UnitZTag : VectorBase.h
  • USE_ALGEBRAIC : BU_VertexPoly.cpp, BU_EdgeEdge.cpp
  • USE_BATCHED_SUPPORT : MinkowskiPenetrationDepthSolver.cpp
  • USE_SOR_SOLVER : SorLcp.h, OdeConstraintSolver.cpp
  • useGlobalSettingContacts : ContactConstraint.cpp
  • useIslands : CcdPhysicsEnvironment.cpp
  • USERCALLBACK_DISPATCHER : Dispatcher.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- v -

  • VERTA : VoronoiSimplexSolver.cpp
  • VERTB : VoronoiSimplexSolver.cpp
  • VERTC : VoronoiSimplexSolver.cpp
  • VERTD : VoronoiSimplexSolver.cpp
  • VERTEXFACE : BU_CollisionPair.cpp
  • VORONOI_SIMPLEX_MAX_VERTS : VoronoiSimplexSolver.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • l
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • z

Here is a list of all file members with links to the files they belong to:

- w -

  • WANTS_DEACTIVATION : CollisionObject.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • i
  • m
  • n
  • r
  • s
  • u
  • v
  • w

- _ -

  • _R : OdeConstraintSolver.cpp

- a -

  • ACTIVE_TAG : CollisionObject.h
  • ALLOCA : SorLcp.cpp
  • ANGULAR_MOTION_TRESHOLD : SimdTransformUtil.h
  • ASSERT : SimdScalar.h
  • ASSERT2 : ContactConstraint.cpp
  • ATTRIBUTE_ALIGNED : EmptyCollisionAlgorithm.h
  • ATTRIBUTE_ALIGNED16 : SimdScalar.h

- b -

  • BU_Polynomial : BU_VertexPoly.cpp, BU_EdgeEdge.cpp

- c -

  • CATCH_DEGENERATE_TETRAHEDRON : VoronoiSimplexSolver.cpp
  • CONVEX_DISTANCE_MARGIN : NarrowPhaseCollision/CollisionMargin.h, CollisionShapes/CollisionMargin.h
  • cubic_rt : BU_AlgebraicPolynomialSolver.cpp

- d -

  • dAASSERT : SorLcp.cpp
  • dALLOCA16 : SorLcp.cpp
  • dCROSS : ContactJoint.cpp, SorLcp.cpp
  • dDOT14 : SorLcp.cpp
  • dDOTpq : SorLcp.cpp
  • dEFFICIENT_SIZE : SorLcp.cpp
  • dIASSERT : SorLcp.cpp
  • dInfinity : SorLcp.cpp
  • DISABLE_DEACTIVATION : CollisionObject.h
  • dMULTIPLY0_331 : SorLcp.cpp
  • dMULTIPLY0_331NEW : SorLcp.cpp
  • dMULTIPLY0_333 : SorLcp.cpp
  • dMULTIPLY2_333 : SorLcp.cpp
  • dMULTIPLYADD0_331 : SorLcp.cpp
  • dMULTIPLYOP0_331 : SorLcp.cpp
  • dMULTIPLYOP0_333 : SorLcp.cpp
  • dMULTIPLYOP2_333 : SorLcp.cpp
  • DO_THE_FRICTION_2 : ContactJoint.cpp
  • dRealAllocaArray : SorLcp.cpp
  • dRealArray : SorLcp.cpp
  • dRecip : SorLcp.cpp
  • dRecipSqrt : ContactJoint.cpp

- e -

  • EDGEEDGE : BU_CollisionPair.cpp
  • EFFICIENT_ALIGNMENT : SorLcp.cpp
  • EPA_MAX_FACE_ENTRIES : Epa.h
  • EPA_POLYHEDRON_USE_PLANES : EpaCommon.h

- f -

  • FORCE_VELOCITY_DAMPING : RigidBody.cpp
  • FRICTION_CONSTANT : ContactJoint.cpp

- g -

  • GEN_RAND_MAX : GEN_random.h

- i -

  • ISLAND_SLEEPING : CollisionObject.h

- m -

  • M_SQRT12 : ContactJoint.cpp
  • MANIFOLD_CACHE_SIZE : PersistentManifold.h
  • MAX_ANGVEL : RigidBody.cpp
  • MAX_ITERATIONS : SubSimplexConvexCast.cpp, ContinuousConvexCollision.cpp
  • MAX_JOINTS_1 : OdeConstraintSolver.cpp
  • MAX_NUM_SPHERES : MultiSphereShape.h
  • MAX_RIGIDBODIES : RigidBody.h

- n -

  • NO_FRICTION_WARMSTART : SimpleConstraintSolver.cpp
  • NO_VIRTUAL_INTERFACE : SimplexSolverInterface.h
  • NUM_UNITSPHERE_POINTS : MinkowskiPenetrationDepthSolver.cpp

- r -

  • RANDOMLY_REORDER_CONSTRAINTS : SorLcp.cpp
  • REAL : SorLcp.cpp

- s -

  • SCREWEPSILON : BU_Screwing.h
  • SIMD_FORCE_INLINE : SimdScalar.h
  • SimdMax : SimdMinMax.h, AabbUtil2.h
  • SimdMin : SimdMinMax.h, AabbUtil2.h
  • SimdRecipSqrt : SimdTransformUtil.h
  • SIMDSQRT12 : SimdTransformUtil.h
  • SIMPLE_MAX_ALGORITHMS : BroadphaseProxy.h
  • SimplexSolverInterface : SimplexSolverInterface.h

- u -

  • USE_ALGEBRAIC : BU_VertexPoly.cpp, BU_EdgeEdge.cpp
  • USE_BATCHED_SUPPORT : MinkowskiPenetrationDepthSolver.cpp
  • USE_SOR_SOLVER : SorLcp.h, OdeConstraintSolver.cpp

- v -

  • VERTA : VoronoiSimplexSolver.cpp
  • VERTB : VoronoiSimplexSolver.cpp
  • VERTC : VoronoiSimplexSolver.cpp
  • VERTD : VoronoiSimplexSolver.cpp
  • VERTEXFACE : BU_CollisionPair.cpp
  • VORONOI_SIMPLEX_MAX_VERTS : VoronoiSimplexSolver.h

- w -

  • WANTS_DEACTIVATION : CollisionObject.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • BroadphaseNativeTypes : BroadphaseProxy.h
  • CollisionDispatcherId : Dispatcher.h
  • IdentityTag : VectorBase.h
  • PHY_ConstraintType : PHY_DynamicTypes.h
  • PHY_PhysicsType : PHY_DynamicTypes.h
  • PHY_ScalarType : StridingMeshInterface.h
  • RotateXTag : VectorBase.h
  • RotateYTag : VectorBase.h
  • RotateZTag : VectorBase.h
  • ScaleTag : VectorBase.h
  • SkewTag : VectorBase.h
  • UnitNegWTag : VectorBase.h
  • UnitNegXTag : VectorBase.h
  • UnitNegYTag : VectorBase.h
  • UnitNegZTag : VectorBase.h
  • UnitWTag : VectorBase.h
  • UnitXTag : VectorBase.h
  • UnitYTag : VectorBase.h
  • UnitZTag : VectorBase.h
  • ZeroTag : VectorBase.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • b
  • c
  • e
  • i
  • m
  • p
  • r
  • s
  • t
  • u

- b -

  • BOX_SHAPE_PROXYTYPE : BroadphaseProxy.h

- c -

  • CONCAVE_SHAPES_START_HERE : BroadphaseProxy.h
  • CONE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • CONVEX_HULL_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • CONVEX_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • CYLINDER_SHAPE_PROXYTYPE : BroadphaseProxy.h

- e -

  • EMPTY_SHAPE_PROXYTYPE : BroadphaseProxy.h

- i -

  • IMPLICIT_CONVEX_SHAPES_START_HERE : BroadphaseProxy.h

- m -

  • MAX_BROADPHASE_COLLISION_TYPES : BroadphaseProxy.h
  • MINKOWSKI_DIFFERENCE_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • MINKOWSKI_SUM_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • MULTI_SPHERE_SHAPE_PROXYTYPE : BroadphaseProxy.h

- p -

  • PHY_ANGULAR_CONSTRAINT : PHY_DynamicTypes.h
  • PHY_CAMERA_RESPONSE : PHY_DynamicTypes.h
  • PHY_CONCAVE_FIXEDBODY : PHY_DynamicTypes.h
  • PHY_CONCAVE_KINEMATICBODY : PHY_DynamicTypes.h
  • PHY_CONCAVE_PHANTOMBODY : PHY_DynamicTypes.h
  • PHY_CONCAVE_RIGIDBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_FIXEDBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_KINEMATICBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_PHANTOMBODY : PHY_DynamicTypes.h
  • PHY_CONVEX_RIGIDBODY : PHY_DynamicTypes.h
  • PHY_DOUBLE : StridingMeshInterface.h
  • PHY_FH_RESPONSE : PHY_DynamicTypes.h
  • PHY_FIXEDPOINT88 : StridingMeshInterface.h
  • PHY_FLOAT : StridingMeshInterface.h
  • PHY_INTEGER : StridingMeshInterface.h
  • PHY_LINEHINGE_CONSTRAINT : PHY_DynamicTypes.h
  • PHY_NUM_RESPONSE : PHY_DynamicTypes.h
  • PHY_OBJECT_RESPONSE : PHY_DynamicTypes.h
  • PHY_POINT2POINT_CONSTRAINT : PHY_DynamicTypes.h
  • PHY_SENSOR_RESPONSE : PHY_DynamicTypes.h
  • PHY_SHORT : StridingMeshInterface.h
  • PHY_STATIC_RESPONSE : PHY_DynamicTypes.h
  • PHY_VEHICLE_CONSTRAINT : PHY_DynamicTypes.h

- r -

  • RIGIDBODY_DISPATCHER : Dispatcher.h

- s -

  • SPHERE_SHAPE_PROXYTYPE : BroadphaseProxy.h

- t -

  • TETRAHEDRAL_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • TRIANGLE_MESH_SHAPE_PROXYTYPE : BroadphaseProxy.h
  • TRIANGLE_SHAPE_PROXYTYPE : BroadphaseProxy.h

- u -

  • USERCALLBACK_DISPATCHER : Dispatcher.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • _
  • a
  • c
  • d
  • g
  • i
  • l
  • m
  • o
  • r
  • s
  • t

- _ -

  • __declspec() : VectorBase.h, Vector.h, Scalar.h

- a -

  • angle() : SimdVector3.h, SimdQuaternion.h

- c -

  • calculateCombinedFriction() : ContactConstraint.cpp
  • CompareEpaFaceEntries() : Epa.h, Epa.cpp
  • compute_invM_JT() : SorLcp.cpp
  • cross() : SimdVector3.h
  • CylinderLocalSupportX() : CylinderShape.cpp
  • CylinderLocalSupportY() : CylinderShape.cpp
  • CylinderLocalSupportZ() : CylinderShape.cpp

- d -

  • dDOT1() : SorLcp.cpp
  • distance() : SimdVector3.h
  • distance2() : SimdVector3.h
  • dot() : SimdVector3.h, SimdQuaternion.h
  • dPlaneSpace1() : ContactJoint.cpp
  • dRand2() : SorLcp.cpp
  • dRandInt2() : SorLcp.h, SorLcp.cpp
  • DrawAabb() : CcdPhysicsEnvironment.cpp
  • dRfromQ1() : OdeConstraintSolver.cpp
  • dSetValue1() : SorLcp.cpp
  • dSetZero1() : SorLcp.cpp

- g -

  • GEN_clamp() : GEN_MinMax.h
  • GEN_clamped() : GEN_MinMax.h
  • GEN_max() : GEN_MinMax.h
  • GEN_min() : GEN_MinMax.h
  • GEN_rand() : GEN_random.h
  • GEN_set_max() : GEN_MinMax.h
  • GEN_set_min() : GEN_MinMax.h
  • GEN_srand() : GEN_random.h

- i -

  • inverse() : SimdQuaternion.h

- l -

  • length() : SimdQuaternion.h
  • lerp() : SimdVector3.h

- m -

  • multiply_J() : SorLcp.cpp
  • MyContactDestroyedCallback() : SimpleConstraintSolver.cpp

- o -

  • operator *() : SimdVector3.h, SimdQuaternion.h, SimdMatrix3x3.h
  • operator+() : SimdVector3.h
  • operator-() : SimdVector3.h, SimdQuaternion.h
  • operator/() : SimdVector3.h
  • operator==() : SimdVector3.h

- r -

  • resolveSingleBilateral() : ContactConstraint.h, ContactConstraint.cpp
  • resolveSingleCollision() : ContactConstraint.h, ContactConstraint.cpp
  • resolveSingleFriction() : ContactConstraint.h, ContactConstraint.cpp
  • restitutionCurve() : SimpleConstraintSolver.cpp

- s -

  • s_fixed() : TypedConstraint.cpp
  • SimdAcos() : SimdScalar.h
  • SimdAsin() : SimdScalar.h
  • SimdAtan() : SimdScalar.h
  • SimdAtan2() : SimdScalar.h
  • SimdCos() : SimdScalar.h
  • SimdDegrees() : SimdScalar.h
  • SimdEqual() : SimdScalar.h
  • SimdExp() : SimdScalar.h
  • SimdFabs() : SimdScalar.h
  • SimdFuzzyZero() : SimdScalar.h
  • SimdGreaterEqual() : SimdScalar.h
  • SimdLog() : SimdScalar.h
  • SimdMax() : SimdMinMax.h, AabbUtil2.h
  • SimdMin() : SimdMinMax.h, AabbUtil2.h
  • SimdMultTransposeLeft() : SimdMatrix3x3.h
  • SimdPlaneSpace1() : SimdTransformUtil.h
  • SimdPow() : SimdScalar.h
  • SimdRadians() : SimdScalar.h
  • SimdSetMax() : SimdMinMax.h
  • SimdSetMin() : SimdMinMax.h
  • SimdSign() : SimdScalar.h
  • SimdSin() : SimdScalar.h
  • SimdSqrt() : SimdScalar.h
  • SimdTan() : SimdScalar.h
  • slerp() : SimdQuaternion.h
  • SolveInternal1() : SorLcp.h, SorLcp.cpp
  • SOR_LCP() : SorLcp.cpp

- t -

  • TestAabbAgainstAabb2() : AabbUtil2.h
  • TestFuzzyZero() : BU_VertexPoly.cpp
  • TestTriangleAgainstAabb2() : AabbUtil2.h
  • triple() : SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines

  • ContactDestroyedCallback : PersistentManifold.h
  • dMatrix3 : RigidBody.h, SorLcp.cpp
  • dQuaternion : OdeConstraintSolver.cpp
  • dRealMutablePtr : SorLcp.cpp
  • dRealPtr : SorLcp.cpp
  • dVector3 : BU_Joint.h
  • dVector4 : SorLcp.cpp
  • NodeArray : OptimizedBvh.h
  • PHY_CollData : PHY_DynamicTypes.h
  • PHY_ConstraintType : PHY_DynamicTypes.h
  • PHY_PhysicsType : PHY_DynamicTypes.h
  • PHY_ResponseCallback : PHY_DynamicTypes.h
  • PHY_ScalarType : StridingMeshInterface.h
  • PHY_Vector3 : PHY_DynamicTypes.h
  • SimdPoint3 : SimdPoint3.h
  • SimdScalar : SimdScalar.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • All
  • Functions
  • Variables
  • Typedefs
  • Enumerations
  • Enumerator
  • Defines
  • a
  • c
  • d
  • e
  • g
  • i
  • m
  • p
  • r
  • s
  • t
  • u
  • z

- a -

  • ATTRIBUTE_ALIGNED : EmptyCollisionAlgorithm.h

- c -

  • coneindices : ConeShape.cpp
  • contactDamping : ContactConstraint.cpp
  • contactTau : ContactConstraint.cpp

- d -

  • disableCcd : ConvexConvexAlgorithm.cpp

- e -

  • EPA_MAX_RELATIVE_ERROR : Epa.h, Epa.cpp
  • EPA_MAX_RELATIVE_ERROR_SQRD : Epa.h, Epa.cpp

- g -

  • g_GJKMaxRelError : EpaPenetrationDepthSolver.h, EpaPenetrationDepthSolver.cpp
  • g_GJKMaxRelErrorSqrd : EpaPenetrationDepthSolver.h, EpaPenetrationDepthSolver.cpp
  • gAngularSleepingTreshold : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gBoxBoxUseGjk : ConvexConvexAlgorithm.cpp
  • gConstraintUid : CcdPhysicsEnvironment.cpp
  • gContactBreakingTreshold : PersistentManifold.h, PersistentManifold.cpp
  • gContactCallback : PersistentManifold.h, PersistentManifold.cpp
  • gDeactivationTime : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gDisableConvexCollision : ConvexConvexAlgorithm.cpp
  • gDisableDeactivation : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gForceBoxBox : ConvexConvexAlgorithm.cpp
  • gJointArray : OdeConstraintSolver.cpp
  • gLinearAirDamping : RigidBody.h, RigidBody.cpp
  • gLinearSleepingTreshold : CcdPhysicsController.h, CcdPhysicsController.cpp
  • gNumManifold : CollisionDispatcher.cpp
  • gPenetrationDepthSolver : ConvexConvexAlgorithm.cpp
  • gUseEpa : RigidBody.h, ConvexConvexAlgorithm.cpp

- i -

  • Identity : VectorBase.h

- m -

  • m_numRows : ContactJoint.cpp
  • maxdist2 : GjkPairDetector.cpp
  • maxIterations : OptimizedBvh.cpp
  • myindices : TriangleMesh.cpp

- p -

  • penetrationResolveFactor : SimpleConstraintSolver.cpp

- r -

  • rel_error : GjkPairDetector.cpp
  • rel_error2 : GjkPairDetector.cpp
  • RotateX : VectorBase.h
  • RotateY : VectorBase.h
  • RotateZ : VectorBase.h

- s -

  • Scale : VectorBase.h
  • seed2 : SorLcp.cpp
  • SIMD_2_PI : SimdScalar.h
  • SIMD_DEGS_PER_RAD : SimdScalar.h
  • SIMD_EPSILON : SimdScalar.h
  • SIMD_HALF_PI : SimdScalar.h
  • SIMD_INFINITY : SimdScalar.h
  • SIMD_PI : SimdScalar.h
  • SIMD_RADS_PER_DEG : SimdScalar.h
  • Skew : VectorBase.h
  • sPenetrationDirections : MinkowskiPenetrationDepthSolver.cpp
  • startVel : CcdPhysicsController.cpp

- t -

  • totalCpd : SimpleConstraintSolver.cpp

- u -

  • uniqueId : RigidBody.cpp
  • UnitNegW : VectorBase.h
  • UnitNegX : VectorBase.h
  • UnitNegY : VectorBase.h
  • UnitNegZ : VectorBase.h
  • UnitW : VectorBase.h
  • UnitX : VectorBase.h
  • UnitY : VectorBase.h
  • UnitZ : VectorBase.h
  • useGlobalSettingContacts : ContactConstraint.cpp
  • useIslands : CcdPhysicsEnvironment.cpp

- z -

  • Zero : VectorBase.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Variables
  • Enumerations
Here is a list of all namespace members with links to the namespace documentation for each member:

  • Identity : Maths
  • IdentityTag : Maths
  • RotateX : Maths
  • RotateXTag : Maths
  • RotateY : Maths
  • RotateYTag : Maths
  • RotateZ : Maths
  • RotateZTag : Maths
  • Scale : Maths
  • ScaleTag : Maths
  • Skew : Maths
  • SkewTag : Maths
  • UnitNegW : Maths
  • UnitNegWTag : Maths
  • UnitNegX : Maths
  • UnitNegXTag : Maths
  • UnitNegY : Maths
  • UnitNegYTag : Maths
  • UnitNegZ : Maths
  • UnitNegZTag : Maths
  • UnitW : Maths
  • UnitWTag : Maths
  • UnitX : Maths
  • UnitXTag : Maths
  • UnitY : Maths
  • UnitYTag : Maths
  • UnitZ : Maths
  • UnitZTag : Maths
  • Zero : Maths
  • ZeroTag : Maths
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Variables
  • Enumerations

  • IdentityTag : Maths
  • RotateXTag : Maths
  • RotateYTag : Maths
  • RotateZTag : Maths
  • ScaleTag : Maths
  • SkewTag : Maths
  • UnitNegWTag : Maths
  • UnitNegXTag : Maths
  • UnitNegYTag : Maths
  • UnitNegZTag : Maths
  • UnitWTag : Maths
  • UnitXTag : Maths
  • UnitYTag : Maths
  • UnitZTag : Maths
  • ZeroTag : Maths
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class Members

  • Namespace List
  • Namespace Members
  • All
  • Variables
  • Enumerations

  • Identity : Maths
  • RotateX : Maths
  • RotateY : Maths
  • RotateZ : Maths
  • Scale : Maths
  • Skew : Maths
  • UnitNegW : Maths
  • UnitNegX : Maths
  • UnitNegY : Maths
  • UnitNegZ : Maths
  • UnitW : Maths
  • UnitX : Maths
  • UnitY : Maths
  • UnitZ : Maths
  • Zero : Maths
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Graphical Class Hierarchy

  • Class List
  • Class Hierarchy
  • Class Members

Bullet Collision Detection & Physics Library Graphical Class Hierarchy

Go to the textual class hierarchy

Generated on Wed May 24 14:00:50 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Class List

  • Class List
  • Class Hierarchy
  • Class Members

Bullet Collision Detection & Physics Library Class List

Here are the classes, structs, unions and interfaces with brief descriptions:
AxisSweep3 | AxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase
AxisSweep3::Edge |
AxisSweep3::Handle |
BoxShape | BoxShape implements both a feature based (vertex/edge/plane) and implicit (getSupportingVertex) Box
BoxTriangleCallback |
BroadphaseInterface | BroadphaseInterface for aabb-overlapping object pairs
BroadphasePair | Pair of aabb-overlapping objects
BroadphaseProxy | BroadphaseProxy
BU_AlgebraicPolynomialSolver | BU_AlgebraicPolynomialSolver implements polynomial root finding by analytically solving algebraic equations
BU_Collidable |
BU_CollisionPair | BU_CollisionPair implements collision algorithm for algebraic time of impact calculation of feature based shapes
BU_ContactJointNode |
BU_EdgeEdge | BU_EdgeEdge implements algebraic time of impact calculation between two (angular + linear) moving edges
BU_Joint |
BU_Joint::Info1 |
BU_Joint::Info2 |
BU_MotionStateInterface |
BU_Screwing | BU_Screwing implements screwing motion interpolation
BU_Simplex1to4 | BU_Simplex1to4 implements feature based and implicit simplex of up to 4 vertices (tetrahedron, triangle, line, vertex)
BU_StaticMotionState |
BU_VertexPoly | BU_VertexPoly implements algebraic time of impact calculation between vertex and a plane
BUM_PolynomialSolverInterface |
BvhTriangleMeshShape | Bvh Concave triangle mesh is a static-triangle mesh shape with Bounding Volume Hierarchy optimization
CcdConstructionInfo |
CcdPhysicsController | CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution
CcdPhysicsEnvironment | CcdPhysicsEnvironment is experimental mainloop for physics simulation using optional continuous collision detection
CollisionAlgorithm | CollisionAlgorithm is an collision interface that is compatible with the Broadphase and Dispatcher
CollisionAlgorithmConstructionInfo |
CollisionAlgorithmCreateFunc |
CollisionDispatcher | CollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs
CollisionDispatcher::IslandCallback |
CollisionObject | CollisionObject can be used to manage collision detection objects
CollisionShape | CollisionShape provides generic interface for collidable objects
CollisionWorld | CollisionWorld is interface and container for the collision detection
CollisionWorld::ClosestRayResultCallback |
CollisionWorld::LocalRayResult |
CollisionWorld::LocalShapeInfo | LocalShapeInfo gives extra information for complex shapes Currently, only TriangleMeshShape is available, so it just contains triangleIndex and subpart
CollisionWorld::RayResultCallback | RayResultCallback is used to report new raycast results
ConeShape | Implements cone shape interface
ConstraintPersistentData |
ConstraintSetting |
ConstraintSolver | ConstraintSolver provides solver interface
ContactJoint |
ContactSolverInfo |
ContinuousConvexCollision | ContinuousConvexCollision implements angular and linear time of impact for convex objects
ConvexCast | ConvexCast is an interface for Casting
ConvexCast::CastResult | RayResult stores the closest result alternatively, add a callback method to decide about closest/all results
ConvexConcaveCollisionAlgorithm | ConvexConcaveCollisionAlgorithm supports collision between convex shapes and (concave) trianges meshes
ConvexConvexAlgorithm | ConvexConvexAlgorithm collision algorithm implements time of impact, convex closest points and penetration depth calculations
ConvexHullShape | ConvexHullShape implements an implicit (getSupportingVertex) Convex Hull of a Point Cloud (vertices) No connectivity is needed
ConvexPenetrationDepthSolver | ConvexPenetrationDepthSolver provides an interface for penetration depth calculation
ConvexShape | ConvexShape is an abstract shape interface
CylinderShape | Implements cylinder shape interface
CylinderShapeX |
CylinderShapeZ |
DefaultMotionState | DefaultMotionState implements standard motionstate, using SimdTransform
DiscreteCollisionDetectorInterface | This interface is made to be used by an iterative approach to do TimeOfImpact calculations This interface allows to query for closest points and penetration depth between two (convex) objects the closest point is on the second object (B), and the normal points from the surface on B towards A
DiscreteCollisionDetectorInterface::ClosestPointInput |
DiscreteCollisionDetectorInterface::Result |
Dispatcher | Dispatcher can be used in combination with broadphase to dispatch overlapping pairs
DispatcherInfo |
EmptyAlgorithm | EmptyAlgorithm is a stub for unsupported collision pairs
EmptyShape | EmptyShape is a collision shape without actual collision detection. It can be replaced by another shape during runtime
Epa |
EpaFace | Note : This class is not supposed to be a base class
EpaHalfEdge | Note : This class is not supposed to be a base class
EpaPenetrationDepthSolver | Note : This class is not supposed to be a base class
EpaPolyhedron | Note : This class is not supposed to be a base class
EpaVertex | Note : This class is not supposed to be a base class
FilterClosestRayResultCallback |
FlippedContactResult |
GEN_Link |
GEN_List |
GjkConvexCast | GjkConvexCast performs a raycast on a convex object using support mapping
GjkPairDetector | GjkPairDetector uses GJK to implement the DiscreteCollisionDetectorInterface
HingeConstraint | Hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space axis defines the orientation of the hinge axis
Hull | Hull implements a convex collision detection algorithm based on Separating Axis Theorem (SAT)
Hull::Edge |
Hull::Face |
Hull::TmpEdge |
Hull::TmpFace |
HullContactCollector | HullContactCollector collects the Hull computation to the contact point results
IDebugDraw |
IndexError |
InternalTriangleIndexCallback |
JacobianEntry | Jacobian entry is an abstraction that allows to describe constraints it can be used in combination with a constraint solver Can be used to relate the effect of an impulse to the constraint error
ManifoldContactAddResult |
ManifoldPoint | ManifoldContactPoint collects and maintains persistent contactpoints
ManifoldResult | ManifoldResult is a helper class to manage contact results
MassProps |
MinkowskiPenetrationDepthSolver | MinkowskiPenetrationDepthSolver implements bruteforce penetration depth estimation
MinkowskiSumShape | MinkowskiSumShape represents implicit (getSupportingVertex) based minkowski sum of two convex implicit shapes
MultiSphereShape | MultiSphereShape represents implicit convex hull of a collection of spheres (using getSupportingVertex)
MyResult |
MyTriangle |
NodeOverlapCallback |
OdeConstraintSolver | OdeConstraintSolver is one of the available solvers for Bullet dynamics framework It uses the the unmodified version of quickstep solver from the open dynamics project
OptimizedBvh | OptimizedBvh store an AABB tree that can be quickly traversed on CPU (and SPU,GPU in future)
OptimizedBvhNode | OptimizedBvhNode contains both internal and leaf node information
PersistentManifold | PersistentManifold maintains contact points, and reduces them to 4
PHY__Vector3 |
PHY_CollData |
PHY_IMotionState | PHY_IMotionState is the Interface to explicitly synchronize the world transformation
PHY_IPhysicsController | PHY_IPhysicsController is the abstract simplified Interface to a physical object
PHY_IPhysicsEnvironment | Physics Environment takes care of stepping the simulation and is a container for physics entities (rigidbodies,constraints, materials etc
PHY_IVehicle |
PHY_MaterialProps |
PHY_ShapeProps |
Point2 |
Point2PointConstraint | Point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space
PointCollector |
PolyhedralConvexShape | PolyhedralConvexShape is an interface class for feature based (vertex/edge/face) convex shapes
Quat |
RigidBody | RigidBody class for RigidBody Dynamics
Separation |
Shape | Shape provides a interface for Hull class (convex hull calculation)
SimdMatrix3x3 |
SimdQuadWord |
SimdQuaternion |
SimdTransform |
SimdTransformUtil | Utils related to temporal transforms
SimdVector3 | SimdVector3 is 16byte aligned, and has an extra unused component m_w this extra component can be used by derived classes (Quaternion?) or by user
SimdVector4 |
SimpleBroadphase | SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks
SimpleBroadphaseProxy |
SimpleConstraintSolver | SimpleConstraintSolver uses a Propagation Method and Sequentially applies impulses The approach is the 3D version of Erin Catto's GDC 2006 tutorial
Solve2LinearConstraint | Constraint class used for lateral tyre friction
SphereShape | SphereShape implements an implicit (getSupportingVertex) Sphere
StorageResult |
StridingMeshInterface | StridingMeshInterface is the interface class for high performance access to triangle meshes It allows for sharing graphics and collision meshes
SubSimplexClosestResult |
SubsimplexConvexCast | SubsimplexConvexCast implements Gino van den Bergens' paper "Ray Casting against General Convex Objects with Application to Continuous Collision Detection" GJK based Ray Cast, optimized version Objects should not start in overlap, otherwise results are not defined
SupportVertexCallback |
TriangleCallback |
TriangleIndexVertexArray |
TriangleMesh | TriangleMesh provides storage for a concave triangle mesh. It can be used as data for the TriangleMeshShape
TriangleMeshShape | Concave triangle mesh. Uses an interface to access the triangles to allow for sharing graphics/physics triangles
TriangleRaycastCallback |
TriangleShape |
TypedConstraint |
UnionFind | UnionFind calculates connected subsets
UsageBitfield |
Vector2 |
VoronoiSimplexSolver | VoronoiSimplexSolver is an implementation of the closest point distance algorithm from a 1-4 points simplex to the origin
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/ -> LinearMath Relation

Bullet

Bullet → LinearMath Relation

File in Bullet | Includes file in LinearMath
BroadphaseCollision / AxisSweep3.h | SimdPoint3.h
BroadphaseCollision / AxisSweep3.h | SimdVector3.h
CollisionShapes / BoxShape.h | SimdMinMax.h
CollisionShapes / BoxShape.h | SimdPoint3.h
BroadphaseCollision / BroadphaseInterface.h | SimdVector3.h
NarrowPhaseCollision / BU_AlgebraicPolynomialSolver.cpp | SimdMinMax.h
NarrowPhaseCollision / BU_Collidable.cpp | SimdTransform.h
NarrowPhaseCollision / BU_Collidable.h | SimdPoint3.h
NarrowPhaseCollision / BU_CollisionPair.cpp | SimdMinMax.h
NarrowPhaseCollision / BU_CollisionPair.cpp | SimdTransformUtil.h
NarrowPhaseCollision / BU_CollisionPair.h | SimdQuaternion.h
NarrowPhaseCollision / BU_EdgeEdge.cpp | SimdPoint3.h
NarrowPhaseCollision / BU_EdgeEdge.h | SimdPoint3.h
NarrowPhaseCollision / BU_EdgeEdge.h | SimdScalar.h
NarrowPhaseCollision / BU_EdgeEdge.h | SimdTransform.h
NarrowPhaseCollision / BU_EdgeEdge.h | SimdVector3.h
NarrowPhaseCollision / BU_MotionStateInterface.h | SimdPoint3.h
NarrowPhaseCollision / BU_MotionStateInterface.h | SimdQuaternion.h
NarrowPhaseCollision / BU_MotionStateInterface.h | SimdTransform.h
NarrowPhaseCollision / BU_PolynomialSolverInterface.h | SimdScalar.h
NarrowPhaseCollision / BU_Screwing.h | SimdPoint3.h
NarrowPhaseCollision / BU_Screwing.h | SimdTransform.h
NarrowPhaseCollision / BU_Screwing.h | SimdVector3.h
NarrowPhaseCollision / BU_VertexPoly.cpp | SimdPoint3.h
NarrowPhaseCollision / BU_VertexPoly.cpp | SimdTransform.h
NarrowPhaseCollision / BU_VertexPoly.cpp | SimdVector3.h
NarrowPhaseCollision / BU_VertexPoly.h | SimdPoint3.h
NarrowPhaseCollision / BU_VertexPoly.h | SimdScalar.h
NarrowPhaseCollision / BU_VertexPoly.h | SimdTransform.h
CollisionDispatch / CollisionObject.h | SimdTransform.h
CollisionShapes / CollisionShape.h | SimdMatrix3x3.h
CollisionShapes / CollisionShape.h | SimdPoint3.h
CollisionShapes / CollisionShape.h | SimdTransform.h
CollisionShapes / CollisionShape.h | SimdVector3.h
CollisionDispatch / CollisionWorld.cpp | AabbUtil2.h
CollisionDispatch / CollisionWorld.h | SimdTransform.h
CollisionDispatch / CollisionWorld.h | SimdVector3.h
CollisionShapes / ConeShape.cpp | SimdPoint3.h
NarrowPhaseCollision / ContinuousConvexCollision.cpp | SimdTransformUtil.h
NarrowPhaseCollision / ConvexCast.h | IDebugDraw.h
NarrowPhaseCollision / ConvexCast.h | SimdScalar.h
NarrowPhaseCollision / ConvexCast.h | SimdTransform.h
NarrowPhaseCollision / ConvexCast.h | SimdVector3.h
CollisionShapes / ConvexHullShape.cpp | SimdQuaternion.h
NarrowPhaseCollision / ConvexPenetrationDepthSolver.h | SimdPoint3.h
CollisionShapes / ConvexShape.h | SimdMatrix3x3.h
CollisionShapes / ConvexShape.h | SimdTransform.h
CollisionShapes / ConvexShape.h | SimdVector3.h
CollisionShapes / CylinderShape.cpp | SimdPoint3.h
CollisionShapes / CylinderShape.h | SimdVector3.h
NarrowPhaseCollision / DiscreteCollisionDetectorInterface.h | SimdTransform.h
NarrowPhaseCollision / DiscreteCollisionDetectorInterface.h | SimdVector3.h
CollisionShapes / EmptyShape.h | SimdMatrix3x3.h
CollisionShapes / EmptyShape.h | SimdTransform.h
CollisionShapes / EmptyShape.h | SimdVector3.h
NarrowPhaseCollision / Epa.cpp | SimdMinMax.h
NarrowPhaseCollision / Epa.cpp | SimdPoint3.h
NarrowPhaseCollision / Epa.cpp | SimdScalar.h
NarrowPhaseCollision / Epa.cpp | SimdTransform.h
NarrowPhaseCollision / Epa.cpp | SimdVector3.h
NarrowPhaseCollision / EpaFace.cpp | SimdPoint3.h
NarrowPhaseCollision / EpaFace.cpp | SimdScalar.h
NarrowPhaseCollision / EpaFace.cpp | SimdVector3.h
NarrowPhaseCollision / EpaPenetrationDepthSolver.cpp | SimdMinMax.h
NarrowPhaseCollision / EpaPenetrationDepthSolver.cpp | SimdPoint3.h
NarrowPhaseCollision / EpaPenetrationDepthSolver.cpp | SimdScalar.h
NarrowPhaseCollision / EpaPenetrationDepthSolver.cpp | SimdTransform.h
NarrowPhaseCollision / EpaPenetrationDepthSolver.cpp | SimdVector3.h
NarrowPhaseCollision / EpaPolyhedron.cpp | Memory2.h
NarrowPhaseCollision / EpaPolyhedron.cpp | SimdPoint3.h
NarrowPhaseCollision / EpaPolyhedron.cpp | SimdScalar.h
NarrowPhaseCollision / EpaPolyhedron.cpp | SimdVector3.h
NarrowPhaseCollision / GjkConvexCast.h | SimdVector3.h
NarrowPhaseCollision / GjkPairDetector.h | SimdPoint3.h
NarrowPhaseCollision / Hull.h | Maths.h
NarrowPhaseCollision / ManifoldPoint.h | SimdTransformUtil.h
NarrowPhaseCollision / ManifoldPoint.h | SimdVector3.h
CollisionShapes / MultiSphereShape.cpp | SimdQuaternion.h
CollisionShapes / OptimizedBvh.cpp | AabbUtil2.h
CollisionShapes / OptimizedBvh.h | SimdVector3.h
NarrowPhaseCollision / PersistentManifold.cpp | SimdTransform.h
NarrowPhaseCollision / PersistentManifold.h | SimdTransform.h
NarrowPhaseCollision / PersistentManifold.h | SimdVector3.h
CollisionShapes / PolyhedralConvexShape.h | SimdMatrix3x3.h
CollisionShapes / PolyhedralConvexShape.h | SimdPoint3.h
NarrowPhaseCollision / Shape.h | Maths.h
BroadphaseCollision / SimpleBroadphase.cpp | SimdMatrix3x3.h
BroadphaseCollision / SimpleBroadphase.cpp | SimdTransform.h
BroadphaseCollision / SimpleBroadphase.cpp | SimdVector3.h
BroadphaseCollision / SimpleBroadphase.h | SimdPoint3.h
CollisionShapes / Simplex1to4Shape.cpp | SimdMatrix3x3.h
NarrowPhaseCollision / SimplexSolverInterface.h | SimdPoint3.h
NarrowPhaseCollision / SimplexSolverInterface.h | SimdVector3.h
CollisionShapes / SphereShape.cpp | SimdQuaternion.h
CollisionShapes / StridingMeshInterface.h | SimdVector3.h
CollisionShapes / TriangleCallback.h | SimdVector3.h
CollisionShapes / TriangleMesh.h | SimdVector3.h
CollisionShapes / TriangleMeshShape.cpp | AabbUtil2.h
CollisionShapes / TriangleMeshShape.cpp | SimdQuaternion.h
CollisionShapes / TriangleMeshShape.cpp | SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/BroadphaseCollision/ -> LinearMath Relation

Bullet » BroadphaseCollision

BroadphaseCollision → LinearMath Relation

File in Bullet » BroadphaseCollision | Includes file in LinearMath
AxisSweep3.h | SimdPoint3.h
AxisSweep3.h | SimdVector3.h
BroadphaseInterface.h | SimdVector3.h
SimpleBroadphase.cpp | SimdMatrix3x3.h
SimpleBroadphase.cpp | SimdTransform.h
SimpleBroadphase.cpp | SimdVector3.h
SimpleBroadphase.h | SimdPoint3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionShapes/ -> LinearMath Relation

Bullet » CollisionShapes

CollisionShapes → LinearMath Relation

File in Bullet » CollisionShapes | Includes file in LinearMath
BoxShape.h | SimdMinMax.h
BoxShape.h | SimdPoint3.h
CollisionShape.h | SimdMatrix3x3.h
CollisionShape.h | SimdPoint3.h
CollisionShape.h | SimdTransform.h
CollisionShape.h | SimdVector3.h
ConeShape.cpp | SimdPoint3.h
ConvexHullShape.cpp | SimdQuaternion.h
ConvexShape.h | SimdMatrix3x3.h
ConvexShape.h | SimdTransform.h
ConvexShape.h | SimdVector3.h
CylinderShape.cpp | SimdPoint3.h
CylinderShape.h | SimdVector3.h
EmptyShape.h | SimdMatrix3x3.h
EmptyShape.h | SimdTransform.h
EmptyShape.h | SimdVector3.h
MultiSphereShape.cpp | SimdQuaternion.h
OptimizedBvh.cpp | AabbUtil2.h
OptimizedBvh.h | SimdVector3.h
PolyhedralConvexShape.h | SimdMatrix3x3.h
PolyhedralConvexShape.h | SimdPoint3.h
Simplex1to4Shape.cpp | SimdMatrix3x3.h
SphereShape.cpp | SimdQuaternion.h
StridingMeshInterface.h | SimdVector3.h
TriangleCallback.h | SimdVector3.h
TriangleMesh.h | SimdVector3.h
TriangleMeshShape.cpp | AabbUtil2.h
TriangleMeshShape.cpp | SimdQuaternion.h
TriangleMeshShape.cpp | SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionShapes/ -> BroadphaseCollision Relation

Bullet » CollisionShapes

CollisionShapes → BroadphaseCollision Relation

File in Bullet » CollisionShapes | Includes file in Bullet » BroadphaseCollision
BoxShape.h | BroadphaseProxy.h
CollisionShape.h | BroadphaseProxy.h
ConeShape.h | BroadphaseProxy.h
ConvexHullShape.h | BroadphaseProxy.h
CylinderShape.h | BroadphaseProxy.h
MinkowskiSumShape.h | BroadphaseProxy.h
MultiSphereShape.h | BroadphaseProxy.h
Simplex1to4Shape.h | BroadphaseProxy.h
SphereShape.h | BroadphaseProxy.h
TriangleMeshShape.h | BroadphaseProxy.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/NarrowPhaseCollision/ -> LinearMath Relation

Bullet » NarrowPhaseCollision

NarrowPhaseCollision → LinearMath Relation

File in Bullet » NarrowPhaseCollision | Includes file in LinearMath
BU_AlgebraicPolynomialSolver.cpp | SimdMinMax.h
BU_Collidable.cpp | SimdTransform.h
BU_Collidable.h | SimdPoint3.h
BU_CollisionPair.cpp | SimdMinMax.h
BU_CollisionPair.cpp | SimdTransformUtil.h
BU_CollisionPair.h | SimdQuaternion.h
BU_EdgeEdge.cpp | SimdPoint3.h
BU_EdgeEdge.h | SimdPoint3.h
BU_EdgeEdge.h | SimdScalar.h
BU_EdgeEdge.h | SimdTransform.h
BU_EdgeEdge.h | SimdVector3.h
BU_MotionStateInterface.h | SimdPoint3.h
BU_MotionStateInterface.h | SimdQuaternion.h
BU_MotionStateInterface.h | SimdTransform.h
BU_PolynomialSolverInterface.h | SimdScalar.h
BU_Screwing.h | SimdPoint3.h
BU_Screwing.h | SimdTransform.h
BU_Screwing.h | SimdVector3.h
BU_VertexPoly.cpp | SimdPoint3.h
BU_VertexPoly.cpp | SimdTransform.h
BU_VertexPoly.cpp | SimdVector3.h
BU_VertexPoly.h | SimdPoint3.h
BU_VertexPoly.h | SimdScalar.h
BU_VertexPoly.h | SimdTransform.h
ContinuousConvexCollision.cpp | SimdTransformUtil.h
ConvexCast.h | IDebugDraw.h
ConvexCast.h | SimdScalar.h
ConvexCast.h | SimdTransform.h
ConvexCast.h | SimdVector3.h
ConvexPenetrationDepthSolver.h | SimdPoint3.h
DiscreteCollisionDetectorInterface.h | SimdTransform.h
DiscreteCollisionDetectorInterface.h | SimdVector3.h
Epa.cpp | SimdMinMax.h
Epa.cpp | SimdPoint3.h
Epa.cpp | SimdScalar.h
Epa.cpp | SimdTransform.h
Epa.cpp | SimdVector3.h
EpaFace.cpp | SimdPoint3.h
EpaFace.cpp | SimdScalar.h
EpaFace.cpp | SimdVector3.h
EpaPenetrationDepthSolver.cpp | SimdMinMax.h
EpaPenetrationDepthSolver.cpp | SimdPoint3.h
EpaPenetrationDepthSolver.cpp | SimdScalar.h
EpaPenetrationDepthSolver.cpp | SimdTransform.h
EpaPenetrationDepthSolver.cpp | SimdVector3.h
EpaPolyhedron.cpp | Memory2.h
EpaPolyhedron.cpp | SimdPoint3.h
EpaPolyhedron.cpp | SimdScalar.h
EpaPolyhedron.cpp | SimdVector3.h
GjkConvexCast.h | SimdVector3.h
GjkPairDetector.h | SimdPoint3.h
Hull.h | Maths.h
ManifoldPoint.h | SimdTransformUtil.h
ManifoldPoint.h | SimdVector3.h
PersistentManifold.cpp | SimdTransform.h
PersistentManifold.h | SimdTransform.h
PersistentManifold.h | SimdVector3.h
Shape.h | Maths.h
SimplexSolverInterface.h | SimdPoint3.h
SimplexSolverInterface.h | SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/NarrowPhaseCollision/ -> CollisionShapes Relation

Bullet » NarrowPhaseCollision

NarrowPhaseCollision → CollisionShapes Relation

File in Bullet » NarrowPhaseCollision | Includes file in Bullet » CollisionShapes
BU_Collidable.cpp | CollisionShape.h
BU_CollisionPair.cpp | PolyhedralConvexShape.h
ContinuousConvexCollision.cpp | ConvexShape.h
ContinuousConvexCollision.cpp | MinkowskiSumShape.h
ContinuousConvexCollision.cpp | SphereShape.h
Epa.cpp | ConvexShape.h
EpaPenetrationDepthSolver.cpp | ConvexShape.h
GjkConvexCast.cpp | MinkowskiSumShape.h
GjkConvexCast.cpp | SphereShape.h
GjkConvexCast.h | CollisionShapes/CollisionMargin.h
GjkPairDetector.cpp | ConvexShape.h
GjkPairDetector.h | CollisionShapes/CollisionMargin.h
MinkowskiPenetrationDepthSolver.cpp | MinkowskiSumShape.h
RaycastCallback.h | TriangleCallback.h
SubSimplexConvexCast.cpp | ConvexShape.h
SubSimplexConvexCast.cpp | MinkowskiSumShape.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ -> LinearMath Relation

BulletDynamics

BulletDynamics → LinearMath Relation

File in BulletDynamics | Includes file in LinearMath
Dynamics / BU_Joint.h | SimdScalar.h
ConstraintSolver / ContactConstraint.cpp | GEN_MinMax.h
ConstraintSolver / ContactConstraint.cpp | SimdVector3.h
ConstraintSolver / ContactConstraint.h | SimdScalar.h
ConstraintSolver / ContactConstraint.h | SimdVector3.h
ConstraintSolver / HingeConstraint.cpp | SimdTransformUtil.h
ConstraintSolver / HingeConstraint.h | SimdVector3.h
ConstraintSolver / JacobianEntry.h | SimdVector3.h
Dynamics / MassProps.h | SimdVector3.h
ConstraintSolver / OdeConstraintSolver.cpp | IDebugDraw.h
ConstraintSolver / Point2PointConstraint.h | SimdVector3.h
Dynamics / RigidBody.cpp | GEN_MinMax.h
Dynamics / RigidBody.cpp | SimdTransformUtil.h
Dynamics / RigidBody.h | SimdPoint3.h
Dynamics / RigidBody.h | SimdTransform.h
ConstraintSolver / SimpleConstraintSolver.cpp | GEN_MinMax.h
ConstraintSolver / SimpleConstraintSolver.cpp | IDebugDraw.h
ConstraintSolver / Solve2LinearConstraint.cpp | SimdVector3.h
ConstraintSolver / Solve2LinearConstraint.h | SimdMatrix3x3.h
ConstraintSolver / Solve2LinearConstraint.h | SimdVector3.h
ConstraintSolver / SorLcp.cpp | SimdScalar.h
ConstraintSolver / SorLcp.h | SimdScalar.h
ConstraintSolver / TypedConstraint.h | SimdScalar.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ -> Bullet Relation

BulletDynamics

BulletDynamics → Bullet Relation

File in BulletDynamics | Includes file in Bullet
ConstraintSolver / ContactConstraint.cpp | NarrowPhaseCollision / ManifoldPoint.h
Dynamics / ContactJoint.cpp | NarrowPhaseCollision / PersistentManifold.h
ConstraintSolver / OdeConstraintSolver.cpp | NarrowPhaseCollision / PersistentManifold.h
Dynamics / RigidBody.cpp | CollisionShapes / ConvexShape.h
Dynamics / RigidBody.h | BroadphaseCollision / BroadphaseProxy.h
Dynamics / RigidBody.h | CollisionDispatch / CollisionObject.h
ConstraintSolver / SimpleConstraintSolver.cpp | NarrowPhaseCollision / PersistentManifold.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/Dynamics/ -> LinearMath Relation

BulletDynamics » Dynamics

Dynamics → LinearMath Relation

File in BulletDynamics » Dynamics | Includes file in LinearMath
BU_Joint.h | SimdScalar.h
MassProps.h | SimdVector3.h
RigidBody.cpp | GEN_MinMax.h
RigidBody.cpp | SimdTransformUtil.h
RigidBody.h | SimdPoint3.h
RigidBody.h | SimdTransform.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/Dynamics/ -> Bullet Relation

BulletDynamics » Dynamics

Dynamics → Bullet Relation

File in BulletDynamics » Dynamics | Includes file in Bullet
ContactJoint.cpp | NarrowPhaseCollision / PersistentManifold.h
RigidBody.cpp | CollisionShapes / ConvexShape.h
RigidBody.h | BroadphaseCollision / BroadphaseProxy.h
RigidBody.h | CollisionDispatch / CollisionObject.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/ -> LinearMath Relation

Extras » PhysicsInterface

PhysicsInterface → LinearMath Relation

File in Extras » PhysicsInterface | Includes file in LinearMath
CcdPhysics / CcdPhysicsController.cpp | SimdTransformUtil.h
CcdPhysics / CcdPhysicsController.h | SimdMatrix3x3.h
CcdPhysics / CcdPhysicsController.h | SimdScalar.h
CcdPhysics / CcdPhysicsController.h | SimdTransform.h
CcdPhysics / CcdPhysicsController.h | SimdVector3.h
CcdPhysics / CcdPhysicsEnvironment.cpp | AabbUtil2.h
CcdPhysics / CcdPhysicsEnvironment.cpp | IDebugDraw.h
CcdPhysics / CcdPhysicsEnvironment.cpp | quickprof.h
CcdPhysics / CcdPhysicsEnvironment.cpp | SimdTransform.h
CcdPhysics / CcdPhysicsEnvironment.h | SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/ -> Bullet Relation

Extras » PhysicsInterface

PhysicsInterface → Bullet Relation

File in Extras » PhysicsInterface | Includes file in Bullet
CcdPhysics / CcdPhysicsController.cpp | BroadphaseCollision / BroadphaseInterface.h
CcdPhysics / CcdPhysicsController.cpp | BroadphaseCollision / BroadphaseProxy.h
CcdPhysics / CcdPhysicsController.cpp | CollisionShapes / ConeShape.h
CcdPhysics / CcdPhysicsController.cpp | CollisionShapes / ConvexShape.h
CcdPhysics / CcdPhysicsController.cpp | CollisionShapes / SphereShape.h
CcdPhysics / CcdPhysicsController.h | BroadphaseCollision / BroadphaseProxy.h
CcdPhysics / CcdPhysicsEnvironment.cpp | BroadphaseCollision / AxisSweep3.h
CcdPhysics / CcdPhysicsEnvironment.cpp | BroadphaseCollision / BroadphaseInterface.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionDispatch / CollisionDispatcher.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionDispatch / CollisionWorld.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionShapes / ConeShape.h
CcdPhysics / CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / ContinuousConvexCollision.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionShapes / ConvexShape.h
CcdPhysics / CcdPhysicsEnvironment.cpp | BroadphaseCollision / Dispatcher.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionDispatch / EmptyCollisionAlgorithm.h
CcdPhysics / CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / GjkConvexCast.h
CcdPhysics / CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / PersistentManifold.h
CcdPhysics / CcdPhysicsEnvironment.cpp | BroadphaseCollision / SimpleBroadphase.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionShapes / SphereShape.h
CcdPhysics / CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / SubSimplexConvexCast.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionShapes / TriangleMeshShape.h
CcdPhysics / CcdPhysicsEnvironment.cpp | CollisionDispatch / UnionFind.h
CcdPhysics / CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / VoronoiSimplexSolver.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/ -> BulletDynamics Relation

Extras » PhysicsInterface

PhysicsInterface → BulletDynamics Relation

File in Extras » PhysicsInterface | Includes file in BulletDynamics
CcdPhysics / CcdPhysicsController.cpp | Dynamics / MassProps.h
CcdPhysics / CcdPhysicsController.cpp | Dynamics / RigidBody.h
CcdPhysics / CcdPhysicsController.h | Dynamics / RigidBody.h
CcdPhysics / CcdPhysicsEnvironment.cpp | ConstraintSolver / ConstraintSolver.h
CcdPhysics / CcdPhysicsEnvironment.cpp | ConstraintSolver / ContactConstraint.h
CcdPhysics / CcdPhysicsEnvironment.cpp | ConstraintSolver / HingeConstraint.h
CcdPhysics / CcdPhysicsEnvironment.cpp | ConstraintSolver / OdeConstraintSolver.h
CcdPhysics / CcdPhysicsEnvironment.cpp | ConstraintSolver / Point2PointConstraint.h
CcdPhysics / CcdPhysicsEnvironment.cpp | Dynamics / RigidBody.h
CcdPhysics / CcdPhysicsEnvironment.cpp | ConstraintSolver / SimpleConstraintSolver.h
CcdPhysics / CcdPhysicsEnvironment.h | ConstraintSolver / ContactSolverInfo.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/CcdPhysics/ -> LinearMath Relation

Extras » PhysicsInterface » CcdPhysics

CcdPhysics → LinearMath Relation

File in Extras » PhysicsInterface » CcdPhysics | Includes file in LinearMath
CcdPhysicsController.cpp | SimdTransformUtil.h
CcdPhysicsController.h | SimdMatrix3x3.h
CcdPhysicsController.h | SimdScalar.h
CcdPhysicsController.h | SimdTransform.h
CcdPhysicsController.h | SimdVector3.h
CcdPhysicsEnvironment.cpp | AabbUtil2.h
CcdPhysicsEnvironment.cpp | IDebugDraw.h
CcdPhysicsEnvironment.cpp | quickprof.h
CcdPhysicsEnvironment.cpp | SimdTransform.h
CcdPhysicsEnvironment.h | SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/CcdPhysics/ -> Bullet Relation

Extras » PhysicsInterface » CcdPhysics

CcdPhysics → Bullet Relation

File in Extras » PhysicsInterface » CcdPhysics | Includes file in Bullet
CcdPhysicsController.cpp | BroadphaseCollision / BroadphaseInterface.h
CcdPhysicsController.cpp | BroadphaseCollision / BroadphaseProxy.h
CcdPhysicsController.cpp | CollisionShapes / ConeShape.h
CcdPhysicsController.cpp | CollisionShapes / ConvexShape.h
CcdPhysicsController.cpp | CollisionShapes / SphereShape.h
CcdPhysicsController.h | BroadphaseCollision / BroadphaseProxy.h
CcdPhysicsEnvironment.cpp | BroadphaseCollision / AxisSweep3.h
CcdPhysicsEnvironment.cpp | BroadphaseCollision / BroadphaseInterface.h
CcdPhysicsEnvironment.cpp | CollisionDispatch / CollisionDispatcher.h
CcdPhysicsEnvironment.cpp | CollisionDispatch / CollisionWorld.h
CcdPhysicsEnvironment.cpp | CollisionShapes / ConeShape.h
CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / ContinuousConvexCollision.h
CcdPhysicsEnvironment.cpp | CollisionShapes / ConvexShape.h
CcdPhysicsEnvironment.cpp | BroadphaseCollision / Dispatcher.h
CcdPhysicsEnvironment.cpp | CollisionDispatch / EmptyCollisionAlgorithm.h
CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / GjkConvexCast.h
CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / PersistentManifold.h
CcdPhysicsEnvironment.cpp | BroadphaseCollision / SimpleBroadphase.h
CcdPhysicsEnvironment.cpp | CollisionShapes / SphereShape.h
CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / SubSimplexConvexCast.h
CcdPhysicsEnvironment.cpp | CollisionShapes / TriangleMeshShape.h
CcdPhysicsEnvironment.cpp | CollisionDispatch / UnionFind.h
CcdPhysicsEnvironment.cpp | NarrowPhaseCollision / VoronoiSimplexSolver.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/CcdPhysics/ -> BulletDynamics Relation

Extras » PhysicsInterface » CcdPhysics

CcdPhysics → BulletDynamics Relation

File in Extras » PhysicsInterface » CcdPhysics | Includes file in BulletDynamics
CcdPhysicsController.cpp | Dynamics / MassProps.h
CcdPhysicsController.cpp | Dynamics / RigidBody.h
CcdPhysicsController.h | Dynamics / RigidBody.h
CcdPhysicsEnvironment.cpp | ConstraintSolver / ConstraintSolver.h
CcdPhysicsEnvironment.cpp | ConstraintSolver / ContactConstraint.h
CcdPhysicsEnvironment.cpp | ConstraintSolver / HingeConstraint.h
CcdPhysicsEnvironment.cpp | ConstraintSolver / OdeConstraintSolver.h
CcdPhysicsEnvironment.cpp | ConstraintSolver / Point2PointConstraint.h
CcdPhysicsEnvironment.cpp | Dynamics / RigidBody.h
CcdPhysicsEnvironment.cpp | ConstraintSolver / SimpleConstraintSolver.h
CcdPhysicsEnvironment.h | ConstraintSolver / ContactSolverInfo.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/CcdPhysics/ -> Common Relation

Extras » PhysicsInterface » CcdPhysics

CcdPhysics → Common Relation

File in Extras » PhysicsInterface » CcdPhysics | Includes file in Extras » PhysicsInterface » Common
CcdPhysicsController.cpp | PHY_IMotionState.h
CcdPhysicsController.h | PHY_IMotionState.h
CcdPhysicsController.h | PHY_IPhysicsController.h
CcdPhysicsEnvironment.cpp | PHY_IMotionState.h
CcdPhysicsEnvironment.h | PHY_IPhysicsEnvironment.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionDispatch/ -> LinearMath Relation

Bullet » CollisionDispatch

CollisionDispatch → LinearMath Relation

File in Bullet » CollisionDispatch | Includes file in LinearMath
CollisionObject.h | SimdTransform.h
CollisionWorld.cpp | AabbUtil2.h
CollisionWorld.h | SimdTransform.h
CollisionWorld.h | SimdVector3.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionDispatch/ -> BroadphaseCollision Relation

Bullet » CollisionDispatch

CollisionDispatch → BroadphaseCollision Relation

File in Bullet » CollisionDispatch | Includes file in Bullet » BroadphaseCollision
CollisionDispatcher.cpp | CollisionAlgorithm.h
CollisionDispatcher.h | BroadphaseProxy.h
CollisionDispatcher.h | Dispatcher.h
CollisionWorld.cpp | BroadphaseInterface.h
ConvexConcaveCollisionAlgorithm.cpp | BroadphaseProxy.h
ConvexConcaveCollisionAlgorithm.h | BroadphaseInterface.h
ConvexConcaveCollisionAlgorithm.h | BroadphaseProxy.h
ConvexConcaveCollisionAlgorithm.h | CollisionAlgorithm.h
ConvexConcaveCollisionAlgorithm.h | Dispatcher.h
ConvexConvexAlgorithm.cpp | BroadphaseInterface.h
ConvexConvexAlgorithm.cpp | BroadphaseProxy.h
ConvexConvexAlgorithm.h | BroadphaseProxy.h
ConvexConvexAlgorithm.h | CollisionAlgorithm.h
EmptyCollisionAlgorithm.h | CollisionAlgorithm.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionDispatch/ -> CollisionShapes Relation

Bullet » CollisionDispatch

CollisionDispatch → CollisionShapes Relation

File in Bullet » CollisionDispatch | Includes file in Bullet » CollisionShapes
CollisionDispatcher.cpp | CollisionShape.h
CollisionWorld.cpp | CollisionShape.h
CollisionWorld.cpp | SphereShape.h
CollisionWorld.cpp | TriangleMeshShape.h
ConvexConcaveCollisionAlgorithm.cpp | BoxShape.h
ConvexConcaveCollisionAlgorithm.cpp | MultiSphereShape.h
ConvexConcaveCollisionAlgorithm.cpp | TriangleMeshShape.h
ConvexConcaveCollisionAlgorithm.cpp | TriangleShape.h
ConvexConcaveCollisionAlgorithm.h | TriangleCallback.h
ConvexConvexAlgorithm.cpp | BoxShape.h
ConvexConvexAlgorithm.cpp | ConvexShape.h
ConvexConvexAlgorithm.cpp | MinkowskiSumShape.h
ConvexConvexAlgorithm.cpp | SphereShape.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionDispatch/ -> NarrowPhaseCollision Relation

Bullet » CollisionDispatch

CollisionDispatch → NarrowPhaseCollision Relation

File in Bullet » CollisionDispatch | Includes file in Bullet » NarrowPhaseCollision
CollisionDispatcher.h | PersistentManifold.h
CollisionWorld.cpp | RaycastCallback.h
CollisionWorld.cpp | SubSimplexConvexCast.h
ConvexConcaveCollisionAlgorithm.cpp | RaycastCallback.h
ConvexConcaveCollisionAlgorithm.h | PersistentManifold.h
ConvexConvexAlgorithm.cpp | ContinuousConvexCollision.h
ConvexConvexAlgorithm.cpp | ConvexPenetrationDepthSolver.h
ConvexConvexAlgorithm.cpp | DiscreteCollisionDetectorInterface.h
ConvexConvexAlgorithm.cpp | GjkConvexCast.h
ConvexConvexAlgorithm.cpp | GjkPairDetector.h
ConvexConvexAlgorithm.cpp | MinkowskiPenetrationDepthSolver.h
ConvexConvexAlgorithm.cpp | SubSimplexConvexCast.h
ConvexConvexAlgorithm.cpp | VoronoiSimplexSolver.h
ConvexConvexAlgorithm.h | GjkPairDetector.h
ConvexConvexAlgorithm.h | PersistentManifold.h
ConvexConvexAlgorithm.h | VoronoiSimplexSolver.h
ManifoldResult.cpp | PersistentManifold.h
ManifoldResult.h | DiscreteCollisionDetectorInterface.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ConstraintSolver/ -> LinearMath Relation

BulletDynamics » ConstraintSolver

ConstraintSolver → LinearMath Relation

File in BulletDynamics » ConstraintSolver | Includes file in LinearMath
ContactConstraint.cpp | GEN_MinMax.h
ContactConstraint.cpp | SimdVector3.h
ContactConstraint.h | SimdScalar.h
ContactConstraint.h | SimdVector3.h
HingeConstraint.cpp | SimdTransformUtil.h
HingeConstraint.h | SimdVector3.h
JacobianEntry.h | SimdVector3.h
OdeConstraintSolver.cpp | IDebugDraw.h
Point2PointConstraint.h | SimdVector3.h
SimpleConstraintSolver.cpp | GEN_MinMax.h
SimpleConstraintSolver.cpp | IDebugDraw.h
Solve2LinearConstraint.cpp | SimdVector3.h
Solve2LinearConstraint.h | SimdMatrix3x3.h
Solve2LinearConstraint.h | SimdVector3.h
SorLcp.cpp | SimdScalar.h
SorLcp.h | SimdScalar.h
TypedConstraint.h | SimdScalar.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ConstraintSolver/ -> Bullet Relation

BulletDynamics » ConstraintSolver

ConstraintSolver → Bullet Relation

File in BulletDynamics » ConstraintSolver | Includes file in Bullet
ContactConstraint.cpp | NarrowPhaseCollision / ManifoldPoint.h
OdeConstraintSolver.cpp | NarrowPhaseCollision / PersistentManifold.h
SimpleConstraintSolver.cpp | NarrowPhaseCollision / PersistentManifold.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ConstraintSolver/ -> Dynamics Relation

BulletDynamics » ConstraintSolver

ConstraintSolver → Dynamics Relation

File in BulletDynamics » ConstraintSolver | Includes file in BulletDynamics » Dynamics
ContactConstraint.cpp | RigidBody.h
HingeConstraint.cpp | MassProps.h
HingeConstraint.cpp | RigidBody.h
JacobianEntry.h | RigidBody.h
OdeConstraintSolver.cpp | BU_Joint.h
OdeConstraintSolver.cpp | ContactJoint.h
OdeConstraintSolver.cpp | RigidBody.h
Point2PointConstraint.cpp | MassProps.h
Point2PointConstraint.cpp | RigidBody.h
SimpleConstraintSolver.cpp | BU_Joint.h
SimpleConstraintSolver.cpp | ContactJoint.h
SimpleConstraintSolver.cpp | RigidBody.h
Solve2LinearConstraint.cpp | RigidBody.h
SorLcp.cpp | BU_Joint.h
SorLcp.cpp | RigidBody.h
TypedConstraint.cpp | MassProps.h
TypedConstraint.cpp | RigidBody.h
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/ Directory Reference

Bullet

Bullet Directory Reference

Directories

directory | BroadphaseCollision
directory | CollisionDispatch
directory | CollisionShapes
directory | NarrowPhaseCollision
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/BroadphaseCollision/ Directory Reference

Bullet » BroadphaseCollision

BroadphaseCollision Directory Reference

Files

file | AxisSweep3.cpp [code]
file | AxisSweep3.h [code]
file | BroadphaseInterface.h [code]
file | BroadphaseProxy.cpp [code]
file | BroadphaseProxy.h [code]
file | CollisionAlgorithm.cpp [code]
file | CollisionAlgorithm.h [code]
file | Dispatcher.cpp [code]
file | Dispatcher.h [code]
file | SimpleBroadphase.cpp [code]
file | SimpleBroadphase.h [code]
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionDispatch/ Directory Reference

Bullet » CollisionDispatch

CollisionDispatch Directory Reference

Files

file | CollisionDispatcher.cpp [code]
file | CollisionDispatcher.h [code]
file | CollisionObject.cpp [code]
file | CollisionObject.h [code]
file | CollisionWorld.cpp [code]
file | CollisionWorld.h [code]
file | ConvexConcaveCollisionAlgorithm.cpp [code]
file | ConvexConcaveCollisionAlgorithm.h [code]
file | ConvexConvexAlgorithm.cpp [code]
file | ConvexConvexAlgorithm.h [code]
file | EmptyCollisionAlgorithm.cpp [code]
file | EmptyCollisionAlgorithm.h [code]
file | ManifoldResult.cpp [code]
file | ManifoldResult.h [code]
file | UnionFind.cpp [code]
file | UnionFind.h [code]
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/CollisionShapes/ Directory Reference

Bullet » CollisionShapes

CollisionShapes Directory Reference

Files

file | BoxShape.cpp [code]
file | BoxShape.h [code]
file | BvhTriangleMeshShape.cpp [code]
file | BvhTriangleMeshShape.h [code]
file | CollisionShapes/CollisionMargin.h [code]
file | CollisionShape.cpp [code]
file | CollisionShape.h [code]
file | ConeShape.cpp [code]
file | ConeShape.h [code]
file | ConvexHullShape.cpp [code]
file | ConvexHullShape.h [code]
file | ConvexShape.cpp [code]
file | ConvexShape.h [code]
file | CylinderShape.cpp [code]
file | CylinderShape.h [code]
file | EmptyShape.cpp [code]
file | EmptyShape.h [code]
file | MinkowskiSumShape.cpp [code]
file | MinkowskiSumShape.h [code]
file | MultiSphereShape.cpp [code]
file | MultiSphereShape.h [code]
file | OptimizedBvh.cpp [code]
file | OptimizedBvh.h [code]
file | PolyhedralConvexShape.cpp [code]
file | PolyhedralConvexShape.h [code]
file | Simplex1to4Shape.cpp [code]
file | Simplex1to4Shape.h [code]
file | SphereShape.cpp [code]
file | SphereShape.h [code]
file | StridingMeshInterface.cpp [code]
file | StridingMeshInterface.h [code]
file | TriangleCallback.cpp [code]
file | TriangleCallback.h [code]
file | TriangleIndexVertexArray.cpp [code]
file | TriangleIndexVertexArray.h [code]
file | TriangleMesh.cpp [code]
file | TriangleMesh.h [code]
file | TriangleMeshShape.cpp [code]
file | TriangleMeshShape.h [code]
file | TriangleShape.h [code]
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Bullet/NarrowPhaseCollision/ Directory Reference

Bullet » NarrowPhaseCollision

NarrowPhaseCollision Directory Reference

Files

file | BU_AlgebraicPolynomialSolver.cpp [code]
file | BU_AlgebraicPolynomialSolver.h [code]
file | BU_Collidable.cpp [code]
file | BU_Collidable.h [code]
file | BU_CollisionPair.cpp [code]
file | BU_CollisionPair.h [code]
file | BU_EdgeEdge.cpp [code]
file | BU_EdgeEdge.h [code]
file | BU_MotionStateInterface.h [code]
file | BU_PolynomialSolverInterface.h [code]
file | BU_Screwing.cpp [code]
file | BU_Screwing.h [code]
file | BU_StaticMotionState.h [code]
file | BU_VertexPoly.cpp [code]
file | BU_VertexPoly.h [code]
file | NarrowPhaseCollision/CollisionMargin.h [code]
file | ContinuousConvexCollision.cpp [code]
file | ContinuousConvexCollision.h [code]
file | ConvexCast.cpp [code]
file | ConvexCast.h [code]
file | ConvexPenetrationDepthSolver.h [code]
file | DiscreteCollisionDetectorInterface.h [code]
file | Epa.cpp [code]
file | Epa.h [code]
file | EpaCommon.h [code]
file | EpaFace.cpp [code]
file | EpaFace.h [code]
file | EpaHalfEdge.h [code]
file | EpaPenetrationDepthSolver.cpp [code]
file | EpaPenetrationDepthSolver.h [code]
file | EpaPolyhedron.cpp [code]
file | EpaPolyhedron.h [code]
file | EpaVertex.h [code]
file | GjkConvexCast.cpp [code]
file | GjkConvexCast.h [code]
file | GjkPairDetector.cpp [code]
file | GjkPairDetector.h [code]
file | Hull.cpp [code]
file | Hull.h [code]
file | HullContactCollector.h [code]
file | ManifoldContactAddResult.cpp [code]
file | ManifoldContactAddResult.h [code]
file | ManifoldPoint.h [code]
file | MinkowskiPenetrationDepthSolver.cpp [code]
file | MinkowskiPenetrationDepthSolver.h [code]
file | PersistentManifold.cpp [code]
file | PersistentManifold.h [code]
file | PointCollector.h [code]
file | RaycastCallback.cpp [code]
file | RaycastCallback.h [code]
file | Shape.cpp [code]
file | Shape.h [code]
file | SimplexSolverInterface.h [code]
file | SubSimplexConvexCast.cpp [code]
file | SubSimplexConvexCast.h [code]
file | VoronoiSimplexSolver.cpp [code]
file | VoronoiSimplexSolver.h [code]
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ Directory Reference

BulletDynamics

BulletDynamics Directory Reference

Directories

directory | ConstraintSolver
directory | Dynamics
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/ConstraintSolver/ Directory Reference

BulletDynamics » ConstraintSolver

ConstraintSolver Directory Reference

Files

file | ConstraintSolver.h [code]
file | ContactConstraint.cpp [code]
file | ContactConstraint.h [code]
file | ContactSolverInfo.h [code]
file | HingeConstraint.cpp [code]
file | HingeConstraint.h [code]
file | JacobianEntry.h [code]
file | OdeConstraintSolver.cpp [code]
file | OdeConstraintSolver.h [code]
file | Point2PointConstraint.cpp [code]
file | Point2PointConstraint.h [code]
file | SimpleConstraintSolver.cpp [code]
file | SimpleConstraintSolver.h [code]
file | Solve2LinearConstraint.cpp [code]
file | Solve2LinearConstraint.h [code]
file | SorLcp.cpp [code]
file | SorLcp.h [code]
file | TypedConstraint.cpp [code]
file | TypedConstraint.h [code]
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: BulletDynamics/Dynamics/ Directory Reference

BulletDynamics » Dynamics

Dynamics Directory Reference

Files

file | BU_Joint.cpp [code]
file | BU_Joint.h [code]
file | ContactJoint.cpp [code]
file | ContactJoint.h [code]
file | MassProps.h [code]
file | RigidBody.cpp [code]
file | RigidBody.h [code]
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/ Directory Reference

Extras

Extras Directory Reference

Directories

directory PhysicsInterface
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/ Directory Reference

Extras » PhysicsInterface

PhysicsInterface Directory Reference

Directories

directory | CcdPhysics
directory | Common
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/CcdPhysics/ Directory Reference

Extras » PhysicsInterface » CcdPhysics

CcdPhysics Directory Reference

Files

file | CcdPhysicsController.cpp [code]
file | CcdPhysicsController.h [code]
file | CcdPhysicsEnvironment.cpp [code]
file | CcdPhysicsEnvironment.h [code]
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Extras/PhysicsInterface/Common/ Directory Reference

Extras » PhysicsInterface » Common

Common Directory Reference

Files

file | PHY_DynamicTypes.h [code]
file | PHY_IMotionState.cpp [code]
file | PHY_IMotionState.h [code]
file | PHY_IPhysicsController.cpp [code]
file | PHY_IPhysicsController.h [code]
file | PHY_IPhysicsEnvironment.cpp [code]
file | PHY_IPhysicsEnvironment.h [code]
file | PHY_IVehicle.cpp [code]
file | PHY_IVehicle.h [code]
file | PHY_Pro.h [code]
Generated on Wed May 24 14:00:40 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: LinearMath/ Directory Reference

LinearMath

LinearMath Directory Reference

Files

file | AabbUtil2.h [code]
file | GEN_List.h [code]
file | GEN_MinMax.h [code]
file | GEN_random.h [code]
file | Geometry.cpp [code]
file | Geometry.h [code]
file | IDebugDraw.h [code]
file | Maths.h [code]
file | Matrix.cpp [code]
file | Matrix.h [code]
file | Memory2.h [code]
file | Quat.cpp [code]
file | Quat.h [code]
file | quickprof.cpp [code]
file | quickprof.h [code]
file | Scalar.cpp [code]
file | Scalar.h [code]
file | SimdMatrix3x3.h [code]
file | SimdMinMax.h [code]
file | SimdPoint3.h [code]
file | SimdQuadWord.h [code]
file | SimdQuaternion.h [code]
file | SimdScalar.h [code]
file | SimdTransform.h [code]
file | SimdTransformUtil.h [code]
file | SimdVector3.h [code]
file | Vector.cpp [code]
file | Vector.h [code]
file | VectorBase.cpp [code]
file | VectorBase.h [code]
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Directory Hierarchy

Bullet Collision Detection & Physics Library Directories

This directory hierarchy is sorted roughly, but not completely, alphabetically:
  • Bullet
    • BroadphaseCollision
    • CollisionDispatch
    • CollisionShapes
    • NarrowPhaseCollision
  • BulletDynamics
    • ConstraintSolver
    • Dynamics
  • Extras
    • PhysicsInterface
      • CcdPhysics
      • Common
  • LinearMath
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: File Index

Bullet Collision Detection & Physics Library File List

Here is a list of all files with brief descriptions:
AabbUtil2.h [code]
AxisSweep3.cpp [code]
AxisSweep3.h [code]
BoxShape.cpp [code]
BoxShape.h [code]
BroadphaseInterface.h [code]
BroadphaseProxy.cpp [code]
BroadphaseProxy.h [code]
BU_AlgebraicPolynomialSolver.cpp [code]
BU_AlgebraicPolynomialSolver.h [code]
BU_Collidable.cpp [code]
BU_Collidable.h [code]
BU_CollisionPair.cpp [code]
BU_CollisionPair.h [code]
BU_EdgeEdge.cpp [code]
BU_EdgeEdge.h [code]
BU_Joint.cpp [code]
BU_Joint.h [code]
BU_MotionStateInterface.h [code]
BU_PolynomialSolverInterface.h [code]
BU_Screwing.cpp [code]
BU_Screwing.h [code]
BU_StaticMotionState.h [code]
BU_VertexPoly.cpp [code]
BU_VertexPoly.h [code]
BvhTriangleMeshShape.cpp [code]
BvhTriangleMeshShape.h [code]
CcdPhysicsController.cpp [code]
CcdPhysicsController.h [code]
CcdPhysicsEnvironment.cpp [code]
CcdPhysicsEnvironment.h [code]
CollisionAlgorithm.cpp [code]
CollisionAlgorithm.h [code]
CollisionDispatcher.cpp [code]
CollisionDispatcher.h [code]
CollisionShapes/CollisionMargin.h [code]
NarrowPhaseCollision/CollisionMargin.h [code]
CollisionObject.cpp [code]
CollisionObject.h [code]
CollisionShape.cpp [code]
CollisionShape.h [code]
CollisionWorld.cpp [code]
CollisionWorld.h [code]
ConeShape.cpp [code]
ConeShape.h [code]
ConstraintSolver.h [code]
ContactConstraint.cpp [code]
ContactConstraint.h [code]
ContactJoint.cpp [code]
ContactJoint.h [code]
ContactSolverInfo.h [code]
ContinuousConvexCollision.cpp [code]
ContinuousConvexCollision.h [code]
ConvexCast.cpp [code]
ConvexCast.h [code]
ConvexConcaveCollisionAlgorithm.cpp [code]
ConvexConcaveCollisionAlgorithm.h [code]
ConvexConvexAlgorithm.cpp [code]
ConvexConvexAlgorithm.h [code]
ConvexHullShape.cpp [code]
ConvexHullShape.h [code]
ConvexPenetrationDepthSolver.h [code]
ConvexShape.cpp [code]
ConvexShape.h [code]
CylinderShape.cpp [code]
CylinderShape.h [code]
DiscreteCollisionDetectorInterface.h [code]
Dispatcher.cpp [code]
Dispatcher.h [code]
EmptyCollisionAlgorithm.cpp [code]
EmptyCollisionAlgorithm.h [code]
EmptyShape.cpp [code]
EmptyShape.h [code]
Epa.cpp [code]
Epa.h [code]
EpaCommon.h [code]
EpaFace.cpp [code]
EpaFace.h [code]
EpaHalfEdge.h [code]
EpaPenetrationDepthSolver.cpp [code]
EpaPenetrationDepthSolver.h [code]
EpaPolyhedron.cpp [code]
EpaPolyhedron.h [code]
EpaVertex.h [code]
GEN_List.h [code]
GEN_MinMax.h [code]
GEN_random.h [code]
Geometry.cpp [code]
Geometry.h [code]
GjkConvexCast.cpp [code]
GjkConvexCast.h [code]
GjkPairDetector.cpp [code]
GjkPairDetector.h [code]
HingeConstraint.cpp [code]
HingeConstraint.h [code]
Hull.cpp [code]
Hull.h [code]
HullContactCollector.h [code]
IDebugDraw.h [code]
JacobianEntry.h [code]
ManifoldContactAddResult.cpp [code]
ManifoldContactAddResult.h [code]
ManifoldPoint.h [code]
ManifoldResult.cpp [code]
ManifoldResult.h [code]
MassProps.h [code]
Maths.h [code]
Matrix.cpp [code]
Matrix.h [code]
Memory2.h [code]
MinkowskiPenetrationDepthSolver.cpp [code]
MinkowskiPenetrationDepthSolver.h [code]
MinkowskiSumShape.cpp [code]
MinkowskiSumShape.h [code]
MultiSphereShape.cpp [code]
MultiSphereShape.h [code]
OdeConstraintSolver.cpp [code]
OdeConstraintSolver.h [code]
OptimizedBvh.cpp [code]
OptimizedBvh.h [code]
PersistentManifold.cpp [code]
PersistentManifold.h [code]
PHY_DynamicTypes.h [code]
PHY_IMotionState.cpp [code]
PHY_IMotionState.h [code]
PHY_IPhysicsController.cpp [code]
PHY_IPhysicsController.h [code]
PHY_IPhysicsEnvironment.cpp [code]
PHY_IPhysicsEnvironment.h [code]
PHY_IVehicle.cpp [code]
PHY_IVehicle.h [code]
PHY_Pro.h [code]
Point2PointConstraint.cpp [code]
Point2PointConstraint.h [code]
PointCollector.h [code]
PolyhedralConvexShape.cpp [code]
PolyhedralConvexShape.h [code]
Quat.cpp [code]
Quat.h [code]
quickprof.cpp [code]
quickprof.h [code]
RaycastCallback.cpp [code]
RaycastCallback.h [code]
RigidBody.cpp [code]
RigidBody.h [code]
Scalar.cpp [code]
Scalar.h [code]
Shape.cpp [code]
Shape.h [code]
SimdMatrix3x3.h [code]
SimdMinMax.h [code]
SimdPoint3.h [code]
SimdQuadWord.h [code]
SimdQuaternion.h [code]
SimdScalar.h [code]
SimdTransform.h [code]
SimdTransformUtil.h [code]
SimdVector3.h [code]
SimpleBroadphase.cpp [code]
SimpleBroadphase.h [code]
SimpleConstraintSolver.cpp [code]
SimpleConstraintSolver.h [code]
Simplex1to4Shape.cpp [code]
Simplex1to4Shape.h [code]
SimplexSolverInterface.h [code]
Solve2LinearConstraint.cpp [code]
Solve2LinearConstraint.h [code]
SorLcp.cpp [code]
SorLcp.h [code]
SphereShape.cpp [code]
SphereShape.h [code]
StridingMeshInterface.cpp [code]
StridingMeshInterface.h [code]
SubSimplexConvexCast.cpp [code]
SubSimplexConvexCast.h [code]
TriangleCallback.cpp [code]
TriangleCallback.h [code]
TriangleIndexVertexArray.cpp [code]
TriangleIndexVertexArray.h [code]
TriangleMesh.cpp [code]
TriangleMesh.h [code]
TriangleMeshShape.cpp [code]
TriangleMeshShape.h [code]
TriangleShape.h [code]
TypedConstraint.cpp [code]
TypedConstraint.h [code]
UnionFind.cpp [code]
UnionFind.h [code]
Vector.cpp [code]
Vector.h [code]
VectorBase.cpp [code]
VectorBase.h [code]
VoronoiSimplexSolver.cpp [code]
VoronoiSimplexSolver.h [code]
Generated on Wed May 24 13:58:36 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Graph Legend

Graph Legend

This page explains how to interpret the graphs that are generated by doxygen.

Consider the following example:

/*! Invisible class because of truncation */
class Invisible { };

/*! Truncated class, inheritance relation is hidden */
class Truncated : public Invisible { };

/* Class not documented with doxygen comments */
class Undocumented { };

/*! Class that is inherited using public inheritance */
class PublicBase : public Truncated { };

/*! A template class */
template<class T> class Templ { };

/*! Class that is inherited using protected inheritance */
class ProtectedBase { };

/*! Class that is inherited using private inheritance */
class PrivateBase { };

/*! Class that is used by the Inherited class */
class Used { };

/*! Super class that inherits a number of other classes */
class Inherited : public PublicBase,
                  protected ProtectedBase,
                  private PrivateBase,
                  public Undocumented
                  public Templ<int>
{
  private:
    Used *m_usedClass;
};
If the MAX_DOT_GRAPH_HEIGHT tag in the configuration file is set to 240 this will result in the following graph:

The boxes in the above graph have the following meaning:

  • A filled black box represents the struct or class for which the graph is generated.
  • A box with a black border denotes a documented struct or class.
  • A box with a grey border denotes an undocumented struct or class.
  • A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
The arrows have the following meaning:
  • A dark blue arrow is used to visualize a public inheritance relation between two classes.
  • A dark green arrow is used for protected inheritance.
  • A dark red arrow is used for private inheritance.
  • A purple dashed arrow is used if a class is contained or used by another class. The arrow is labeled with the variable(s) through which the pointed class or struct is accessible.
  • A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labeled with the template parameters of the instance.
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Hierarchical Index

  • Class List
  • Class Hierarchy
  • Class Members

Bullet Collision Detection & Physics Library Class Hierarchy

Go to the graphical class hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically:

  • AxisSweep3::Edge
  • BroadphaseInterface
    • SimpleBroadphase
      • AxisSweep3
  • BroadphasePair
  • BroadphaseProxy
    • AxisSweep3::Handle
    • SimpleBroadphaseProxy
  • BU_Collidable
  • BU_ContactJointNode
  • BU_EdgeEdge
  • BU_Joint
    • ContactJoint
  • BU_Joint::Info1
  • BU_Joint::Info2
  • BU_MotionStateInterface
    • BU_StaticMotionState
  • BU_Screwing
  • BU_VertexPoly
  • BUM_PolynomialSolverInterface
    • BU_AlgebraicPolynomialSolver
  • CcdConstructionInfo
  • CollisionAlgorithm
    • ConvexConcaveCollisionAlgorithm
    • ConvexConvexAlgorithm
    • EmptyAlgorithm
  • CollisionAlgorithmConstructionInfo
  • CollisionAlgorithmCreateFunc
  • CollisionDispatcher::IslandCallback
  • CollisionObject
    • RigidBody
  • CollisionShape
    • ConvexShape
      • ConeShape
      • MinkowskiSumShape
      • MultiSphereShape
      • PolyhedralConvexShape
        • BoxShape
          • CylinderShape
            • CylinderShapeX
            • CylinderShapeZ
        • BU_Simplex1to4
        • ConvexHullShape
        • TriangleShape
      • SphereShape
    • EmptyShape
    • TriangleMeshShape
      • BvhTriangleMeshShape
  • CollisionWorld
  • CollisionWorld::LocalRayResult
  • CollisionWorld::LocalShapeInfo
  • CollisionWorld::RayResultCallback
    • CollisionWorld::ClosestRayResultCallback
      • FilterClosestRayResultCallback
  • ConstraintPersistentData
  • ConstraintSetting
  • ConstraintSolver
    • OdeConstraintSolver
    • SimpleConstraintSolver
  • ContactSolverInfo
  • ConvexCast
    • BU_CollisionPair
    • ContinuousConvexCollision
    • GjkConvexCast
    • SubsimplexConvexCast
  • ConvexCast::CastResult
  • ConvexPenetrationDepthSolver
    • EpaPenetrationDepthSolver
    • MinkowskiPenetrationDepthSolver
  • DiscreteCollisionDetectorInterface
    • GjkPairDetector
  • DiscreteCollisionDetectorInterface::ClosestPointInput
  • DiscreteCollisionDetectorInterface::Result
    • FlippedContactResult
    • ManifoldContactAddResult
    • ManifoldResult
    • MyResult
    • PointCollector
    • StorageResult
  • Dispatcher
    • CollisionDispatcher
  • DispatcherInfo
  • Epa
  • EpaFace
  • EpaHalfEdge
  • EpaPolyhedron
  • EpaVertex
  • GEN_Link
  • GEN_List
  • Hull::Edge
  • Hull::Face
  • Hull::TmpEdge
  • Hull::TmpFace
  • HullContactCollector
  • IDebugDraw
  • IndexError
  • InternalTriangleIndexCallback
  • JacobianEntry
  • ManifoldPoint
  • MassProps
  • MyTriangle
  • NodeOverlapCallback
  • OptimizedBvh
  • OptimizedBvhNode
  • PersistentManifold
  • PHY__Vector3
  • PHY_CollData
  • PHY_IMotionState
    • DefaultMotionState
  • PHY_IPhysicsController
    • CcdPhysicsController
  • PHY_IPhysicsEnvironment
    • CcdPhysicsEnvironment
  • PHY_IVehicle
  • PHY_MaterialProps
  • PHY_ShapeProps
  • Point2
  • Quat
  • Separation
  • Shape
    • Hull
  • SimdMatrix3x3
  • SimdQuadWord
    • SimdQuaternion
    • SimdVector3
      • SimdVector4
  • SimdTransform
  • SimdTransformUtil
  • Solve2LinearConstraint
  • StridingMeshInterface
    • TriangleIndexVertexArray
    • TriangleMesh
  • SubSimplexClosestResult
  • TriangleCallback
    • BoxTriangleCallback
    • SupportVertexCallback
    • TriangleRaycastCallback
  • TypedConstraint
    • HingeConstraint
    • Point2PointConstraint
  • UnionFind
  • UsageBitfield
  • Vector2
  • VoronoiSimplexSolver
Generated on Wed May 24 13:59:54 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5


Bullet Collision Detection & Physics Library: Namespace Index

  • Namespace List
  • Namespace Members

Bullet Collision Detection & Physics Library Namespace List

Here is a list of all namespaces with brief descriptions:
Maths
Generated on Wed May 24 14:00:41 2006 for Bullet Collision Detection & Physics Library by doxygen 1.4.5