1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Added 3D freelook navigation mode

- Triggered by holding RMB
- Can look around in FPS style
- Can move with WASD
- Movement speed accelerates over time
- Can multiply speed with a modifier key to go faster or slower
- Configurable in editor settings and shortcuts
This commit is contained in:
Marc Gilleron
2017-05-01 20:57:35 +02:00
parent f527a69462
commit 442006b4bf
3 changed files with 123 additions and 124 deletions

View File

@@ -113,6 +113,7 @@ private:
bool transforming;
bool orthogonal;
float gizmo_scale;
real_t freelook_speed;
struct _RayResult {
@@ -168,7 +169,8 @@ private:
NAVIGATION_NONE,
NAVIGATION_PAN,
NAVIGATION_ZOOM,
NAVIGATION_ORBIT
NAVIGATION_ORBIT,
NAVIGATION_LOOK
};
enum TransformMode {
TRANSFORM_NONE,
@@ -203,8 +205,6 @@ private:
struct Cursor {
Vector3 cursor_pos;
Vector3 pos;
float x_rot, y_rot, distance;
bool region_select;
@@ -227,10 +227,12 @@ private:
//
void _update_camera();
Transform to_camera_transform(const Cursor &p_cursor) const;
void _draw();
void _smouseenter();
void _sinput(const InputEvent &p_ie);
void _update_freelook(real_t delta);
SpatialEditor *spatial_editor;
Camera *previewing;
@@ -385,7 +387,6 @@ private:
};
Button *tool_button[TOOL_MAX];
Button *instance_button;
MenuButton *transform_menu;
MenuButton *view_menu;