chore!: renamed AABB to AABB2D
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using Engine.Core;
|
||||
|
||||
namespace Engine.Systems.Tween;
|
||||
|
||||
public static class TweenAABB2DExtensions
|
||||
{
|
||||
private static readonly BoxedPool<AABB2D> boxedAABBPool = new(2);
|
||||
|
||||
public static ITween TweenAABB(this AABB2D initialAABB, ITweenManager tweenManager, float duration, AABB2D targetAABB, System.Action<AABB2D> setMethod)
|
||||
{
|
||||
Boxed<AABB2D> boxedInitial = boxedAABBPool.Get(initialAABB);
|
||||
Boxed<AABB2D> boxedTarget = boxedAABBPool.Get(targetAABB);
|
||||
|
||||
ITween tween = tweenManager.StartTween(duration, t => setMethod?.Invoke(new AABB2D(boxedInitial.Value.LowerBoundary.Lerp(boxedTarget.Value.LowerBoundary, t), boxedInitial.Value.UpperBoundary.Lerp(boxedTarget.Value.UpperBoundary, t))));
|
||||
|
||||
tween.OnComplete(() =>
|
||||
{
|
||||
boxedAABBPool.Return(boxedInitial);
|
||||
boxedAABBPool.Return(boxedTarget);
|
||||
});
|
||||
|
||||
return tween;
|
||||
}
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
using Engine.Core;
|
||||
|
||||
namespace Engine.Systems.Tween;
|
||||
|
||||
public static class TweenAABBExtensions
|
||||
{
|
||||
private static readonly BoxedPool<AABB> boxedAABBPool = new(2);
|
||||
|
||||
public static ITween TweenAABB(this AABB initialAABB, ITweenManager tweenManager, float duration, AABB targetAABB, System.Action<AABB> setMethod)
|
||||
{
|
||||
Boxed<AABB> boxedInitial = boxedAABBPool.Get(initialAABB);
|
||||
Boxed<AABB> boxedTarget = boxedAABBPool.Get(targetAABB);
|
||||
|
||||
ITween tween = tweenManager.StartTween(duration, t => setMethod?.Invoke(new AABB(boxedInitial.Value.LowerBoundary.Lerp(boxedTarget.Value.LowerBoundary, t), boxedInitial.Value.UpperBoundary.Lerp(boxedTarget.Value.UpperBoundary, t))));
|
||||
|
||||
tween.OnComplete(() =>
|
||||
{
|
||||
boxedAABBPool.Return(boxedInitial);
|
||||
boxedAABBPool.Return(boxedTarget);
|
||||
});
|
||||
|
||||
return tween;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user