예제 #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;
  }
예제 #3
0
  public final void makeUsing(final Bitmap aBitmap) {
    // #if DEBUG
    Assert.isFalse("not made", myHasTextureIdFlag);
    // #endif

    myWidth = aBitmap.getWidth();
    myHeight = aBitmap.getHeight();
    makeOpenglTexture(aBitmap);
  }