public void Update(float updateStepTime) { VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyCamera-Update"); Zoom.Update(updateStepTime); VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock(); Vector3 newCameraPosOffset = Vector3.Zero; // spring if (CameraSpring.Enabled) { CameraSpring.Update(updateStepTime, out newCameraPosOffset); } // shake if (CameraShake.ShakeEnabled) { Vector3 shakePos, shakeDir; CameraShake.UpdateShake(updateStepTime, out shakePos, out shakeDir); newCameraPosOffset += shakePos; } // apply if (newCameraPosOffset != Vector3.Zero) { Vector3D newCameraPosOffsetD = newCameraPosOffset; Vector3D newCameraPosOffsetRotatedD; Vector3D.Rotate(ref newCameraPosOffsetD, ref ViewMatrix, out newCameraPosOffsetRotatedD); ViewMatrix.Translation += newCameraPosOffsetRotatedD; } UpdatePropertiesInternal(ViewMatrix); }
public void Update(float updateStepSize) { VRageRender.MyRenderProxy.GetRenderProfiler().StartProfilingBlock("MyCamera-Update"); Zoom.Update(updateStepSize); VRageRender.MyRenderProxy.GetRenderProfiler().EndProfilingBlock(); }