Lines Matching refs:T

25 template<typename T>
30 T x_;
31 T y_;
33 T data_[2];
37 Vector2(T x, T y);
38 explicit Vector2(const T* v);
42 T Dot(const Vector2<T>& other) const;
43 T Cross(const Vector2<T>& other) const;
45 Vector2 operator-(const Vector2<T>& other) const;
46 Vector2 operator+(const Vector2<T>& other) const;
47 Vector2 operator/(T scale) const;
48 Vector2 operator*(T scale) const;
49 Vector2 operator*(const Vector2<T>& other) const;
50 Vector2& operator*=(const Vector2<T>& other);
51 Vector2& operator+=(const Vector2<T>& other);
53 T operator[](int index) const;
54 T& operator[](int index);
57 bool IsNearEqual(const Vector2& other, T threshold = std::numeric_limits<T>::epsilon()) const;
59 T* GetData();
61 T GetLength() const;
62 T GetSqrLength() const;
63 T Normalize();
71 template<typename T>
72 Vector2<T>::Vector2() in Vector2()
75 template<typename T>
76 Vector2<T>::Vector2(T x, T y) in Vector2()
82 template<typename T>
83 Vector2<T>::Vector2(const T* v) in Vector2()
89 template<typename T>
90 Vector2<T>::~Vector2() in ~Vector2()
93 template<typename T>
94 Vector2<T> Vector2<T>::Normalized() const in Normalized()
96 Vector2<T> rNormalize(*this); in Normalized()
101 template<typename T>
102 T Vector2<T>::Dot(const Vector2<T>& other) const in Dot()
104 const T* oData = other.data_; in Dot()
105 T sum = data_[0] * oData[0]; in Dot()
110 template<typename T>
111 T Vector2<T>::Cross(const Vector2<T>& other) const in Cross()
113 const T* oData = other.data_; in Cross()
118 template<typename T>
119 Vector2<T> Vector2<T>::operator-() const
121 Vector2<T> rNeg;
122 T* rData = rNeg.data_;
128 template<typename T>
129 Vector2<T> Vector2<T>::operator-(const Vector2<T>& other) const
131 Vector2<T> rSub(*this);
132 T* rData = rSub.data_;
133 const T* oData = other.data_;
139 template<typename T>
140 Vector2<T> Vector2<T>::operator+(const Vector2<T>& other) const
142 Vector2<T> rAdd(*this);
146 template<typename T>
147 Vector2<T> Vector2<T>::operator/(T scale) const
152 const T invScale = 1.0f / scale;
156 template<typename T>
157 Vector2<T> Vector2<T>::operator*(T scale) const
159 Vector2<T> rMult(*this);
160 T* rData = rMult.data_;
167 template<typename T>
168 Vector2<T> Vector2<T>::operator*(const Vector2<T>& other) const
170 Vector2<T> rMult(*this);
174 template<typename T>
175 Vector2<T>& Vector2<T>::operator*=(const Vector2<T>& other)
177 const T* oData = other.data_;
183 template<typename T>
184 Vector2<T>& Vector2<T>::operator+=(const Vector2<T>& other)
191 template<typename T>
192 Vector2<T>& Vector2<T>::operator=(const Vector2<T>& other)
194 const T* oData = other.data_;
200 template<typename T>
201 T Vector2<T>::operator[](int index) const
206 template<typename T>
207 inline T& Vector2<T>::operator[](int index)
212 template<typename T>
213 inline bool Vector2<T>::operator==(const Vector2& other) const
215 const T* oData = other.data_;
217 return (MMI_EQ<T>(data_[0], oData[0])) && (MMI_EQ<T>(data_[1], oData[1]));
220 template<typename T>
221 inline bool Vector2<T>::operator!=(const Vector2& other) const
223 const T* oData = other.data_;
225 return (!MMI_EQ<T>(data_[0], oData[0])) || (!MMI_EQ<T>(data_[1], oData[1]));
228 template<typename T>
229 bool Vector2<T>::IsNearEqual(const Vector2& other, T threshold) const in IsNearEqual()
231 const T* otherData = other.data_; in IsNearEqual()
233 …return (MMI_EQ<T>(data_[0], otherData[0], threshold)) && (MMI_EQ<T>(data_[1], otherData[1], thresh… in IsNearEqual()
236 template<typename T>
237 inline T* Vector2<T>::GetData() in GetData()
242 template<typename T>
243 T Vector2<T>::GetLength() const in GetLength()
248 template<typename T>
249 T Vector2<T>::GetSqrLength() const in GetSqrLength()
251 T sum = data_[0] * data_[0]; in GetSqrLength()
256 template<typename T>
257 T Vector2<T>::Normalize() in Normalize()
259 T l = GetLength(); in Normalize()
260 if (MMI_EQ<T>(l, 0.0)) { in Normalize()
264 const T invLen = 1.0f / l; in Normalize()
271 template<typename T>
272 bool Vector2<T>::IsInfinite() const in IsInfinite()
277 template<typename T>
278 bool Vector2<T>::IsNaN() const in IsNaN()