Normand Briere
2019-06-21 15123b19e7bc8da2869429b07f0fbaa0598e945e
CameraPane.java
....@@ -150,6 +150,8 @@
150150 defaultcaps.setAccumAlphaBits(16);
151151 }
152152
153
+ private File defaultDirectory = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory();
154
+
153155 void SetAsGLRenderer(boolean b)
154156 {
155157 isRenderer = b;
....@@ -462,10 +464,12 @@
462464 if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0)
463465 {
464466 //gl.glBegin(gl.GL_TRIANGLES);
465
- 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
+ ;
466470 if (!hasnorm)
467471 {
468
- // System.out.println("FUCK!!");
472
+ // System.out.println("Mesh normal");
469473 LA.vecSub(pv/*.pos*/, qv/*.pos*/, obj.v0);
470474 LA.vecSub(pv/*.pos*/, rv/*.pos*/, obj.v1);
471475 LA.vecCross(obj.v0, obj.v1, obj.v2);
....@@ -1190,10 +1194,12 @@
11901194 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
11911195 }
11921196 }
1197
+
11931198 if (flipV)
11941199 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
11951200 else
11961201 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1202
+
11971203 //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
11981204 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
11991205
....@@ -1213,10 +1219,12 @@
12131219 gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
12141220 }
12151221 }
1222
+
12161223 if (flipV)
12171224 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12181225 else
12191226 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1227
+
12201228 //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
12211229 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
12221230
....@@ -1244,8 +1252,10 @@
12441252 gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
12451253 else
12461254 gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
1255
+
12471256 //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
12481257 gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
1258
+
12491259 count2 += 2;
12501260 count3 += 3;
12511261 }
....@@ -1888,7 +1898,7 @@
18881898 void PushMatrix(double[][] matrix)
18891899 {
18901900 // GrafreeD.tracein(matrix);
1891
- PushMatrix(matrix,1);
1901
+ PushMatrix(matrix, 1);
18921902 }
18931903
18941904 void PushMatrix()
....@@ -2265,7 +2275,7 @@
22652275 LOOKAT ^= true;
22662276 }
22672277
2268
- void ToggleRandom()
2278
+ void ToggleSwitch()
22692279 {
22702280 SWITCH ^= true;
22712281 }
....@@ -2374,7 +2384,7 @@
23742384 {
23752385 return currentGL;
23762386 }
2377
-
2387
+
23782388 /**/
23792389 class CacheTexture
23802390 {
....@@ -7919,6 +7929,64 @@
79197929 ReleaseTexture(pigment, false);
79207930 }
79217931
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
+
79227990 void ReleaseTexture(String tex, boolean bump)
79237991 {
79247992 if (// DrawMode() != 0 || /*tex == null ||*/
....@@ -8022,7 +8090,7 @@
80228090 }
80238091 }
80248092
8025
- /*boolean*/ public void BindTextures(cTexture tex, int resolution) // INTERFACE
8093
+ /*boolean*/ public void BindTextures(cTexture tex, int resolution) throws Exception // INTERFACE
80268094 {
80278095 if (// DrawMode() != 0 || /*tex == null ||*/
80288096 ambientOcclusion ) // || !textureon)
....@@ -8067,7 +8135,94 @@
80678135 return; // true;
80688136 }
80698137
8070
- 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
80718226 {
80728227 CacheTexture/*com.sun.opengl.util.texture.Texture*/ texture = null;
80738228
....@@ -8075,15 +8230,17 @@
80758230 {
80768231 String texname = tex;
80778232
8233
+ String fallbackTextureName = defaultDirectory + "/Textures/" + texname;
8234
+
80788235 // String[] split = tex.split("Textures");
80798236 // if (split.length > 1)
80808237 // texname = "/Users/nbriere/Textures" + split[split.length-1];
80818238 // else
80828239 // if (!texname.startsWith("/"))
80838240 // texname = "/Users/nbriere/Textures/" + texname;
8084
- if (!new File(tex).exists())
8241
+ if (!FileExists(tex))
80858242 {
8086
- texname = javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory() + "/Textures/" + texname;
8243
+ texname = fallbackTextureName;
80878244 }
80888245
80898246 if (CACHETEXTURE)
....@@ -8153,7 +8310,7 @@
81538310 }
81548311
81558312 cachename = texname.substring(0, texname.length()-4)+ext+".jpg";
8156
- if (!new File(cachename).exists())
8313
+ if (!FileExists(cachename))
81578314 cachename = texname;
81588315 else
81598316 processbump = false; // don't process bump map again
....@@ -8175,7 +8332,7 @@
81758332 }
81768333
81778334 cachename = texname.substring(0, texname.length()-4)+ext+".png";
8178
- if (!new File(cachename).exists())
8335
+ if (!FileExists(cachename))
81798336 cachename = texname;
81808337 else
81818338 processbump = false; // don't process bump map again
....@@ -8184,7 +8341,9 @@
81848341 texturedata = GetFileTexture(cachename, processbump, resolution);
81858342
81868343
8187
- if (texturedata != null)
8344
+ if (texturedata == null)
8345
+ throw new Exception();
8346
+
81888347 texture = new CacheTexture(com.sun.opengl.util.texture.TextureIO.newTexture(texturedata),resolution);
81898348 //texture = GetTexture(tex, bump);
81908349 }
....@@ -8306,7 +8465,7 @@
83068465 return texture;
83078466 }
83088467
8309
- 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
83108469 {
83118470 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83128471
....@@ -8324,14 +8483,14 @@
83248483 return texture!=null?texture.texture:null;
83258484 }
83268485
8327
- 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
83288487 {
83298488 CacheTexture texture = GetCacheTexture(tex, bump, resolution);
83308489
83318490 return texture!=null?texture.texturedata:null;
83328491 }
83338492
8334
- boolean BindTexture(String tex, boolean bump, int resolution)
8493
+ boolean BindTexture(String tex, boolean bump, int resolution) throws Exception
83358494 {
83368495 if (/*tex == null ||*/ ambientOcclusion ) // || !textureon)
83378496 {
....@@ -9308,8 +9467,8 @@
93089467 assert (parentcam != renderCamera);
93099468
93109469 if (renderCamera != lightCamera)
9311
- for (int count = parentcam.GetTransformCount(); --count>=0;)
9312
- LA.matConcat(matrix, parentcam.toParent, matrix);
9470
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
9471
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
93139472
93149473 // LA.matConcat(renderCamera.toScreen, renderCamera.toParent, matrix);
93159474
....@@ -9324,8 +9483,8 @@
93249483 LA.matCopy(renderCamera.fromScreen, matrix);
93259484
93269485 if (renderCamera != lightCamera)
9327
- for (int count = parentcam.GetTransformCount(); --count>=0;)
9328
- LA.matConcat(parentcam.fromParent, matrix, matrix);
9486
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
9487
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
93299488
93309489 // LA.matConcat(renderCamera.fromParent, renderCamera.fromScreen, matrix);
93319490
....@@ -10390,13 +10549,13 @@
1039010549 ambientOcclusion = false;
1039110550 }
1039210551
10393
- if (Globals.lighttouched && DrawMode() == DEFAULT && !lightMode) // && !FROZEN)
10552
+ if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1039410553 {
1039510554 //if (RENDERSHADOW) // ?
1039610555 if (!IsFrozen())
1039710556 {
1039810557 // dec 2012
10399
- if (!ambientOcclusion && !(!flash && !lightMode && DrawMode() == DEFAULT && ANTIALIAS > 0))
10558
+ if (!ambientOcclusion && !(!flash && DrawMode() == DEFAULT && ANTIALIAS > 0))
1040010559 {
1040110560 Globals.framecount++;
1040210561 shadowbuffer.display();
....@@ -10523,8 +10682,8 @@
1052310682
1052410683 // if (parentcam != renderCamera) // not a light
1052510684 if (cam != lightCamera)
10526
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10527
- LA.matConcat(matrix, parentcam.toParent, matrix);
10685
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
10686
+ LA.matConcat(matrix, parentcam.GlobalTransform(), matrix);
1052810687
1052910688 for (int j = 0; j < 4; j++)
1053010689 {
....@@ -10538,8 +10697,8 @@
1053810697
1053910698 // if (parentcam != renderCamera) // not a light
1054010699 if (cam != lightCamera)
10541
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10542
- LA.matConcat(parentcam.fromParent, matrix, matrix);
10700
+ //for (int count = parentcam.GetTransformCount(); --count>=0;)
10701
+ LA.matConcat(parentcam.GlobalTransformInv(), matrix, matrix);
1054310702
1054410703 //LA.matConcat(cam.fromScreen, parentcam.fromParent, matrix);
1054510704
....@@ -10798,7 +10957,16 @@
1079810957 // Bump noise
1079910958 gl.glActiveTexture(GL.GL_TEXTURE6);
1080010959 //gl.glBindTexture(GL.GL_TEXTURE_2D, bump_noise);
10801
- 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
+
1080210970
1080310971 gl.glActiveTexture(GL.GL_TEXTURE0);
1080410972 gl.glEnable(GL.GL_TEXTURE_2D);
....@@ -10923,8 +11091,8 @@
1092311091 System.err.println("parentcam != renderCamera");
1092411092
1092511093 // if (cam != lightCamera)
10926
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10927
- 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
1092811096 }
1092911097
1093011098 LA.xformDir(lightposition, cam.toScreen, lightposition);
....@@ -10945,8 +11113,8 @@
1094511113 if (true) // TODO
1094611114 {
1094711115 if (cam != lightCamera)
10948
- for (int count = parentcam.GetTransformCount(); --count>=0;)
10949
- 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
1095011118 }
1095111119
1095211120 LA.xformPos(light0, cam.toScreen, light0);
....@@ -11354,7 +11522,14 @@
1135411522
1135511523 usedtextures.clear();
1135611524
11357
- 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
+ }
1135811533 }
1135911534 //System.out.println("--> " + stackdepth);
1136011535 // GrafreeD.traceon();
....@@ -11445,7 +11620,14 @@
1144511620 if (checker != null && DrawMode() == DEFAULT)
1144611621 {
1144711622 //BindTexture(IMMORTAL_TEXTURE);
11448
- 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
+ }
1144911631 // NEAREST
1145011632 GetGL().glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST); // GL.GL_LINEAR);
1145111633 DrawChecker(gl);
....@@ -11527,7 +11709,7 @@
1152711709 return;
1152811710 }
1152911711
11530
- String string = obj.GetToolTip();
11712
+ String string = obj.toString(); //.GetToolTip();
1153111713
1153211714 GL gl = GetGL();
1153311715
....@@ -11844,8 +12026,8 @@
1184412026 //obj.TransformToWorld(light, light);
1184512027 for (int i = tp.size(); --i >= 0;)
1184612028 {
11847
- for (int count = tp.get(i).GetTransformCount(); --count>=0;)
11848
- 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);
1184912031 }
1185012032
1185112033
....@@ -11862,8 +12044,8 @@
1186212044 parentcam = cameras[0];
1186312045 }
1186412046
11865
- for (int count = parentcam.GetTransformCount(); --count>=0;)
11866
- 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
1186712049
1186812050 LA.xformPos(light, renderCamera.toScreen, light);
1186912051
....@@ -12477,8 +12659,8 @@
1247712659
1247812660 // display shadow only (bump == 0)
1247912661 "SUB temp.x, half.x, shadow.x;" +
12480
- "MOV temp.y, -params6.x;" +
12481
- "SLT temp.z, temp.y, zero.x;" +
12662
+ "MOV temp.y, -params5.z;" + // params6.x;" +
12663
+ "SLT temp.z, temp.y, -one2048th.x;" +
1248212664 "SUB temp.y, one.x, temp.z;" +
1248312665 "MUL temp.x, temp.x, temp.y;" +
1248412666 "KIL temp.x;" +
....@@ -12809,7 +12991,7 @@
1280912991 //once = true;
1281012992 }
1281112993
12812
- System.out.print("Program #" + mode + "; length = " + program.length());
12994
+ System.out.print("Program #" + mode + "; instructions = " + program.split(";").length + "; length = " + program.length());
1281312995 System.out.println(" - " + (mode >> 3) + " lights; " + ((mode & 2) == 2 ? "anisoUV " : "") + ((mode & 4) == 4 ? "SoftShadow " : ""));
1281412996 loadProgram(gl, GL.GL_FRAGMENT_PROGRAM_ARB, program);
1281512997
....@@ -12942,12 +13124,16 @@
1294213124
1294313125 "ADD " + depth + ".z, " + depth + ".z, temp.x;" +
1294413126 //"SUB " + depth + ".z, " + depth + ".z, temp.x;" + // back face shadowing!
13127
+
13128
+ // Compare fragment depth in light space with shadowmap.
1294513129 "SUB temp.x, fragment.texcoord[1].z, " + depth + ".z;" +
1294613130 "SGE temp.y, temp.x, zero.x;" +
12947
- "SUB " + shadow + ".y, one.x, temp.y;" +
13131
+ "SUB " + shadow + ".y, one.x, temp.y;" + // Specular is fully occluded
13132
+
13133
+ // Reverse comparison
1294813134 "SUB temp.x, one.x, temp.x;" +
1294913135 "MUL " + shadow + ".x, temp.x, temp.y;" +
12950
- "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // specular is fully occluded
13136
+ "SUB " + shadow + ".x, one.x, " + shadow + ".x;" + // diffuse
1295113137 "POW " + shadow + ".x, " + shadow + ".x, params5.z;" + // fake depth
1295213138
1295313139 "SLT " + shadow + ".z, fragment.texcoord[1].z, " + depth + ".z;" +
....@@ -12961,6 +13147,10 @@
1296113147 // No shadow for backface
1296213148 "DP3 temp.x, normal, lightd;" +
1296313149 "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;" +
1296413154 "LRP " + shadow + ", temp.x, one, " + shadow + ";" +
1296513155 "";
1296613156 }
....@@ -13776,9 +13966,12 @@
1377613966
1377713967 public void mouseDragged(MouseEvent e)
1377813968 {
13969
+ Globals.MOUSEDRAGGED = true;
13970
+
1377913971 //System.out.println("mouseDragged: " + e);
1378013972 if (isRenderer)
1378113973 movingcamera = true;
13974
+
1378213975 //if (drawing)
1378313976 //return;
1378413977 if ((e.getModifiersEx() & CTRL) != 0
....@@ -14340,7 +14533,10 @@
1434014533
1434114534 public void mouseReleased(MouseEvent e)
1434214535 {
14536
+ Globals.MOUSEDRAGGED = false;
14537
+
1434314538 movingcamera = false;
14539
+ X = Y = 0;
1434414540 //System.out.println("mouseReleased: " + e);
1434514541 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1434614542 }
....@@ -15349,7 +15545,9 @@
1534915545 info.bounds.setBounds(0, 0, (int) (width * zoom), (int) (height * zoom));
1535015546 //Image img = CreateImage(width, height);
1535115547 //System.out.println("width = " + width + "; height = " + height + "\n");
15548
+
1535215549 Graphics gr = g; // img.getGraphics();
15550
+
1535315551 if (!hasMarquee)
1535415552 {
1535515553 if (Xmin < Xmax) // !locked)
....@@ -15447,14 +15645,33 @@
1544715645 if (!isRenderer)
1544815646 {
1544915647 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
+ }
1545015665 }
1545115666 }
15667
+
1545215668 if (isRenderer)
1545315669 {
1545415670 //gr.setColor(Color.black);
1545515671 //gr.drawRect(info.bounds.x - 1, info.bounds.y - 1, info.bounds.width + 1, info.bounds.height + 1);
1545615672 //gr.drawRect(info.bounds.x - 2, info.bounds.y - 2, info.bounds.width + 3, info.bounds.height + 3);
1545715673 }
15674
+
1545815675 if (hasMarquee)
1545915676 {
1546015677 gr.setXORMode(Color.white);
....@@ -15861,7 +16078,7 @@
1586116078 Object3D object;
1586216079 static Object3D trackedobject;
1586316080 Camera renderCamera; // Light or Eye (or Occlusion)
15864
- /*static*/ Camera manipCamera; // Light or Eye
16081
+ /*static*/ Camera manipCamera; // Light or Eye. Can be Light when Eye, not Eye when Light
1586516082 /*static*/ Camera eyeCamera;
1586616083 /*static*/ Camera lightCamera;
1586716084 int cameracount;
....@@ -16602,7 +16819,7 @@
1660216819 //gl.glColorMask(false, false, false, false);
1660316820
1660416821 //render_scene_from_light_view(gl, drawable, 0, 0);
16605
- if (Globals.RENDERSHADOW && Globals.lighttouched && !movingcamera) // && !parent.IsFreezed())
16822
+ if (Globals.RENDERSHADOW && Globals.lighttouched && (!movingcamera || !Globals.FREEZEONMOVE)) // && !parent.IsFreezed())
1660616823 {
1660716824 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
1660816825