Free Electron
algorithms.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __math_algorithms_h__
8 #define __math_algorithms_h__
9 
10 namespace fe
11 {
12 
13 FE_DL_PUBLIC
14 BWORD intersectRaySphere( Real *a_collisionDistance,
15  const SpatialVector &a_rayRoot,
16  const SpatialVector &a_rayDirection,
17  const SpatialVector &a_sphereCenter,
18  const Real &a_sphereRadius);
19 
20 
21 FE_DL_PUBLIC
22 BWORD intersectLinePlane( SpatialVector &a_intersection,
23  BWORD a_loBound, BWORD a_hiBound,
24  const SpatialVector &a_lineLo,
25  const SpatialVector &a_lineHi,
26  const SpatialVector &a_pointOnPlane,
27  const SpatialVector &a_planeNormal);
28 
29 
30 FE_DL_PUBLIC
31 BWORD intersectRayPlane( SpatialVector &a_intersection,
32  const SpatialVector &a_lineLo,
33  const SpatialVector &a_lineHi,
34  const SpatialVector &a_pointOnPlane,
35  const SpatialVector &a_planeNormal);
36 
37 
38 FE_DL_PUBLIC
39 BWORD intersectLineTriangle( SpatialVector &a_intersection,
40  BWORD a_loBound, BWORD a_hiBound,
41  const SpatialVector &a_lineLo,
42  const SpatialVector &a_lineHi,
43  const SpatialVector &a_triA,
44  const SpatialVector &a_triB,
45  const SpatialVector &a_triC,
46  const SpatialVector &a_triNormal);
47 
48 
49 FE_DL_PUBLIC
50 BWORD intersectRayTriangle( SpatialVector &a_intersection,
51  const SpatialVector &a_lineLo,
52  const SpatialVector &a_lineHi,
53  const SpatialVector &a_triA,
54  const SpatialVector &a_triB,
55  const SpatialVector &a_triC);
56 
57 FE_DL_PUBLIC
58 BWORD intersectTrianglePlane(SpatialVector &a_intersectionA,
59  SpatialVector &a_intersectionB,
60  const SpatialVector &a_triA,
61  const SpatialVector &a_triB,
62  const SpatialVector &a_triC,
63  const SpatialVector &a_pointOnPlane,
64  const SpatialVector &a_planeNormal);
65 
66 FE_DL_PUBLIC
67 BWORD pointInTriangle( const SpatialVector &a_point,
68  const SpatialVector &a_triA,
69  const SpatialVector &a_triB,
70  const SpatialVector &a_triC);
71 
72 FE_DL_PUBLIC
73 Vector2 uvDelta( const Vector2 &a_uv0,
74  const Vector2 &a_uv1);
75 
76 FE_DL_PUBLIC
77 BWORD triangleDuDv( Vector<3,Real> &a_du,
78  Vector<3,Real> &a_dv,
79  const Vector<3,Real> &a_point0,
80  const Vector<3,Real> &a_point1,
81  const Vector<3,Real> &a_point2,
82  const Vector2 &a_uv0,
83  const Vector2 &a_uv1,
84  const Vector2 &a_uv2);
85 
86 FE_DL_PUBLIC
87 BWORD tangentFromDuDvN( Vector<3,Real> &a_tangent,
88  const Vector<3,Real> &a_du,
89  const Vector<3,Real> &a_dv,
90  const Vector<3,Real> &a_normal);
91 
92 FE_DL_PUBLIC
93 void randomRealSeed( const U32 &a_seed);
94 
95 FE_DL_PUBLIC
96 Real randomReal( const Real &a_min,
97  const Real &a_max);
98 
99 FE_DL_PUBLIC
100 Real randomRealReentrant( U32* a_pSeed,
101  const Real &a_min,
102  const Real &a_max);
103 
104 
105 } /* namespace */
106 
107 #endif /* __math_algorithms_h__ */
108 
kernel
Definition: namespace.dox:3