mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
Scripting: Added Set and GetPosition to Rigidbody2D
+ Vectors: Hide swizzles in Debugger + Generate ToString
This commit is contained in:
@@ -27,4 +27,20 @@ public class Rigidbody2D : Component
|
||||
{
|
||||
ScriptGlue.RigidBody2D_ApplyForceToCenter(Entity._uuid, force, wakeUp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the position of the rigidbody.
|
||||
/// </summary>
|
||||
/// <param name="position">The position of the rigidbody.</param>
|
||||
public void SetPosition(float2 position)
|
||||
{
|
||||
ScriptGlue.RigidBody2D_SetPosition(Entity._uuid, position);
|
||||
}
|
||||
|
||||
public float2 GetPosition()
|
||||
{
|
||||
ScriptGlue.RigidBody2D_GetPosition(Entity._uuid, out float2 position);
|
||||
|
||||
return position;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,12 @@ internal static class ScriptGlue
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void RigidBody2D_ApplyForceToCenter(UUID entityId, in float2 force, bool wakeUp);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void RigidBody2D_SetPosition(UUID entityId, in float2 position);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void RigidBody2D_GetPosition(UUID entityId, out float2 position);
|
||||
|
||||
#endregion RigidBody2D
|
||||
|
||||
@@ -74,5 +80,4 @@ internal static class ScriptGlue
|
||||
internal static extern float4 modf_float4(float4 x, out float4 integerPart);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user