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

![image](https://github.com/bevyengine/bevy/assets/45868716/a7e74050-e202-4adb-9179-82a87263c300)
This commit is contained in:
re0312 2024-06-26 05:14:37 +08:00 committed by GitHub
parent d8b45ca136
commit dbffb41e50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}