Implement native agent movement and teleportation (#60)
All checks were successful
Native code generation / deterministic (push) Successful in 12m6s
Imaging and meshing gate / native (push) Successful in 4m6s
Native Rust workspace compile / compile (push) Successful in 4m10s

This commit is contained in:
2026-08-09 23:07:30 +00:00
parent 9c9d5b91f1
commit 0791e0a69e
13 changed files with 4060 additions and 936 deletions

View File

@@ -1011,6 +1011,7 @@ pub struct SimulatorData {
pub wind_speeds: Option<Vec<Vector2>>,
endpoint: std::net::SocketAddr,
connected: AtomicBool,
movement_complete: AtomicBool,
handshake_complete: AtomicBool,
handshake_wait: Condvar,
handshake_wait_lock: Mutex<()>,
@@ -1173,6 +1174,7 @@ impl Simulator {
wind_speeds: None,
endpoint: address,
connected: AtomicBool::new(false),
movement_complete: AtomicBool::new(false),
handshake_complete: AtomicBool::new(false),
handshake_wait: Condvar::new(),
handshake_wait_lock: Mutex::new(()),
@@ -1483,6 +1485,10 @@ impl Simulator {
Ok(self.caps_running() || self.current_sim_caps_running())
}
pub(crate) fn native_start_event_queue(&self) {
self.start_current_event_queue();
}
fn caps_running(&self) -> bool {
read(&self.caps_state).as_ref().is_some_and(|inner| {
Caps::native_from_inner(Arc::clone(inner), self.native_clone_without_caps())
@@ -1615,6 +1621,15 @@ impl Simulator {
self.connected.load(Ordering::Acquire)
}
#[must_use]
pub(crate) fn native_agent_movement_complete(&self) -> bool {
self.movement_complete.load(Ordering::Acquire)
}
pub(crate) fn native_set_agent_movement_complete(&self, value: bool) {
self.movement_complete.store(value, Ordering::Release);
}
#[cfg(test)]
pub(crate) fn native_set_connected_for_tests(&self, connected: bool) {
self.connected.store(connected, Ordering::Release);