Normand Briere
2019-07-07 46dbce888e7c3eff8969f1ddbe22e144410b67f4
CameraPane.java
....@@ -37,7 +37,6 @@
3737 static boolean[] selectedstack = new boolean[65536];
3838 static int materialdepth = 0;
3939
40
- static boolean DEBUG = false;
4140 static boolean FRUSTUM = false; // still bogus true; // frustum culling
4241
4342 // camera change fix
....@@ -327,7 +326,7 @@
327326 cStatic.objectstack[materialdepth++] = obj;
328327 //System.out.println("material " + material);
329328 //Applet3D.tracein(this, selected);
330
- display.vector2buffer = obj.projectedVertices;
329
+ //display.vector2buffer = obj.projectedVertices;
331330 if (obj instanceof Camera)
332331 {
333332 display.options1[0] = material.shift;
....@@ -336,14 +335,28 @@
336335 display.options1[2] = material.shadowbias;
337336 display.options1[3] = material.aniso;
338337 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]);
339343 display.options2[0] = material.opacity;
340344 display.options2[1] = material.diffuse;
341345 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]);
342349
343350 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]);
344354 display.options4[0] = material.cameralight/0.2f;
345355 display.options4[1] = material.subsurface;
346356 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]);
347360
348361 // if (display.CURRENTANTIALIAS > 0)
349362 // display.options3[3] /= 4;
....@@ -359,7 +372,7 @@
359372 /**/
360373 } else
361374 {
362
- DrawMaterial(material, selected);
375
+ DrawMaterial(material, selected, obj.projectedVertices);
363376 }
364377 } else
365378 {
....@@ -383,8 +396,8 @@
383396 cStatic.objectstack[materialdepth++] = obj;
384397 //System.out.println("material " + material);
385398 //Applet3D.tracein("selected ", selected);
386
- display.vector2buffer = obj.projectedVertices;
387
- display.DrawMaterial(material, selected);
399
+ //display.vector2buffer = obj.projectedVertices;
400
+ display.DrawMaterial(material, selected, obj.projectedVertices);
388401 }
389402 }
390403
....@@ -401,8 +414,8 @@
401414 materialdepth -= 1;
402415 if (materialdepth > 0)
403416 {
404
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
405
- 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);
406419 }
407420 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
408421 } else if (selected && CameraPane.flash && obj.GetMaterial() != null)
....@@ -422,8 +435,8 @@
422435 materialdepth -= 1;
423436 if (materialdepth > 0)
424437 {
425
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
426
- 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);
427440 }
428441 //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
429442 //else
....@@ -1611,7 +1624,7 @@
16111624 // gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
16121625 }
16131626
1614
- void DrawMaterial(cMaterial material, boolean selected)
1627
+ void DrawMaterial(cMaterial material, boolean selected, Object3D.cVector2[] others)
16151628 {
16161629 CameraPane display = this;
16171630 //new Exception().printStackTrace();
....@@ -1646,7 +1659,7 @@
16461659 colorV[0] = display.modelParams0[0] * material.diffuse;
16471660 colorV[1] = display.modelParams0[1] * material.diffuse;
16481661 colorV[2] = display.modelParams0[2] * material.diffuse;
1649
- colorV[3] = material.opacity;
1662
+ colorV[3] = 1; // material.opacity;
16501663
16511664 gl.glColor4f(colorV[0], colorV[1], colorV[2], material.opacity);
16521665 //System.out.println("Opacity = " + opacity);
....@@ -1754,9 +1767,9 @@
17541767 display.modelParams7[2] = 0;
17551768 display.modelParams7[3] = 0;
17561769
1757
- display.modelParams6[0] = 100; // criss de bug de bump
1770
+ //display.modelParams6[0] = 100; // criss de bug de bump
17581771
1759
- Object3D.cVector2[] extparams = display.vector2buffer;
1772
+ Object3D.cVector2[] extparams = others; // display.vector2buffer;
17601773 if (extparams != null && extparams.length > 0 && extparams[0] != null)
17611774 {
17621775 display.modelParams6[0] = extparams[0].x / 1000.0f; // bump
....@@ -2052,7 +2065,7 @@
20522065 //System.err.println("Oeil on");
20532066 OEIL = true;
20542067 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
2055
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
2068
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
20562069 //pingthread.StepToTarget(true);
20572070 }
20582071
....@@ -2267,7 +2280,7 @@
22672280
22682281 void ToggleDebug()
22692282 {
2270
- DEBUG ^= true;
2283
+ Globals.DEBUG ^= true;
22712284 }
22722285
22732286 void ToggleLookAt()
....@@ -9367,11 +9380,35 @@
93679380 jy8[3] = 0.5f;
93689381 }
93699382
9370
- 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
93719384 float[] options2 = new float[]{0, 1, 0, 0}; // fog density, intensity, elevation
93729385 float[] options3 = new float[]{1, 1, 1, 0}; // fog color
93739386 float[] options4 = new float[]{1, 0, 1, 0}; // image intensity, subsurface, lightsheen
93749387
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
+
93759412 static int imagecount = 0; // movie generation
93769413
93779414 static int jitter = 0;
....@@ -10482,6 +10519,7 @@
1048210519 ANTIALIAS = 0;
1048310520 //System.out.println("RESTART");
1048410521 AAtimer.restart();
10522
+ Globals.TIMERRUNNING = true;
1048510523 }
1048610524 }
1048710525 }
....@@ -10549,7 +10587,8 @@
1054910587 ambientOcclusion = false;
1055010588 }
1055110589
10552
- if (Globals.lighttouched && DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
10590
+ if (//Globals.lighttouched &&
10591
+ DrawMode() == DEFAULT) // && !lightMode) // && !FROZEN)
1055310592 {
1055410593 //if (RENDERSHADOW) // ?
1055510594 if (!IsFrozen())
....@@ -11459,15 +11498,36 @@
1145911498
1146011499 static boolean zoomonce = false;
1146111500
11501
+ static void CreateSelectedPoint()
11502
+ {
11503
+ if (selectedpoint == null)
11504
+ {
11505
+ debugpointG = new Sphere();
11506
+ debugpointP = new Sphere();
11507
+ debugpointC = new Sphere();
11508
+ debugpointR = new Sphere();
11509
+
11510
+ selectedpoint = new Superellipsoid();
11511
+
11512
+ for (int i=0; i<8; i++)
11513
+ {
11514
+ debugpoints[i] = new Sphere();
11515
+ }
11516
+ }
11517
+ }
11518
+
1146211519 void DrawObject(GL gl, boolean draw)
1146311520 {
11521
+ // To clear camera values
11522
+ ResetOptions();
11523
+
1146411524 //System.out.println("DRAW OBJECT " + mouseDown);
1146511525 // DrawMode() = SELECTION;
1146611526 //GL gl = getGL();
1146711527 if ((TRACK || SHADOWTRACK) || zoomonce)
1146811528 {
1146911529 if ((TRACK || SHADOWTRACK) && trackedobject != null && DrawMode() == SHADOW) // && !lightMode)
11470
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
11530
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1147111531 pingthread.StepToTarget(true); // true);
1147211532 // zoomonce = false;
1147311533 }
....@@ -11539,8 +11599,9 @@
1153911599
1154011600 if (DrawMode() == DEFAULT)
1154111601 {
11542
- if (DEBUG)
11602
+ if (Globals.DEBUG)
1154311603 {
11604
+ CreateSelectedPoint();
1154411605 float radius = 0.05f;
1154511606 if (selectedpoint.radius != radius)
1154611607 {
....@@ -12027,7 +12088,7 @@
1202712088 for (int i = tp.size(); --i >= 0;)
1202812089 {
1202912090 //for (int count = tp.get(i).GetTransformCount(); --count>=0;)
12030
- LA.xformPos(light, tp.get(i).GlobalTransform(), light);
12091
+ LA.xformPos(light, tp.get(i).GlobalTransformInv(), light);
1203112092 }
1203212093
1203312094
....@@ -13297,7 +13358,8 @@
1329713358 /*static*/ float[] modelParams5 = new float[]{0, 0, 0, 0}; // texture, opacity, fakedepth, shadowbias
1329813359 /*static*/ float[] modelParams6 = new float[]{0, 0, 0, 0}; // bump, noise, borderfade, fog punchthrough
1329913360 /*static*/ float[] modelParams7 = new float[]{0, 0, 0, 0}; // noise power, opacity power
13300
- Object3D.cVector2[] vector2buffer;
13361
+
13362
+ //Object3D.cVector2[] vector2buffer;
1330113363
1330213364 // IN : ndotl, ndoth, xxx, NdotL //, snininess, lightarea
1330313365 // OUT : diff, spec
....@@ -13313,9 +13375,10 @@
1331313375 "DP3 " + dest + ".z," + "normals," + "eye;" +
1331413376 "MAX " + dest + ".w," + dest + ".z," + "eps.x;" +
1331513377 //"MOV " + dest + ".w," + "normal.z;" +
13316
- "MUL " + dest + ".z," + "params2.w," + dest + ".x;" +
13317
- "MUL " + dest + ".z," + dest + ".z," + dest + ".x;" +
13318
- //"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
1331913382 "POW " + dest + ".w," + dest + ".w," + dest + ".z;" +
1332013383 "RCP " + dest + ".w," + dest + ".w;" +
1332113384 //"RSQ " + dest + ".w," + dest + ".w;" +
....@@ -13820,6 +13883,7 @@
1382013883 else
1382113884 if (evt.getSource() == AAtimer)
1382213885 {
13886
+ Globals.TIMERRUNNING = false;
1382313887 if (mouseDown)
1382413888 {
1382513889 //new Exception().printStackTrace();
....@@ -13879,7 +13943,7 @@
1387913943
1388013944 // fev 2014???
1388113945 if ((TRACK || SHADOWTRACK) && trackedobject != null) // && DrawMode() == SHADOW) // && !lightMode)
13882
- object.editWindow.ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
13946
+ object.GetWindow().ScreenFit(trackedobject, SHADOWTRACK && !TRACK);
1388313947 pingthread.StepToTarget(true); // true);
1388413948 }
1388513949 // if (!LIVE)
....@@ -13894,6 +13958,7 @@
1389413958 return;
1389513959
1389613960 AAtimer.restart(); //
13961
+ Globals.TIMERRUNNING = true;
1389713962
1389813963 // waslive = LIVE;
1389913964 // LIVE = false;
....@@ -14357,7 +14422,8 @@
1435714422 info.camera = renderCamera;
1435814423 info.x = x;
1435914424 info.y = y;
14360
- object.editWindow.copy.doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
14425
+ object.GetWindow().copy
14426
+ .doEditDrag(info, (modifiers & MouseEvent.BUTTON3_MASK) != 0);
1436114427 } else
1436214428 {
1436314429 if (x < startX)
....@@ -14521,7 +14587,9 @@
1452114587 ci.camera = renderCamera;
1452214588 if (!isRenderer)
1452314589 {
14524
- if (object.editWindow.copy.doEditClick(ci, 0))
14590
+ //ObjEditor editWindow = object.editWindow;
14591
+ //Object3D copy = editWindow.copy;
14592
+ if (object.doEditClick(ci, 0))
1452514593 {
1452614594 setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
1452714595 } else
....@@ -14536,7 +14604,8 @@
1453614604 Globals.MOUSEDRAGGED = false;
1453714605
1453814606 movingcamera = false;
14539
- X = Y = 0;
14607
+ X = 0; // getBounds().width/2;
14608
+ Y = 0; // getBounds().height/2;
1454014609 //System.out.println("mouseReleased: " + e);
1454114610 clickEnd(e.getX(), e.getY(), e.getModifiersEx());
1454214611 }
....@@ -14902,8 +14971,14 @@
1490214971 RevertCamera();
1490314972 repaint();
1490414973 break;
14905
- case 'L':
1490614974 case 'l':
14975
+ lightMode ^= true;
14976
+ Globals.lighttouched = true;
14977
+ manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
14978
+ targetLookAt.set(manipCamera.lookAt);
14979
+ repaint();
14980
+ break;
14981
+ case 'L':
1490714982 if (lightMode)
1490814983 {
1490914984 lightMode = false;
....@@ -15046,20 +15121,18 @@
1504615121 case '_':
1504715122 kompactbit = 5;
1504815123 break;
15049
- case '+':
15050
- kompactbit = 6;
15051
- break;
15124
+// case '+':
15125
+// kompactbit = 6;
15126
+// break;
1505215127 case ' ':
15053
- lightMode ^= true;
15054
- Globals.lighttouched = true;
15055
- manipCamera = renderCamera = lightMode ? lightCamera : eyeCamera;
15056
- targetLookAt.set(manipCamera.lookAt);
15128
+ ObjEditor.theFrame.ToggleFullScreen();
1505715129 repaint();
1505815130 break;
1505915131 //case '`' :
1506015132 case ESC:
1506115133 RENDERPROGRAM += 1;
1506215134 RENDERPROGRAM %= 3;
15135
+
1506315136 repaint();
1506415137 break;
1506515138 case 'Z':
....@@ -15099,8 +15172,9 @@
1509915172 case DELETE:
1510015173 ClearSelection();
1510115174 break;
15102
- /*
1510315175 case '+':
15176
+
15177
+ /*
1510415178 //fontsize += 1;
1510515179 bbzoom *= 2;
1510615180 repaint();
....@@ -15117,17 +15191,17 @@
1511715191 case '=':
1511815192 IncDepth();
1511915193 //fontsize += 1;
15120
- object.editWindow.refreshContents(true);
15194
+ object.GetWindow().refreshContents(true);
1512115195 maskbit = 6;
1512215196 break;
1512315197 case '-': //if (PixelThreshold>1) PixelThreshold /= 2;
1512415198 DecDepth();
1512515199 maskbit = 5;
1512615200 //if(fontsize > 1) fontsize -= 1;
15127
- if (object.editWindow == null)
15128
- new Exception().printStackTrace();
15129
- else
15130
- object.editWindow.refreshContents(true);
15201
+// if (object.editWindow == null)
15202
+// new Exception().printStackTrace();
15203
+// else
15204
+ object.GetWindow().refreshContents(true);
1513115205 break;
1513215206 case '{':
1513315207 manipCamera.shaper_fovy /= 1.1;
....@@ -15351,7 +15425,7 @@
1535115425 }
1535215426 */
1535315427
15354
- object.editWindow.EditSelection();
15428
+ object.GetWindow().EditSelection(false);
1535515429 }
1535615430
1535715431 void SelectParent()
....@@ -15368,10 +15442,10 @@
1536815442 {
1536915443 //selectees.remove(i);
1537015444 System.out.println("select parent of " + elem);
15371
- group.editWindow.Select(elem.parent.GetTreePath(), first, true);
15445
+ group.GetWindow().Select(elem.parent.GetTreePath(), first, true);
1537215446 } else
1537315447 {
15374
- group.editWindow.Select(elem.GetTreePath(), first, true);
15448
+ group.GetWindow().Select(elem.GetTreePath(), first, true);
1537515449 }
1537615450
1537715451 first = false;
....@@ -15413,12 +15487,12 @@
1541315487 for (int j = 0; j < group.children.size(); j++)
1541415488 {
1541515489 elem = (Object3D) group.children.elementAt(j);
15416
- object.editWindow.Select(elem.GetTreePath(), first, true);
15490
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1541715491 first = false;
1541815492 }
1541915493 } else
1542015494 {
15421
- object.editWindow.Select(elem.GetTreePath(), first, true);
15495
+ object.GetWindow().Select(elem.GetTreePath(), first, true);
1542215496 }
1542315497
1542415498 first = false;
....@@ -15429,21 +15503,21 @@
1542915503 {
1543015504 //Composite group = (Composite) object;
1543115505 Object3D group = object;
15432
- group.editWindow.loadClipboard(true); // ClearSelection(false);
15506
+ group.GetWindow().loadClipboard(true); // ClearSelection(false);
1543315507 }
1543415508
1543515509 void ResetTransform(int mask)
1543615510 {
1543715511 //Composite group = (Composite) object;
1543815512 Object3D group = object;
15439
- group.editWindow.ResetTransform(mask);
15513
+ group.GetWindow().ResetTransform(mask);
1544015514 }
1544115515
1544215516 void FlipTransform()
1544315517 {
1544415518 //Composite group = (Composite) object;
1544515519 Object3D group = object;
15446
- group.editWindow.FlipTransform();
15520
+ group.GetWindow().FlipTransform();
1544715521 // group.editWindow.ReduceMesh(true);
1544815522 }
1544915523
....@@ -15451,7 +15525,7 @@
1545115525 {
1545215526 //Composite group = (Composite) object;
1545315527 Object3D group = object;
15454
- group.editWindow.PrintMemory();
15528
+ group.GetWindow().PrintMemory();
1545515529 // group.editWindow.ReduceMesh(true);
1545615530 }
1545715531
....@@ -15459,7 +15533,7 @@
1545915533 {
1546015534 //Composite group = (Composite) object;
1546115535 Object3D group = object;
15462
- group.editWindow.ResetCentroid();
15536
+ group.GetWindow().ResetCentroid();
1546315537 }
1546415538
1546515539 void IncDepth()
....@@ -15644,23 +15718,42 @@
1564415718 */
1564515719 if (!isRenderer)
1564615720 {
15647
- object.drawEditHandles(info, 0);
15648
-
15649
- if (drag && (X != 0 || Y != 0) && object.selection.Size() > 0)
15721
+ if (object.selection.Size() > 0)
1565015722 {
15651
- switch (object.selection.get(0).hitSomething)
15723
+ int hitSomething = object.selection.get(0).hitSomething;
15724
+
15725
+ info.DX = 0;
15726
+ info.DY = 0;
15727
+ info.W = 1;
15728
+ if (hitSomething == Object3D.hitCenter)
1565215729 {
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;
15730
+ info.DX = X;
15731
+ if (X != 0)
15732
+ info.DX -= info.bounds.width/2;
15733
+
15734
+ info.DY = Y;
15735
+ if (Y != 0)
15736
+ info.DY -= info.bounds.height/2;
1566215737 }
15663
-
15738
+
15739
+ object.drawEditHandles(info, 0);
15740
+
15741
+ if (drag && (X != 0 || Y != 0))
15742
+ {
15743
+ switch (hitSomething)
15744
+ {
15745
+ case Object3D.hitCenter: gr.setColor(Color.pink);
15746
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15747
+ break;
15748
+ case Object3D.hitRotate: gr.setColor(Color.yellow);
15749
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15750
+ break;
15751
+ case Object3D.hitScale: gr.setColor(Color.cyan);
15752
+ gr.drawLine(X, Y, info.bounds.width/2, info.bounds.height/2);
15753
+ break;
15754
+ }
15755
+
15756
+ }
1566415757 }
1566515758 }
1566615759 }
....@@ -16363,16 +16456,16 @@
1636316456 cStatic.objectstack[materialdepth++] = checker;
1636416457 //System.out.println("material " + material);
1636516458 //Applet3D.tracein(this, selected);
16366
- vector2buffer = checker.projectedVertices;
16459
+ //vector2buffer = checker.projectedVertices;
1636716460
1636816461 //checker.GetMaterial().Draw(this, false); // true);
16369
- DrawMaterial(checker.GetMaterial(), false); // true);
16462
+ DrawMaterial(checker.GetMaterial(), false, checker.projectedVertices); // true);
1637016463
1637116464 materialdepth -= 1;
1637216465 if (materialdepth > 0)
1637316466 {
16374
- vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16375
- DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1]);
16467
+ //vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
16468
+ DrawMaterial(materialstack[materialdepth - 1], selectedstack[materialdepth - 1], cStatic.objectstack[materialdepth - 1].projectedVertices);
1637616469 }
1637716470 //checker.GetMaterial().opacity = 1f;
1637816471 ////checker.GetMaterial().ambient = 1f;
....@@ -16596,6 +16689,8 @@
1659616689 // System.err.println("view = " + view[8] + " " + view[9] + " " + view[10] + " " + view[11]);
1659716690 // System.err.println("view = " + view[12] + " " + view[13] + " " + view[14] + " " + view[15]);
1659816691
16692
+ CreateSelectedPoint();
16693
+
1659916694 // Will fit the mesh !!!
1660016695 selectedpoint.toParent[0][0] = 0.0001;
1660116696 selectedpoint.toParent[1][1] = 0.0001;
....@@ -16649,7 +16744,7 @@
1664916744 }
1665016745
1665116746 if (!movingcamera && !PAINTMODE)
16652
- object.editWindow.ScreenFitPoint(); // fev 2014
16747
+ object.GetWindow().ScreenFitPoint(); // fev 2014
1665316748
1665416749 if (PAINTMODE && Grafreed.clipboard.size() == 1) // object.editWindow.copy.selection.Size() > 0)
1665516750 {
....@@ -16661,17 +16756,17 @@
1666116756
1666216757 group.add(paintobj); // link
1666316758
16664
- object.editWindow.SnapObject(group);
16759
+ object.GetWindow().SnapObject(group);
1666516760
16666
- Object3D folder = object.editWindow.copy;
16761
+ Object3D folder = object.GetWindow().copy;
1666716762
16668
- if (object.editWindow.copy.selection.Size() > 0)
16669
- folder = object.editWindow.copy.selection.elementAt(0);
16763
+ if (object.GetWindow().copy.selection.Size() > 0)
16764
+ folder = object.GetWindow().copy.selection.elementAt(0);
1667016765
1667116766 folder.add(group);
1667216767
16673
- object.editWindow.ResetModel();
16674
- object.editWindow.refreshContents();
16768
+ object.GetWindow().ResetModel();
16769
+ object.GetWindow().refreshContents();
1667516770 }
1667616771 else
1667716772 paintcount = 0;
....@@ -16710,6 +16805,11 @@
1671016805 //System.out.println("objects[color] = " + objects[color]);
1671116806 //objects[color].Select();
1671216807 indexcount = 0;
16808
+ ObjEditor window = object.GetWindow();
16809
+ if (window != null && deselect)
16810
+ {
16811
+ window.Select(null, deselect, true);
16812
+ }
1671316813 object.Select(color, deselect);
1671416814 }
1671516815
....@@ -17235,23 +17335,15 @@
1723517335 int AAbuffersize = 0;
1723617336
1723717337 //double[] selectedpoint = new double[3];
17238
- static Superellipsoid selectedpoint = new Superellipsoid();
17338
+ static Superellipsoid selectedpoint;
1723917339 static Sphere previousselectedpoint = null;
17240
- static Sphere debugpointG = new Sphere();
17241
- static Sphere debugpointP = new Sphere();
17242
- static Sphere debugpointC = new Sphere();
17243
- static Sphere debugpointR = new Sphere();
17340
+ static Sphere debugpointG;
17341
+ static Sphere debugpointP;
17342
+ static Sphere debugpointC;
17343
+ static Sphere debugpointR;
1724417344
1724517345 static Sphere debugpoints[] = new Sphere[8];
1724617346
17247
- static
17248
- {
17249
- for (int i=0; i<8; i++)
17250
- {
17251
- debugpoints[i] = new Sphere();
17252
- }
17253
- }
17254
-
1725517347 static void InitPoints(float radius)
1725617348 {
1725717349 for (int i=0; i<8; i++)