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

Method InterpolateCamera

TombEngine/Renderer/RendererDraw.cpp:4112–4142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4110 }
4111
4112 void Renderer::InterpolateCamera(float interpFactor)
4113 {
4114 _interpolationFactor = interpFactor;
4115
4116 // Interpolate camera.
4117 if (!Camera.DisableInterpolation)
4118 {
4119 _gameCamera.Camera.WorldPosition = Vector3::Lerp(_oldGameCamera.Camera.WorldPosition, _currentGameCamera.Camera.WorldPosition, interpFactor);
4120 _gameCamera.Camera.WorldDirection = Vector3::Lerp(_oldGameCamera.Camera.WorldDirection, _currentGameCamera.Camera.WorldDirection, interpFactor);
4121 _gameCamera.Camera.View = Matrix::Lerp(_oldGameCamera.Camera.View, _currentGameCamera.Camera.View, interpFactor);
4122 _gameCamera.Camera.Projection = Matrix::Lerp(_oldGameCamera.Camera.Projection, _currentGameCamera.Camera.Projection, interpFactor);
4123 _gameCamera.Camera.ViewProjection = _gameCamera.Camera.View * _gameCamera.Camera.Projection;
4124 _gameCamera.Camera.FOV = Lerp(_oldGameCamera.Camera.FOV, _currentGameCamera.Camera.FOV, interpFactor);
4125 _gameCamera.Camera.Frustum.Update(_gameCamera.Camera.View, _gameCamera.Camera.Projection);
4126 }
4127 else
4128 {
4129 _gameCamera.Camera.WorldPosition = _currentGameCamera.Camera.WorldPosition;
4130 _gameCamera.Camera.WorldDirection = _currentGameCamera.Camera.WorldDirection;
4131 _gameCamera.Camera.View = _currentGameCamera.Camera.View;
4132 _gameCamera.Camera.Projection = _currentGameCamera.Camera.Projection;
4133 _gameCamera.Camera.ViewProjection = _gameCamera.Camera.View * _gameCamera.Camera.Projection;
4134 _gameCamera.Camera.FOV = _currentGameCamera.Camera.FOV;
4135 _gameCamera.Camera.Frustum = _currentGameCamera.Camera.Frustum;
4136 }
4137
4138 _gameCamera.Camera.ViewSize = _currentGameCamera.Camera.ViewSize;
4139 _gameCamera.Camera.InvViewSize = _currentGameCamera.Camera.InvViewSize;
4140 _gameCamera.Camera.NearPlane = _currentGameCamera.Camera.NearPlane;
4141 _gameCamera.Camera.FarPlane = _currentGameCamera.Camera.FarPlane;
4142 }
4143
4144 void Renderer::SetupAnimatedTextures(const RendererBucket& bucket)
4145 {

Callers

nothing calls this directly

Calls 2

LerpFunction · 0.85
UpdateMethod · 0.45

Tested by

no test coverage detected