Normand Briere
2019-07-18 d7a17c35c443e2cb6c09eaa3cfeaf590a571faa1
CameraPane.java
....@@ -326,7 +326,7 @@
326326 cStatic.objectstack[materialdepth++] = obj;
327327 //System.out.println("material " + material);
328328 //Applet3D.tracein(this, selected);
329
- display.vector2buffer = obj.projectedVertices;
329
+ //display.vector2buffer = obj.projectedVertices;
330330 if (obj instanceof Camera)
331331 {
332332 display.options1[0] = material.shift;
....@@ -335,14 +335,28 @@
335335 display.options1[2] = material.shadowbias;
336336 display.options1[3] = material.aniso;
337337 display.options1[4] = material.anisoV;
338
+// System.out.println("display.options1[0] " + display.options1[0]);
339
+// System.out.println("display.options1[1] " + display.options1[1]);
340
+// System.out.println("display.options1[2] " + display.options1[2]);
341
+// System.out.println("display.options1[3] " + display.options1[3]);
342
+// System.out.println("display.options1[4] " + display.options1[4]);
338343 display.options2[0] = material.opacity;
339344 display.options2[1] = material.diffuse;
340345 display.options2[2] = material.factor;
346
+// System.out.println("display.options2[0] " + display.options2[0]);
347
+// System.out.println("display.options2[1] " + display.options2[1]);
348
+// System.out.println("display.options2[2] " + display.options2[2]);
341349
342350 cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
351
+// System.out.println("display.options3[0] " + display.options3[0]);
352
+// System.out.println("display.options3[1] " + display.options3[1]);
353
+// System.out.println("display.options3[2] " + display.options3[2]);
343354 display.options4[0] = material.cameralight/0.2f;
344355 display.options4[1] = material.subsurface;
345356 display.options4[2] = material.sheen;
357
+// System.out.println("display.options4[0] " + display.options4[0]);
358
+// System.out.println("display.options4[1] " + display.options4[1]);
359
+// System.out.println("display.options4[2] " + display.options4[2]);
346360
347361 // if (display.CURRENTANTIALIAS > 0)
348362 // display.options3[3] /= 4;
....@@ -358,7 +372,7 @@
358372 /**/
359373 } else
360374 {
361
- DrawMaterial(material, selected);
375
+ DrawMaterial(material, selected, obj.projectedVertices);
362376 }
363377 } else
364378 {
....@@ -382,8 +396,8 @@
382396 cStatic.objectstack[materialdepth++] = obj;
383397 //System.out.println("material " + material);
384398 //Applet3D.tracein("selected ", selected);
385
- display.vector2buffer = obj.projectedVertices;
386
- display.DrawMaterial(material, selected);
399
+ //display.vector2buffer = obj.projectedVertices;
400
+ display.DrawMaterial(material, selected, obj.projectedVertices);
387401 }
388402 }
389403
....@@ -400,8 +414,8 @@
400414 materialdepth -= 1;
401415 if (materialdepth > 0)
402416 {
403
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
404
- display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
417
+ //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
418
+ display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
405419 }
406420 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
407421 } else if (selected && CameraPane.flash && obj.GetMaterial() != null)
....@@ -421,8 +435,8 @@
421435 materialdepth -= 1;
422436 if (materialdepth > 0)
423437 {
424
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
425
- display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
438
+ //display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
439
+ display.DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
426440 }
427441 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
428442 //else
....@@ -1610,7 +1624,7 @@
16101624 // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
16111625 }
16121626
1613
- void DrawMaterial(cMaterial material, boolean selected)
1627
+ void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others)
16141628 {
16151629 CameraPane display = this;
16161630 //new Exception().printStackTrace();
....@@ -1645,7 +1659,7 @@
16451659 colorV[0] = display.modelParams0[0] * material.diffuse;
16461660 colorV[1] = display.modelParams0[1] * material.diffuse;
16471661 colorV[2] = display.modelParams0[2] * material.diffuse;
1648
- colorV[3] = material.opacity;
1662
+ colorV[3] = 1; // material.opacity;
16491663
16501664 gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity);
16511665 //System.out.println("Opacity = " + opacity);
....@@ -1753,9 +1767,9 @@
17531767 display.modelParams7[2] = 0;
17541768 display.modelParams7[3] = 0;
17551769
1756
- display.modelParams6[0] = 100; // criss de bug de bump
1770
+ //display.modelParams6[0] = 100; // criss de bug de bump
17571771
1758
- Object3D.cVector2[] extparams = display.vector2buffer;
1772
+ Object3D.cVector2[] extparams = others; // display.vector2buffer;
17591773 if (extparams != null && extparams.length > 0 && extparams[0] != null)
17601774 {
17611775 display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
....@@ -2051,7 +2065,7 @@
20512065 //System.err.println("Oeil on");
20522066 OEIL = true;
20532067 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
2054
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
2068
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
20552069 //pingthread.StepToTarget(true);
20562070 }
20572071
....@@ -9366,11 +9380,35 @@
93669380 jy8[3] = 0.5f;
93679381 }
93689382
9369
- float[] options1 = new float[]{1000, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
9383
+ float[] options1 = new float[]{100, 0.00001f, 20, 0, 0}; // focus, aperture, Shadow blur, aniso, anisoV
93709384 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
93719385 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
93729386 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
93739387
9388
+ void ResetOptions()
9389
+ {
9390
+ options1[0] = 100;
9391
+ options1[1] = 0.025f;
9392
+ options1[2] = 0.01f;
9393
+ options1[3] = 0;
9394
+ options1[4] = 0;
9395
+
9396
+ options2[0] = 0;
9397
+ options2[1] = 0.75f;
9398
+ options2[2] = 0;
9399
+ options2[3] = 0;
9400
+
9401
+ options3[0] = 1;
9402
+ options3[1] = 1;
9403
+ options3[2] = 1;
9404
+ options3[3] = 0;
9405
+
9406
+ options4[0] = 1;
9407
+ options4[1] = 0;
9408
+ options4[2] = 1;
9409
+ options4[3] = 0;
9410
+ }
9411
+
93749412 static int imagecount = 0; // movie generation
93759413
93769414 static int jitter = 0;
....@@ -10481,6 +10519,7 @@
1048110519 ANTIALIAS = 0;
1048210520 //System.out.println("RESTART");
1048310521 AAtimer.restart();
10522
+ Globals.TIMERRUNNING = true;
1048410523 }
1048510524 }
1048610525 }
....@@ -10548,7 +10587,8 @@
1054810587 ambientOcclusion = false;
1054910588 }
1055010589
10551
- if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
10590
+ if (//Globals.lighttouched &&
10591
+ DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1055210592 {
1055310593 //if (RENDERSHADOW) // ?
1055410594 if (!IsFrozen())
....@@ -10988,9 +11028,9 @@
1098811028
1098911029 gl.glMatrixMode(GL.GL_MODELVIEW);
1099011030
10991
-//gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
10992
-//gl.glEnable(gl.GL_POLYGON_SMOOTH);
10993
-//gl.glEnable(gl.GL_MULTISAMPLE);
11031
+gl.glEnable(gl.GL_POLYGON_SMOOTH);
11032
+gl.glHint(gl.GL_POLYGON_SMOOTH_HINT, gl.GL_NICEST);
11033
+gl.glEnable(gl.GL_MULTISAMPLE);
1099411034 } else
1099511035 {
1099611036 //gl.glDisable(GL.GL_TEXTURE_2D);
....@@ -11001,7 +11041,7 @@
1100111041 //System.out.println("BLENDING ON");
1100211042 gl.glEnable(GL.GL_BLEND);
1100311043 gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
11004
-
11044
+// gl.glBlendFunc(GL.GL_SRC_ALPHA_SATURATE, GL.GL_ONE);
1100511045 gl.glMatrixMode(gl.GL_PROJECTION);
1100611046 gl.glLoadIdentity();
1100711047
....@@ -11458,7 +11498,7 @@
1145811498
1145911499 static boolean zoomonce = false;
1146011500
11461
- void CreateSelectedPoint()
11501
+ static void CreateSelectedPoint()
1146211502 {
1146311503 if (selectedpoint == null)
1146411504 {
....@@ -11478,13 +11518,16 @@
1147811518
1147911519 void DrawObject(GL gl, boolean draw)
1148011520 {
11521
+ // To clear camera values
11522
+ ResetOptions();
11523
+
1148111524 //System.out.println("DRAW OBJECT " + mouseDown);
1148211525 // DrawMode() = SELECTION;
1148311526 //GL gl = getGL();
1148411527 if ((TRACK || SHADOWTRACK) || zoomonce)
1148511528 {
1148611529 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
11487
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11530
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1148811531 pingthread.StepToTarget(true); // true);
1148911532 // zoomonce = false;
1149011533 }
....@@ -12045,7 +12088,7 @@
1204512088 for (int i = tp.size(); --i >= 0;)
1204612089 {
1204712090 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
12048
- LA.xformPos(light, tp.get(i).GlobalTransform(), light);
12091
+ LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
1204912092 }
1205012093
1205112094
....@@ -13315,7 +13358,8 @@
1331513358 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias
1331613359 /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough
1331713360 /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power
13318
- Object3D.cVector2[] vector2buffer;
13361
+
13362
+ //Object3D.cVector2[] vector2buffer;
1331913363
1332013364 // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea
1332113365 // OUT : diff, spec
....@@ -13331,9 +13375,10 @@
1333113375 "DP3 " + dest + ".z," + "normals," + "eye;" +
1333213376 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1333313377 //"MOV " + dest + ".w," + "normal.z;" +
13334
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13335
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13336
- //"MOV " + dest + ".z," + "params2.w;" +
13378
+// "MUL " + dest + ".z," + "params2.w," + dest + ".x;" + // PRETTY HEURISTIC FOR VELVET
13379
+// "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13380
+
13381
+ "MOV " + dest + ".z," + "params2.w;" + // EXACT
1333713382 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1333813383 "RCP " + dest + ".w," + dest + ".w;" +
1333913384 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -13838,6 +13883,7 @@
1383813883 else
1383913884 if (evt.getSource() == AAtimer)
1384013885 {
13886
+ Globals.TIMERRUNNING = false;
1384113887 if (mouseDown)
1384213888 {
1384313889 //new Exception().printStackTrace();
....@@ -13897,7 +13943,7 @@
1389713943
1389813944 // fev 2014???
1389913945 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
13900
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
13946
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1390113947 pingthread.StepToTarget(true); // true);
1390213948 }
1390313949 // if (!LIVE)
....@@ -13912,6 +13958,7 @@
1391213958 return;
1391313959
1391413960 AAtimer.restart(); //
13961
+ Globals.TIMERRUNNING = true;
1391513962
1391613963 // waslive = LIVE;
1391713964 // LIVE = false;
....@@ -14250,12 +14297,12 @@
1425014297 void GoDown(int mod)
1425114298 {
1425214299 MODIFIERS |= COMMAND;
14253
- /*
14300
+ /**/
1425414301 if((mod&SHIFT) == SHIFT)
1425514302 manipCamera.RotatePosition(0, -speed);
1425614303 else
14257
- manipCamera.BackForth(0, -speed*delta, getWidth());
14258
- */
14304
+ manipCamera.BackForth(0, -speed*delta, 0); // getWidth());
14305
+ /**/
1425914306 if ((mod & SHIFT) == SHIFT)
1426014307 {
1426114308 mouseMode = mouseMode; // VR??
....@@ -14271,12 +14318,12 @@
1427114318 void GoUp(int mod)
1427214319 {
1427314320 MODIFIERS |= COMMAND;
14274
- /*
14321
+ /**/
1427514322 if((mod&SHIFT) == SHIFT)
1427614323 manipCamera.RotatePosition(0, speed);
1427714324 else
14278
- manipCamera.BackForth(0, speed*delta, getWidth());
14279
- */
14325
+ manipCamera.BackForth(0, speed*delta, 0); // getWidth());
14326
+ /**/
1428014327 if ((mod & SHIFT) == SHIFT)
1428114328 {
1428214329 mouseMode = mouseMode;
....@@ -14292,12 +14339,12 @@
1429214339 void GoLeft(int mod)
1429314340 {
1429414341 MODIFIERS |= COMMAND;
14295
- /*
14342
+ /**/
1429614343 if((mod&SHIFT) == SHIFT)
14297
- manipCamera.RotatePosition(speed, 0);
14298
- else
1429914344 manipCamera.Translate(speed*delta, 0, getWidth());
14300
- */
14345
+ else
14346
+ manipCamera.RotatePosition(speed, 0);
14347
+ /**/
1430114348 if ((mod & SHIFT) == SHIFT)
1430214349 {
1430314350 mouseMode = mouseMode;
....@@ -14313,12 +14360,12 @@
1431314360 void GoRight(int mod)
1431414361 {
1431514362 MODIFIERS |= COMMAND;
14316
- /*
14363
+ /**/
1431714364 if((mod&SHIFT) == SHIFT)
14318
- manipCamera.RotatePosition(-speed, 0);
14319
- else
1432014365 manipCamera.Translate(-speed*delta, 0, getWidth());
14321
- */
14366
+ else
14367
+ manipCamera.RotatePosition(-speed, 0);
14368
+ /**/
1432214369 if ((mod & SHIFT) == SHIFT)
1432314370 {
1432414371 mouseMode = mouseMode;
....@@ -14375,7 +14422,8 @@
1437514422 info.camera = renderCamera;
1437614423 info.x = x;
1437714424 info.y = y;
14378
- object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14425
+ object.GetWindow().copy
14426
+ .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1437914427 } else
1438014428 {
1438114429 if (x < startX)
....@@ -14539,7 +14587,9 @@
1453914587 ci.camera = renderCamera;
1454014588 if (!isRenderer)
1454114589 {
14542
- if (object.editWindow.copy.doEditClick(ci, 0))
14590
+ //ObjEditor editWindow = object.editWindow;
14591
+ //Object3D copy = editWindow.copy;
14592
+ if (object.doEditClick(ci, 0))
1454314593 {
1454414594 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1454514595 } else
....@@ -14554,7 +14604,8 @@
1455414604 Globals.MOUSEDRAGGED = false;
1455514605
1455614606 movingcamera = false;
14557
- X = Y = 0;
14607
+ X = 0; // getBounds().width/2;
14608
+ Y = 0; // getBounds().height/2;
1455814609 //System.out.println("mouseReleased: " + e);
1455914610 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1456014611 }
....@@ -14895,7 +14946,9 @@
1489514946 case 'E' : COMPACT ^= true;
1489614947 repaint();
1489714948 break;
14898
- case 'W' : DEBUGHSB ^= true;
14949
+ case 'W' : // Wide Window (fullscreen)
14950
+ //DEBUGHSB ^= true;
14951
+ ObjEditor.theFrame.ToggleFullScreen();
1489914952 repaint();
1490014953 break;
1490114954 case 'u' : Udebug ^= true; Vdebug = false; NORMALdebug = false; programInitialized = false; repaint(); break;
....@@ -14921,13 +14974,7 @@
1492114974 repaint();
1492214975 break;
1492314976 case 'l':
14924
- lightMode ^= true;
14925
- Globals.lighttouched = true;
14926
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14927
- targetLookAt.set(manipCamera.lookAt);
14928
- repaint();
14929
- break;
14930
- case 'L':
14977
+ //case 'L':
1493114978 if (lightMode)
1493214979 {
1493314980 lightMode = false;
....@@ -15070,11 +15117,14 @@
1507015117 case '_':
1507115118 kompactbit = 5;
1507215119 break;
15073
- case '+':
15074
- kompactbit = 6;
15075
- break;
15120
+// case '+':
15121
+// kompactbit = 6;
15122
+// break;
1507615123 case ' ':
15077
- ObjEditor.theFrame.ToggleFullScreen();
15124
+ lightMode ^= true;
15125
+ Globals.lighttouched = true;
15126
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15127
+ targetLookAt.set(manipCamera.lookAt);
1507815128 repaint();
1507915129 break;
1508015130 //case '`' :
....@@ -15121,8 +15171,9 @@
1512115171 case DELETE:
1512215172 ClearSelection();
1512315173 break;
15124
- /*
1512515174 case '+':
15175
+
15176
+ /*
1512615177 //fontsize += 1;
1512715178 bbzoom *= 2;
1512815179 repaint();
....@@ -15139,17 +15190,17 @@
1513915190 case '=':
1514015191 IncDepth();
1514115192 //fontsize += 1;
15142
- object.editWindow.refreshContents(true);
15193
+ object.GetWindow().refreshContents(true);
1514315194 maskbit = 6;
1514415195 break;
1514515196 case '-': //if (PixelThreshold>1) PixelThreshold /= 2;
1514615197 DecDepth();
1514715198 maskbit = 5;
1514815199 //if(fontsize > 1) fontsize -= 1;
15149
- if (object.editWindow == null)
15150
- new Exception().printStackTrace();
15151
- else
15152
- object.editWindow.refreshContents(true);
15200
+// if (object.editWindow == null)
15201
+// new Exception().printStackTrace();
15202
+// else
15203
+ object.GetWindow().refreshContents(true);
1515315204 break;
1515415205 case '{':
1515515206 manipCamera.shaper_fovy /= 1.1;
....@@ -15373,7 +15424,7 @@
1537315424 }
1537415425 */
1537515426
15376
- object.editWindow.EditSelection();
15427
+ object.GetWindow().EditSelection(false);
1537715428 }
1537815429
1537915430 void SelectParent()
....@@ -15390,10 +15441,10 @@
1539015441 {
1539115442 //selectees.remove(i);
1539215443 System.out.println("select parent of " + elem);
15393
- group.editWindow.Select(elem.parent.GetTreePath(), first, true);
15444
+ group.GetWindow().Select(elem.parent.GetTreePath(), first, true);
1539415445 } else
1539515446 {
15396
- group.editWindow.Select(elem.GetTreePath(), first, true);
15447
+ group.GetWindow().Select(elem.GetTreePath(), first, true);
1539715448 }
1539815449
1539915450 first = false;
....@@ -15435,12 +15486,12 @@
1543515486 for (int j = 0; j < group.children.size(); j++)
1543615487 {
1543715488 elem = (Object3D) group.children.elementAt(j);
15438
- object.editWindow.Select(elem.GetTreePath(), first, true);
15489
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1543915490 first = false;
1544015491 }
1544115492 } else
1544215493 {
15443
- object.editWindow.Select(elem.GetTreePath(), first, true);
15494
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1544415495 }
1544515496
1544615497 first = false;
....@@ -15451,21 +15502,21 @@
1545115502 {
1545215503 //Composite group = (Composite) object;
1545315504 Object3D group = object;
15454
- group.editWindow.loadClipboard(true); // ClearSelection(false);
15505
+ group.GetWindow().loadClipboard(true); // ClearSelection(false);
1545515506 }
1545615507
1545715508 void ResetTransform(int mask)
1545815509 {
1545915510 //Composite group = (Composite) object;
1546015511 Object3D group = object;
15461
- group.editWindow.ResetTransform(mask);
15512
+ group.GetWindow().ResetTransform(mask);
1546215513 }
1546315514
1546415515 void FlipTransform()
1546515516 {
1546615517 //Composite group = (Composite) object;
1546715518 Object3D group = object;
15468
- group.editWindow.FlipTransform();
15519
+ group.GetWindow().FlipTransform();
1546915520 // group.editWindow.ReduceMesh(true);
1547015521 }
1547115522
....@@ -15473,7 +15524,7 @@
1547315524 {
1547415525 //Composite group = (Composite) object;
1547515526 Object3D group = object;
15476
- group.editWindow.PrintMemory();
15527
+ group.GetWindow().PrintMemory();
1547715528 // group.editWindow.ReduceMesh(true);
1547815529 }
1547915530
....@@ -15481,7 +15532,7 @@
1548115532 {
1548215533 //Composite group = (Composite) object;
1548315534 Object3D group = object;
15484
- group.editWindow.ResetCentroid();
15535
+ group.GetWindow().ResetCentroid();
1548515536 }
1548615537
1548715538 void IncDepth()
....@@ -15657,6 +15708,7 @@
1565715708 info.bounds.y += (height - desired) / 2;
1565815709 }
1565915710 }
15711
+
1566015712 info.g = gr;
1566115713 info.camera = renderCamera;
1566215714 /*
....@@ -15666,23 +15718,44 @@
1566615718 */
1566715719 if (!isRenderer)
1566815720 {
15669
- object.drawEditHandles(info, 0);
15670
-
15671
- if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15721
+ Grafreed.Assert(object != null);
15722
+ Grafreed.Assert(object.selection != null);
15723
+ if (object.selection.Size() > 0)
1567215724 {
15673
- switch (object.selection.get(0).hitSomething)
15725
+ int hitSomething = object.selection.get(0).hitSomething;
15726
+
15727
+ info.DX = 0;
15728
+ info.DY = 0;
15729
+ info.W = 1;
15730
+ if (hitSomething == Object3D.hitCenter)
1567415731 {
15675
- case Object3D.hitCenter: gr.setColor(Color.pink);
15676
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15677
- break;
15678
- case Object3D.hitRotate: gr.setColor(Color.yellow);
15679
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15680
- break;
15681
- case Object3D.hitScale: gr.setColor(Color.cyan);
15682
- gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15683
- break;
15732
+ info.DX = X;
15733
+ if (X != 0)
15734
+ info.DX -= info.bounds.width/2;
15735
+
15736
+ info.DY = Y;
15737
+ if (Y != 0)
15738
+ info.DY -= info.bounds.height/2;
1568415739 }
15685
-
15740
+
15741
+ object.drawEditHandles(info, 0);
15742
+
15743
+ if (drag && (X != 0 || Y != 0))
15744
+ {
15745
+ switch (hitSomething)
15746
+ {
15747
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15748
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15749
+ break;
15750
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15751
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15752
+ break;
15753
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15754
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15755
+ break;
15756
+ }
15757
+
15758
+ }
1568615759 }
1568715760 }
1568815761 }
....@@ -16385,16 +16458,16 @@
1638516458 cStatic.objectstack[materialdepth++] = checker;
1638616459 //System.out.println("material " + material);
1638716460 //Applet3D.tracein(this, selected);
16388
- vector2buffer = checker.projectedVertices;
16461
+ //vector2buffer = checker.projectedVertices;
1638916462
1639016463 //checker.GetMaterial().Draw(this, false); // true);
16391
- DrawMaterial(checker.GetMaterial(), false); // true);
16464
+ DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true);
1639216465
1639316466 materialdepth -= 1;
1639416467 if (materialdepth > 0)
1639516468 {
16396
- vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16397
- DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
16469
+ //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16470
+ DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
1639816471 }
1639916472 //checker.GetMaterial().opacity = 1f;
1640016473 ////checker.GetMaterial().ambient = 1f;
....@@ -16618,6 +16691,8 @@
1661816691 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1661916692 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
1662016693
16694
+ CreateSelectedPoint();
16695
+
1662116696 // Will fit the mesh !!!
1662216697 selectedpoint.toParent[0][0] = 0.0001;
1662316698 selectedpoint.toParent[1][1] = 0.0001;
....@@ -16671,7 +16746,7 @@
1667116746 }
1667216747
1667316748 if (!movingcamera && !PAINTMODE)
16674
- object.editWindow.ScreenFitPoint(); // fev 2014
16749
+ object.GetWindow().ScreenFitPoint(); // fev 2014
1667516750
1667616751 if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1667716752 {
....@@ -16683,17 +16758,17 @@
1668316758
1668416759 group.add(paintobj); // link
1668516760
16686
- object.editWindow.SnapObject(group);
16761
+ object.GetWindow().SnapObject(group);
1668716762
16688
- Object3D folder = object.editWindow.copy;
16763
+ Object3D folder = object.GetWindow().copy;
1668916764
16690
- if (object.editWindow.copy.selection.Size() > 0)
16691
- folder = object.editWindow.copy.selection.elementAt(0);
16765
+ if (object.GetWindow().copy.selection.Size() > 0)
16766
+ folder = object.GetWindow().copy.selection.elementAt(0);
1669216767
1669316768 folder.add(group);
1669416769
16695
- object.editWindow.ResetModel();
16696
- object.editWindow.refreshContents();
16770
+ object.GetWindow().ResetModel();
16771
+ object.GetWindow().refreshContents();
1669716772 }
1669816773 else
1669916774 paintcount = 0;
....@@ -16732,6 +16807,11 @@
1673216807 //System.out.println("objects[color] = " + objects[color]);
1673316808 //objects[color].Select();
1673416809 indexcount = 0;
16810
+ ObjEditor window = object.GetWindow();
16811
+ if (window != null && deselect)
16812
+ {
16813
+ window.Select(null, deselect, true);
16814
+ }
1673516815 object.Select(color, deselect);
1673616816 }
1673716817