Revision f338550a
Added by Leszek Koltunski almost 9 years ago
| src/main/java/org/distorted/examples/effects3d/Effects3DActivity.java | ||
|---|---|---|
| 244 | 244 |
|
| 245 | 245 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 246 | 246 |
|
| 247 |
public static void setSupportsRegion(boolean supports)
|
|
| 247 |
public void setSupportsRegion(boolean supports) |
|
| 248 | 248 |
{
|
| 249 |
mSupportsRegion = supports; |
|
| 249 |
if( mSupportsRegion != supports ) |
|
| 250 |
{
|
|
| 251 |
mSupportsRegion = supports; |
|
| 252 |
Effects3DSurfaceView view = (Effects3DSurfaceView) findViewById(R.id.effects3dSurfaceView); |
|
| 253 |
view.getRenderer().attachRegion(supports); |
|
| 254 |
} |
|
| 250 | 255 |
} |
| 251 | 256 |
|
| 252 | 257 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 253 | 258 |
|
| 254 |
public static void setSupportsCenter(boolean supports)
|
|
| 259 |
public void setSupportsCenter(boolean supports) |
|
| 255 | 260 |
{
|
| 256 |
mSupportsCenter = supports; |
|
| 261 |
if( mSupportsCenter != supports ) |
|
| 262 |
{
|
|
| 263 |
mSupportsCenter = supports; |
|
| 264 |
Effects3DSurfaceView view = (Effects3DSurfaceView) findViewById(R.id.effects3dSurfaceView); |
|
| 265 |
view.getRenderer().attachCenter(supports); |
|
| 266 |
} |
|
| 257 | 267 |
} |
| 258 | 268 |
|
| 259 | 269 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| ... | ... | |
| 523 | 533 |
mRegionY = 0; |
| 524 | 534 |
mRegionR = getWidth()/2; |
| 525 | 535 |
|
| 526 |
mSupportsRegion = true;
|
|
| 536 |
mSupportsRegion =false;
|
|
| 527 | 537 |
mSupportsCenter =false; |
| 538 |
/* |
|
| 539 |
Effects3DSurfaceView view = (Effects3DSurfaceView) findViewById(R.id.effects3dSurfaceView); |
|
| 540 |
view.getRenderer().attachRegion(false); |
|
| 541 |
view.getRenderer().attachCenter(false); |
|
| 542 |
*/ |
|
| 528 | 543 |
} |
| 529 | 544 |
|
| 530 | 545 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| src/main/java/org/distorted/examples/effects3d/Effects3DEffect.java | ||
|---|---|---|
| 481 | 481 |
seek[i].setProgress( mInter[i] ); |
| 482 | 482 |
} |
| 483 | 483 |
|
| 484 |
Effects3DActivity.setSupportsRegion(mName.supportsRegion());
|
|
| 485 |
Effects3DActivity.setSupportsCenter(mName.supportsCenter());
|
|
| 484 |
act.setSupportsCenter(mName.supportsCenter());
|
|
| 485 |
act.setSupportsRegion(mName.supportsRegion());
|
|
| 486 | 486 |
|
| 487 | 487 |
return mEffect; |
| 488 | 488 |
} |
| ... | ... | |
| 636 | 636 |
|
| 637 | 637 |
if( fromUser ) |
| 638 | 638 |
{
|
| 639 |
Effects3DActivity.setSupportsRegion(mName.supportsRegion()); |
|
| 640 |
Effects3DActivity.setSupportsCenter(mName.supportsCenter()); |
|
| 641 |
|
|
| 642 | 639 |
Effects3DActivity act = mAct.get(); |
| 643 | 640 |
|
| 641 |
act.setSupportsCenter(mName.supportsCenter()); |
|
| 642 |
act.setSupportsRegion(mName.supportsRegion()); |
|
| 644 | 643 |
act.setCenter(mCenterSta.getX(),mCenterSta.getY(),mCenterSta.getZ()); |
| 645 | 644 |
act.setRegion(mRegionSta.getX(),mRegionSta.getY(),mRegionSta.getZ()); |
| 646 | 645 |
} |
| src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java | ||
|---|---|---|
| 119 | 119 |
mScreen.attach(mBackgroundTexture, mBackgroundEffects, mQuad ); |
| 120 | 120 |
mScreen.attach(mObjectTexture , mObjectEffects , mObjectMesh); |
| 121 | 121 |
|
| 122 |
//if( Effects3DActivity.supportsCenter() ) |
|
| 123 |
mScreen.attach(mCenterNode); |
|
| 124 |
//if( Effects3DActivity.supportsRegion() ) |
|
| 125 |
mScreen.attach(mRegionNode); |
|
| 122 |
mScreen.attach(mCenterNode); |
|
| 123 |
mScreen.attach(mRegionNode); |
|
| 124 |
} |
|
| 125 |
|
|
| 126 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 127 |
|
|
| 128 |
void attachRegion(boolean attach) |
|
| 129 |
{
|
|
| 130 |
//if( attach ) mScreen.attach(mRegionNode); |
|
| 131 |
//else mScreen.detach(mRegionNode); |
|
| 132 |
} |
|
| 133 |
|
|
| 134 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
| 135 |
|
|
| 136 |
void attachCenter(boolean attach) |
|
| 137 |
{
|
|
| 138 |
//if( attach ) mScreen.attach(mCenterNode); |
|
| 139 |
//else mScreen.detach(mCenterNode); |
|
| 126 | 140 |
} |
| 127 | 141 |
|
| 128 | 142 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Some progress with fixing the efects3D regression. Not done yet.