Ejemplo n.º 1
0
  /**
   * Adds a new channel.
   *
   * @throws IllegalStateException if there is already a channel related to same object
   */
  public void addChannel(MeshChannel channel) {
    if (channels[channel.objectIndex] != null)
      throw new IllegalStateException(
          "there is already a channel for joint " + channel.objectIndex);

    channels[channel.objectIndex] = channel;
    size++;
    if (channel.getTime() > maxTime) maxTime = channel.getTime();
  }
Ejemplo n.º 2
0
  private void updateTime() {
    maxTime = 0;

    for (MeshChannel channel : channels) {
      if (channel == null) continue;
      float max = channel.getTime();
      if (max > maxTime) {
        maxTime = max;
      }
    }
  }