All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RayCasterIntersectionBuilder.h
1 // Copyright eeGeo Ltd (2012-2017), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Collision.h"
6 #include "VectorMath.h"
7 #include "RayMeshIntersectionResult.h"
8 #include "RayNodeIntersectionResult.h"
9 #include "RayCasterResult.h"
10 #include "VectorMath.h"
11 #include "IVerifyRaycastResultDelegate.h"
12 
13 #include <functional>
14 
15 namespace Eegeo
16 {
17  namespace Collision
18  {
19  struct RayCasterIntersectionBuilder : public std::unary_function<RayNodeIntersectionResult, bool>
20  {
22  const dv3& rayOriginEcef,
23  const dv3& rayDirection,
24  float environmentFlatteningScale,
25  const IVerifyRaycastResultDelegate& validIntersectionVerfification);
26 
27  virtual bool operator () (const RayNodeIntersectionResult& nodeIntersection) = 0;
28 
29  protected:
30  RayCasterResult BuildResult(const RayMeshIntersectionResult& intersection, const CollisionBvh& bvh) const;
31  const IVerifyRaycastResultDelegate& m_intersectionValidator;
32  const dv3 m_rayOriginEcef;
33  const dv3 m_rayDirection;
34  const float m_environmentFlatteningScale;
35  };
36  }
37 }