feat: Implement Live Director System for interactive simulation control
- Added waypoint context updates to handle action queue statuses in `waypoint_context.gd`. - Introduced new scene file `manwalk.scene` with terrain and stickman setup. - Created architecture summary for the Live Director System detailing core state transitions, physics mechanics, UI elements, and action execution. - Specified class contracts and interfaces for the Live Director implementation in `phase_12_live_director.md`. - Defined state transitions, input handling, and queue editing mechanics for the Live Director feature.
This commit is contained in:
@@ -194,14 +194,38 @@ func _is_selectable(node: Node) -> bool:
|
||||
return false
|
||||
if node.get_parent() != _world:
|
||||
return false
|
||||
if node.name == RAGDOLL_CONTAINER_NAME:
|
||||
if node.is_in_group("stickman_ragdoll_container") or bool(node.get_meta("stickman_ragdoll_container", false)):
|
||||
return false
|
||||
return true
|
||||
|
||||
|
||||
func _ragdoll_rig_at(world_pos: Vector2) -> Node2D:
|
||||
if _world == null or not is_instance_valid(_world):
|
||||
return null
|
||||
var state: PhysicsDirectSpaceState2D = _world.get_world_2d().direct_space_state
|
||||
var query := PhysicsPointQueryParameters2D.new()
|
||||
query.position = world_pos
|
||||
query.collision_mask = 0x7FFFFFFF
|
||||
query.collide_with_areas = false
|
||||
query.collide_with_bodies = true
|
||||
var hits: Array[Dictionary] = state.intersect_point(query, 32)
|
||||
for hit: Dictionary in hits:
|
||||
var body: Object = hit.get("collider") as Object
|
||||
if body == null or not body is Node or not (body as Node).has_meta("stickman_ragdoll_body"):
|
||||
continue
|
||||
var rig: Node2D = (body as Node).get_meta("stickman_rig") as Node2D
|
||||
if rig == null or not is_instance_valid(rig) or rig.is_queued_for_deletion() or rig.get_parent() != _world:
|
||||
continue
|
||||
return rig
|
||||
return null
|
||||
|
||||
|
||||
## Highest World child index wins; on equal area the frontmost (first hit in
|
||||
## reverse iteration) stays.
|
||||
func _frontmost_at(world_pos: Vector2) -> Node2D:
|
||||
var ragdoll_hit: Node2D = _ragdoll_rig_at(world_pos)
|
||||
if ragdoll_hit != null:
|
||||
return ragdoll_hit
|
||||
var children := _world.get_children()
|
||||
var best: Node2D = null
|
||||
var best_area := INF
|
||||
|
||||
Reference in New Issue
Block a user