Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members |
00001 // Copyright 2006-2011 by Kat'Oun 00002 00003 #ifndef _VECTOR_3D_H_ 00004 #define _VECTOR_3D_H_ 00005 00006 #include <EngineConfig.h> 00007 #include <core/Types.h> 00008 00009 namespace core 00010 { 00011 00013 class ENGINE_PUBLIC_EXPORT vector3d 00014 { 00015 public: 00016 00017 vector3d(); 00018 vector3d(f32 nx, f32 ny, f32 nz); 00019 vector3d(const vector3d& other); 00020 00021 vector3d operator-() const; 00022 00023 vector3d& operator=(const vector3d& other); 00024 00025 vector3d operator+(const vector3d& other) const; 00026 vector3d& operator+=(const vector3d& other); 00027 00028 vector3d operator-(const vector3d& other) const; 00029 vector3d& operator-=(const vector3d& other); 00030 00031 vector3d operator*(const vector3d& other) const; 00032 vector3d& operator*=(const vector3d& other); 00033 vector3d operator*(const f32 v) const; 00034 vector3d& operator*=(const f32 v); 00035 00036 vector3d operator/(const vector3d& other) const; 00037 vector3d& operator/=(const vector3d& other); 00038 vector3d operator/(const f32 v) const; 00039 vector3d& operator/=(const f32 v); 00040 00041 bool operator==(const vector3d& other) const; 00042 bool operator!=(const vector3d& other) const; 00043 00044 void set(const f32 nx, const f32 ny, const f32 nz); 00045 void set(const vector3d& other); 00046 00047 f32* get(); 00048 const f32* get() const; 00049 00051 void invert(); 00052 00054 vector3d& normalize(); 00055 00057 f32 getLength() const; 00058 00062 f32 getLengthSQ() const; 00063 00065 void setLength(f32 newLength); 00066 00068 f32 dotProduct(const vector3d& other) const; 00069 00073 vector3d crossProduct(const vector3d& p) const; 00074 00077 f32 getDistanceFrom(const vector3d& other) const; 00078 00081 f32 getDistanceFromSQ(const vector3d& other) const; 00082 00088 bool isBetweenPoints(const vector3d& begin, const vector3d& end) const; 00089 00091 static const vector3d ORIGIN_3D; 00092 00094 static const vector3d UNIT_X; 00095 00097 static const vector3d UNIT_Y; 00098 00100 static const vector3d UNIT_Z; 00101 00103 static const vector3d NEGATIVE_UNIT_X; 00104 00106 static const vector3d NEGATIVE_UNIT_Y; 00107 00109 static const vector3d NEGATIVE_UNIT_Z; 00110 00111 static const vector3d UNIT_SCALE; 00112 00113 f32 X, Y, Z; 00114 }; 00115 00116 } // end namespace core 00117 00118 #endif
The KG Game Engine
Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:04 by
Doxygen
(1.7.4)
|