forked from gameprogcpp/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrbitCamera.h
More file actions
33 lines (28 loc) · 911 Bytes
/
OrbitCamera.h
File metadata and controls
33 lines (28 loc) · 911 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// ----------------------------------------------------------------
// 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 OrbitCamera : public CameraComponent
{
public:
OrbitCamera(class Actor* owner);
void Update(float deltaTime) override;
float GetPitchSpeed() const { return mPitchSpeed; }
float GetYawSpeed() const { return mYawSpeed; }
void SetPitchSpeed(float speed) { mPitchSpeed = speed; }
void SetYawSpeed(float speed) { mYawSpeed = speed; }
private:
// Offset from target
Vector3 mOffset;
// Up vector of camera
Vector3 mUp;
// Rotation/sec speed of pitch
float mPitchSpeed;
// Rotation/sec speed of yaw
float mYawSpeed;
};