Radium Engine  1.5.20
Loading...
Searching...
No Matches
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
10namespace Ra {
11namespace 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
16namespace Geometry {
17class TriangleMesh;
18
20bool RA_CORE_API RayCastAabb( const Ray& r,
21 const Core::Aabb& aabb,
22 Scalar& hitOut,
23 Vector3& normalOut );
24
26bool RA_CORE_API RayCastSphere( const Ray& r,
27 const Core::Vector3& center,
28 Scalar radius,
29 std::vector<Scalar>& hitsOut );
30
32bool RA_CORE_API RayCastPlane( const Ray& r,
33 const Core::Vector3& a,
34 const Core::Vector3& normal,
35 std::vector<Scalar>& hitsOut );
36
38bool 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
45bool 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
51bool 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
@ Geometry
"Geometry" render objects are those loaded using Radium::IO and generated by GeometrySystem
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3