right trigger to zoom
This commit is contained in:
@ -21,6 +21,7 @@ class Colin
|
||||
private var pos = Vector2()
|
||||
private var angle = 0.0f
|
||||
private var offsAngle = Vector2()
|
||||
private var fov = 60.0f
|
||||
private var cam: PerspectiveCamera
|
||||
private var nutted = false
|
||||
|
||||
@ -29,7 +30,7 @@ class Colin
|
||||
|
||||
init
|
||||
{
|
||||
cam = PerspectiveCamera(60.0f,
|
||||
cam = PerspectiveCamera(fov,
|
||||
Gdx.graphics.width.toFloat(),
|
||||
Gdx.graphics.height.toFloat())
|
||||
cam.near = 0.1f
|
||||
@ -85,6 +86,10 @@ class Colin
|
||||
.radialDeadzone(0.1f, 1.0f) * MathUtils.PI * -0.25f
|
||||
offsAngle.lerp(dst, 16.0f * deltaTime)
|
||||
} ?: Vector2.Zero
|
||||
Controllers.getCurrent()?.let { pad ->
|
||||
val targetFov = MathUtils.lerp(60.0f, 20.0f, pad.getAxis(5))
|
||||
cam.fieldOfView = MathUtils.lerp(cam.fieldOfView, targetFov, 20.0f * deltaTime)
|
||||
}
|
||||
|
||||
if (Controllers.getCurrent()?.let { pad -> pad.getButton(pad.mapping.buttonA) } == true || Gdx.input.isKeyJustPressed(Input.Keys.N))
|
||||
{
|
||||
|
Reference in New Issue
Block a user