-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error: The vector given to Dir3::new_unchecked
is not normalized
#573
Comments
I'm getting this same panic occasionally when I call I had this error with the older version (bevy 0.14) and solved it by getting rid of all usage of the LinearVelocity component. But now with the upgrade to bevy 0.15 and avian 0.2 the bug is back. My hypothesis is somewhere, something is setting the transform.rotation to a non-normalized quaternion. |
I got a similar error message by using the "look_at()" and "up()" function in my code. I replaced the usage of the up() with "Vec3::Y" like this:
And I never got the error message again. Maybe it can help. |
I got the same issue, makes it currently impossible to work on one of my projects. |
#620 appears to fix #618, which is a very similar issue to this one. I'd appreciate if someone who is getting this panic could test that branch to see if it fixes it :) (or if it causes any other issues) Also FYI, this is a |
Hey there 👋 Encountered this after updating my version of
avian
to the latestmain
(For Bevy 0.15 compatibility):This happens very spuriously/inconsistently, but generally when shooting enemies in my game.
The issue seems to arise from a
Quat * Dir3
multiplication in this function:avian/src/position.rs
Lines 727 to 729 in 56d7c59
I modified it to check for normalization of the result and print the values of both operands and result:
Then, right before the assertion failure, I get this output:
It looks like for whatever reason, the quaternion being used for
global_rotation
here is non-normalized.This might be caused by an internal change in glam, since bevy did update from 0.27.x to 0.29.x, and especially in 0.29.0 there seems to be a few changes related to quaternions that could cause this?Edit: Looking around at recent PRs, I suspect the most likely culprit is this: #520
Edit 2: Just added the missing
.normalize()
call totransform_to_position
that was removed in #520, and the crash is gone.Edit 3: I think I might have hit #522 as well, check the footage below, this weird rotation glitch does not happen when reverting to the old addition-based math, from before #520.
[CW: Videogame Violence]
rotation.issue.720p.mov
The text was updated successfully, but these errors were encountered: