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