mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-02 09:47:58 +03:00
Fixed plane selection for split ceilings
This commit is contained in:
parent
1fa0a8a1c9
commit
952b27f932
2 changed files with 12 additions and 1 deletions
|
@ -17,6 +17,16 @@ int FLOOR_INFO::SectorPlane(int x, int z) const
|
|||
return vector.x < 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
int FLOOR_INFO::SectorPlaneCeiling(int x, int z) const
|
||||
{
|
||||
const auto point = GetSectorPoint(x, z);
|
||||
auto vector = Vector2(point.x, point.y);
|
||||
const auto matrix = Matrix::CreateRotationZ(CeilingCollision.SplitAngle);
|
||||
Vector2::Transform(vector, matrix, vector);
|
||||
|
||||
return vector.x < 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
std::optional<int> FLOOR_INFO::RoomBelow(int plane) const
|
||||
{
|
||||
const auto room = FloorCollision.Portals[plane];
|
||||
|
@ -116,7 +126,7 @@ int FLOOR_INFO::BridgeFloorHeight(int x, int z, int y) const
|
|||
|
||||
int FLOOR_INFO::CeilingHeight(int x, int z) const
|
||||
{
|
||||
const auto plane = SectorPlane(x, z);
|
||||
const auto plane = SectorPlaneCeiling(x, z);
|
||||
const auto vector = GetSectorPoint(x, z);
|
||||
|
||||
return CeilingCollision.Planes[plane].x * vector.x + CeilingCollision.Planes[plane].y * vector.y + CeilingCollision.Planes[plane].z;
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
int Room;
|
||||
|
||||
int SectorPlane(int x, int z) const;
|
||||
int SectorPlaneCeiling(int x, int z) const;
|
||||
std::optional<int> RoomBelow(int plane) const;
|
||||
std::optional<int> RoomBelow(int x, int z) const;
|
||||
std::optional<int> RoomBelow(int x, int z, int y) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue