INNER CODE UNIT · C++
y
TombEngine/TombEngine · TombEngine/Game/camera.cpp:377
y = g_Level.Rooms[Camera.pos.RoomNumber].Position.y - CLICK(1);
auto pointColl = GetPointCollision(Vector3i(Camera.pos.x, y, Camera.pos.z), Camera.pos.RoomNumber);
if (y < pointColl.GetCeilingHeight() ||
y > pointColl.GetFloorHeight())
{
LOSAndReturnTarget(&Camera.target, &Camera.pos, 0);
if (abs(Camera.pos.x - ideal->x) < BLOCK(0.5f) &&
abs(Camera.pos.y - ideal->y) < BLOCK(0.5f) &&
abs(Camera.pos.z - ideal->z) < BLOCK(0.5f))
{
auto origin = *ideal;
auto target = Camera.pos;
if (!LOSAndReturnTarget(&origin, &target, 0) &&
++CameraSnaps >= 8)
{
Camera.pos = *ideal;