6 #include "VectorMath.h"
7 #include "CollisionBvhNode.h"
8 #include "RayNodeIntersectionResult.h"
9 #include "IntersectionTests.h"
10 #include "CollisionBvh.h"
21 : m_collisionBvh(collisionBvh)
22 , m_rayOrigin(rayOrigin)
23 , m_rayDirection(rayDirection)
24 , m_skewedParamScale(skewedParamScale)
33 bool intersects = Geometry::IntersectionTests::SphereIntersectsWithRay(sphere, m_rayOrigin, m_rayDirection, t);
34 t *= m_skewedParamScale;
35 RayNodeIntersectionResult result(m_rayOrigin, m_rayDirection, m_skewedParamScale, m_collisionBvh, candidate, intersects, t);
43 const float m_skewedParamScale;
49 : m_collisionBvh(collisionBvh)
50 , m_rayOrigin(rayOrigin)
51 , m_rayDirection(rayDirection)
52 , m_lineSegmentLength(lineSegmentLength)
53 , m_skewedParamScale(skewedParamScale)
63 bool intersectsRay = Geometry::IntersectionTests::SphereIntersectsWithRay(sphere, m_rayOrigin, m_rayDirection, t);
64 t *= m_skewedParamScale;
65 bool intersectsLineSegment = intersectsRay && (t <= m_lineSegmentLength);
66 RayNodeIntersectionResult result(m_rayOrigin, m_rayDirection, m_skewedParamScale, m_collisionBvh, candidate, intersectsLineSegment, t);
74 const float m_lineSegmentLength;
75 const float m_skewedParamScale;
82 return testResult.Intersects();