home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*_________________________________________________________________________
- |
- | maze.h - maze creation and drawing routines
- |
- | (c) 1994 Frans van Hoesel, Xtreme graphics software
- |
- */
-
- #ifndef MAZE_H__SEEN
-
- /* included for definition of type object */
- #include <gl/gl.h>
-
- #include "config.h"
- #include "players.h"
-
- #define MAXHEIGHT 0.08
- #define WIDTH 0.02
- #define DEPTH 20
- /* I define some fp constants extra, because I'm not sure if the
- * preprocessor would do that for me. The old one did not
- */
- #define FOVY 100 /* angle of perspective view in 1/10 degrees */
- #define TANFOVY 0.087 /* tan(FOVY/20) */
- #define SCALE 1.0 /* fixed scaling, sphere is unit size before scaling */
- #define TANFOVY_BY_SCALE 0.087 /* TANFOVY / SCALE */
- #define TRANS (-14) /* 1.0 / TANFOVY ; initial translation */
- #define NEAR 0.15 /* clipping plane; far is determined by trans */
- #define EXTRA 0.377705 /* sqrt(1.0 - 1/SQR(1+MAXHEIGHT)) */
- #define PI_DEPTH 0.157079632 /* PI / DEPTH */
-
- typedef struct {
- float w0[3];
- float w1[3];
- float w2[3];
- float w3[3];
- float n0[3];
- float n1[3];
- float n2[3];
- } segment_t;
-
-
- typedef struct {
- Object wall_obj; /* side of the walls */
- Object top_obj; /* top of the walla */
- } arc_t;
-
- typedef struct {
- int narcs;
- arc_t *arcs;
- float *walls; /* holds lengths of the walls */
- float *gaps; /* holds lengths of the gaps */
- float start[3]; /* starting point of circle */
- int *cappings; /* wall has ends or not */
- float rotation; /* overall rotation */
- float cradius; /* cartesian radius */
- } circle_t;
-
- typedef struct {
- int ncircles;
- circle_t *circles;
- float center_v[3]; /* coordinates of center */
- float axis_v[3];
- float radius; /* cartesian maximum radius */
- } center_t;
-
-
- typedef union special_t {
- struct b /*bits */ {
- unsigned int ptype : 4;
- unsigned int ndir : 1;
- unsigned int magic : 16;
- } b;
- int all;
- } special_t;
-
- typedef struct node_t {
- float pos[3];
- int cnt; /* number of connnection */
- player_t *player;
- special_t special;
- int c[4]; /* connections to other nodes */
- } node_t;
-
- typedef struct {
- int ncenters;
- int leveln; /* the level number */
- center_t *centers;
- int nnodes;
- node_t *nodes;
- } level_t;
-
- typedef struct {
- int nlevels;
- level_t *levels;
- } maze_t;
-
- void init_maze(void);
- void build_maze(int level, int lod) ;
- void draw_maze(const Matrix m, int zbuf) ;
- void free_arcs(void);
- #ifdef BUILDNODES
- void write_nodes(void);
- #endif
-
- #define MAZE_H__SEEN
- #endif
-