pub struct SemanticProperties {
pub traits: TagSet,
pub signals: TagSet,
pub receivers: TagSet,
pub scalars: Vec<(PropertyKey, f32)>,
pub vectors: Vec<(PropertyKey, [f32; 4])>,
pub ints: Vec<(PropertyKey, i32)>,
pub bools: Vec<(PropertyKey, bool)>,
pub enums: Vec<(PropertyKey, PropertyEnum)>,
}Expand description
Semantic properties for an entity — traits, signals, receivers, and typed properties. Uses Vec-based storage (sorted by key) instead of HashMap for hot-path access. Physics property stores are typically small (<64 entries), so linear/binary search outperforms HashMap due to better cache locality and lower per-lookup overhead.
Fields§
§traits: TagSet§signals: TagSet§receivers: TagSet§scalars: Vec<(PropertyKey, f32)>§vectors: Vec<(PropertyKey, [f32; 4])>§ints: Vec<(PropertyKey, i32)>§bools: Vec<(PropertyKey, bool)>§enums: Vec<(PropertyKey, PropertyEnum)>Implementations§
Source§impl SemanticProperties
impl SemanticProperties
pub fn new() -> Self
pub fn set_scalar(&mut self, key: PropertyKey, value: f32)
pub fn get_scalar(&self, key: PropertyKey) -> Option<f32>
pub fn set_bool(&mut self, key: PropertyKey, value: bool)
pub fn get_bool(&self, key: PropertyKey) -> Option<bool>
pub fn set_int(&mut self, key: PropertyKey, value: i32)
pub fn get_int(&self, key: PropertyKey) -> Option<i32>
pub fn set_vec4(&mut self, key: PropertyKey, value: [f32; 4])
pub fn get_vec4(&self, key: PropertyKey) -> Option<[f32; 4]>
pub fn get_enum(&self, key: PropertyKey) -> Option<&PropertyEnum>
pub fn set_enum(&mut self, key: PropertyKey, value: PropertyEnum)
Trait Implementations§
Source§impl Clone for SemanticProperties
impl Clone for SemanticProperties
Source§fn clone(&self) -> SemanticProperties
fn clone(&self) -> SemanticProperties
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticProperties
impl Debug for SemanticProperties
Source§impl Default for SemanticProperties
impl Default for SemanticProperties
Source§fn default() -> SemanticProperties
fn default() -> SemanticProperties
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SemanticProperties
impl RefUnwindSafe for SemanticProperties
impl Send for SemanticProperties
impl Sync for SemanticProperties
impl Unpin for SemanticProperties
impl UnsafeUnpin for SemanticProperties
impl UnwindSafe for SemanticProperties
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more