AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzVec4.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #ifndef __CZ_CVEC4_H__
00015 #define __CZ_CVEC4_H__
00016 
00017 #include "CzVec2.h"
00018 #include "CzVec3.h"
00019 #include "CzSVec2.h"
00020 
00021 class CzVec4
00022 {
00023 public:
00024     float   x, y, z, w;
00025 
00026 private:
00027 public:
00028     CzVec4();
00029     CzVec4(float x, float y, float z, float w);
00030 
00031     void            Set(float n);
00032     void            Add(CzVec4 const &v);
00033     void            Add(float v);
00034     void            Zero();
00035     void            One();
00036     void            Sub(CzVec4 const &v);
00037     void            Sub(float v);
00038     void            Invert();
00039     void            Mul(CzVec4 const &v);
00040     void            Mul(float v);
00041     float           Dot(CzVec4 const &v) const;
00042     void            Normalise();
00043     void            Clamp(float max_mag);
00044     void            Clamp(CzVec4& clamp);
00045     float           Mag() const;
00046     float           MagSquared() const;
00047 
00048     bool            operator==	(CzVec4 const &v) const;
00049     bool            operator!=	(CzVec4 const &v) const;
00050     CzVec4          operator+	(CzVec4 const &v) const;
00051     CzVec4&         operator+=	(CzVec4 const &v);
00052     CzVec4          operator-	(CzVec4 const &v) const;
00053     CzVec4&         operator-=	(CzVec4 const &v);
00054     CzVec4          operator*	(CzVec4 const &v) const;
00055     CzVec4&         operator*=	(CzVec4 const &v);
00056     CzVec4          operator*	(float n) const;
00057     CzVec4&         operator*=	(float n);
00058     
00059     CzVec2          toVec2() const;
00060     CzVec3          toVec3() const;
00061     CzSVec2         toSVec2() const;
00062 
00063 };
00064 
00065 
00066 #endif  // __CZ_CVEC4_H__
00067