Revision 6bb59aad
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/effect/VertexEffectPinch.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
public class VertexEffectPinch extends VertexEffect |
35 | 35 |
{ |
36 |
private static final String NAME = "PINCH"; |
|
36 | 37 |
private static final float[] UNITIES = new float[] {1.0f}; |
37 | 38 |
private static final int DIMENSION = 2; |
38 | 39 |
private static final boolean SUPPORTS_CENTER = true; |
39 | 40 |
private static final boolean SUPPORTS_REGION = true; |
40 | 41 |
|
41 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
42 |
|
|
43 |
/** |
|
44 |
* Pull all points around the center of the Effect towards a line passing through the center |
|
45 |
* (that's if degree>=1) or push them away from the line (degree<=1) |
|
46 |
* |
|
47 |
* @param pinch The current degree of the Effect + angle the line forms with X-axis |
|
48 |
* @param center 3-dimensional Data that, at any given time, returns the Center of the Effect. |
|
49 |
* @param region Region that masks the Effect. |
|
50 |
*/ |
|
43 | 51 |
public VertexEffectPinch(Data2D pinch, Data3D center, Data4D region) |
44 | 52 |
{ |
45 |
super(PINCH,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION); |
|
53 |
super(PINCH,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION,NAME);
|
|
46 | 54 |
|
47 | 55 |
if( pinch instanceof Dynamic2D) |
48 | 56 |
{ |
... | ... | |
73 | 81 |
} |
74 | 82 |
|
75 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
76 |
|
|
84 |
/** |
|
85 |
* Pull all points around the center of the Effect towards a line passing through the center |
|
86 |
* (that's if degree>=1) or push them away from the line (degree<=1) |
|
87 |
* |
|
88 |
* @param pinch The current degree of the Effect + angle the line forms with X-axis |
|
89 |
* @param center 3-dimensional Data that, at any given time, returns the Center of the Effect. |
|
90 |
*/ |
|
77 | 91 |
public VertexEffectPinch(Data2D pinch, Data3D center) |
78 | 92 |
{ |
79 |
super(PINCH,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION); |
|
93 |
super(PINCH,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION,NAME);
|
|
80 | 94 |
|
81 | 95 |
if( pinch instanceof Dynamic2D) |
82 | 96 |
{ |
Also available in: Unified diff
Progress with support for Effect classes.