Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Refactor the CameraComponent3D #3394

Merged
merged 6 commits into from
Dec 14, 2024

Conversation

wolfenrain
Copy link
Contributor

@wolfenrain wolfenrain commented Dec 14, 2024

Description

Allow the users to create their own camera component while also providing a few basic camera components

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

@wolfenrain wolfenrain marked this pull request as ready for review December 14, 2024 12:30
Comment on lines +38 to +45
// Compute the desired position based on the rotation and distance.
final desiredPosition = following + _getRotatedOffset();

// Smoothly interpolate the camera's position toward the desired position.
position = position + (desiredPosition - position) * (followDamping * dt);

// Always look at the following point.
target.setFrom(following);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This math is not yet perfect, it seems to sometimes overflow and reset the rotation.

Copy link
Member

@luanpotter luanpotter left a comment

Choose a reason for hiding this comment

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

LGTM

@wolfenrain wolfenrain enabled auto-merge (squash) December 14, 2024 13:57
@wolfenrain wolfenrain merged commit 4a61718 into main Dec 14, 2024
8 checks passed
@wolfenrain wolfenrain deleted the feat-refactor-the-camera-component-3d branch December 14, 2024 14:48
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