MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / FixedCamera

Function FixedCamera

TombEngine/Game/camera.cpp:931–963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

929}
930
931void FixedCamera(ItemInfo* item)
932{
933 // Fixed cameras before TR3 had optional "movement" effect.
934 // Later for some reason it was forced to always be 1, and actual speed value
935 // from camera trigger was ignored. In TEN, we move speed value out of legacy
936 // floordata trigger to camera itself and make use of it again. Still, by default,
937 // value is 1 for UseForcedFixedCamera hack.
938
939 int moveSpeed = 1;
940
941 GameVector origin, target;
942 if (UseForcedFixedCamera)
943 origin = ForcedFixedCamera;
944 else
945 {
946 auto* camera = &g_Level.Cameras[Camera.number];
947
948 origin = GameVector(camera->Position, camera->RoomNumber);
949
950 // Multiply original speed by 8 to comply with original bitshifted speed from TR1-2.
951 moveSpeed = camera->Speed * 8 + 1;
952 }
953
954 Camera.fixedCamera = true;
955
956 MoveCamera(&origin, moveSpeed);
957
958 if (Camera.timer > 0)
959 {
960 if (!--Camera.timer)
961 Camera.timer = NO_VALUE;
962 }
963}
964
965void BounceCamera(ItemInfo* item, short bounce, short maxDistance)
966{

Callers 1

CalculateCameraFunction · 0.70

Calls 2

MoveCameraFunction · 0.85
GameVectorClass · 0.50

Tested by

no test coverage detected