#[repr(C, align(16))]pub struct Vector4 {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
Expand description
§Vector4
§C++ Info
- name:
hkVector4
- type_size:
16
(x86)/16
(x86_64)
§Examples
use havok_types::Vector4;
assert_eq!(Vector4::new(1.0, 1.0, 1.0, 0.0).to_string(), "(1.000000 1.000000 1.000000 0.000000)");
assert_eq!(Vector4::new(-0.0, 0.0, -0.0, 1.0).to_string(), "(-0.000000 0.000000 -0.000000 1.000000)");
§XML representation
<hkparam name="">
<!-- x y z w -->
(-0.000000 0.000000 -0.000000 1.000000)
</hkparam>
Fields§
§x: f32
§C++ Info
- name:
x
(ctype:hkReal
) - offset:
0
(x86)/0
(x86_64) - type_size:
4
(x86)/4
(x86_64)
y: f32
§C++ Info
- name:
y
(ctype:hkReal
) - offset:
4
(x86)/4
(x86_64) - type_size:
4
(x86)/4
(x86_64)
z: f32
§C++ Info
- name:
z
(ctype:hkReal
) - offset:
8
(x86)/8
(x86_64) - type_size:
4
(x86)/4
(x86_64)
w: f32
§C++ Info
- name:
w
(ctype:hkReal
) - offset:
12
(x86)/12
(x86_64) - type_size:
4
(x86)/4
(x86_64)
Implementations§
Source§impl Vector4
impl Vector4
Sourcepub fn to_le_bytes(&self) -> [u8; 16]
pub fn to_le_bytes(&self) -> [u8; 16]
As a byte array in little endian.
Sourcepub fn to_be_bytes(&self) -> [u8; 16]
pub fn to_be_bytes(&self) -> [u8; 16]
As a byte array in big endian.
Sourcepub const fn from_le_bytes(bytes: &[u8; 16]) -> Self
pub const fn from_le_bytes(bytes: &[u8; 16]) -> Self
Create a Vector4
value from its representation as a byte array in little endian.
Sourcepub const fn from_be_bytes(bytes: &[u8; 16]) -> Self
pub const fn from_be_bytes(bytes: &[u8; 16]) -> Self
Create a Vector4
value from its representation as a byte array in big endian.
Trait Implementations§
Source§impl PartialOrd for Vector4
impl PartialOrd for Vector4
impl StructuralPartialEq for Vector4
Auto Trait Implementations§
impl Freeze for Vector4
impl RefUnwindSafe for Vector4
impl Send for Vector4
impl Sync for Vector4
impl Unpin for Vector4
impl UnwindSafe for Vector4
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