@@ -3958,9 +3958,16 @@ protected void translateImpl(float tx, float ty, float tz) {
3958
3958
static protected void invTranslate (PMatrix3D matrix ,
3959
3959
float tx , float ty , float tz ) {
3960
3960
matrix .preApply (1 , 0 , 0 , -tx ,
3961
- 0 , 1 , 0 , -ty ,
3962
- 0 , 0 , 1 , -tz ,
3963
- 0 , 0 , 0 , 1 );
3961
+ 0 , 1 , 0 , -ty ,
3962
+ 0 , 0 , 1 , -tz ,
3963
+ 0 , 0 , 0 , 1 );
3964
+ }
3965
+
3966
+
3967
+ static protected void invTranslate (PMatrix2D matrix ,
3968
+ float tx , float ty ) {
3969
+ matrix .preApply (1 , 0 , -tx ,
3970
+ 0 , 1 , -ty );
3964
3971
}
3965
3972
3966
3973
@@ -4049,16 +4056,21 @@ protected void rotateImpl(float angle, float v0, float v1, float v2) {
4049
4056
}
4050
4057
4051
4058
4052
- static private void invRotate (PMatrix3D matrix , float angle ,
4053
- float v0 , float v1 , float v2 ) {
4059
+ static protected void invRotate (PMatrix3D matrix , float angle ,
4060
+ float v0 , float v1 , float v2 ) {
4054
4061
float c = PApplet .cos (-angle );
4055
4062
float s = PApplet .sin (-angle );
4056
4063
float t = 1.0f - c ;
4057
4064
4058
4065
matrix .preApply ((t *v0 *v0 ) + c , (t *v0 *v1 ) - (s *v2 ), (t *v0 *v2 ) + (s *v1 ), 0 ,
4059
- (t *v0 *v1 ) + (s *v2 ), (t *v1 *v1 ) + c , (t *v1 *v2 ) - (s *v0 ), 0 ,
4060
- (t *v0 *v2 ) - (s *v1 ), (t *v1 *v2 ) + (s *v0 ), (t *v2 *v2 ) + c , 0 ,
4061
- 0 , 0 , 0 , 1 );
4066
+ (t *v0 *v1 ) + (s *v2 ), (t *v1 *v1 ) + c , (t *v1 *v2 ) - (s *v0 ), 0 ,
4067
+ (t *v0 *v2 ) - (s *v1 ), (t *v1 *v2 ) + (s *v0 ), (t *v2 *v2 ) + c , 0 ,
4068
+ 0 , 0 , 0 , 1 );
4069
+ }
4070
+
4071
+
4072
+ static protected void invRotate (PMatrix2D matrix , float angle ) {
4073
+ matrix .rotate (-angle );
4062
4074
}
4063
4075
4064
4076
@@ -4103,6 +4115,11 @@ static protected void invScale(PMatrix3D matrix, float x, float y, float z) {
4103
4115
}
4104
4116
4105
4117
4118
+ static protected void invScale (PMatrix2D matrix , float x , float y ) {
4119
+ matrix .preApply (1 /x , 0 , 0 , 1 /y , 0 , 0 );
4120
+ }
4121
+
4122
+
4106
4123
@ Override
4107
4124
public void shearX (float angle ) {
4108
4125
float t = (float ) Math .tan (angle );
@@ -6690,7 +6707,7 @@ protected Object initCache(PImage img) {
6690
6707
if (tex == null || tex .contextIsOutdated ()) {
6691
6708
tex = addTexture (img );
6692
6709
if (tex != null ) {
6693
- boolean dispose = ! img .loaded ;
6710
+ boolean dispose = img .pixels == null ;
6694
6711
img .loadPixels ();
6695
6712
tex .set (img .pixels , img .format );
6696
6713
img .setModified ();
0 commit comments