ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/mat4.h
Revision: 2.11
Committed: Mon Jun 30 14:59:11 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 2.10: +1 -5 lines
Log Message:
Replaced most outdated BSD function calls with their posix equivalents, and cleaned up a few other platform dependencies.

File Contents

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