Lines Matching refs:T
23 template<typename T>
28 T x_;
29 T y_;
30 T z_;
32 T data_[3];
36 Vector3(T x, T y, T z);
37 explicit Vector3(T* v);
41 T Dot(const Vector3<T>& other) const;
42 Vector3 Cross(const Vector3<T>& other) const;
43 T GetSqrLength() const;
44 T GetLength() const;
46 void SetValues(T x, T y, T z);
47 T Normalize();
49 Vector3& operator*=(const Vector3<T>& other);
50 Vector3& operator*=(T s);
51 Vector3 operator*(T s) const;
52 Vector3 operator+(const Vector3<T>& other) const;
53 Vector3& operator+=(const Vector3<T>& other);
54 Vector3& operator=(const Vector3<T>& other);
55 Vector3 operator-(const Vector3<T>& other) const;
56 T operator[](int index) const;
57 T& operator[](int index);
59 T* GetData();
66 template<typename T>
67 const Vector3<T> Vector3<T>::ZERO(0.0, 0.0, 0.0);
69 template<typename T>
70 Vector3<T>::Vector3() in Vector3()
77 template<typename T>
78 Vector3<T>::Vector3(T x, T y, T z) in Vector3()
85 template<typename T>
86 Vector3<T>::Vector3(T* v) in Vector3()
93 template<typename T>
94 Vector3<T>::~Vector3() in ~Vector3()
97 template<typename T>
98 Vector3<T> Vector3<T>::Normalized() const in Normalized()
100 Vector3<T> rNormalize(*this); in Normalized()
105 template<typename T>
106 T Vector3<T>::Dot(const Vector3<T>& other) const in Dot()
108 const T* oData = other.data_; in Dot()
109 T sum = data_[0] * oData[0]; in Dot()
115 template<typename T>
116 Vector3<T> Vector3<T>::Cross(const Vector3<T>& other) const in Cross()
118 T x = data_[0]; in Cross()
119 T y = data_[1]; in Cross()
120 T z = data_[2]; in Cross()
121 const T* oData = other.data_; in Cross()
122 T oX = oData[0]; in Cross()
123 T oY = oData[1]; in Cross()
124 T oZ = oData[2]; in Cross()
125 Vector3<T> rCross; in Cross()
130 template<typename T>
131 T Vector3<T>::GetSqrLength() const in GetSqrLength()
133 T x = data_[0]; in GetSqrLength()
134 T y = data_[1]; in GetSqrLength()
135 T z = data_[2]; in GetSqrLength()
139 template<typename T>
140 T Vector3<T>::GetLength() const in GetLength()
145 template<typename T>
146 void Vector3<T>::SetZero() in SetZero()
151 template<typename T>
152 void Vector3<T>::SetValues(T x, T y, T z) in SetValues()
159 template<typename T>
160 T Vector3<T>::Normalize() in Normalize()
162 T l = GetLength(); in Normalize()
163 if (MMI_EQ<T>(l, 0.0)) { in Normalize()
167 const T d = 1.0f / l; in Normalize()
174 template<typename T>
175 Vector3<T>& Vector3<T>::operator*=(const Vector3<T>& other)
177 const T* oData = other.data_;
184 template<typename T>
185 Vector3<T>& Vector3<T>::operator*=(T s)
193 template<typename T>
194 Vector3<T> Vector3<T>::operator*(T s) const
196 Vector3<T> rMulti(*this);
197 T* rData = rMulti.data_;
205 template<typename T>
206 Vector3<T> Vector3<T>::operator+(const Vector3<T>& other) const
208 Vector3<T> rVec = *this;
213 template<typename T>
214 Vector3<T>& Vector3<T>::operator+=(const Vector3<T>& other)
222 template<typename T>
223 Vector3<T>& Vector3<T>::operator=(const Vector3<T>& other)
231 template<typename T>
232 Vector3<T> Vector3<T>::operator-(const Vector3<T>& other) const
234 Vector3<T> rSub(*this);
235 T* rData = rSub.data_;
236 const T* oData = other.data_;
243 template<typename T>
244 T Vector3<T>::operator[](int index) const
249 template<typename T>
250 T& Vector3<T>::operator[](int index)
255 template<typename T>
256 inline bool Vector3<T>::operator==(const Vector3& other) const
258 const T* oData = other.data_;
260 …return (MMI_EQ<T>(data_[0], oData[0])) && (MMI_EQ<T>(data_[1], oData[1])) && (MMI_EQ<T>(data_[2], …
263 template<typename T>
264 inline T* Vector3<T>::GetData() in GetData()