00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _VECTOR2D_H
00026 #define _VECTOR2D_H
00027
00028 #ifdef WIN32
00029 #include <windows.h>
00030 #endif
00031
00032 #include "build.h"
00033
00034
00035
00036 namespace ngn
00037 {
00038 namespace core
00039 {
00040
00044 class NGN_API Vector2df
00045 {
00046 public:
00048 Vector2df()
00049 {
00050 x = y = 0.0f;
00051 }
00052 Vector2df( const Vector2df& other )
00053 {
00054 x = other.x;
00055 y = other.y;
00056 }
00057 Vector2df(float X, float Y)
00058 {
00059 x = X;
00060 y = Y;
00061 }
00063 Vector2df operator+(Vector2df V)
00064 {
00065 return Vector2df(V.x + x, V.y + y);
00066 }
00067
00068
00069 Vector2df operator-(Vector2df vVector)
00070 {
00071 return Vector2df(x - vVector.x, y - vVector.y);
00072 }
00073
00074 Vector2df operator*(float num)
00075 {
00076 return Vector2df(x * num, y * num);
00077 }
00078
00079 Vector2df operator/(float num)
00080 {
00081 return Vector2df(x / num, y / num);
00082 }
00083
00084
00085 float x, y;
00086 };
00087
00088
00089
00090 struct Vector2di
00091 {
00092 int x,y;
00093 };
00094
00095
00096
00097
00098
00099 }
00100 }
00101
00102 #endif
00103