units for quaternion, transform and more collider values

This commit is contained in:
nothingTVatYT
2024-01-29 08:24:55 +01:00
parent ef41ad6074
commit a0741dd9de
5 changed files with 13 additions and 10 deletions

View File

@@ -45,14 +45,17 @@ namespace FlaxEditor.CustomEditors.Editors
gridControl.SlotsVertically = 1; gridControl.SlotsVertically = 1;
XElement = grid.FloatValue(); XElement = grid.FloatValue();
XElement.ValueBox.Category = Utils.ValueCategory.Angle;
XElement.ValueBox.ValueChanged += OnValueChanged; XElement.ValueBox.ValueChanged += OnValueChanged;
XElement.ValueBox.SlidingEnd += ClearToken; XElement.ValueBox.SlidingEnd += ClearToken;
YElement = grid.FloatValue(); YElement = grid.FloatValue();
YElement.ValueBox.Category = Utils.ValueCategory.Angle;
YElement.ValueBox.ValueChanged += OnValueChanged; YElement.ValueBox.ValueChanged += OnValueChanged;
YElement.ValueBox.SlidingEnd += ClearToken; YElement.ValueBox.SlidingEnd += ClearToken;
ZElement = grid.FloatValue(); ZElement = grid.FloatValue();
ZElement.ValueBox.Category = Utils.ValueCategory.Angle;
ZElement.ValueBox.ValueChanged += OnValueChanged; ZElement.ValueBox.ValueChanged += OnValueChanged;
ZElement.ValueBox.SlidingEnd += ClearToken; ZElement.ValueBox.SlidingEnd += ClearToken;

View File

@@ -18,12 +18,12 @@ API_STRUCT() struct FLAXENGINE_API Transform
/// <summary> /// <summary>
/// The translation vector of the transform. /// The translation vector of the transform.
/// </summary> /// </summary>
API_FIELD(Attributes="EditorOrder(10), EditorDisplay(null, \"Position\")") Vector3 Translation; API_FIELD(Attributes="EditorOrder(10), EditorDisplay(null, \"Position\"), NumberCategory(Utils.ValueCategory.Distance)") Vector3 Translation;
/// <summary> /// <summary>
/// The rotation of the transform. /// The rotation of the transform.
/// </summary> /// </summary>
API_FIELD(Attributes="EditorOrder(20), EditorDisplay(null, \"Rotation\")") Quaternion Orientation; API_FIELD(Attributes="EditorOrder(20), EditorDisplay(null, \"Rotation\"), NumberCategory(Utils.ValueCategory.Angle)") Quaternion Orientation;
/// <summary> /// <summary>
/// The scale vector of the transform. /// The scale vector of the transform.

View File

@@ -23,7 +23,7 @@ public:
/// Gets the size of the box, measured in the object's local space. /// Gets the size of the box, measured in the object's local space.
/// </summary> /// </summary>
/// <remarks>The box size will be scaled by the actor's world scale. </remarks> /// <remarks>The box size will be scaled by the actor's world scale. </remarks>
API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(typeof(Float3), \"100,100,100\"), EditorDisplay(\"Collider\")") API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(typeof(Float3), \"100,100,100\"), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)")
FORCE_INLINE Float3 GetSize() const FORCE_INLINE Float3 GetSize() const
{ {
return _size; return _size;

View File

@@ -25,7 +25,7 @@ public:
/// Gets the radius of the sphere, measured in the object's local space. /// Gets the radius of the sphere, measured in the object's local space.
/// </summary> /// </summary>
/// <remarks>The sphere radius will be scaled by the actor's world scale.</remarks> /// <remarks>The sphere radius will be scaled by the actor's world scale.</remarks>
API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(20.0f), EditorDisplay(\"Collider\")") API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(20.0f), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)")
FORCE_INLINE float GetRadius() const FORCE_INLINE float GetRadius() const
{ {
return _radius; return _radius;
@@ -41,7 +41,7 @@ public:
/// Gets the height of the capsule, measured in the object's local space between the centers of the hemispherical ends. /// Gets the height of the capsule, measured in the object's local space between the centers of the hemispherical ends.
/// </summary> /// </summary>
/// <remarks>The capsule height will be scaled by the actor's world scale.</remarks> /// <remarks>The capsule height will be scaled by the actor's world scale.</remarks>
API_PROPERTY(Attributes="EditorOrder(110), DefaultValue(100.0f), EditorDisplay(\"Collider\")") API_PROPERTY(Attributes="EditorOrder(110), DefaultValue(100.0f), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)")
FORCE_INLINE float GetHeight() const FORCE_INLINE float GetHeight() const
{ {
return _height; return _height;

View File

@@ -73,7 +73,7 @@ public:
/// <summary> /// <summary>
/// Gets the radius of the sphere, measured in the object's local space. The sphere radius will be scaled by the actor's world scale. /// Gets the radius of the sphere, measured in the object's local space. The sphere radius will be scaled by the actor's world scale.
/// </summary> /// </summary>
API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(50.0f), EditorDisplay(\"Collider\")") API_PROPERTY(Attributes="EditorOrder(100), DefaultValue(50.0f), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)")
float GetRadius() const; float GetRadius() const;
/// <summary> /// <summary>
@@ -84,7 +84,7 @@ public:
/// <summary> /// <summary>
/// Gets the height of the capsule, measured in the object's local space. The capsule height will be scaled by the actor's world scale. /// Gets the height of the capsule, measured in the object's local space. The capsule height will be scaled by the actor's world scale.
/// </summary> /// </summary>
API_PROPERTY(Attributes="EditorOrder(110), DefaultValue(150.0f), EditorDisplay(\"Collider\")") API_PROPERTY(Attributes="EditorOrder(110), DefaultValue(150.0f), EditorDisplay(\"Collider\"), NumberCategory(Utils.ValueCategory.Distance)")
float GetHeight() const; float GetHeight() const;
/// <summary> /// <summary>
@@ -95,7 +95,7 @@ public:
/// <summary> /// <summary>
/// Gets the slope limit (in degrees). Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value. /// Gets the slope limit (in degrees). Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value.
/// </summary> /// </summary>
API_PROPERTY(Attributes="EditorOrder(210), DefaultValue(45.0f), Limit(0, 100), EditorDisplay(\"Character Controller\")") API_PROPERTY(Attributes="EditorOrder(210), DefaultValue(45.0f), Limit(0, 100), EditorDisplay(\"Character Controller\"), NumberCategory(Utils.ValueCategory.Angle)")
float GetSlopeLimit() const; float GetSlopeLimit() const;
/// <summary> /// <summary>
@@ -117,7 +117,7 @@ public:
/// <summary> /// <summary>
/// Gets the step height. The character will step up a stair only if it is closer to the ground than the indicated value. This should not be greater than the Character Controllers height or it will generate an error. /// Gets the step height. The character will step up a stair only if it is closer to the ground than the indicated value. This should not be greater than the Character Controllers height or it will generate an error.
/// </summary> /// </summary>
API_PROPERTY(Attributes="EditorOrder(220), DefaultValue(30.0f), Limit(0), EditorDisplay(\"Character Controller\")") API_PROPERTY(Attributes="EditorOrder(220), DefaultValue(30.0f), Limit(0), EditorDisplay(\"Character Controller\"), NumberCategory(Utils.ValueCategory.Distance)")
float GetStepOffset() const; float GetStepOffset() const;
/// <summary> /// <summary>
@@ -139,7 +139,7 @@ public:
/// <summary> /// <summary>
/// Gets the minimum move distance of the character controller. The minimum traveled distance to consider. If traveled distance is smaller, the character doesn't move. This is used to stop the recursive motion algorithm when remaining distance to travel is small. /// Gets the minimum move distance of the character controller. The minimum traveled distance to consider. If traveled distance is smaller, the character doesn't move. This is used to stop the recursive motion algorithm when remaining distance to travel is small.
/// </summary> /// </summary>
API_PROPERTY(Attributes="EditorOrder(230), DefaultValue(0.0f), Limit(0, 1000), EditorDisplay(\"Character Controller\")") API_PROPERTY(Attributes="EditorOrder(230), DefaultValue(0.0f), Limit(0, 1000), EditorDisplay(\"Character Controller\"), NumberCategory(Utils.ValueCategory.Distance)")
float GetMinMoveDistance() const; float GetMinMoveDistance() const;
/// <summary> /// <summary>