~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to NuxCore/Math/Point3D.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 19:25:37 UTC
  • Revision ID: neil.patel@canonical.com-20100901192537-mfz7rm6q262pewg6
Import and build NuxCore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef POINT3D_H
 
2
#define POINT3D_H
 
3
 
 
4
NAMESPACE_BEGIN
 
5
 
 
6
template<typename T>
 
7
class Point3D
 
8
{
 
9
public:
 
10
    Point3D();
 
11
    ~Point3D();
 
12
    Point3D(const Point3D& Pt);
 
13
    Point3D(T x, T y, T z);
 
14
 
 
15
    void Set(T X, T Y, T Z);
 
16
    bool operator == (const Point3D<T>& Pt) const;
 
17
    bool operator != (const Point3D<T>& Pt) const;
 
18
 
 
19
    T x, y, z;
 
20
};
 
21
 
 
22
template<typename T>
 
23
Point3D<T>::Point3D()
 
24
{
 
25
    x = 0;
 
26
    y = 0;
 
27
    z = 0;
 
28
}
 
29
 
 
30
template<typename T>
 
31
Point3D<T>::~Point3D()
 
32
{
 
33
 
 
34
}
 
35
 
 
36
template<typename T>
 
37
Point3D<T>::Point3D(const Point3D& Pt)
 
38
{
 
39
    x = Pt.x;
 
40
    y = Pt.y;
 
41
    z = Pt.z;
 
42
}
 
43
 
 
44
template<typename T>
 
45
Point3D<T>::Point3D(T X, T Y, T Z)
 
46
{
 
47
    x = X;
 
48
    y = Y;
 
49
    z = Z;
 
50
}
 
51
 
 
52
template<typename T>
 
53
void Point3D<T>::Set(T X, T Y, T Z)
 
54
{
 
55
    x = X;
 
56
    y = Y;
 
57
    z = Z;
 
58
}
 
59
 
 
60
template<typename T>
 
61
bool Point3D<T>::operator == (const Point3D<T>& Pt) const
 
62
{
 
63
    if((x == Pt.x) &&
 
64
        (y == Pt.y) &&
 
65
        (z == Pt.z))
 
66
    {
 
67
        return true;
 
68
    }
 
69
    return false;
 
70
}
 
71
 
 
72
template<typename T>
 
73
bool Point3D<T>::operator != (const Point3D<T>& Pt) const
 
74
{
 
75
    return !((*this) == Pt);
 
76
}
 
77
 
 
78
NAMESPACE_END
 
79
 
 
80
#endif // POINT3D_H