You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Fix Pathfollow direction
Co-authored-by: aaronfranke <arnfranke@yahoo.com>
This commit is contained in:
committed by
Silc Lizard (Tokage) Renew
parent
dc625bcbfc
commit
42aa5398d9
@@ -1648,9 +1648,9 @@ void Curve3D::_bake() const {
|
||||
Vector3 forward = forward_ptr[0];
|
||||
|
||||
if (abs(forward.dot(Vector3(0, 1, 0))) > 1.0 - UNIT_EPSILON) {
|
||||
frame_prev = Basis::looking_at(-forward, Vector3(1, 0, 0));
|
||||
frame_prev = Basis::looking_at(forward, Vector3(1, 0, 0));
|
||||
} else {
|
||||
frame_prev = Basis::looking_at(-forward, Vector3(0, 1, 0));
|
||||
frame_prev = Basis::looking_at(forward, Vector3(0, 1, 0));
|
||||
}
|
||||
|
||||
up_write[0] = frame_prev.get_column(1);
|
||||
@@ -1809,8 +1809,8 @@ Basis Curve3D::_sample_posture(Interval p_interval, bool p_apply_tilt) const {
|
||||
}
|
||||
|
||||
// Build frames at both ends of the interval, then interpolate.
|
||||
const Basis frame_begin = Basis::looking_at(-forward_begin, up_begin);
|
||||
const Basis frame_end = Basis::looking_at(-forward_end, up_end);
|
||||
const Basis frame_begin = Basis::looking_at(forward_begin, up_begin);
|
||||
const Basis frame_end = Basis::looking_at(forward_end, up_end);
|
||||
const Basis frame = frame_begin.slerp(frame_end, frac).orthonormalized();
|
||||
|
||||
if (!p_apply_tilt) {
|
||||
|
||||
Reference in New Issue
Block a user