| 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 |
+ |
#ifndef _RAD_MAT4_H_ |
| 6 |
+ |
#define _RAD_MAT4_H_ |
| 7 |
+ |
#ifdef __cplusplus |
| 8 |
+ |
extern "C" { |
| 9 |
+ |
#endif |
| 10 |
|
|
| 11 |
+ |
#include <string.h> |
| 12 |
+ |
|
| 13 |
|
#include "fvect.h" |
| 14 |
|
|
| 15 |
< |
typedef FLOAT MAT4[4][4]; |
| 15 |
> |
typedef RREAL MAT4[4][4]; |
| 16 |
|
|
| 17 |
|
#ifdef BSD |
| 18 |
< |
#define copymat4(m4a,m4b) bcopy((char *)m4b,(char *)m4a,sizeof(MAT4)) |
| 18 |
> |
#define copymat4(m4a,m4b) bcopy((void *)m4b,(void *)m4a,sizeof(MAT4)) |
| 19 |
|
#else |
| 20 |
< |
#define copymat4(m4a,m4b) (void)memcpy((char *)m4a,(char *)m4b,sizeof(MAT4)) |
| 17 |
< |
extern char *memcpy(); |
| 20 |
> |
#define copymat4(m4a,m4b) (void)memcpy((void *)m4a,(void *)m4b,sizeof(MAT4)) |
| 21 |
|
#endif |
| 22 |
|
|
| 23 |
< |
#define MAT4IDENT { 1.,0.,0.,0., 0.,1.,0.,0., \ |
| 24 |
< |
0.,0.,1.,0., 0.,0.,0.,1. } |
| 23 |
> |
#define MAT4IDENT { {1.,0.,0.,0.}, {0.,1.,0.,0.}, \ |
| 24 |
> |
{0.,0.,1.,0.}, {0.,0.,0.,1.} } |
| 25 |
|
|
| 26 |
|
extern MAT4 m4ident; |
| 27 |
|
|
| 28 |
|
#define setident4(m4) copymat4(m4, m4ident) |
| 29 |
+ |
|
| 30 |
+ |
|
| 31 |
+ |
extern void multmat4(MAT4 m4a, MAT4 m4b, MAT4 m4c); |
| 32 |
+ |
extern void multv3(FVECT v3a, FVECT v3b, MAT4 m4); |
| 33 |
+ |
extern void multp3(FVECT p3a, FVECT p3b, MAT4 m4); |
| 34 |
+ |
extern int invmat4(MAT4 inverse, MAT4 mat); |
| 35 |
+ |
|
| 36 |
+ |
|
| 37 |
+ |
#ifdef __cplusplus |
| 38 |
+ |
} |
| 39 |
+ |
#endif |
| 40 |
+ |
#endif /* _RAD_MAT4_H_ */ |
| 41 |
+ |
|