Project

General

Profile

« Previous | Next » 

Revision b7e5a0ac

Added by Leszek Koltunski over 3 years ago

Progress with RubikControl.

View differences:

src/main/java/org/distorted/control/RubikControl.java
139 139

  
140 140
  public void effectFinished(long effectID)
141 141
    {
142
    if( effectID==mWhole.getEffectID()  ) finishWhole();
143
    if( effectID==mRotate.getEffectID() ) finishRotate();
142
    if( effectID==mWhole.getEffectID()  )
143
      {
144
      android.util.Log.e("D", "whole finished");
145
      finishWhole();
146
      }
147
    if( effectID==mRotate.getEffectID() )
148
      {
149
      android.util.Log.e("D", "rotate finished");
150
      finishRotate();
151
      }
144 152
    }
145 153

  
146 154
///////////////////////////////////////////////////////////////////////////////////////////////////
src/main/java/org/distorted/control/RubikControlWhole.java
22 22
import android.graphics.Bitmap;
23 23
import android.graphics.BitmapFactory;
24 24

  
25
import org.distorted.library.effect.MatrixEffectMove;
25 26
import org.distorted.library.effect.MatrixEffectScale;
26 27
import org.distorted.library.main.DistortedEffects;
27 28
import org.distorted.library.main.DistortedNode;
......
49 50
  private long mEffectID;
50 51

  
51 52
  private Dynamic3D mDynamic;
52
  private MatrixEffectScale mScale;
53
  private MatrixEffectMove mMove;
53 54

  
54 55
///////////////////////////////////////////////////////////////////////////////////////////////////
55 56

  
......
77 78
      mEffects[0]= new DistortedEffects();
78 79
      mEffects[1]= new DistortedEffects();
79 80

  
80
      float scaleCirc = 150;
81
      float scaleHand = 300;
81
      float x1 = 200;
82
      float y1 = 300;
83
      float z  = 0;
82 84

  
83
      Static3D scale0 = new Static3D(scaleCirc,scaleCirc,scaleCirc);
84
      Static3D scale1 = new Static3D(scaleHand,scaleHand,scaleHand);
85
      Static3D point0 = new Static3D(-x1,-y1,z);
86
      Static3D point1 = new Static3D(+x1,-y1,z);
87
      Static3D point2 = new Static3D(+x1,+y1,z);
85 88

  
86 89
      mDynamic = new Dynamic3D(10000,0.5f);
87
      mDynamic.add(scale0);
90
      mDynamic.add(point0);
91
      mDynamic.add(point1);
92
      mDynamic.add(point2);
88 93
      mDynamic.setMode(Dynamic.MODE_PATH);
89 94

  
90
      mScale = new MatrixEffectScale(mDynamic);
91
      mScale.notifyWhenFinished(mControl);
92
      mEffectID = mScale.getID();
93
      mEffects[0].apply(mScale);
94
      mEffects[1].apply( new MatrixEffectScale(scale1));
95
      mMove = new MatrixEffectMove(mDynamic);
96
      mMove.notifyWhenFinished(mControl);
97
      mEffectID = mMove.getID();
98

  
99
      mEffects[0].apply( new MatrixEffectScale(150));
100
      mEffects[0].apply(mMove);
101
      mEffects[1].apply( new MatrixEffectScale(300));
102
      mEffects[1].apply(mMove);
95 103
      }
96 104
    else
97 105
      {
98 106
      mDynamic.resetToBeginning();
99
      mScale.notifyWhenFinished(mControl);
107
      mMove.notifyWhenFinished(mControl);
100 108
      }
101 109
    }
102 110

  

Also available in: Unified diff