-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - use Mul<f32>
to double the value of Vec3
#6607
Conversation
@@ -169,8 +169,7 @@ fn integrate(mut query: Query<(&mut Acceleration, &mut Transform, &mut LastPos)> | |||
// verlet integration | |||
// x(t+dt) = 2x(t) - x(t-dt) + a(t)dt^2 + O(dt^4) | |||
|
|||
let new_pos = | |||
transform.translation + transform.translation - last_pos.0 + acceleration.0 * dt_sq; | |||
let new_pos = transform.translation * 2.0 - last_pos.0 + acceleration.0 * dt_sq; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move the 2.0 to before translation to match the equation above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't do this, because we don't have the impl Mul<Vec3> for f32
rule.
bors r+ |
Pull request successfully merged into main. Build succeeded:
|
Mul<f32>
to double the value of Vec3
Mul<f32>
to double the value of Vec3
improve the example code
improve the example code
improve the example code
improve the example code