Revision 0df17fad
Added by Leszek Koltunski almost 8 years ago
src/main/java/org/distorted/library/DistortedObject.java | ||
---|---|---|
171 | 171 |
|
172 | 172 |
void releasePriv() |
173 | 173 |
{ |
174 |
if( matrixCloned ==false) mM.abortAll(); |
|
175 |
if( vertexCloned ==false) mV.abortAll(); |
|
176 |
if( fragmentCloned==false) mF.abortAll(); |
|
174 |
if( matrixCloned ==false) mM.abortAll(false);
|
|
175 |
if( vertexCloned ==false) mV.abortAll(false);
|
|
176 |
if( fragmentCloned==false) mF.abortAll(false);
|
|
177 | 177 |
|
178 | 178 |
mBmp = null; |
179 | 179 |
mGrid = null; |
... | ... | |
374 | 374 |
*/ |
375 | 375 |
public int abortAllEffects() |
376 | 376 |
{ |
377 |
return mM.abortAll() + mV.abortAll() + mF.abortAll();
|
|
377 |
return mM.abortAll(true) + mV.abortAll(true) + mF.abortAll(true);
|
|
378 | 378 |
} |
379 | 379 |
|
380 | 380 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
388 | 388 |
{ |
389 | 389 |
switch(type) |
390 | 390 |
{ |
391 |
case MATRIX : return mM.abortAll(); |
|
392 |
case VERTEX : return mV.abortAll(); |
|
393 |
case FRAGMENT: return mF.abortAll(); |
|
391 |
case MATRIX : return mM.abortAll(true);
|
|
392 |
case VERTEX : return mV.abortAll(true);
|
|
393 |
case FRAGMENT: return mF.abortAll(true);
|
|
394 | 394 |
default : return 0; |
395 | 395 |
} |
396 | 396 |
} |
... | ... | |
498 | 498 |
* Rotates the Object by 'angle' degrees around the center. |
499 | 499 |
* Static axis of rotation is given by the last parameter. |
500 | 500 |
* |
501 |
* @param center Coordinates of the Point we are rotating around. |
|
502 | 501 |
* @param angle Angle that we want to rotate the Object to. Unit: degrees |
503 | 502 |
* @param axis Axis of rotation |
503 |
* @param center Coordinates of the Point we are rotating around. |
|
504 | 504 |
* @return ID of the effect added, or -1 if we failed to add one. |
505 | 505 |
*/ |
506 |
public long rotate(Data3D center, Data1D angle, Static3D axis)
|
|
506 |
public long rotate(Data1D angle, Static3D axis, Data3D center )
|
|
507 | 507 |
{ |
508 |
return mM.add(EffectNames.ROTATE, center, angle, axis);
|
|
508 |
return mM.add(EffectNames.ROTATE, angle, axis, center);
|
|
509 | 509 |
} |
510 | 510 |
|
511 | 511 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
513 | 513 |
* Rotates the Object by 'angle' degrees around the center. |
514 | 514 |
* Here both angle and axis can dynamically change. |
515 | 515 |
* |
516 |
* @param center Coordinates of the Point we are rotating around. |
|
517 | 516 |
* @param angleaxis Combined 4-tuple representing the (angle,axisX,axisY,axisZ). |
517 |
* @param center Coordinates of the Point we are rotating around. |
|
518 | 518 |
* @return ID of the effect added, or -1 if we failed to add one. |
519 | 519 |
*/ |
520 |
public long rotate(Data3D center, Data4D angleaxis)
|
|
520 |
public long rotate(Data4D angleaxis, Data3D center)
|
|
521 | 521 |
{ |
522 |
return mM.add(EffectNames.ROTATE, center, angleaxis);
|
|
522 |
return mM.add(EffectNames.ROTATE, angleaxis, center);
|
|
523 | 523 |
} |
524 | 524 |
|
525 | 525 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
526 | 526 |
/** |
527 | 527 |
* Rotates the Object by quaternion. |
528 |
* |
|
529 |
* @param center Coordinates of the Point we are rotating around. |
|
528 |
* |
|
530 | 529 |
* @param quaternion The quaternion describing the rotation. |
530 |
* @param center Coordinates of the Point we are rotating around. |
|
531 | 531 |
* @return ID of the effect added, or -1 if we failed to add one. |
532 | 532 |
*/ |
533 |
public long quaternion(Data3D center, Data4D quaternion)
|
|
533 |
public long quaternion(Data4D quaternion, Data3D center )
|
|
534 | 534 |
{ |
535 |
return mM.add(EffectNames.QUATERNION,center,quaternion);
|
|
535 |
return mM.add(EffectNames.QUATERNION,quaternion,center);
|
|
536 | 536 |
} |
537 | 537 |
|
538 | 538 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
539 | 539 |
/** |
540 | 540 |
* Shears the Object. |
541 | 541 |
* |
542 |
* @param center Center of shearing, i.e. the point which stays unmoved. |
|
543 | 542 |
* @param shear The 3-tuple of shear factors. |
543 |
* @param center Center of shearing, i.e. the point which stays unmoved. |
|
544 | 544 |
* @return ID of the effect added, or -1 if we failed to add one. |
545 | 545 |
*/ |
546 |
public long shear(Data3D center, Data3D shear)
|
|
546 |
public long shear(Data3D shear, Data3D center)
|
|
547 | 547 |
{ |
548 |
return mM.add(EffectNames.SHEAR, center, shear);
|
|
548 |
return mM.add(EffectNames.SHEAR, shear, center);
|
|
549 | 549 |
} |
550 | 550 |
|
551 | 551 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
- Javadoc for EffectNames
- make Matrix effects consistent with the rest (center of effect as last parameter!)
- bugfix for yesterday's bugfix (we only want to send 'EFFECT_REMOVED' messages if it was really the Application that called 'abortAll' and not when we are cleaning up everything)