|
|
@ -180,7 +180,7 @@ public class Regions { |
|
|
|
boolean movingUp = false; |
|
|
|
boolean movingUp = false; |
|
|
|
|
|
|
|
|
|
|
|
boolean movingDown = false; |
|
|
|
boolean movingDown = false; |
|
|
|
float yLerp = worldObject.region.lerpY(worldObject); |
|
|
|
float yLerp = worldObject.region.lerpY(worldObject.loc); |
|
|
|
|
|
|
|
|
|
|
|
if (yLerp == (worldObject.region.highLerp.y)) |
|
|
|
if (yLerp == (worldObject.region.highLerp.y)) |
|
|
|
movingUp = true; |
|
|
|
movingUp = true; |
|
|
@ -338,10 +338,10 @@ public class Regions { |
|
|
|
return inside; |
|
|
|
return inside; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public float lerpY(AbstractWorldObject lerper) { |
|
|
|
public float lerpY(Vector3fImmutable lerper) { |
|
|
|
|
|
|
|
|
|
|
|
Vector3fImmutable lengthVector = this.highLerp.subtract2D(this.lowLerp); |
|
|
|
Vector3fImmutable lengthVector = this.highLerp.subtract2D(this.lowLerp); |
|
|
|
Vector3fImmutable characterVector = lerper.getLoc().subtract2D(this.lowLerp); |
|
|
|
Vector3fImmutable characterVector = lerper.subtract2D(this.lowLerp); |
|
|
|
float lengthVectorMagnitude = lengthVector.magnitude(); |
|
|
|
float lengthVectorMagnitude = lengthVector.magnitude(); |
|
|
|
float characterVectorMagnitude = characterVector.magnitude(); |
|
|
|
float characterVectorMagnitude = characterVector.magnitude(); |
|
|
|
float percentDistance = characterVectorMagnitude / lengthVectorMagnitude; |
|
|
|
float percentDistance = characterVectorMagnitude / lengthVectorMagnitude; |
|
|
|