All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RayNodeIntersectionResult.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Collision.h"
6 #include "VectorMath.h"
7 
8 namespace Eegeo
9 {
10  namespace Collision
11  {
13  {
15  : m_rayOrigin(v3::Zero())
16  , m_rayDirection(v3::Zero())
17  , m_skewedRayParamScale(0.f)
18  , m_pCollisionBvh(NULL)
19  , m_pNode(NULL)
20  , m_bIntersects(false)
21  , m_intersectionParam(0.f)
22  {}
23 
24  RayNodeIntersectionResult(const v3& rayOrigin, const v3& rayDirection, float skewedRayParamScale, const CollisionBvh& collisionBvh, const CollisionBvhNode& node, bool intersects, float intersectionParam)
25  : m_rayOrigin(rayOrigin)
26  , m_rayDirection(rayDirection)
27  , m_skewedRayParamScale(skewedRayParamScale)
28  , m_pCollisionBvh(&collisionBvh)
29  , m_pNode(&node)
30  , m_bIntersects(intersects)
31  , m_intersectionParam(intersectionParam)
32  {
33  }
34 
35  const v3& RayOrigin() const { return m_rayOrigin; }
36  const v3& RayDirection() const { return m_rayDirection; }
37  float SkewedRayParamScale() const { return m_skewedRayParamScale; }
38  const CollisionBvh& Bvh() const { return *m_pCollisionBvh; }
39  const CollisionBvhNode& Node() const { return *m_pNode; }
40  bool Intersects() const { return m_bIntersects; }
41  float IntersectionParam() const { return m_intersectionParam; }
42  private:
43  v3 m_rayOrigin;
44  v3 m_rayDirection;
45  float m_skewedRayParamScale;
46  const CollisionBvh* m_pCollisionBvh;
47  const CollisionBvhNode* m_pNode;
48  bool m_bIntersects;
49  float m_intersectionParam;
50  };
51  }
52 }