mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
04691aaa48
Lands the non-networked Phase 0 tasks from multiplayer-todo.md (ship/camera/ arena refactors, sim constants, background FPS handling) plus a first pass at exposing graphics/performance settings (presets, resolution scaling, vsync, FPS cap, perf overlay) and a GPU profiling harness for the real-hardware follow-up in task 0.15b.
24 lines
906 B
GDScript
24 lines
906 B
GDScript
class_name ShipAction
|
|
extends RefCounted
|
|
|
|
# A single physics tick's worth of control input for a Ship.
|
|
# Produced by a ShipController each tick, consumed by Ship._integrate_forces.
|
|
# This is deliberately shaped as the future RL action space (a flat 7-value
|
|
# box) and the future network-replicated input payload.
|
|
|
|
var thrust := Vector3.ZERO # Per-axis -1..1: x = strafe, y = vertical, z = forward/back
|
|
var rotation := Vector3.ZERO # Per-axis -1..1: x = pitch, y = yaw, z = roll
|
|
var turbo := false
|
|
|
|
|
|
# Returns a distinct ShipAction with equal fields. Callers that hold onto an
|
|
# action past the tick it was returned in (input history, prediction ring)
|
|
# must copy() it — get_action() implementations are free to return a reused
|
|
# instance, and player_ship_controller.gd's does.
|
|
func copy() -> ShipAction:
|
|
var c := ShipAction.new()
|
|
c.thrust = thrust
|
|
c.rotation = rotation
|
|
c.turbo = turbo
|
|
return c
|