Exemple #1
0
 /**
  * @param face the face to apply the specular color to
  * @param specular the new specular color
  */
 public void setSpecular(final MaterialFace face, final ReadOnlyColorRGBA specular) {
   if (face == MaterialFace.Front || face == MaterialFace.FrontAndBack) {
     _frontSpecular.set(specular);
   }
   if (face == MaterialFace.Back || face == MaterialFace.FrontAndBack) {
     _backSpecular.set(specular);
   }
   setNeedsRefresh(true);
 }
Exemple #2
0
 /**
  * @param face the face to apply the emissive color to
  * @param emissive the new emissive color
  */
 public void setEmissive(final MaterialFace face, final ReadOnlyColorRGBA emissive) {
   if (face == MaterialFace.Front || face == MaterialFace.FrontAndBack) {
     _frontEmissive.set(emissive);
   }
   if (face == MaterialFace.Back || face == MaterialFace.FrontAndBack) {
     _backEmissive.set(emissive);
   }
   setNeedsRefresh(true);
 }
Exemple #3
0
 /**
  * @param face the face to apply the diffuse color to
  * @param diffuse the new diffuse color
  */
 public void setDiffuse(final MaterialFace face, final ReadOnlyColorRGBA diffuse) {
   if (face == MaterialFace.Front || face == MaterialFace.FrontAndBack) {
     _frontDiffuse.set(diffuse);
   }
   if (face == MaterialFace.Back || face == MaterialFace.FrontAndBack) {
     _backDiffuse.set(diffuse);
   }
   setNeedsRefresh(true);
 }
Exemple #4
0
 /**
  * @param face the face to apply the ambient color to
  * @param ambient the new ambient color
  */
 public void setAmbient(final MaterialFace face, final ReadOnlyColorRGBA ambient) {
   if (face == MaterialFace.Front || face == MaterialFace.FrontAndBack) {
     _frontAmbient.set(ambient);
   }
   if (face == MaterialFace.Back || face == MaterialFace.FrontAndBack) {
     _backAmbient.set(ambient);
   }
   setNeedsRefresh(true);
 }
Exemple #5
0
  /**
   * Cause this particle to reset it's color, age and size per the parent's settings. status is set
   * to Status.Available. Location, velocity and lifespan are set as given. Actual geometry data is
   * not affected by this call, only particle params.
   *
   * @param velocity new initial particle velocity
   * @param position new initial particle position
   * @param lifeSpan new particle lifespan in ms
   */
  public void init(
      final ReadOnlyVector3 velocity, final ReadOnlyVector3 position, final double lifeSpan) {
    this.lifeSpan = lifeSpan;
    _velocity.set(velocity);
    _position.set(position);

    currColor.set(parent.getStartColor());
    currentAge = 0;
    status = Status.Available;
    values[VAL_CURRENT_SIZE] = parent.getStartSize();
  }
Exemple #6
0
 @Override
 public void read(final Ardor3DImporter e) throws IOException {
   super.read(e);
   final InputCapsule capsule = e.getCapsule(this);
   start = capsule.readFloat("start", 0);
   end = capsule.readFloat("end", 0);
   density = capsule.readFloat("density", 0);
   color.set((ColorRGBA) capsule.readSavable("color", new ColorRGBA(ColorRGBA.WHITE)));
   densityFunction =
       capsule.readEnum("densityFunction", DensityFunction.class, DensityFunction.Exponential);
   quality = capsule.readEnum("applyFunction", Quality.class, Quality.PerPixel);
   source = capsule.readEnum("source", CoordinateSource.class, CoordinateSource.Depth);
 }
Exemple #7
0
  /**
   * Reset particle conditions. Besides the passed lifespan, we also reset color, size, and spin
   * angle to their starting values (as given by parent.) Status is set to Status.Available.
   *
   * @param lifeSpan the recreated particle's new lifespan
   */
  public void recreateParticle(final double lifeSpan) {
    this.lifeSpan = lifeSpan;

    final int verts = ParticleSystem.getVertsForParticleType(type);
    currColor.set(parent.getStartColor());
    for (int x = 0; x < verts; x++) {
      BufferUtils.setInBuffer(
          currColor, parent.getParticleGeometry().getMeshData().getColorBuffer(), startIndex + x);
    }
    values[VAL_CURRENT_SIZE] = parent.getStartSize();
    currentAge = 0;
    values[VAL_CURRENT_MASS] = 1;
    status = Status.Available;
  }
Exemple #8
0
 @Override
 public void read(final InputCapsule capsule) throws IOException {
   super.read(capsule);
   _frontAmbient.set((ColorRGBA) capsule.readSavable("frontAmbient", (ColorRGBA) DEFAULT_AMBIENT));
   _frontDiffuse.set((ColorRGBA) capsule.readSavable("frontDiffuse", (ColorRGBA) DEFAULT_DIFFUSE));
   _frontSpecular.set(
       (ColorRGBA) capsule.readSavable("frontSpecular", (ColorRGBA) DEFAULT_SPECULAR));
   _frontEmissive.set(
       (ColorRGBA) capsule.readSavable("frontEmissive", (ColorRGBA) DEFAULT_EMISSIVE));
   _frontShininess = capsule.readFloat("frontShininess", DEFAULT_SHININESS);
   _backAmbient.set((ColorRGBA) capsule.readSavable("backAmbient", (ColorRGBA) DEFAULT_AMBIENT));
   _backDiffuse.set((ColorRGBA) capsule.readSavable("backDiffuse", (ColorRGBA) DEFAULT_DIFFUSE));
   _backSpecular.set(
       (ColorRGBA) capsule.readSavable("backSpecular", (ColorRGBA) DEFAULT_SPECULAR));
   _backEmissive.set(
       (ColorRGBA) capsule.readSavable("backEmissive", (ColorRGBA) DEFAULT_EMISSIVE));
   _backShininess = capsule.readFloat("backShininess", DEFAULT_SHININESS);
   _colorMaterial = capsule.readEnum("colorMaterial", ColorMaterial.class, DEFAULT_COLOR_MATERIAL);
   _colorMaterialFace =
       capsule.readEnum("colorMaterialFace", MaterialFace.class, DEFAULT_COLOR_MATERIAL_FACE);
 }
Exemple #9
0
 public void setGlobalAmbient(final ReadOnlyColorRGBA color) {
   _globalAmbient.set(color);
   setNeedsRefresh(true);
 }