Project

General

Profile

« Previous | Next » 

Revision 8bf89617

Added by Leszek Koltunski over 4 years ago

New effect VertexEffectDisappear

View differences:

src/main/java/org/distorted/examples/generic/GenericEffect.java
40 40
import org.distorted.library.effect.PostprocessEffectBlur;
41 41
import org.distorted.library.effect.PostprocessEffectGlow;
42 42
import org.distorted.library.effect.VertexEffectDeform;
43
import org.distorted.library.effect.VertexEffectDisappear;
43 44
import org.distorted.library.effect.VertexEffectDistort;
44 45
import org.distorted.library.effect.VertexEffectMove;
45 46
import org.distorted.library.effect.VertexEffectPinch;
......
124 125
      case PINCH            : effect = new VertexEffectPinch       (mDyn3, mCenterDyn, mRegion4Dyn)              ; break;
125 126
      case SWIRL            : effect = new VertexEffectSwirl       (mDyn1, mCenterDyn, mRegion4Dyn)              ; break;
126 127
      case WAVE             : effect = new VertexEffectWave        (mDyn5, mCenterDyn, mRegion4Dyn)              ; break;
128
      case DISAPPEAR        : effect = new VertexEffectDisappear   ()                                            ; break;
129

  
127 130
      case VERTEX_MOVE      : effect = new VertexEffectMove        (mDyn3)                                       ; break;
128 131
      case VERTEX_QUATERNION: effect = new VertexEffectQuaternion  (mDyn4, mCenterDyn)                           ; break;
129 132
      case VERTEX_ROTATE    : effect = new VertexEffectRotate      (mDyn1, mDyn3, mCenterDyn)                    ; break;
......
238 241
                              float bp = (mInter[2]-50)*180 / 50.0f;
239 242
                              mSta3.set(dp,ap,bp);
240 243
                              break;
244
      case DISAPPEAR        : break;
241 245

  
242 246
      ///////////////////////////////////////////////////////////////////////////////////////
243 247
      // FRAGMENT
......
490 494

  
491 495
    switch(mDimension)
492 496
      {
497
      case 0 : break;
493 498
      case 1 : mDyn1 = new Dynamic1D();
494 499
               mSta1 = new Static1D(0);
495 500
               mDyn1.add(mSta1);
......
544 549
      default: throw new RuntimeException("unsupported effect");
545 550
      }
546 551

  
547
    mInter = new int[mDimension];
548
    mSeekID= new int[mDimension];
549

  
550
    mInterRegion = new int[4];
551
    mSeekRegionID= new int[4];
552
    mRegion4Dyn  = new Dynamic4D();
553
    mRegion4Sta  = new Static4D(0,0,0,0);
554
    mRegion4Dyn.add(mRegion4Sta);
555
    mRegion3Dyn  = new Dynamic3D();
556
    mRegion3Sta  = new Static3D(0,0,0);
557
    mRegion3Dyn.add(mRegion3Sta);
558

  
559
    mInterCenter = new int[3];
560
    mSeekCenterID= new int[3];
561
    mCenterDyn   = new Dynamic3D();
562
    mCenterSta   = new Static3D(0,0,0);
563
    mCenterDyn.add(mCenterSta);
552
    if( mDimension>0 )
553
      {
554
      mInter = new int[mDimension];
555
      mSeekID= new int[mDimension];
556

  
557
      mInterRegion = new int[4];
558
      mSeekRegionID= new int[4];
559
      mRegion4Dyn  = new Dynamic4D();
560
      mRegion4Sta  = new Static4D(0,0,0,0);
561
      mRegion4Dyn.add(mRegion4Sta);
562
      mRegion3Dyn  = new Dynamic3D();
563
      mRegion3Sta  = new Static3D(0,0,0);
564
      mRegion3Dyn.add(mRegion3Sta);
565

  
566
      mInterCenter = new int[3];
567
      mSeekCenterID= new int[3];
568
      mCenterDyn   = new Dynamic3D();
569
      mCenterSta   = new Static3D(0,0,0);
570
      mCenterDyn.add(mCenterSta);
571
      }
564 572

  
565 573
    mButton = null;
566 574
    mEffect = null;
......
572 580

  
573 581
  View createView(int num)
574 582
    {
575
    SeekBar[] seek = new SeekBar[mDimension];
583
    SeekBar[] seek = null;
584

  
585
    if( mDimension>0 )
586
      {
587
      seek = new SeekBar[mDimension];
588
      }
576 589

  
577 590
    GenericActivity2 act = mAct.get();
578 591

  
579 592
    switch(mDimension)
580 593
      {
594
      case 0 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect0d, null);
595
               mText      = mEffect.findViewById(R.id.effect0dText);
596
               mButton    = mEffect.findViewById(R.id.button0dRemove);
597
               setText();
598
               break;
581 599
      case 1 : mEffect    = act.getLayoutInflater().inflate(R.layout.effect1d, null);
582 600
               mText      = mEffect.findViewById(R.id.effect1dText);
583 601
               seek[0]    = mEffect.findViewById(R.id.effect1dbar1);
src/main/java/org/distorted/examples/generic/GenericTab.java
123 123
      {
124 124
      case R.id.effects3dButtonAdd   : newEffect(); break;
125 125
      case R.id.effects3dButtonRemove: removeAll(); break;
126
      case R.id.button0dRemove       :
126 127
      case R.id.button1dRemove       :
127 128
      case R.id.button2dRemove       :
128 129
      case R.id.button3dRemove       :
......
189 190

  
190 191
    switch(dimension)
191 192
      {
193
      case 0: butt = view.findViewById(R.id.button0dRemove);
194
              butt.setOnClickListener(this);
195
              break;
192 196
      case 1: butt = view.findViewById(R.id.button1dRemove);
193 197
              butt.setOnClickListener(this);
194 198
              break;
src/main/res/layout/effect0d.xml
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
              android:id="@+id/effect0dLayout"
4
              android:layout_width="match_parent"
5
              android:layout_height="wrap_content"
6
              android:orientation="vertical">
7

  
8
        <LinearLayout
9
              android:id="@+id/button0dLayout"
10
              android:layout_width="match_parent"
11
              android:layout_height="match_parent"
12
              android:orientation="horizontal">
13

  
14
                <TextView
15
                    android:id="@+id/effect0dText"
16
                    android:layout_width="wrap_content"
17
                    android:layout_height="wrap_content"
18
                    android:layout_marginEnd="5dp"
19
                    android:layout_marginStart="5dp"
20
                    android:layout_marginTop="3dp"
21
                    android:layout_weight="1"/>
22

  
23
                <Button
24
                    android:text="@string/removebut"
25
                    android:layout_width="wrap_content"
26
                    android:layout_height="wrap_content"
27
                    android:id="@+id/button0dRemove"
28
                    android:layout_weight="0.2"
29
                    android:layout_marginTop="3dp"/>
30
        </LinearLayout>
31

  
32
</LinearLayout>

Also available in: Unified diff