1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#ifndef _QUATERNIONS_H_
#define _QUATERNIONS_H_
using namespace std;
class XYZ{
public:
float x;
float y;
float z;
XYZ operator+(XYZ add);
XYZ operator-(XYZ add);
XYZ operator*(float add);
XYZ operator*(XYZ add);
XYZ operator/(float add);
void operator+=(XYZ add);
void operator-=(XYZ add);
void operator*=(float add);
void operator*=(XYZ add);
void operator/=(float add);
void operator=(float add);
bool operator==(XYZ add);
};
void CrossProduct(XYZ P, XYZ Q, XYZ *V);
void Normalise(XYZ *vectory);
bool PointInTriangle(XYZ *p, XYZ normal, XYZ *p1, XYZ *p2, XYZ *p3);
float LineFacetd(XYZ p1,XYZ p2,XYZ pa,XYZ pb,XYZ pc,XYZ n, XYZ *p);
float LineFacetd(XYZ *p1,XYZ *p2,XYZ *pa,XYZ *pb,XYZ *pc,XYZ *n, XYZ *p);
void ReflectVector(XYZ *vel, XYZ *n);
XYZ DoRotation(XYZ thePoint, float xang, float yang, float zang);
float findDistance(XYZ point1, XYZ point2);
float findLengthfast(XYZ point1);
float findDistancefast(XYZ point1, XYZ point2);
float dotproduct(XYZ point1, XYZ point2);
bool sphere_line_intersection(float x1, float y1, float z1,
float x2, float y2, float z2, float x3, float y3, float z3, float r);
#endif
|