Migrate codebase to glam + release v0.26.0 #401
+13,378
−13,759
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
More insights on the rational behind this change will be provided in an upcoming blog-post (tl.dr: it’s to prepare for our upcoming GPU computing work).
0.26.0
Breaking changes
This release migrates parry from
nalgebratoglam(via theglamxcrate) for future compatibility withrust-gpu. This is a major breaking change affecting almost all public APIs.Type renames
Isometry→Pose(usingglamx::Pose2/Pose3)Rotation→Rot2/Rot3(usingglamx::Rot2/Rot3)IsometryOps→PoseOpsIsometryOpt→PoseOptRemoved types
Point<Real>- useVectorinstead. Points and vectors are now unified.UnitVector<Real>- useVectorinstead. Normalization is no longer encoded in the type.Translation<Real>- useVectorfor translations.Math type changes
Vectoris nowglam::Vec2/Vec3/DVec2/DVec3depending on dimension and precision featuresMatrixis nowglam::Mat2/Mat3/DMat2/DMat3mathmodule now re-exports glam types and provides dimension-agnostic aliasesAPI signature changes
&Point<Real>or&Vector<Real>now takeVectorby value&Isometry<Real>now take&PoseorPoseby valueHalfSpace::newnow takesVectorinstead ofUnit<Vector<Real>>Segment::new,Triangle::new,Capsule::newnow takeVectorinstead ofPointAabb::minsandAabb::maxsare nowVectorinstead ofPoint<Real>Migration guide
If your codebase currently relies on
nalgebra, note thatnalgebraandglamxprovide type conversion. Enable thecorresponding features:
nalgebra = { version = "0.34", features = [ "convert-glam030" ] }glamx = { version = "0.1", features = ["nalgebra"] }then you can convert between
glamandnalgebratypes using.into().Common patterns:
Point3::origin()→Vector::ZEROVector3::x()→Vector::Xpoint.coords→ just use the vector directlyUnit::new_normalize(v)→v.normalize()Isometry3::identity()→Pose::IDENTITYisometry.translation.vector→pose.translationModified
glamxinstead ofnalgebraas the public linear algebra dependencymacroquadtokiss3d