Esempio n. 1
0
  /**
   * Called at every frame update.
   *
   * @param frame Frame information
   */
  public void update(FrameInput frame) {

    // Notify to components
    for (Component component : components.values()) {
      component.update(frame);
    }

    // Notify to children
    for (Entity child : children) {
      child.update(frame);
    }

    // Update local model matrix if necessary.
    if (localMatrixUpdateRequired) {
      updateLocalMatrix();
      invalidateWorldModelMatrix();
      localMatrixUpdateRequired = false;
    }

    // Update world model matrix if necessary.
    if (worldMatrixUpdateRequired) {
      updateWorldModelMatrix();
      worldMatrixUpdateRequired = false;

      // Update native side values
      worldModelMatrix.get(matrixValues);
      setWorldModelMatrix(nativePointer.get(), matrixValues);
    }

    // Update opacity if necessary.
    if (updateOpacityRequired) {
      updateOpacity();
      updateOpacityRequired = false;
    }
  }
Esempio n. 2
0
  private void invalidateWorldModelMatrix() {

    worldMatrixUpdateRequired = true;

    // Propagate to children
    for (Entity child : children) {
      child.invalidateWorldModelMatrix();
    }
  }