Revision 8badfe2a
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/control/RubikControlWhole.java | ||
---|---|---|
49 | 49 |
private DistortedEffects[] mEffects; |
50 | 50 |
private DistortedNode[] mNodes; |
51 | 51 |
private long mEffectID; |
52 |
private MeshQuad mQuad; |
|
52 | 53 |
|
53 | 54 |
private Dynamic3D mDynamicHand1; |
54 | 55 |
private MatrixEffectMove mMoveHand1; |
... | ... | |
57 | 58 |
|
58 | 59 |
private Bitmap openBitmap(RubikActivity act, int resource) |
59 | 60 |
{ |
60 |
try(InputStream is = act.getResources().openRawResource(resource) ) |
|
61 |
try( InputStream is = act.getResources().openRawResource(resource) )
|
|
61 | 62 |
{ |
62 | 63 |
return BitmapFactory.decodeStream(is); |
63 | 64 |
} |
64 |
catch(IOException e)
|
|
65 |
catch( IOException e )
|
|
65 | 66 |
{ |
66 | 67 |
// ignore |
67 | 68 |
} |
... | ... | |
131 | 132 |
if( mNodes==null ) |
132 | 133 |
{ |
133 | 134 |
mNodes = new DistortedNode[NUM_NODE]; |
134 |
RubikActivity act = mControl.getActivity();
|
|
135 |
|
|
136 |
if( act!=null ) |
|
137 |
{
|
|
138 |
MeshQuad mesh = new MeshQuad(); |
|
139 |
|
|
140 |
Bitmap bmpCirc = openBitmap(act, R.drawable.ui_fading_circle);
|
|
141 |
DistortedTexture textureCirc = new DistortedTexture();
|
|
142 |
textureCirc.setTexture(bmpCirc);
|
|
143 |
mNodes[0]= new DistortedNode(textureCirc,mEffects[0],mesh);
|
|
144 |
mNodes[1]= new DistortedNode(textureCirc,mEffects[1],mesh);
|
|
145 |
|
|
146 |
Bitmap bmpHand = openBitmap(act, R.drawable.ui_hand_pointer); |
|
147 |
DistortedTexture textureHand = new DistortedTexture();
|
|
148 |
textureHand.setTexture(bmpHand);
|
|
149 |
mNodes[2]= new DistortedNode(textureHand,mEffects[2],mesh);
|
|
150 |
mNodes[3]= new DistortedNode(textureHand,mEffects[3],mesh);
|
|
151 |
}
|
|
152 |
else
|
|
153 |
{
|
|
154 |
android.util.Log.e("D", "Activity NULL!!");
|
|
155 |
}
|
|
135 |
mQuad = new MeshQuad();
|
|
136 |
} |
|
137 |
|
|
138 |
RubikActivity act = mControl.getActivity();
|
|
139 |
|
|
140 |
if( act!=null ) |
|
141 |
{
|
|
142 |
Bitmap bmpCirc = openBitmap(act, R.drawable.ui_fading_circle);
|
|
143 |
DistortedTexture textureCirc = new DistortedTexture();
|
|
144 |
textureCirc.setTexture(bmpCirc);
|
|
145 |
mNodes[0]= new DistortedNode(textureCirc,mEffects[0],mQuad);
|
|
146 |
mNodes[1]= new DistortedNode(textureCirc,mEffects[1],mQuad); |
|
147 |
|
|
148 |
Bitmap bmpHand = openBitmap(act, R.drawable.ui_hand_pointer);
|
|
149 |
DistortedTexture textureHand = new DistortedTexture();
|
|
150 |
textureHand.setTexture(bmpHand);
|
|
151 |
mNodes[2]= new DistortedNode(textureHand,mEffects[2],mQuad);
|
|
152 |
mNodes[3]= new DistortedNode(textureHand,mEffects[3],mQuad);
|
|
153 |
}
|
|
154 |
else
|
|
155 |
{
|
|
156 |
android.util.Log.e("D", "Activity NULL!!");
|
|
156 | 157 |
} |
157 | 158 |
} |
158 | 159 |
|
Also available in: Unified diff
Progress with RubikControl.