1 |
f0d1f003
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
cc62b34a
|
Leszek Koltunski
|
// Copyright 2017 Leszek Koltunski leszek@koltunski.pl //
|
3 |
f0d1f003
|
Leszek Koltunski
|
// //
|
4 |
|
|
// This file is part of Distorted. //
|
5 |
|
|
// //
|
6 |
cc62b34a
|
Leszek Koltunski
|
// 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 |
f0d1f003
|
Leszek Koltunski
|
// //
|
11 |
cc62b34a
|
Leszek Koltunski
|
// This library is distributed in the hope that it will be useful, //
|
12 |
f0d1f003
|
Leszek Koltunski
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
cc62b34a
|
Leszek Koltunski
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU //
|
14 |
|
|
// Lesser General Public License for more details. //
|
15 |
f0d1f003
|
Leszek Koltunski
|
// //
|
16 |
cc62b34a
|
Leszek Koltunski
|
// 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 |
f0d1f003
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
20 |
|
|
|
21 |
|
|
package org.distorted.library.effect;
|
22 |
|
|
|
23 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
24 |
|
|
|
25 |
|
|
/**
|
26 |
943b2e18
|
Leszek Koltunski
|
* Make the whole Mesh disappear.
|
27 |
f0d1f003
|
Leszek Koltunski
|
*/
|
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 |
|
|
|