use new Martix4 function which use temporary array
- avoid 'undefined behaviour' which did work for most cases...
This commit is contained in:
parent
b463ca7e3b
commit
477548c5f7
@ -31,7 +31,6 @@ import org.oscim.utils.Matrix4;
|
||||
import org.oscim.utils.quadtree.QuadTree;
|
||||
|
||||
import android.opengl.GLES20;
|
||||
|
||||
/**
|
||||
* This class is for rendering the Line- and PolygonLayers of visible MapTiles.
|
||||
* For visible tiles that do not have data available yet its parent in children
|
||||
@ -58,10 +57,12 @@ public class TileRenderer {
|
||||
mMatrices = m;
|
||||
mFaded = fade;
|
||||
|
||||
mProjMatrix.copy(m.viewproj);
|
||||
// discard z projection from tilt
|
||||
mProjMatrix.copy(m.proj);
|
||||
// discard depth projection from tilt, we use depth buffer
|
||||
// for clipping
|
||||
mProjMatrix.setValue(10, 0);
|
||||
mProjMatrix.setValue(14, 0);
|
||||
mProjMatrix.multiplyRhs(m.view);
|
||||
|
||||
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
@ -141,7 +142,7 @@ public class TileRenderer {
|
||||
Matrices m = mMatrices;
|
||||
m.mvp.setTransScale(x, y, (float) (scale / GLRenderer.COORD_SCALE));
|
||||
|
||||
m.mvp.multiplyMM(mProjMatrix, m.mvp);
|
||||
m.mvp.multiplyLhs(mProjMatrix);
|
||||
|
||||
// set depth offset (used for clipping to tile boundaries)
|
||||
GLES20.glPolygonOffset(0, mOffsetCnt++);
|
||||
|
||||
@ -100,7 +100,7 @@ public abstract class RenderLayer {
|
||||
matrices.mvp.setTransScale((float) (x * tileScale), (float) (y * tileScale),
|
||||
(float) ((position.scale / oPos.scale) / GLRenderer.COORD_SCALE));
|
||||
|
||||
matrices.mvp.multiplyMM(project ? matrices.viewproj : matrices.view, matrices.mvp);
|
||||
matrices.mvp.multiplyLhs(project ? matrices.viewproj : matrices.view);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -111,10 +111,7 @@ public class CustomRenderLayer extends RenderLayer {
|
||||
float ratio = 1f / mMapView.getWidth();
|
||||
|
||||
m.mvp.setScale(ratio, ratio, 1);
|
||||
m.mvp.multiplyMM(m.proj, m.mvp);
|
||||
|
||||
|
||||
// setMatrix(pos, m);
|
||||
m.mvp.multiplyLhs(m.proj);
|
||||
m.mvp.setAsUniform(hMatrixPosition);
|
||||
|
||||
// Draw the triangle
|
||||
|
||||
@ -333,7 +333,7 @@ public class ExtrusionRenderLayer extends RenderLayer {
|
||||
// scale height
|
||||
m.mvp.setValue(10, scale / 10);
|
||||
|
||||
m.mvp.multiplyMM(m.viewproj, m.mvp);
|
||||
m.mvp.multiplyLhs(m.viewproj);
|
||||
|
||||
m.mvp.addDepthOffset(delta);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ public class MapViewPosition {
|
||||
|
||||
mProjMatrix.set(tmp);
|
||||
mTmpMatrix.setTranslation(0, 0, -VIEW_DISTANCE);
|
||||
mProjMatrix.multiplyMM(mTmpMatrix);
|
||||
mProjMatrix.multiplyRhs(mTmpMatrix);
|
||||
mProjMatrix.get(tmp);
|
||||
|
||||
Matrix.invertM(tmp, 0, tmp, 0);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user