1
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2
|
// Copyright 2019 Leszek Koltunski //
|
3
|
// //
|
4
|
// This file is part of Magic Cube. //
|
5
|
// //
|
6
|
// Magic Cube is proprietary software licensed under an EULA which you should have received //
|
7
|
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html //
|
8
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
9
|
|
10
|
package org.distorted.objectlib.effects.objectchange;
|
11
|
|
12
|
import org.distorted.library.effect.Effect;
|
13
|
import org.distorted.library.effect.MatrixEffectScale;
|
14
|
import org.distorted.library.type.Dynamic3D;
|
15
|
import org.distorted.library.type.Static3D;
|
16
|
|
17
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
18
|
|
19
|
class ObjectChangeEffectScale extends ObjectChangeEffect
|
20
|
{
|
21
|
public int createEffectsPhase0(int duration)
|
22
|
{
|
23
|
mCubeEffectPosition[0] = new int[] {2};
|
24
|
mCubeEffects[0] = new Effect[mCubeEffectPosition[0].length];
|
25
|
|
26
|
Dynamic3D d0 = new Dynamic3D(duration/2, 0.5f);
|
27
|
d0.add(new Static3D(1.00f, 1.00f, 1.00f));
|
28
|
d0.add(new Static3D(0.01f, 0.01f, 0.01f));
|
29
|
mCubeEffects[0][0] = new MatrixEffectScale(d0);
|
30
|
|
31
|
return 1;
|
32
|
}
|
33
|
|
34
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
35
|
|
36
|
public int createEffectsPhase1(int duration)
|
37
|
{
|
38
|
mCubeEffectPosition[1] = new int[] {2};
|
39
|
mCubeEffects[1] = new Effect[mCubeEffectPosition[1].length];
|
40
|
|
41
|
Dynamic3D d0 = new Dynamic3D(duration/2, 0.5f);
|
42
|
d0.add(new Static3D(0.01f, 0.01f, 0.01f));
|
43
|
d0.add(new Static3D(1.00f, 1.00f, 1.00f));
|
44
|
mCubeEffects[1][0] = new MatrixEffectScale(d0);
|
45
|
|
46
|
return 1;
|
47
|
}
|
48
|
|
49
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
50
|
// Enable all effects used in this Effect. Called by reflection from the parent class.
|
51
|
// Matrix Effects do not have to be enabled.
|
52
|
|
53
|
@SuppressWarnings("unused")
|
54
|
static void enable()
|
55
|
{
|
56
|
|
57
|
}
|
58
|
}
|
59
|
|