Project

General

Profile

« Previous | Next » 

Revision f0d1f003

Added by Leszek Koltunski over 4 years ago

New effect VertexEffectDisappear

View differences:

src/main/java/org/distorted/library/effect/EffectName.java
55 55
  PINCH            ( EffectType.VERTEX  ,   new float[] {1.0f}           , 3, 4,     3    , VertexEffectPinch.class        ),
56 56
  SWIRL            ( EffectType.VERTEX  ,   new float[] {0.0f}           , 1, 4,     3    , VertexEffectSwirl.class        ),
57 57
  WAVE             ( EffectType.VERTEX  ,   new float[] {0.0f}           , 5, 4,     3    , VertexEffectWave.class         ),
58
  DISAPPEAR        ( EffectType.VERTEX  ,   new float[] {}               , 0, 0,     0    , VertexEffectDisappear.class    ),
59

  
58 60
  VERTEX_MOVE      ( EffectType.VERTEX  ,   new float[] {0.0f,0.0f,0.0f} , 3, 0,     0    , VertexEffectMove.class         ),
59 61
  VERTEX_QUATERNION( EffectType.VERTEX  ,   new float[] {0.0f,0.0f,0.0f} , 4, 0,     3    , VertexEffectQuaternion.class   ),
60 62
  VERTEX_ROTATE    ( EffectType.VERTEX  ,   new float[] {0.0f}           , 4, 0,     3    , VertexEffectRotate.class       ),
src/main/java/org/distorted/library/effect/VertexEffectDisappear.java
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

  

Also available in: Unified diff