| 184 | } |
| 185 | |
| 186 | int GetVehicleWaterHeight(ItemInfo* vehicleItem, int forward, int right, bool clamp, Vector3i* pos) |
| 187 | { |
| 188 | auto rotMatrix = vehicleItem->Pose.Orientation.ToRotationMatrix(); |
| 189 | auto tMatrix = Matrix::CreateTranslation(vehicleItem->Pose.Position.ToVector3()); |
| 190 | auto world = rotMatrix * tMatrix; |
| 191 | |
| 192 | auto point = Vector3(right, 0, forward); |
| 193 | point = Vector3::Transform(point, world); |
| 194 | *pos = Vector3i(point); |
| 195 | |
| 196 | auto pointColl = GetPointCollision(*pos, vehicleItem->RoomNumber); |
| 197 | int height = GetPointCollision(Vector3i(pos->x, pos->y, pos->z), pointColl.GetRoomNumber()).GetWaterTopHeight(); |
| 198 | |
| 199 | if (height == NO_HEIGHT) |
| 200 | { |
| 201 | height = pointColl.GetFloorHeight(); |
| 202 | if (height == NO_HEIGHT) |
| 203 | return height; |
| 204 | } |
| 205 | |
| 206 | height -= 5; |
| 207 | |
| 208 | if (pos->y > height && clamp) |
| 209 | pos->y = height; |
| 210 | |
| 211 | return height; |
| 212 | } |
| 213 | |
| 214 | void DoVehicleCollision(ItemInfo* vehicleItem, int radius) |
| 215 | { |
no test coverage detected