Add D6 Joint motions editing in Editor properties panel
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
|
||||
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace FlaxEngine
|
||||
{
|
||||
partial struct D6JointDrive
|
||||
@@ -24,4 +26,59 @@ namespace FlaxEngine
|
||||
Acceleration = acceleration;
|
||||
}
|
||||
}
|
||||
partial class D6Joint
|
||||
{
|
||||
#if FLAX_EDITOR
|
||||
internal struct D6JointAxisMotion
|
||||
{
|
||||
[EditorOrder(0), DefaultValue(D6JointMotion.Locked)]
|
||||
[Tooltip("Movement on the X axis.")]
|
||||
public D6JointMotion X;
|
||||
|
||||
[EditorOrder(1), DefaultValue(D6JointMotion.Locked)]
|
||||
[Tooltip("Movement on the Y axis.")]
|
||||
public D6JointMotion Y;
|
||||
|
||||
[EditorOrder(2), DefaultValue(D6JointMotion.Locked)]
|
||||
[Tooltip("Movement on the Z axis.")]
|
||||
public D6JointMotion Z;
|
||||
|
||||
[EditorOrder(2), DefaultValue(D6JointMotion.Locked)]
|
||||
[Tooltip("Rotation around the X axis.")]
|
||||
public D6JointMotion Twist;
|
||||
|
||||
[EditorOrder(4), DefaultValue(D6JointMotion.Locked)]
|
||||
[Tooltip("Rotation around the Y axis."), EditorDisplay(null, "Swing Y")]
|
||||
public D6JointMotion SwingY;
|
||||
|
||||
[EditorOrder(5), DefaultValue(D6JointMotion.Locked)]
|
||||
[Tooltip("Rotation around the Z axis."), EditorDisplay(null, "Swing Z")]
|
||||
public D6JointMotion SwingZ;
|
||||
}
|
||||
|
||||
[ShowInEditor, Serialize, EditorOrder(100), EditorDisplay("Joint")]
|
||||
[Tooltip("Joint motion options (per-axis).")]
|
||||
internal D6JointAxisMotion AxisMotion
|
||||
{
|
||||
get => new D6JointAxisMotion
|
||||
{
|
||||
X = GetMotion(D6JointAxis.X),
|
||||
Y = GetMotion(D6JointAxis.Y),
|
||||
Z = GetMotion(D6JointAxis.Z),
|
||||
Twist = GetMotion(D6JointAxis.Twist),
|
||||
SwingY = GetMotion(D6JointAxis.SwingY),
|
||||
SwingZ = GetMotion(D6JointAxis.SwingZ)
|
||||
};
|
||||
set
|
||||
{
|
||||
SetMotion(D6JointAxis.X, value.X);
|
||||
SetMotion(D6JointAxis.Y, value.Y);
|
||||
SetMotion(D6JointAxis.Z, value.Z);
|
||||
SetMotion(D6JointAxis.Twist, value.Twist);
|
||||
SetMotion(D6JointAxis.SwingY, value.SwingY);
|
||||
SetMotion(D6JointAxis.SwingZ, value.SwingZ);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ API_ENUM() enum class D6JointAxis
|
||||
/// </summary>
|
||||
SwingZ = 5,
|
||||
|
||||
API_ENUM(Attributes="HideInEditor")
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -63,6 +64,7 @@ API_ENUM() enum class D6JointMotion
|
||||
/// </summary>
|
||||
Free,
|
||||
|
||||
API_ENUM(Attributes="HideInEditor")
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -113,6 +115,7 @@ API_ENUM() enum class D6JointDriveType
|
||||
/// </summary>
|
||||
Slerp = 5,
|
||||
|
||||
API_ENUM(Attributes="HideInEditor")
|
||||
MAX
|
||||
};
|
||||
|
||||
|
||||
@@ -330,12 +330,12 @@ DECLARE_SCRIPTING_TYPE_MINIMAL(LimitConeRange);
|
||||
/// <summary>
|
||||
/// The Y angle of the cone (in degrees). Movement is constrained between 0 and this angle on the Y axis.
|
||||
/// </summary>
|
||||
API_FIELD() float YLimitAngle = 90.0f;
|
||||
API_FIELD(Attributes="Limit(0.0f, 180.0f)") float YLimitAngle = 90.0f;
|
||||
|
||||
/// <summary>
|
||||
/// The Z angle of the cone (in degrees). Movement is constrained between 0 and this angle on the Z axis.
|
||||
/// </summary>
|
||||
API_FIELD() float ZLimitAngle = 90.0f;
|
||||
API_FIELD(Attributes="Limit(0.0f, 180.0f)") float ZLimitAngle = 90.0f;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user