| 1234567891011121314151617181920212223242526272829303132 |
- // ----------------------------------------------------------------
- // From Game Programming in C++ by Sanjay Madhav
- // Copyright (C) 2017 Sanjay Madhav. All rights reserved.
- //
- // Released under the BSD License
- // See LICENSE in root directory for full details.
- // ----------------------------------------------------------------
- #pragma once
- #include "CameraComponent.h"
- class FPSCamera : public CameraComponent
- {
- public:
- FPSCamera(class Actor* owner);
- void Update(float deltaTime) override;
- float GetPitch() const { return mPitch; }
- float GetPitchSpeed() const { return mPitchSpeed; }
- float GetMaxPitch() const { return mMaxPitch; }
- void SetPitchSpeed(float speed) { mPitchSpeed = speed; }
- void SetMaxPitch(float pitch) { mMaxPitch = pitch; }
- private:
- // Rotation/sec speed of pitch
- float mPitchSpeed;
- // Maximum pitch deviation from forward
- float mMaxPitch;
- // Current pitch
- float mPitch;
- };
|