Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
CameraPane.java
....@@ -56,8 +56,6 @@
5656 static int CURRENTANTIALIAS = 0; // 1;
5757 /*static*/ boolean RENDERSHADOW = true;
5858 /*static*/ int RENDERPROGRAM = 2; // 0 == none, 1 == fast, 2 == normal
59
- static boolean ANIMATION = false;
60
- static String filename;
6159
6260 boolean DISPLAYTEXT = false;
6361 //boolean REDUCETEXTURE = true;
....@@ -92,6 +90,8 @@
9290
9391 static int tickcount = 0; // slow pose issue
9492
93
+static boolean BUTTONLESSWHEEL = false;
94
+static boolean ZOOMBOXMODE = false;
9595 static boolean BOXMODE = false;
9696 static boolean IMAGEFLIP = false;
9797 static boolean SMOOTHFOCUS = false;
....@@ -106,7 +106,7 @@
106106 static boolean OEIL = true;
107107 static boolean OEILONCE = false; // do oeilon then oeiloff
108108 static boolean LOOKAT = true;
109
-static boolean RANDOM = true; // false;
109
+static boolean SWITCH = true; // false;
110110 static boolean HANDLES = false; // selection doesn't work!!
111111 static boolean PAINTMODE = false;
112112
....@@ -149,6 +149,8 @@
149149 defaultcaps.setAccumBlueBits(16);
150150 defaultcaps.setAccumAlphaBits(16);
151151 }
152
+
153
+ private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory();
152154
153155 void SetAsGLRenderer(boolean b)
154156 {
....@@ -223,6 +225,11 @@
223225 public boolean IsBoxMode()
224226 {
225227 return BOXMODE;
228
+ }
229
+
230
+ public boolean IsZoomBoxMode()
231
+ {
232
+ return ZOOMBOXMODE;
226233 }
227234
228235 public void ClearDepth()
....@@ -457,10 +464,12 @@
457464 if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0)
458465 {
459466 //gl.glBegin(gl.GL_TRIANGLES);
460
- boolean hasnorm = pv.norm != null; // && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0);
467
+ boolean hasnorm = pv.norm != null && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0)
468
+ // TEST LIVE NORMALS && !obj.dontselect
469
+ ;
461470 if (!hasnorm)
462471 {
463
- // System.out.println("FUCK!!");
472
+ // System.out.println("Mesh normal");
464473 LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0);
465474 LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1);
466475 LA.vecCross(obj.v0, obj.v1, obj.v2);
....@@ -1185,10 +1194,12 @@
11851194 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
11861195 }
11871196 }
1197
+
11881198 if (flipV)
11891199 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
11901200 else
11911201 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1202
+
11921203 //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
11931204 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
11941205
....@@ -1208,10 +1219,12 @@
12081219 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
12091220 }
12101221 }
1222
+
12111223 if (flipV)
12121224 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12131225 else
12141226 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1227
+
12151228 //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
12161229 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
12171230
....@@ -1239,8 +1252,10 @@
12391252 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12401253 else
12411254 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1255
+
12421256 //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
12431257 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1258
+
12441259 count2 += 2;
12451260 count3 += 3;
12461261 }
....@@ -1612,18 +1627,18 @@
16121627 //col.getColorComponents(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB), CameraPane.modelParams0);
16131628 if (!material.multiply)
16141629 {
1615
- display.color = color;
1630
+ display.color = material.color;
16161631 display.saturation = material.modulation;
16171632 }
16181633 else
16191634 {
1620
- display.color *= color*2;
1635
+ display.color *= material.color*2;
16211636 display.saturation *= material.modulation*2;
16221637 }
16231638
16241639 cColor.HSBtoRGB(display.color, display.saturation, 1, display.modelParams0);
16251640
1626
- float[] colorV = GrafreeD.colorV;
1641
+ float[] colorV = Grafreed.colorV;
16271642
16281643 /**/
16291644 if (display.DrawMode() == display.DEFAULT) // && display.RENDERPROGRAM == 0)
....@@ -1883,7 +1898,7 @@
18831898 void PushMatrix(double[][] matrix)
18841899 {
18851900 // GrafreeD.tracein(matrix);
1886
- PushMatrix(matrix,1);
1901
+ PushMatrix(matrix, 1);
18871902 }
18881903
18891904 void PushMatrix()
....@@ -2135,7 +2150,7 @@
21352150 System.err.println("LIVE = " + Globals.isLIVE());
21362151
21372152 if (!Globals.isLIVE()) // save sound
2138
- GrafreeD.savesound = true; // wav.save();
2153
+ Grafreed.savesound = true; // wav.save();
21392154 // else
21402155 repaint(); // start loop // may 2013
21412156 }
....@@ -2168,6 +2183,11 @@
21682183 public void ToggleBoxMode()
21692184 {
21702185 BOXMODE ^= true;
2186
+ }
2187
+
2188
+ public void ToggleZoomBoxMode()
2189
+ {
2190
+ ZOOMBOXMODE ^= true;
21712191 }
21722192
21732193 public void ToggleSmoothFocus()
....@@ -2255,9 +2275,9 @@
22552275 LOOKAT ^= true;
22562276 }
22572277
2258
- void ToggleRandom()
2278
+ void ToggleSwitch()
22592279 {
2260
- RANDOM ^= true;
2280
+ SWITCH ^= true;
22612281 }
22622282
22632283 void ToggleHandles()
....@@ -2364,7 +2384,7 @@
23642384 {
23652385 return currentGL;
23662386 }
2367
-
2387
+
23682388 /**/
23692389 class CacheTexture
23702390 {
....@@ -4196,6 +4216,7 @@
41964216
41974217 com.sun.opengl.util.texture.Texture CompressTexture2(String name)
41984218 {
4219
+ new Exception().printStackTrace();
41994220 System.exit(0);
42004221 com.sun.opengl.util.texture.Texture texture = null;
42014222
....@@ -7908,6 +7929,64 @@
79087929 ReleaseTexture(pigment, false);
79097930 }
79107931
7932
+ public void ReleasePigmentTexture(cTexture tex) // INTERFACE
7933
+ {
7934
+ if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
7935
+ {
7936
+ return;
7937
+ }
7938
+
7939
+ if (tex == null)
7940
+ {
7941
+ ReleaseTexture(null, false);
7942
+ return;
7943
+ }
7944
+
7945
+ String pigment = Object3D.GetPigment(tex);
7946
+
7947
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7948
+ {
7949
+ // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
7950
+ // System.out.println("; bump = " + bump);
7951
+ }
7952
+
7953
+ if (pigment.equals(""))
7954
+ {
7955
+ pigment = null;
7956
+ }
7957
+
7958
+ ReleaseTexture(pigment, false);
7959
+ }
7960
+
7961
+ public void ReleaseBumpTexture(cTexture tex) // INTERFACE
7962
+ {
7963
+ if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
7964
+ {
7965
+ return;
7966
+ }
7967
+
7968
+ if (tex == null)
7969
+ {
7970
+ ReleaseTexture(null, true);
7971
+ return;
7972
+ }
7973
+
7974
+ String bump = Object3D.GetBump(tex);
7975
+
7976
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
7977
+ {
7978
+ // System.out.print("RELEASE +++++++++++++++ pigment = " + pigment);
7979
+ // System.out.println("; bump = " + bump);
7980
+ }
7981
+
7982
+ if (bump.equals(""))
7983
+ {
7984
+ bump = null;
7985
+ }
7986
+
7987
+ ReleaseTexture(bump, true);
7988
+ }
7989
+
79117990 void ReleaseTexture(String tex, boolean bump)
79127991 {
79137992 if (// DrawMode() != 0 || /*tex == null ||*/
....@@ -8011,7 +8090,7 @@
80118090 }
80128091 }
80138092
8014
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8093
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
80158094 {
80168095 if (// DrawMode() != 0 || /*tex == null ||*/
80178096 ambientOcclusion ) // || !textureon)
....@@ -8056,7 +8135,94 @@
80568135 return; // true;
80578136 }
80588137
8059
- CacheTexture GetCacheTexture(String tex, boolean bump, int resolution)
8138
+ /*boolean*/ public void BindPigmentTexture(cTexture tex, int resolution) throws Exception // INTERFACE
8139
+ {
8140
+ if (// DrawMode() != 0 || /*tex == null ||*/
8141
+ ambientOcclusion ) // || !textureon)
8142
+ {
8143
+ return; // false;
8144
+ }
8145
+
8146
+ if (tex == null)
8147
+ {
8148
+ BindTexture(null,false,resolution);
8149
+ return;
8150
+ }
8151
+
8152
+ String pigment = Object3D.GetPigment(tex);
8153
+
8154
+ usedtextures.put(pigment, pigment);
8155
+
8156
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8157
+ {
8158
+ // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
8159
+ // System.out.println("; bump = " + bump);
8160
+ }
8161
+
8162
+ if (pigment.equals(""))
8163
+ {
8164
+ pigment = null;
8165
+ }
8166
+
8167
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
8168
+ BindTexture(pigment, false, resolution);
8169
+ }
8170
+
8171
+ /*boolean*/ public void BindBumpTexture(cTexture tex, int resolution) throws Exception // INTERFACE
8172
+ {
8173
+ if (// DrawMode() != 0 || /*tex == null ||*/
8174
+ ambientOcclusion ) // || !textureon)
8175
+ {
8176
+ return; // false;
8177
+ }
8178
+
8179
+ if (tex == null)
8180
+ {
8181
+ BindTexture(null,true,resolution);
8182
+ return;
8183
+ }
8184
+
8185
+ String bump = Object3D.GetBump(tex);
8186
+
8187
+ usedtextures.put(bump, bump);
8188
+
8189
+ if (!tex.equals(":") && !tex.equals(DEFAULT_TEXTURES))
8190
+ {
8191
+ // System.out.print("BIND +++++++++++++++ pigment = " + pigment);
8192
+ // System.out.println("; bump = " + bump);
8193
+ }
8194
+
8195
+ if (bump.equals(""))
8196
+ {
8197
+ bump = null;
8198
+ }
8199
+
8200
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE2);
8201
+ BindTexture(bump, true, resolution);
8202
+ GetGL().glActiveTexture(GetGL().GL_TEXTURE0);
8203
+ }
8204
+
8205
+ java.util.HashSet<String> missingTextures = new java.util.HashSet<String>();
8206
+
8207
+ private boolean FileExists(String tex)
8208
+ {
8209
+ if (missingTextures.contains(tex))
8210
+ {
8211
+ return false;
8212
+ }
8213
+
8214
+ boolean fileExists = new File(tex).exists();
8215
+
8216
+ if (!fileExists)
8217
+ {
8218
+ // If file exists, the "new File()" is not executed sgain
8219
+ missingTextures.add(tex);
8220
+ }
8221
+
8222
+ return fileExists;
8223
+ }
8224
+
8225
+ CacheTexture GetCacheTexture(String tex, boolean bump, int resolution) throws Exception
80608226 {
80618227 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
80628228
....@@ -8064,12 +8230,18 @@
80648230 {
80658231 String texname = tex;
80668232
8067
- String[] split = tex.split("Textures");
8068
- if (split.length > 1)
8069
- texname = "/Users/nbriere/Textures" + split[split.length-1];
8070
- else
8071
- if (!texname.startsWith("/"))
8072
- texname = "/Users/nbriere/Textures/" + texname;
8233
+ String fallbackTextureName = defaultDirectory + "/Textures/" + texname;
8234
+
8235
+// String[] split = tex.split("Textures");
8236
+// if (split.length > 1)
8237
+// texname = "/Users/nbriere/Textures" + split[split.length-1];
8238
+// else
8239
+// if (!texname.startsWith("/"))
8240
+// texname = "/Users/nbriere/Textures/" + texname;
8241
+ if (!FileExists(tex))
8242
+ {
8243
+ texname = fallbackTextureName;
8244
+ }
80738245
80748246 if (CACHETEXTURE)
80758247 texture = textures.get(texname); // TEXTURE CACHE
....@@ -8138,7 +8310,7 @@
81388310 }
81398311
81408312 cachename = texname.substring(0, texname.length()-4)+ext+".jpg";
8141
- if (!new File(cachename).exists())
8313
+ if (!FileExists(cachename))
81428314 cachename = texname;
81438315 else
81448316 processbump = false; // don't process bump map again
....@@ -8160,7 +8332,7 @@
81608332 }
81618333
81628334 cachename = texname.substring(0, texname.length()-4)+ext+".png";
8163
- if (!new File(cachename).exists())
8335
+ if (!FileExists(cachename))
81648336 cachename = texname;
81658337 else
81668338 processbump = false; // don't process bump map again
....@@ -8169,7 +8341,9 @@
81698341 texturedata = GetFileTexture(cachename, processbump, resolution);
81708342
81718343
8172
- if (texturedata != null)
8344
+ if (texturedata == null)
8345
+ throw new Exception();
8346
+
81738347 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
81748348 //texture = GetTexture(tex, bump);
81758349 }
....@@ -8291,7 +8465,7 @@
82918465 return texture;
82928466 }
82938467
8294
- com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution)
8468
+ com.sun.opengl.util.texture.Texture GetTexture(String tex, boolean bump, int resolution) throws Exception
82958469 {
82968470 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
82978471
....@@ -8309,14 +8483,14 @@
83098483 return texture!=null?texture.texture:null;
83108484 }
83118485
8312
- public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution)
8486
+ public com.sun.opengl.util.texture.TextureData GetTextureData(String tex, boolean bump, int resolution) throws Exception
83138487 {
83148488 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83158489
83168490 return texture!=null?texture.texturedata:null;
83178491 }
83188492
8319
- boolean BindTexture(String tex, boolean bump, int resolution)
8493
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
83208494 {
83218495 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
83228496 {
....@@ -9293,8 +9467,8 @@
92939467 assert (parentcam != renderCamera);
92949468
92959469 if (renderCamera != lightCamera)
9296
- for (int count = parentcam.GetTransformCount(); --count>=0;)
9297
- LA.matConcat(matrix, parentcam.toParent, matrix);
9470
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
9471
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
92989472
92999473 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
93009474
....@@ -9309,8 +9483,8 @@
93099483 LA.matCopy(renderCamera.fromScreen, matrix);
93109484
93119485 if (renderCamera != lightCamera)
9312
- for (int count = parentcam.GetTransformCount(); --count>=0;)
9313
- LA.matConcat(parentcam.fromParent, matrix, matrix);
9486
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
9487
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
93149488
93159489 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
93169490
....@@ -9382,7 +9556,7 @@
93829556 //gl.glFlush();
93839557 gl.glAccum(gl.GL_ACCUM, 1.0f / ACSIZE);
93849558
9385
- if (ANIMATION && ABORTED)
9559
+ if (Globals.ANIMATION && ABORTED)
93869560 {
93879561 System.err.println(" ABORTED FRAME");
93889562 break;
....@@ -9412,7 +9586,7 @@
94129586 setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
94139587
94149588 // save image
9415
- if (ANIMATION && !ABORTED)
9589
+ if (Globals.ANIMATION && !ABORTED)
94169590 {
94179591 VPwidth = viewport[2];
94189592 VPheight = viewport[3];
....@@ -9523,11 +9697,11 @@
95239697
95249698 // imagecount++;
95259699
9526
- String fullname = filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
9700
+ String fullname = Globals.filename + (i%100000)/10000 + "" + (i%10000)/1000 + "" + (i%1000)/100 + "" + (i%100)/10 + "" + (i%10) + "." + ext;
95279701
95289702 if (!BOXMODE)
95299703 {
9530
- System.out.println("image: " + fullname + " (wav cursor=" + (GrafreeD.wav.cursor / 735 / 4) + ")");
9704
+ System.out.println("image: " + fullname + " (wav cursor=" + (Grafreed.wav.cursor / 735 / 4) + ")");
95319705 }
95329706
95339707 if (!BOXMODE)
....@@ -9565,7 +9739,7 @@
95659739 ABORTED = false;
95669740 }
95679741 else
9568
- GrafreeD.wav.cursor += 735 * ACSIZE;
9742
+ Grafreed.wav.cursor += 735 * ACSIZE;
95699743
95709744 if (false)
95719745 {
....@@ -10228,11 +10402,11 @@
1022810402
1022910403 public void display(GLAutoDrawable drawable)
1023010404 {
10231
- if (GrafreeD.savesound && GrafreeD.hassound)
10405
+ if (Grafreed.savesound && Grafreed.hassound)
1023210406 {
10233
- GrafreeD.wav.save();
10234
- GrafreeD.savesound = false;
10235
- GrafreeD.hassound = false;
10407
+ Grafreed.wav.save();
10408
+ Grafreed.savesound = false;
10409
+ Grafreed.hassound = false;
1023610410 }
1023710411 // if (DEBUG_SELECTION)
1023810412 // {
....@@ -10362,7 +10536,7 @@
1036210536 Object3D theobject = object;
1036310537 Object3D theparent = object.parent;
1036410538 object.parent = null;
10365
- object = (Object3D)GrafreeD.clone(object);
10539
+ object = (Object3D)Grafreed.clone(object);
1036610540 object.Stripify();
1036710541 if (theobject.selection == null || theobject.selection.Size() == 0)
1036810542 theobject.PreprocessOcclusion(this);
....@@ -10375,13 +10549,13 @@
1037510549 ambientOcclusion = false;
1037610550 }
1037710551
10378
- if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN)
10552
+ if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1037910553 {
1038010554 //if (RENDERSHADOW) // ?
1038110555 if (!IsFrozen())
1038210556 {
1038310557 // dec 2012
10384
- if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0))
10558
+ if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0))
1038510559 {
1038610560 Globals.framecount++;
1038710561 shadowbuffer.display();
....@@ -10508,8 +10682,8 @@
1050810682
1050910683 // if (parentcam != renderCamera) // not a light
1051010684 if (cam != lightCamera)
10511
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10512
- LA.matConcat(matrix, parentcam.toParent, matrix);
10685
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
10686
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
1051310687
1051410688 for (int j = 0; j < 4; j++)
1051510689 {
....@@ -10523,8 +10697,8 @@
1052310697
1052410698 // if (parentcam != renderCamera) // not a light
1052510699 if (cam != lightCamera)
10526
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10527
- LA.matConcat(parentcam.fromParent, matrix, matrix);
10700
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
10701
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
1052810702
1052910703 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
1053010704
....@@ -10783,7 +10957,16 @@
1078310957 // Bump noise
1078410958 gl.glActiveTexture(GL.GL_TEXTURE6);
1078510959 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10786
- BindTexture(NOISE_TEXTURE, false, 2);
10960
+
10961
+ try
10962
+ {
10963
+ BindTexture(NOISE_TEXTURE, false, 2);
10964
+ }
10965
+ catch (Exception e)
10966
+ {
10967
+ System.err.println("FAILED: " + NOISE_TEXTURE);
10968
+ }
10969
+
1078710970
1078810971 gl.glActiveTexture(GL.GL_TEXTURE0);
1078910972 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -10908,8 +11091,8 @@
1090811091 System.err.println("parentcam != renderCamera");
1090911092
1091011093 // if (cam != lightCamera)
10911
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10912
- LA.xformDir(lightposition, parentcam.toParent, lightposition); // may 2013
11094
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
11095
+ LA.xformDir(lightposition, parentcam.GlobalTransform(), lightposition); // may 2013
1091311096 }
1091411097
1091511098 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -10930,8 +11113,8 @@
1093011113 if (true) // TODO
1093111114 {
1093211115 if (cam != lightCamera)
10933
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10934
- LA.xformDir(light0, parentcam.toParent, light0); // may 2013
11116
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
11117
+ LA.xformDir(light0, parentcam.GlobalTransform(), light0); // may 2013
1093511118 }
1093611119
1093711120 LA.xformPos(light0, cam.toScreen, light0);
....@@ -11247,8 +11430,14 @@
1124711430 {
1124811431 renderpass++;
1124911432 // System.out.println("Draw object... ");
11433
+ STEP = 1;
1125011434 if (FAST) // in case there is no script
11251
- STEP = 16;
11435
+ STEP = 8;
11436
+
11437
+ if (CURRENTANTIALIAS == 0 || ACSIZE == 1)
11438
+ {
11439
+ STEP *= 4;
11440
+ }
1125211441
1125311442 //object.FullInvariants();
1125411443
....@@ -11262,8 +11451,8 @@
1126211451 e.printStackTrace();
1126311452 }
1126411453
11265
- if (GrafreeD.RENDERME > 0)
11266
- GrafreeD.RENDERME--; // mechante magouille
11454
+ if (Grafreed.RENDERME > 0)
11455
+ Grafreed.RENDERME--; // mechante magouille
1126711456
1126811457 Globals.ONESTEP = false;
1126911458 }
....@@ -11333,7 +11522,14 @@
1133311522
1133411523 usedtextures.clear();
1133511524
11336
- BindTextures(DEFAULT_TEXTURES, 2);
11525
+ try
11526
+ {
11527
+ BindTextures(DEFAULT_TEXTURES, 2);
11528
+ }
11529
+ catch (Exception e)
11530
+ {
11531
+ System.err.println("FAILED: " + DEFAULT_TEXTURES);
11532
+ }
1133711533 }
1133811534 //System.out.println("--> " + stackdepth);
1133911535 // GrafreeD.traceon();
....@@ -11424,7 +11620,14 @@
1142411620 if (checker != null && DrawMode() == DEFAULT)
1142511621 {
1142611622 //BindTexture(IMMORTAL_TEXTURE);
11427
- BindTextures(checker.GetTextures(), checker.texres);
11623
+ try
11624
+ {
11625
+ BindTextures(checker.GetTextures(), checker.texres);
11626
+ }
11627
+ catch (Exception e)
11628
+ {
11629
+ System.err.println("FAILED: " + checker.GetTextures());
11630
+ }
1142811631 // NEAREST
1142911632 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1143011633 DrawChecker(gl);
....@@ -11506,7 +11709,7 @@
1150611709 return;
1150711710 }
1150811711
11509
- String string = obj.GetToolTip();
11712
+ String string = obj.toString(); //.GetToolTip();
1151011713
1151111714 GL gl = GetGL();
1151211715
....@@ -11823,8 +12026,8 @@
1182312026 //obj.TransformToWorld(light, light);
1182412027 for (int i = tp.size(); --i >= 0;)
1182512028 {
11826
- for (int count = tp.get(i).GetTransformCount(); --count>=0;)
11827
- LA.xformPos(light, tp.get(i).toParent, light);
12029
+ //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
12030
+ LA.xformPos(light, tp.get(i).GlobalTransform(), light);
1182812031 }
1182912032
1183012033
....@@ -11841,8 +12044,8 @@
1184112044 parentcam = cameras[0];
1184212045 }
1184312046
11844
- for (int count = parentcam.GetTransformCount(); --count>=0;)
11845
- LA.xformPos(light, parentcam.toParent, light); // may 2013
12047
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
12048
+ LA.xformPos(light, parentcam.GlobalTransform(), light); // may 2013
1184612049
1184712050 LA.xformPos(light, renderCamera.toScreen, light);
1184812051
....@@ -12456,8 +12659,8 @@
1245612659
1245712660 // display shadow only (bump == 0)
1245812661 "SUB temp.x, half.x, shadow.x;" +
12459
- "MOV temp.y, -params6.x;" +
12460
- "SLT temp.z, temp.y, zero.x;" +
12662
+ "MOV temp.y, -params5.z;" + // params6.x;" +
12663
+ "SLT temp.z, temp.y, -one2048th.x;" +
1246112664 "SUB temp.y, one.x, temp.z;" +
1246212665 "MUL temp.x, temp.x, temp.y;" +
1246312666 "KIL temp.x;" +
....@@ -12586,8 +12789,10 @@
1258612789 "MAX ndotl.x, ndotl.x, -ndotl.x;" +
1258712790
1258812791 "SUB temp.x, one.x, ndotl.x;" +
12589
- "ADD temp.x, temp.x, options2.z;" + // lightsheen
12590
- "ADD temp.y, one.y, options2.y;" + // sursurface
12792
+ // Tuning for default skin
12793
+ //"ADD temp.x, temp.x, options2.z;" + // lightsheen
12794
+ "MAD temp.x, options2.z, half.y, temp.x;" + // lightsheen
12795
+ "ADD temp.y, one.y, options2.y;" + // subsurface
1259112796 "MUL temp.x, temp.x, temp.y;" +
1259212797
1259312798 "MUL saturation, saturation, temp.xxxx;" +
....@@ -12786,7 +12991,7 @@
1278612991 //once = true;
1278712992 }
1278812993
12789
- System.out.print("Program #" + mode + "; length = " + program.length());
12994
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1279012995 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1279112996 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1279212997
....@@ -12919,12 +13124,16 @@
1291913124
1292013125 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1292113126 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
13127
+
13128
+ // Compare fragment depth in light space with shadowmap.
1292213129 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1292313130 "SGE temp.y, temp.x, zero.x;" +
12924
- "SUB " + shadow + ".y, one.x, temp.y;" +
13131
+ "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded
13132
+
13133
+ // Reverse comparison
1292513134 "SUB temp.x, one.x, temp.x;" +
1292613135 "MUL " + shadow + ".x, temp.x, temp.y;" +
12927
- "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded
13136
+ "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse
1292813137 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1292913138
1293013139 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12938,6 +13147,10 @@
1293813147 // No shadow for backface
1293913148 "DP3 temp.x, normal, lightd;" +
1294013149 "SLT temp.x, temp.x, zero.x;" + // shadoweps
13150
+ "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
13151
+
13152
+ // No shadow when out of frustrum
13153
+ "SGE temp.x, " + depth + ".z, one.z;" +
1294113154 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1294213155 "";
1294313156 }
....@@ -13496,7 +13709,7 @@
1349613709 public void mousePressed(MouseEvent e)
1349713710 {
1349813711 //System.out.println("mousePressed: " + e);
13499
- clickStart(e.getX(), e.getY(), e.getModifiersEx());
13712
+ clickStart(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1350013713 }
1350113714
1350213715 static long prevtime = 0;
....@@ -13523,6 +13736,7 @@
1352313736
1352413737 //System.err.println("Dtime = " + Dtime + "; units = " + e.getUnitsToScroll() + "; ratio (units/ms) = " + ratio);
1352513738
13739
+ if (BUTTONLESSWHEEL)
1352613740 if (Math.abs(ratio) < 0.1 || Math.abs(Dtime) == 0) // < 30)
1352713741 {
1352813742 return;
....@@ -13531,7 +13745,7 @@
1353113745 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
1353213746
1353313747 // TIMER
13534
- if (!wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
13748
+ if (ZOOMBOXMODE && !wheeltimer.isRunning() && e.getModifiersEx() == 0 && !capsLocked) // VR
1353513749 {
1353613750 keepboxmode = BOXMODE;
1353713751 keepsupport = SUPPORT;
....@@ -13571,8 +13785,8 @@
1357113785 // mode |= META;
1357213786 //}
1357313787
13574
- SetMouseMode(WHEEL | e.getModifiersEx());
13575
- drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0);
13788
+ SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx());
13789
+ drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);
1357613790 anchorX = ax;
1357713791 anchorY = ay;
1357813792 prevX = px;
....@@ -13632,6 +13846,10 @@
1363213846 // wasliveok = true;
1363313847 // waslive = false;
1363413848
13849
+ // May 2019 Forget it:
13850
+ if (true)
13851
+ return;
13852
+
1363513853 // source == timer
1363613854 if (mouseDown)
1363713855 {
....@@ -13670,7 +13888,7 @@
1367013888
1367113889 javax.swing.Timer timer = new javax.swing.Timer(350, this);
1367213890
13673
- void clickStart(int x, int y, int modifiers)
13891
+ void clickStart(int x, int y, int modifiers, int modifiersex)
1367413892 {
1367513893 if (!wasliveok)
1367613894 return;
....@@ -13687,7 +13905,7 @@
1368713905 // touched = true; // main DL
1368813906 if (isRenderer)
1368913907 {
13690
- SetMouseMode(modifiers);
13908
+ SetMouseMode(modifiers, modifiersex);
1369113909 }
1369213910
1369313911 selectX = anchorX = x;
....@@ -13700,7 +13918,7 @@
1370013918 clicked = true;
1370113919 hold = false;
1370213920
13703
- if (((modifiers & ~1024) & ~0) == 0) // Single or multiple selection
13921
+ if (((modifiersex & ~1024) & ~0) == 0) // Single or multiple selection
1370413922 // june 2013 means CTRL_CLICK: if (((modifiers & ~1024) & ~128) == 0) // Single or multiple selection
1370513923 {
1370613924 // System.out.println("RESTART II " + modifiers);
....@@ -13731,7 +13949,7 @@
1373113949 info.camera = renderCamera;
1373213950 info.x = x;
1373313951 info.y = y;
13734
- info.modifiers = modifiers;
13952
+ info.modifiers = modifiersex;
1373513953 editObj = object.doEditClick(info, 0);
1373613954 if (!editObj)
1373713955 {
....@@ -13748,11 +13966,14 @@
1374813966
1374913967 public void mouseDragged(MouseEvent e)
1375013968 {
13969
+ Globals.MOUSEDRAGGED = true;
13970
+
13971
+ //System.out.println("mouseDragged: " + e);
1375113972 if (isRenderer)
1375213973 movingcamera = true;
13974
+
1375313975 //if (drawing)
1375413976 //return;
13755
- //System.out.println("mouseDragged: " + e);
1375613977 if ((e.getModifiersEx() & CTRL) != 0
1375713978 || (e.getModifiersEx() & COMMAND) != 0) // || IsFrozen())
1375813979 {
....@@ -13760,7 +13981,7 @@
1376013981 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1376113982 }
1376213983 else
13763
- drag(e.getX(), e.getY(), e.getModifiersEx());
13984
+ drag(e.getX(), e.getY(), e.getModifiers(), e.getModifiersEx());
1376413985
1376513986 //try { Thread.sleep(1); } catch (Exception ex) {}
1376613987 }
....@@ -13933,6 +14154,7 @@
1393314154
1393414155 public void run()
1393514156 {
14157
+ new Exception().printStackTrace();
1393614158 System.exit(0);
1393714159 for (;;)
1393814160 {
....@@ -13996,7 +14218,7 @@
1399614218 {
1399714219 Globals.lighttouched = true;
1399814220 }
13999
- drag(X, (mouseMode != 0) ? Y : anchorY, MODIFIERS);
14221
+ drag(X, (mouseMode != 0) ? Y : anchorY, 0, MODIFIERS);
1400014222 }
1400114223 //else
1400214224 }
....@@ -14096,7 +14318,7 @@
1409614318 int X, Y;
1409714319 boolean SX, SY;
1409814320
14099
- void drag(int x, int y, int modifiers)
14321
+ void drag(int x, int y, int modifiers, int modifiersex)
1410014322 {
1410114323 if (IsFrozen())
1410214324 {
....@@ -14105,17 +14327,17 @@
1410514327
1410614328 drag = true; // NEW
1410714329
14108
- boolean continuous = (modifiers & COMMAND) == COMMAND;
14330
+ boolean continuous = (modifiersex & COMMAND) == COMMAND;
1410914331
1411014332 X = x;
1411114333 Y = y;
1411214334 // floating state for animation
14113
- MODIFIERS = modifiers;
14114
- modifiers &= ~1024;
14335
+ MODIFIERS = modifiersex;
14336
+ modifiersex &= ~1024;
1411514337 if (false) // modifiers != 0)
1411614338 {
1411714339 //new Exception().printStackTrace();
14118
- System.out.println("mouseDragged: " + modifiers);
14340
+ System.out.println("mouseDragged: " + modifiersex);
1411914341 System.out.println("SHIFT = " + SHIFT);
1412014342 System.out.println("CONTROL = " + COMMAND);
1412114343 System.out.println("META = " + META);
....@@ -14135,7 +14357,7 @@
1413514357 info.camera = renderCamera;
1413614358 info.x = x;
1413714359 info.y = y;
14138
- object.editWindow.copy.doEditDrag(info);
14360
+ object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1413914361 } else
1414014362 {
1414114363 if (x < startX)
....@@ -14287,7 +14509,6 @@
1428714509 public void mouseMoved(MouseEvent e)
1428814510 {
1428914511 //System.out.println("mouseMoved: " + e);
14290
-
1429114512 if (isRenderer)
1429214513 return;
1429314514
....@@ -14312,7 +14533,10 @@
1431214533
1431314534 public void mouseReleased(MouseEvent e)
1431414535 {
14536
+ Globals.MOUSEDRAGGED = false;
14537
+
1431514538 movingcamera = false;
14539
+ X = Y = 0;
1431614540 //System.out.println("mouseReleased: " + e);
1431714541 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1431814542 }
....@@ -14335,9 +14559,9 @@
1433514559 boolean control = ((modifiers & CTRL) != 0); // june 2013: for point selection
1433614560 boolean command = ((modifiers & COMMAND) != 0); // june 2013: for multiple selection
1433714561
14338
- if (control || command || IsFrozen())
14562
+// No delay if (control || command || IsFrozen())
1433914563 timeout = true;
14340
- else
14564
+// ?? May 2019 else
1434114565 // timer.setDelay((modifiers & 128) != 0?0:350);
1434214566 mouseDown = false;
1434314567 if (!control && !command) // june 2013
....@@ -14447,7 +14671,7 @@
1444714671 System.out.println("keyReleased: " + e);
1444814672 }
1444914673
14450
- void SetMouseMode(int modifiers)
14674
+ void SetMouseMode(int modifiers, int modifiersex)
1445114675 {
1445214676 //System.out.println("SetMouseMode = " + modifiers);
1445314677 //modifiers &= ~1024;
....@@ -14459,25 +14683,25 @@
1445914683 //if (modifiers == 0) // || (modifiers == (1024 | CONTROL)))
1446014684 // return;
1446114685 //System.out.println("SetMode = " + modifiers);
14462
- if ((modifiers & WHEEL) == WHEEL)
14686
+ if ((modifiersex & WHEEL) == WHEEL)
1446314687 {
1446414688 mouseMode |= ZOOM;
1446514689 }
1446614690
1446714691 boolean capsLocked = Toolkit.getDefaultToolkit().getLockingKeyState(KeyEvent.VK_CAPS_LOCK);
14468
- if (capsLocked || (modifiers & META) == META)
14692
+ if (capsLocked) // || (modifiers & META) == META)
1446914693 {
1447014694 mouseMode |= VR; // BACKFORTH;
1447114695 }
14472
- if ((modifiers & CTRLCLICK) == CTRLCLICK)
14696
+ if ((modifiersex & CTRLCLICK) == CTRLCLICK)
1447314697 {
1447414698 mouseMode |= SELECT;
1447514699 }
14476
- if ((modifiers & COMMAND) == COMMAND)
14700
+ if ((modifiersex & COMMAND) == COMMAND)
1447714701 {
1447814702 mouseMode |= SELECT;
1447914703 }
14480
- if ((modifiers & SHIFT) == SHIFT || forcetranslate)
14704
+ if ((modifiersex & SHIFT) == SHIFT || forcetranslate || (modifiers & MouseEvent.BUTTON3_MASK) != 0)
1448114705 {
1448214706 mouseMode &= ~VR;
1448314707 mouseMode |= TRANSLATE;
....@@ -14506,7 +14730,7 @@
1450614730
1450714731 if (isRenderer) //
1450814732 {
14509
- SetMouseMode(modifiers);
14733
+ SetMouseMode(0, modifiers);
1451014734 }
1451114735
1451214736 Globals.theRenderer.keyPressed(key);
....@@ -14842,7 +15066,7 @@
1484215066 //RESIZETEXTURE ^= true;
1484315067 //break;
1484415068 case 'z':
14845
- RENDERSHADOW ^= true;
15069
+ Globals.RENDERSHADOW ^= true;
1484615070 Globals.lighttouched = true;
1484715071 repaint();
1484815072 break;
....@@ -14966,7 +15190,7 @@
1496615190 //mode = ROTATE;
1496715191 if ((MODIFIERS & COMMAND) == 0) // VR??
1496815192 {
14969
- SetMouseMode(modifiers);
15193
+ SetMouseMode(0, modifiers);
1497015194 }
1497115195 }
1497215196
....@@ -15100,8 +15324,9 @@
1510015324
1510115325 protected void processMouseMotionEvent(MouseEvent e)
1510215326 {
15103
- //System.out.println("processMouseMotionEvent: " + mouseMode);
15104
- if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15327
+ //System.out.println("processMouseMotionEvent: " + mouseMode + " " + e.getModifiers() + " " + e.getModifiersEx() + " " + e.getButton());
15328
+ //if (e.getButton() == MouseEvent.NOBUTTON && (mouseMode & SELECT) == 0)
15329
+ if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) == 0 && (e.getModifiers() & MouseEvent.BUTTON3_MASK) == 0 && (mouseMode & SELECT) == 0)
1510515330 {
1510615331 mouseMoved(e);
1510715332 } else
....@@ -15131,6 +15356,7 @@
1513115356
1513215357 void SelectParent()
1513315358 {
15359
+ new Exception().printStackTrace();
1513415360 System.exit(0);
1513515361 Composite group = (Composite) object;
1513615362 java.util.Vector selectees = new java.util.Vector(group.selection);
....@@ -15154,6 +15380,7 @@
1515415380
1515515381 void SelectChildren()
1515615382 {
15383
+ new Exception().printStackTrace();
1515715384 System.exit(0);
1515815385 /*
1515915386 Composite group = (Composite) object;
....@@ -15318,7 +15545,9 @@
1531815545 info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1531915546 //Image img = CreateImage(width, height);
1532015547 //System.out.println("width = " + width + "; height = " + height + "\n");
15548
+
1532115549 Graphics gr = g; // img.getGraphics();
15550
+
1532215551 if (!hasMarquee)
1532315552 {
1532415553 if (Xmin < Xmax) // !locked)
....@@ -15416,14 +15645,33 @@
1541615645 if (!isRenderer)
1541715646 {
1541815647 object.drawEditHandles(info, 0);
15648
+
15649
+ if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15650
+ {
15651
+ switch (object.selection.get(0).hitSomething)
15652
+ {
15653
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15654
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15655
+ break;
15656
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15657
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15658
+ break;
15659
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15660
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15661
+ break;
15662
+ }
15663
+
15664
+ }
1541915665 }
1542015666 }
15667
+
1542115668 if (isRenderer)
1542215669 {
1542315670 //gr.setColor(Color.black);
1542415671 //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1);
1542515672 //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3);
1542615673 }
15674
+
1542715675 if (hasMarquee)
1542815676 {
1542915677 gr.setXORMode(Color.white);
....@@ -15536,6 +15784,7 @@
1553615784 public boolean mouseDown(Event evt, int x, int y)
1553715785 {
1553815786 System.out.println("mouseDown: " + evt);
15787
+ System.exit(0);
1553915788 /*
1554015789 locked = true;
1554115790 drag = false;
....@@ -15579,7 +15828,7 @@
1557915828 {
1558015829 keyPressed(0, modifiers);
1558115830 }
15582
- clickStart(x, y, modifiers);
15831
+ // clickStart(x, y, modifiers);
1558315832 return true;
1558415833 }
1558515834
....@@ -15697,7 +15946,7 @@
1569715946 {
1569815947 keyReleased(0, 0);
1569915948 }
15700
- drag(x, y, modifiers);
15949
+ drag(x, y, 0, modifiers);
1570115950 return true;
1570215951 }
1570315952
....@@ -15829,7 +16078,7 @@
1582916078 Object3D object;
1583016079 static Object3D trackedobject;
1583116080 Camera renderCamera; // Light or Eye (or Occlusion)
15832
- /*static*/ Camera manipCamera; // Light or Eye
16081
+ /*static*/ Camera manipCamera; // Light or Eye. Can be Light when Eye, not Eye when Light
1583316082 /*static*/ Camera eyeCamera;
1583416083 /*static*/ Camera lightCamera;
1583516084 int cameracount;
....@@ -16267,6 +16516,7 @@
1626716516 {
1626816517 if (!selection)
1626916518 {
16519
+ new Exception().printStackTrace();
1627016520 System.exit(0);
1627116521 return;
1627216522 }
....@@ -16394,16 +16644,16 @@
1639416644 System.out.println("; fromto " + sel + " " + Trunk(previousselectedpoint.toParent[3][0]) + " " + Trunk(previousselectedpoint.toParent[3][2]) + " " + Trunk(selectedpoint.toParent[3][0]) + " " + Trunk(selectedpoint.toParent[3][2]));
1639516645 }
1639616646
16397
- previousselectedpoint = (Sphere) GrafreeD.clone(selectedpoint);
16647
+ previousselectedpoint = (Sphere) Grafreed.clone(selectedpoint);
1639816648 }
1639916649 }
1640016650
1640116651 if (!movingcamera && !PAINTMODE)
1640216652 object.editWindow.ScreenFitPoint(); // fev 2014
1640316653
16404
- if (PAINTMODE && GrafreeD.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
16654
+ if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1640516655 {
16406
- Object3D paintobj = GrafreeD.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
16656
+ Object3D paintobj = Grafreed.clipboard.get(0); // object.editWindow.copy.selection.elementAt(0);
1640716657
1640816658 Object3D group = new Object3D("inst" + paintcount++);
1640916659
....@@ -16559,7 +16809,7 @@
1655916809 gl.glDisable(gl.GL_CULL_FACE);
1656016810 }
1656116811
16562
- if (!RENDERSHADOW)
16812
+ if (!Globals.RENDERSHADOW)
1656316813 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1656416814
1656516815 // SB gl.glPolygonOffset(2.5f, 10);
....@@ -16569,7 +16819,7 @@
1656916819 //gl.glColorMask(false, false, false, false);
1657016820
1657116821 //render_scene_from_light_view(gl, drawable, 0, 0);
16572
- if (RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16822
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1657316823 {
1657416824 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1657516825