27 #ifndef ICB_PX_ROUTE_BARRIERS_H_INCLUDED 28 #define ICB_PX_ROUTE_BARRIERS_H_INCLUDED 32 #include "engines/icb/common/px_common.h" 37 #define PX_FILENAME_LINEOFSIGHT "pxwglineofsight" 38 #define PX_FILENAME_ROUTING "pxwgrouting" 39 #define PX_FILENAME_BARRIERLIST "pxwgbarrierlist" 42 #define PC_EXT_LINKED "linked" 45 #ifndef PSX_EXT_LINKED 46 #define PSX_EXT_LINKED "PSXlinked" 53 #define PX_EXT_LINKED PC_EXT_LINKED 57 #define VERSION_PXWGLINEOFSIGHT 200 58 #define VERSION_PXWGROUTING 200 59 #define VERSION_PXWGBARRIERLIST 200 62 #define FLOOR_CUBE_SIZE 1000 // 10-metre sides. 63 #define ABOVE_ALL_MODELS 10000 // Set this to be higher than any model point ever. 75 enum eBarrierType { BRICK = 0, GLASS, BULLET_PROOF_GLASS, THIN_STEEL, WIRE_FENCE, UNIT_HEIGHT, VIEW_FIELD, LEFT_NUDGE, RIGHT_NUDGE };
77 #define BARRIER_TYPE_CARDINALITY 9 // Must match number of enums in previous type (because C++ 82 enum eBarrierRayType { TEST_RAY, LIGHT, BULLET };
84 #define RAY_TYPE_CARDINALITY 3 87 enum eBarrierLogicValue { NO_IMPACT = 0, BLOCKS, ALLOWS, MAYBE, SPECIAL };
91 static enum eBarrierLogicValue barrierLogicTable[BARRIER_TYPE_CARDINALITY][RAY_TYPE_CARDINALITY] = {
92 {BLOCKS, BLOCKS, BLOCKS}, {BLOCKS, ALLOWS, SPECIAL}, {BLOCKS, ALLOWS, BLOCKS}, {BLOCKS, BLOCKS, ALLOWS}, {BLOCKS, ALLOWS, MAYBE},
93 {BLOCKS, ALLOWS, ALLOWS}, {BLOCKS, ALLOWS, ALLOWS}, {BLOCKS, ALLOWS, ALLOWS}, {BLOCKS, ALLOWS, ALLOWS}};
97 PXfloat m_linedist, m_alinedist, m_blinedist;
100 PXfloat m_alpx, m_alpz;
101 PXfloat m_blpx, m_blpz;
108 return -bmath->m_lpz;
123 return -bmath->m_lpx;
130 int32 nLength = (int32)PXsqrt((PXdouble)(dx * dx + dz * dz));
132 PXfloat xunit = PXreal2PXfloat(dx) / nLength;
133 PXfloat zunit = PXreal2PXfloat(dz) / nLength;
135 bmath->m_lpx = -zunit;
136 bmath->m_lpz = xunit;
138 bmath->m_linedist = (x1 * bmath->m_lpx) + (z1 * bmath->m_lpz);
140 bmath->m_alinedist = (x1 * alpx(bmath)) + (z1 * alpz(bmath));
142 bmath->m_blinedist = (x2 * blpx(bmath)) + (z2 * blpz(bmath));
151 eBarrierType m_material;
156 inline void routeBarrierCreatePan(
RouteBarrier *barrier) { barrier->m_pan = PXAngleOfVector(barrier->m_z1 - barrier->m_z2, barrier->m_x1 - barrier->m_x2); }
177 uint32 offset_cubes[1];
197 uint32 num_childgroups;
198 uint32 childgroups[1];
206 uint32 num_parent_boxes;
207 uint32 parent_boxes[1];
211 inline eBarrierLogicValue IsBarrierTo(eBarrierType eMaterial, eBarrierRayType eRay) {
return barrierLogicTable[eMaterial][eRay]; }
215 #endif // #ifndef _PX_ROUTE_BARRIERS_H_INCLUDED Definition: px_route_barriers.h:104
Definition: px_route_barriers.h:190
Definition: px_route_barriers.h:168
Definition: px_route_barriers.h:203
Definition: px_route_barriers.h:95
Definition: px_route_barriers.h:181
Definition: px_route_barriers.h:160
Definition: px_route_barriers.h:146