1 |
< |
/* Copyright (c) 1990 Regents of the University of California */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
4 |
< |
|
1 |
> |
/* RCSid $Id$ */ |
2 |
|
/* |
3 |
|
* Definitions for 4x4 matrix operations |
4 |
|
*/ |
5 |
|
|
6 |
+ |
#include "copyright.h" |
7 |
+ |
|
8 |
|
#include "fvect.h" |
9 |
|
|
10 |
< |
typedef double MAT4[4][4]; |
10 |
> |
typedef FLOAT MAT4[4][4]; |
11 |
|
|
12 |
|
#ifdef BSD |
13 |
< |
#define copymat4(m4a,m4b) bcopy((char *)m4b,(char *)m4a,sizeof(MAT4)) |
13 |
> |
#define copymat4(m4a,m4b) bcopy((void *)m4b,(void *)m4a,sizeof(MAT4)) |
14 |
|
#else |
15 |
< |
#define copymat4(m4a,m4b) (void)memcpy((char *)m4a,(char *)m4b,sizeof(MAT4)) |
17 |
< |
extern char *memcpy(); |
15 |
> |
#define copymat4(m4a,m4b) (void)memcpy((void *)m4a,(void *)m4b,sizeof(MAT4)) |
16 |
|
#endif |
17 |
|
|
18 |
< |
#define MAT4IDENT { 1.,0.,0.,0., 0.,1.,0.,0., \ |
19 |
< |
0.,0.,1.,0., 0.,0.,0.,1. } |
18 |
> |
#define MAT4IDENT { {1.,0.,0.,0.}, {0.,1.,0.,0.}, \ |
19 |
> |
{0.,0.,1.,0.}, {0.,0.,0.,1.} } |
20 |
|
|
21 |
|
extern MAT4 m4ident; |
22 |
|
|
23 |
|
#define setident4(m4) copymat4(m4, m4ident) |
24 |
+ |
|
25 |
+ |
#ifdef NOPROTO |
26 |
+ |
|
27 |
+ |
extern void multmat4(); |
28 |
+ |
extern void multv3(); |
29 |
+ |
extern void multp3(); |
30 |
+ |
extern int invmat4(); |
31 |
+ |
|
32 |
+ |
#else |
33 |
+ |
|
34 |
+ |
extern void multmat4(MAT4 m4a, MAT4 m4b, MAT4 m4c); |
35 |
+ |
extern void multv3(FVECT v3a, FVECT v3b, MAT4 m4); |
36 |
+ |
extern void multp3(FVECT p3a, FVECT p3b, MAT4 m4); |
37 |
+ |
extern int invmat4(MAT4 inverse, MAT4 mat); |
38 |
+ |
|
39 |
+ |
#endif |