Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

Vector4.h

00001 
00002 
00003 #ifndef __VECTOR4_H_
00004 #define __VECTOR4_H_
00005 /*
00006 Peon - Win32 Games Programming Library
00007 Copyright (C) 2002-2005 Erik Yuzwa
00008 
00009 This library is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU Library General Public
00011 License as published by the Free Software Foundation; either
00012 version 2 of the License, or (at your option) any later version.
00013 
00014 This library is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 Library General Public License for more details.
00018 
00019 You should have received a copy of the GNU Library General Public
00020 License along with this library; if not, write to the Free
00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023 Erik Yuzwa
00024 peon AT wazooinc DOT com
00025 */
00026 
00027 #include "Peonstdafx.h"
00028 
00029 namespace peon
00030 {
00037         class PEONMAIN_API Vector4
00038         {
00039         public:
00041                 float x;
00042 
00044                 float y;
00045 
00047                 float z;
00048 
00050                 float w;
00051 
00052                 Vector4(float x_ = 0.0f, float y_ = 0.0f, float z_ = 0.0f, float w_ = 0.0f);
00053                 ~Vector4();
00054 
00055                 void set(float x_, float y_, float z_, float w_);
00056                 float length(void);
00057                 void normalize(void);
00058 
00059                 // Static utility methods
00060                 static float distance(const Vector4 &v1, const Vector4 &v2);
00061                 static float dotProduct(const Vector4 &v1,  const Vector4 &v2 );
00062                 static Vector4 crossProduct(const Vector4 &v1, const Vector4 &v2);
00063 
00064                 // Operators...
00065                 Vector4 operator + (const Vector4 &other);
00066                 Vector4 operator - (const Vector4 &other);
00067                 Vector4 operator * (const Vector4 &other);
00068                 Vector4 operator / (const Vector4 &other);
00069 
00070                 Vector4 operator * (const float scalar);
00071                 friend Vector4 operator * (const float scalar, const Vector4 &other);
00072     
00073                 Vector4& operator = (const Vector4 &other);
00074                 Vector4& operator += (const Vector4 &other);
00075                 Vector4& operator -= (const Vector4 &other);
00076 
00077                 Vector4 operator + (void) const;
00078                 Vector4 operator - (void) const;
00079         };
00080 
00081 }
00082 
00083 #endif
00084 

Generated on Thu Dec 1 01:55:40 2005 for Peon by  doxygen 1.4.1