mirror of
https://github.com/bevyengine/bevy
synced 2025-02-18 15:08:36 +00:00
Remove unnecessary compute for rotation interpolation (#14019)
# Objective - `slerp` has a built-in short path check. And quaternions are ensured to be normalized during loading . ## Solution - remove it ## Testing `many_foxes ` in single thread 
This commit is contained in:
parent
d8b45ca136
commit
dbffb41e50
1 changed files with 3 additions and 6 deletions
|
@ -957,13 +957,10 @@ impl AnimationTargetContext<'_> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let rot_start = keyframes[step_start];
|
let rot_start = keyframes[step_start];
|
||||||
let mut rot_end = keyframes[step_start + 1];
|
let rot_end = keyframes[step_start + 1];
|
||||||
// Choose the smallest angle for the rotation
|
|
||||||
if rot_end.dot(rot_start) < 0.0 {
|
|
||||||
rot_end = -rot_end;
|
|
||||||
}
|
|
||||||
// Rotations are using a spherical linear interpolation
|
// Rotations are using a spherical linear interpolation
|
||||||
let rot = rot_start.normalize().slerp(rot_end.normalize(), lerp);
|
let rot = rot_start.slerp(rot_end, lerp);
|
||||||
transform.rotation = transform.rotation.slerp(rot, weight);
|
transform.rotation = transform.rotation.slerp(rot, weight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue