A* algorithm now working as intended
This commit is contained in:
+19
-19
@@ -78,39 +78,39 @@ void AAdventureCameraPawn::EdgeScrollSide(float AxisValue)
|
||||
|
||||
if (mousePosX <= ESASize) // if in LEFT area
|
||||
{
|
||||
////// Scroll LEFT with Vert Accelleration
|
||||
////// Scroll LEFT
|
||||
float SpeedX = (mousePosX * ESAMinBoundSlope + ESAMinBoundIntercept) * BaseScrollSpeed;
|
||||
AddActorLocalOffset(FVector(0, -SpeedX, 0));
|
||||
AddActorLocalOffset(FVector(-SpeedX, 0, 0));
|
||||
|
||||
if (mousePosY > .005) // if not touching EDGE
|
||||
if (mousePosY > .005) // if not touching TOP EDGE
|
||||
{
|
||||
AddActorLocalOffset(FVector(VertAccelleration, 0, 0));
|
||||
AddActorLocalOffset(FVector(0, -VertAccelleration, 0));
|
||||
}
|
||||
|
||||
if (AxisValue < .0 && mousePosX <= .005) // if mouse moving LEFT and touching EDGE
|
||||
{
|
||||
////// Add LEFT accelleration
|
||||
SpeedX = AxisValue * ScrollAccelleration;
|
||||
AddActorLocalOffset(FVector(0, SpeedX, 0));
|
||||
AddActorLocalOffset(FVector(SpeedX, 0, 0));
|
||||
}
|
||||
}
|
||||
|
||||
if (mousePosX >= 1-ESASize) // if in RIGHT area
|
||||
{
|
||||
////// Scroll RIGHT with Vert Accelleration
|
||||
////// Scroll RIGHT
|
||||
float SpeedX = (mousePosX * ESAMaxBoundSlope + ESAMaxBoundIntercept) * BaseScrollSpeed;
|
||||
AddActorLocalOffset(FVector(0, SpeedX, 0));
|
||||
AddActorLocalOffset(FVector(SpeedX, 0, 0));
|
||||
|
||||
if (mousePosY < .995) // if not touching EDGE
|
||||
if (mousePosY < .995) // if not touching BOT EDGE
|
||||
{
|
||||
AddActorLocalOffset(FVector(VertAccelleration, 0, 0));
|
||||
AddActorLocalOffset(FVector(0, -VertAccelleration, 0));
|
||||
}
|
||||
|
||||
if (AxisValue > .0 && mousePosX >= .995) // if mouse moving RIGHT and touching EDGE
|
||||
{
|
||||
////// Add RIGHT accelleration
|
||||
SpeedX = AxisValue * ScrollAccelleration;
|
||||
AddActorLocalOffset(FVector(0, SpeedX, 0));
|
||||
AddActorLocalOffset(FVector(SpeedX, 0, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,39 +126,39 @@ void AAdventureCameraPawn::EdgeScrollVert(float AxisValue)
|
||||
|
||||
if (mousePosY <= ESASize) // if in TOP area
|
||||
{
|
||||
////// Scroll TOP with Side Accelleration
|
||||
////// Scroll TOP
|
||||
float SpeedY = (mousePosY * ESAMinBoundSlope + ESAMinBoundIntercept) * BaseScrollSpeed;
|
||||
AddActorLocalOffset(FVector(SpeedY, SideAccelleration, 0));
|
||||
AddActorLocalOffset(FVector(0, -SpeedY, 0));
|
||||
|
||||
if (mousePosX > .005) // if not touching EDGE
|
||||
{
|
||||
AddActorLocalOffset(FVector(0, SideAccelleration, 0));
|
||||
AddActorLocalOffset(FVector(SideAccelleration, 0, 0));
|
||||
}
|
||||
|
||||
if (AxisValue > .0 && mousePosY <= .005) // if mouse moving TOP and touching EDGE
|
||||
{
|
||||
////// Add TOP accelleration
|
||||
SpeedY = AxisValue * ScrollAccelleration;
|
||||
AddActorLocalOffset(FVector(SpeedY, 0, 0));
|
||||
AddActorLocalOffset(FVector(0, -SpeedY, 0));
|
||||
}
|
||||
}
|
||||
|
||||
if (mousePosY >= 1-ESASize) // if in BOTTOM area
|
||||
{
|
||||
////// Scroll BOTTOM with Side Accelleration
|
||||
////// Scroll BOTTOM
|
||||
float SpeedY = (mousePosY * ESAMaxBoundSlope + ESAMaxBoundIntercept) * BaseScrollSpeed;
|
||||
AddActorLocalOffset(FVector(-SpeedY, SideAccelleration, 0));
|
||||
AddActorLocalOffset(FVector(0, SpeedY, 0));
|
||||
|
||||
if (mousePosX < .995) // if not touching EDGE
|
||||
if (mousePosX < .995) // if not touching BOT EDGE
|
||||
{
|
||||
AddActorLocalOffset(FVector(0, SideAccelleration, 0));
|
||||
AddActorLocalOffset(FVector(SideAccelleration, 0, 0));
|
||||
}
|
||||
|
||||
if (AxisValue < .0 && mousePosY >= .995) // if mouse moving BOTTOM and touching EDGE
|
||||
{
|
||||
////// add BOTTOM accelleration
|
||||
SpeedY = AxisValue * ScrollAccelleration;
|
||||
AddActorLocalOffset(FVector(SpeedY, 0, 0));
|
||||
AddActorLocalOffset(FVector(0, -SpeedY, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user