void DoInterpolate() { if (!mSegment.Spline.IsInitialized) { return; } bool calc = !Input.IsNone; if (calc) { System.Type metaType = System.Type.GetType(MetaDataType.Value); float inputF = (UseWorldUnits.Value) ? mSegment.DistanceToLocalF(Input.Value) : Input.Value; if (StorePosition.UseVariable) { StorePosition.Value = (UseCache.Value) ? mSegment.InterpolateFast(inputF) : mSegment.Interpolate(inputF); } if (StoreTangent.UseVariable) { StoreTangent.Value = mSegment.GetTangent(inputF); } if (StoreUpVector.UseVariable) { StoreUpVector.Value = mSegment.GetOrientationUpFast(inputF); } if (StoreRotation.UseVariable) { StoreRotation.Value = (StoreUpVector.IsNone) ? mSegment.GetOrientationFast(inputF) : Quaternion.LookRotation(mSegment.GetTangent(inputF), StoreUpVector.Value); } if (StoreScale.UseVariable) { StoreScale.Value = mSegment.InterpolateScale(inputF); } if (StoreTF.UseVariable) { StoreTF.Value = mSegment.LocalFToTF(inputF); } if (StoreSegmentDistance.UseVariable) { StoreSegmentDistance.Value = mSegment.LocalFToDistance(inputF); } if (StoreDistance.UseVariable) { StoreDistance.Value = (StoreSegmentDistance.UseVariable) ? StoreSegmentDistance.Value + mSegment.Distance : mSegment.LocalFToDistance(inputF) + mSegment.Distance; } if (StoreSegmentF.UseVariable) { StoreSegmentF.Value = inputF; } if (metaType != null) { if (StoreMetadata.UseVariable) { StoreMetadata.Value = mSegment.GetMetaData(metaType); } if (StoreInterpolatedMetadata.useVariable) { StoreInterpolatedMetadata.SetValue(mSegment.InterpolateMetadata(metaType, inputF)); } } } // General if (StoreLength.UseVariable) { StoreLength.Value = mSegment.Length; } if (StoreSegmentIndex.UseVariable) { StoreSegmentIndex.Value = mSegment.SegmentIndex; } if (StoreControlPointIndex.UseVariable) { StoreControlPointIndex.Value = mSegment.ControlPointIndex; } }