diff options
Diffstat (limited to 'extern/bullet/Bullet/NarrowPhaseCollision/PointCollector.h')
-rw-r--r-- | extern/bullet/Bullet/NarrowPhaseCollision/PointCollector.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/extern/bullet/Bullet/NarrowPhaseCollision/PointCollector.h b/extern/bullet/Bullet/NarrowPhaseCollision/PointCollector.h new file mode 100644 index 00000000000..f39fa090ae4 --- /dev/null +++ b/extern/bullet/Bullet/NarrowPhaseCollision/PointCollector.h @@ -0,0 +1,36 @@ +#ifndef POINT_COLLECTOR_H +#define POINT_COLLECTOR_H + +#include "DiscreteCollisionDetectorInterface.h" + + + +struct PointCollector : public DiscreteCollisionDetectorInterface::Result +{ + + + SimdVector3 m_normalOnBInWorld; + SimdVector3 m_pointInWorld; + SimdScalar m_distance;//negative means penetration + + bool m_hasResult; + + PointCollector () + : m_hasResult(false),m_distance(1e30f) + { + } + + virtual void AddContactPoint(const SimdVector3& normalOnBInWorld,const SimdVector3& pointInWorld,float depth) + { + if (depth< m_distance) + { + m_hasResult = true; + m_normalOnBInWorld = normalOnBInWorld; + m_pointInWorld = pointInWorld; + //negative means penetration + m_distance = depth; + } + } +}; + +#endif //POINT_COLLECTOR_H
\ No newline at end of file |