public static dynamic TryGetPathProperty(Track track, string propertyName, float time) { Property pathProperty = null; track?.PathProperties.TryGetValue(propertyName, out pathProperty); if (pathProperty == null) { return(null); } PointDefinitionInterpolation pointDataInterpolation = (PointDefinitionInterpolation)pathProperty.Value; switch (pathProperty.PropertyType) { case PropertyType.Linear: return(pointDataInterpolation.InterpolateLinear(time)); case PropertyType.Quaternion: return(pointDataInterpolation.InterpolateQuaternion(time)); case PropertyType.Vector3: return(pointDataInterpolation.Interpolate(time)); case PropertyType.Vector4: return(pointDataInterpolation.InterpolateVector4(time)); default: return(null); } }
public static Quaternion?TryGetQuaternionPathProperty(Track track, string propertyName, float time) { PointDefinitionInterpolation pointDataInterpolation = GetPathInterpolation(track, propertyName, PropertyType.Quaternion); if (pointDataInterpolation != null) { return(pointDataInterpolation.InterpolateQuaternion(time)); } return(null); }