diff --git a/include/CPUMAC.H b/include/CPUMAC.H new file mode 100644 index 0000000..1d2f806 --- /dev/null +++ b/include/CPUMAC.H @@ -0,0 +1,68 @@ +/* +** cpumac.h + mike acton +*/ + +// cpu_ldr(cpu register,data pointer) +// copy 32bit data from dp to r +#define cpu_ldr(r,dp)\ +asm(\ + "lw %0, 0(%1);"\ + : "=r" (r)\ + : "r" (dp)\ +) + +// cpu_gted0(cpu register) +// copy 32bit data from r to gte register 0 +#define cpu_gted0(r)\ +asm(\ + "mtc2 %0, $0;"\ + :\ + : "r" (r)\ +) + +// cpu_gted1(cpu register) +// copy 32bit data from r to gte register 1 +#define cpu_gted1(r)\ +asm(\ + "mtc2 %0, $1;"\ + :\ + : "r" (r)\ +) + +// cpu_gted2(cpu register) +// copy 32bit data from r to gte register 2 +#define cpu_gted2(r)\ +asm(\ + "mtc2 %0, $2;"\ + :\ + : "r" (r)\ +) + +// cpu_gted3(cpu register) +// copy 32bit data from r to gte register 3 +#define cpu_gted3(r)\ +asm(\ + "mtc2 %0, $3;"\ + :\ + : "r" (r)\ +) + +// cpu_gted4(cpu register) +// copy 32bit data from r to gte register 4 +#define cpu_gted4(r)\ +asm(\ + "mtc2 %0, $4;"\ + :\ + : "r" (r)\ +) + +// cpu_gted5(cpu register) +// copy 32bit data from r to gte register 5 +#define cpu_gted5(r)\ +asm(\ + "mtc2 %0, $5;"\ + :\ + : "r" (r)\ +) + diff --git a/include/camera.h b/include/camera.h index 196761d..2c49620 100644 --- a/include/camera.h +++ b/include/camera.h @@ -17,14 +17,14 @@ typedef struct{ int pan, panv; int tilt, tiltv; int rol; - SVECTOR pos; - SVECTOR rot; + SVECTOR * pos; + SVECTOR * rot; SVECTOR dvs; - MATRIX mat; + MATRIX * mat; } CAMERA; void getCameraXZ(int * x, int * z, int actorX, int actorZ, int angle, int distance); void getCameraXZY(int * x, int * z, int * y, int actorX, int actorZ, int actorY, int angle, int angleX, int distance); void getCameraZY( int * z, int * y, int actorZ, int actorY, int angleX, int distance); void applyCamera(CAMERA * cam); -void setCameraPos(CAMERA * camera, SVECTOR pos, SVECTOR rot); +void setCameraPos(CAMERA * camera, SVECTOR * pos, SVECTOR * rot); diff --git a/include/defines b/include/defines index a5b5a8f..9cd9e34 100644 Binary files a/include/defines and b/include/defines differ diff --git a/include/defines.h b/include/defines.h index 5212cc9..dbcafc1 100644 --- a/include/defines.h +++ b/include/defines.h @@ -1,5 +1,5 @@ #define VMODE 0 // 0 == NTSC, 1 == PAL -#define VSYNC 0 +#define VSYNC 1 #define SCREENXRES 320 #define SCREENYRES 240 #define CENTERX SCREENXRES/2 @@ -16,7 +16,7 @@ #define FNT_SCR_X 16 #define FNT_SCR_Y 192 #define FNT_SCR_W 240 -#define FNT_SCR_H 32 +#define FNT_SCR_H 48 #define FNT_SCR_BG 0 #define FNT_SCR_MAX_CHAR 256 @@ -25,6 +25,33 @@ #define OTLEN 4096 #define PRIMBUFFLEN 4096 * sizeof(POLY_GT4) // Maximum number of POLY_GT4 primitives +#define cpu_uldr(r,dp) \ +asm(\ + "sw %0, 0(%1);" \ + : "=r" (r)\ + : "r" (dp)\ +) + +// DCache setup +#define dc_camdirp ((sshort*) getScratchAddr(0)) +#define dc_ip ((uchar*) getScratchAddr(1)) +#define dc_opzp ((slong*) getScratchAddr(2)) +#define dc_wrkmatp ((MATRIX*) getScratchAddr(3)) +#define dc_retmatp ((MATRIX*) getScratchAddr(9)) +#define dc_lgtmatp ((MATRIX*) getScratchAddr(12)) +#define dc_lvllgtmatp ((MATRIX*) getScratchAddr(16)) +#define dc_lvlcmatp ((MATRIX*) getScratchAddr(24)) +#define dc_lgtangp ((SVECTOR*) getScratchAddr(32)) +#define dc_wrklvector ((VECTOR*) getScratchAddr(34)) +#define dc_camMat ((MATRIX*) getScratchAddr(38)) +#define dc_camRot ((SVECTOR*) getScratchAddr(46)) +#define dc_camPos ((SVECTOR*) getScratchAddr(54)) + +//~ #define dc_sxytbl ((DVECTOR*) getScratchAddr(15)) // 6 DVEC == 12 +//~ #define dc_verts ((SVECTOR*) getScratchAddr(27)) // store verts here +//~ #define dc_verts1 ((SVECTOR*) getScratchAddr(35)) // store verts here +//~ #define dc_verts2 ((SVECTOR*) getScratchAddr(43)) // store verts here + // Fog #define FOG_NEAR 2300 #define FOG_FAR 2600 diff --git a/include/graphics.h b/include/graphics.h index 554fe84..77fe88a 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -6,19 +6,19 @@ // Drawing void transformMesh(CAMERA * camera, MESH * meshes); void enlightMesh(LEVEL * curLvl, MESH * actorPtr, SVECTOR * lgtang); -void drawPoly(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw); +void drawPoly(MESH * mesh, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw); // Tri drawing -long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i); +long drawTri(MESH * mesh, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i); void set3VertexLerPos(MESH * mesh, long t); void set3Prism(POLY_GT3 * poly, MESH * mesh, DRAWENV * draw, char * db, int i); void set3Tex(POLY_GT3 * poly, MESH * mesh, DRAWENV * draw, long t, int i); -long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t, long * Flag); +long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t); //Quad drawing -long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i); +long drawQuad(MESH * mesh, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i); void set4VertexLerPos(MESH * mesh, long t); void set4Prism(POLY_GT4 * poly4, MESH * mesh, DRAWENV * draw, char * db, int i); void set4Tex(POLY_GT4 * poly4, MESH * mesh, DRAWENV * draw, long t, int i); int set4Subdiv(MESH * mesh, POLY_GT4 * poly4, u_long * ot, long t, int i, char ** nextpri); -long interpolateQuad(POLY_GT4 * poly4, MESH * mesh, long t, long * Flag); +long interpolateQuad(POLY_GT4 * poly4, MESH * mesh, long t); //2D drawing void drawBG(CAMANGLE * camPtr, char ** nextpri, u_long * otdisc, char * db); diff --git a/include/macros b/include/macros new file mode 100644 index 0000000..4392310 Binary files /dev/null and b/include/macros differ diff --git a/include/macros.h b/include/macros.h index 63268d5..36cc485 100644 --- a/include/macros.h +++ b/include/macros.h @@ -34,17 +34,15 @@ // GTE Macros #define gte_RotAverageNclip4(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12) \ - { gte_ldv3(r1,r2,r3); \ - gte_rtpt(); \ - gte_stflg(r11); \ - gte_nclip(); \ - gte_stopz(r12); \ - gte_stsxy3(r5,r6,r7); \ - \ - gte_ldv0(r4); \ - gte_rtps(); \ - gte_stsxy(r8); \ - \ - gte_stdp(r9); \ - gte_avsz4(); \ - gte_stotz(r10); } + { gte_ldv3(r1,r2,r3); \ + gte_rtpt(); \ + gte_stflg(r11); \ + gte_nclip(); \ + gte_ldv0(r4); \ + gte_stopz(r12); \ + gte_stsxy3(r5,r6,r7); \ + gte_rtps(); \ + gte_stsxy(r8); \ + gte_stdp(r9); \ + gte_avsz4(); \ + gte_stotz(r10); } diff --git a/include/psx.h b/include/psx.h index 9e20249..5399d67 100644 --- a/include/psx.h +++ b/include/psx.h @@ -6,14 +6,16 @@ #include #include #include +#include #include #include #include "../include/defines.h" #include "../custom_types.h" // PSX setup -void setLightEnv(DRAWENV draw[2], CVECTOR * BGc, VECTOR * BKc, MATRIX * cmat); -void init(DISPENV disp[2], DRAWENV draw[2], short db, MATRIX * cmat, CVECTOR * BG, VECTOR * BK, VECTOR * FC ); +void setDCLightEnv(MATRIX * curLevelCMat, MATRIX * curLevelLgtMat, SVECTOR * curLevelLgtAng); +void setLightEnv(DRAWENV draw[2], CVECTOR * BGc, VECTOR * BKc); +void init(DISPENV disp[2], DRAWENV draw[2], short db, CVECTOR * BG, VECTOR * BK, VECTOR * FC ); void ScrRst(void); void display(DISPENV * disp, DRAWENV * draw, u_long * otdisc, char * primbuff, char ** nextprim, char * db); diff --git a/levels/level1.c b/levels/level1.c index d0c06e6..697d84b 100644 --- a/levels/level1.c +++ b/levels/level1.c @@ -60,62 +60,62 @@ MATRIX level1_cmat = { }; SVECTOR level1_modelCube_mesh[] = { - { -32,21,-24 }, - { -32,-8,-26 }, - { -32,18,26 }, - { -32,-11,24 }, - { 33,21,-23 }, - { 33,-8,-26 }, - { 33,18,26 }, - { 33,-12,24 }, - { 0,-20,23 }, - { 0,-17,-27 }, - { 0,9,25 }, - { 0,13,-25 }, - { 33,-10,3 }, - { 0,-19,2 }, - { 33,19,5 }, - { -32,19,5 }, - { 0,11,4 }, - { -32,-10,3 }, - { 33,-10,-4 }, - { -32,-10,-4 }, - { 0,11,-3 }, - { -32,20,-2 }, - { 0,-18,-5 }, - { 33,20,-2 }, - { -45,-14,3 }, - { -45,-13,-4 }, - { -45,-11,3 }, - { -45,-10,-4 }, - { -32,-6,3 }, - { -32,-6,-4 }, - { 33,18,16 }, - { 33,-11,14 }, - { 24,-12,24 }, - { 24,18,26 }, - { 24,21,-24 }, - { 24,-8,-26 }, - { 33,21,-16 }, - { 33,-9,-18 }, - { 42,31,-22 }, - { 38,31,-22 }, - { 42,30,-18 }, - { 19,28,24 }, - { 19,28,21 }, - { 16,28,24 }, - { 33,-19,-24 }, - { 31,-23,21 }, - { -32,20,-12 }, - { -20,21,-24 }, - { -18,17,26 }, - { -32,19,14 }, - { -42,31,-21 }, - { -15,28,24 }, - { -42,31,-16 }, - { -38,31,-21 }, - { -10,28,24 }, - { -15,28,20 } + { -32,21,-24 ,0}, + { -32,-8,-26 ,0}, + { -32,18,26 ,0}, + { -32,-11,24 ,0}, + { 33,21,-23 ,0}, + { 33,-8,-26 ,0}, + { 33,18,26 ,0}, + { 33,-12,24 ,0}, + { 0,-20,23 ,0}, + { 0,-17,-27 ,0}, + { 0,9,25 ,0}, + { 0,13,-25 ,0}, + { 33,-10,3 ,0}, + { 0,-19,2 ,0}, + { 33,19,5 ,0}, + { -32,19,5 ,0}, + { 0,11,4 ,0}, + { -32,-10,3 ,0}, + { 33,-10,-4 ,0}, + { -32,-10,-4 ,0}, + { 0,11,-3 ,0}, + { -32,20,-2 ,0}, + { 0,-18,-5 ,0}, + { 33,20,-2 ,0}, + { -45,-14,3 ,0}, + { -45,-13,-4 ,0}, + { -45,-11,3 ,0}, + { -45,-10,-4 ,0}, + { -32,-6,3 ,0}, + { -32,-6,-4 ,0}, + { 33,18,16 ,0}, + { 33,-11,14 ,0}, + { 24,-12,24 ,0}, + { 24,18,26 ,0}, + { 24,21,-24 ,0}, + { 24,-8,-26 ,0}, + { 33,21,-16 ,0}, + { 33,-9,-18 ,0}, + { 42,31,-22 ,0}, + { 38,31,-22 ,0}, + { 42,30,-18 ,0}, + { 19,28,24 ,0}, + { 19,28,21 ,0}, + { 16,28,24 ,0}, + { 33,-19,-24 ,0}, + { 31,-23,21 ,0}, + { -32,20,-12 ,0}, + { -20,21,-24 ,0}, + { -18,17,26 ,0}, + { -32,19,14 ,0}, + { -42,31,-21 ,0}, + { -15,28,24 ,0}, + { -42,31,-16 ,0}, + { -38,31,-21 ,0}, + { -10,28,24 ,0}, + { -15,28,20 , 0} }; SVECTOR level1_modelCube_normal[] = { @@ -995,27 +995,27 @@ MESH level1_meshCube = { }; SVECTOR level1_modelCylindre_mesh[] = { - { -2,35,10 }, - { 5,-30,41 }, - { 4,35,7 }, - { 31,-30,26 }, - { 6,35,2 }, - { 39,-30,1 }, - { 4,35,-4 }, - { 29,-30,-23 }, - { 0,35,-7 }, - { -4,35,-8 }, - { 6,-30,-36 }, - { -8,35,-6 }, - { -16,-30,-33 }, - { -11,35,-2 }, - { -35,-30,-15 }, - { -12,35,2 }, - { -38,-30,7 }, - { -10,35,6 }, - { -32,-30,25 }, - { -7,35,9 }, - { -18,-30,37 } + { -2,35,10 ,0}, + { 5,-30,41 ,0}, + { 4,35,7 ,0}, + { 31,-30,26 ,0}, + { 6,35,2 ,0}, + { 39,-30,1 ,0}, + { 4,35,-4 ,0}, + { 29,-30,-23 ,0}, + { 0,35,-7 ,0}, + { -4,35,-8 ,0}, + { 6,-30,-36 ,0}, + { -8,35,-6 ,0}, + { -16,-30,-33 ,0}, + { -11,35,-2 ,0}, + { -35,-30,-15 ,0}, + { -12,35,2 ,0}, + { -38,-30,7 ,0}, + { -10,35,6 ,0}, + { -32,-30,25 ,0}, + { -7,35,9 ,0}, + { -18,-30,37,0 } }; SVECTOR level1_modelCylindre_normal[] = { @@ -1326,464 +1326,464 @@ VANIM level1_modelCylindre_anim = { 0, { //Frame 0 - { 3,35,47 }, - { -1,-30,14 }, - { 33,35,32 }, - { 7,-30,9 }, - { 43,35,5 }, - { 9,-30,2 }, - { 35,35,-23 }, - { 6,-30,-4 }, - { 13,35,-36 }, - { -7,35,-38 }, - { 0,-30,-8 }, - { -26,35,-29 }, - { -6,-30,-7 }, - { -39,35,-13 }, - { -12,-30,-2 }, - { -42,35,7 }, - { -13,-30,4 }, - { -36,35,27 }, - { -11,-30,9 }, - { -20,35,41 }, - { -7,-30,12 }, + { 3,35,47 ,0}, + { -1,-30,14 ,0}, + { 33,35,32 ,0}, + { 7,-30,9 ,0}, + { 43,35,5 ,0}, + { 9,-30,2 ,0}, + { 35,35,-23 ,0}, + { 6,-30,-4 ,0}, + { 13,35,-36 ,0}, + { -7,35,-38 ,0}, + { 0,-30,-8 ,0}, + { -26,35,-29 ,0}, + { -6,-30,-7 ,0}, + { -39,35,-13 ,0}, + { -12,-30,-2 ,0}, + { -42,35,7 ,0}, + { -13,-30,4 ,0}, + { -36,35,27 ,0}, + { -11,-30,9 ,0}, + { -20,35,41 ,0}, + { -7,-30,12 ,0}, //Frame 1 - { 3,35,45 }, - { 0,-30,15 }, - { 31,35,31 }, - { 8,-30,11 }, - { 41,35,5 }, - { 11,-30,2 }, - { 33,35,-21 }, - { 8,-30,-6 }, - { 13,35,-35 }, - { -7,35,-36 }, - { 0,-30,-10 }, - { -25,35,-28 }, - { -7,-30,-9 }, - { -37,35,-13 }, - { -13,-30,-3 }, - { -40,35,7 }, - { -14,-30,4 }, - { -34,35,26 }, - { -12,-30,10 }, - { -19,35,39 }, - { -8,-30,14 }, + { 3,35,45 ,0}, + { 0,-30,15 ,0}, + { 31,35,31 ,0}, + { 8,-30,11 ,0}, + { 41,35,5 ,0}, + { 11,-30,2 ,0}, + { 33,35,-21 ,0}, + { 8,-30,-6 ,0}, + { 13,35,-35 ,0}, + { -7,35,-36 ,0}, + { 0,-30,-10 ,0}, + { -25,35,-28 ,0}, + { -7,-30,-9 ,0}, + { -37,35,-13 ,0}, + { -13,-30,-3 ,0}, + { -40,35,7 ,0}, + { -14,-30,4 ,0}, + { -34,35,26 ,0}, + { -12,-30,10 ,0}, + { -19,35,39 ,0}, + { -8,-30,14 ,0}, //Frame 2 - { 2,35,38 }, - { 1,-30,20 }, - { 26,35,26 }, - { 12,-30,14 }, - { 34,35,4 }, - { 16,-30,2 }, - { 27,35,-18 }, - { 12,-30,-9 }, - { 10,35,-29 }, - { -6,35,-31 }, - { 1,-30,-15 }, - { -22,35,-24 }, - { -9,-30,-13 }, - { -32,35,-11 }, - { -18,-30,-5 }, - { -35,35,6 }, - { -19,-30,5 }, - { -30,35,22 }, - { -16,-30,13 }, - { -17,35,33 }, - { -10,-30,18 }, + { 2,35,38 ,0}, + { 1,-30,20 ,0}, + { 26,35,26 ,0}, + { 12,-30,14 ,0}, + { 34,35,4 ,0}, + { 16,-30,2 ,0}, + { 27,35,-18 ,0}, + { 12,-30,-9 ,0}, + { 10,35,-29 ,0}, + { -6,35,-31 ,0}, + { 1,-30,-15 ,0}, + { -22,35,-24 ,0}, + { -9,-30,-13 ,0}, + { -32,35,-11 ,0}, + { -18,-30,-5 ,0}, + { -35,35,6 ,0}, + { -19,-30,5 ,0}, + { -30,35,22 ,0}, + { -16,-30,13 ,0}, + { -17,35,33 ,0}, + { -10,-30,18 ,0}, //Frame 3 - { 1,35,29 }, - { 2,-30,27 }, - { 19,35,20 }, - { 19,-30,18 }, - { 25,35,3 }, - { 24,-30,2 }, - { 19,35,-13 }, - { 18,-30,-14 }, - { 7,35,-22 }, - { -6,35,-23 }, - { 3,-30,-22 }, - { -17,35,-18 }, - { -11,-30,-20 }, - { -25,35,-8 }, - { -24,-30,-9 }, - { -27,35,5 }, - { -26,-30,5 }, - { -23,35,16 }, - { -21,-30,17 }, - { -14,35,25 }, - { -12,-30,24 }, + { 1,35,29 ,0}, + { 2,-30,27 ,0}, + { 19,35,20 ,0}, + { 19,-30,18 ,0}, + { 25,35,3 ,0}, + { 24,-30,2 ,0}, + { 19,35,-13 ,0}, + { 18,-30,-14 ,0}, + { 7,35,-22 ,0}, + { -6,35,-23 ,0}, + { 3,-30,-22 ,0}, + { -17,35,-18 ,0}, + { -11,-30,-20 ,0}, + { -25,35,-8 ,0}, + { -24,-30,-9 ,0}, + { -27,35,5 ,0}, + { -26,-30,5 ,0}, + { -23,35,16 ,0}, + { -21,-30,17 ,0}, + { -14,35,25 ,0}, + { -12,-30,24 ,0}, //Frame 4 - { -1,35,19 }, - { 3,-30,35 }, - { 11,35,13 }, - { 25,-30,22 }, - { 15,35,2 }, - { 31,-30,2 }, - { 12,35,-9 }, - { 24,-30,-19 }, - { 3,35,-14 }, - { -5,35,-15 }, - { 5,-30,-29 }, - { -13,35,-11 }, - { -14,-30,-27 }, - { -18,35,-5 }, - { -30,-30,-12 }, - { -19,35,3 }, - { -32,-30,6 }, - { -17,35,11 }, - { -27,-30,21 }, - { -10,35,17 }, - { -15,-30,31 }, + { -1,35,19 ,0}, + { 3,-30,35 ,0}, + { 11,35,13 ,0}, + { 25,-30,22 ,0}, + { 15,35,2 ,0}, + { 31,-30,2 ,0}, + { 12,35,-9 ,0}, + { 24,-30,-19 ,0}, + { 3,35,-14 ,0}, + { -5,35,-15 ,0}, + { 5,-30,-29 ,0}, + { -13,35,-11 ,0}, + { -14,-30,-27 ,0}, + { -18,35,-5 ,0}, + { -30,-30,-12 ,0}, + { -19,35,3 ,0}, + { -32,-30,6 ,0}, + { -17,35,11 ,0}, + { -27,-30,21 ,0}, + { -10,35,17 ,0}, + { -15,-30,31 ,0}, //Frame 5 - { -2,35,13 }, - { 4,-30,40 }, - { 6,35,9 }, - { 29,-30,25 }, - { 8,35,2 }, - { 37,-30,1 }, - { 6,35,-5 }, - { 28,-30,-22 }, - { 1,35,-9 }, - { -5,35,-9 }, - { 6,-30,-34 }, - { -9,35,-7 }, - { -15,-30,-31 }, - { -13,35,-3 }, - { -34,-30,-14 }, - { -14,35,2 }, - { -37,-30,7 }, - { -12,35,7 }, - { -30,-30,24 }, - { -8,35,11 }, - { -17,-30,35 }, + { -2,35,13 ,0}, + { 4,-30,40 ,0}, + { 6,35,9 ,0}, + { 29,-30,25 ,0}, + { 8,35,2 ,0}, + { 37,-30,1 ,0}, + { 6,35,-5 ,0}, + { 28,-30,-22 ,0}, + { 1,35,-9 ,0}, + { -5,35,-9 ,0}, + { 6,-30,-34 ,0}, + { -9,35,-7 ,0}, + { -15,-30,-31 ,0}, + { -13,35,-3 ,0}, + { -34,-30,-14 ,0}, + { -14,35,2 ,0}, + { -37,-30,7 ,0}, + { -12,35,7 ,0}, + { -30,-30,24 ,0}, + { -8,35,11 ,0}, + { -17,-30,35 ,0}, //Frame 6 - { -2,35,10 }, - { 5,-30,41 }, - { 4,35,7 }, - { 31,-30,26 }, - { 6,35,2 }, - { 39,-30,1 }, - { 4,35,-4 }, - { 29,-30,-23 }, - { 0,35,-7 }, - { -4,35,-8 }, - { 6,-30,-36 }, - { -8,35,-6 }, - { -16,-30,-33 }, - { -11,35,-2 }, - { -35,-30,-15 }, - { -12,35,2 }, - { -38,-30,7 }, - { -10,35,6 }, - { -32,-30,25 }, - { -7,35,9 }, - { -18,-30,37 }, + { -2,35,10 ,0}, + { 5,-30,41 ,0}, + { 4,35,7 ,0}, + { 31,-30,26 ,0}, + { 6,35,2 ,0}, + { 39,-30,1 ,0}, + { 4,35,-4 ,0}, + { 29,-30,-23 ,0}, + { 0,35,-7 ,0}, + { -4,35,-8 ,0}, + { 6,-30,-36 ,0}, + { -8,35,-6 ,0}, + { -16,-30,-33 ,0}, + { -11,35,-2 ,0}, + { -35,-30,-15 ,0}, + { -12,35,2 ,0}, + { -38,-30,7 ,0}, + { -10,35,6 ,0}, + { -32,-30,25 ,0}, + { -7,35,9 ,0}, + { -18,-30,37 ,0}, //Frame 7 - { -2,35,11 }, - { 5,-30,41 }, - { 4,35,8 }, - { 31,-30,26 }, - { 7,35,2 }, - { 38,-30,1 }, - { 5,35,-4 }, - { 29,-30,-23 }, - { 0,35,-8 }, - { -4,35,-8 }, - { 6,-30,-35 }, - { -9,35,-6 }, - { -16,-30,-33 }, - { -11,35,-2 }, - { -35,-30,-15 }, - { -12,35,2 }, - { -38,-30,7 }, - { -11,35,6 }, - { -32,-30,25 }, - { -7,35,9 }, - { -17,-30,36 }, + { -2,35,11 ,0}, + { 5,-30,41 ,0}, + { 4,35,8 ,0}, + { 31,-30,26 ,0}, + { 7,35,2 ,0}, + { 38,-30,1 ,0}, + { 5,35,-4 ,0}, + { 29,-30,-23 ,0}, + { 0,35,-8 ,0}, + { -4,35,-8 ,0}, + { 6,-30,-35 ,0}, + { -9,35,-6 ,0}, + { -16,-30,-33 ,0}, + { -11,35,-2 ,0}, + { -35,-30,-15 ,0}, + { -12,35,2 ,0}, + { -38,-30,7 ,0}, + { -11,35,6 ,0}, + { -32,-30,25 ,0}, + { -7,35,9 ,0}, + { -17,-30,36 ,0}, //Frame 8 - { -2,35,12 }, - { 5,-30,40 }, - { 5,35,8 }, - { 30,-30,26 }, - { 8,35,2 }, - { 37,-30,1 }, - { 6,35,-5 }, - { 28,-30,-22 }, - { 0,35,-9 }, - { -5,35,-9 }, - { 6,-30,-34 }, - { -9,35,-7 }, - { -15,-30,-32 }, - { -12,35,-3 }, - { -34,-30,-14 }, - { -13,35,2 }, - { -37,-30,7 }, - { -12,35,7 }, - { -31,-30,24 }, - { -8,35,11 }, - { -17,-30,35 }, + { -2,35,12 ,0}, + { 5,-30,40 ,0}, + { 5,35,8 ,0}, + { 30,-30,26 ,0}, + { 8,35,2 ,0}, + { 37,-30,1 ,0}, + { 6,35,-5 ,0}, + { 28,-30,-22 ,0}, + { 0,35,-9 ,0}, + { -5,35,-9 ,0}, + { 6,-30,-34 ,0}, + { -9,35,-7 ,0}, + { -15,-30,-32 ,0}, + { -12,35,-3 ,0}, + { -34,-30,-14 ,0}, + { -13,35,2 ,0}, + { -37,-30,7 ,0}, + { -12,35,7 ,0}, + { -31,-30,24 ,0}, + { -8,35,11 ,0}, + { -17,-30,35 ,0}, //Frame 9 - { -2,35,14 }, - { 4,-30,38 }, - { 7,35,10 }, - { 28,-30,25 }, - { 10,35,2 }, - { 36,-30,2 }, - { 7,35,-6 }, - { 27,-30,-21 }, - { 1,35,-10 }, - { -5,35,-11 }, - { 6,-30,-33 }, - { -10,35,-8 }, - { -15,-30,-30 }, - { -14,35,-3 }, - { -33,-30,-14 }, - { -15,35,3 }, - { -36,-30,7 }, - { -13,35,8 }, - { -30,-30,23 }, - { -9,35,12 }, - { -17,-30,34 }, + { -2,35,14 ,0}, + { 4,-30,38 ,0}, + { 7,35,10 ,0}, + { 28,-30,25 ,0}, + { 10,35,2 ,0}, + { 36,-30,2 ,0}, + { 7,35,-6 ,0}, + { 27,-30,-21 ,0}, + { 1,35,-10 ,0}, + { -5,35,-11 ,0}, + { 6,-30,-33 ,0}, + { -10,35,-8 ,0}, + { -15,-30,-30 ,0}, + { -14,35,-3 ,0}, + { -33,-30,-14 ,0}, + { -15,35,3 ,0}, + { -36,-30,7 ,0}, + { -13,35,8 ,0}, + { -30,-30,23 ,0}, + { -9,35,12 ,0}, + { -17,-30,34 ,0}, //Frame 10 - { -1,35,17 }, - { 4,-30,36 }, - { 9,35,12 }, - { 26,-30,23 }, - { 13,35,2 }, - { 33,-30,2 }, - { 10,35,-8 }, - { 25,-30,-20 }, - { 2,35,-12 }, - { -5,35,-13 }, - { 5,-30,-31 }, - { -12,35,-10 }, - { -14,-30,-28 }, - { -16,35,-4 }, - { -31,-30,-13 }, - { -17,35,3 }, - { -34,-30,6 }, - { -15,35,10 }, - { -28,-30,22 }, - { -10,35,15 }, - { -16,-30,32 }, + { -1,35,17 ,0}, + { 4,-30,36 ,0}, + { 9,35,12 ,0}, + { 26,-30,23 ,0}, + { 13,35,2 ,0}, + { 33,-30,2 ,0}, + { 10,35,-8 ,0}, + { 25,-30,-20 ,0}, + { 2,35,-12 ,0}, + { -5,35,-13 ,0}, + { 5,-30,-31 ,0}, + { -12,35,-10 ,0}, + { -14,-30,-28 ,0}, + { -16,35,-4 ,0}, + { -31,-30,-13 ,0}, + { -17,35,3 ,0}, + { -34,-30,6 ,0}, + { -15,35,10 ,0}, + { -28,-30,22 ,0}, + { -10,35,15 ,0}, + { -16,-30,32 ,0}, //Frame 11 - { -1,35,20 }, - { 3,-30,34 }, - { 12,35,14 }, - { 24,-30,22 }, - { 16,35,2 }, - { 30,-30,2 }, - { 13,35,-9 }, - { 23,-30,-18 }, - { 4,35,-15 }, - { -5,35,-16 }, - { 5,-30,-28 }, - { -13,35,-12 }, - { -13,-30,-26 }, - { -19,35,-5 }, - { -29,-30,-12 }, - { -20,35,3 }, - { -31,-30,6 }, - { -17,35,12 }, - { -26,-30,20 }, - { -11,35,18 }, - { -15,-30,30 }, + { -1,35,20 ,0}, + { 3,-30,34 ,0}, + { 12,35,14 ,0}, + { 24,-30,22 ,0}, + { 16,35,2 ,0}, + { 30,-30,2 ,0}, + { 13,35,-9 ,0}, + { 23,-30,-18 ,0}, + { 4,35,-15 ,0}, + { -5,35,-16 ,0}, + { 5,-30,-28 ,0}, + { -13,35,-12 ,0}, + { -13,-30,-26 ,0}, + { -19,35,-5 ,0}, + { -29,-30,-12 ,0}, + { -20,35,3 ,0}, + { -31,-30,6 ,0}, + { -17,35,12 ,0}, + { -26,-30,20 ,0}, + { -11,35,18 ,0}, + { -15,-30,30 ,0}, //Frame 12 - { 0,35,25 }, - { 3,-30,31 }, - { 15,35,17 }, - { 22,-30,20 }, - { 20,35,3 }, - { 27,-30,2 }, - { 16,35,-11 }, - { 21,-30,-16 }, - { 5,35,-18 }, - { -5,35,-19 }, - { 4,-30,-25 }, - { -15,35,-15 }, - { -12,-30,-23 }, - { -22,35,-7 }, - { -26,-30,-10 }, - { -23,35,4 }, - { -28,-30,6 }, - { -20,35,14 }, - { -24,-30,19 }, - { -12,35,21 }, - { -14,-30,27 }, + { 0,35,25 ,0}, + { 3,-30,31 ,0}, + { 15,35,17 ,0}, + { 22,-30,20 ,0}, + { 20,35,3 ,0}, + { 27,-30,2 ,0}, + { 16,35,-11 ,0}, + { 21,-30,-16 ,0}, + { 5,35,-18 ,0}, + { -5,35,-19 ,0}, + { 4,-30,-25 ,0}, + { -15,35,-15 ,0}, + { -12,-30,-23 ,0}, + { -22,35,-7 ,0}, + { -26,-30,-10 ,0}, + { -23,35,4 ,0}, + { -28,-30,6 ,0}, + { -20,35,14 ,0}, + { -24,-30,19 ,0}, + { -12,35,21 ,0}, + { -14,-30,27 ,0}, //Frame 13 - { 1,35,29 }, - { 2,-30,27 }, - { 19,35,20 }, - { 19,-30,18 }, - { 25,35,3 }, - { 24,-30,2 }, - { 19,35,-13 }, - { 18,-30,-14 }, - { 7,35,-22 }, - { -6,35,-23 }, - { 3,-30,-22 }, - { -17,35,-18 }, - { -11,-30,-20 }, - { -25,35,-8 }, - { -24,-30,-9 }, - { -27,35,5 }, - { -26,-30,5 }, - { -23,35,16 }, - { -21,-30,17 }, - { -14,35,25 }, - { -12,-30,24 }, + { 1,35,29 ,0}, + { 2,-30,27 ,0}, + { 19,35,20 ,0}, + { 19,-30,18 ,0}, + { 25,35,3 ,0}, + { 24,-30,2 ,0}, + { 19,35,-13 ,0}, + { 18,-30,-14 ,0}, + { 7,35,-22 ,0}, + { -6,35,-23 ,0}, + { 3,-30,-22 ,0}, + { -17,35,-18 ,0}, + { -11,-30,-20 ,0}, + { -25,35,-8 ,0}, + { -24,-30,-9 ,0}, + { -27,35,5 ,0}, + { -26,-30,5 ,0}, + { -23,35,16 ,0}, + { -21,-30,17 ,0}, + { -14,35,25 ,0}, + { -12,-30,24 ,0}, //Frame 14 - { 1,35,33 }, - { 1,-30,24 }, - { 22,35,23 }, - { 16,-30,16 }, - { 29,35,4 }, - { 20,-30,2 }, - { 23,35,-16 }, - { 15,-30,-12 }, - { 8,35,-25 }, - { -6,35,-26 }, - { 2,-30,-19 }, - { -19,35,-20 }, - { -10,-30,-17 }, - { -28,35,-9 }, - { -21,-30,-7 }, - { -30,35,5 }, - { -23,-30,5 }, - { -26,35,19 }, - { -19,-30,15 }, - { -15,35,29 }, - { -11,-30,22 }, + { 1,35,33 ,0}, + { 1,-30,24 ,0}, + { 22,35,23 ,0}, + { 16,-30,16 ,0}, + { 29,35,4 ,0}, + { 20,-30,2 ,0}, + { 23,35,-16 ,0}, + { 15,-30,-12 ,0}, + { 8,35,-25 ,0}, + { -6,35,-26 ,0}, + { 2,-30,-19 ,0}, + { -19,35,-20 ,0}, + { -10,-30,-17 ,0}, + { -28,35,-9 ,0}, + { -21,-30,-7 ,0}, + { -30,35,5 ,0}, + { -23,-30,5 ,0}, + { -26,35,19 ,0}, + { -19,-30,15 ,0}, + { -15,35,29 ,0}, + { -11,-30,22 ,0}, //Frame 15 - { 2,35,37 }, - { 1,-30,21 }, - { 25,35,25 }, - { 13,-30,14 }, - { 33,35,4 }, - { 17,-30,2 }, - { 26,35,-17 }, - { 13,-30,-10 }, - { 10,35,-28 }, - { -6,35,-30 }, - { 2,-30,-16 }, - { -21,35,-23 }, - { -9,-30,-14 }, - { -31,35,-10 }, - { -18,-30,-6 }, - { -34,35,6 }, - { -20,-30,5 }, - { -29,35,21 }, - { -17,-30,13 }, - { -17,35,32 }, - { -10,-30,19 }, + { 2,35,37 ,0}, + { 1,-30,21 ,0}, + { 25,35,25 ,0}, + { 13,-30,14 ,0}, + { 33,35,4 ,0}, + { 17,-30,2 ,0}, + { 26,35,-17 ,0}, + { 13,-30,-10 ,0}, + { 10,35,-28 ,0}, + { -6,35,-30 ,0}, + { 2,-30,-16 ,0}, + { -21,35,-23 ,0}, + { -9,-30,-14 ,0}, + { -31,35,-10 ,0}, + { -18,-30,-6 ,0}, + { -34,35,6 ,0}, + { -20,-30,5 ,0}, + { -29,35,21 ,0}, + { -17,-30,13 ,0}, + { -17,35,32 ,0}, + { -10,-30,19 ,0}, //Frame 16 - { 2,35,41 }, - { 0,-30,19 }, - { 28,35,28 }, - { 11,-30,12 }, - { 37,35,4 }, - { 14,-30,2 }, - { 29,35,-19 }, - { 10,-30,-8 }, - { 11,35,-31 }, - { -6,35,-33 }, - { 1,-30,-13 }, - { -23,35,-25 }, - { -8,-30,-12 }, - { -34,35,-11 }, - { -16,-30,-4 }, - { -36,35,6 }, - { -17,-30,4 }, - { -31,35,23 }, - { -15,-30,12 }, - { -18,35,35 }, - { -9,-30,17 }, + { 2,35,41 ,0}, + { 0,-30,19 ,0}, + { 28,35,28 ,0}, + { 11,-30,12 ,0}, + { 37,35,4 ,0}, + { 14,-30,2 ,0}, + { 29,35,-19 ,0}, + { 10,-30,-8 ,0}, + { 11,35,-31 ,0}, + { -6,35,-33 ,0}, + { 1,-30,-13 ,0}, + { -23,35,-25 ,0}, + { -8,-30,-12 ,0}, + { -34,35,-11 ,0}, + { -16,-30,-4 ,0}, + { -36,35,6 ,0}, + { -17,-30,4 ,0}, + { -31,35,23 ,0}, + { -15,-30,12 ,0}, + { -18,35,35 ,0}, + { -9,-30,17 ,0}, //Frame 17 - { 3,35,43 }, - { 0,-30,16 }, - { 30,35,30 }, - { 9,-30,11 }, - { 39,35,5 }, - { 12,-30,2 }, - { 32,35,-21 }, - { 9,-30,-6 }, - { 12,35,-33 }, - { -7,35,-35 }, - { 0,-30,-11 }, - { -24,35,-27 }, - { -7,-30,-10 }, - { -36,35,-12 }, - { -14,-30,-3 }, - { -39,35,7 }, - { -15,-30,4 }, - { -33,35,25 }, - { -13,-30,11 }, - { -19,35,38 }, - { -8,-30,15 }, + { 3,35,43 ,0}, + { 0,-30,16 ,0}, + { 30,35,30 ,0}, + { 9,-30,11 ,0}, + { 39,35,5 ,0}, + { 12,-30,2 ,0}, + { 32,35,-21 ,0}, + { 9,-30,-6 ,0}, + { 12,35,-33 ,0}, + { -7,35,-35 ,0}, + { 0,-30,-11 ,0}, + { -24,35,-27 ,0}, + { -7,-30,-10 ,0}, + { -36,35,-12 ,0}, + { -14,-30,-3 ,0}, + { -39,35,7 ,0}, + { -15,-30,4 ,0}, + { -33,35,25 ,0}, + { -13,-30,11 ,0}, + { -19,35,38 ,0}, + { -8,-30,15 ,0}, //Frame 18 - { 3,35,45 }, - { 0,-30,15 }, - { 32,35,31 }, - { 8,-30,10 }, - { 42,35,5 }, - { 10,-30,2 }, - { 33,35,-22 }, - { 7,-30,-5 }, - { 13,35,-35 }, - { -7,35,-37 }, - { 0,-30,-9 }, - { -25,35,-28 }, - { -7,-30,-8 }, - { -37,35,-13 }, - { -13,-30,-3 }, - { -41,35,7 }, - { -14,-30,4 }, - { -35,35,26 }, - { -12,-30,10 }, - { -20,35,40 }, - { -7,-30,13 }, + { 3,35,45 ,0}, + { 0,-30,15 ,0}, + { 32,35,31 ,0}, + { 8,-30,10 ,0}, + { 42,35,5 ,0}, + { 10,-30,2 ,0}, + { 33,35,-22 ,0}, + { 7,-30,-5 ,0}, + { 13,35,-35 ,0}, + { -7,35,-37 ,0}, + { 0,-30,-9 ,0}, + { -25,35,-28 ,0}, + { -7,-30,-8 ,0}, + { -37,35,-13 ,0}, + { -13,-30,-3 ,0}, + { -41,35,7 ,0}, + { -14,-30,4 ,0}, + { -35,35,26 ,0}, + { -12,-30,10 ,0}, + { -20,35,40 ,0}, + { -7,-30,13 ,0}, //Frame 19 - { 3,35,47 }, - { -1,-30,14 }, - { 33,35,32 }, - { 7,-30,10 }, - { 43,35,5 }, - { 9,-30,2 }, - { 34,35,-22 }, - { 6,-30,-5 }, - { 13,35,-36 }, - { -7,35,-38 }, - { 0,-30,-8 }, - { -26,35,-29 }, - { -7,-30,-7 }, - { -38,35,-13 }, - { -12,-30,-2 }, - { -42,35,7 }, - { -13,-30,4 }, - { -35,35,27 }, - { -11,-30,9 }, - { -20,35,41 }, - { -7,-30,13 } + { 3,35,47 ,0}, + { -1,-30,14 ,0}, + { 33,35,32 ,0}, + { 7,-30,10 ,0}, + { 43,35,5 ,0}, + { 9,-30,2 ,0}, + { 34,35,-22 ,0}, + { 6,-30,-5 ,0}, + { 13,35,-36 ,0}, + { -7,35,-38 ,0}, + { 0,-30,-8 ,0}, + { -26,35,-29 ,0}, + { -7,-30,-7 ,0}, + { -38,35,-13 ,0}, + { -12,-30,-2 ,0}, + { -42,35,7 ,0}, + { -13,-30,4 ,0}, + { -35,35,27 ,0}, + { -11,-30,9 ,0}, + { -20,35,41 ,0}, + { -7,-30,13 ,0} } }; @@ -1826,7 +1826,7 @@ MESH level1_meshCylindre = { 1, 0, 0, - 1, + 0, 0, 0, 0, @@ -1840,42 +1840,42 @@ MESH level1_meshCylindre = { }; SVECTOR level1_modelgnd_mesh[] = { - { 200,0,-98 }, - { 103,0,-98 }, - { 200,0,-1 }, - { 103,0,-1 }, - { 5,0,-98 }, - { 5,0,-1 }, - { 200,0,97 }, - { 103,0,97 }, - { -92,0,-98 }, - { 5,0,97 }, - { -92,0,-1 }, - { 200,0,194 }, - { 103,0,194 }, - { -92,0,97 }, - { -190,0,-98 }, - { 5,0,194 }, - { -190,0,-1 }, - { -92,0,194 }, - { -190,0,97 }, - { -287,0,-98 }, - { -287,0,-1 }, - { -190,0,194 }, - { -287,0,97 }, - { -385,0,-98 }, - { -287,0,194 }, - { -385,0,-1 }, - { -385,0,97 }, - { -385,0,194 }, - { -482,0,-98 }, - { -482,0,-1 }, - { -482,0,97 }, - { -482,0,194 }, - { -580,0,-98 }, - { -580,0,-1 }, - { -580,0,97 }, - { -580,0,194 } + { 200,0,-98 ,0}, + { 103,0,-98 ,0}, + { 200,0,-1 ,0}, + { 103,0,-1 ,0}, + { 5,0,-98 ,0}, + { 5,0,-1 ,0}, + { 200,0,97 ,0}, + { 103,0,97 ,0}, + { -92,0,-98 ,0}, + { 5,0,97 ,0}, + { -92,0,-1 ,0}, + { 200,0,194 ,0}, + { 103,0,194 ,0}, + { -92,0,97 ,0}, + { -190,0,-98 ,0}, + { 5,0,194 ,0}, + { -190,0,-1 ,0}, + { -92,0,194 ,0}, + { -190,0,97 ,0}, + { -287,0,-98 ,0}, + { -287,0,-1 ,0}, + { -190,0,194 ,0}, + { -287,0,97 ,0}, + { -385,0,-98 ,0}, + { -287,0,194 ,0}, + { -385,0,-1 ,0}, + { -385,0,97 ,0}, + { -385,0,194 ,0}, + { -482,0,-98 ,0}, + { -482,0,-1 ,0}, + { -482,0,97 ,0}, + { -482,0,194 ,0}, + { -580,0,-98 ,0}, + { -580,0,-1 ,0}, + { -580,0,97 ,0}, + { -580,0,194, 0 } }; SVECTOR level1_modelgnd_normal[] = { @@ -2309,30 +2309,30 @@ MESH level1_meshgnd = { }; SVECTOR level1_modelgnd_001_mesh[] = { - { 200,0,194 }, - { 103,0,194 }, - { 5,0,194 }, - { -92,0,194 }, - { 200,0,292 }, - { 103,0,292 }, - { 5,0,292 }, - { -92,0,292 }, - { 200,0,389 }, - { 103,0,389 }, - { 5,0,389 }, - { -92,0,389 }, - { 200,0,487 }, - { 103,0,487 }, - { 5,0,487 }, - { -92,0,487 }, - { 200,0,584 }, - { 103,0,584 }, - { 5,0,584 }, - { -92,0,584 }, - { 200,0,682 }, - { 103,0,682 }, - { 5,0,682 }, - { -92,0,682 } + { 200,0,194 ,0}, + { 103,0,194 ,0}, + { 5,0,194 ,0}, + { -92,0,194 ,0}, + { 200,0,292 ,0}, + { 103,0,292 ,0}, + { 5,0,292 ,0}, + { -92,0,292 ,0}, + { 200,0,389 ,0}, + { 103,0,389 ,0}, + { 5,0,389 ,0}, + { -92,0,389 ,0}, + { 200,0,487 ,0}, + { 103,0,487 ,0}, + { 5,0,487 ,0}, + { -92,0,487 ,0}, + { 200,0,584 ,0}, + { 103,0,584 ,0}, + { 5,0,584 ,0}, + { -92,0,584 ,0}, + { 200,0,682 ,0}, + { 103,0,682 ,0}, + { 5,0,682 ,0}, + { -92,0,682,0 } }; SVECTOR level1_modelgnd_001_normal[] = { @@ -2628,30 +2628,30 @@ MESH level1_meshgnd_001 = { }; SVECTOR level1_modelgnd_003_mesh[] = { - { -224,0,-586 }, - { -321,0,-586 }, - { -419,0,-586 }, - { -516,0,-586 }, - { -224,0,-488 }, - { -321,0,-488 }, - { -419,0,-488 }, - { -516,0,-488 }, - { -224,0,-391 }, - { -321,0,-391 }, - { -419,0,-391 }, - { -516,0,-391 }, - { -224,0,-293 }, - { -321,0,-293 }, - { -419,0,-293 }, - { -516,0,-293 }, - { -224,0,-196 }, - { -321,0,-196 }, - { -419,0,-196 }, - { -516,0,-196 }, - { -224,0,-98 }, - { -321,0,-98 }, - { -419,0,-98 }, - { -516,0,-98 } + { -224,0,-586 ,0}, + { -321,0,-586 ,0}, + { -419,0,-586 ,0}, + { -516,0,-586 ,0}, + { -224,0,-488 ,0}, + { -321,0,-488 ,0}, + { -419,0,-488 ,0}, + { -516,0,-488 ,0}, + { -224,0,-391 ,0}, + { -321,0,-391 ,0}, + { -419,0,-391 ,0}, + { -516,0,-391 ,0}, + { -224,0,-293 ,0}, + { -321,0,-293 ,0}, + { -419,0,-293 ,0}, + { -516,0,-293 ,0}, + { -224,0,-196 ,0}, + { -321,0,-196 ,0}, + { -419,0,-196 ,0}, + { -516,0,-196 ,0}, + { -224,0,-98 ,0}, + { -321,0,-98 ,0}, + { -419,0,-98 ,0}, + { -516,0,-98, 0 } }; SVECTOR level1_modelgnd_003_normal[] = { @@ -2947,30 +2947,30 @@ MESH level1_meshgnd_003 = { }; SVECTOR level1_modelgnd_002_mesh[] = { - { 459,0,-586 }, - { 361,0,-586 }, - { 264,0,-586 }, - { 166,0,-586 }, - { 459,0,-488 }, - { 361,0,-488 }, - { 264,0,-488 }, - { 166,0,-488 }, - { 459,0,-391 }, - { 361,0,-391 }, - { 264,0,-391 }, - { 166,0,-391 }, - { 459,0,-293 }, - { 361,0,-293 }, - { 264,0,-293 }, - { 166,0,-293 }, - { 459,0,-196 }, - { 361,0,-196 }, - { 264,0,-196 }, - { 166,0,-196 }, - { 459,0,-98 }, - { 361,0,-98 }, - { 264,0,-98 }, - { 166,0,-98 } + { 459,0,-586 ,0}, + { 361,0,-586 ,0}, + { 264,0,-586 ,0}, + { 166,0,-586 ,0}, + { 459,0,-488 ,0}, + { 361,0,-488 ,0}, + { 264,0,-488 ,0}, + { 166,0,-488 ,0}, + { 459,0,-391 ,0}, + { 361,0,-391 ,0}, + { 264,0,-391 ,0}, + { 166,0,-391 ,0}, + { 459,0,-293 ,0}, + { 361,0,-293 ,0}, + { 264,0,-293 ,0}, + { 166,0,-293 ,0}, + { 459,0,-196 ,0}, + { 361,0,-196 ,0}, + { 264,0,-196 ,0}, + { 166,0,-196 ,0}, + { 459,0,-98 ,0}, + { 361,0,-98 ,0}, + { 264,0,-98 ,0}, + { 166,0,-98 ,0} }; SVECTOR level1_modelgnd_002_normal[] = { @@ -3266,350 +3266,350 @@ MESH level1_meshgnd_002 = { }; SVECTOR level1_modelLara_mesh[] = { - { 5,-78,12 }, - { 9,-75,11 }, - { 8,-69,11 }, - { 6,-74,9 }, - { 0,-75,12 }, - { 10,-70,8 }, - { 0,-75,12 }, - { 8,-66,10 }, - { 0,-68,14 }, - { -4,-78,11 }, - { 8,-64,10 }, - { 0,-66,14 }, - { 7,-63,11 }, - { 0,-64,13 }, - { 0,-61,16 }, - { 3,-61,13 }, - { 0,-60,14 }, - { 0,-79,2 }, - { -5,-74,9 }, - { -8,-75,10 }, - { 7,-76,-2 }, - { 8,-66,3 }, - { -3,-60,13 }, - { -7,-68,11 }, - { -7,-66,10 }, - { 8,-66,-1 }, - { 3,-54,10 }, - { -7,-63,11 }, - { -7,-64,10 }, - { -9,-70,8 }, - { 0,-53,12 }, - { 2,-78,-4 }, - { 9,-67,-4 }, - { -2,-54,10 }, - { 8,-38,16 }, - { 11,-37,14 }, - { 10,-40,12 }, - { -2,-78,-4 }, - { 13,-48,4 }, - { 11,-40,10 }, - { 6,-57,1 }, - { 10,-35,15 }, - { 6,-41,12 }, - { 13,-46,4 }, - { -7,-76,-2 }, - { 12,-42,7 }, - { 14,-42,5 }, - { -7,-66,3 }, - { 13,-36,11 }, - { 6,-42,9 }, - { 2,-57,1 }, - { 18,-44,1 }, - { 6,-34,16 }, - { 4,-73,-9 }, - { 5,-44,8 }, - { 13,-47,0 }, - { 11,-32,12 }, - { 10,-45,2 }, - { 12,-35,8 }, - { 3,-49,3 }, - { 10,-42,3 }, - { -3,-57,1 }, - { -7,-66,-1 }, - { 3,-55,-1 }, - { 15,-45,-2 }, - { 13,-48,-4 }, - { -4,-73,-9 }, - { 6,-31,13 }, - { 4,-67,-11 }, - { -6,-57,1 }, - { 2,-57,-5 }, - { 11,-31,9 }, - { 10,-44,-1 }, - { 4,-57,-6 }, - { -3,-55,-1 }, - { 4,-59,-8 }, - { -8,-67,-4 }, - { -9,-38,16 }, - { -4,-49,3 }, - { -8,-41,12 }, - { -6,-44,8 }, - { 9,-48,-6 }, - { -8,-42,9 }, - { -3,-57,-5 }, - { 5,-61,-12 }, - { 4,-50,-6 }, - { -8,-34,16 }, - { 7,-29,9 }, - { 9,-48,-8 }, - { 4,-58,-11 }, - { -11,-40,12 }, - { -4,-67,-11 }, - { 2,-66,-15 }, - { -4,-57,-6 }, - { -11,-35,15 }, - { -12,-37,14 }, - { -4,-59,-8 }, - { -12,-40,10 }, - { -2,-66,-15 }, - { 8,-24,8 }, - { -13,-48,4 }, - { -8,-31,13 }, - { 2,-62,-16 }, - { 24,-23,-1 }, - { -13,-42,7 }, - { 26,-25,-4 }, - { -4,-58,-11 }, - { -4,-61,-12 }, - { 2,-57,-14 }, - { -5,-50,-6 }, - { -13,-45,4 }, - { 9,-46,-12 }, - { -11,-45,2 }, - { -10,-42,3 }, - { -14,-36,11 }, - { -12,-32,12 }, - { -2,-62,-16 }, - { 24,-22,-3 }, - { -2,-57,-14 }, - { -13,-46,0 }, - { -15,-42,5 }, - { -8,-29,9 }, - { 20,-22,-3 }, - { 11,-37,-10 }, - { 24,-25,-8 }, - { -13,-35,8 }, - { -9,-48,-6 }, - { -11,-43,-1 }, - { 24,-23,-7 }, - { -12,-31,9 }, - { 23,-22,-5 }, - { -9,-48,-8 }, - { -13,-48,-4 }, - { 10,-30,-7 }, - { 7,-18,6 }, - { 20,-23,-7 }, - { -18,-43,1 }, - { -15,-44,-2 }, - { -8,-24,8 }, - { 9,-12,7 }, - { 9,-30,-10 }, - { 8,-23,-3 }, - { 9,-34,-13 }, - { -9,-46,-12 }, - { 34,-3,-1 }, - { 7,-17,-2 }, - { 35,-4,-4 }, - { -7,-18,6 }, - { 30,-3,-1 }, - { 9,-14,-2 }, - { 7,-4,8 }, - { -11,-37,-10 }, - { 16,-5,2 }, - { 33,-3,-6 }, - { -10,-30,-7 }, - { 39,6,1 }, - { -8,-12,7 }, - { -8,-23,-3 }, - { 30,-2,-6 }, - { -9,-30,-10 }, - { -9,-34,-13 }, - { 22,2,1 }, - { 17,1,2 }, - { -7,-17,-2 }, - { 32,9,1 }, - { -6,-4,8 }, - { 18,4,1 }, - { -8,-14,-2 }, - { 38,6,-7 }, - { 9,6,7 }, - { 21,1,-7 }, - { 13,-7,-10 }, - { -26,-24,-1 }, - { -22,-22,-3 }, - { 16,0,-8 }, - { 32,9,-7 }, - { -22,-23,-7 }, - { -26,-22,-3 }, - { -24,-21,-5 }, - { -29,-25,-5 }, - { -26,-25,-8 }, - { -15,-5,2 }, - { -26,-23,-7 }, - { -8,6,7 }, - { 2,11,1 }, - { -12,-7,-10 }, - { -18,1,2 }, - { 21,20,-1 }, - { 13,5,-15 }, - { -1,11,0 }, - { 18,22,1 }, - { 20,20,-7 }, - { 5,12,-8 }, - { 11,12,-12 }, - { -23,2,1 }, - { -3,11,-6 }, - { -18,6,0 }, - { -17,0,-8 }, - { 11,28,5 }, - { 17,21,-8 }, - { 18,27,-1 }, - { -1,7,-14 }, - { -22,1,-7 }, - { -33,-2,-2 }, - { -35,-3,0 }, - { -35,-3,-3 }, - { -33,-1,-4 }, - { -11,12,-10 }, - { -35,-2,-5 }, - { -15,5,-15 }, - { 4,29,-1 }, - { 16,27,-11 }, - { -34,9,3 }, - { -10,29,5 }, - { -2,29,-1 }, - { -40,6,3 }, - { -18,22,1 }, - { 7,27,-11 }, - { -21,20,-1 }, - { -34,9,-6 }, - { -20,20,-6 }, - { -17,21,-8 }, - { -40,6,-5 }, - { -18,27,-1 }, - { -6,28,-11 }, - { -15,27,-11 }, - { 12,49,0 }, - { 12,47,-3 }, - { 16,49,-4 }, - { 15,48,-9 }, - { 8,49,-5 }, - { 10,49,-9 }, - { 13,57,-1 }, - { 15,56,-3 }, - { 19,56,-5 }, - { 17,54,-9 }, - { 11,57,-3 }, - { 17,54,-11 }, - { -11,49,0 }, - { -7,49,-4 }, - { 14,54,-11 }, - { -9,47,-7 }, - { -15,47,-3 }, - { 8,57,-6 }, - { 9,55,-9 }, - { 10,55,-11 }, - { -14,47,-7 }, - { 14,65,-2 }, - { 18,65,-5 }, - { 22,64,-7 }, - { -12,52,-7 }, - { 20,63,-11 }, - { 19,61,-15 }, - { 11,65,-5 }, - { 15,69,-2 }, - { 18,69,-5 }, - { 21,68,-8 }, - { 14,61,-15 }, - { 20,68,-11 }, - { 12,69,-5 }, - { 7,66,-8 }, - { 8,64,-11 }, - { 10,62,-15 }, - { 19,66,-14 }, - { 15,73,-3 }, - { 18,73,-5 }, - { 21,72,-8 }, - { 14,67,-14 }, - { 8,69,-8 }, - { 20,72,-11 }, - { 12,73,-5 }, - { 9,69,-11 }, - { 11,67,-14 }, - { -13,65,-2 }, - { -6,66,-8 }, - { 19,72,-14 }, - { 10,73,-8 }, - { 15,72,-14 }, - { -9,62,-15 }, - { 11,73,-11 }, - { 12,72,-14 }, - { -21,64,-7 }, - { -18,61,-15 }, - { 16,83,-3 }, - { 18,82,-5 }, - { 20,82,-8 }, - { 14,83,-5 }, - { 19,81,-10 }, - { -14,73,-3 }, - { -9,73,-8 }, - { 19,81,-13 }, - { 11,83,-8 }, - { 12,82,-10 }, - { 15,82,-13 }, - { 13,82,-13 }, - { -11,72,-14 }, - { -20,72,-8 }, - { -18,72,-14 }, - { 20,91,-7 }, - { 17,92,-5 }, - { 19,102,11 }, - { 19,92,-7 }, - { 20,93,-6 }, - { 14,92,-6 }, - { 21,97,-1 }, - { 19,91,-10 }, - { 14,92,-5 }, - { 18,93,-6 }, - { 15,93,-6 }, - { 14,102,11 }, - { 19,92,-9 }, - { 19,91,-12 }, - { 13,93,-7 }, - { 13,92,-10 }, - { 16,91,-12 }, - { 18,92,-12 }, - { 12,97,-1 }, - { 14,93,-10 }, - { 15,93,-12 }, - { 20,106,11 }, - { 13,106,11 }, - { 21,96,-15 }, - { 22,106,1 }, - { -12,92,-7 }, - { -15,92,-5 }, - { 12,96,-15 }, - { -13,102,10 }, - { -10,97,-1 }, - { 11,106,-2 }, - { -19,91,-7 }, - { -13,91,-12 }, - { -18,102,10 }, - { -20,97,-1 }, - { -12,106,10 }, - { -19,91,-14 }, - { 20,104,-17 }, - { -19,106,10 }, - { -11,96,-16 }, - { 13,104,-17 }, - { -9,105,-2 }, - { -20,96,-16 }, - { -21,106,0 }, - { -12,104,-18 }, - { -19,104,-18 } + { 5,-78,12 ,0}, + { 9,-75,11 ,0}, + { 8,-69,11 ,0}, + { 6,-74,9 ,0}, + { 0,-75,12 ,0}, + { 10,-70,8 ,0}, + { 0,-75,12 ,0}, + { 8,-66,10 ,0}, + { 0,-68,14 ,0}, + { -4,-78,11 ,0}, + { 8,-64,10 ,0}, + { 0,-66,14 ,0}, + { 7,-63,11 ,0}, + { 0,-64,13 ,0}, + { 0,-61,16 ,0}, + { 3,-61,13 ,0}, + { 0,-60,14 ,0}, + { 0,-79,2 ,0}, + { -5,-74,9 ,0}, + { -8,-75,10 ,0}, + { 7,-76,-2 ,0}, + { 8,-66,3 ,0}, + { -3,-60,13 ,0}, + { -7,-68,11 ,0}, + { -7,-66,10 ,0}, + { 8,-66,-1 ,0}, + { 3,-54,10 ,0}, + { -7,-63,11 ,0}, + { -7,-64,10 ,0}, + { -9,-70,8 ,0}, + { 0,-53,12 ,0}, + { 2,-78,-4 ,0}, + { 9,-67,-4 ,0}, + { -2,-54,10 ,0}, + { 8,-38,16 ,0}, + { 11,-37,14 ,0}, + { 10,-40,12 ,0}, + { -2,-78,-4 ,0}, + { 13,-48,4 ,0}, + { 11,-40,10 ,0}, + { 6,-57,1 ,0}, + { 10,-35,15 ,0}, + { 6,-41,12 ,0}, + { 13,-46,4 ,0}, + { -7,-76,-2 ,0}, + { 12,-42,7 ,0}, + { 14,-42,5 ,0}, + { -7,-66,3 ,0}, + { 13,-36,11 ,0}, + { 6,-42,9 ,0}, + { 2,-57,1 ,0}, + { 18,-44,1 ,0}, + { 6,-34,16 ,0}, + { 4,-73,-9 ,0}, + { 5,-44,8 ,0}, + { 13,-47,0 ,0}, + { 11,-32,12 ,0}, + { 10,-45,2 ,0}, + { 12,-35,8 ,0}, + { 3,-49,3 ,0}, + { 10,-42,3 ,0}, + { -3,-57,1 ,0}, + { -7,-66,-1 ,0}, + { 3,-55,-1 ,0}, + { 15,-45,-2 ,0}, + { 13,-48,-4 ,0}, + { -4,-73,-9 ,0}, + { 6,-31,13 ,0}, + { 4,-67,-11 ,0}, + { -6,-57,1 ,0}, + { 2,-57,-5 ,0}, + { 11,-31,9 ,0}, + { 10,-44,-1 ,0}, + { 4,-57,-6 ,0}, + { -3,-55,-1 ,0}, + { 4,-59,-8 ,0}, + { -8,-67,-4 ,0}, + { -9,-38,16 ,0}, + { -4,-49,3 ,0}, + { -8,-41,12 ,0}, + { -6,-44,8 ,0}, + { 9,-48,-6 ,0}, + { -8,-42,9 ,0}, + { -3,-57,-5 ,0}, + { 5,-61,-12 ,0}, + { 4,-50,-6 ,0}, + { -8,-34,16 ,0}, + { 7,-29,9 ,0}, + { 9,-48,-8 ,0}, + { 4,-58,-11 ,0}, + { -11,-40,12 ,0}, + { -4,-67,-11 ,0}, + { 2,-66,-15 ,0}, + { -4,-57,-6 ,0}, + { -11,-35,15 ,0}, + { -12,-37,14 ,0}, + { -4,-59,-8 ,0}, + { -12,-40,10 ,0}, + { -2,-66,-15 ,0}, + { 8,-24,8 ,0}, + { -13,-48,4 ,0}, + { -8,-31,13 ,0}, + { 2,-62,-16 ,0}, + { 24,-23,-1 ,0}, + { -13,-42,7 ,0}, + { 26,-25,-4 ,0}, + { -4,-58,-11 ,0}, + { -4,-61,-12 ,0}, + { 2,-57,-14 ,0}, + { -5,-50,-6 ,0}, + { -13,-45,4 ,0}, + { 9,-46,-12 ,0}, + { -11,-45,2 ,0}, + { -10,-42,3 ,0}, + { -14,-36,11 ,0}, + { -12,-32,12 ,0}, + { -2,-62,-16 ,0}, + { 24,-22,-3 ,0}, + { -2,-57,-14 ,0}, + { -13,-46,0 ,0}, + { -15,-42,5 ,0}, + { -8,-29,9 ,0}, + { 20,-22,-3 ,0}, + { 11,-37,-10 ,0}, + { 24,-25,-8 ,0}, + { -13,-35,8 ,0}, + { -9,-48,-6 ,0}, + { -11,-43,-1 ,0}, + { 24,-23,-7 ,0}, + { -12,-31,9 ,0}, + { 23,-22,-5 ,0}, + { -9,-48,-8 ,0}, + { -13,-48,-4 ,0}, + { 10,-30,-7 ,0}, + { 7,-18,6 ,0}, + { 20,-23,-7 ,0}, + { -18,-43,1 ,0}, + { -15,-44,-2 ,0}, + { -8,-24,8 ,0}, + { 9,-12,7 ,0}, + { 9,-30,-10 ,0}, + { 8,-23,-3 ,0}, + { 9,-34,-13 ,0}, + { -9,-46,-12 ,0}, + { 34,-3,-1 ,0}, + { 7,-17,-2 ,0}, + { 35,-4,-4 ,0}, + { -7,-18,6 ,0}, + { 30,-3,-1 ,0}, + { 9,-14,-2 ,0}, + { 7,-4,8 ,0}, + { -11,-37,-10 ,0}, + { 16,-5,2 ,0}, + { 33,-3,-6 ,0}, + { -10,-30,-7 ,0}, + { 39,6,1 ,0}, + { -8,-12,7 ,0}, + { -8,-23,-3 ,0}, + { 30,-2,-6 ,0}, + { -9,-30,-10 ,0}, + { -9,-34,-13 ,0}, + { 22,2,1 ,0}, + { 17,1,2 ,0}, + { -7,-17,-2 ,0}, + { 32,9,1 ,0}, + { -6,-4,8 ,0}, + { 18,4,1 ,0}, + { -8,-14,-2 ,0}, + { 38,6,-7 ,0}, + { 9,6,7 ,0}, + { 21,1,-7 ,0}, + { 13,-7,-10 ,0}, + { -26,-24,-1 ,0}, + { -22,-22,-3 ,0}, + { 16,0,-8 ,0}, + { 32,9,-7 ,0}, + { -22,-23,-7 ,0}, + { -26,-22,-3 ,0}, + { -24,-21,-5 ,0}, + { -29,-25,-5 ,0}, + { -26,-25,-8 ,0}, + { -15,-5,2 ,0}, + { -26,-23,-7 ,0}, + { -8,6,7 ,0}, + { 2,11,1 ,0}, + { -12,-7,-10 ,0}, + { -18,1,2 ,0}, + { 21,20,-1 ,0}, + { 13,5,-15 ,0}, + { -1,11,0 ,0}, + { 18,22,1 ,0}, + { 20,20,-7 ,0}, + { 5,12,-8 ,0}, + { 11,12,-12 ,0}, + { -23,2,1 ,0}, + { -3,11,-6 ,0}, + { -18,6,0 ,0}, + { -17,0,-8 ,0}, + { 11,28,5 ,0}, + { 17,21,-8 ,0}, + { 18,27,-1 ,0}, + { -1,7,-14 ,0}, + { -22,1,-7 ,0}, + { -33,-2,-2 ,0}, + { -35,-3,0 ,0}, + { -35,-3,-3 ,0}, + { -33,-1,-4 ,0}, + { -11,12,-10 ,0}, + { -35,-2,-5 ,0}, + { -15,5,-15 ,0}, + { 4,29,-1 ,0}, + { 16,27,-11 ,0}, + { -34,9,3 ,0}, + { -10,29,5 ,0}, + { -2,29,-1 ,0}, + { -40,6,3 ,0}, + { -18,22,1 ,0}, + { 7,27,-11 ,0}, + { -21,20,-1 ,0}, + { -34,9,-6 ,0}, + { -20,20,-6 ,0}, + { -17,21,-8 ,0}, + { -40,6,-5 ,0}, + { -18,27,-1 ,0}, + { -6,28,-11 ,0}, + { -15,27,-11 ,0}, + { 12,49,0 ,0}, + { 12,47,-3 ,0}, + { 16,49,-4 ,0}, + { 15,48,-9 ,0}, + { 8,49,-5 ,0}, + { 10,49,-9 ,0}, + { 13,57,-1 ,0}, + { 15,56,-3 ,0}, + { 19,56,-5 ,0}, + { 17,54,-9 ,0}, + { 11,57,-3 ,0}, + { 17,54,-11 ,0}, + { -11,49,0 ,0}, + { -7,49,-4 ,0}, + { 14,54,-11 ,0}, + { -9,47,-7 ,0}, + { -15,47,-3 ,0}, + { 8,57,-6 ,0}, + { 9,55,-9 ,0}, + { 10,55,-11 ,0}, + { -14,47,-7 ,0}, + { 14,65,-2 ,0}, + { 18,65,-5 ,0}, + { 22,64,-7 ,0}, + { -12,52,-7 ,0}, + { 20,63,-11 ,0}, + { 19,61,-15 ,0}, + { 11,65,-5 ,0}, + { 15,69,-2 ,0}, + { 18,69,-5 ,0}, + { 21,68,-8 ,0}, + { 14,61,-15 ,0}, + { 20,68,-11 ,0}, + { 12,69,-5 ,0}, + { 7,66,-8 ,0}, + { 8,64,-11 ,0}, + { 10,62,-15 ,0}, + { 19,66,-14 ,0}, + { 15,73,-3 ,0}, + { 18,73,-5 ,0}, + { 21,72,-8 ,0}, + { 14,67,-14 ,0}, + { 8,69,-8 ,0}, + { 20,72,-11 ,0}, + { 12,73,-5 ,0}, + { 9,69,-11 ,0}, + { 11,67,-14 ,0}, + { -13,65,-2 ,0}, + { -6,66,-8 ,0}, + { 19,72,-14 ,0}, + { 10,73,-8 ,0}, + { 15,72,-14 ,0}, + { -9,62,-15 ,0}, + { 11,73,-11 ,0}, + { 12,72,-14 ,0}, + { -21,64,-7 ,0}, + { -18,61,-15 ,0}, + { 16,83,-3 ,0}, + { 18,82,-5 ,0}, + { 20,82,-8 ,0}, + { 14,83,-5 ,0}, + { 19,81,-10 ,0}, + { -14,73,-3 ,0}, + { -9,73,-8 ,0}, + { 19,81,-13 ,0}, + { 11,83,-8 ,0}, + { 12,82,-10 ,0}, + { 15,82,-13 ,0}, + { 13,82,-13 ,0}, + { -11,72,-14 ,0}, + { -20,72,-8 ,0}, + { -18,72,-14 ,0}, + { 20,91,-7 ,0}, + { 17,92,-5 ,0}, + { 19,102,11 ,0}, + { 19,92,-7 ,0}, + { 20,93,-6 ,0}, + { 14,92,-6 ,0}, + { 21,97,-1 ,0}, + { 19,91,-10 ,0}, + { 14,92,-5 ,0}, + { 18,93,-6 ,0}, + { 15,93,-6 ,0}, + { 14,102,11 ,0}, + { 19,92,-9 ,0}, + { 19,91,-12 ,0}, + { 13,93,-7 ,0}, + { 13,92,-10 ,0}, + { 16,91,-12 ,0}, + { 18,92,-12 ,0}, + { 12,97,-1 ,0}, + { 14,93,-10 ,0}, + { 15,93,-12 ,0}, + { 20,106,11 ,0}, + { 13,106,11 ,0}, + { 21,96,-15 ,0}, + { 22,106,1 ,0}, + { -12,92,-7 ,0}, + { -15,92,-5 ,0}, + { 12,96,-15 ,0}, + { -13,102,10 ,0}, + { -10,97,-1 ,0}, + { 11,106,-2 ,0}, + { -19,91,-7 ,0}, + { -13,91,-12 ,0}, + { -18,102,10 ,0}, + { -20,97,-1 ,0}, + { -12,106,10 ,0}, + { -19,91,-14 ,0}, + { 20,104,-17 ,0}, + { -19,106,10 ,0}, + { -11,96,-16 ,0}, + { 13,104,-17 ,0}, + { -9,105,-2 ,0}, + { -20,96,-16 ,0}, + { -21,106,0 ,0}, + { -12,104,-18 ,0}, + { -19,104,-18, 0 } }; SVECTOR level1_modelLara_normal[] = { @@ -8879,14 +8879,14 @@ MESH level1_meshLara = { }; SVECTOR level1_modelobject_mesh[] = { - { 9,17,-20 }, - { 9,0,-20 }, - { -9,17,-22 }, - { -9,0,-22 }, - { 19,20,18 }, - { 19,-32,18 }, - { -20,20,18 }, - { -20,-32,18 } + { 9,17,-20 ,0}, + { 9,0,-20 ,0}, + { -9,17,-22 ,0}, + { -9,0,-22 ,0}, + { 19,20,18 ,0}, + { 19,-32,18 ,0}, + { -20,20,18 ,0}, + { -20,-32,18, 0 } }; SVECTOR level1_modelobject_normal[] = { @@ -9117,33 +9117,33 @@ MESH level1_meshPlan = { }; SVECTOR level1_modelSphere_mesh[] = { - { 0,-8,24 }, - { 4,5,25 }, - { 9,-18,15 }, - { 22,-2,12 }, - { 19,12,11 }, - { 11,21,10 }, - { 24,-9,-1 }, - { 8,-23,-5 }, - { 17,-12,-14 }, - { 20,11,-11 }, - { 5,-15,-19 }, - { 7,3,-24 }, - { 7,21,-11 }, - { -8,-8,-23 }, - { -9,11,-20 }, - { 0,-24,4 }, - { -18,-10,-14 }, - { -7,23,-7 }, - { -6,-23,-5 }, - { -19,12,-11 }, - { -21,-14,1 }, - { -25,-2,1 }, - { -12,-17,14 }, - { -18,12,13 }, - { -17,-2,18 }, - { -8,24,4 }, - { -6,18,16 } + { 0,-8,24 ,0}, + { 4,5,25 ,0}, + { 9,-18,15 ,0}, + { 22,-2,12 ,0}, + { 19,12,11 ,0}, + { 11,21,10 ,0}, + { 24,-9,-1 ,0}, + { 8,-23,-5 ,0}, + { 17,-12,-14 ,0}, + { 20,11,-11 ,0}, + { 5,-15,-19 ,0}, + { 7,3,-24 ,0}, + { 7,21,-11 ,0}, + { -8,-8,-23 ,0}, + { -9,11,-20 ,0}, + { 0,-24,4 ,0}, + { -18,-10,-14 ,0}, + { -7,23,-7 ,0}, + { -6,-23,-5 ,0}, + { -19,12,-11 ,0}, + { -21,-14,1 ,0}, + { -25,-2,1 ,0}, + { -12,-17,14 ,0}, + { -18,12,13 ,0}, + { -17,-2,18 ,0}, + { -8,24,4 ,0}, + { -6,18,16, 0 } }; SVECTOR level1_modelSphere_normal[] = { @@ -9582,33 +9582,33 @@ MESH level1_meshSphere = { }; SVECTOR level1_modelSphere_001_mesh[] = { - { 0,-8,24 }, - { 4,5,25 }, - { 9,-18,15 }, - { 22,-2,12 }, - { 19,12,11 }, - { 11,21,10 }, - { 24,-9,-1 }, - { 8,-23,-5 }, - { 17,-12,-14 }, - { 20,11,-11 }, - { 5,-15,-19 }, - { 7,3,-24 }, - { 7,21,-11 }, - { -8,-8,-23 }, - { -9,11,-20 }, - { 0,-24,4 }, - { -18,-10,-14 }, - { -7,23,-7 }, - { -6,-23,-5 }, - { -19,12,-11 }, - { -21,-14,1 }, - { -25,-2,1 }, - { -12,-17,14 }, - { -18,12,13 }, - { -17,-2,18 }, - { -8,24,4 }, - { -6,18,16 } + { 0,-8,24 ,0}, + { 4,5,25 ,0}, + { 9,-18,15 ,0}, + { 22,-2,12 ,0}, + { 19,12,11 ,0}, + { 11,21,10 ,0}, + { 24,-9,-1 ,0}, + { 8,-23,-5 ,0}, + { 17,-12,-14 ,0}, + { 20,11,-11 ,0}, + { 5,-15,-19 ,0}, + { 7,3,-24 ,0}, + { 7,21,-11 ,0}, + { -8,-8,-23 ,0}, + { -9,11,-20 ,0}, + { 0,-24,4 ,0}, + { -18,-10,-14 ,0}, + { -7,23,-7 ,0}, + { -6,-23,-5 ,0}, + { -19,12,-11 ,0}, + { -21,-14,1 ,0}, + { -25,-2,1 ,0}, + { -12,-17,14 ,0}, + { -18,12,13 ,0}, + { -17,-2,18 ,0}, + { -8,24,4 ,0}, + { -6,18,16, 0 } }; SVECTOR level1_modelSphere_001_normal[] = { @@ -10047,18 +10047,18 @@ MESH level1_meshSphere_001 = { }; SVECTOR level1_modelwall_mesh[] = { - { -580,-97,-98 }, - { -580,0,-98 }, - { -580,-195,-98 }, - { -580,-97,-1 }, - { -580,0,-1 }, - { -580,-195,-1 }, - { -580,-97,97 }, - { -580,0,97 }, - { -580,-195,97 }, - { -580,-97,194 }, - { -580,0,194 }, - { -580,-195,194 } + { -580,-97,-98 ,0}, + { -580,0,-98 ,0}, + { -580,-195,-98 ,0}, + { -580,-97,-1 ,0}, + { -580,0,-1 ,0}, + { -580,-195,-1 ,0}, + { -580,-97,97 ,0}, + { -580,0,97 ,0}, + { -580,-195,97 ,0}, + { -580,-97,194 ,0}, + { -580,0,194 ,0}, + { -580,-195,194, 0 } }; SVECTOR level1_modelwall_normal[] = { @@ -10216,24 +10216,24 @@ MESH level1_meshwall = { }; SVECTOR level1_modelwall_001_mesh[] = { - { -92,-97,194 }, - { -92,0,194 }, - { -92,-195,194 }, - { -190,-97,194 }, - { -190,0,194 }, - { -190,-195,194 }, - { -287,-97,194 }, - { -287,0,194 }, - { -287,-195,194 }, - { -385,-97,194 }, - { -385,0,194 }, - { -385,-195,194 }, - { -482,-97,194 }, - { -482,0,194 }, - { -482,-195,194 }, - { -580,-97,194 }, - { -580,0,194 }, - { -580,-195,194 } + { -92,-97,194 ,0}, + { -92,0,194 ,0}, + { -92,-195,194 ,0}, + { -190,-97,194 ,0}, + { -190,0,194 ,0}, + { -190,-195,194 ,0}, + { -287,-97,194 ,0}, + { -287,0,194 ,0}, + { -287,-195,194 ,0}, + { -385,-97,194 ,0}, + { -385,0,194 ,0}, + { -385,-195,194 ,0}, + { -482,-97,194 ,0}, + { -482,0,194 ,0}, + { -482,-195,194 ,0}, + { -580,-97,194 ,0}, + { -580,0,194 ,0}, + { -580,-195,194, 0 } }; SVECTOR level1_modelwall_001_normal[] = { @@ -10453,24 +10453,24 @@ MESH level1_meshwall_001 = { }; SVECTOR level1_modelwall_002_mesh[] = { - { -92,-97,194 }, - { -92,0,194 }, - { -92,-195,194 }, - { -92,-97,292 }, - { -92,0,292 }, - { -92,-195,292 }, - { -92,-97,389 }, - { -92,0,389 }, - { -92,-195,389 }, - { -92,-97,487 }, - { -92,0,487 }, - { -92,-195,487 }, - { -92,-97,584 }, - { -92,0,584 }, - { -92,-195,584 }, - { -92,-97,682 }, - { -92,0,682 }, - { -92,-195,682 } + { -92,-97,194 ,0}, + { -92,0,194 ,0}, + { -92,-195,194 ,0}, + { -92,-97,292 ,0}, + { -92,0,292 ,0}, + { -92,-195,292 ,0}, + { -92,-97,389 ,0}, + { -92,0,389 ,0}, + { -92,-195,389 ,0}, + { -92,-97,487 ,0}, + { -92,0,487 ,0}, + { -92,-195,487 ,0}, + { -92,-97,584 ,0}, + { -92,0,584 ,0}, + { -92,-195,584 ,0}, + { -92,-97,682 ,0}, + { -92,0,682 ,0}, + { -92,-195,682 ,0} }; SVECTOR level1_modelwall_002_normal[] = { @@ -10690,18 +10690,18 @@ MESH level1_meshwall_002 = { }; SVECTOR level1_modelwall_003_mesh[] = { - { 200,-97,682 }, - { 103,-97,682 }, - { 200,0,682 }, - { 200,-195,682 }, - { 103,0,682 }, - { 103,-195,682 }, - { 5,-97,682 }, - { 5,0,682 }, - { 5,-195,682 }, - { -92,-97,682 }, - { -92,0,682 }, - { -92,-195,682 } + { 200,-97,682 ,0}, + { 103,-97,682 ,0}, + { 200,0,682 ,0}, + { 200,-195,682 ,0}, + { 103,0,682 ,0}, + { 103,-195,682 ,0}, + { 5,-97,682 ,0}, + { 5,0,682 ,0}, + { 5,-195,682 ,0}, + { -92,-97,682 ,0}, + { -92,0,682 ,0}, + { -92,-195,682 ,0} }; SVECTOR level1_modelwall_003_normal[] = { diff --git a/src/camera.c b/src/camera.c index c39704e..a0cb6df 100644 --- a/src/camera.c +++ b/src/camera.c @@ -21,14 +21,14 @@ void getCameraZY( int * z, int * y, int actorZ, int actorY, int angleX, int dist }; // @Will : you might want to use sin/cos to move the camera in a circle but you could do that by moving it along it’s tangent and then clamping the distance void applyCamera( CAMERA * cam ) { - VECTOR vec; // Vector that holds the output values of the following instructions - RotMatrix_gte(&cam->rot, &cam->mat); // Convert rotation angle in psx units (360° == 4096) to rotation matrix) - gte_ApplyMatrix(&cam->mat, &cam->pos, &vec); // Multiply matrix by vector pos and output to vec - TransMatrix(&cam->mat, &vec); // Apply transform vector - gte_SetRotMatrix(&cam->mat); // Set Rotation matrix - gte_SetTransMatrix(&cam->mat); // Set Transform matrix + //~ VECTOR vec; // Vector that holds the output values of the following instructions + RotMatrix_gte(dc_camRot, dc_camMat); // Convert rotation angle in psx units (360° == 4096) to rotation matrix) + gte_ApplyMatrix(dc_camMat, dc_camPos, dc_wrklvector); // Multiply matrix by vector pos and output to vec + TransMatrix(dc_camMat, dc_wrklvector); // Apply transform vector + gte_SetRotMatrix(dc_camMat); // Set Rotation matrix + gte_SetTransMatrix(dc_camMat); // Set Transform matrix }; -void setCameraPos( CAMERA * camera, SVECTOR pos, SVECTOR rot ) { - camera->pos = pos; - camera->rot = rot; +void setCameraPos( CAMERA * camera, SVECTOR * pos, SVECTOR * rot ) { + copyVector(camera->pos, pos); + copyVector(camera->rot, rot); }; diff --git a/src/graphics.c b/src/graphics.c index 882e786..a20a045 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1,41 +1,66 @@ #include "../include/psx.h" #include "../include/graphics.h" #include "../include/math.h" +#include "../include/CPUMAC.H" + +// Declare registers 16 19 23 +//~ register ulong ur0 asm("$16"); +//~ register ulong ur1 asm("$19"); +//~ register ulong ur2 asm("$20"); +//~ register ulong ur3 asm("$23"); +//~ register ulong ur4 asm("$21"); +//~ register ulong ur5 asm("$22"); void enlightMesh(LEVEL * curLvl, MESH * mesh, SVECTOR * lgtang){ // Update light rotation on actor - MATRIX rotlgt, rotmesh, light; + //~ MATRIX rotlgt, rotmesh, light; // Find rotmat from actor angle - RotMatrix_gte(&mesh->rot, &rotmesh); - RotMatrix_gte(lgtang, &rotlgt); - gte_MulMatrix0(&rotmesh, &rotlgt, &rotlgt); - gte_MulMatrix0(curLvl->lgtmat, &rotlgt, &light); - gte_SetLightMatrix(&light); + RotMatrix_gte(&mesh->rot, dc_wrkmatp); + RotMatrix_gte(lgtang, dc_retmatp); + gte_MulMatrix0(dc_wrkmatp, dc_retmatp, dc_retmatp); + gte_MulMatrix0(curLvl->lgtmat, dc_retmatp, dc_retmatp); + gte_SetLightMatrix(dc_retmatp); }; void transformMesh(CAMERA * camera, MESH * mesh){ - MATRIX mat; + //~ MATRIX mat; // Find rotation matrix - RotMatrix_gte(&mesh->rot, &mat); + RotMatrix_gte(&mesh->rot, dc_wrkmatp); // Find translation matrix - TransMatrix(&mat, &mesh->pos); + TransMatrix(dc_wrkmatp, &mesh->pos); // Compose matrix with cam - gte_CompMatrix(&camera->mat, &mat, &mat); + gte_CompMatrix(dc_camMat, dc_wrkmatp, dc_wrkmatp); + //gte_MulMatrix0(&camera->mat, &mat, &mat); + //~ gte_SetRotMatrix(&camera->mat); + //~ gte_ldclmv(&mat); + //~ gte_rtir(); + //~ gte_stclmv(&mat); + //~ gte_ldclmv((char*)&mat+2); + //~ gte_rtir(); + //~ gte_stclmv((char*)&mat+2); + //~ gte_ldclmv((char*)&mat+4); + //~ gte_rtir(); + //~ gte_stclmv((char*)&mat+4); + //~ // + //~ gte_SetTransMatrix(&camera->mat); + //~ gte_ldlv0((char*)&mat+20); + //~ gte_rt(); + //~ gte_stlvnl((char*)&mat+20); // Set default rotation and translation matrices - gte_SetRotMatrix(&mat); - gte_SetTransMatrix(&mat); + gte_SetRotMatrix(dc_wrkmatp); + gte_SetTransMatrix(dc_wrkmatp); //~ } }; -void drawPoly(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw) { - long nclip, t = 0; +void drawPoly(MESH * mesh, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw) { + long t = 0; // mesh is POLY_GT3 ( triangle ) for (int i = 0; i < (mesh->totalVerts) && (mesh->totalVerts - i) > 2;) { if (mesh->index[t].code == 4) { - t = drawTri(mesh, Flag, atime, camMode, nextpri, ot, db, draw, t, i); + t = drawTri(mesh, atime, camMode, nextpri, ot, db, draw, t, i); i += 3; } // If mesh is quad if (mesh->index[t].code == 8) { - t = drawQuad(mesh, Flag, atime, camMode, nextpri, ot, db, draw, t, i); + t = drawQuad(mesh, atime, camMode, nextpri, ot, db, draw, t, i); i += 4; } } @@ -81,8 +106,8 @@ void set4VertexLerPos(MESH * mesh, long t){ mesh->tmesh->v[ mesh->index[ t ].order.pad ].vy = lerpD( mesh->anim->data[ mesh->anim->lerpCursor * mesh->anim->nvert + mesh->index[ t ].order.pad ].vy << precision , mesh->anim->data[ (mesh->anim->lerpCursor + 1) * mesh->anim->nvert + mesh->index[ t ].order.pad ].vy << precision, mesh->anim->cursor << precision) >> precision; mesh->anim->cursor += 2 * mesh->anim->dir; } -long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t, long * Flag){ - long nclip = 0; +long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t){ + long Flag, nclip = 0; // Ping pong //~ //if (mesh->anim->cursor > 4096 || mesh->anim->cursor < 0){ //~ // mesh->anim->dir *= -1; @@ -115,8 +140,8 @@ long interpolateTri(POLY_GT3 * poly, MESH * mesh, long t, long * Flag){ ); return nclip; }; -long interpolateQuad(POLY_GT4 * poly4, MESH * mesh, long t, long * Flag){ - long nclip = 0; +long interpolateQuad(POLY_GT4 * poly4, MESH * mesh, long t){ + long Flag, nclip = 0; // ping pong //~ if (mesh->anim->cursor > 4096 || mesh->anim->cursor < 0){ //~ mesh->anim->dir *= -1; @@ -297,8 +322,8 @@ int set4Subdiv(MESH * mesh, POLY_GT4 * poly4, u_long * ot, long t, int i, char * //~ } return 0; }; -long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i) { - long nclip = 0; +long drawQuad(MESH * mesh, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i) { + long Flag, nclip = 0; int subSkip = 0; // If mesh is quad POLY_GT4 * poly4; @@ -311,7 +336,7 @@ long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpr if (mesh->isAnim){ // with interpolation if ( mesh->anim->interpolate ){ - interpolateQuad(poly4, mesh, t, Flag); + interpolateQuad(poly4, mesh, t); } else { // No interpolation, use all vertices coordinates in anim data gte_RotAverageNclip4( @@ -338,7 +363,6 @@ long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpr gte_SetRotMatrix(&invRot); } // Use regular vertex coords - gte_RotAverageNclip4( &mesh->tmesh->v[ mesh->index[t].order.pad ], &mesh->tmesh->v[ mesh->index[t].order.vz], @@ -382,8 +406,8 @@ long drawQuad(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpr } //~ } }; -long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i) { - long nclip = 0; +long drawTri(MESH * mesh, int atime, int * camMode, char ** nextpri, u_long * ot, char * db, DRAWENV * draw, int t, int i) { + long Flag, nclip = 0; // mesh is POLY_GT3 ( triangle ) POLY_GT3 * poly; // len member == # vertices, but here it's # of triangle... So, for each tri * 3 vertices ... @@ -395,7 +419,7 @@ long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri if (mesh->isAnim){ // If interpolation flag is set, use it if(mesh->anim->interpolate){ - nclip = interpolateTri(poly, mesh, t, Flag); + nclip = interpolateTri(poly, mesh, t); } else { // No interpolation // Use the pre-calculated vertices coordinates from the animation data @@ -414,22 +438,24 @@ long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri // No animation if (mesh->isSprite){ // Find inverse rotation matrix so that sprite always faces camera - MATRIX rot, invRot; - gte_ReadRotMatrix(&rot); - TransposeMatrix(&rot, &invRot); + //~ MATRIX rot, invRot; + // Use scratchpad dc_wrkmatp and dc_retmatp + gte_ReadRotMatrix(dc_wrkmatp); + TransposeMatrix(dc_wrkmatp, dc_retmatp); //~ SetMulRotMatrix(&invRot); - gte_MulMatrix0(&rot, &invRot, &invRot); - gte_SetRotMatrix(&invRot); + gte_MulMatrix0(dc_wrkmatp, dc_retmatp, dc_retmatp); + gte_SetRotMatrix(dc_retmatp); } // Use model's regular vertex coordinates - nclip = RotAverageNclip3( + gte_RotAverageNclip3( &mesh->tmesh->v[ mesh->index[t].order.vx ], &mesh->tmesh->v[ mesh->index[t].order.vz ], &mesh->tmesh->v[ mesh->index[t].order.vy ], ( long * ) &poly->x0, ( long * ) &poly->x1, ( long * ) &poly->x2, &mesh->p, &mesh->OTz, - Flag + &Flag, + &nclip ); } // Do not draw invisible meshes @@ -454,7 +480,7 @@ long drawTri(MESH * mesh, long * Flag, int atime, int * camMode, char ** nextpri set3Tex(poly, mesh, draw, t, i); } if ( (mesh->OTz > 0) /*&& (*mesh->OTz < OTLEN)*/ && (mesh->p < 4096) ) { - AddPrim(&ot[ mesh->OTz-2 ], poly); + AddPrim(&ot[ mesh->OTz-4 ], poly); } *nextpri += sizeof(POLY_GT3); } diff --git a/src/main.c b/src/main.c index 19e5100..4a6dfd5 100644 --- a/src/main.c +++ b/src/main.c @@ -25,7 +25,7 @@ #include "../include/graphics.h" #include "../include/space.h" -#define USECD +//~ #define USECD // START OVERLAY extern u_long load_all_overlays_here; @@ -37,7 +37,7 @@ u_long overlaySize = 0; #include "../levels/level1.h" // Levels -volatile u_char level = 1; +u_char level = 1; u_short levelWas = 0; u_short levelHasChanged = 0; // Overlay @@ -57,7 +57,7 @@ char db = 0; // Current buffer counter CVECTOR BGc = {128, 128, 128, 0}; // Default Far color - This can be set in each level. VECTOR BKc = {128, 128, 128, 0}; // Back color VECTOR FC = FOG_COLOR; // Far (Fog) color -SVECTOR lgtang = {0, 0, 0}; +SVECTOR lgtang = {0, 0, 0}; MATRIX rotlgt, light; short vs; CAMERA camera = {0}; @@ -76,37 +76,24 @@ VECTOR angleCam = {0,0,0,0}; int dist = 150; int lerping = 0; short curCamAngle = 0; -// Inverted Cam coordinates for Forward Vector calc -VECTOR InvCamPos = {0,0,0,0}; // Actor's forward vector (used for dualshock) VECTOR fVecActor = {0,0,0,0}; u_long triCount = 0; -// Default level : Initialize everything to 0 -MATRIX cmat = {0}, lgtmat = {0}; -MESH actorPtr = {0}, levelPtr = {0} , propPtr = {0}, meshes[] = {0}; -int meshes_length = 0; -NODE curNode = {0}; -CAMPATH camPath = {0}; -CAMANGLE camPtr = {0}, camAngles[] = {0}; -LEVEL curLvl = { - &BGc, - &BKc, - &cmat, - &lgtmat, - (MESH **)&meshes, - &meshes_length, - &actorPtr, - &levelPtr, - &propPtr, - &camPtr, - &camPath, - (CAMANGLE **)&camAngles, - &curNode -}; +LEVEL curLvl = {0}; LEVEL * loadLvl; +// Callback variables +u_short lastPad; +int lerpValues[4096 >> 7]; +short cursor = 0; +short angleCamTimer = 0; +short forceApplied = 0; // Callback function is used for pads void callback(); int main() { + // Set matrices pointers to scratchpad + camera.mat = dc_camMat; + camera.pos = dc_camPos; + camera.rot = dc_camRot; // Load level file according to level, l.39 if ( level == 0 ){ overlayFile = "\\level0.bin;1"; @@ -130,8 +117,10 @@ int main() { LvlPtrSet( &curLvl, &level1); } levelWas = level; + // Copy light matrices / vector to scratchpad + setDCLightEnv(curLvl.cmat, curLvl.lgtmat, &lgtang); // Init dislay, Gte.. - init(disp, draw, db, curLvl.cmat, curLvl.BGc, curLvl.BKc, &FC); + init(disp, draw, db, curLvl.BGc, curLvl.BKc, &FC); // Init Pads InitPAD(controllers[0].pad, 34, controllers[1].pad, 34); StartPAD(); @@ -167,7 +156,7 @@ int main() { triCount += curLvl.meshes[k]->tmesh->len; } // Set camera starting pos - setCameraPos(&camera, curLvl.camPtr->campos->pos, curLvl.camPtr->campos->rot); + setCameraPos(&camera, &curLvl.camPtr->campos->pos, &curLvl.camPtr->campos->rot); // Find curCamAngle if using pre-calculated BGs if (camMode == 2) { if (curLvl.camPtr->tim_data){ @@ -176,7 +165,7 @@ int main() { } // Main loop while ( VSync(VSYNC) ) { - timeS = VSync(-1) / 60; + //~ timeS = VSync(-1) / 60; // Check if level has changed // TODO : Proper level system / loader if ( levelWas != level ){ @@ -186,11 +175,14 @@ int main() { overlayFile = "\\level0.bin;1"; overlaySize = __lvl0_end; loadLvl = &level0; + // Copy light matrices / vector to scratchpad break; case 1: overlayFile = "\\level1.bin;1"; overlaySize = __lvl1_end; loadLvl = &level1; + // Copy light matrices / vector to scratchpad + break; default: overlayFile = "\\level0.bin;1"; @@ -201,7 +193,7 @@ int main() { LoadLevelCD( overlayFile, &load_all_overlays_here ); #endif SwitchLevel( &curLvl, loadLvl); - setLightEnv(draw, curLvl.BGc, curLvl.BKc, curLvl.cmat); + setLightEnv(draw, curLvl.BGc, curLvl.BKc); levelWas = level; } FntPrint("Ovl:%s\nLvl : %x\nLvl: %d %d \n%x", overlayFile, &level, level, levelWas, loadLvl); @@ -228,9 +220,9 @@ int main() { ); // Camera modes if(camMode != 2) { - camera.rot.vy = camAngleToAct.vy; + camera.rot->vy = camAngleToAct.vy; // using csin/ccos, no need for theta - camera.rot.vx = camAngleToAct.vx; + camera.rot->vx = camAngleToAct.vx; } if(camMode < 4 ) { lerping = 0; @@ -238,7 +230,7 @@ int main() { // Camera follows actor if(camMode == 0) { dist = 200; - setVector(&camera.pos, -(camera.x/ONE), -(camera.y/ONE), -(camera.z/ONE)); + setVector(camera.pos, -(camera.x/ONE), -(camera.y/ONE), -(camera.z/ONE)); angle.vy = -(curLvl.actorPtr->rot.vy / 2) + angleCam.vy; // Camera horizontal and vertical position getCameraZY(&camera.z, &camera.y, curLvl.actorPtr->pos.vz, curLvl.actorPtr->pos.vy, angle.vx, dist); @@ -249,7 +241,7 @@ int main() { // Set distance between cam and actor dist = 150; // Set camera position - setVector(&camera.pos, -(camera.x/ONE), 100, -(camera.z/ONE)); + setVector(camera.pos, -(camera.x/ONE), 100, -(camera.z/ONE)); // Find new camera position getCameraXZ(&camera.x, &camera.z, curLvl.actorPtr->pos.vx, curLvl.actorPtr->pos.vz, angle.vy, dist); // Set rotation amount @@ -260,7 +252,7 @@ int main() { // Using precalc sqrt dist = psqrt( (posToActor.vx * posToActor.vx ) + (posToActor.vz * posToActor.vz) ); // Set camera position - setVector(&camera.pos, 190, 100, 180); + setVector(camera.pos, 190, 100, 180); } // Fixed Camera angle if (camMode == 2) { @@ -293,7 +285,7 @@ int main() { } } } - setCameraPos(&camera, curLvl.camPtr->campos->pos, curLvl.camPtr->campos->rot); + setCameraPos(&camera, &curLvl.camPtr->campos->pos, &curLvl.camPtr->campos->rot); } // Flyby mode with LERP from camStart to camEnd if (camMode == 4) { @@ -302,7 +294,7 @@ int main() { // Lerping sequence has not begun if (!lerping){ // Set cam start position ( first key pos ) - copyVector(&camera.pos, &curLvl.camPath->points[curLvl.camPath->cursor]); + copyVector(camera.pos, &curLvl.camPath->points[curLvl.camPath->cursor]); // Lerping sequence is starting lerping = 1; // Set cam pos index to 0 @@ -312,7 +304,7 @@ int main() { dist = psqrt( (posToActor.vx * posToActor.vx ) + (posToActor.vz * posToActor.vz)); // Fixed point precision 2^12 == 4096 int precision = 12; - setVector( &camera.pos, + setVector( camera.pos, lerpD(curLvl.camPath->points[curLvl.camPath->cursor].vx << precision, curLvl.camPath->points[curLvl.camPath->cursor+1].vx << precision, curLvl.camPath->pos << precision) >> precision, lerpD(curLvl.camPath->points[curLvl.camPath->cursor].vy << precision, curLvl.camPath->points[curLvl.camPath->cursor+1].vy << precision, curLvl.camPath->pos << precision) >> precision, lerpD(curLvl.camPath->points[curLvl.camPath->cursor].vz << precision, curLvl.camPath->points[curLvl.camPath->cursor+1].vz << precision, curLvl.camPath->pos << precision) >> precision @@ -342,7 +334,7 @@ int main() { // Lerping sequence has not begun if (!lerping){ // Set cam start position ( first key pos ) - copyVector(&camera.pos, &curLvl.camPath->points[curLvl.camPath->cursor]); + copyVector(camera.pos, &curLvl.camPath->points[curLvl.camPath->cursor]); // Lerping sequence is starting lerping = 1; // Set cam pos index to 0 @@ -352,17 +344,17 @@ int main() { dist = psqrt( (posToActor.vx * posToActor.vx ) + (posToActor.vz * posToActor.vz)); // Fixed point precision 2^12 == 4096 short precision = 12; - setVector( &camera.pos, + setVector( camera.pos, lerpD(curLvl.camPath->points[curLvl.camPath->cursor].vx << precision, curLvl.camPath->points[curLvl.camPath->cursor+1].vx << precision, curLvl.camPath->pos << precision) >> precision, lerpD(curLvl.camPath->points[curLvl.camPath->cursor].vy << precision, curLvl.camPath->points[curLvl.camPath->cursor+1].vy << precision, curLvl.camPath->pos << precision) >> precision, lerpD(curLvl.camPath->points[curLvl.camPath->cursor].vz << precision, curLvl.camPath->points[curLvl.camPath->cursor+1].vz << precision, curLvl.camPath->pos << precision) >> precision ); // Ony move cam if position is between first curLvl.camPath->vx and last curLvl.camPath->vx - if ( camAngleToAct.vy < -50 && camera.pos.vx > curLvl.camPath->points[curLvl.camPath->len - 1].vx ) { + if ( camAngleToAct.vy < -50 && camera.pos->vx > curLvl.camPath->points[curLvl.camPath->len - 1].vx ) { // Clamp curLvl.camPath position to cameraSpeed curLvl.camPath->pos += dist < cameraSpeed ? 0 : cameraSpeed ; } - if ( camAngleToAct.vy > 50 && camera.pos.vx > curLvl.camPath->points[curLvl.camPath->cursor].vx ) { + if ( camAngleToAct.vy > 50 && camera.pos->vx > curLvl.camPath->points[curLvl.camPath->cursor].vx ) { curLvl.camPath->pos -= dist < cameraSpeed ? 0 : cameraSpeed; } // If camera has reached next key pos, reset pos index, move cursor to next key pos @@ -416,16 +408,20 @@ int main() { if ( curLvl.meshes[k]->isProp ){ checkBodyCol( curLvl.meshes[k]->body , curLvl.meshes[k]->node->plane->body ); } - // Get col between actor and props - col = getExtCollision( *curLvl.meshes[k]->body, *curLvl.propPtr->body ); - if (col.vx && col.vz ) { - setVector( &curLvl.propPtr->body->velocity, - curLvl.meshes[k]->body->velocity.vx, - 0, - curLvl.meshes[k]->body->velocity.vz - ); - // If prop is spherical, make it roll - applyAngMom(curLvl); + // Only evaluate collision if actor is on same plane as prop + if ( curLvl.curNode == curLvl.propPtr->node ){ + // Get col between actor and props + col = getExtCollision( *curLvl.meshes[k]->body, *curLvl.propPtr->body ); + if (col.vx && col.vz ) { + setVector( &curLvl.propPtr->body->velocity, + curLvl.meshes[k]->body->velocity.vx, + 0, + curLvl.meshes[k]->body->velocity.vz + ); + // If prop is spherical, make it roll + applyAngMom(curLvl); + } + } // Synchronize mesh to body position copyVector(&curLvl.meshes[k]->pos, &curLvl.meshes[k]->body->position); @@ -439,59 +435,60 @@ int main() { } // Camera setup // Get position of cam relative to actor - addVector2(&curLvl.actorPtr->pos, &camera.pos, &posToActor); + addVector2(&curLvl.actorPtr->pos, camera.pos, &posToActor); // Polygon drawing if (curLvl.curNode){ - static long Flag; if ( (camMode == 2) && (curLvl.camPtr->tim_data ) ) { drawBG(curLvl.camPtr, &nextpri, otdisc[db], &db); // Loop on camAngles for ( int mesh = 0 ; mesh < curLvl.camAngles[ curCamAngle ]->index; mesh ++ ) { - enlightMesh(&curLvl, curLvl.camAngles[curCamAngle]->objects[mesh], &lgtang); + enlightMesh(&curLvl, curLvl.camAngles[curCamAngle]->objects[mesh], dc_lgtangp); transformMesh(&camera, curLvl.camAngles[curCamAngle]->objects[mesh]); - drawPoly(curLvl.camAngles[curCamAngle]->objects[mesh], &Flag, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); + drawPoly(curLvl.camAngles[curCamAngle]->objects[mesh], atime, &camMode, &nextpri, ot[db], &db, &draw[db]); } } else { // Draw current node's plane - drawPoly( curLvl.curNode->plane, &Flag, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); + drawPoly( curLvl.curNode->plane, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); // Draw surrounding planes for ( int sibling = 0; sibling < curLvl.curNode->siblings->index; sibling++ ) { - drawPoly(curLvl.curNode->siblings->list[ sibling ]->plane, &Flag, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); + drawPoly(curLvl.curNode->siblings->list[ sibling ]->plane, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); } // Draw adjacent planes's children for ( int sibling = 0; sibling < curLvl.curNode->siblings->index; sibling++ ) { for ( int object = 0; object < curLvl.curNode->siblings->list[ sibling ]->objects->index; object++ ) { long t = 0; - enlightMesh(&curLvl, curLvl.curNode->siblings->list[ sibling ]->objects->list[ object ], &lgtang); + enlightMesh(&curLvl, curLvl.curNode->siblings->list[ sibling ]->objects->list[ object ], dc_lgtangp); transformMesh(&camera, curLvl.curNode->siblings->list[ sibling ]->objects->list[ object ]); - drawPoly( curLvl.curNode->siblings->list[ sibling ]->objects->list[ object ], &Flag, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); + drawPoly( curLvl.curNode->siblings->list[ sibling ]->objects->list[ object ], atime, &camMode, &nextpri, ot[db], &db, &draw[db]); } } // Draw current plane children for ( int object = 0; object < curLvl.curNode->objects->index; object++ ) { - enlightMesh(&curLvl, curLvl.curNode->objects->list[ object ], &lgtang); + enlightMesh(&curLvl, curLvl.curNode->objects->list[ object ], dc_lgtangp); transformMesh(&camera, curLvl.curNode->objects->list[ object ]); - drawPoly( curLvl.curNode->objects->list[ object ], &Flag, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); + drawPoly( curLvl.curNode->objects->list[ object ], atime, &camMode, &nextpri, ot[db], &db, &draw[db]); } // Draw rigidbodies for ( int object = 0; object < curLvl.curNode->rigidbodies->index; object++ ) { - enlightMesh(&curLvl, curLvl.curNode->rigidbodies->list[ object ], &lgtang); + enlightMesh(&curLvl, curLvl.curNode->rigidbodies->list[ object ], dc_lgtangp); transformMesh(&camera, curLvl.curNode->rigidbodies->list[ object ]); - drawPoly( curLvl.curNode->rigidbodies->list[ object ], &Flag, atime, &camMode, &nextpri, ot[db], &db, &draw[db]); + drawPoly( curLvl.curNode->rigidbodies->list[ object ], atime, &camMode, &nextpri, ot[db], &db, &draw[db]); } } } - // Update global light matrix - RotMatrix_gte(&lgtang, &rotlgt); - MulMatrix0(curLvl.lgtmat, &rotlgt, &light); - SetLightMatrix(&light); + // Update global light matrix - use scratchpad + RotMatrix_gte(dc_lgtangp, dc_lgtmatp); + gte_MulMatrix0(dc_lvllgtmatp, dc_lgtmatp, dc_lgtmatp); + gte_SetLightMatrix(dc_lgtmatp); // Set camera applyCamera(&camera); // Add secondary OT to main OT AddPrims(otdisc[db], ot[db] + OTLEN - 1, ot[db]); - FntPrint("Time : %d", timeS); + FntPrint("Time : %d\n", time); + FntPrint("#Tri : %d\n", triCount); + FntPrint("# : %d %d\n", sizeof(VECTOR), sizeof(CAMERA) ); FntFlush(-1); display( &disp[db], &draw[db], otdisc[db], primbuff[db], &nextpri, &db); } @@ -504,12 +501,13 @@ void callback() { read_controller( &theControllers[1], &controllers[1].pad[0], 1 ); u_char PADL = ~theControllers[0].button1; u_char PADR = ~theControllers[0].button2; - static u_short lastPad; - static short forceApplied = 0; + //~ static u_short lastPad; + //~ static int lerpValues[4096 >> 7]; + //~ static short cursor = 0; + //~ static short angleCamTimer = 0; + //~ static short forceApplied = 0; int div = 32; - static int lerpValues[4096 >> 7]; - static short cursor = 0; - static short angleCamTimer = 0; + if( !lerpValues[0] ) { for ( long long i = 0; i < div ; i++ ){ lerpValues[(div-1)-i] = lerp(-24, -264, easeIn(i)); @@ -530,7 +528,7 @@ void callback() { camMode ++; lerping = 0; } else { - setCameraPos(&camera, curLvl.camPtr->campos->pos, curLvl.camPtr->campos->rot); + setCameraPos(&camera, &curLvl.camPtr->campos->pos, &curLvl.camPtr->campos->rot); curLvl.camPath->cursor = 0; camMode = 0; lerping = 0; @@ -552,10 +550,10 @@ void callback() { //pressed = 0; //~ } if ( PADR & PadShldL2 ) { - lgtang.vy += 32; + dc_lgtangp->vy += 32; } if ( PADR & PadShldL1 ) { - lgtang.vz += 32; + dc_lgtangp->vz += 32; } if ( PADR & PadUp && !timer ){ if (curLvl.actorPtr->isPrism){ @@ -589,14 +587,14 @@ void callback() { if (theControllers[0].type == 0x73){ // Analog stick L up if ( theControllers[0].analog3 >= 0 && theControllers[0].analog3 < 108 ) { - curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * (128 - theControllers[0].analog3 ) >> 15 ; - curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * (128 - theControllers[0].analog3 ) >> 15 ; + curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * (128 - theControllers[0].analog3 ) >> 14 ; + curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * (128 - theControllers[0].analog3 ) >> 14 ; lastPad = PADL; } // Analog stick L down if ( theControllers[0].analog3 > 168 && theControllers[0].analog3 <= 255 ) { - curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * ( theControllers[0].analog3 - 128 ) >> 15 ; - curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * ( theControllers[0].analog3 - 128 ) >> 15 ; + curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz * ( theControllers[0].analog3 - 128 ) >> 14 ; + curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx * ( theControllers[0].analog3 - 128 ) >> 14 ; lastPad = PADL; } // Analog stick L dead zone @@ -614,8 +612,8 @@ void callback() { } } if ( PADL & PadUp ) { - curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 8 ; - curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 8 ; + curLvl.actorPtr->body->gForce.vz = getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 7 ; + curLvl.actorPtr->body->gForce.vx = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 7; lastPad = PADL; } if ( !(PADL & PadUp) && lastPad & PadUp) { @@ -624,8 +622,8 @@ void callback() { lastPad = PADL; } if ( PADL & PadDown ) { - curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 8 ; - curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 8 ; + curLvl.actorPtr->body->gForce.vz = -getVectorTo(fVecActor, curLvl.actorPtr->pos).vz >> 7 ; + curLvl.actorPtr->body->gForce.vx = getVectorTo(fVecActor, curLvl.actorPtr->pos).vx >> 7 ; lastPad = PADL; } if ( !( PADL & PadDown ) && lastPad & PadDown) { diff --git a/src/psx.c b/src/psx.c index 20737ab..dc5db30 100644 --- a/src/psx.c +++ b/src/psx.c @@ -1,6 +1,13 @@ #include "../include/psx.h" -void setLightEnv(DRAWENV draw[2], CVECTOR * BGc, VECTOR * BKc, MATRIX * cmat){ + +void setDCLightEnv(MATRIX * curLevelCMat, MATRIX * curLevelLgtMat, SVECTOR * curLevelLgtAng){ + memcpy( dc_lvlcmatp, curLevelCMat, sizeof(MATRIX)); + memcpy( dc_lvllgtmatp, curLevelLgtMat, sizeof(MATRIX)); + memcpy( dc_lgtangp, curLevelLgtAng, sizeof(SVECTOR)); +}; + +void setLightEnv(DRAWENV draw[2], CVECTOR * BGc, VECTOR * BKc){ // Set Draw area color setRGB0(&draw[0], BGc->r, BGc->g, BGc->b); setRGB0(&draw[1], BGc->r, BGc->g, BGc->b); @@ -9,10 +16,10 @@ void setLightEnv(DRAWENV draw[2], CVECTOR * BGc, VECTOR * BKc, MATRIX * cmat){ // Set Ambient color SetBackColor( BKc->vx, BKc->vy, BKc->vz ); // Set Light matrix - SetColorMatrix(cmat); + SetColorMatrix(dc_lvlcmatp); }; -void init(DISPENV disp[2], DRAWENV draw[2], short db, MATRIX * cmat, CVECTOR * BGc, VECTOR * BKc, VECTOR * FC) { +void init(DISPENV disp[2], DRAWENV draw[2], short db, CVECTOR * BGc, VECTOR * BKc, VECTOR * FC) { ResetCallback(); // Init pad //~ PadInit(0); @@ -23,7 +30,9 @@ void init(DISPENV disp[2], DRAWENV draw[2], short db, MATRIX * cmat, CVECTOR * B // Initialize and setup the GTE InitGeom(); SetGeomOffset( CENTERX, CENTERY ); // x, y offset - SetGeomScreen( FOV ); // Distance between eye and screen - Camera FOV + SetGeomScreen( FOV ); // Distance between eye and screen - Camera FOV + + SetDispMask(1); // Set the display and draw environments SetDefDispEnv(&disp[0], 0, 0 , SCREENXRES, SCREENYRES); SetDefDispEnv(&disp[1], 0, SCREENYRES, SCREENXRES, SCREENYRES); @@ -36,7 +45,7 @@ void init(DISPENV disp[2], DRAWENV draw[2], short db, MATRIX * cmat, CVECTOR * B disp[1].screen.y += 8; } // Set Draw area color - setLightEnv(draw, BGc, BKc, cmat); + setLightEnv(draw, BGc, BKc); // Set Draw area clear flag draw[0].isbg = 1; draw[1].isbg = 1; @@ -73,7 +82,7 @@ void display(DISPENV * disp, DRAWENV * draw, u_long * otdisc, char * primbuff, c ResetGraph(1); PutDispEnv(disp); PutDrawEnv(draw); - SetDispMask(1); + //~ SetDispMask(1); // Main OT DrawOTag(otdisc + OT2LEN - 1); *db = !*db; @@ -118,6 +127,10 @@ void SwitchLevel( LEVEL * curLevel, LEVEL * loadLevel ){ if (curLevel->camPtr->tim_data){ LoadTexture(curLevel->camPtr->tim_data, curLevel->camPtr->BGtim); } + // TODO : per-level lgtang + SVECTOR lgtang = {0,0,0,0}; + // Light environment + setDCLightEnv(curLevel->cmat, curLevel->lgtmat, &lgtang); }; void LoadTexture(u_long * tim, TIM_IMAGE * tparam){ // This part is from Lameguy64's tutorial series : lameguy64.net/svn/pstutorials/chapter1/3-textures.html login/pw: annoyingmous OpenTIM(tim); // Open the tim binary data, feed it the address of the data in memory