-
Notifications
You must be signed in to change notification settings - Fork 1
/
xform.h
46 lines (40 loc) · 1.07 KB
/
xform.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright © 1991-2006 Bart Massey
* ALL RIGHTS RESERVED
* [This program is licensed under the "3-clause ('new') BSD License"]
* Please see the file COPYING in the source
* distribution of this software for license terms.
*/
// -*- C++ -*-
// a simple transformation matrix class -- interface
// Bart 2/91
enum xform_types {
XFORM_IDENTITY,
XFORM_TRANSLATE,
XFORM_SCALE,
XFORM_ROTATE_X,
XFORM_ROTATE_Y,
XFORM_ROTATE_Z
};
class point;
typedef float gmatrix[4][4];
class xform {
private:
gmatrix *m, *mi;
gmatrix mv, miv;
public:
xform( enum xform_types );
xform( enum xform_types, point );
xform( enum xform_types, float );
xform( const xform & );
inline virtual ~xform( void );
inline void operator= ( const xform & );
inline virtual float at( int, int );
inline virtual point row( int );
inline virtual float rowmult( int, float [4] );
inline virtual point col( int );
inline virtual void operator*= ( xform );
inline virtual xform operator* ( xform );
inline virtual void invert( void );
inline virtual xform inverse( void );
};