Various weapon fixes and some change on vehicle sync

This commit is contained in:
sardelka9515
2022-12-04 19:34:54 +08:00
parent 4cc5054b91
commit 3a9068f060
24 changed files with 247 additions and 290 deletions

View File

@ -22,6 +22,16 @@ namespace RageCoop.Core
};
}
public static Vector3 Limit(this Vector3 v, float length)
{
// Avoid square root to gain more performance
if (v.LengthSquared() > length * length)
{
return v.Normalized * length;
}
return v;
}
/// <summary>
/// </summary>
public static Vector3 ToVector(this Quaternion vec)