예제 #1
0
  @Override
  public synchronized void render(GL10 gl, Renderable parent) {

    // store current matrix and then modify it:
    gl.glPushMatrix();
    loadPosition(gl);
    setScale(gl);
    loadRotation(gl);

    if (ObjectPicker.readyToDrawWithColor) {
      if (myPickColor != null) {
        gl.glColor4f(myPickColor.red, myPickColor.green, myPickColor.blue, myPickColor.alpha);
      } else {
        Log.d("Object Picker", "Object " + this + " had no picking color");
      }
    } else if (myColor != null) {
      gl.glColor4f(myColor.red, myColor.green, myColor.blue, myColor.alpha);
    }

    if (myChildren != null) {
      myChildren.render(gl, this);
    }

    draw(gl, parent);
    // restore old matrix:
    gl.glPopMatrix();
  }
예제 #2
0
  @Override
  public boolean update(float timeDelta, Updateable parent) {
    setMyParent(parent);

    if ((myChildren != null) && (graficAnimationActive)) {

      // if the animation does not need to be animated anymore..
      if (!myChildren.update(timeDelta, this)) {
        // ..remove it:
        Log.d(
            LOG_TAG,
            myChildren
                + " will now be removed from mesh because it "
                + "is finished (returned false on update())");
        myChildren = null;
      }
    }
    return true;
  }