feat(M03): add environment snapshot facade
This commit is contained in:
@@ -4,6 +4,7 @@ extends Node
|
||||
const M2_BUILDER_SCRIPT := preload("res://addons/mpq_extractor/loaders/m2_builder.gd")
|
||||
const COORDINATE_MAPPER_SCRIPT := preload("res://src/domain/coordinates/coordinate_mapper.gd")
|
||||
const GODOT_WORLD_POSITION_SCRIPT := preload("res://src/domain/coordinates/godot_world_position.gd")
|
||||
const WORLD_ENVIRONMENT_SNAPSHOT_SCRIPT := preload("res://src/render/environment/world_environment_snapshot.gd")
|
||||
|
||||
const LIGHT_COORD_SCALE := 36.0
|
||||
const HALF_MINUTES_PER_DAY := 2880
|
||||
@@ -133,6 +134,22 @@ func _process(delta: float) -> void:
|
||||
_update_skybox_transform()
|
||||
|
||||
|
||||
## Accepts an authoritative time snapshot without moving DBC visual selection out
|
||||
## of this controller. Existing fixed-clock behavior is preserved and frozen until
|
||||
## another snapshot or explicit local clock configuration is supplied.
|
||||
func apply_environment_snapshot(world_environment_snapshot: RefCounted) -> bool:
|
||||
if (
|
||||
world_environment_snapshot == null
|
||||
or world_environment_snapshot.get_script() != WORLD_ENVIRONMENT_SNAPSHOT_SCRIPT
|
||||
or not bool(world_environment_snapshot.get("is_valid"))
|
||||
):
|
||||
return false
|
||||
use_system_time = false
|
||||
time_speed = 0.0
|
||||
fixed_time_hours = float(world_environment_snapshot.get("time_of_day_hours"))
|
||||
return true
|
||||
|
||||
|
||||
func _resolve_nodes() -> void:
|
||||
if not world_environment_path.is_empty():
|
||||
_world_environment = get_node_or_null(world_environment_path) as WorldEnvironment
|
||||
|
||||
@@ -98,6 +98,7 @@ hitch_profiler_enabled = true
|
||||
script = ExtResource("7_render_facade")
|
||||
streaming_world_loader_path = NodePath("..")
|
||||
streaming_focus_source_path = NodePath("../ThirdPersonPlayer")
|
||||
world_environment_controller_path = NodePath("../WowSkyController")
|
||||
|
||||
[node name="ThirdPersonPlayer" type="CharacterBody3D" parent="." unique_id=502573687]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 16800, 80, 26400)
|
||||
|
||||
@@ -99,6 +99,7 @@ hitch_profiler_enabled = true
|
||||
script = ExtResource("7_render_facade")
|
||||
streaming_world_loader_path = NodePath("..")
|
||||
streaming_focus_source_path = NodePath("../ThirdPersonPlayer")
|
||||
world_environment_controller_path = NodePath("../WowSkyController")
|
||||
|
||||
[node name="ThirdPersonPlayer" type="CharacterBody3D" parent="." unique_id=502573687]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 16800, 80, 26400)
|
||||
|
||||
Reference in New Issue
Block a user