pub struct Vector3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
Expand description
The standard 3D vector type used in Roblox.
See Also
- [
Vector3int16
][struct.Vector3int16.html] - Vector3 on Roblox Developer Hub
Fields§
§x: f32
§y: f32
§z: f32
Implementations§
source§impl Vector3
impl Vector3
pub fn new(x: f32, y: f32, z: f32) -> Self
sourcepub fn to_normal_id(&self) -> Option<u8>
pub fn to_normal_id(&self) -> Option<u8>
If the vector is a positive or negative basis vector, returns its corresponding ID. Otherwise, returns None. The mapping goes like this: (1.0, 0.0, 0.0) -> 0 (0.0, 1.0, 0.0) -> 1 (0.0, 0.0, 1.0) -> 2 (-1.0, 0.0, 0.0) -> 3 (0.0, -1.0, 0.0) -> 4 (0.0, 0.0, -1.0) -> 5
Trait Implementations§
source§impl PartialEq for Vector3
impl PartialEq for Vector3
impl Copy for Vector3
impl StructuralPartialEq for Vector3
Auto Trait Implementations§
impl RefUnwindSafe for Vector3
impl Send for Vector3
impl Sync for Vector3
impl Unpin for Vector3
impl UnwindSafe for Vector3
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