refactor: removed noise from class names
This commit is contained in:
26
Shared/Behaviours/DrawableColliderShape.cs
Normal file
26
Shared/Behaviours/DrawableColliderShape.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
using Syntriax.Engine.Integration.MonoGame;
|
||||
|
||||
namespace Pong.Behaviours;
|
||||
|
||||
public class DrawableColliderShape : Syntriax.Engine.Physics2D.Collider2DShape, IDrawableTriangle
|
||||
{
|
||||
private readonly IList<Triangle> triangles = [];
|
||||
|
||||
public ColorRGBA Color { get; set; } = new ColorRGBA(255, 255, 255);
|
||||
|
||||
public void Draw(ITriangleBatch triangleBatch)
|
||||
{
|
||||
Recalculate();
|
||||
|
||||
ShapeWorld.ToTrianglesConvex(triangles);
|
||||
|
||||
foreach (Triangle triangle in triangles)
|
||||
triangleBatch.Draw(triangle, Color);
|
||||
}
|
||||
|
||||
public DrawableColliderShape(Shape2D shape) : base(shape) { }
|
||||
public DrawableColliderShape(Shape2D shape, ColorRGBA color) : base(shape) { Color = color; }
|
||||
}
|
||||
Reference in New Issue
Block a user