Пример #1
0
  public StarField(final int aNumberOfStars, final CharGenerator aStarsGenerator) {
    final int intensitySteps = aStarsGenerator.charsPerRow * aStarsGenerator.charsPerColumn;
    // #if DEBUG
    Assert.isTrue("stars generator should have at least one frame", intensitySteps > 0);
    // #endif

    myStars = new CharData[intensitySteps];
    for (int idx = 0; idx < myStars.length; idx++) {
      myStars[idx] = aStarsGenerator.getCharData(idx);
    }

    myNumberOfStars = aNumberOfStars;
    myStarsX = new float[myNumberOfStars];
    myStarsY = new float[myNumberOfStars];
    myStarsZ = new float[myNumberOfStars];

    final Random random = new Random();
    for (int idx = 0; idx < myNumberOfStars; idx++) {
      myStarsX[idx] = random.nextFloat(UNIVERSE_HALF);
      myStarsY[idx] = random.nextFloat(UNIVERSE_HALF);
      myStarsZ[idx] = random.nextFloat(UNIVERSE_HALF);
    }

    setAnimatedAxes(true, true, true);
  }
Пример #2
0
  public final void purge() {
    // #if DEBUG
    Assert.isTrue("still valid", myHasTextureIdFlag);
    // #endif

    myUtilities.purge(myOglTextureId);
    myHasTextureIdFlag = false;
  }