Implmented first/third person toggle via V
Deploy Promiscuity Auth API / deploy (push) Successful in 1m25s
Deploy Promiscuity Character API / deploy (push) Successful in 1m23s
Deploy Promiscuity Crafting API / deploy (push) Successful in 1m19s
Deploy Promiscuity Inventory API / deploy (push) Successful in 1m25s
Deploy Promiscuity Locations API / deploy (push) Successful in 1m26s
Deploy Promiscuity Mail API / deploy (push) Successful in 1m21s
Deploy Promiscuity World API / deploy (push) Successful in 1m21s
k8s smoke test / test (push) Successful in 20s
Deploy Promiscuity Auth API / deploy (push) Successful in 1m25s
Deploy Promiscuity Character API / deploy (push) Successful in 1m23s
Deploy Promiscuity Crafting API / deploy (push) Successful in 1m19s
Deploy Promiscuity Inventory API / deploy (push) Successful in 1m25s
Deploy Promiscuity Locations API / deploy (push) Successful in 1m26s
Deploy Promiscuity Mail API / deploy (push) Successful in 1m21s
Deploy Promiscuity World API / deploy (push) Successful in 1m21s
k8s smoke test / test (push) Successful in 20s
This commit is contained in:
@@ -22,4 +22,5 @@
|
||||
- Fireball: Shift + B
|
||||
- Phone: Tab
|
||||
- Pause menu: Esc
|
||||
- Toggle first/third person: V
|
||||
- Zoom (in/out): Scroll Wheel (snaps to First Person on zoom in)
|
||||
|
||||
@@ -116,6 +116,11 @@ player_phone={
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194306,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
player_toggle_perspective={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":86,"key_label":0,"unicode":118,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
interact={
|
||||
"deadzone": 0.2,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":69,"key_label":0,"unicode":101,"location":0,"echo":false,"script":null)
|
||||
|
||||
@@ -2,6 +2,8 @@ extends Node
|
||||
|
||||
var _requested_spawn_name: StringName = &""
|
||||
var camera_zoom_dist: float = 3.0
|
||||
var third_person_camera_zoom_dist: float = 3.0
|
||||
var camera_is_first_person: bool = false
|
||||
|
||||
|
||||
func request_spawn(spawn_name: StringName) -> void:
|
||||
|
||||
+59
-15
@@ -15,7 +15,11 @@ const DEFAULT_ZOOM_DIST := 3.0
|
||||
const MIN_ZOOM_DIST := 1.5
|
||||
const MAX_ZOOM_DIST := 8.0
|
||||
const ZOOM_STEP := 0.5
|
||||
const FIRST_PERSON_HEIGHT := 1.6
|
||||
const MODEL_SHOW_CAMERA_DISTANCE := 0.75
|
||||
var _zoom_dist := DEFAULT_ZOOM_DIST
|
||||
var _third_person_zoom_dist := DEFAULT_ZOOM_DIST
|
||||
var _is_first_person := false
|
||||
const FIREBALL_SPAWN_FORWARD_OFFSET := 1.5
|
||||
const FIREBALL_SPAWN_UP_OFFSET := 1.2
|
||||
var mouse_sensitivity := 0.005
|
||||
@@ -71,7 +75,13 @@ func _ready() -> void:
|
||||
audio_player.volume_db = -20
|
||||
if cam:
|
||||
if TeleportState != null:
|
||||
_zoom_dist = TeleportState.camera_zoom_dist
|
||||
_third_person_zoom_dist = clampf(
|
||||
TeleportState.third_person_camera_zoom_dist,
|
||||
MIN_ZOOM_DIST,
|
||||
MAX_ZOOM_DIST
|
||||
)
|
||||
_is_first_person = TeleportState.camera_is_first_person or TeleportState.camera_zoom_dist == 0.0
|
||||
_zoom_dist = 0.0 if _is_first_person else _third_person_zoom_dist
|
||||
_camera_pitch = cam.rotation.x
|
||||
_camera_yaw = global_transform.basis.get_euler().y
|
||||
cam.set_as_top_level(true)
|
||||
@@ -160,8 +170,7 @@ func _integrate_forces(state):
|
||||
cam.global_position = cam.global_position.lerp(target_pos, camera_follow_speed * state.step)
|
||||
cam.global_rotation = Vector3(_camera_pitch, _camera_yaw, 0.0)
|
||||
|
||||
if _model_root:
|
||||
_model_root.visible = (_zoom_dist > 0.0) and not _in_vehicle
|
||||
_update_model_visibility()
|
||||
|
||||
_update_animation(on_floor, state.linear_velocity)
|
||||
_jump_triggered = false
|
||||
@@ -180,6 +189,10 @@ func _input(event):
|
||||
if _in_vehicle:
|
||||
return
|
||||
|
||||
if event.is_action_pressed("player_toggle_perspective"):
|
||||
set_first_person(not _is_first_person)
|
||||
return
|
||||
|
||||
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED:
|
||||
_pending_mouse_delta += event.relative
|
||||
|
||||
@@ -200,29 +213,60 @@ func zoom_camera(zoom_in: bool) -> void:
|
||||
if cam == null:
|
||||
return
|
||||
if zoom_in:
|
||||
if _zoom_dist == 0.0:
|
||||
if _is_first_person:
|
||||
return
|
||||
elif _zoom_dist <= MIN_ZOOM_DIST:
|
||||
_zoom_dist = 0.0
|
||||
set_first_person(true)
|
||||
return
|
||||
else:
|
||||
_zoom_dist = max(MIN_ZOOM_DIST, _zoom_dist - ZOOM_STEP)
|
||||
else:
|
||||
if _zoom_dist == 0.0:
|
||||
_zoom_dist = MIN_ZOOM_DIST
|
||||
if _is_first_person:
|
||||
set_first_person(false)
|
||||
return
|
||||
else:
|
||||
_zoom_dist = min(MAX_ZOOM_DIST, _zoom_dist + ZOOM_STEP)
|
||||
|
||||
if TeleportState != null:
|
||||
TeleportState.camera_zoom_dist = _zoom_dist
|
||||
|
||||
|
||||
_third_person_zoom_dist = _zoom_dist
|
||||
_persist_camera_state()
|
||||
update_camera_offset()
|
||||
|
||||
func set_first_person(enabled: bool) -> void:
|
||||
if enabled == _is_first_person:
|
||||
return
|
||||
if enabled and _zoom_dist > 0.0:
|
||||
_third_person_zoom_dist = _zoom_dist
|
||||
_is_first_person = enabled
|
||||
_zoom_dist = 0.0 if enabled else _third_person_zoom_dist
|
||||
_persist_camera_state()
|
||||
update_camera_offset()
|
||||
_update_model_visibility()
|
||||
|
||||
func _persist_camera_state() -> void:
|
||||
if TeleportState == null:
|
||||
return
|
||||
TeleportState.camera_is_first_person = _is_first_person
|
||||
TeleportState.camera_zoom_dist = _zoom_dist
|
||||
TeleportState.third_person_camera_zoom_dist = _third_person_zoom_dist
|
||||
|
||||
func update_camera_offset() -> void:
|
||||
if _zoom_dist == 0.0:
|
||||
_camera_offset_local = Vector3(0.0, 1.6, 0.0)
|
||||
if _is_first_person:
|
||||
_camera_offset_local = Vector3(0.0, FIRST_PERSON_HEIGHT, 0.0)
|
||||
else:
|
||||
var height_offset := 0.25 * _zoom_dist
|
||||
_camera_offset_local = Vector3(0.5, 1.6 + height_offset, _zoom_dist)
|
||||
_camera_offset_local = Vector3(0.5, FIRST_PERSON_HEIGHT + height_offset, _zoom_dist)
|
||||
|
||||
func _update_model_visibility() -> void:
|
||||
if _model_root == null:
|
||||
return
|
||||
if _in_vehicle or _is_first_person:
|
||||
_model_root.visible = false
|
||||
return
|
||||
if cam == null:
|
||||
_model_root.visible = true
|
||||
return
|
||||
var eye_position := global_position + Vector3.UP * FIRST_PERSON_HEIGHT
|
||||
_model_root.visible = cam.global_position.distance_to(eye_position) >= MODEL_SHOW_CAMERA_DISTANCE
|
||||
|
||||
func shoot_fireball() -> void:
|
||||
var direction := get_look_direction()
|
||||
@@ -286,7 +330,7 @@ func exit_vehicle(exit_point: Node3D, vehicle_camera: Camera3D) -> void:
|
||||
_vehicle_original_parent = null
|
||||
_flashlight.visible = _light_was_on
|
||||
if _model_root:
|
||||
_model_root.visible = true
|
||||
_model_root.visible = not _is_first_person
|
||||
if exit_point:
|
||||
global_transform = exit_point.global_transform
|
||||
if vehicle_camera:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.2.0
|
||||
@@ -19,37 +20,97 @@ EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|x64.Build.0 = Release|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{334F3B23-EFE8-6F1A-5E5F-9A2275D56E28}.Release|x86.Build.0 = Release|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Release|x64.Build.0 = Release|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{1572BA36-8EFC-4472-BE74-0676B593AED9}.Release|x86.Build.0 = Release|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C343AFFB-9AB0-4B70-834C-3D2A21E2B506}.Release|x86.Build.0 = Release|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Release|x64.Build.0 = Release|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{72AA73C5-6A42-4F79-ADCC-19F10A66B9E0}.Release|x86.Build.0 = Release|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Release|x64.Build.0 = Release|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{2A6A80E9-2D58-4E42-8B93-483F2D6E6D42}.Release|x86.Build.0 = Release|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Release|x64.Build.0 = Release|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{0B5EE564-C6E1-4BA7-B0E2-B86D363A9C74}.Release|x86.Build.0 = Release|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Release|x64.Build.0 = Release|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{C8F20B54-2A76-4BE0-8DA8-E146D1AF4D10}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user