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

Function BounceCamera

TombEngine/Game/camera.cpp:965–977  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

963}
964
965void BounceCamera(ItemInfo* item, short bounce, short maxDistance)
966{
967 float distance = Vector3i::Distance(item->Pose.Position, Camera.pos.ToVector3i());
968 if (distance < maxDistance)
969 {
970 if (maxDistance == NO_VALUE)
971 Camera.bounce = bounce;
972 else
973 Camera.bounce = -(bounce * (maxDistance - distance) / maxDistance);
974 }
975 else if (maxDistance == NO_VALUE)
976 Camera.bounce = bounce;
977}
978
979void BinocularCamera(ItemInfo* item)
980{

Callers 1

ControlWreckingBallFunction · 0.85

Calls 1

ToVector3iMethod · 0.45

Tested by

no test coverage detected