Changeset 2907 for code/branches/questsystem5/src/bullet/BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp
- Timestamp:
- Apr 8, 2009, 12:36:08 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
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 }
Note: See TracChangeset
for help on using the changeset viewer.