mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Moved Components to their respective namespaces
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
namespace GlitchyEngine.Core;
|
||||
|
||||
/// <summary>
|
||||
/// The base class for all Components.
|
||||
/// </summary>
|
||||
public abstract class Component : EngineObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the entity that this component is attached to.
|
||||
/// </summary>
|
||||
public Entity Entity => new(_uuid);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using GlitchyEngine.Math;
|
||||
|
||||
namespace GlitchyEngine.Core;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the position, rotation and scale of an entity in the world.
|
||||
/// <br/><br/>
|
||||
/// Every entity has a transform component.
|
||||
/// </summary>
|
||||
public class Transform : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the translation (position) of the entity.
|
||||
/// </summary>
|
||||
public float3 Translation
|
||||
{
|
||||
get
|
||||
{
|
||||
ScriptGlue.Transform_GetTranslation(Entity.UUID, out float3 translation);
|
||||
return translation;
|
||||
}
|
||||
set => ScriptGlue.Transform_SetTranslation(Entity.UUID, in value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user