Alpha al = head.getAlpha(); if (al.finished()) { //code }
/** * This method is invoked by the behavior scheduler every frame. It * maps the alpha value that corresponds to the current time into a * transparency value and updates the specified TransparencyAttributes * object with this new transparency value. * @param criteria an enumeration of the criteria that caused the * stimulus */ @Override public void processStimulus(Enumeration criteria) { // Handle stimulus WakeupCriterion criterion = passiveWakeupCriterion; if (alpha != null) { float value = alpha.value(); if (value != prevAlphaValue) { float val = (float)((1.0-value)*minimumTransparency + value*maximumTransparency); target.setTransparency(val); prevAlphaValue = value; } if (!alpha.finished() && !alpha.isPaused()) { criterion = defaultWakeupCriterion; } } wakeupOn(criterion); }
prevAlphaValue = value; if (!alpha.finished() && !alpha.isPaused()) { criterion = defaultWakeupCriterion;
/** * This method is invoked by the behavior scheduler every frame. It maps * the alpha value that corresponds to the current time into the * appropriate light intensity for that time as obtained by interpolating * between the light intensity values for each knot point that were passed * to this class. * @param criteria enumeration of criteria that have triggered this wakeup */ @Override public void processStimulus(Enumeration criteria) { // Handle stimulus if (this.getAlpha() != null) { // Let FloatValueInterpolator calculate the correct // interpolated value computePathInterpolation(); // Set light intensity to the value calculated by // FloatValueInterpolator if (theLight != null) theLight.setIntensity(currentValue); if ((this.getAlpha()).finished()) return; } wakeupOn(defaultWakeupCriterion); }
/** * This method is invoked by the behavior scheduler every frame. * First it gets the alpha value that corresponds to the current time. * Then it calls computeTransform() method to computes the transform based on this * alpha vaule, and updates the specified TransformGroup node with this new transform. * @param criteria an enumeration of the criteria that caused the * stimulus */ @Override public void processStimulus(Enumeration criteria) { // Handle stimulus WakeupCriterion criterion = passiveWakeupCriterion; if (alpha != null) { float value = alpha.value(); if (value != prevAlphaValue) { computeTransform(value, currentTransform); target.setTransform(currentTransform); prevAlphaValue = value; } if (!alpha.finished() && !alpha.isPaused()) { criterion = defaultWakeupCriterion; } } wakeupOn(criterion); }
/** * This method sets the correct child for the Switch node according * to alpha * @param criteria enumeration of criteria that have triggered this wakeup */ @Override public void processStimulus(Enumeration criteria) { int child; // Handle stimulus if (this.getAlpha() != null) { // Let PathInterpolator calculate the correct // interpolated knot point computePathInterpolation(); if (currentKnotIndex > 0) child = currentKnotIndex - 1; else child = 0; if (target.getWhichChild() != child) { target.setWhichChild(child); } if ((this.getAlpha()).finished()) return; } wakeupOn(defaultWakeupCriterion); }
if (!alpha.finished() && !alpha.isPaused()) { criterion = defaultWakeupCriterion;