00001 #ifndef Matrix33_H 00002 #define Matrix33_H 00003 /*######################################################################## 00004 File: Matrix33.h 00005 Creation date: 25th May 2002 00006 00007 Copyright 2002 Mark Williams, all rights reserved. 00008 Contact: mark@extrabit.com 00009 http://www.extrabit.com 00010 00011 This program is free software; you can redistribute it and/or 00012 modify it under the terms of the GNU General Public License 00013 as published by the Free Software Foundation; either version 2 00014 of the License, or (at your option) any later version. 00015 00016 This program is distributed in the hope that it will be useful, 00017 but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 GNU General Public License for more details. 00020 00021 ########################################################################*/ 00022 00023 /*######################################################################## 00024 Headers 00025 ########################################################################*/ 00026 00027 /*######################################################################## 00028 Declarations 00029 ########################################################################*/ 00030 00031 class Vector2 ; 00032 00033 /*######################################################################## 00034 Class Definition 00035 ########################################################################*/ 00036 00042 class Matrix33 00043 { 00044 public: 00045 Matrix33 (void) ; 00046 00047 // Initialisers that take no arguments. 00048 enum Matrix33_init {IDENTITY, ZERO} ; 00049 Matrix33 (Matrix33_init) ; 00050 00051 // Initialisers that take a double argument. 00052 enum Matrix33_init_d {ROTATE, SCALE} ; 00053 Matrix33 (Matrix33_init_d, double) ; 00054 00055 // Initialisers that take a ZVector2 argument. 00056 enum Matrix33_init_v {TRANSLATE, SCALE_XY} ; 00057 Matrix33 (Matrix33_init_v, const Vector2&) ; 00058 00059 void set_zero (void) ; 00060 void set_identity (void) ; 00061 void set_translation (const Vector2&) ; 00062 void set_rotation (double angle) ; 00063 void set_rotation (double angle, const Vector2& origin) ; 00064 void set_scale (double scale) ; 00065 void set_scale (const Vector2& scale_xy) ; 00066 00067 void transform (Vector2*) const ; 00068 00069 Matrix33 operator* (const Matrix33&) const ; 00070 00071 private: 00073 double m_elements[3][3] ; 00074 } ; 00075 00076 00077 /*######################################################################## 00078 End 00079 ########################################################################*/ 00080 #endif
1.2.16