Implement native agent movement and teleportation (#60)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user