public FInterpCurvePoint(float _fInVal, T _tOutVal, T _tArriveTangent, T _tLeaveTangent, ESplinePointType _eInterpMode) { InVal = _fInVal; OutVal = _tOutVal; ArriveTangent = _tArriveTangent; LeaveTangent = _tLeaveTangent; InterpMode = _eInterpMode; }
/// <summary> /// 设置关键点的样线类型 /// </summary> public void SetSplinePointType(int PointIndex, ESplinePointType Type, bool bUpdateSpline = true) { if ((PointIndex >= 0) && (PointIndex < SplineCurves.Position.Points.Count)) { SplineCurves.Position.Points[PointIndex].InterpMode = (Type); if (bUpdateSpline) { UpdateSpline(); } } }
public FSplinePoint( float _fInputKey = 0f, Vector3 _vPos = new Vector3(), Vector3 _vArriveTangent = new Vector3(), Vector3 _vLeaveTangent = new Vector3(), Quaternion _qRotation = new Quaternion(), ESplinePointType _eType = ESplinePointType.Curve) { InputKey = _fInputKey; Position = _vPos; ArriveTangent = _vArriveTangent; LeaveTangent = _vLeaveTangent; Rotation = _qRotation; Scale = Vector3.one; Type = _eType; }
/// <summary>Specify the type of a spline point</summary> public extern void SetSplinePointType(int PointIndex, ESplinePointType Type, bool bUpdateSpline = true);
/// <summary>Specify the type of a spline point</summary> public void SetSplinePointType(int PointIndex, ESplinePointType Type, bool bUpdateSpline = true) { CheckIsValid(); SetSplinePointType(_this.Get(), PointIndex, (int)Type, bUpdateSpline?1:0); }
private void DrawSelectedPointInspector() { GUILayout.Label("当前选择的关键点"); int index = m_selectedIndex; EditorGUI.BeginChangeCheck(); Vector3 point = EditorGUILayout.Vector3Field("Position", SelectSpline.GetLocationAtSplinePoint(index, ESplineCoordinateSpace.World)); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(SelectSpline, "Move Position"); EditorUtility.SetDirty(SelectSpline); SelectSpline.SetLocationAtSplinePoint(index, point, ESplineCoordinateSpace.World); } EditorGUI.BeginChangeCheck(); Vector3 ArriveTangent = EditorGUILayout.Vector3Field("ArriveTangent", SelectSpline.GetArriveTangentAtSplinePoint(index, ESplineCoordinateSpace.World)); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(SelectSpline, "Move ArriveTangent"); EditorUtility.SetDirty(SelectSpline); SelectSpline.SetArriveTangentAtSplilnePoint(index, ArriveTangent, ESplineCoordinateSpace.World); } EditorGUI.BeginChangeCheck(); Vector3 LeaveTangent = EditorGUILayout.Vector3Field("LeaveTangent", SelectSpline.GetLeaveTangentAtSplinePoint(index, ESplineCoordinateSpace.World)); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(SelectSpline, "Move LeaveTangent"); EditorUtility.SetDirty(SelectSpline); SelectSpline.SetLeaveTangentAtSplilnePoint(index, LeaveTangent, ESplineCoordinateSpace.World); } EditorGUI.BeginChangeCheck(); ESplinePointType InterpMode = (ESplinePointType)EditorGUILayout.EnumPopup("InterpMode", SelectSpline.GetSplinePointType(index)); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(SelectSpline, "Change InterpMode"); EditorUtility.SetDirty(SelectSpline); SelectSpline.SetSplinePointType(index, InterpMode); } //EditorGUI.BeginChangeCheck(); //Quaternion Rotation = EditorGUILayout.("Rotation", SelectSpline.GetQuaternionAtSplineInputKey((float)index,ESplineCoordinateSpace.World); //if (EditorGUI.EndChangeCheck()) //{ // Undo.RecordObject(SelectSpline, "Change Rotation"); // EditorUtility.SetDirty(SelectSpline); // SelectSpline.SetScaleAtSplinePoint(index, Rotation); //} EditorGUI.BeginChangeCheck(); Vector3 Scale = EditorGUILayout.Vector3Field("Scale", SelectSpline.GetScaleAtSplinePoint(index)); if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(SelectSpline, "Change Scale"); EditorUtility.SetDirty(SelectSpline); SelectSpline.SetScaleAtSplinePoint(index, Scale); } }
public FInterpCurveFloatPoint(float _fInVal, float _tOutVal, float _tArriveTangent, float _tLeaveTangent, ESplinePointType _eInterpMode) : base(_fInVal, _tOutVal, _tArriveTangent, _tLeaveTangent, _eInterpMode) { }
public FInterpCurveQuaternionPoint(float _fInVal, Quaternion _tOutVal, Quaternion _tArriveTangent, Quaternion _tLeaveTangent, ESplinePointType _eInterpMode) : base(_fInVal, _tOutVal, _tArriveTangent, _tLeaveTangent, _eInterpMode) { }