#[repr(C)]pub struct IVector4 {
pub x: i32,
pub y: i32,
pub z: i32,
pub w: i32,
}Expand description
A 4-dimensional vector with x, y, z and w components, all of which are i32.
Fields§
§x: i32§y: i32§z: i32§w: i32Implementations§
Source§impl IVector4
impl IVector4
Sourcepub fn new(x: i32, y: i32, z: i32, w: i32) -> IVector4
pub fn new(x: i32, y: i32, z: i32, w: i32) -> IVector4
Creates a new IVector4 with the given x, y, z, and w components.
§Arguments
x- Thexcomponent of the vector.y- Theycomponent of the vector.z- Thezcomponent of the vector.w- Thewcomponent of the vector.
§Examples
use cgl_rs::math::IVector4;
let vec = IVector4::new(1, 2, 3, 4);
assert_eq!(vec.x, 1);
assert_eq!(vec.y, 2);
assert_eq!(vec.z, 3);
assert_eq!(vec.w, 4);Trait Implementations§
Source§impl IndexMut<usize> for IVector4
impl IndexMut<usize> for IVector4
Source§fn index_mut(&mut self, index: usize) -> &mut Self::Output
fn index_mut(&mut self, index: usize) -> &mut Self::Output
Returns a mutable reference to the element at the given index of this Vector4.
§Arguments
index- The index of the element to retrieve.
§Panics
Panics if index is greater than or equal to 4.
§Examples
use cgl_rs::math::IVector4;
let mut vec = IVector4::new(1, 2, 3, 4);
vec[0] = 5;
assert_eq!(vec[0], 5);impl Copy for IVector4
impl StructuralPartialEq for IVector4
Auto Trait Implementations§
impl Freeze for IVector4
impl RefUnwindSafe for IVector4
impl Send for IVector4
impl Sync for IVector4
impl Unpin for IVector4
impl UnwindSafe for IVector4
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