ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/mat4.h
Revision: 2.12
Committed: Mon Jul 14 22:23:59 2003 UTC (20 years, 9 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Changes since 2.11: +5 -4 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Moved includes in headers out of "C" scope.

File Contents

# User Rev Content
1 schorsch 2.12 /* RCSid $Id: mat4.h,v 2.11 2003/06/30 14:59:11 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 schorsch 2.8
8     #include <string.h>
9 greg 2.4
10 greg 1.1 #include "fvect.h"
11 schorsch 2.12
12     #ifdef __cplusplus
13     extern "C" {
14     #endif
15 greg 1.1
16 schorsch 2.9 typedef RREAL MAT4[4][4];
17 greg 1.1
18 greg 2.6 #define copymat4(m4a,m4b) (void)memcpy((void *)m4a,(void *)m4b,sizeof(MAT4))
19 greg 1.2
20 greg 2.2 #define MAT4IDENT { {1.,0.,0.,0.}, {0.,1.,0.,0.}, \
21     {0.,0.,1.,0.}, {0.,0.,0.,1.} }
22 greg 1.2
23     extern MAT4 m4ident;
24    
25     #define setident4(m4) copymat4(m4, m4ident)
26 greg 2.4
27    
28     extern void multmat4(MAT4 m4a, MAT4 m4b, MAT4 m4c);
29     extern void multv3(FVECT v3a, FVECT v3b, MAT4 m4);
30     extern void multp3(FVECT p3a, FVECT p3b, MAT4 m4);
31     extern int invmat4(MAT4 inverse, MAT4 mat);
32    
33 schorsch 2.7
34     #ifdef __cplusplus
35     }
36 greg 2.4 #endif
37 schorsch 2.7 #endif /* _RAD_MAT4_H_ */
38