public static float CatmullRom(float value1, float value2, float value3, float value4, float amount) { float num = amount * amount; float num2 = amount * num; return 0.5f * (2f * value2 + (-value1 + value3) * amount + (2f * value1 - 5f * value2 + 4f * value3 - value4) * num + (-value1 + 3f * value2 - 3f * value3 + value4) * num2); } public static float Hermite(float value1, float tangent1, float value2, float tangent2, float amount)
public static void CatmullRom(ref Vector3 value1, ref Vector3 value2, ref Vector3 value3, ref Vector3 value4, FP amount, out Vector3 result) { result = new Vector3(MathHelper.CatmullRom(value1.X, value2.X, value3.X, value4.X, amount), MathHelper.CatmullRom(value1.Y, value2.Y, value3.Y, value4.Y, amount), MathHelper.CatmullRom(value1.Z, value2.Z, value3.Z, value4.Z, amount)); }