#[repr(C)]pub struct hkVector4 {
pub quad: hkQuadReal,
}
Expand description
Represents a 4D vector using SSE-aligned floating-point values in the Havok system.
This struct wraps a hkQuadReal
(__m128) for vector operations.
§Memory Layout:
quad
: SSE-aligned 128-bit vector (0x00 - 0x0F)
Fields§
§quad: hkQuadReal
The 128-bit SSE vector containing x, y, z, and w components.
- Offset: 0x00
Implementations§
Source§impl hkVector4
impl hkVector4
Sourcepub fn from_scalar(x: f32) -> Self
pub fn from_scalar(x: f32) -> Self
Creates a new hkVector4
with all components set to the same value.
Sourcepub fn from_components(x: f32, y: f32, z: f32, w: f32) -> Self
pub fn from_components(x: f32, y: f32, z: f32, w: f32) -> Self
Creates a new hkVector4
from individual x, y, z, and w components.
Sourcepub fn from_ni_point3(point: NiPoint3) -> Self
pub fn from_ni_point3(point: NiPoint3) -> Self
Creates a new hkVector4
from an NiPoint3
, with w set to 0.0.
Sourcepub fn IsEqual(&self, pt: Self, epsilon: f32) -> bool
pub fn IsEqual(&self, pt: Self, epsilon: f32) -> bool
Checks if this vector is equal to another within a given epsilon.
Sourcepub fn Cross(&self, pt: Self) -> Self
pub fn Cross(&self, pt: Self) -> Self
Computes the cross product with another hkVector4
(using x, y, z components).
Sourcepub fn Dot3(&self, pt: Self) -> f32
pub fn Dot3(&self, pt: Self) -> f32
Computes the 3D dot product with another hkVector4
(ignoring w).
Sourcepub fn GetDistance3(&self, pt: Self) -> f32
pub fn GetDistance3(&self, pt: Self) -> f32
Gets the 3D distance to another hkVector4
.
Sourcepub fn GetSquaredDistance3(&self, pt: Self) -> f32
pub fn GetSquaredDistance3(&self, pt: Self) -> f32
Gets the squared 3D distance to another hkVector4
.
Sourcepub fn SqrLength3(&self) -> f32
pub fn SqrLength3(&self) -> f32
Gets the squared 3D length of the vector.
Sourcepub fn SqrLength4(&self) -> f32
pub fn SqrLength4(&self) -> f32
Gets the squared 4D length of the vector.
Sourcepub fn get_component(&self, index: usize) -> f32
pub fn get_component(&self, index: usize) -> f32
Gets a component of the vector by index (0 = x, 1 = y, 2 = z, 3 = w).
Sourcepub fn set_component(&mut self, index: usize, value: f32)
pub fn set_component(&mut self, index: usize, value: f32)
Sets a component of the vector by index (0 = x, 1 = y, 2 = z, 3 = w).
Trait Implementations§
Source§impl AddAssign for hkVector4
impl AddAssign for hkVector4
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl DivAssign for hkVector4
impl DivAssign for hkVector4
Source§fn div_assign(&mut self, rhs: Self)
fn div_assign(&mut self, rhs: Self)
/=
operation. Read moreSource§impl From<__m128> for hkVector4
impl From<__m128> for hkVector4
Source§fn from(quad: hkQuadReal) -> Self
fn from(quad: hkQuadReal) -> Self
Source§impl MulAssign for hkVector4
impl MulAssign for hkVector4
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*=
operation. Read moreSource§impl SubAssign for hkVector4
impl SubAssign for hkVector4
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read more