2
0

MirrorCamera.h 874 B

123456789101112131415161718192021222324252627282930313233
  1. // ----------------------------------------------------------------
  2. // From Game Programming in C++ by Sanjay Madhav
  3. // Copyright (C) 2017 Sanjay Madhav. All rights reserved.
  4. //
  5. // Released under the BSD License
  6. // See LICENSE in root directory for full details.
  7. // ----------------------------------------------------------------
  8. #pragma once
  9. #include "CameraComponent.h"
  10. class MirrorCamera : public CameraComponent
  11. {
  12. public:
  13. MirrorCamera(class Actor* owner);
  14. void Update(float deltaTime) override;
  15. void SnapToIdeal();
  16. void SetHorzDist(float dist) { mHorzDist = dist; }
  17. void SetVertDist(float dist) { mVertDist = dist; }
  18. void SetTargetDist(float dist) { mTargetDist = dist; }
  19. private:
  20. Vector3 ComputeCameraPos() const;
  21. // Horizontal follow distance
  22. float mHorzDist;
  23. // Vertical follow distance
  24. float mVertDist;
  25. // Target distance
  26. float mTargetDist;
  27. };