|
55 | 55 | // common implementation headers
|
56 | 56 | #include "Obstacle.h"
|
57 | 57 | #include "ObstacleMgr.h"
|
| 58 | +#include "WallObstacle.h" |
58 | 59 | #include "CollisionManager.h"
|
59 | 60 | #include "BaseBuilding.h"
|
60 | 61 | #include "AnsiCodes.h"
|
@@ -1050,6 +1051,13 @@ static void relayPlayerPacket(int index, uint16_t len, const void *rawbuf, uint1
|
1050 | 1051 | }
|
1051 | 1052 | }
|
1052 | 1053 |
|
| 1054 | +void addWall(float x, float y, float z, float r, float w, float h) |
| 1055 | +{ |
| 1056 | + const float pos[3] = { x, y, z }; |
| 1057 | + WallObstacle* wall = new WallObstacle(pos, r, w, h, false); |
| 1058 | + OBSTACLEMGR.addWorldObstacle(wall); |
| 1059 | +} |
| 1060 | + |
1053 | 1061 | void makeWalls ( void )
|
1054 | 1062 | {
|
1055 | 1063 | float worldSize = BZDBCache::worldSize;
|
@@ -1079,16 +1087,16 @@ void makeWalls ( void )
|
1079 | 1087 | float x = sinf(midpointAngle*degToRad)*midpointRad;
|
1080 | 1088 | float y = cosf(midpointAngle*degToRad)*midpointRad;
|
1081 | 1089 |
|
1082 |
| - world->addWall(x, y, 0.0f, (270.0f-midpointAngle)*degToRad, (float)segmentLen, wallHeight); |
| 1090 | + addWall(x, y, 0.0f, (270.0f-midpointAngle)*degToRad, (float)segmentLen, wallHeight); |
1083 | 1091 |
|
1084 | 1092 | }
|
1085 | 1093 | }
|
1086 | 1094 | else
|
1087 | 1095 | {
|
1088 |
| - world->addWall(0.0f, 0.5f * worldSize, 0.0f, (float)(1.5 * M_PI), 0.5f * worldSize, wallHeight); |
1089 |
| - world->addWall(0.5f * worldSize, 0.0f, 0.0f, (float)M_PI, 0.5f * worldSize, wallHeight); |
1090 |
| - world->addWall(0.0f, -0.5f * worldSize, 0.0f, (float)(0.5 * M_PI), 0.5f * worldSize, wallHeight); |
1091 |
| - world->addWall(-0.5f * worldSize, 0.0f, 0.0f, 0.0f, 0.5f * worldSize, wallHeight); |
| 1096 | + addWall(0.0f, 0.5f * worldSize, 0.0f, (float)(1.5 * M_PI), 0.5f * worldSize, wallHeight); |
| 1097 | + addWall(0.5f * worldSize, 0.0f, 0.0f, (float)M_PI, 0.5f * worldSize, wallHeight); |
| 1098 | + addWall(0.0f, -0.5f * worldSize, 0.0f, (float)(0.5 * M_PI), 0.5f * worldSize, wallHeight); |
| 1099 | + addWall(-0.5f * worldSize, 0.0f, 0.0f, 0.0f, 0.5f * worldSize, wallHeight); |
1092 | 1100 | }
|
1093 | 1101 | }
|
1094 | 1102 |
|
|
0 commit comments