summaryrefslogtreecommitdiff
path: root/modules/gridmap
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2016-10-18 15:50:21 -0500
committerFerenc Arn <tagcup@yahoo.com>2017-01-03 17:41:04 -0600
commitbd7ba0b664fa98381db9ef8edb69ba211213d595 (patch)
tree8e313066ce55a3366cd6b972ff429372583cda28 /modules/gridmap
parentf2e99826c0b1e8227644bfab0795d858c504d279 (diff)
Use right handed coordinate system for rotation matrices and quaternions. Also fixes Euler angles (XYZ convention, which is used as default by Blender).
Furthermore, functions which expect a rotation matrix will now give an error simply, rather than trying to orthonormalize such matrices. The documentation for such functions has be updated accordingly. This commit breaks code using 3D rotations, and is a part of the breaking changes in 2.1 -> 3.0 transition. The code affected within Godot code base is fixed in this commit.
Diffstat (limited to 'modules/gridmap')
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index eb712e49cb..dada7fcc9e 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -103,13 +103,13 @@ void GridMapEditor::_menu_option(int p_option) {
if (input_action==INPUT_DUPLICATE) {
r.set_orthogonal_index(selection.duplicate_rot);
- r.rotate(Vector3(0,1,0),Math_PI/2.0);
+ r.rotate(Vector3(0,1,0),-Math_PI/2.0);
selection.duplicate_rot=r.get_orthogonal_index();
_update_duplicate_indicator();
break;
}
r.set_orthogonal_index(cursor_rot);
- r.rotate(Vector3(0,1,0),Math_PI/2.0);
+ r.rotate(Vector3(0,1,0),-Math_PI/2.0);
cursor_rot=r.get_orthogonal_index();
_update_cursor_transform();
} break;
@@ -118,14 +118,14 @@ void GridMapEditor::_menu_option(int p_option) {
if (input_action==INPUT_DUPLICATE) {
r.set_orthogonal_index(selection.duplicate_rot);
- r.rotate(Vector3(1,0,0),Math_PI/2.0);
+ r.rotate(Vector3(1,0,0),-Math_PI/2.0);
selection.duplicate_rot=r.get_orthogonal_index();
_update_duplicate_indicator();
break;
}
r.set_orthogonal_index(cursor_rot);
- r.rotate(Vector3(1,0,0),Math_PI/2.0);
+ r.rotate(Vector3(1,0,0),-Math_PI/2.0);
cursor_rot=r.get_orthogonal_index();
_update_cursor_transform();
} break;
@@ -134,35 +134,35 @@ void GridMapEditor::_menu_option(int p_option) {
if (input_action==INPUT_DUPLICATE) {
r.set_orthogonal_index(selection.duplicate_rot);
- r.rotate(Vector3(0,0,1),Math_PI/2.0);
+ r.rotate(Vector3(0,0,1),-Math_PI/2.0);
selection.duplicate_rot=r.get_orthogonal_index();
_update_duplicate_indicator();
break;
}
r.set_orthogonal_index(cursor_rot);
- r.rotate(Vector3(0,0,1),Math_PI/2.0);
+ r.rotate(Vector3(0,0,1),-Math_PI/2.0);
cursor_rot=r.get_orthogonal_index();
_update_cursor_transform();
} break;
case MENU_OPTION_CURSOR_BACK_ROTATE_Y: {
Matrix3 r;
r.set_orthogonal_index(cursor_rot);
- r.rotate(Vector3(0,1,0),-Math_PI/2.0);
+ r.rotate(Vector3(0,1,0),Math_PI/2.0);
cursor_rot=r.get_orthogonal_index();
_update_cursor_transform();
} break;
case MENU_OPTION_CURSOR_BACK_ROTATE_X: {
Matrix3 r;
r.set_orthogonal_index(cursor_rot);
- r.rotate(Vector3(1,0,0),-Math_PI/2.0);
+ r.rotate(Vector3(1,0,0),Math_PI/2.0);
cursor_rot=r.get_orthogonal_index();
_update_cursor_transform();
} break;
case MENU_OPTION_CURSOR_BACK_ROTATE_Z: {
Matrix3 r;
r.set_orthogonal_index(cursor_rot);
- r.rotate(Vector3(0,0,1),-Math_PI/2.0);
+ r.rotate(Vector3(0,0,1),Math_PI/2.0);
cursor_rot=r.get_orthogonal_index();
_update_cursor_transform();
} break;