Test1
This commit is contained in:
23
Game/Physics2D/Abstract/ICollider2D.cs
Normal file
23
Game/Physics2D/Abstract/ICollider2D.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
using Syntriax.Engine.Core.Abstract;
|
||||
|
||||
namespace Syntriax.Engine.Physics2D.Abstract;
|
||||
|
||||
public interface ICollider2D : IBehaviour, IAssignableTransform
|
||||
{
|
||||
Action<ICollider2D, ICollider2D>? OnCollision { get; set; }
|
||||
|
||||
Vector2 OffsetPosition { get; set; }
|
||||
Vector2 OffsetScale { get; set; }
|
||||
float OffsetRotation { get; set; }
|
||||
|
||||
IReadOnlyList<Vector2> Vertices { get; }
|
||||
|
||||
bool CheckCollision(ICollider2D collider);
|
||||
|
||||
void RecalculateVertices();
|
||||
}
|
6
Game/Physics2D/Abstract/ICollisionResolver2D.cs
Normal file
6
Game/Physics2D/Abstract/ICollisionResolver2D.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Syntriax.Engine.Physics2D.Abstract;
|
||||
|
||||
public interface ICollisionResolver2D
|
||||
{
|
||||
void ResolveCollision(ICollider2D colliderA, ICollider2D colliderB);
|
||||
}
|
11
Game/Physics2D/Abstract/IPhysicsEngine2D.cs
Normal file
11
Game/Physics2D/Abstract/IPhysicsEngine2D.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Syntriax.Engine.Physics2D.Abstract;
|
||||
|
||||
public interface IPhysicsEngine2D
|
||||
{
|
||||
int IterationCount { get; set; }
|
||||
|
||||
void AddRigidBody(IRigidBody2D rigidBody);
|
||||
void RemoveRigidBody(IRigidBody2D rigidBody);
|
||||
|
||||
void Step(float deltaTime);
|
||||
}
|
7
Game/Physics2D/Abstract/IPhysicsMaterial2D.cs
Normal file
7
Game/Physics2D/Abstract/IPhysicsMaterial2D.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Syntriax.Engine.Physics2D.Abstract;
|
||||
|
||||
public interface IPhysicsMaterial2D
|
||||
{
|
||||
float Friction { get; set; }
|
||||
float Restitution { get; set; }
|
||||
}
|
15
Game/Physics2D/Abstract/IRigidBody2D.cs
Normal file
15
Game/Physics2D/Abstract/IRigidBody2D.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
using Syntriax.Engine.Core.Abstract;
|
||||
|
||||
namespace Syntriax.Engine.Physics2D.Abstract;
|
||||
|
||||
public interface IRigidBody2D : IBehaviour, IAssignableTransform
|
||||
{
|
||||
IPhysicsMaterial2D Material { get; set; }
|
||||
|
||||
Vector2 Velocity { get; set; }
|
||||
float AngularVelocity { get; set; }
|
||||
|
||||
float Mass { get; set; }
|
||||
}
|
Reference in New Issue
Block a user