feat: third-person camera toggle (V) + fix first-person showing inside the model
The first-person head-shrink (SkeletonModifier3D) left the camera looking at the inside of the neck/torso/hair. Replaced it: the owner's model now renders shadows-only in first person (clean FPS view, still fully animated and visible to others and in shadows). Added a third-person toggle (V / toggle_camera_view) so you can actually see your own animated model — the easiest way to verify a new skin's animations: - over-the-shoulder SpringArm3D camera (wall-collision aware) on the local player; press V to swap, press again to return - firing still uses the first-person camera, so aim is unchanged - reveals the owner's model via set_owner_visible() on both SkinnedPlayerModel and HumanoidModel; hides the first-person weapon viewmodel while in TP - death forces first person so the toggle can't fight the death cam Smoke test extended to cover the toggle (camera boom created, becomes current, round-trips) — 28/28 checks pass for both color and GLB skins. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5
parent
64bbbf93c6
commit
e2fbc424a7
@@ -197,6 +197,19 @@ func _set_procedural_visible(on: bool) -> void:
|
||||
if part:
|
||||
part.visible = on
|
||||
|
||||
## Show/hide the model to its OWNER (third-person toggle). off = shadows-only so
|
||||
## the local first-person camera doesn't see the body; on = fully visible.
|
||||
func set_owner_visible(on: bool) -> void:
|
||||
var mode := GeometryInstance3D.SHADOW_CASTING_SETTING_ON if on \
|
||||
else GeometryInstance3D.SHADOW_CASTING_SETTING_SHADOWS_ONLY
|
||||
_set_owner_shadow_recursive(self, mode)
|
||||
|
||||
func _set_owner_shadow_recursive(node: Node, mode: int) -> void:
|
||||
if node is GeometryInstance3D:
|
||||
node.cast_shadow = mode
|
||||
for child in node.get_children():
|
||||
_set_owner_shadow_recursive(child, mode)
|
||||
|
||||
func _apply_color(col: Color) -> void:
|
||||
var mat = StandardMaterial3D.new()
|
||||
mat.albedo_color = col
|
||||
|
||||
Reference in New Issue
Block a user