protected override void RecalculateLengthBias() { const int res = LengthSampleCount; ClearData(); SegmentLength.Clear(); CalculateCubicParameters(); if (ControlPointCount <= 1) { LengthCache = 0f; SegmentLength.Add(1f); return; } if (ControlPointCount == 2) { LengthCache = math.distance(GetControlPoint2DLocal(0), GetControlPoint2DLocal(1)); SegmentLength.Add(1f); return; } if (ControlPointCount == 3) { LengthCache = LengthBetweenPoints(0, res); SegmentLength.Add(1f); return; } // fallback to known good code base.RecalculateLengthBias(); }
protected override void setJSON(JObject obj, BaseClassIfc host, SetJsonOptions options) { base.setJSON(obj, host, options); obj["StartPlacement"] = StartPlacement.getJson(this, options); obj["SegmentLength"] = SegmentLength.getJson(this, options); obj["ParentCurve"] = ParentCurve.getJson(this, options); }
public string[] ToStringArray() { return(new string[] { InputFile, SegmentLength.ToString(), OutputLocation, FilenamePrefix.EndsWith("/") ? FilenamePrefix : FilenamePrefix + "/", PlaylistFilename, ProcessId, Marshal.GetFunctionPointerForDelegate(CallbackMethod).ToInt64().ToString() }); }