INNER CODE UNIT · C++
COLL_PUSH
TombEngine/TombEngine · TombEngine/Game/camera.cpp:170
constexpr auto COLL_PUSH = BLOCK(0.25f) - BLOCK(1 / 16.0f);
constexpr auto LOOK_AT_DIST = BLOCK(0.5f);
constexpr auto CAMERA_DIST_COEFF = 0.7f;
constexpr auto CAMERA_DIST_MAX = BLOCK(0.75f);
const auto& player = GetLaraInfo(item);
int verticalOffset = GetLookCameraVerticalOffset(item, coll);
auto pivotOffset = Vector3i(0, verticalOffset, 0);
float idealDist = -std::max(Camera.targetDistance * CAMERA_DIST_COEFF, CAMERA_DIST_MAX);
// Define absolute camera orientation.
auto orient = player.Control.Look.Orientation +
EulerAngles(item.Pose.Orientation.x, item.Pose.Orientation.y, 0) +
EulerAngles(0, Camera.targetAngle, 0);
orient.x = std::clamp(orient.x, LOOKCAM_ORIENT_CONSTRAINT.first.x, LOOKCAM_ORIENT_CONSTRAINT.second.x);