Skip to content

Conversation

@pragmatrix
Copy link
Owner

No description provided.

@pragmatrix pragmatrix requested a review from Copilot December 31, 2025 06:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Hermite interpolation as an animation option alongside the existing linear interpolation, enabling velocity-continuous animations that smoothly chain together. The implementation maintains backward compatibility by introducing an enum wrapper while preserving the existing linear interpolation as the default behavior.

Key Changes:

  • Implements Hermite interpolation with velocity continuity for smoother animation chaining
  • Refactors animation system to support multiple interpolation strategies via an enum pattern
  • Adds Add and Mul<f64> trait implementations for Transform and PixelCamera types

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
geometry/src/transform.rs Implements Add and Mul<f64> traits for Transform to support hermite interpolation operations
geometry/src/pixel_camera.rs Implements Add and Mul<f64> traits for PixelCamera to support hermite interpolation operations
applications/src/scene.rs Updates animation method signature to require Add and Mul<f64> trait bounds
animation/src/lib.rs Renames module from blended_animation to blended for improved organization
animation/src/blended/linear.rs Renames BlendedAnimation struct to Linear as part of refactoring to support multiple interpolation types
animation/src/blended/hermite.rs New file implementing Hermite interpolation with velocity continuity, including comprehensive tests
animation/src/blended.rs New file introducing BlendedAnimation enum to dispatch between Linear and Hermite interpolation strategies
animation/src/animated.rs Updates trait bounds to include Add and Mul<f64> requirements for hermite interpolation support
.github/copilot-instructions.md Documents new coding guidelines learned from implementing this feature

fn add(self, rhs: Transform) -> Self::Output {
Transform {
translate: self.translate + rhs.translate,
rotate: self.rotate.slerp(rhs.rotate, 0.5),
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Add implementation for quaternion rotation uses slerp with a fixed 0.5 parameter, which averages the two rotations. This doesn't satisfy the mathematical properties of addition (e.g., commutativity and associativity with respect to the Hermite interpolation). For Hermite interpolation to work correctly with rotations, consider using quaternion addition or document why averaging is the intended behavior here.

Suggested change
rotate: self.rotate.slerp(rhs.rotate, 0.5),
rotate: self.rotate + rhs.rotate,

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants