- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp
r2907 r2908 136 136 //btScalar clippedDist = dist; 137 137 138 //don't report time of impact for motion away from the contact normal (or causes minor penetration)139 if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=SIMD_EPSILON)140 return false;141 138 142 139 dLambda = dist / (projectedLinearVelocity+ maxAngularProjectedVelocity); … … 200 197 201 198 } 202 199 200 //don't report time of impact for motion away from the contact normal (or causes minor penetration) 203 201 if ((projectedLinearVelocity+ maxAngularProjectedVelocity)<=result.m_allowedPenetration)//SIMD_EPSILON) 204 202 return false; 205 203 206 204 result.m_fraction = lambda; 207 205 result.m_normal = n; -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp
r2907 r2908 151 151 if ((delta > btScalar(0.0)) && (delta * delta > squaredDistance * input.m_maximumDistanceSquared)) 152 152 { 153 checkSimplex=true; 154 //checkPenetration = false; 153 checkPenetration = false; 155 154 break; 156 155 } -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btManifoldPoint.h
r2907 r2908 113 113 } 114 114 115 ///this returns the most recent applied impulse, to satisfy contact constraints by the constraint solver116 btScalar getAppliedImpulse() const117 {118 return m_appliedImpulse;119 }120 121 115 122 116 -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
r2907 r2908 184 184 185 185 } 186 if (insertIndex<0)187 insertIndex=0;188 189 186 btAssert(m_pointCache[insertIndex].m_userPersistentData==0); 190 187 m_pointCache[insertIndex] = newPoint; -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btPersistentManifold.h
r2907 r2908 56 56 57 57 btScalar m_contactBreakingThreshold; 58 btScalar m_contactProcessingThreshold;59 58 60 59 … … 72 71 btPersistentManifold(); 73 72 74 btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold ,btScalar contactProcessingThreshold)73 btPersistentManifold(void* body0,void* body1,int , btScalar contactBreakingThreshold) 75 74 : m_body0(body0),m_body1(body1),m_cachedPoints(0), 76 m_contactBreakingThreshold(contactBreakingThreshold), 77 m_contactProcessingThreshold(contactProcessingThreshold) 75 m_contactBreakingThreshold(contactBreakingThreshold) 78 76 { 79 77 … … 114 112 ///@todo: get this margin from the current physics / collision environment 115 113 btScalar getContactBreakingThreshold() const; 116 117 btScalar getContactProcessingThreshold() const118 {119 return m_contactProcessingThreshold;120 }121 114 122 115 int getCacheEntry(const btManifoldPoint& newPoint) const; -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
r2907 r2908 24 24 #include "btRaycastCallback.h" 25 25 26 btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to , unsigned int flags)26 btTriangleRaycastCallback::btTriangleRaycastCallback(const btVector3& from,const btVector3& to) 27 27 : 28 28 m_from(from), 29 29 m_to(to), 30 //@BP Mod31 m_flags(flags),32 30 m_hitFraction(btScalar(1.)) 33 31 { … … 58 56 return ; // same sign 59 57 } 60 //@BP Mod - Backface filtering61 if (((m_flags & kF_FilterBackfaces) != 0) && (dist_a > btScalar(0.0)))62 {63 // Backface, skip check64 return;65 }66 58 67 59 const btScalar proj_length=dist_a-dist_b; … … 98 90 if ( (btScalar)(cp2.dot(triangleNormal)) >=edge_tolerance) 99 91 { 100 //@BP Mod101 // Triangle normal isn't normalized102 triangleNormal.normalize();103 92 104 //@BP Mod - Allow for unflipped normal when raycasting against backfaces 105 if (((m_flags & kF_KeepUnflippedNormal) != 0) || (dist_a <= btScalar(0.0))) 93 if ( dist_a > 0 ) 106 94 { 107 m_hitFraction = reportHit( -triangleNormal,distance,partId,triangleIndex);95 m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex); 108 96 } 109 97 else 110 98 { 111 m_hitFraction = reportHit(triangleNormal,distance,partId,triangleIndex);99 m_hitFraction = reportHit(-triangleNormal,distance,partId,triangleIndex); 112 100 } 113 101 } -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.h
r2907 r2908 30 30 btVector3 m_to; 31 31 32 //@BP Mod - allow backface filtering and unflipped normals33 enum EFlags34 {35 kF_None = 0,36 kF_FilterBackfaces = 1 << 0,37 kF_KeepUnflippedNormal = 1 << 1, // Prevents returned face normal getting flipped when a ray hits a back-facing triangle38 39 kF_Terminator = 0xFFFFFFFF40 };41 unsigned int m_flags;42 43 32 btScalar m_hitFraction; 44 33 45 btTriangleRaycastCallback(const btVector3& from,const btVector3& to , unsigned int flags=0);34 btTriangleRaycastCallback(const btVector3& from,const btVector3& to); 46 35 47 36 virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex); -
code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp
r2907 r2908 26 26 27 27 #include "btVoronoiSimplexSolver.h" 28 #include <assert.h> 29 //#include <stdio.h> 28 30 29 31 #define VERTA 0 … … 36 38 { 37 39 38 btAssert(m_numVertices>0);40 assert(m_numVertices>0); 39 41 m_numVertices--; 40 42 m_simplexVectorW[index] = m_simplexVectorW[m_numVertices];
Note: See TracChangeset
for help on using the changeset viewer.