Fix bug where selection outline stayed visible after a component is

deleted
This commit is contained in:
bkuker 2012-12-13 15:53:45 -05:00
parent ee95d6998a
commit aac5fb9451

View File

@ -131,20 +131,22 @@ public class RocketRenderer {
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GLLightingFunc.GL_SPECULAR, colorBlack, 0); gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GLLightingFunc.GL_SPECULAR, colorBlack, 0);
gl.glLineWidth(5.0f); gl.glLineWidth(5.0f);
for (RocketComponent c : selection) { for (RocketComponent c : configuration) {
//Draw as lines, set Z to nearest if ( selection.contains(c) ){
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE); //Draw as lines, set Z to nearest
gl.glDepthRange(0, 0); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE);
cr.renderGeometry(gl, c); gl.glDepthRange(0, 0);
cr.renderGeometry(gl, c);
//Draw polygons, always passing depth test, //Draw polygons, always passing depth test,
//setting Z to farthest //setting Z to farthest
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL);
gl.glDepthRange(1, 1); gl.glDepthRange(1, 1);
gl.glDepthFunc(GL.GL_ALWAYS); gl.glDepthFunc(GL.GL_ALWAYS);
cr.renderGeometry(gl, c); cr.renderGeometry(gl, c);
gl.glDepthFunc(GL.GL_LESS); gl.glDepthFunc(GL.GL_LESS);
gl.glDepthRange(0, 1); gl.glDepthRange(0, 1);
}
} }
gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL); gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL);
gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GLLightingFunc.GL_EMISSION, gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GLLightingFunc.GL_EMISSION,