Assembly: Implement special drag mode for revolute.

This commit is contained in:
Paddle
2023-12-23 21:21:22 +01:00
committed by PaddleStroke
parent 43019a8f34
commit 48173f2b9d
12 changed files with 1121 additions and 183 deletions

View File

@@ -464,6 +464,22 @@ float_type Vector3<float_type>::GetAngle(const Vector3& rcVect) const
return float_type(acos(dot));
}
template<class float_type>
float_type Vector3<float_type>::GetAngleOriented(const Vector3& rcVect, const Vector3& norm) const
{
float_type angle = GetAngle(rcVect);
Vector3<float_type> crossProduct = Cross(rcVect);
// Use dot product to determine the sign
float_type dot = crossProduct.Dot(norm);
if (dot < 0) {
angle = 2 * traits_type::pi() - angle;
}
return angle;
}
template<class float_type>
void Vector3<float_type>::TransformToCoordinateSystem(const Vector3& rclBase,
const Vector3& rclDirX,