Make JuiceStreamPath time based instead of distance based.

And remove the "slope limit" feature.
TODO: for a juice stream with a large slope, the slider velocity of the hit object should be changed.
This commit is contained in:
ekrctb
2022-05-08 18:32:01 +09:00
parent dabe295196
commit 4e0155fa4b
9 changed files with 157 additions and 178 deletions

View File

@ -15,15 +15,15 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
/// </summary>
private JuiceStreamPathVertex lastVertex;
public PlacementEditablePath(Func<float, double> positionToDistance)
: base(positionToDistance)
public PlacementEditablePath(Func<float, double> positionToTime)
: base(positionToTime)
{
}
public void AddNewVertex()
{
var endVertex = Vertices[^1];
int index = AddVertex(endVertex.Distance, endVertex.X);
int index = AddVertex(endVertex.Time, endVertex.X);
for (int i = 0; i < VertexCount; i++)
{
@ -41,9 +41,9 @@ namespace osu.Game.Rulesets.Catch.Edit.Blueprints.Components
public void MoveLastVertex(Vector2 screenSpacePosition)
{
Vector2 position = ToRelativePosition(screenSpacePosition);
double distanceDelta = PositionToDistance(position.Y) - lastVertex.Distance;
double timeDelta = PositionToTime(position.Y) - lastVertex.Time;
float xDelta = position.X - lastVertex.X;
MoveSelectedVertices(distanceDelta, xDelta);
MoveSelectedVertices(timeDelta, xDelta);
}
}
}