pub struct Vector3f {
pub x: f32,
pub y: f32,
pub z: f32,
}Fields§
§x: f32§y: f32§z: f32Implementations§
Source§impl Vector3f
impl Vector3f
pub const UP: Self
pub const DOWN: Self
pub const LEFT: Self
pub const RIGHT: Self
pub const FORWARD: Self
pub const BACKWARD: Self
pub const ZERO: Self
pub const ONE: Self
pub const CHUNK_SIZE: Self
pub const CHUNK_HALF: Self
pub const fn new(x: f32, y: f32, z: f32) -> Self
pub fn normalize(self) -> Self
pub fn cross(self, other: Self) -> Self
Trait Implementations§
Source§impl AddAssign for Vector3f
impl AddAssign for Vector3f
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreSource§impl AsBrdbValue for Vector3f
impl AsBrdbValue for Vector3f
Source§fn as_brdb_struct_prop_value(
&self,
schema: &BrdbSchema,
_struct_name: BrdbInterned,
prop_name: BrdbInterned,
) -> Result<&dyn AsBrdbValue, BrdbSchemaError>
fn as_brdb_struct_prop_value( &self, schema: &BrdbSchema, _struct_name: BrdbInterned, prop_name: BrdbInterned, ) -> Result<&dyn AsBrdbValue, BrdbSchemaError>
Read a specific struct property value from the schema.
fn as_brdb_wire_variant(&self) -> Result<WireVariant, BrdbSchemaError>
fn as_brdb_bool(&self) -> Result<bool, BrdbSchemaError>
fn as_brdb_u8(&self) -> Result<u8, BrdbSchemaError>
fn as_brdb_u16(&self) -> Result<u16, BrdbSchemaError>
fn as_brdb_u32(&self) -> Result<u32, BrdbSchemaError>
fn as_brdb_u64(&self) -> Result<u64, BrdbSchemaError>
fn as_brdb_i8(&self) -> Result<i8, BrdbSchemaError>
fn as_brdb_i16(&self) -> Result<i16, BrdbSchemaError>
fn as_brdb_i32(&self) -> Result<i32, BrdbSchemaError>
fn as_brdb_i64(&self) -> Result<i64, BrdbSchemaError>
fn as_brdb_f32(&self) -> Result<f32, BrdbSchemaError>
fn as_brdb_f64(&self) -> Result<f64, BrdbSchemaError>
fn as_brdb_str(&self) -> Result<&str, BrdbSchemaError>
fn as_brdb_asset( &self, _schema: &BrdbSchema, _ty: &str, ) -> Result<Option<usize>, BrdbSchemaError>
fn as_brdb_enum( &self, _schema: &BrdbSchema, _def: &BrdbSchemaEnum, ) -> Result<i32, BrdbSchemaError>
fn as_brdb_wire_array_variant( &self, ) -> Result<WireArrayVariant, BrdbSchemaError>
fn as_brdb_wire_map_variant(&self) -> Result<WireMapVariant, BrdbSchemaError>
Source§fn as_brdb_variant_member(&self) -> Option<&str>
fn as_brdb_variant_member(&self) -> Option<&str>
When this value should encode as a named member of a schema
variant
(a tagged union whose members are structs, e.g. BRInventoryEntryVariant
-> BRInventoryEntryNothing), return the member struct’s name. The
writer emits uint(tag) + <that struct>. None (the default) means
“not a struct-member variant” and the writer falls back to the wire
map/array/scalar variant paths.Source§fn has_brdb_struct_prop(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> bool
fn has_brdb_struct_prop( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> bool
Cheap presence probe for a struct property. When this returns
false, the schema writer takes the default/zero path directly
instead of paying for a MissingStructField error (two String
allocations) per unset field. Implementations that can’t answer
cheaply keep the default true; the writer then falls back to
the erroring accessors below.Source§fn as_brdb_struct_prop_array(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> Result<BrdbArrayIter<'_>, BrdbSchemaError>
fn as_brdb_struct_prop_array( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> Result<BrdbArrayIter<'_>, BrdbSchemaError>
Get the the number of entries in a struct property.
Source§fn as_brdb_struct_prop_map(
&self,
_schema: &BrdbSchema,
_struct_name: BrdbInterned,
_prop_name: BrdbInterned,
) -> Result<BrdbMapIter<'_>, BrdbSchemaError>
fn as_brdb_struct_prop_map( &self, _schema: &BrdbSchema, _struct_name: BrdbInterned, _prop_name: BrdbInterned, ) -> Result<BrdbMapIter<'_>, BrdbSchemaError>
Get the the number of entries in a struct property.
impl Copy for Vector3f
Source§impl DivAssign<f32> for Vector3f
impl DivAssign<f32> for Vector3f
Source§fn div_assign(&mut self, scalar: f32)
fn div_assign(&mut self, scalar: f32)
Performs the
/= operation. Read moreSource§impl From<Vector3f> for WireVariant
impl From<Vector3f> for WireVariant
Source§impl MulAssign<Vector3f> for f32
impl MulAssign<Vector3f> for f32
Source§fn mul_assign(&mut self, vec: Vector3f)
fn mul_assign(&mut self, vec: Vector3f)
Performs the
*= operation. Read moreSource§impl MulAssign<f32> for Vector3f
impl MulAssign<f32> for Vector3f
Source§fn mul_assign(&mut self, scalar: f32)
fn mul_assign(&mut self, scalar: f32)
Performs the
*= operation. Read moreSource§impl PartialOrd for Vector3f
impl PartialOrd for Vector3f
impl StructuralPartialEq for Vector3f
Auto Trait Implementations§
impl Freeze for Vector3f
impl RefUnwindSafe for Vector3f
impl Send for Vector3f
impl Sync for Vector3f
impl Unpin for Vector3f
impl UnsafeUnpin for Vector3f
impl UnwindSafe for Vector3f
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