#[repr(C)]pub struct Vector3 {
pub x: f32,
pub y: f32,
pub z: f32,
}Fields§
§x: f32§y: f32§z: f32Implementations§
Source§impl Vector3
impl Vector3
Sourcepub fn add_value(self, add: f32) -> Self
pub fn add_value(self, add: f32) -> Self
Add scalar to all components. (raymath Vector3AddValue)
Sourcepub fn sub_value(self, sub: f32) -> Self
pub fn sub_value(self, sub: f32) -> Self
Subtract scalar from all components. (raymath Vector3SubtractValue)
Sourcepub fn multiply(self, other: Vector3) -> Self
pub fn multiply(self, other: Vector3) -> Self
Component-wise multiply. (raymath Vector3Multiply)
Sourcepub fn perpendicular(self) -> Self
pub fn perpendicular(self) -> Self
Perpendicular vector. (raymath Vector3Perpendicular)
Sourcepub fn length_sqr(self) -> f32
pub fn length_sqr(self) -> f32
Squared vector length. (raymath Vector3LengthSqr)
Sourcepub fn distance(self, other: Vector3) -> f32
pub fn distance(self, other: Vector3) -> f32
Distance between two vectors. (raymath Vector3Distance)
Sourcepub fn distance_sqr(self, other: Vector3) -> f32
pub fn distance_sqr(self, other: Vector3) -> f32
Squared distance between two vectors. (raymath Vector3DistanceSqr)
Sourcepub fn angle(self, other: Vector3) -> f32
pub fn angle(self, other: Vector3) -> f32
Angle between two vectors (radians). (raymath Vector3Angle)
Sourcepub fn reject(self, other: Vector3) -> Self
pub fn reject(self, other: Vector3) -> Self
Reject self from other (component perpendicular to other). (raymath Vector3Reject)
Sourcepub fn rotate_by_quaternion(self, q: Quaternion) -> Self
pub fn rotate_by_quaternion(self, q: Quaternion) -> Self
Rotate by quaternion. (raymath Vector3RotateByQuaternion)
Sourcepub fn rotate_by_axis_angle(self, axis: Vector3, angle: f32) -> Self
pub fn rotate_by_axis_angle(self, axis: Vector3, angle: f32) -> Self
Rotate by axis and angle (radians). (raymath Vector3RotateByAxisAngle)
Sourcepub fn move_towards(self, target: Vector3, max_distance: f32) -> Self
pub fn move_towards(self, target: Vector3, max_distance: f32) -> Self
Move towards target by at most maxDistance. (raymath Vector3MoveTowards)
Sourcepub fn lerp(self, other: Vector3, amount: f32) -> Self
pub fn lerp(self, other: Vector3, amount: f32) -> Self
Linear interpolation. (raymath Vector3Lerp)
Sourcepub fn cubic_hermite(
self,
tangent1: Vector3,
v2: Vector3,
tangent2: Vector3,
amount: f32,
) -> Self
pub fn cubic_hermite( self, tangent1: Vector3, v2: Vector3, tangent2: Vector3, amount: f32, ) -> Self
Cubic Hermite interpolation. (raymath Vector3CubicHermite)
Sourcepub fn reflect(self, normal: Vector3) -> Self
pub fn reflect(self, normal: Vector3) -> Self
Reflect vector about normal. (raymath Vector3Reflect)
Sourcepub fn barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) -> Self
pub fn barycenter(p: Vector3, a: Vector3, b: Vector3, c: Vector3) -> Self
Barycentric coordinates of point p in triangle (a, b, c). (raymath Vector3Barycenter)
Sourcepub fn unproject(self, projection: Matrix, view: Matrix) -> Self
pub fn unproject(self, projection: Matrix, view: Matrix) -> Self
Unproject vector from screen space using projection and view matrices. (raymath Vector3Unproject)
Sourcepub fn to_float_array(self) -> float3
pub fn to_float_array(self) -> float3
Convert to array of floats. (raymath Vector3ToFloatV)
Sourcepub fn clamp(self, min: Vector3, max: Vector3) -> Self
pub fn clamp(self, min: Vector3, max: Vector3) -> Self
Clamp components between min and max vectors. (raymath Vector3Clamp)
Sourcepub fn clamp_value(self, min: f32, max: f32) -> Self
pub fn clamp_value(self, min: f32, max: f32) -> Self
Clamp length between min and max scalars. (raymath Vector3ClampValue)
Trait Implementations§
Source§impl AddAssign for Vector3
impl AddAssign for Vector3
Source§fn add_assign(&mut self, rhs: Vector3)
fn add_assign(&mut self, rhs: Vector3)
+= operation. Read moreimpl Copy for Vector3
Source§impl MulAssign<f32> for Vector3
impl MulAssign<f32> for Vector3
Source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*= operation. Read more