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
|
import org.distorted.library.effectqueue.EffectQueue;
|
24
|
|
25
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
26
|
/**
|
27
|
* Abstract class that represents an Effect that works by modifying the ModelView matrix.
|
28
|
*/
|
29
|
public abstract class MatrixEffect extends Effect
|
30
|
{
|
31
|
/**
|
32
|
* 7: 4 per-effect interpolated values + 3 dimensional center.
|
33
|
*/
|
34
|
public static final int NUM_FLOAT_UNIFORMS = 7;
|
35
|
/**
|
36
|
* 0: nothing
|
37
|
*/
|
38
|
public static final int NUM_INT_UNIFORMS = 1;
|
39
|
|
40
|
static final int CENTER_OFFSET = 4;
|
41
|
|
42
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
43
|
/**
|
44
|
* Only for use by the library itself.
|
45
|
*
|
46
|
* @y.exclude
|
47
|
*/
|
48
|
public abstract void apply(float[] matrixP, float[] matrixV, float[] uniforms, int index);
|
49
|
|
50
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
51
|
/**
|
52
|
* Only for use by the library itself.
|
53
|
*
|
54
|
* @y.exclude
|
55
|
*/
|
56
|
public void addQueue(EffectQueue queue)
|
57
|
{
|
58
|
// NO OP
|
59
|
}
|
60
|
|
61
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
62
|
/**
|
63
|
* Only for use by the library itself.
|
64
|
*
|
65
|
* @y.exclude
|
66
|
*/
|
67
|
public void remQueue(EffectQueue queue)
|
68
|
{
|
69
|
// NO OP
|
70
|
}
|
71
|
|
72
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73
|
// empty function for completeness
|
74
|
|
75
|
static void destroyStatics()
|
76
|
{
|
77
|
|
78
|
}
|
79
|
|
80
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
81
|
|
82
|
MatrixEffect(EffectName name)
|
83
|
{
|
84
|
super(name);
|
85
|
}
|
86
|
}
|