Skip to content

Commit

Permalink
Upgrade integrations.
Browse files Browse the repository at this point in the history
This change upgrades all integrations to their latest versions at time
of writing.
  • Loading branch information
olson-sean-k committed Nov 23, 2024
1 parent 9e3bd9b commit 19b6252
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 135 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,23 @@ typenum = "^1.17.0"
# Integrations.

[dependencies.cgmath]
version = "^0.17.0"
version = "^0.18.0"
optional = true

[dependencies.glam]
version = "^0.9.0"
version = "^0.29.0"
optional = true

[dependencies.mint]
version = "^0.5.0"
optional = true

[dependencies.nalgebra]
version = "^0.22.0"
version = "^0.33.0"
optional = true

[dependencies.ultraviolet]
version = "^0.6.0"
version = "^0.9.0"
optional = true

# Platform-specific features.
Expand All @@ -78,4 +78,4 @@ features = ["intel-mkl-static"]
optional = true

[dev-dependencies]
nalgebra = "^0.22.0"
nalgebra = "^0.33.0"
49 changes: 15 additions & 34 deletions src/integration/glam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,7 @@ impl Basis for Vec2 {
}

fn canonical_basis_component(index: usize) -> Option<Self> {
match index {
0 => Some(Self::unit_x()),
1 => Some(Self::unit_y()),
_ => None,
}
Self::AXES.get(index).copied()
}
}

Expand All @@ -113,12 +109,7 @@ impl Basis for Vec3 {
}

fn canonical_basis_component(index: usize) -> Option<Self> {
match index {
0 => Some(Self::unit_x()),
1 => Some(Self::unit_y()),
2 => Some(Self::unit_z()),
_ => None,
}
Self::AXES.get(index).copied()
}
}

Expand All @@ -134,12 +125,7 @@ impl Basis for Vec3A {
}

fn canonical_basis_component(index: usize) -> Option<Self> {
match index {
0 => Some(Self::unit_x()),
1 => Some(Self::unit_y()),
2 => Some(Self::unit_z()),
_ => None,
}
Self::AXES.get(index).copied()
}
}

Expand All @@ -156,13 +142,7 @@ impl Basis for Vec4 {
}

fn canonical_basis_component(index: usize) -> Option<Self> {
match index {
0 => Some(Self::unit_x()),
1 => Some(Self::unit_y()),
2 => Some(Self::unit_z()),
3 => Some(Self::unit_w()),
_ => None,
}
Self::AXES.get(index).copied()
}
}

Expand Down Expand Up @@ -488,14 +468,14 @@ impl Truncate<Vec2> for Vec3A {
impl Truncate<Vec3> for Vec4 {
fn truncate(self) -> (Vec3, Self::Item) {
let z = self.z();
(self.truncate().into(), z)
(self.truncate(), z)
}
}

impl Truncate<Vec3A> for Vec4 {
fn truncate(self) -> (Vec3A, Self::Item) {
let z = self.z();
(self.truncate(), z)
(self.truncate().into(), z)
}
}

Expand All @@ -515,7 +495,7 @@ impl VectorSpace for Vec2 {
}

fn zero() -> Self {
Self::zero()
Self::ZERO
}
}

Expand All @@ -536,7 +516,7 @@ impl VectorSpace for Vec3 {
}

fn zero() -> Self {
Self::zero()
Self::ZERO
}
}

Expand All @@ -557,25 +537,26 @@ impl VectorSpace for Vec3A {
}

fn zero() -> Self {
Self::zero()
Self::ZERO
}
}

impl VectorSpace for Vec4 {
type Scalar = f32;

fn scalar_component(&self, index: usize) -> Option<Self::Scalar> {
let [x, y, z, w] = self.to_array();
match index {
0 => Some(self.x()),
1 => Some(self.y()),
2 => Some(self.z()),
3 => Some(self.w()),
0 => Some(x),
1 => Some(y),
2 => Some(z),
3 => Some(w),
_ => None,
}
}

fn zero() -> Self {
Self::zero()
Self::ZERO
}
}

Expand Down
Loading

0 comments on commit 19b6252

Please sign in to comment.