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
@ -957,13 +957,10 @@ impl AnimationTargetContext<'_> {
|
||||
};
|
||||
|
||||
let rot_start = keyframes[step_start];
|
||||
let mut 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;
|
||||
}
|
||||
let rot_end = keyframes[step_start + 1];
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user