Revision 6bb59aad
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/effect/MatrixEffectRotate.java | ||
---|---|---|
33 | 33 |
|
34 | 34 |
public class MatrixEffectRotate extends MatrixEffect |
35 | 35 |
{ |
36 |
private static final String NAME = "ROTATE"; |
|
36 | 37 |
private static final float[] UNITIES = new float[]{0.0f}; |
37 | 38 |
private static final int DIMENSION = 4; |
38 | 39 |
private static final boolean SUPPORTS_CENTER = true; |
39 | 40 |
private static final boolean SUPPORTS_REGION = false; |
40 | 41 |
|
41 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
42 |
|
|
43 |
/** |
|
44 |
* Rotates the Object by 'angle' degrees around the center. |
|
45 |
* Static axis of rotation is given by the last parameter. |
|
46 |
* |
|
47 |
* @param angle Angle that we want to rotate the Object to. Unit: degrees |
|
48 |
* @param axis Axis of rotation |
|
49 |
* @param center Coordinates of the Point we are rotating around. |
|
50 |
*/ |
|
43 | 51 |
public MatrixEffectRotate(Data1D angle, Static3D axis, Data3D center) |
44 | 52 |
{ |
45 |
super(ROTATE,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION); |
|
53 |
super(ROTATE,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION,NAME);
|
|
46 | 54 |
|
47 | 55 |
if( angle instanceof Static1D ) |
48 | 56 |
{ |
... | ... | |
66 | 74 |
} |
67 | 75 |
|
68 | 76 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
69 |
|
|
77 |
/** |
|
78 |
* Rotates the Object by 'angle' degrees around the center. |
|
79 |
* Here both angle and axis can dynamically change. |
|
80 |
* |
|
81 |
* @param angleaxis Combined 4-tuple representing the (angle,axisX,axisY,axisZ). |
|
82 |
* @param center Coordinates of the Point we are rotating around. |
|
83 |
*/ |
|
70 | 84 |
public MatrixEffectRotate(Data4D angleaxis, Data3D center) |
71 | 85 |
{ |
72 |
super(ROTATE,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION); |
|
86 |
super(ROTATE,UNITIES,DIMENSION,SUPPORTS_CENTER,SUPPORTS_REGION,NAME);
|
|
73 | 87 |
|
74 | 88 |
if( angleaxis instanceof Static4D) |
75 | 89 |
{ |
Also available in: Unified diff
Progress with support for Effect classes.