Project

General

Profile

Download (3.23 KB) Statistics
| Branch: | Revision:

library / src / main / java / org / distorted / library / effect / VertexEffectDisappear.java @ 8c57d77b

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2017 Leszek Koltunski  leszek@koltunski.pl                                          //
3
//                                                                                               //
4
// This file is part of Distorted.                                                               //
5
//                                                                                               //
6
// This library is free software; you can redistribute it and/or                                 //
7
// modify it under the terms of the GNU Lesser General Public                                    //
8
// License as published by the Free Software Foundation; either                                  //
9
// version 2.1 of the License, or (at your option) any later version.                            //
10
//                                                                                               //
11
// This library 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 GNU                             //
14
// Lesser General Public License for more details.                                               //
15
//                                                                                               //
16
// You should have received a copy of the GNU Lesser General Public                              //
17
// License along with this library; if not, write to the Free Software                           //
18
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA                //
19
///////////////////////////////////////////////////////////////////////////////////////////////////
20

    
21
package org.distorted.library.effect;
22

    
23
///////////////////////////////////////////////////////////////////////////////////////////////////
24

    
25
/**
26
 * Make the whole Mesh disappear.
27
 */
28
public class VertexEffectDisappear extends VertexEffect
29
  {
30
  private static final EffectName NAME = EffectName.DISAPPEAR;
31

    
32
///////////////////////////////////////////////////////////////////////////////////////////////////
33
/**
34
 * Only for use by the library itself.
35
 *
36
 * @y.exclude
37
 */
38
  public boolean compute(float[] uniforms, int index, long currentDuration, long step )
39
    {
40
    return false;
41
    }
42

    
43
///////////////////////////////////////////////////////////////////////////////////////////////////
44
// PUBLIC API
45
///////////////////////////////////////////////////////////////////////////////////////////////////
46

    
47
  static String code()
48
    {
49
    return "v = vec3(0.0, 0.0, 0.0);";
50
    }
51

    
52
///////////////////////////////////////////////////////////////////////////////////////////////////
53
/**
54
 * Have to call this before the shaders get compiled (i.e before DistortedLibrary.onCreate()) for the Effect to work.
55
 */
56
  public static void enable()
57
    {
58
    addEffect( NAME, code() );
59
    }
60

    
61
///////////////////////////////////////////////////////////////////////////////////////////////////
62
/**
63
 * Disappear the whole (component of the) Mesh.
64
 */
65
  public VertexEffectDisappear()
66
    {
67
    super(NAME);
68
    }
69
  }
70

    
71

    
(24-24/34)