1 |
8eccf334
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
cc62b34a
|
Leszek Koltunski
|
// Copyright 2017 Leszek Koltunski leszek@koltunski.pl //
|
3 |
8eccf334
|
Leszek Koltunski
|
// //
|
4 |
46b572b5
|
Leszek Koltunski
|
// This file is part of Distorted. //
|
5 |
8eccf334
|
Leszek Koltunski
|
// //
|
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 |
8eccf334
|
Leszek Koltunski
|
// //
|
11 |
cc62b34a
|
Leszek Koltunski
|
// This library is distributed in the hope that it will be useful, //
|
12 |
8eccf334
|
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 |
8eccf334
|
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 |
8eccf334
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
20 |
|
|
|
21 |
|
|
package org.distorted.library.effect;
|
22 |
|
|
|
23 |
43814a57
|
Leszek Koltunski
|
import org.distorted.library.effectqueue.EffectQueue;
|
24 |
|
|
|
25 |
8eccf334
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
26 |
faa3ff56
|
Leszek Koltunski
|
/**
|
27 |
a20f274f
|
Leszek Koltunski
|
* Abstract class that represents an Effect that works by modifying the ModelView matrix.
|
28 |
faa3ff56
|
Leszek Koltunski
|
*/
|
29 |
8eccf334
|
Leszek Koltunski
|
public abstract class MatrixEffect extends Effect
|
30 |
|
|
{
|
31 |
96e3b88a
|
Leszek Koltunski
|
/**
|
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 |
e979d285
|
Leszek Koltunski
|
static final int CENTER_OFFSET = 4;
|
41 |
6d62a900
|
Leszek Koltunski
|
|
42 |
227b03bd
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
43 |
faa3ff56
|
Leszek Koltunski
|
/**
|
44 |
|
|
* Only for use by the library itself.
|
45 |
|
|
*
|
46 |
|
|
* @y.exclude
|
47 |
|
|
*/
|
48 |
62c869ad
|
Leszek Koltunski
|
public abstract void apply(float[] matrixP, float[] matrixV, float[] uniforms, int index);
|
49 |
227b03bd
|
Leszek Koltunski
|
|
50 |
43814a57
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
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 |
2f1f7570
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
73 |
143095f7
|
Leszek Koltunski
|
// empty function for completeness
|
74 |
2f1f7570
|
Leszek Koltunski
|
|
75 |
|
|
static void destroyStatics()
|
76 |
|
|
{
|
77 |
|
|
|
78 |
|
|
}
|
79 |
|
|
|
80 |
b547aaba
|
leszek
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
81 |
8eccf334
|
Leszek Koltunski
|
|
82 |
a0d5e302
|
Leszek Koltunski
|
MatrixEffect(EffectName name)
|
83 |
b547aaba
|
leszek
|
{
|
84 |
9d0d8530
|
leszek
|
super(name);
|
85 |
b547aaba
|
leszek
|
}
|
86 |
8eccf334
|
Leszek Koltunski
|
}
|