mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user