Changeset 2908 for code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.