Panda3D
|
00001 #ifndef __ZMATH__ 00002 #define __ZMATH__ 00003 00004 /* Matrix & Vertex */ 00005 00006 typedef struct { 00007 PN_stdfloat m[4][4]; 00008 } M4; 00009 00010 typedef struct { 00011 PN_stdfloat m[3][3]; 00012 } M3; 00013 00014 typedef struct { 00015 PN_stdfloat m[3][4]; 00016 } M34; 00017 00018 typedef struct { 00019 PN_stdfloat v[2]; 00020 } V2; 00021 00022 typedef struct { 00023 PN_stdfloat v[3]; 00024 } V3; 00025 00026 typedef struct { 00027 PN_stdfloat v[4]; 00028 } V4; 00029 00030 void gl_M4_Id(M4 *a); 00031 int gl_M4_IsId(M4 *a); 00032 void gl_M4_Move(M4 *a,M4 *b); 00033 void gl_MoveV3(V3 *a,V3 *b); 00034 void gl_MulM4V3(V3 *a,M4 *b,V3 *c); 00035 void gl_MulM3V3(V3 *a,M4 *b,V3 *c); 00036 00037 void gl_M4_MulV4(V4 * a,M4 *b,V4 * c); 00038 void gl_M4_InvOrtho(M4 *a,M4 b); 00039 void gl_M4_Inv(M4 *a,M4 *b); 00040 void gl_M4_Mul(M4 *c,M4 *a,M4 *b); 00041 void gl_M4_MulLeft(M4 *c,M4 *a); 00042 void gl_M4_Transpose(M4 *a,M4 *b); 00043 void gl_M4_Rotate(M4 *c,PN_stdfloat t,int u); 00044 int gl_V3_Norm(V3 *a); 00045 00046 V3 gl_V3_New(PN_stdfloat x,PN_stdfloat y,PN_stdfloat z); 00047 V4 gl_V4_New(PN_stdfloat x,PN_stdfloat y,PN_stdfloat z,PN_stdfloat w); 00048 00049 int gl_Matrix_Inv(PN_stdfloat *r,PN_stdfloat *m,int n); 00050 00051 #endif