feat: Initial Physics Code From Previous Repo
This commit is contained in:
24
Engine.Physics2D/RigidBody2D.cs
Normal file
24
Engine.Physics2D/RigidBody2D.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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; }
|
||||
|
||||
|
||||
public IPhysicsMaterial2D Material { get; set; } = new PhysicsMaterial2DDefault();
|
||||
|
||||
public Vector2D Velocity { get; set; } = Vector2D.Zero;
|
||||
public float AngularVelocity { get; set; } = 0f;
|
||||
public float Mass { get; set; } = 0f;
|
||||
|
||||
ITransform IAssignableTransform.Transform => Transform;
|
||||
|
||||
|
||||
public bool Assign(ITransform transform) => GameObject.Assign(transform);
|
||||
}
|
Reference in New Issue
Block a user