TrueSync.TSVector.ClampMagnitude is inconsistent with UnityEngine.Vector3.ClampMagnitude?
Options
Unity decompiled: https://github.com/MattRix/UnityDecompiled/blob/master/UnityEngine/UnityEngine/Vector3.cs
Vector3 result; if (vector.sqrMagnitude > maxLength * maxLength) { result = vector.normalized * maxLength; } else { result = vector; } return result;Photon:
public static TSVector ClampMagnitude(TSVector vector, FP maxLength) { return Normalize(vector) * maxLength; }Unless I'm mistaken, Unity CLAMPS the magnitude between 0 and maxLength, whereas Photon SETS the magnitude to maxLength.
1
Best Answer
-
Thanks @niki_walker_ubisoft! You are right5
Answers
-
Nice catch!!
0 -
Thanks @niki_walker_ubisoft! You are right5