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
CzMatrix4.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_MATRIX4_H__
00015 #define __CZ_MATRIX4_H__
00016 
00017 #include "CzVec3.h"
00018 
00019 class CzMatrix4
00020 {
00021 private:
00022 public:
00023     float       m[4][4];
00024 private:
00025 public:
00026                 CzMatrix4();
00027                 CzMatrix4(CzMatrix4* m0);
00028 
00029     void        Clear();
00030     void        Copy(CzMatrix4* m0);
00031     void        Invert();
00032     void        Transpose();
00033     void        Transpose4x4();
00034     void        ConvertGL(CzMatrix4 &m0);
00035     void        ConvertFromGL(float* m0);
00036     void        Identity();
00037     void        UVN(CzVec3* pU, CzVec3* pV, CzVec3 *pN);
00038     void        Translate(float x, float y, float z);
00039     void        Translate(CzVec3* pV);
00040     void        TranslateSet(float x, float y, float z);
00041     void        TranslateSet(CzVec3* pV);
00042     void        Scale(float x, float y, float z);
00043     void        Scale(CzVec3 *v);
00044     void        Quat(float x, float y, float z, float w);
00045     void        AngleAxis(float axis_x, float axis_y, float axis_z, float angle);
00046     void        LookAt(float eye_x, float eye_y, float eye_z, float lookat_x, float lookat_y, float lookat_z, float up_x, float up_y, float up_z, CzVec3* trans);
00047     void        RotateX(float angle);
00048     void        RotateY(float angle);
00049     void        RotateZ(float angle);
00050     void        Rotate(float x, float y, float z);
00051     void        Rotate(CzVec3 *pAngles);
00052     void        RotateYXZ(CzVec3 *pAngles);
00053     void        RotateYXZ(float x, float y, float z);
00054     void        Multiply(CzMatrix4* m0);
00055     void        MultiplyPost(CzMatrix4* m0);
00056     void        Multiply(CzMatrix4* m0, CzMatrix4* m1);
00057     void        Transform(float x, float y, float z, CzVec3 *ov);
00058     void        Transform(CzVec3 *iv, CzVec3 *ov);
00059     CzVec3      Transform(float x, float y, float z);
00060     void        TransformRotationOnly(float x, float y, float z, CzVec3 *ov);
00061     void        TransformRotationOnly(CzVec3* iv, CzVec3* ov);
00062     void        TransformN(CzVec3* iv, CzVec3* ov, int nCount);
00063     void        TransformNRotationOnly(CzVec3* iv, CzVec3* ov, int nCount);
00064     void        TransformNPreTranslate(CzVec3* iv, CzVec3* ov, int nCount);
00065     float       TransformZ(float x, float y, float z);
00066     float       TransformZRS(float x, float y, float z);
00067 
00068     CzVec3      getTranslation();
00069     float       getX() const;
00070     float       getY() const;
00071     float       getZ() const;
00072 
00073     void        OrthoProjection(float top, float bottom, float left, float right, float near_plane, float far_plane);
00074     void        PerspProjection(float fov, float aspect, float near_plane, float far_plane);
00075 };
00076 
00077 
00078 #endif  // __CZ_MATRIX4_H__