You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
real_tVector3::signed_angle_to(const Vector3 &p_to, const Vector3 &p_axis) const {
Vector3 cross_to = cross(p_to);
real_t unsigned_angle = Math::atan2(cross_to.length(), dot(p_to)); // this line is incorrect in rustreal_t sign = cross_to.dot(p_axis);
return (sign < 0) ? -unsigned_angle : unsigned_angle;
}
in the gdext impl is backwards
pubfnsigned_angle_to(self,to:Self,axis:Self) -> real{let cross_to = self.cross(to);// the atan2 is inverted here atan2(self dot to, cross.len)
-- let unsigned_angle = self.dot(to).atan2(cross_to.length());// this is how it should be atan2(cross.len, self dot to);
++ let unsigned_angle = cross_to.length().atan2(self.dot(to));let sign = cross_to.dot(axis);if sign < 0.0{
-unsigned_angle
}else{
unsigned_angle
}}
The text was updated successfully, but these errors were encountered:
The implementation of signed_angle_to is incorrect in this line.
here is the snippet from godot's impl
in the gdext impl is backwards
The text was updated successfully, but these errors were encountered: