ScriptCore: Added more properties to components

- Added CircleRenderer
- Transform: Added Rotation, RotationEuler, RotationAxisAngle and Scale
- RigidBody: Added BodyType and GravityScale
- Added ColorRGBA
This commit is contained in:
Simon Lübeß
2024-01-27 19:46:37 +01:00
parent bc535ddc26
commit 8ff35d3967
12 changed files with 566 additions and 22 deletions
+53
View File
@@ -1,3 +1,4 @@
using System.Numerics;
using GlitchyEngine.Math;
namespace GlitchyEngine.Core;
@@ -35,4 +36,56 @@ public class Transform : Component
}
set => ScriptGlue.Transform_SetTranslation(Entity.UUID, in value);
}
/// <summary>
/// Gets or sets the rotation of the entity.
/// </summary>
public Quaternion Rotation
{
get
{
ScriptGlue.Transform_GetRotation(Entity.UUID, out Quaternion rotation);
return rotation;
}
set => ScriptGlue.Transform_SetRotation(Entity.UUID, in value);
}
/// <summary>
/// Gets or sets the rotation of the entity in radians around each axis.
/// </summary>
public float3 RotationEuler
{
get
{
ScriptGlue.Transform_GetRotationEuler(Entity.UUID, out float3 rotationEuler);
return rotationEuler;
}
set => ScriptGlue.Transform_SetRotationEuler(Entity.UUID, in value);
}
/// <summary>
/// Gets or sets the rotation of the entity as an axis of rotation and the angle in radians.
/// </summary>
public RotationAxisAngle RotationAxisAngle
{
get
{
ScriptGlue.Transform_GetRotationAxisAngle(Entity.UUID, out RotationAxisAngle rotationEuler);
return rotationEuler;
}
set => ScriptGlue.Transform_SetRotationAxisAngle(Entity.UUID, value);
}
/// <summary>
/// Gets or sets the scale of the entity.
/// </summary>
public float3 Scale
{
get
{
ScriptGlue.Transform_GetScale(Entity.UUID, out float3 scale);
return scale;
}
set => ScriptGlue.Transform_SetScale(Entity.UUID, in value);
}
}