We’ve done a number of “quality of life” improvements to properties manipulation in the Castle Game Engine editor.
We simplified the display of floats and vectors. No need for excessive trailing zeroes. Instead of
1.00 2.00 3.00we now display
0 0 0or
1 2 3which is much easier to “parse” by a human eye.
Editing vectors and components of vectors automatically updates everything immediately. E.g. if you edit
TCastleTransform.Translationwill update immediately to
10 0 0. And if you edit the vector
42 0 0, the
TCastleTransform.Translation.Xwill update immediately to
TCastleTransform.Upare now exposed in the “Basic” tab. Thanks to above improvements, you can now clearly see they are synchronized with
TCastleTransform.Rotation— changing one changes the other.
TCastleImageTransform.Sizeis now more comfortable to edit: simply type single float to set both X and Y to the same value. E.g. type
10to set Size to
10 10(in Pascal this would mean
Vector2(10, 10)). This is consistent with
TCastleTransform.Scaleand similar properties: typing a single float sets all vector components to be equal.
The display and input of angles and rotations now displays / accepts degrees.
Note that the Pascal API still accepts angles in radians. This is standard (in X3D, glTF,
Mathroutines etc.). I experimented and looked at how others (Blender and Godot) present angles to make the end result useful and not confusing. To this end:
Angles are now displayed as degrees in CGE editor.
And the fact that they are in degrees is explicitly shown by wrapping them with
deg(xxx)text. So the angle looks like
We are deliberately explicit that the angles are in degrees, to avoid confusion.
This affects both angles displayed as angle of axis+angle rotation (like
0 1 0 deg(45)) or as single float number (e.g. if you expand the
TCastleTransform.Rotationto reveal the
When you input an angle value, you can keep the
"deg(...)"wrapping, or you can input just the number. In the latter case, we will automatically add
"deg(...)"around, so we interpret input as being in degrees anyway.
This is similar to what both Blender and Godot are doing too, likely for similar reasons (have API in radians, but for display and input in editor — degrees are easier to use).
This affects both single-value fields and 4D vectors. So for single-value field (like
"45"is understood as
"deg(45)". For editing rotation as 4D vector (axis + angle) typing
"0 1 0 45"is understood as
"0 1 0 deg(45)". You will see the
"deg(...)"added immediately, so it is hopefully clear what happens.
To be consistent, you can also use
Degin Pascal. It’s just an alias for
deg(....)case doesn’t matter.
DEGare the same. To interpret expressions in editor, the
degis a function in Castle Script.