| 137 | } |
| 138 | |
| 139 | static void SetSectorAttribs(CollisionPositionData& sectorAttribs, const CollisionSetupData& collSetup, PointCollisionData& pointColl, |
| 140 | const Vector3i& probePos, int realRoomNumber) |
| 141 | { |
| 142 | constexpr auto ASPECT_ANGLE_DELTA_MAX = ANGLE(90.0f); |
| 143 | |
| 144 | auto floorNormal = pointColl.GetFloorNormal(); |
| 145 | short aspectAngle = Geometry::GetSurfaceAspectAngle(floorNormal); |
| 146 | short aspectAngleDelta = Geometry::GetShortestAngle(collSetup.ForwardAngle, aspectAngle); |
| 147 | |
| 148 | if (collSetup.BlockFloorSlopeUp && |
| 149 | sectorAttribs.FloorSlope && |
| 150 | sectorAttribs.Floor <= STEPUP_HEIGHT && |
| 151 | sectorAttribs.Floor >= -STEPUP_HEIGHT && |
| 152 | abs(aspectAngleDelta) >= ASPECT_ANGLE_DELTA_MAX) |
| 153 | { |
| 154 | sectorAttribs.Floor = MAX_HEIGHT; |
| 155 | } |
| 156 | else if (collSetup.BlockFloorSlopeDown && |
| 157 | sectorAttribs.FloorSlope && |
| 158 | sectorAttribs.Floor <= STEPUP_HEIGHT && |
| 159 | sectorAttribs.Floor >= -STEPUP_HEIGHT && |
| 160 | abs(aspectAngleDelta) <= ASPECT_ANGLE_DELTA_MAX) |
| 161 | { |
| 162 | sectorAttribs.Floor = MAX_HEIGHT; |
| 163 | } |
| 164 | else if (collSetup.BlockCeilingSlope && |
| 165 | sectorAttribs.CeilingSlope) |
| 166 | { |
| 167 | sectorAttribs.Floor = MAX_HEIGHT; |
| 168 | } |
| 169 | else if (collSetup.BlockDeathFloorDown && |
| 170 | sectorAttribs.Floor >= CLICK(0.5f) && |
| 171 | pointColl.GetBottomSector().Flags.Death) |
| 172 | { |
| 173 | sectorAttribs.Floor = MAX_HEIGHT; |
| 174 | } |
| 175 | else if (collSetup.BlockMonkeySwingEdge) |
| 176 | { |
| 177 | auto pointColl = GetPointCollision(probePos, realRoomNumber, Vector3::UnitY, collSetup.Height); |
| 178 | if (!pointColl.GetBottomSector().Flags.Monkeyswing) |
| 179 | sectorAttribs.Floor = MAX_HEIGHT; |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | static void HandleDiagonalShift(ItemInfo& item, CollisionInfo& coll, const Vector3i& pos, CardinalDirection quadrant, bool isRightShift) |
| 184 | { |
no test coverage detected