00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020
00021
00022 00023 00024 00025 00026 00027 00028 00029 00030 00031
00032 #ifndef __POLYGON_H
00033 #define __POLYGON_H
00034
00035 #include "rvtypes.h"
00036
00037
00038 #define TEP_PWALL 1
00039 #define TEP_RWALL 2
00040 #define TEP_CARIMG 4
00041 #define TEP_FLOOR 8
00042 #define TEP_FLOOR2 16 // ces 2000-04-13
00043 #define TEP_LAMP 32
00044 #define TEP_BOX 64
00045 #define TEP_TRACK 128
00046 #define TEP_PIPE 256 // ces 2000-04-13
00047 #define TEP_BCEIL 512 // ces 2000-04-13
00048 #define TEP_BRAIL 1024 // ces 2000-04-13
00049
00050
00051 #define SURF_NOCOLL -2
00052 #define TEX_INVISIBLE -2
00053
00054 class Mesh;
00055
00060 enum EnvMapType
00061 {
00062
00063 On,
00064 Off,
00065 Disabled
00066 };
00067
00068
00070 class Polygon
00071 {
00072 public:
00073 friend class PolygonModifier;
00074
00075 public:
00076 Polygon(Mesh *p, RV_Poly *d);
00077
00078 Polygon(Mesh *, FILE *, bool is_IM, bool is_Instance);
00079
00085 Polygon(Mesh *, Polygon *);
00086
00087
00093 void setTransparency(rvulong);
00095 void setSurface(rvlong);
00096
00097 void turnInvisible(void);
00098 bool isInvisible(void);
00099 void setNoColl(void);
00100 bool isNoColl(void);
00101
00108 int numverts(void);
00109
00110 void setTEColor(rvulong);
00111
00112 void write(FILE *, bool is_IM, bool is_Instance);
00113
00115 int detTEPart(void);
00116
00117 void shiftVIndices(rvushort);
00118
00119 bool isInTexture(rvshort page, rvfloat ulo, rvfloat uhi, rvfloat vlo, rvfloat vhi);
00120
00126 int vertidx(int);
00127
00128 Mesh *parent;
00129
00130
00131
00132
00133 private:
00135 bool teheur_BlueWall(void);
00137 bool teheur_Lamp(void);
00139 bool teheur_Floor(void);
00141 bool teheur_Floor2(void);
00143 bool teheur_RWall(void);
00145 bool teheur_Box(void);
00147 bool teheur_CarImage(void);
00149 bool teheur_Pipe(void);
00151 bool teheur_BCeil(void);
00153 bool teheur_BRail(void);
00154
00155 public:
00157 rvlong surface;
00159 rvlong ncp_type;
00160
00161 EnvMapType envmap;
00162 RVColor env_color;
00163 RV_Poly data;
00165 rvfloat lower_coll;
00166 };
00167
00168
00169 #endif