public void drawObject(float[] paramArrayOfFloat)
   throws OpenGLException
 {
   if (!this.mInitialized);
   do
   {
     return;
     if (this.mTextures.size() == 0)
     {
       LG.d("No textures defined!");
       return;
     }
     this.mBackgroundSprite.setShader(this.mLineShader);
     this.mBackgroundSprite.setTexture((GLTexture)this.mTextures.get(0));
     this.mBackgroundSprite.draw(paramArrayOfFloat);
     this.mPreviewSprite.setTexture((GLTexture)this.mTextures.get(0));
     this.mPreviewSprite.setShader(this.mShader);
     this.mPreviewSprite.draw(paramArrayOfFloat);
   }
   while (!this.mValidEstimate);
   GLES20.glDisable(2929);
   updateCurrentFrameOutline();
   this.mLineShader.bind();
   this.mLineShader.setVertices(this.mOutlineVertices);
   this.mLineShader.setTransform(paramArrayOfFloat);
   this.mOutlineIndices.position(0);
   this.mOutlineVertices.position(0);
   GLES20.glLineWidth(2.0F);
   GLES20.glDrawElements(2, 20, 5123, this.mOutlineIndices);
   GLES20.glEnable(2929);
 }
Ejemplo n.º 2
0
  private void renderLines() {
    if (phenixLineProgram != null) {
      if (!phenixLineProgram.use()) {
        return;
      }

      float angle =
          360.0f * getTimeDeltaByScale((long) (1 * 50000L / speedFactor / rotationSpeedFactor));
      Matrix.setRotateM(M_matrix, 0, angle, 0, 0, 1.0f);

      Matrix.multiplyMM(MVP_matrix, 0, V_matrix, 0, M_matrix, 0);
      Matrix.multiplyMM(MVP_matrix, 0, P_matrix, 0, MVP_matrix, 0);

      float delta = getTimeDeltaByScale((long) (1 * 25000L / speedFactor));

      lineVertices.bind(phenixLineProgram, "aPosition", null);

      GLES20.glUniformMatrix4fv(
          phenixLineProgram.getUniformLocation("uMVPMatrix"), 1, false, MVP_matrix, 0);

      GLES20.glUniform1f(phenixLineProgram.getUniformLocation("uDelta"), delta);
      GLES20.glUniform1f(
          phenixLineProgram.getUniformLocation("uBrightness"), brightness * brightnessFactor);
      GLES20.glUniform3f(
          phenixLineProgram.getUniformLocation("uColor"),
          linesColorRed,
          linesColorGreen,
          linesColorBlue);

      GLES20.glEnable(GLES20.GL_BLEND);
      GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE);
      GLES20.glLineWidth(lineWidth * lineWidthFactor);

      lineVertices.draw(GLES20.GL_LINES, 0, MOVING_LINE_COUNT);

      GLES20.glUniform1f(phenixLineProgram.getUniformLocation("uDelta"), 0.0f);

      lineVertices.draw(GLES20.GL_LINES, MOVING_LINE_COUNT, STALE_LINE_COUNT);

      GLES20.glDisable(GLES20.GL_BLEND);

      lineVertices.unbind(phenixLineProgram, "aPosition", null);
    }
  }
Ejemplo n.º 3
0
 @Override
 public void glLineWidth(float width) {
   GLES20.glLineWidth(width);
 }
Ejemplo n.º 4
0
 @Override
 public void lineWidth(final float width) {
   checkOpenGLThread();
   GLES20.glLineWidth(width);
 }