Vec3A

Vec3A

  • x : f32
  • y : f32
  • z : f32

Description

No Documentation 🚧

Functions

FunctionSummary
abs(_self) Returns a vector containing the absolute value of each element of `self`.
abs_diff_eq(_self, rhs, max_abs_diff) Returns true if the absolute difference of all elements between `self` and `rhs` is less than or e
add(_self, rhs)No Documentation 🚧
add-1(arg0, arg1)No Documentation 🚧
add-2(arg0, arg1)No Documentation 🚧
angle_between(_self, rhs) Returns the angle (in radians) between two vectors in the range `[0, +Ï€]`. The inputs do not need to be unit vectors however they must be non-zero.
any_orthogonal_vector(_self) Returns some vector that is orthogonal to the given one. The input vector must be finite and non-z
any_orthonormal_vector(_self) Returns any unit vector that is orthogonal to the given one. The input vector must be unit length.
as_dvec3(_self) Casts all elements of `self` to `f64`.
as_i64vec3(_self) Casts all elements of `self` to `i64`.
as_ivec3(_self) Casts all elements of `self` to `i32`.
as_u64vec3(_self) Casts all elements of `self` to `u64`.
as_uvec3(_self) Casts all elements of `self` to `u32`.
ceil(_self) Returns a vector containing the smallest integer greater than or equal to a number for each elemen
clamp(_self, min, max) Component-wise clamping of values, similar to [`f32::clamp`]. Each element in `min` must be less-or-equal to the corresponding element in `max`. # Panics Will panic if `min` is greater than `max` when `glam_assert` is enabled.
clamp_length(_self, min, max) Returns a vector with a length no less than `min` and no more than `max`. # Panics Will panic if `min`
clamp_length_max(_self, max) Returns a vector with a length no more than `max`. # Panics Will panic if `max` is negative when `glam_assert` is enabled.
clamp_length_min(_self, min) Returns a vector with a length no less than `min`. # Panics Will panic if `min` is negative when `glam_assert` is enabled.
clone(_self)No Documentation 🚧
cmpeq(_self, rhs) Returns a vector mask containing the result of a `==` comparison for each element of `self` and `rhs`
cmpge(_self, rhs) Returns a vector mask containing the result of a `>=` comparison for each element of `self` and `rhs`
cmpgt(_self, rhs) Returns a vector mask containing the result of a `>` comparison for each element of `self` and `rhs`
cmple(_self, rhs) Returns a vector mask containing the result of a `<=` comparison for each element of `self` and `rhs`
cmplt(_self, rhs) Returns a vector mask containing the result of a `<` comparison for each element of `self` and `rhs`
cmpne(_self, rhs) Returns a vector mask containing the result of a `!=` comparison for each element of `self` and `rhs`
copysign(_self, rhs) Returns a vector with signs of `rhs` and the magnitudes of `self`.
cross(_self, rhs) Computes the cross product of `self` and `rhs`.
distance(_self, rhs) Computes the Euclidean distance between two points in space.
distance_squared(_self, rhs) Compute the squared euclidean distance between two points in space.
div(_self, rhs)No Documentation 🚧
div-1(arg0, arg1)No Documentation 🚧
div-2(arg0, arg1)No Documentation 🚧
div_euclid(_self, rhs) Returns the element-wise quotient of [Euclidean division] of `self` by `rhs`.
dot(_self, rhs) Computes the dot product of `self` and `rhs`.
dot_into_vec(_self, rhs) Returns a vector where every component is the dot product of `self` and `rhs`.
element_product(_self) Returns the product of all elements of `self`. In other words, this computes `self.x * self.y * ..
element_sum(_self) Returns the sum of all elements of `self`. In other words, this computes `self.x + self.y + ..`.
eq(_self, rhs)No Documentation 🚧
exp(_self) Returns a vector containing `e^self` (the exponential function) for each element of `self`.
extend(_self, w) Creates a 4D vector from `self` and the given `w` value.
floor(_self) Returns a vector containing the largest integer less than or equal to a number for each element of
fract(_self) Returns a vector containing the fractional part of the vector as `self - self.trunc()`. Note that
fract_gl(_self) Returns a vector containing the fractional part of the vector as `self - self.floor()`. Note that
from_array(a) Creates a new vector from an array.
from_vec4(v) Creates a [`Vec3A`] from the `x`, `y` and `z` elements of `self` discarding `w`. On architectures where SIMD is supported such as SSE2 on `x86_64` this conversion is a noop.
is_finite(_self) Returns `true` if, and only if, all elements are finite. If any element is either `NaN`, positive
is_finite_mask(_self) Performs `is_finite` on each element of self, returning a vector mask of the results. In other words, this computes `[x.is_finite(), y.is_finite(), ...]
is_nan(_self) Returns `true` if any elements are `NaN`.
is_nan_mask(_self) Performs `is_nan` on each element of self, returning a vector mask of the results. In other words, this computes `[x.is_nan(), y.is_nan(), ...]
is_negative_bitmask(_self) Returns a bitmask with the lowest 3 bits set to the sign bits from the elements of `self`. A negat
is_normalized(_self) Returns whether `self` is length `1.0` or not. Uses a precision threshold of approximately `1e-4`.
length(_self) Computes the length of `self`.
length_recip(_self) Computes `1.0 / length()`. For valid results, `self` must _not_ be of length zero.
length_squared(_self) Computes the squared length of `self`. This is faster than `length()` as it avoids a square root o
lerp(_self, rhs, s) Performs a linear interpolation between `self` and `rhs` based on the value `s`. When `s` is `0.0`
max(_self, rhs) Returns a vector containing the maximum values for each element of `self` and `rhs`. In other word
max_element(_self) Returns the horizontal maximum of `self`. In other words this computes `max(x, y, ..)`.
midpoint(_self, rhs) Calculates the midpoint between `self` and `rhs`. The midpoint is the average of, or halfway point
min(_self, rhs) Returns a vector containing the minimum values for each element of `self` and `rhs`. In other word
min_element(_self) Returns the horizontal minimum of `self`. In other words this computes `min(x, y, ..)`.
move_towards(_self, rhs, d) Moves towards `rhs` based on the value `d`. When `d` is `0.0`, the result will be equal to `self`.
mul(_self, rhs)No Documentation 🚧
mul-1(arg0, arg1)No Documentation 🚧
mul-2(arg0, arg1)No Documentation 🚧
mul_add(_self, a, b) Fused multiply-add. Computes `(self * a) + b` element-wise with only one rounding error, yielding a more accurate result than an unfused multiply-add. Using `mul_add` *may* be more performant than an unfused multiply-add if the target architecture has a dedicated fma CPU instruction. However, this is not always true, and will be heavily dependant on designing algorithms with specific target hardware in mind.
neg(_self)No Documentation 🚧
new(x, y, z) Creates a new vector.
normalize(_self) Returns `self` normalized to length 1.0. For valid results, `self` must be finite and _not_ of len
normalize_or(_self, fallback) Returns `self` normalized to length 1.0 if possible, else returns a fallback value. In particular
normalize_or_zero(_self) Returns `self` normalized to length 1.0 if possible, else returns zero. In particular, if the inpu
powf(_self, n) Returns a vector containing each element of `self` raised to the power of `n`.
project_onto(_self, rhs) Returns the vector projection of `self` onto `rhs`. `rhs` must be of non-zero length. # Panics W
project_onto_normalized(_self, rhs) Returns the vector projection of `self` onto `rhs`. `rhs` must be normalized. # Panics Will pani
recip(_self) Returns a vector containing the reciprocal `1.0/n` of each element of `self`.
reflect(_self, normal) Returns the reflection vector for a given incident vector `self` and surface normal `normal`. `normal`
refract(_self, normal, eta) Returns the refraction direction for a given incident vector `self`, surface normal `normal` and r
reject_from(_self, rhs) Returns the vector rejection of `self` from `rhs`. The vector rejection is the vector perpendicula
reject_from_normalized(_self, rhs) Returns the vector rejection of `self` from `rhs`. The vector rejection is the vector perpendicula
rem(_self, rhs)No Documentation 🚧
rem-1(arg0, arg1)No Documentation 🚧
rem-2(arg0, arg1)No Documentation 🚧
rem_euclid(_self, rhs) Returns the element-wise remainder of [Euclidean division] of `self` by `rhs`. [Euclidean division
round(_self) Returns a vector containing the nearest integer to a number for each element of `self`. Round half
select(mask, if_true, if_false) Creates a vector from the elements in `if_true` and `if_false`, selecting which to use for each el
signum(_self) Returns a vector with elements representing the sign of `self`. - `1.0` if the number is positive,
splat(v) Creates a vector with all elements set to `v`.
sub(_self, rhs)No Documentation 🚧
sub-1(arg0, arg1)No Documentation 🚧
sub-2(arg0, arg1)No Documentation 🚧
to_array(_self) `[x, y, z]`
trunc(_self) Returns a vector containing the integer part each element of `self`. This means numbers are always
truncate(_self) Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`. Truncation may also b
with_x(_self, x) Creates a 3D vector from `self` with the given value of `x`.
with_y(_self, y) Creates a 3D vector from `self` with the given value of `y`.
with_z(_self, z) Creates a 3D vector from `self` with the given value of `z`.