pub struct CharacterTree { /* private fields */ }Expand description
The characters’ spatial tree. See the module documentation.
Implementations§
Source§impl CharacterTree
impl CharacterTree
Sourcepub fn insert(&mut self, who: Who, position: [f32; 3], radius: f32) -> i32
pub fn insert(&mut self, who: Who, position: [f32; 3], radius: f32) -> i32
A slot for who, placed at once. Returns the slot.
Original: FUN_140018e00.
Sourcepub fn slot_of(&self, who: Who) -> Option<i32>
pub fn slot_of(&self, who: Who) -> Option<i32>
Out of its node; the slot goes on the free list. The slot holding who, if it is in the
tree.
Original: FUN_140018f70.
Sourcepub fn place(&mut self, slot: i32, position: [f32; 3], radius: f32)
pub fn place(&mut self, slot: i32, position: [f32; 3], radius: f32)
Where the character stands now; a new node puts it at the end of that node’s list.
Original: FUN_140019070.
Sourcepub fn set_direction(&mut self, slot: i32, direction: [f32; 3])
pub fn set_direction(&mut self, slot: i32, direction: [f32; 3])
The walking direction the follow check reads (the component’s).
Sourcepub fn follows(&self, slot: i32) -> bool
pub fn follows(&self, slot: i32) -> bool
MoveTo’s notify: the nearest other character within 0.5, if it came after this one (the original compares the components’ addresses; the port, the order they were put in the tree) and walks the same way (the directions’ dot product above 0), is followed.
Original: FUN_1400cde40, FUN_140097730.
Sourcepub fn visit(
&self,
point: [f32; 3],
radius: f32,
each: impl FnMut(Who, [f32; 3]),
)
pub fn visit( &self, point: [f32; 3], radius: f32, each: impl FnMut(Who, [f32; 3]), )
The search: every slot of the nodes whose loose box meets point ± radius, in the
original’s order, with where it stands.
Original: FUN_1400197e0, FUN_140019290.
Trait Implementations§
Source§impl Clone for CharacterTree
impl Clone for CharacterTree
Source§fn clone(&self) -> CharacterTree
fn clone(&self) -> CharacterTree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more