ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/mat4.h
Revision: 2.9
Committed: Thu Jun 26 00:58:09 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 2.8: +2 -2 lines
Log Message:
Abstracted process and path handling for Windows.
Renamed FLOAT to RREAL because of conflict on Windows.
Added conditional compiles for some signal handlers.

File Contents

# User Rev Content
1 schorsch 2.9 /* RCSid $Id: mat4.h,v 2.8 2003/06/07 12:50:20 schorsch Exp $ */
2 greg 1.1 /*
3     * Definitions for 4x4 matrix operations
4     */
5 schorsch 2.7 #ifndef _RAD_MAT4_H_
6     #define _RAD_MAT4_H_
7     #ifdef __cplusplus
8     extern "C" {
9     #endif
10 greg 1.1
11 greg 2.5 #include "copyright.h"
12 schorsch 2.8
13     #include <string.h>
14 greg 2.4
15 greg 1.1 #include "fvect.h"
16    
17 schorsch 2.9 typedef RREAL MAT4[4][4];
18 greg 1.1
19     #ifdef BSD
20 greg 2.6 #define copymat4(m4a,m4b) bcopy((void *)m4b,(void *)m4a,sizeof(MAT4))
21 greg 1.1 #else
22 greg 2.6 #define copymat4(m4a,m4b) (void)memcpy((void *)m4a,(void *)m4b,sizeof(MAT4))
23 greg 1.1 #endif
24 greg 1.2
25 greg 2.2 #define MAT4IDENT { {1.,0.,0.,0.}, {0.,1.,0.,0.}, \
26     {0.,0.,1.,0.}, {0.,0.,0.,1.} }
27 greg 1.2
28     extern MAT4 m4ident;
29    
30     #define setident4(m4) copymat4(m4, m4ident)
31 greg 2.4
32    
33     extern void multmat4(MAT4 m4a, MAT4 m4b, MAT4 m4c);
34     extern void multv3(FVECT v3a, FVECT v3b, MAT4 m4);
35     extern void multp3(FVECT p3a, FVECT p3b, MAT4 m4);
36     extern int invmat4(MAT4 inverse, MAT4 mat);
37    
38 schorsch 2.7
39     #ifdef __cplusplus
40     }
41 greg 2.4 #endif
42 schorsch 2.7 #endif /* _RAD_MAT4_H_ */
43