00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00033
00034
00035 #ifndef __VPVECTOR3D_H
00036 #define __VPVECTOR3D_H
00037
00038 #include <vppoint3d.h>
00039
00040
00042
00043
00044
00046
00047 class VPVector3D:public VPPoint3D {
00048 public:
00049 VPVector3D();
00050 VPVector3D(float xi, float yi, float zi);
00051 VPVector3D(const VPVector3D&);
00052 VPVector3D& operator=(const VPVector3D&);
00053
00054 int operator==(const VPVector3D&);
00055 int operator!=(const VPVector3D&);
00056
00057 VPPoint3D operator+(VPPoint3D);
00058
00059 VPPoint3D operator-(VPPoint3D);
00060
00061 VPVector3D operator+(const VPVector3D&);
00062 VPVector3D operator-(const VPVector3D&);
00063 VPVector3D operator-();
00064 VPVector3D operator*(const float&);
00065 VPVector3D operator/(const float&);
00066 VPVector3D operator*(const VPVector3D&);
00067
00068 VPVector3D& operator+=(const VPVector3D&);
00069 VPVector3D& operator-=(const VPVector3D&);
00070 VPVector3D& operator*=(const float&);
00071 VPVector3D& operator/=(const float&);
00072
00073 float vpDotProduct(const VPVector3D&);
00074
00075 VPVector3D vpCrossProduct(const VPVector3D&);
00076
00077 float vpModule();
00078
00079 void vpNormalize();
00080
00081 void vpSetVector3D(VPPoint3D p);
00082 void vpSetVector3D(float xx,float yy,float zz);
00083 void vpGetVector3D(float &xx,float &yy,float &zz);
00084 VPVector3D vpGetVector3D(void);
00085 float vpGetVector3DX(void);
00086 float vpGetVector3DY(void);
00087 float vpGetVector3DZ(void);
00088 };
00089
00090
00091
00092
00093 const VPVector3D VZERO ( 0.0, 0.0, 0.0 );
00094 const VPVector3D VX ( 1.0, 0.0, 0.0 );
00095 const VPVector3D VY ( 0.0, 1.0, 0.0 );
00096 const VPVector3D VZ ( 0.0, 0.0, 1.0 );
00097
00098 #endif