|  | 1 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 2 | // Copyright 2020 Leszek Koltunski                                                               //
 | 
  |  | 3 | //                                                                                               //
 | 
  |  | 4 | // This file is part of Distorted.                                                               //
 | 
  |  | 5 | //                                                                                               //
 | 
  |  | 6 | // Distorted is free software: you can redistribute it and/or modify                             //
 | 
  |  | 7 | // it under the terms of the GNU General Public License as published by                          //
 | 
  |  | 8 | // the Free Software Foundation, either version 2 of the License, or                             //
 | 
  |  | 9 | // (at your option) any later version.                                                           //
 | 
  |  | 10 | //                                                                                               //
 | 
  |  | 11 | // Distorted is distributed in the hope that it will be useful,                                  //
 | 
  |  | 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
 | 
  |  | 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
 | 
  |  | 14 | // GNU General Public License for more details.                                                  //
 | 
  |  | 15 | //                                                                                               //
 | 
  |  | 16 | // You should have received a copy of the GNU General Public License                             //
 | 
  |  | 17 | // along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
 | 
  |  | 18 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 19 | 
 | 
  |  | 20 | package org.distorted.library.effect;
 | 
  |  | 21 | 
 | 
  |  | 22 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 23 | 
 | 
  |  | 24 | /**
 | 
  |  | 25 |  * Distort the Mesh by applying a 3D vector of force.
 | 
  |  | 26 |  */
 | 
  |  | 27 | public class VertexEffectDisappear extends VertexEffect
 | 
  |  | 28 |   {
 | 
  |  | 29 |   private static final EffectName NAME = EffectName.DISAPPEAR;
 | 
  |  | 30 | 
 | 
  |  | 31 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 32 | /**
 | 
  |  | 33 |  * Only for use by the library itself.
 | 
  |  | 34 |  *
 | 
  |  | 35 |  * @y.exclude
 | 
  |  | 36 |  */
 | 
  |  | 37 |   public boolean compute(float[] uniforms, int index, long currentDuration, long step )
 | 
  |  | 38 |     {
 | 
  |  | 39 |     return false;
 | 
  |  | 40 |     }
 | 
  |  | 41 | 
 | 
  |  | 42 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 43 | // PUBLIC API
 | 
  |  | 44 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 45 | 
 | 
  |  | 46 |   static String code()
 | 
  |  | 47 |     {
 | 
  |  | 48 |     return "v = vec3(0.0, 0.0, 0.0);";
 | 
  |  | 49 |     }
 | 
  |  | 50 | 
 | 
  |  | 51 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 52 | /**
 | 
  |  | 53 |  * Have to call this before the shaders get compiled (i.e before DistortedLibrary.onCreate()) for the Effect to work.
 | 
  |  | 54 |  */
 | 
  |  | 55 |   public static void enable()
 | 
  |  | 56 |     {
 | 
  |  | 57 |     addEffect( NAME, code() );
 | 
  |  | 58 |     }
 | 
  |  | 59 | 
 | 
  |  | 60 | ///////////////////////////////////////////////////////////////////////////////////////////////////
 | 
  |  | 61 | /**
 | 
  |  | 62 |  * Disappear the whole (component of the) Mesh.
 | 
  |  | 63 |  */
 | 
  |  | 64 |   public VertexEffectDisappear()
 | 
  |  | 65 |     {
 | 
  |  | 66 |     super(NAME);
 | 
  |  | 67 |     }
 | 
  |  | 68 |   }
 | 
  |  | 69 | 
 | 
  |  | 70 | 
 | 
 
New effect VertexEffectDisappear