ADTF_DISPLAY_TOOLBOX  3.8.0 (ADTF 3.14.3)
vector3.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include <adtf_utils.h>
11 
12 namespace adtf
13 {
14 
15 namespace disptb
16 {
17 
18 namespace graphicslib
19 {
20 
21 namespace dengar
22 {
23 
29 class cVector3 : public IVector3
30 {
31 private:
32  tFloat64 x;
33  tFloat64 y;
34  tFloat64 z;
35 
36  static const tFloat64 nullScalar;
37  static const tFloat64 oneScalar;
38 
39 public:
40  static const cVector3 Null;
41  static const cVector3 One;
42 
43 public:
48 
54  cVector3(const IVector3* pVector3);
55 
63  cVector3(const tFloat64 f64X, const tFloat64 f64Y, const tFloat64 f64Z);
64 
68  tVoid Release();
69 
75  OPT_INLINE void Set(const cVector3& Vector);
76 
82  OPT_INLINE void Set(const tFloat64 Value);
83 
91  OPT_INLINE void Set(const tFloat64 f64X, const tFloat64 f64Y, const tFloat64 f64Z);
92 
96  OPT_INLINE void Zero();
97 
103  OPT_INLINE void Add(const cVector3& Vector);
104 
110  OPT_INLINE void Sub(const cVector3& Vector);
111 
117  OPT_INLINE void Scale(const tFloat64 Value);
118 
124  OPT_INLINE void Scale(const cVector3& Vector);
125 
126  //void Rotate(const cVector3& Vector);
127 
136  OPT_INLINE cVector3 Scalar(const cVector3& Vector) const;
137 
145  OPT_INLINE cVector3 Multiply(const cVector3& Vector) const;
146 
147  //OPT_INLINE cVector3 Multiply(const cMatrix& Matrix) const;
148 
154  tFloat Length() const;
155 
159  void Normalize();
160 
164  void Dump();
165 
171  tFloat64 GetX() const;
172 
179  tVoid SetX(tFloat64 xValue);
180 
186  tFloat64 GetY() const;
187 
194  tVoid SetY(tFloat64 f64YValue);
195 
201  tFloat64 GetZ() const;
202 
209  tVoid SetZ(tFloat64 zValue);
210 
219 
226  { return cVector3(-x, -y, -z); };
227 
236  friend cVector3 operator+(const cVector3& v1, const cVector3& v2);
237 
246  friend cVector3 operator-(const cVector3& v1, const cVector3& v2);
247 
256  friend cVector3 operator*(const cVector3& v1, const cVector3& v2);
257 
266  friend cVector3 operator*(const tFloat64 s, const cVector3& v);
267 
276  friend cVector3 operator*(const cVector3& v, const tFloat64 s);
277 
286  friend cVector3 operator/(const cVector3& v, const tFloat64 s);
287 
294  friend void operator+=(cVector3& v1, const cVector3& v2);
295 
302  friend void operator-=(cVector3& v1, const cVector3& v2);
303 
312  friend bool operator==(const cVector3& v1, const cVector3& v2);
313 
322  friend bool operator!=(const cVector3& v1, const cVector3& v2);
323 
329  explicit operator IVector3*()
330  {
331  return static_cast<IVector3*>(this);
332  }
333 };
334 
335 }
336 
337 using dengar::cVector3;
338 }
339 
340 }
341 
342 }
343 
OPT_INLINE void Sub(const cVector3 &Vector)
Subtract the given vector from the current one.
OPT_INLINE void Zero()
Set vector to zero.
OPT_INLINE void Set(const tFloat64 Value)
Set vector to the given value.
tVoid Release()
Releases this vector.
cVector3 operator-(void)
Negate the current vector.
Definition: vector3.h:225
friend cVector3 operator*(const tFloat64 s, const cVector3 &v)
Scalar product of vector and scalar.
OPT_INLINE void Scale(const tFloat64 Value)
Scale the current vector by the given value.
static const tFloat64 oneScalar
scalar identity value
Definition: vector3.h:37
tVoid SetZ(tFloat64 zValue)
Set the current z value to the given one.
tVoid SetX(tFloat64 xValue)
Set the current x value to the given one.
friend bool operator==(const cVector3 &v1, const cVector3 &v2)
Comparison for equality of two vectors.
OPT_INLINE void Set(const cVector3 &Vector)
Set vector to the given value.
friend cVector3 operator+(const cVector3 &v1, const cVector3 &v2)
Add two vectors.
friend cVector3 operator/(const cVector3 &v, const tFloat64 s)
Divide vector through scalar.
cVector3 operator=(const cVector3 &v)
Set the current vector to the given one.
tFloat64 GetY() const
gets the value of the y component
cVector3(const IVector3 *pVector3)
constructor from IVector3
OPT_INLINE cVector3 Multiply(const cVector3 &Vector) const
Cross product of the current vector and the given one.
void Dump()
Dump the current vector to stdout.
tFloat64 GetZ() const
gets the value of the z component
friend void operator-=(cVector3 &v1, const cVector3 &v2)
Subtraction of two vectors.
friend bool operator!=(const cVector3 &v1, const cVector3 &v2)
Comparison for inequality of two vectors.
tFloat64 x
X coordinate of vector.
Definition: vector3.h:32
friend void operator+=(cVector3 &v1, const cVector3 &v2)
Add two vectors.
cVector3(const tFloat64 f64X, const tFloat64 f64Y, const tFloat64 f64Z)
Constructor.
tFloat Length() const
Calculate the length of the current vector.
friend cVector3 operator-(const cVector3 &v1, const cVector3 &v2)
Subtract two vectors.
tVoid SetY(tFloat64 f64YValue)
Set the current y value to the given one.
tFloat64 z
Z coordinate of vector.
Definition: vector3.h:34
OPT_INLINE void Scale(const cVector3 &Vector)
Scale the current vector by the given one.
friend cVector3 operator*(const cVector3 &v1, const cVector3 &v2)
Cross-product of two vectors.
static const tFloat64 nullScalar
scalar null value
Definition: vector3.h:36
OPT_INLINE void Add(const cVector3 &Vector)
Add the given vector to the current one.
static const cVector3 One
Identity vector.
Definition: vector3.h:41
OPT_INLINE cVector3 Scalar(const cVector3 &Vector) const
Multiply every coordinate of the current vector with the corresponding coordinate from the given one.
tFloat64 y
Y coordinate of vector.
Definition: vector3.h:33
friend cVector3 operator*(const cVector3 &v, const tFloat64 s)
Scalar product of vector and scalar.
OPT_INLINE void Set(const tFloat64 f64X, const tFloat64 f64Y, const tFloat64 f64Z)
Set vector to the given value.
tFloat64 GetX() const
gets the value of the x component
static const cVector3 Null
Null vector.
Definition: vector3.h:40
void Normalize()
Normalize the current vector so that the length becomes one.
Main namespace.
Copyright © Audi Electronics Venture GmbH.