1
// Wild Magic Source Code
3
// http://www.geometrictools.com
4
// Copyright (c) 1998-2007
6
// This library is free software; you can redistribute it and/or modify it
7
// under the terms of the GNU Lesser General Public License as published by
8
// the Free Software Foundation; either version 2.1 of the License, or (at
9
// your option) any later version. The license is available for reading at
10
// either of the locations:
11
// http://www.gnu.org/copyleft/lgpl.html
12
// http://www.geometrictools.com/License/WildMagicLicense.pdf
13
// The license applies to versions 0 through 4 of Wild Magic.
15
// Version: 4.0.0 (2006/06/28)
20
#include "Wm4FoundationLIB.h"
21
#include "Wm4TRVector.h"
27
class RVector3 : public TRVector<3,ISIZE>
32
RVector3 (const RVector3& rkV);
35
RVector3 (const TRVector<3,ISIZE>& rkV)
37
// The inline body is here because of an apparent MSVC++ .NET 2002
38
// compiler bug. If placed in the *.inl file, the compiler complains:
40
// error C2244: 'Wm4::RVector3<>::__ctor' : unable to match function
41
// definition to an existing declaration
43
// 'Wm4::RVector3<>::RVector3(const Wm4::TRVector<3,> &)'
44
// existing declarations
45
// 'Wm4::RVector3<>::RVector3(const Wm4::TRational<> &,
46
// const Wm4::TRational<> &)'
47
// 'Wm4::RVector3<>::RVector3(const Wm4::TRVector<3,> &)'
48
// 'Wm4::RVector3<>::RVector3(const Wm4::RVector3<> &)'
49
// 'Wm4::RVector3<>::RVector3(void)'
50
// The "definition" is in the "existing declarations" list, so I do
51
// not know what the compiler is complaining about.
53
m_akTuple[0] = rkV[0];
54
m_akTuple[1] = rkV[1];
55
m_akTuple[2] = rkV[2];
58
RVector3 (const TRVector<3,ISIZE>& rkV);
61
RVector3 (const TRational<ISIZE>& rkX, const TRational<ISIZE>& rkY,
62
const TRational<ISIZE>& rkZ);
65
TRational<ISIZE> X () const;
66
TRational<ISIZE>& X ();
67
TRational<ISIZE> Y () const;
68
TRational<ISIZE>& Y ();
69
TRational<ISIZE> Z () const;
70
TRational<ISIZE>& Z ();
73
RVector3& operator= (const RVector3& rkV);
76
RVector3& operator= (const TRVector<3,ISIZE>& rkV)
78
// The inline body is here because of an apparent MSVC++ .NET 2002
79
// compiler bug. If placed in the *.inl file, the compiler complains:
81
// error C2244: 'Wm4::RVector3<>::operator`='' : unable to match
82
// function definition to an existing declaration
84
// 'Wm4::RVector3<> &Wm4::RVector3<>::operator =(
85
// const Wm4::TRVector<3,> &)'
86
// existing declarations
87
// 'Wm4::RVector3<> &Wm4::RVector3<>::operator =(
88
// const Wm4::TRVector<3,> &)'
89
// 'Wm4::RVector3<> &Wm4::RVector3<>::operator =(
90
// const Wm4::RVector3<> &)'
92
m_akTuple[0] = rkV[0];
93
m_akTuple[1] = rkV[1];
94
m_akTuple[2] = rkV[2];
98
RVector3& operator= (const TRVector<3,ISIZE>& rkV);
101
// returns Dot(this,V)
102
TRational<ISIZE> Dot (const RVector3& rkV) const;
104
// returns Cross(this,V)
105
RVector3 Cross (const RVector3& rkV) const;
107
// returns Dot(this,Cross(U,V))
108
TRational<ISIZE> TripleScalar (const RVector3& rkU, const RVector3& rkV)
112
using TRVector<3,ISIZE>::m_akTuple;
115
#include "Wm4RVector3.inl"