Revision 15aa7d94
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/effect/MatrixEffectQuaternion.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import org.distorted.library.type.Data3D; |
23 | 23 |
import org.distorted.library.type.Data4D; |
24 |
import org.distorted.library.type.Dynamic3D; |
|
24 | 25 |
import org.distorted.library.type.Dynamic4D; |
26 |
import org.distorted.library.type.Static3D; |
|
25 | 27 |
import org.distorted.library.type.Static4D; |
26 | 28 |
|
27 | 29 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
48 | 50 |
mDynamic0 = (Dynamic4D)quaternion; |
49 | 51 |
} |
50 | 52 |
|
51 |
mCenter = center; |
|
53 |
if( center instanceof Static3D) |
|
54 |
{ |
|
55 |
mStaticCenter = (Static3D)center; |
|
56 |
} |
|
57 |
else if( center instanceof Dynamic3D) |
|
58 |
{ |
|
59 |
mDynamicCenter = (Dynamic3D)center; |
|
60 |
} |
|
61 |
} |
|
62 |
|
|
63 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
64 |
|
|
65 |
public boolean compute(float[] uniforms, int index, long currentDuration, long step ) |
|
66 |
{ |
|
67 |
if( mDynamicCenter!=null ) |
|
68 |
{ |
|
69 |
mDynamicCenter.interpolateMain(uniforms,index+4,currentDuration,step); |
|
70 |
} |
|
71 |
else |
|
72 |
{ |
|
73 |
uniforms[index+4] = mStaticCenter.getX(); |
|
74 |
uniforms[index+5] = mStaticCenter.getY(); |
|
75 |
uniforms[index+6] = mStaticCenter.getZ(); |
|
76 |
} |
|
77 |
|
|
78 |
if( mDynamic0!=null ) |
|
79 |
{ |
|
80 |
return mDynamic0.interpolateMain(uniforms,index,currentDuration,step); |
|
81 |
} |
|
82 |
else |
|
83 |
{ |
|
84 |
uniforms[index ] = ((Static4D)mStatic0).getX(); |
|
85 |
uniforms[index+1] = ((Static4D)mStatic0).getY(); |
|
86 |
uniforms[index+2] = ((Static4D)mStatic0).getZ(); |
|
87 |
uniforms[index+3] = ((Static4D)mStatic0).getW(); |
|
88 |
|
|
89 |
return false; |
|
90 |
} |
|
52 | 91 |
} |
53 | 92 |
} |
Also available in: Unified diff
Progress with support for Effect classes.