Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreQuake3Types.h

Go to the documentation of this file.
00001 // Quake 3 data definitions
00002 // Copyright (C) 1999-2000 Id Software, Inc.
00003 //
00004 // This file must be identical in the quake and utils directories
00005 
00006 // contents flags are seperate bits
00007 // a given brush can contribute multiple content bits
00008 
00009 // these definitions also need to be in q_shared.h!
00010 #ifndef __Quake3Types_H__
00011 #define __Quake3Types_H__
00012 
00013 
00014 #define BSP_HEADER_ID   (*(int*)"IBSP")
00015 #define BSP_HEADER_VER  (46)
00016 
00017 #define BSP_ENTITIES_LUMP   (0)
00018 #define BSP_SHADERS_LUMP    (1)
00019 #define BSP_PLANES_LUMP     (2)
00020 #define BSP_NODES_LUMP      (3)
00021 #define BSP_LEAVES_LUMP     (4)
00022 #define BSP_LFACES_LUMP     (5)
00023 #define BSP_LBRUSHES_LUMP   (6)
00024 #define BSP_MODELS_LUMP     (7)
00025 #define BSP_BRUSH_LUMP      (8)
00026 #define BSP_BRUSHSIDES_LUMP (9)
00027 #define BSP_VERTICES_LUMP   (10)
00028 #define BSP_ELEMENTS_LUMP   (11)
00029 #define BSP_FOG_LUMP        (12)
00030 #define BSP_FACES_LUMP      (13)
00031 #define BSP_LIGHTMAPS_LUMP  (14)
00032 #define BSP_LIGHTVOLS_LUMP  (15)
00033 #define BSP_VISIBILITY_LUMP (16)
00034 
00035 #define BSP_LIGHTMAP_BANKSIZE   (128*128*3)
00036 
00037 
00038 #define    CONTENTS_SOLID            1        // an eye is never valid in a solid
00039 #define    CONTENTS_LAVA            8
00040 #define    CONTENTS_SLIME            16
00041 #define    CONTENTS_WATER            32
00042 #define    CONTENTS_FOG            64
00043 
00044 #define    CONTENTS_AREAPORTAL        0x8000
00045 
00046 #define    CONTENTS_PLAYERCLIP        0x10000
00047 #define    CONTENTS_MONSTERCLIP    0x20000
00048 //bot specific contents types
00049 #define    CONTENTS_TELEPORTER        0x40000
00050 #define    CONTENTS_JUMPPAD        0x80000
00051 #define CONTENTS_CLUSTERPORTAL    0x100000
00052 #define CONTENTS_DONOTENTER        0x200000
00053 
00054 #define    CONTENTS_ORIGIN            0x1000000    // removed before bsping an entity
00055 
00056 #define    CONTENTS_BODY            0x2000000    // should never be on a brush, only in game
00057 #define    CONTENTS_CORPSE            0x4000000
00058 #define    CONTENTS_DETAIL            0x8000000    // brushes not used for the bsp
00059 #define    CONTENTS_STRUCTURAL        0x10000000    // brushes used for the bsp
00060 #define    CONTENTS_TRANSLUCENT    0x20000000    // don't consume surface fragments inside
00061 #define    CONTENTS_TRIGGER        0x40000000
00062 #define    CONTENTS_NODROP            0x80000000    // don't leave bodies or items (death fog, lava)
00063 
00064 #define    SURF_NODAMAGE            0x1        // never give falling damage
00065 #define    SURF_SLICK                0x2        // effects game physics
00066 #define    SURF_SKY                0x4        // lighting from environment map
00067 #define    SURF_LADDER                0x8
00068 #define    SURF_NOIMPACT            0x10    // don't make missile explosions
00069 #define    SURF_NOMARKS            0x20    // don't leave missile marks
00070 #define    SURF_FLESH                0x40    // make flesh sounds and effects
00071 #define    SURF_NODRAW                0x80    // don't generate a drawsurface at all
00072 #define    SURF_HINT                0x100    // make a primary bsp splitter
00073 #define    SURF_SKIP                0x200    // completely ignore, allowing non-closed brushes
00074 #define    SURF_NOLIGHTMAP            0x400    // surface doesn't need a lightmap
00075 #define    SURF_POINTLIGHT            0x800    // generate lighting info at vertexes
00076 #define    SURF_METALSTEPS            0x1000    // clanking footsteps
00077 #define    SURF_NOSTEPS            0x2000    // no footstep sounds
00078 #define    SURF_NONSOLID            0x4000    // don't collide against curves with this set
00079 #define SURF_LIGHTFILTER        0x8000    // act as a light filter during q3map -light
00080 #define    SURF_ALPHASHADOW        0x10000    // do per-pixel light shadow casting in q3map
00081 #define    SURF_NODLIGHT            0x20000    // don't dlight even if solid (solid lava, skies)
00082 
00083 /* Shader flags */
00084 enum
00085 {
00086     SHADER_NOCULL        = 1 << 0,
00087     SHADER_TRANSPARENT   = 1 << 1,
00088     SHADER_DEPTHWRITE    = 1 << 2,
00089     SHADER_SKY           = 1 << 3,
00090     SHADER_NOMIPMAPS     = 1 << 4,
00091     SHADER_NEEDCOLOURS   = 1 << 5,
00092     SHADER_DEFORMVERTS   = 1 << 6
00093 };
00094 
00095 /* Shaderpass flags */
00096 enum
00097 {
00098     SHADER_LIGHTMAP   = 1 << 0,
00099     SHADER_BLEND      = 1 << 1,
00100     SHADER_ALPHAFUNC  = 1 << 3,
00101     SHADER_TCMOD      = 1 << 4,
00102     SHADER_ANIMMAP    = 1 << 5,
00103     SHADER_TCGEN_ENV  = 1 << 6
00104 };
00105 
00106 /* Transform functions */
00107 enum WaveType
00108 {
00109     SHADER_FUNC_NONE            = 0,
00110     SHADER_FUNC_SIN             = 1,
00111     SHADER_FUNC_TRIANGLE        = 2,
00112     SHADER_FUNC_SQUARE          = 3,
00113     SHADER_FUNC_SAWTOOTH        = 4,
00114     SHADER_FUNC_INVERSESAWTOOTH = 5
00115 };
00116 
00117 /* *Gen functions */
00118 enum GenFunc
00119 {
00120     SHADER_GEN_IDENTITY = 0,
00121     SHADER_GEN_WAVE     = 1,
00122     SHADER_GEN_VERTEX   = 2
00123 };
00124 
00125 enum TexGen
00126 {
00127     TEXGEN_BASE = 0,        // Coord set 0
00128     TEXGEN_LIGHTMAP = 1,    // Coord set 1
00129     TEXGEN_ENVIRONMENT = 2  // Neither, generated
00130 };
00131 
00132 enum DeformFunc
00133 {
00134     DEFORM_FUNC_NONE = 0,
00135     DEFORM_FUNC_BULGE = 1,
00136     DEFORM_FUNC_WAVE = 2,
00137     DEFORM_FUNC_NORMAL = 3,
00138     DEFORM_FUNC_MOVE = 4,
00139     DEFORM_FUNC_AUTOSPRITE = 5,
00140     DEFORM_FUNC_AUTOSPRITE2 = 6
00141 
00142 };
00144 //
00145 // bsp contents
00146 //
00147 
00148 struct bsp_plane_t {
00149     float normal[3];
00150     float dist;
00151 };
00152 
00153 struct bsp_model_t {
00154     float bbox[6];
00155     int face_start;
00156     int face_count;
00157     int brush_start;
00158     int brush_count;
00159 };
00160 
00161 struct bsp_node_t {
00162     int plane;          // dividing plane
00163     //int children[2];    // left and right nodes,
00164                         // negative are leaves
00165     int front;
00166     int back;
00167     int bbox[6];
00168 };
00169 
00170 struct bsp_leaf_t {
00171     int cluster;    // visibility cluster number
00172     int area;
00173     int bbox[6];
00174     int face_start;
00175     int face_count;
00176     int brush_start;
00177     int brush_count;
00178 };
00179 
00180 #define BSP_FACETYPE_NORMAL (1)
00181 #define BSP_FACETYPE_PATCH  (2)
00182 #define BSP_FACETYPE_MESH   (3)
00183 #define BSP_FACETYPE_FLARE  (4)
00184 
00185 struct bsp_face_t {
00186     int shader;         // shader ref
00187     int unknown;
00188     int type;           // face type
00189     int vert_start;
00190     int vert_count;
00191     int elem_start;
00192     int elem_count;
00193     int lm_texture;     // lightmap
00194     int lm_offset[2];
00195     int lm_size[2];
00196     float org[3];       // facetype_normal only
00197     float bbox[6];      // facetype_patch only
00198     float normal[3];    // facetype_normal only
00199     int mesh_cp[2];     // patch control point dims
00200 };
00201 
00202 struct bsp_shader_t {
00203     char name[64];
00204     int surface_flags;
00205     int content_flags;
00206 };
00207 
00208 struct bsp_vertex_t {
00209     float point[3];
00210     float texture[2];
00211     float lightmap[2];
00212     float normal[3];
00213     int color;
00214 };
00215 
00216 struct bsp_vis_t {
00217     int cluster_count;
00218     int row_size;
00219     unsigned char data[1];
00220 };
00221 
00222 // OGRE additions
00223 struct bsp_lump_entry_t {
00224     int offset;
00225     int size;
00226 };
00227 struct bsp_header_t {
00228     char magic[4];
00229     int version;
00230     bsp_lump_entry_t lumps[17];
00231 };
00232 
00233 //
00234 // Brushes sides in BSP tree
00235 //
00236 struct bsp_brushside_t {
00237     int planenum;
00238     int content;            // ¿?shader¿?
00239 };
00240 
00241 
00242 //
00243 // Brushes in BSP tree
00244 //
00245 struct bsp_brush_t {
00246     int firstside;
00247     int numsides;
00248     int shaderIndex;
00249 };
00250 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:37:47 2006