ViewController API enhancements

This commit is contained in:
Emux 2018-07-06 14:12:27 +03:00
parent bbd27f1332
commit d58d79facf
No known key found for this signature in database
GPG Key ID: 64ED9980896038C3

View File

@ -29,7 +29,7 @@ import static org.oscim.utils.FastMath.clamp;
public class ViewController extends Viewport {
protected float mPivotY = 0.0f;
private float mPivotY = 0.0f;
private final float[] mat = new float[16];
@ -71,6 +71,15 @@ public class ViewController extends Viewport {
updateMatrices();
}
/**
* Get pivot height relative to view center. E.g. 0.5 is usually preferred
* for navigation, moving the center to 25% of the view height.
* Range is [-1, 1].
*/
public float getMapViewCenter() {
return mPivotY;
}
/**
* Set pivot height relative to view center. E.g. 0.5 is usually preferred
* for navigation, moving the center to 25% of the view height.