diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5617ee5..5452463 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: strategy: + fail-fast: false matrix: toolchain: # Run against a "known good" nightly. Rustc version is 1 day behind the toolchain date @@ -46,6 +47,7 @@ jobs: test: strategy: + fail-fast: false matrix: toolchain: - nightly-2023-06-01 diff --git a/citro3d/src/math/fvec.rs b/citro3d/src/math/fvec.rs index b1d7f12..c6624c6 100644 --- a/citro3d/src/math/fvec.rs +++ b/citro3d/src/math/fvec.rs @@ -57,12 +57,12 @@ impl FVec4 { /// The dot product of two vectors. pub fn dot(&self, rhs: &Self) -> f32 { - unsafe { citro3d_sys::FVec3_Dot(self.0, rhs.0) } + unsafe { citro3d_sys::FVec4_Dot(self.0, rhs.0) } } /// The magnitude of the vector. pub fn magnitude(&self) -> f32 { - unsafe { citro3d_sys::FVec3_Magnitude(self.0) } + unsafe { citro3d_sys::FVec4_Magnitude(self.0) } } /// Normalize the vector to a magnitude of `1.0`. @@ -144,7 +144,7 @@ mod tests { let dot = l.dot(&FVec4::splat(3.0)); assert!((dot - 24.0).abs() < f32::EPSILON); - assert!((l.magnitude() - 8.0).abs() < f32::EPSILON); + assert!((l.magnitude() - 4.0).abs() < f32::EPSILON); let norm = l.normalize(); assert!((norm.magnitude() - 1.0).abs() < f32::EPSILON); @@ -166,7 +166,7 @@ mod tests { let dot = l.dot(&FVec3::splat(3.0)); assert!((dot - 18.0).abs() < f32::EPSILON); - assert!((l.magnitude() - 8.0).abs() < f32::EPSILON); + assert!((l.magnitude() - f32::sqrt(12.0)).abs() < f32::EPSILON); let norm = l.normalize(); assert!((norm.magnitude() - 1.0).abs() < f32::EPSILON); diff --git a/citro3d/src/math/ops.rs b/citro3d/src/math/ops.rs index dffe352..7a4f486 100644 --- a/citro3d/src/math/ops.rs +++ b/citro3d/src/math/ops.rs @@ -15,7 +15,7 @@ impl> Sub for FVec4 { type Output = Self; fn sub(self, rhs: Rhs) -> Self::Output { - Self(unsafe { citro3d_sys::FVec4_Add(self.0, rhs.borrow().0) }) + Self(unsafe { citro3d_sys::FVec4_Subtract(self.0, rhs.borrow().0) }) } } @@ -47,7 +47,7 @@ impl> Sub for FVec3 { type Output = Self; fn sub(self, rhs: Rhs) -> Self::Output { - Self(unsafe { citro3d_sys::FVec3_Add(self.0, rhs.borrow().0) }) + Self(unsafe { citro3d_sys::FVec3_Subtract(self.0, rhs.borrow().0) }) } }