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

Function UpdateMikePos

TombEngine/Game/camera.cpp:1607–1629  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1605}
1606
1607void UpdateMikePos(const ItemInfo& item)
1608{
1609 if (Camera.mikeAtLara)
1610 {
1611 Camera.mikePos = item.Pose.Position;
1612 Camera.actualAngle = item.Pose.Orientation.y;
1613
1614 if (item.IsLara())
1615 {
1616 const auto& player = GetLaraInfo(item);
1617 Camera.actualAngle += player.ExtraHeadRot.y + player.ExtraTorsoRot.y;
1618 }
1619 }
1620 else
1621 {
1622 int phdPerspective = g_Configuration.ScreenWidth / 2 * phd_cos(CurrentFOV / 2) / phd_sin(CurrentFOV / 2);
1623
1624 Camera.actualAngle = phd_atan(Camera.target.z - Camera.pos.z, Camera.target.x - Camera.pos.x);
1625 Camera.mikePos.x = Camera.pos.x + phdPerspective * phd_sin(Camera.actualAngle);
1626 Camera.mikePos.z = Camera.pos.z + phdPerspective * phd_cos(Camera.actualAngle);
1627 Camera.mikePos.y = Camera.pos.y;
1628 }
1629}
1630
1631void RumbleScreen()
1632{

Callers 4

CalculateSpotCamerasFunction · 0.85
LookCameraFunction · 0.85
MoveCameraFunction · 0.85
BinocularCameraFunction · 0.85

Calls 4

phd_cosFunction · 0.85
phd_sinFunction · 0.85
phd_atanFunction · 0.85
IsLaraMethod · 0.80

Tested by

no test coverage detected