Engine-Pong/Game/Physics2D/RigidBody2D.cs

25 lines
761 B
C#
Raw Permalink Normal View History

2023-11-30 17:52:09 +03:00
using System;
using Syntriax.Engine.Core;
using Syntriax.Engine.Core.Abstract;
using Syntriax.Engine.Physics2D.Abstract;
namespace Syntriax.Engine.Physics2D;
public class RigidBody2D : BehaviourOverride, IRigidBody2D
{
public Action<IAssignableTransform>? OnTransformAssigned { get => GameObject.OnTransformAssigned; set => GameObject.OnTransformAssigned = value; }
2024-01-23 12:17:49 +03:00
public IPhysicsMaterial2D Material { get; set; } = new PhysicsMaterial2DDefault();
2023-11-30 17:52:09 +03:00
2024-01-23 12:16:58 +03:00
public Vector2D Velocity { get; set; } = Vector2D.Zero;
2023-11-30 17:52:09 +03:00
public float AngularVelocity { get; set; } = 0f;
public float Mass { get; set; } = 0f;
2024-01-23 12:17:49 +03:00
2023-11-30 17:52:09 +03:00
ITransform IAssignableTransform.Transform => Transform;
public bool Assign(ITransform transform) => GameObject.Assign(transform);
}