MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _menu_option

Method _menu_option

editor/scene/3d/node_3d_editor_plugin.cpp:3670–4058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3668}
3669
3670void Node3DEditorViewport::_menu_option(int p_option) {
3671 EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
3672 switch (p_option) {
3673 case VIEW_TOP: {
3674 cursor.y_rot = 0;
3675 cursor.x_rot = Math::PI / 2.0;
3676 set_message(TTR("Top View."), 2);
3677 view_type = VIEW_TYPE_TOP;
3678 _set_auto_orthogonal();
3679 _update_name();
3680
3681 } break;
3682 case VIEW_BOTTOM: {
3683 cursor.y_rot = 0;
3684 cursor.x_rot = -Math::PI / 2.0;
3685 set_message(TTR("Bottom View."), 2);
3686 view_type = VIEW_TYPE_BOTTOM;
3687 _set_auto_orthogonal();
3688 _update_name();
3689
3690 } break;
3691 case VIEW_LEFT: {
3692 cursor.x_rot = 0;
3693 cursor.y_rot = Math::PI / 2.0;
3694 set_message(TTR("Left View."), 2);
3695 view_type = VIEW_TYPE_LEFT;
3696 _set_auto_orthogonal();
3697 _update_name();
3698
3699 } break;
3700 case VIEW_RIGHT: {
3701 cursor.x_rot = 0;
3702 cursor.y_rot = -Math::PI / 2.0;
3703 set_message(TTR("Right View."), 2);
3704 view_type = VIEW_TYPE_RIGHT;
3705 _set_auto_orthogonal();
3706 _update_name();
3707
3708 } break;
3709 case VIEW_FRONT: {
3710 cursor.x_rot = 0;
3711 cursor.y_rot = 0;
3712 set_message(TTR("Front View."), 2);
3713 view_type = VIEW_TYPE_FRONT;
3714 _set_auto_orthogonal();
3715 _update_name();
3716
3717 } break;
3718 case VIEW_REAR: {
3719 cursor.x_rot = 0;
3720 cursor.y_rot = Math::PI;
3721 set_message(TTR("Rear View."), 2);
3722 view_type = VIEW_TYPE_REAR;
3723 _set_auto_orthogonal();
3724 _update_name();
3725
3726 } break;
3727 case VIEW_CENTER_TO_ORIGIN: {

Callers 1

_process_clickMethod · 0.45

Calls 15

TTRFunction · 0.85
rotate_localMethod · 0.80
get_parent_node_3dMethod · 0.80
get_euler_normalizedMethod · 0.80
set_debug_drawMethod · 0.80
Vector3Function · 0.50
get_global_transformMethod · 0.45
create_actionMethod · 0.45
xformMethod · 0.45

Tested by

no test coverage detected