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
CzVec3.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_CVEC3_H__
00015 #define __CZ_CVEC3_H__
00016 
00017 #include "CzVec2.h"
00018 #include "CzSVec2.h"
00019 
00020 class CzVec3
00021 {
00022 public:
00023     float   x, y, z;
00024 
00025 private:
00026 public:
00027     CzVec3();
00028     CzVec3(float x, float y, float z);
00029 
00030     void            Set(float n);
00031     void            Add(CzVec3 const &v);
00032     void            Add(float v);
00033     void            Zero();
00034     void            One();
00035     void            Sub(CzVec3 const &v);
00036     void            Sub(float v);
00037     void            Invert();
00038     void            Mul(CzVec3 const &v);
00039     void            Mul(float v);
00040     float           Dot(CzVec3 const &v) const;
00041     CzVec3          Cross(CzVec3 const &v) const;
00042     void            Normalise();
00043     void            Clamp(float max_mag);
00044     void            Clamp(CzVec3 const &clamp);
00045     float           Mag() const;
00046     float           MagSquared() const;
00047     float           PointDistanceToLine(CzVec3 const &v0, CzVec3 const &v1, CzVec3& out) const;
00048     float           PointClosestToLine(CzVec3 const &v0, CzVec3 const &v1, CzVec3& out) const;
00049 
00050     bool            operator==	(CzVec3 const &v) const;
00051     bool            operator!=	(CzVec3 const &v) const;
00052     CzVec3          operator+	(CzVec3 const &v) const;
00053     CzVec3&         operator+=	(CzVec3 const &v);
00054     CzVec3          operator-	(CzVec3 const &v) const;
00055     CzVec3&         operator-=	(CzVec3 const &v);
00056     CzVec3          operator*	(CzVec3 const &v) const;
00057     CzVec3&         operator*=	(CzVec3 const &v);
00058     CzVec3          operator*	(float n) const;
00059     CzVec3&         operator*=	(float n);
00060     
00061     CzVec2          toVec2() const;
00062     CzSVec2         toSVec2() const;
00063 
00064 };
00065 
00066 
00067 #endif  // __CZ_CVEC3_H__
00068