diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-04 01:17:41 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-04 01:17:41 -0300 |
commit | 76c2e8583e70e8c976a306e77a40e8e7226aa249 (patch) | |
tree | fe260ef3c0d00996d537f2fe3b8c78abfb92aa60 /scene/3d/character_camera.cpp | |
parent | b085c40edfac45ec1c8b866c789f6e9bab7e5e08 (diff) | |
parent | 3a0c19d3f6ddb26359c95d84c376a8e6b1afd04d (diff) |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'scene/3d/character_camera.cpp')
-rw-r--r-- | scene/3d/character_camera.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/3d/character_camera.cpp b/scene/3d/character_camera.cpp index e8b7759a98..b4cd46bd35 100644 --- a/scene/3d/character_camera.cpp +++ b/scene/3d/character_camera.cpp @@ -255,8 +255,8 @@ void CharacterCamera::_compute_camera() { orbit.x=max_orbit_x; Matrix3 m; - m.rotate(Vector3(0,1,0),Math::deg2rad(orbit.y)); - m.rotate(Vector3(1,0,0),Math::deg2rad(orbit.x)); + m.rotate(Vector3(0,1,0),-Math::deg2rad(orbit.y)); + m.rotate(Vector3(1,0,0),-Math::deg2rad(orbit.x)); new_pos = (m.get_axis(2) * distance) + character_pos; @@ -432,8 +432,8 @@ void CharacterCamera::set_orbit(const Vector2& p_orbit) { float d = char_pos.distance_to(follow_pos); Matrix3 m; - m.rotate(Vector3(0,1,0),orbit.y); - m.rotate(Vector3(1,0,0),orbit.x); + m.rotate(Vector3(0,1,0),-orbit.y); + m.rotate(Vector3(1,0,0),-orbit.x); follow_pos=char_pos + m.get_axis(2) * d; @@ -475,8 +475,8 @@ void CharacterCamera::rotate_orbit(const Vector2& p_relative) { if (type == CAMERA_FOLLOW && is_inside_scene()) { Matrix3 m; - m.rotate(Vector3(0,1,0),Math::deg2rad(p_relative.y)); - m.rotate(Vector3(1,0,0),Math::deg2rad(p_relative.x)); + m.rotate(Vector3(0,1,0),-Math::deg2rad(p_relative.y)); + m.rotate(Vector3(1,0,0),-Math::deg2rad(p_relative.x)); Vector3 char_pos = get_global_transform().origin; char_pos.y+=height; |