Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Code/Camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ void OrbitCamera::Zoom(float deltaZoom, float deltaTime) {
}
}

void OrbitCamera::Pan(const vec2& delataPan, float deltaTime) {
void OrbitCamera::Pan(const vec2& deltaPan, float deltaTime) {
vec3 right(m_matWorld._11, m_matWorld._12, m_matWorld._13);

// Pan X axis in local space
target = target - (right * (delataPan.x * panSpeed.x * deltaTime));
target = target - (right * (deltaPan.x * panSpeed.x * deltaTime));
// Pan Y Axis in global space
target = target + (vec3(0, 1, 0) * (delataPan.y * panSpeed.y * deltaTime));
target = target + (vec3(0, 1, 0) * (deltaPan.y * panSpeed.y * deltaTime));

// Reset zoom to allow infinate zooming after a motion
// This part of the code is not in the book!
Expand Down
2 changes: 1 addition & 1 deletion Code/Camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class OrbitCamera : public Camera {

void Rotate(const vec2& deltaRot, float deltaTime);
void Zoom(float deltaZoom, float deltaTime);
void Pan(const vec2& delataPan, float deltaTime);
void Pan(const vec2& deltaPan, float deltaTime);

void Update(float dt);
float ClampAngle(float angle, float min, float max);
Expand Down