Skip to content

Commit

Permalink
Merge pull request #48 from DaveGreen-Games/IShapeOverhaul
Browse files Browse the repository at this point in the history
IShape Overhaul
  • Loading branch information
SoloByte authored Nov 6, 2024
2 parents 39dbc50 + 3504558 commit e828b5d
Show file tree
Hide file tree
Showing 20 changed files with 1,622 additions and 1,042 deletions.
1 change: 1 addition & 0 deletions ShapeEngine/Core/Collision/CircleCollider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public CircleCollider(Transform2D offset) : base(offset)
// return c.GetClosestCollisionPoint(p);
// }
public override Rect GetBoundingBox() => GetCircleShape().GetBoundingBox();

public override ShapeType GetShapeType() => ShapeType.Circle;
public override Circle GetCircleShape() => new(CurTransform.Position, CurTransform.ScaledSize.Radius);
}
6 changes: 3 additions & 3 deletions ShapeEngine/Core/Collision/CircleSectorCollider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ public CircleSectorCollider(Transform2D offset, float angleSectorRad, int arcPoi

}

protected override void OnTransformSetupFinished()
protected override void OnInitialized()
{
CalculatePoints();
}

public override void Recalculate()
public override void RecalculateShape()
{
CalculatePoints();
}

protected override void UpdateColliderShape(bool transformChanged)
protected override void OnShapeTransformChanged(bool transformChanged)
{
if(transformChanged || dirty) CalculatePoints();
}
Expand Down
Loading

0 comments on commit e828b5d

Please sign in to comment.