]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/clouds3d/plane.hpp
A first attempt at making the clouds3d endian aware. Almost there.
[simgear.git] / simgear / scene / sky / clouds3d / plane.hpp
1 //------------------------------------------------------------------------------
2 // File : plane.hpp
3 //------------------------------------------------------------------------------
4 // GLVU : Copyright 1997 - 2002 
5 //        The University of North Carolina at Chapel Hill
6 //------------------------------------------------------------------------------
7 // Permission to use, copy, modify, distribute and sell this software and its 
8 // documentation for any purpose is hereby granted without fee, provided that 
9 // the above copyright notice appear in all copies and that both that copyright 
10 // notice and this permission notice appear in supporting documentation. 
11 // Binaries may be compiled with this software without any royalties or 
12 // restrictions. 
13 //
14 // The University of North Carolina at Chapel Hill makes no representations 
15 // about the suitability of this software for any purpose. It is provided 
16 // "as is" without express or implied warranty.
17
18 //=========================================================================
19 // plane.hpp
20 //=========================================================================
21
22 // PLANE EQUATION COEFFICIENT GENERATION FUNCTIONS
23 float* PlaneEquation(float P[4], 
24                      const float p0[3], const float p1[3], const float p2[3]);
25 float* PlaneEquation(float P[4], const float N[3], float Dist);
26 float* PlaneEquation(float P[4], const float N[3], const float pt[3]);
27
28 int PlanePtOutTest(const float P[4], const float Pt[3]);
29 int PlanePtInOutTest(const float P[4], const float Pt[3]);
30 float PlaneDistToPt(const float P[4], const float Pt[3]);
31
32 int PlaneRayIsect(const float P[4], const float Start[3], const float Dir[3]);
33 int PlaneRayIsect(const float P[4], const float Start[3], const float Dir[3], 
34                   float IsectPt[3]);
35 int ZPlaneLineIsect(float d, const float Start[3], const float Dir[3], 
36                     float IsectPt[3]);
37 int PlaneEdgeIsect(const float P[4], const float A[3], const float B[3]);
38 int PlaneEdgeIsect(const float P[4], const float A[3], const float B[3],
39                    float IsectPt[3]);
40
41 void XformPlane(const float M[16], float P[4]);
42
43 int PlaneMinMaxBoxOverlap(const float P[4], const float m[3], 
44                           const float M[3]);
45
46 int PlanesRayIsect(const float Planes[][4], int NumPlanes,
47                    const float Start[3], const float Dir[3], 
48                    float *InT, float *OutT);
49 int PlanesEdgeIsect(const float Planes[][4], int NumPlanes,
50                     const float A[3], const float B[3], 
51                     float *InT, float *OutT);