Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine  1.5.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
RayCast.hpp
1 #pragma once
2 
3 #include <Core/RaCore.hpp>
4 #include <Core/Types.hpp>
5 #include <Eigen/Core>
6 #include <vector>
7 
8 // useful : http://www.realtimerendering.com/intersections.html
9 
10 namespace Ra {
11 namespace Core {
12 // Low-level intersection functions of line versus various abstract shapes.
13 // All functions return true if there was a hit, false if not.
14 // If a ray starts inside the shape, the resulting hit will be at the ray's origin (t=0).
15 
16 namespace Geometry {
17 class TriangleMesh;
18 
20 bool RA_CORE_API RayCastAabb( const Ray& r,
21  const Core::Aabb& aabb,
22  Scalar& hitOut,
23  Vector3& normalOut );
24 
26 bool RA_CORE_API RayCastSphere( const Ray& r,
27  const Core::Vector3& center,
28  Scalar radius,
29  std::vector<Scalar>& hitsOut );
30 
32 bool RA_CORE_API RayCastPlane( const Ray& r,
33  const Core::Vector3& a,
34  const Core::Vector3& normal,
35  std::vector<Scalar>& hitsOut );
36 
38 bool RA_CORE_API RayCastCylinder( const Ray& r,
39  const Core::Vector3& a,
40  const Core::Vector3& b,
41  Scalar radius,
42  std::vector<Scalar>& hitsOut );
43 
45 bool RA_CORE_API RayCastTriangle( const Ray& r,
46  const Core::Vector3& a,
47  const Core::Vector3& b,
48  const Core::Vector3& c,
49  std::vector<Scalar>& hitsOut );
50 
51 bool RA_CORE_API RayCastTriangleMesh( const Ray& r,
52  const TriangleMesh& mesh,
53  std::vector<Scalar>& hitsOut,
54  std::vector<Vector3ui>& trianglesIdxOut );
55 } // namespace Geometry
56 } // namespace Core
57 } // namespace Ra
Definition: Cage.cpp:3