Normand Briere
2019-06-09 8558ae86e65457c512a26339d3660d79eee16ae6
Object3D.java
....@@ -5,6 +5,7 @@
55 import java.util.Vector;
66
77 import javax.media.j3d.Transform3D;
8
+import javax.media.opengl.GL;
89 import javax.vecmath.Vector3d;
910
1011 import javax.imageio.ImageIO;
....@@ -13,13 +14,30 @@
1314 import //weka.core.
1415 matrix.Matrix;
1516
17
+import java.util.UUID;
18
+
1619 //import net.sourceforge.sizeof.SizeOf;
1720 public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D>
1821 {
1922 //static final long serialVersionUID = -607422624994562685L;
2023 static final long serialVersionUID = 5022536242724664900L;
2124
25
+ private UUID uuid = UUID.randomUUID();
26
+
2227 ScriptNode scriptnode;
28
+
29
+ void InitOthers()
30
+ {
31
+ if (projectedVertices == null || projectedVertices.length <= 2)
32
+ {
33
+ projectedVertices = new Object3D.cVector2[3];
34
+ }
35
+ for (int i = 0; i < 3; i++)
36
+ {
37
+ projectedVertices[i] = new cVector2(); // Others
38
+ }
39
+ projectedVertices[0].x = 100; // bump
40
+ }
2341
2442 void MinMax(cVector minima, cVector maxima)
2543 {
....@@ -285,8 +303,8 @@
285303 return parent.GetName() + "#";
286304 }
287305
288
- boolean timeline = false;
289306 boolean live = false;
307
+ boolean dontselect = false;
290308 boolean hide = false;
291309 boolean link2master = false; // performs reset support/master at each frame
292310 boolean marked = false; // animation node
....@@ -296,6 +314,8 @@
296314 boolean random = false;
297315 boolean speedup = false;
298316 boolean rewind = false;
317
+
318
+ float NORMALPUSH = 0;
299319
300320 Object3D support;
301321
....@@ -416,16 +436,16 @@
416436 {
417437 Object3D copy = this;
418438
419
- Camera parentcam = CameraPane.theRenderer.manipCamera;
439
+ Camera parentcam = Globals.theRenderer.ManipCamera();
420440
421
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[0])
441
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0])
422442 {
423
- parentcam = CameraPane.theRenderer.cameras[1];
443
+ parentcam = Globals.theRenderer.Cameras()[1];
424444 }
425445
426
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[1])
446
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1])
427447 {
428
- parentcam = CameraPane.theRenderer.cameras[0];
448
+ parentcam = Globals.theRenderer.Cameras()[0];
429449 }
430450
431451 if (this == parentcam)
....@@ -433,7 +453,7 @@
433453 //assert(this instanceof Camera);
434454
435455 for (int count = parentcam.GetTransformCount(); --count>=0;)
436
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.toParent, CameraPane.theRenderer.targetLookAt);
456
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt());
437457 }
438458
439459 copy.marked ^= true;
....@@ -453,7 +473,7 @@
453473 //assert(this instanceof Camera);
454474
455475 for (int count = parentcam.GetTransformCount(); --count>=0;)
456
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.fromParent, CameraPane.theRenderer.targetLookAt);
476
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt());
457477 }
458478
459479 copy.Touch(); // display list issue
....@@ -588,7 +608,7 @@
588608 return;
589609 }
590610
591
- if (CameraPane.fromscript)
611
+ if (Globals.fromscript)
592612 {
593613 transformcount = 0;
594614 return;
....@@ -746,7 +766,7 @@
746766
747767 int GetTransformCount()
748768 {
749
- // marde pour serialization de Texture
769
+ // patch pour serialization de Texture
750770 resetmaxcount();
751771 resettransformcount();
752772 resetstep();
....@@ -759,7 +779,7 @@
759779 if (step == 0)
760780 step = 1;
761781 if (maxcount == 0)
762
- maxcount = 2048; // 4;
782
+ maxcount = 128; // 2048; // 4;
763783 // if (acceleration == 0)
764784 // acceleration = 10;
765785 if (delay == 0) // serial
....@@ -780,9 +800,12 @@
780800 // factor = CameraPane.STEP;
781801 // }
782802
783
- if (marked && CameraPane.isLIVE() && live && CameraPane.drawMode == CameraPane.SHADOW && currentframe != CameraPane.framecount)
803
+ if (marked && Globals.isLIVE() && live &&
804
+ //TEMP21aug2018
805
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
806
+ currentframe != Globals.framecount)
784807 {
785
- currentframe = CameraPane.framecount;
808
+ currentframe = Globals.framecount;
786809
787810 // System.err.println("transformcount = " + transformcount);
788811 // System.err.println("factor = " + factor);
....@@ -894,6 +917,11 @@
894917 fromParent = null; // LA.newMatrix();
895918 bRep = null; // new BoundaryRep();
896919
920
+ if (oname != null && oname.equals("LeftHand"))
921
+ {
922
+ name = oname;
923
+ }
924
+
897925 /*
898926 float hue = (float)Math.random();
899927 Color col;
....@@ -936,7 +964,7 @@
936964
937965 public Object clone()
938966 {
939
- return GrafreeD.clone(this);
967
+ return Grafreed.clone(this);
940968 }
941969
942970 Object3D copyExpand()
....@@ -1452,7 +1480,7 @@
14521480 BoundaryRep.SEUIL = other.material.cameralight;
14531481
14541482 // Set default to 0.1
1455
- BoundaryRep.SEUIL /= 2;
1483
+ BoundaryRep.SEUIL /= 4; // 2;
14561484 System.out.println("SEUIL = " + BoundaryRep.SEUIL);
14571485 }
14581486
....@@ -1711,7 +1739,7 @@
17111739 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17121740 o.bRep = transientrep;
17131741 if (clone)
1714
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1742
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17151743 o.CreateMaterial();
17161744 o.SetAttributes(this, -1);
17171745 //parent
....@@ -1724,7 +1752,7 @@
17241752 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17251753 o.bRep = bRep;
17261754 if (clone)
1727
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1755
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17281756 o.CreateMaterial();
17291757 //o.overwriteThis(this, -1);
17301758 o.SetAttributes(this, -1);
....@@ -1811,12 +1839,15 @@
18111839 if (obj.name == null)
18121840 continue; // can't be a null one
18131841
1842
+ // Try perfect match first.
18141843 if (n.equals(obj.name))
18151844 {
18161845 theobj = obj;
18171846 count++;
18181847 }
18191848 }
1849
+
1850
+ // not needed: n = n.split(":")[0]; // Poser generates a count
18201851
18211852 if (count != 1)
18221853 for (int i=Size(); --i>=0;)
....@@ -2131,15 +2162,8 @@
21312162 if (/*parent != null &&*/ material == null)
21322163 {
21332164 material = new cMaterial(GetMaterial());
2134
- if (projectedVertices == null || projectedVertices.length <= 2)
2135
- {
2136
- projectedVertices = new Object3D.cVector2[3];
2137
- }
2138
- for (int i = 0; i < 3; i++)
2139
- {
2140
- projectedVertices[i] = new cVector2(); // Others
2141
- }
2142
- projectedVertices[0].x = 100; // bump
2165
+
2166
+ InitOthers();
21432167
21442168 if (this instanceof Camera)
21452169 {
....@@ -2289,6 +2313,7 @@
22892313 {
22902314 if (newWindow)
22912315 {
2316
+ new Exception().printStackTrace();
22922317 System.exit(0);
22932318 if (parent != null)
22942319 {
....@@ -2465,13 +2490,13 @@
24652490 return retval;
24662491 }
24672492
2468
- void doEditDrag(ClickInfo info)
2493
+ void doEditDrag(ClickInfo info, boolean opposite)
24692494 {
24702495 switch (doSomething)
24712496 {
24722497 case 1: // '\001'
24732498 //super.
2474
- doEditDrag0(info);
2499
+ doEditDrag0(info, opposite);
24752500 break;
24762501
24772502 case 2: // '\002'
....@@ -2484,11 +2509,11 @@
24842509 {
24852510 //sel.hitSomething = childToDrag.hitSomething;
24862511 //childToDrag.doEditDrag(info);
2487
- sel.doEditDrag(info);
2512
+ sel.doEditDrag(info, opposite);
24882513 } else
24892514 {
24902515 //super.
2491
- doEditDrag0(info);
2516
+ doEditDrag0(info, opposite);
24922517 }
24932518 }
24942519 break;
....@@ -2895,7 +2920,8 @@
28952920 {
28962921 if (bRep != null)
28972922 {
2898
- bRep.GenUV();
2923
+ bRep.GenUV(); //1);
2924
+ //bRep.UnfoldUV();
28992925 Touch();
29002926 }
29012927 }
....@@ -2970,6 +2996,33 @@
29702996 blockloop = false;
29712997 }
29722998
2999
+ void TransformChildren()
3000
+ {
3001
+ if (toParent != null)
3002
+ {
3003
+ for (int i=Size(); --i>=0;)
3004
+ {
3005
+ Object3D v = get(i);
3006
+
3007
+ if (v.toParent == null)
3008
+ {
3009
+ v.toParent = LA.newMatrix();
3010
+ v.fromParent = LA.newMatrix();
3011
+ }
3012
+
3013
+// LA.matConcat(v.toParent, toParent, v.toParent);
3014
+// LA.matConcat(fromParent, v.fromParent, v.fromParent);
3015
+ LA.matConcat(toParent, v.toParent, v.toParent);
3016
+ LA.matConcat(v.fromParent, fromParent, v.fromParent);
3017
+ }
3018
+
3019
+ toParent = null; // LA.matIdentity(toParent);
3020
+ fromParent = null; // LA.matIdentity(fromParent);
3021
+
3022
+ Touch();
3023
+ }
3024
+ }
3025
+
29733026 void TransformGeometry()
29743027 {
29753028 Object3D obj = this;
....@@ -3191,9 +3244,11 @@
31913244
31923245 BoundaryRep sup = bRep.support;
31933246 bRep.support = null;
3194
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3247
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
31953248 // bRep.SplitInTwo(onlyone); // thread...
3196
- temprep.SplitInTwo(reduction34, onlyone);
3249
+
3250
+ while(temprep.SplitInTwo(reduction34, onlyone));
3251
+
31973252 bRep = temprep;
31983253 bRep.support = sup;
31993254 Touch();
....@@ -3715,7 +3770,7 @@
37153770 if (child == null)
37163771 continue;
37173772
3718
- if (GrafreeD.RENDERME > 0)
3773
+ if (Grafreed.RENDERME > 0)
37193774 {
37203775 if (child instanceof Merge)
37213776 ((Merge)child).renderme();
....@@ -3866,7 +3921,7 @@
38663921 if (child == null)
38673922 continue;
38683923
3869
- if (GrafreeD.RENDERME > 0)
3924
+ if (Grafreed.RENDERME > 0)
38703925 {
38713926 if (child instanceof Merge)
38723927 ((Merge)child).renderme();
....@@ -4061,7 +4116,7 @@
40614116 if (child == null)
40624117 continue;
40634118
4064
- if (GrafreeD.RENDERME > 0)
4119
+ if (Grafreed.RENDERME > 0)
40654120 {
40664121 if (child instanceof Merge)
40674122 ((Merge)child).renderme();
....@@ -4158,6 +4213,22 @@
41584213 }
41594214 blockloop = true;
41604215 get(i).RepairParent();
4216
+ blockloop = false;
4217
+ }
4218
+ }
4219
+
4220
+ void RepairShadow()
4221
+ {
4222
+ if (blockloop)
4223
+ return;
4224
+
4225
+ if (this.material != null)
4226
+ this.InitOthers();
4227
+
4228
+ for (int i=0; i<Size(); i++)
4229
+ {
4230
+ blockloop = true;
4231
+ get(i).RepairShadow();
41614232 blockloop = false;
41624233 }
41634234 }
....@@ -4652,7 +4723,7 @@
46524723
46534724 cTreePath SelectLeaf(int indexcount, boolean deselect)
46544725 {
4655
- if (hide)
4726
+ if (hide || dontselect)
46564727 return null;
46574728
46584729 if (count <= 0)
....@@ -4678,7 +4749,7 @@
46784749
46794750 cTreePath Select(int indexcount, boolean deselect)
46804751 {
4681
- if (hide)
4752
+ if (hide || dontselect)
46824753 return null;
46834754
46844755 if (count <= 0)
....@@ -4828,7 +4899,7 @@
48284899 return globalTransform;
48294900 }
48304901
4831
- void PreprocessOcclusion(CameraPane cp)
4902
+ void PreprocessOcclusion(iCameraPane cp)
48324903 {
48334904 /*
48344905 if (AOdone)
....@@ -4975,7 +5046,8 @@
49755046 } else //
49765047 if (editWindow != null)
49775048 {
4978
- editWindow.cameraView.lighttouched = true;
5049
+ //editWindow.cameraView.lighttouched = true;
5050
+ Globals.lighttouched = true;
49795051 }
49805052 }
49815053
....@@ -5129,10 +5201,34 @@
51295201
51305202 // System.out.println("Fullname = " + fullname);
51315203
5132
- if (fullname.name.indexOf(":") == -1)
5133
- return fullname.name;
5204
+ // Does not work on Windows due to C:
5205
+// if (fullname.name.indexOf(":") == -1)
5206
+// return fullname.name;
5207
+//
5208
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51345209
5135
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5210
+ String[] split = fullname.name.split(":");
5211
+
5212
+ if (split.length == 0)
5213
+ {
5214
+ return "";
5215
+ }
5216
+
5217
+ if (split.length <= 2)
5218
+ {
5219
+ if (fullname.name.endsWith(":"))
5220
+ {
5221
+ // Windows
5222
+ return fullname.name.substring(0, fullname.name.length()-1);
5223
+ }
5224
+
5225
+ return split[0];
5226
+ }
5227
+
5228
+ // Windows
5229
+ assert(split.length == 4);
5230
+
5231
+ return split[0] + ":" + split[1];
51365232 }
51375233
51385234 static String GetBump(cTexture fullname)
....@@ -5141,10 +5237,38 @@
51415237 return "";
51425238
51435239 // System.out.println("Fullname = " + fullname);
5144
- if (fullname.name.indexOf(":") == -1)
5145
- return "";
5146
-
5147
- return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5240
+ // Does not work on Windows due to C:
5241
+// if (fullname.name.indexOf(":") == -1)
5242
+// return "";
5243
+//
5244
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5245
+ String[] split = fullname.name.split(":");
5246
+
5247
+ if (split.length == 0)
5248
+ {
5249
+ return "";
5250
+ }
5251
+
5252
+ if (split.length == 1)
5253
+ {
5254
+ return "";
5255
+ }
5256
+
5257
+ if (split.length == 2)
5258
+ {
5259
+ if (fullname.name.endsWith(":"))
5260
+ {
5261
+ // Windows
5262
+ return "";
5263
+ }
5264
+
5265
+ return split[1];
5266
+ }
5267
+
5268
+ // Windows
5269
+ assert(split.length == 4);
5270
+
5271
+ return split[2] + ":" + split[3];
51485272 }
51495273
51505274 String GetPigmentTexture()
....@@ -5218,7 +5342,7 @@
52185342 System.out.print("; textures = " + textures);
52195343 System.out.println("; usedtextures = " + usedtextures);
52205344
5221
- if (GetTextures() == null)
5345
+ if (GetTextures() == null) // What is that??
52225346 GetTextures().name = ":";
52235347
52245348 String texname = tex;
....@@ -5249,6 +5373,43 @@
52495373 child.ResetPigmentTexture();
52505374 blockloop = false;
52515375 }
5376
+ }
5377
+
5378
+ UUID GetUUID()
5379
+ {
5380
+ if (uuid == null)
5381
+ {
5382
+ // Serial
5383
+ uuid = UUID.randomUUID();
5384
+ }
5385
+
5386
+ return uuid;
5387
+ }
5388
+
5389
+ Object3D GetObject(UUID uid)
5390
+ {
5391
+ if (blockloop)
5392
+ return null;
5393
+
5394
+ if (GetUUID().equals(uid))
5395
+ return this;
5396
+
5397
+ int nb = Size();
5398
+ for (int i = 0; i < nb; i++)
5399
+ {
5400
+ Object3D child = (Object3D) get(i);
5401
+
5402
+ if (child == null)
5403
+ continue;
5404
+
5405
+ blockloop = true;
5406
+ Object3D obj = child.GetObject(uid);
5407
+ blockloop = false;
5408
+ if (obj != null)
5409
+ return obj;
5410
+ }
5411
+
5412
+ return null;
52525413 }
52535414
52545415 void SetBumpTexture(String tex)
....@@ -5287,25 +5448,22 @@
52875448 }
52885449 }
52895450
5290
- void draw(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5451
+ void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
52915452 {
52925453 Draw(display, root, selected, blocked);
52935454 }
52945455
5295
- static cMaterial[] materialstack = new cMaterial[65536];
5296
- static boolean[] selectedstack = new boolean[65536];
5297
- static int materialdepth = 0;
5298
-
52995456 boolean NeedSupport()
53005457 {
53015458 return
5302
- CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
5459
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
53035460 // PROBLEM with CROWD!!
5304
- && (CameraPane.drawMode == CameraPane.SHADOW || CameraPane.CROWD);
5461
+ && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
53055462 }
53065463
5464
+ static boolean DEBUG_SELECTION = false;
53075465
5308
- void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5466
+ void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
53095467 {
53105468 Invariants(); // june 2013
53115469
....@@ -5314,8 +5472,8 @@
53145472 // System.err.println("Draw " + this + " Frame # " + ((Mocap)((Merge)support).object).frame);
53155473 }
53165474
5317
- if (display.drawMode == CameraPane.SELECTION &&
5318
- hide)
5475
+ if (display.DrawMode() == iCameraPane.SELECTION &&
5476
+ (hide || dontselect))
53195477 return;
53205478
53215479 if (name != null && name.contains("sclera"))
....@@ -5333,7 +5491,7 @@
53335491 if (this instanceof Checker)
53345492 return;
53355493
5336
- if (display.drawMode == display.SHADOW && PASSTEST)
5494
+ if (display.DrawMode() == display.SHADOW && PASSTEST)
53375495 return;
53385496
53395497 if (count <= 0)
....@@ -5341,13 +5499,13 @@
53415499 return;
53425500 }
53435501
5344
- if ((//display.drawMode == CameraPane.SHADOW ||
5345
- display.drawMode == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency())
5502
+ if ((//display.DrawMode() == CameraPane.SHADOW ||
5503
+ display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency())
53465504 {
53475505 return;
53485506 }
53495507
5350
- javax.media.opengl.GL gl = display.GetGL();
5508
+ //javax.media.opengl.GL gl = display.GetGL();
53515509
53525510 /*
53535511 if (touched)
....@@ -5383,15 +5541,15 @@
53835541
53845542 boolean compiled = false;
53855543
5386
- boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION;
5544
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
53875545
5388
- if (!selectmode && //display.drawMode != display.SELECTION &&
5546
+ if (!selectmode && //display.DrawMode() != display.SELECTION &&
53895547 (touched || (bRep != null && bRep.displaylist <= 0)))
53905548 {
5391
- display.lighttouched = true;
5549
+ Globals.lighttouched = true;
53925550 } // all panes...
5393
- //if (usecalllists && display.drawMode != display.SELECTION && display.drawMode != display.SHADOW &&
5394
- if (bRep != null && usecalllists && !selectmode && // june 2013 display.drawMode != display.SHADOW &&
5551
+ //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
5552
+ if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
53955553 (touched || (bRep != null && bRep.displaylist <= 0)))
53965554 {
53975555 if (!(this instanceof Composite))
....@@ -5399,7 +5557,7 @@
53995557 //if (displaylist == -1 && usecalllists)
54005558 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54015559 {
5402
- bRep.displaylist = gl.glGenLists(1);
5560
+ bRep.displaylist = display.GenList();
54035561 assert(bRep.displaylist != 0);
54045562 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54055563 //System.out.println("\tgen list " + list);
....@@ -5411,18 +5569,20 @@
54115569 if (usecalllists)
54125570 {
54135571 // System.err.println("new list " + bRep.displaylist + " for " + this);
5414
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5572
+ display.NewList(bRep.displaylist);
54155573 }
5574
+
54165575 CallList(display, root, selected, blocked);
5576
+
54175577 // compiled = true;
54185578 if (usecalllists)
54195579 {
54205580 // System.err.println("end list " + bRep.displaylist + " for " + this);
5421
- gl.glEndList();
5581
+ display.EndList();
54225582 }
54235583 //gl.glDrawBuffer(gl.GL_BACK);
54245584 // XXX touched = false;
5425
- display.lighttouched = true; // all panes...
5585
+ Globals.lighttouched = true; // all panes...
54265586 }
54275587
54285588 touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false;
....@@ -5461,12 +5621,12 @@
54615621
54625622 // frustum culling
54635623 if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid
5464
- && display.drawMode != CameraPane.SELECTION)
5624
+ && display.DrawMode() != iCameraPane.SELECTION)
54655625 {
5466
- if (display.drawMode == CameraPane.SHADOW)
5626
+ if (display.DrawMode() == iCameraPane.SHADOW)
54675627 {
54685628 if (!link2master // tricky to cull in shadow mode.
5469
- && GetBRep().FrustumCull(this, gl, display.lightCamera, true))
5629
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54705630 {
54715631 //System.out.print("CULLED");
54725632 culled = true;
....@@ -5474,7 +5634,7 @@
54745634 }
54755635 else
54765636 //GetBRep().getBounds(v0, v1, this);
5477
- if (GetBRep().FrustumCull(this, gl, display.renderCamera, false))
5637
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
54785638 culled = true;
54795639
54805640 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5510,11 +5670,11 @@
55105670
55115671
55125672 if (!culled)
5513
- if (display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION)
5673
+ if (display.DrawMode() == display.SELECTION || display.IsDebugSelection())
55145674 {
55155675 if (GetBRep() != null)
55165676 {
5517
- CameraPane.NextIndex(this, gl);
5677
+ display.NextIndex();
55185678 // vertex color conflict : gl.glCallList(list);
55195679 DrawNode(display, root, selected);
55205680 if (this instanceof BezierPatch)
....@@ -5536,55 +5696,7 @@
55365696 color[2] /= 2;
55375697 gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT_AND_DIFFUSE, color, 0);
55385698 */
5539
- if (material != null)
5540
- {
5541
- materialstack[materialdepth] = material;
5542
- selectedstack[materialdepth] = selected;
5543
- cStatic.objectstack[materialdepth++] = this;
5544
- //System.out.println("material " + material);
5545
- //Applet3D.tracein(this, selected);
5546
- display.vector2buffer = projectedVertices;
5547
- if (this instanceof Camera)
5548
- {
5549
- display.options1[0] = material.shift;
5550
- //System.out.println("shift " + material.shift);
5551
- display.options1[1] = material.lightarea;
5552
- display.options1[2] = material.shadowbias;
5553
- display.options1[3] = material.aniso;
5554
- display.options1[4] = material.anisoV;
5555
- display.options2[0] = material.opacity;
5556
- display.options2[1] = material.diffuse;
5557
- display.options2[2] = material.factor;
5558
-
5559
- cColor.HSBtoRGB(material.color, material.modulation, 1, display.options3);
5560
- display.options4[0] = material.cameralight/0.2f;
5561
- display.options4[1] = material.subsurface;
5562
- display.options4[2] = material.sheen;
5563
-
5564
- // if (display.CURRENTANTIALIAS > 0)
5565
- // display.options3[3] /= 4;
5566
-
5567
- /*
5568
- System.out.println("Focus = " + display.options1[0]);
5569
- System.out.println("Aperture = " + display.options1[1]);
5570
- System.out.println("ShadowBlur = " + display.options1[2]);
5571
- System.out.println("Antialiasing = " + display.options1[3]);
5572
- System.out.println("Fog = " + display.options2[0]);
5573
- System.out.println("Intensity = " + display.options2[1]);
5574
- System.out.println("Elevation = " + display.options2[2]);
5575
- /**/
5576
- } else
5577
- {
5578
- material.Draw(display, selected);
5579
- }
5580
- } else
5581
- {
5582
- if (selected && CameraPane.flash)
5583
- {
5584
- display.modelParams4[1] = 100;
5585
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0);
5586
- }
5587
- }
5699
+ display.PushMaterial(this, selected);
55885700
55895701 //System.out.println("call list " + list);
55905702 //System.out.println();
....@@ -5603,7 +5715,17 @@
56035715 tex = GetTextures();
56045716 }
56055717
5606
- display.BindTextures(tex, texres);
5718
+ boolean failed = false;
5719
+
5720
+ try
5721
+ {
5722
+ display.BindTextures(tex, texres);
5723
+ }
5724
+ catch (Exception e)
5725
+ {
5726
+ System.err.println("FAILED: " + this);
5727
+ failed = true;
5728
+ }
56075729
56085730 if (!compiled)
56095731 {
....@@ -5619,30 +5741,16 @@
56195741
56205742 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
56215743 assert(bRep.displaylist != 0);
5622
- gl.glCallList(bRep.displaylist);
5744
+ display.CallList(bRep.displaylist);
56235745 // june 2013 drawSelf(display, root, selected);
56245746 }
56255747 }
56265748 }
56275749
5628
- display.ReleaseTextures(tex);
5629
-
5630
- //if (parent != null && parent.GetMaterial() != null)
5631
- // parent.GetMaterial().Draw(display, parent.IsSelected(this));
5632
- if (material != null)
5633
- {
5634
- materialdepth -= 1;
5635
- if (materialdepth > 0)
5636
- {
5637
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
5638
- materialstack[materialdepth - 1].Draw(display, selectedstack[materialdepth - 1]);
5639
- }
5640
- //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
5641
- } else if (selected && CameraPane.flash && GetMaterial() != null)
5642
- {
5643
- display.modelParams4[1] = GetMaterial().cameralight;
5644
- gl.glProgramEnvParameter4fvARB(gl.GL_FRAGMENT_PROGRAM_ARB, 4, display.modelParams4, 0);
5645
- }
5750
+ if (!failed)
5751
+ display.ReleaseTextures(tex);
5752
+
5753
+ display.PopMaterial(this, selected);
56465754 }
56475755
56485756 if (this instanceof Texture || this instanceof TextureNode)
....@@ -5684,7 +5792,7 @@
56845792 // resetMasterNode();
56855793 }
56865794
5687
- void CallList(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5795
+ void CallList(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
56885796 {
56895797 if (GetBRep() == null)
56905798 {
....@@ -5767,8 +5875,11 @@
57675875 boolean flipV = false; // true;
57685876 int texres = 0; // 0 = low, 1 = normal, 2 = high res texture
57695877
5770
- void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5878
+ void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57715879 {
5880
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
5881
+ return;
5882
+
57725883 if (hide)
57735884 return;
57745885 // shadow optimisation
....@@ -5826,16 +5937,7 @@
58265937 // // ??????????????????????????? Touch();
58275938 // }
58285939
5829
- if (material != null)
5830
- {
5831
- materialstack[materialdepth] = material;
5832
- selectedstack[materialdepth] = selected;
5833
- cStatic.objectstack[materialdepth++] = this;
5834
- //System.out.println("material " + material);
5835
- //Applet3D.tracein("selected ", selected);
5836
- display.vector2buffer = projectedVertices;
5837
- material.Draw(display, selected);
5838
- }
5940
+display.PushMaterial2(this, selected);
58395941
58405942 Object3D child;
58415943 boolean sel;
....@@ -5887,19 +5989,7 @@
58875989 */
58885990 //depth += 1;
58895991
5890
- if (material != null)
5891
- {
5892
- materialdepth -= 1;
5893
- if (materialdepth > 0)
5894
- {
5895
- display.vector2buffer = cStatic.objectstack[materialdepth - 1].projectedVertices;
5896
- materialstack[materialdepth - 1].Draw(display, selectedstack[materialdepth - 1]);
5897
- }
5898
- //Applet3D.traceout("selected ", (stackdepth>0)?selectedstack[stackdepth-1]:"???");
5899
- //else
5900
- //material.Draw(display, false);
5901
- }
5902
-
5992
+display.PopMaterial2(this);
59035993 /*
59045994 display.ReleaseTextures(tex);
59055995 */
....@@ -5910,10 +6000,13 @@
59106000
59116001 //static cVector min,max;
59126002
5913
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected)
6003
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
59146004 {
5915
- if (display.drawMode == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
6005
+ if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
59166006 return; // no shadow for transparent objects
6007
+
6008
+ if (display.DrawMode() == iCameraPane.SELECTION && dontselect)
6009
+ return;
59176010
59186011 if (hide)
59196012 return;
....@@ -5955,11 +6048,12 @@
59556048 return;
59566049 }
59576050
6051
+ //bRep.GenUV(1/material.diffuseness);
59586052 // bRep.lock = true;
59596053
5960
- javax.media.opengl.GL gl = display.GetGL();
6054
+ //javax.media.opengl.GL gl = display.GetGL();
59616055
5962
- if (CameraPane.BOXMODE) // || CameraPane.movingcamera)
6056
+ if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59636057 {
59646058 int fc = bRep.FaceCount();
59656059 int vc = bRep.VertexCount();
....@@ -5974,23 +6068,7 @@
59746068
59756069 bRep.getMinMax(min, max, 100);
59766070
5977
- gl.glBegin(gl.GL_LINES);
5978
-
5979
- gl.glVertex3d(min.x, min.y, min.z);
5980
- gl.glVertex3d(min.x, min.y, max.z);
5981
- gl.glVertex3d(min.x, min.y, min.z);
5982
- gl.glVertex3d(min.x, max.y, min.z);
5983
- gl.glVertex3d(min.x, min.y, min.z);
5984
- gl.glVertex3d(max.x, min.y, min.z);
5985
-
5986
- gl.glVertex3d(max.x, max.y, max.z);
5987
- gl.glVertex3d(min.x, max.y, max.z);
5988
- gl.glVertex3d(max.x, max.y, max.z);
5989
- gl.glVertex3d(max.x, min.y, max.z);
5990
- gl.glVertex3d(max.x, max.y, max.z);
5991
- gl.glVertex3d(max.x, max.y, min.z);
5992
-
5993
- gl.glEnd();
6071
+ display.DrawBox(min, max);
59946072
59956073 return;
59966074 }
....@@ -6034,7 +6112,7 @@
60346112 {
60356113 //throw new Error();
60366114
6037
- boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION;
6115
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
60386116
60396117 int[] strips = bRep.getRawIndices();
60406118
....@@ -6044,178 +6122,14 @@
60446122 new Exception().printStackTrace();
60456123 return;
60466124 }
6047
-
6048
- // TRIANGLE STRIP ARRAY
6049
- if (bRep.trimmed)
6050
- {
6051
- float[] v = bRep.getRawVertices();
6052
- float[] n = bRep.getRawNormals();
6053
- float[] c = bRep.getRawColors();
6054
- float[] uv = bRep.getRawUVMap();
6055
-
6056
- int count2 = 0;
6057
- int count3 = 0;
6058
-
6059
- if (n.length > 0)
6060
- {
6061
- for (int i = 0; i < strips.length; i++)
6062
- {
6063
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6064
-
6065
- /*
6066
- boolean locked = false;
6067
- float eps = 0.1f;
6068
- boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
6069
-
6070
- int dot = 0;
6071
-
6072
- if ((dot&1) == 0)
6073
- dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
6074
-
6075
- if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
6076
- gl.glTexCoord2f((float) qv.s, (float) qv.t);
6077
- else
6078
- {
6079
- locked = true;
6080
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6081
- }
6082
- //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6083
- gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
6084
- if (hasnorm)
6085
- {
6086
- //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6087
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6088
- }
6089
-
6090
- if ((dot&4) == 0)
6091
- dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
6092
-
6093
- if (wrap || !locked && (dot&8) != 0)
6094
- gl.glTexCoord2f((float) rv.s, (float) rv.t);
6095
- else
6096
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6097
-
6098
- f.dot = dot;
6099
- */
6100
-
6101
- if (!selectmode)
6102
- {
6103
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6104
- {
6105
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6106
- } else
6107
- {
6108
- gl.glNormal3f(0, 0, 1);
6109
- }
6110
-
6111
- if (c != null)
6112
- //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
6113
- {
6114
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6115
- }
6116
- }
6117
- if (flipV)
6118
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6119
- else
6120
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6121
- //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6122
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6123
-
6124
- count2 += 2;
6125
- count3 += 3;
6126
- if (!selectmode)
6127
- {
6128
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6129
- {
6130
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6131
- } else
6132
- {
6133
- gl.glNormal3f(0, 0, 1);
6134
- }
6135
- if (c != null)
6136
- {
6137
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6138
- }
6139
- }
6140
- if (flipV)
6141
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6142
- else
6143
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6144
- //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6145
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6146
-
6147
- count2 += 2;
6148
- count3 += 3;
6149
- for (int j = 0; j < strips[i] - 2; j++)
6150
- {
6151
- //gl.glTexCoord2d(...);
6152
- if (!selectmode)
6153
- {
6154
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6155
- {
6156
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6157
- } else
6158
- {
6159
- gl.glNormal3f(0, 0, 1);
6160
- }
6161
- if (c != null)
6162
- {
6163
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6164
- }
6165
- }
6166
-
6167
- if (flipV)
6168
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6169
- else
6170
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6171
- //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
6172
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6173
- count2 += 2;
6174
- count3 += 3;
6175
- }
6176
-
6177
- gl.glEnd();
6178
- }
6179
- }
6180
-
6181
- assert count3 == v.length;
6182
- }
6183
- else // !trimmed
6184
- {
6185
- int count = 0;
6186
- for (int i = 0; i < strips.length; i++)
6187
- {
6188
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6189
-
6190
- Vertex p = bRep.GetVertex(bRep.indices[count++]);
6191
- Vertex q = bRep.GetVertex(bRep.indices[count++]);
6192
-
6193
- drawVertex(gl, p, selectmode);
6194
- drawVertex(gl, q, selectmode);
6195
-
6196
- for (int j = 0; j < strips[i] - 2; j++)
6197
- {
6198
- Vertex r = bRep.GetVertex(bRep.indices[count++]);
6199
-
6200
-// if (j%2 == 0)
6201
-// drawFace(p, q, r, display, null);
6202
-// else
6203
-// drawFace(p, r, q, display, null);
6204
-
6205
-// p = q;
6206
-// q = r;
6207
- drawVertex(gl, r, selectmode);
6208
- }
6209
-
6210
- gl.glEnd();
6211
- }
6212
- }
6125
+
6126
+ display.DrawGeometry(bRep, flipV, selectmode);
62136127 } else // catch (Error e)
62146128 {
62156129 // TRIANGLE ARRAY
62166130 if (IsOpaque()) // Static())
62176131 {
6218
- gl.glBegin(gl.GL_TRIANGLES);
6132
+ display.StartTriangles();
62196133 int facecount = bRep.FaceCount();
62206134 for (int i = 0; i < facecount; i++)
62216135 {
....@@ -6278,9 +6192,9 @@
62786192 // // r.norm.dot(v3) > -0.5)
62796193 // // continue;
62806194
6281
- drawFace(p, q, r, display, face);
6195
+ display.DrawFace(this, p, q, r, face);
62826196 }
6283
- gl.glEnd();
6197
+ display.EndTriangles();
62846198 }
62856199 else
62866200 {
....@@ -6309,8 +6223,8 @@
63096223 //System.out.println("SORT");
63106224
63116225 java.util.Arrays.sort(facescompare);
6312
-
6313
- gl.glBegin(gl.GL_TRIANGLES);
6226
+
6227
+ display.StartTriangles();
63146228 for (int i = 0; i < facecount; i++)
63156229 {
63166230 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6322,13 +6236,14 @@
63226236 Vertex q = bRep.GetVertex(face.q);
63236237 Vertex r = bRep.GetVertex(face.r);
63246238
6325
- drawFace(p, q, r, display, face);
6239
+ display.DrawFace(this, p, q, r, face);
63266240 }
6327
- gl.glEnd();
6241
+ display.EndTriangles();
63286242 }
63296243
63306244 if (false) // live && support != null && support.bRep != null) // debug weights
63316245 {
6246
+ /*
63326247 gl.glDisable(gl.GL_LIGHTING);
63336248 float[] colorV = new float[3];
63346249
....@@ -6407,6 +6322,7 @@
64076322 // gl.glEnd();
64086323 }
64096324 }
6325
+ */
64106326 }
64116327 }
64126328
....@@ -6451,7 +6367,7 @@
64516367 center.add(r);
64526368 center.mul(1.0/3);
64536369
6454
- center.sub(CameraPane.theRenderer.eyeCamera.location);
6370
+ center.sub(Globals.theRenderer.EyeCamera().location);
64556371
64566372 distance = center.dot(center);
64576373 }
....@@ -6462,347 +6378,11 @@
64626378
64636379 transient FaceCompare[] facescompare = null;
64646380
6465
- void SetColor(CameraPane display, Vertex p0)
6466
- {
6467
- if (display.RENDERPROGRAM == 0)
6468
- {
6469
- float r = 0;
6470
- if (bRep != null)
6471
- {
6472
- if (bRep.stripified)
6473
- {
6474
- r = 1;
6475
- }
6476
- }
6477
- float g = 0;
6478
- if (bRep != null)
6479
- {
6480
- if (bRep.trimmed)
6481
- {
6482
- g = 1;
6483
- }
6484
- }
6485
- float b = 0;
6486
- if (support != null && link2master)
6487
- {
6488
- b = 1;
6489
- }
6490
- display.GetGL().glColor3f(r*p0.AO, g*p0.AO, b*p0.AO);
6491
- return;
6492
- }
6493
-
6494
- if (display.drawMode != CameraPane.SHADOW)
6495
- return;
6496
-
6497
- javax.media.opengl.GL gl = display.GetGL();
6498
-// if (true) return;
6499
-// float ao = p.AO;
6500
-//
6501
-// // if (ao == 0 && !bRep.AOdone) // transient problem!
6502
-// // ao = 1;
6503
-//
6504
-// gl.glColor4f(ao, ao, ao, 1);
6505
-
6506
-// CameraPane.selectedpoint.
6507
-// getAverage(cStatic.point1, true);
6508
- if (CameraPane.pointflow == null) // !random) // live)
6509
- {
6510
- return;
6511
- }
6512
-
6513
- cStatic.point1.set(0,0,0);
6514
- LA.xformPos(cStatic.point1, CameraPane.selectedpoint.toParent, cStatic.point1);
6515
-
6516
- cStatic.point1.sub(p0);
6517
-
6518
-
6519
-// if (marked && (p0.vertexlinks == null || support == null || support.bRep == null)) // no position delta?
6520
-// {
6521
-// return;
6522
-// }
6523
-
6524
- //if (true)
6525
- if (cStatic.point1.dot(cStatic.point1) > 0.000001)
6526
- {
6527
- return;
6528
- }
6529
-
6530
- float[] colorV = new float[3];
6531
-
6532
- if (false) // marked)
6533
- {
6534
- // debug rigging weights
6535
- for (int object = 0; object < p0.vertexlinks.length; object++)
6536
- {
6537
- float weight = p0.weights[object] / p0.totalweight;
6538
-
6539
- // if (weight < 0.1)
6540
- // {
6541
- // assert(weight == 0);
6542
- // continue;
6543
- // }
6544
-
6545
- if (p0.vertexlinks[object] == -1)
6546
- continue;
6547
-
6548
- Vertex q = support.bRep.GetVertex(p0.vertexlinks[object]);
6549
-
6550
- int color = //1 << object; //
6551
- //p.vertexlinks.length;
6552
- support.bRep.supports[p0.closestsupport].links[object];
6553
- colorV[2] += (color & 1) * weight;
6554
- colorV[1] += ((color & 2) >> 1) * weight;
6555
- colorV[0] += ((color & 4) >> 2) * weight;
6556
- }
6557
- }
6558
- else
6559
- {
6560
- if (drawingstarted)
6561
- {
6562
- // find next point
6563
- if (bRep.GetVertex(0).faceindices == null)
6564
- {
6565
- bRep.InitFaceIndices();
6566
- }
6567
-
6568
- double ymin = p0.y;
6569
-
6570
- Vertex newp = p0;
6571
-
6572
- for (int fii = 0; fii < p0.faceindices.length; fii++)
6573
- {
6574
- int fi = p0.faceindices[fii];
6575
-
6576
- if (fi == -1)
6577
- break;
6578
-
6579
- Face f = bRep.GetFace(fi);
6580
-
6581
- Vertex p = bRep.GetVertex(f.p);
6582
- Vertex q = bRep.GetVertex(f.q);
6583
- Vertex r = bRep.GetVertex(f.r);
6584
-
6585
- int swap = (int)(Math.random()*3);
6586
-
6587
-// for (int s=swap; --s>=0;)
6588
-// {
6589
-// Vertex t = p;
6590
-// p = q;
6591
-// q = r;
6592
-// r = t;
6593
-// }
6594
- if (ymin > p.y)
6595
- {
6596
- ymin = p.y;
6597
- newp = p;
6598
-// break;
6599
- }
6600
- if (ymin > q.y)
6601
- {
6602
- ymin = q.y;
6603
- newp = q;
6604
-// break;
6605
- }
6606
- if (ymin > r.y)
6607
- {
6608
- ymin = r.y;
6609
- newp = r;
6610
-// break;
6611
- }
6612
- }
6613
-
6614
- CameraPane.selectedpoint.toParent[3][0] = newp.x;
6615
- CameraPane.selectedpoint.toParent[3][1] = newp.y;
6616
- CameraPane.selectedpoint.toParent[3][2] = newp.z;
6617
-
6618
- drawingstarted = false;
6619
-
6620
- // return;
6621
- }
6622
-
6623
- if (false) // CameraPane.DRAW
6624
- {
6625
- p0.AO = colorV[0] = 2;
6626
- colorV[1] = 2;
6627
- colorV[2] = 2;
6628
- }
6629
-
6630
- CameraPane.pointflow.add(p0);
6631
- CameraPane.pointflow.Touch();
6632
- }
6633
-
6634
-// gl.glColor3f(colorV[0], colorV[1], colorV[2]);
6635
-// gl.glMaterialfv(gl.GL_FRONT, gl.GL_DIFFUSE, colorV, 0);
6636
-// gl.glMaterialfv(gl.GL_BACK, gl.GL_DIFFUSE, colorV, 0);
6637
- }
6638
-
66396381 void Print(Vertex v)
66406382 {
66416383 //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")");
66426384 }
66436385
6644
- void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode)
6645
- {
6646
- if (!selectmode)
6647
- {
6648
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6649
- gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
6650
-
6651
- if (flipV)
6652
- gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
6653
- else
6654
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6655
- }
6656
-
6657
- gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
6658
- }
6659
-
6660
- void drawFace(Vertex pv, Vertex qv, Vertex rv,
6661
- CameraPane display, Face face)
6662
- {
6663
- if (pv.y == -10000 ||
6664
- qv.y == -10000 ||
6665
- rv.y == -10000)
6666
- return;
6667
-
6668
-// float b = f.nbiterations & 1;
6669
-// float g = (f.nbiterations>>1) & 1;
6670
-// float r = (f.nbiterations>>2) & 1;
6671
-//
6672
-// //if (f.weight == 10000)
6673
-// //{
6674
-// // r = 1; g = b = 0;
6675
-// //}
6676
-// //else
6677
-// //{
6678
-// // assert(f.weight < 10000);
6679
-// r = g = b = (float)bRep.FaceWeight(f)*100;
6680
-// if (r<0)
6681
-// assert(r>=0);
6682
-// //}
6683
-
6684
- javax.media.opengl.GL gl = display.GetGL();
6685
-
6686
- boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION;
6687
-
6688
- //System.out.println("p = " + pv + "; q = " + qv + "; r = " + rv);
6689
- if (!selectmode) // display.drawMode != display.SELECTION) // && display.drawMode != display.SHADOW) // (attributes & FILL) != 0)
6690
- {
6691
- //gl.glBegin(gl.GL_TRIANGLES);
6692
- boolean hasnorm = pv.norm != null; // && (pv.norm.x != 0 || pv.norm.y != 0 || pv.norm.z != 0);
6693
- if (!hasnorm)
6694
- {
6695
- // System.out.println("FUCK!!");
6696
- LA.vecSub(pv/*.pos*/, qv/*.pos*/, v0);
6697
- LA.vecSub(pv/*.pos*/, rv/*.pos*/, v1);
6698
- LA.vecCross(v0, v1, v2);
6699
- LA.vecNormalize(v2);
6700
- gl.glNormal3f((float) v2.x, (float) v2.y, (float) v2.z);
6701
- }
6702
-
6703
- if (hasnorm)
6704
- {
6705
-// if (!pv.norm.normalized())
6706
-// assert(pv.norm.normalized());
6707
-
6708
- //System.out.println("normalp = " + pv.norm.x + ", " + pv.norm.y + ", " + pv.norm.z);
6709
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6710
- }
6711
- gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
6712
- SetColor(display, pv);
6713
- //gl.glColor4f(r, g, b, 1);
6714
- //gl.glColor4f(pv.boundary, pv.boundary, pv.boundary, 1);
6715
- if (flipV)
6716
- gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
6717
- else
6718
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6719
- //System.out.println("vertexp = " + pv.x + ", " + pv.y + ", " + pv.z);
6720
- gl.glVertex3f((float) pv./*pos.*/x, (float) pv./*pos.*/y, (float) pv./*pos.*/z);
6721
-// Print(pv);
6722
- if (hasnorm)
6723
- {
6724
-// assert(qv.norm.normalized());
6725
- //System.out.println("normalq = " + qv.norm.x + ", " + qv.norm.y + ", " + qv.norm.z);
6726
- gl.glNormal3f((float) qv.norm.x, (float) qv.norm.y, (float) qv.norm.z);
6727
- }
6728
- //System.out.println("vertexq = " + qv.s + ", " + qv.t);
6729
- // boolean locked = false;
6730
- // float eps = 0.1f;
6731
- // boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
6732
-
6733
- // int dot = 0; //*/ (int)f.dot;
6734
-
6735
- // if ((dot&1) == 0)
6736
- // dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
6737
-
6738
- // if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
6739
- if (flipV)
6740
- gl.glTexCoord2f((float) qv.s, 1-(float) qv.t);
6741
- else
6742
- gl.glTexCoord2f((float) qv.s, (float) qv.t);
6743
- // else
6744
- // {
6745
- // locked = true;
6746
- // gl.glTexCoord2f((float) pv.s, (float) pv.t);
6747
- // }
6748
- gl.glColor4f(qv.AO, qv.AO, qv.AO, 1);
6749
- SetColor(display, qv);
6750
- //gl.glColor4f(r, g, b, 1);
6751
- //gl.glColor4f(qv.boundary, qv.boundary, qv.boundary, 1);
6752
- //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6753
- gl.glVertex3f((float) qv./*pos.*/x, (float) qv./*pos.*/y, (float) qv./*pos.*/z);
6754
-// Print(qv);
6755
- if (hasnorm)
6756
- {
6757
-// assert(rv.norm.normalized());
6758
- //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6759
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6760
- }
6761
-
6762
- // if ((dot&4) == 0)
6763
- // dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
6764
-
6765
- // if (wrap || !locked && (dot&8) != 0)
6766
- if (flipV)
6767
- gl.glTexCoord2f((float) rv.s, 1-(float) rv.t);
6768
- else
6769
- gl.glTexCoord2f((float) rv.s, (float) rv.t);
6770
- // else
6771
- // gl.glTexCoord2f((float) pv.s, (float) pv.t);
6772
-
6773
- // f.dot = dot;
6774
-
6775
- gl.glColor4f(rv.AO, rv.AO, rv.AO, 1);
6776
- SetColor(display, rv);
6777
- //gl.glColor4f(r, g, b, 1);
6778
- //gl.glColor4f(rv.boundary, rv.boundary, rv.boundary, 1);
6779
- //System.out.println("vertexr = " + rv.x + ", " + rv.y + ", " + rv.z);
6780
- gl.glVertex3f((float) rv./*pos.*/x, (float) rv./*pos.*/y, (float) rv./*pos.*/z);
6781
-// Print(rv);
6782
- //gl.glEnd();
6783
- }
6784
- else
6785
- {
6786
- gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
6787
- gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
6788
- gl.glVertex3f((float) rv.x, (float) rv.y, (float) rv.z);
6789
-
6790
- }
6791
-
6792
- if (false) // (attributes & WIREFRAME) != 0)
6793
- {
6794
- gl.glDisable(gl.GL_LIGHTING);
6795
-
6796
- gl.glBegin(gl.GL_LINE_LOOP);
6797
- gl.glVertex3d(pv./*pos.*/x, pv./*pos.*/y, pv./*pos.*/z);
6798
- gl.glVertex3d(qv./*pos.*/x, qv./*pos.*/y, qv./*pos.*/z);
6799
- gl.glVertex3d(rv./*pos.*/x, rv./*pos.*/y, rv./*pos.*/z);
6800
- gl.glEnd();
6801
-
6802
- gl.glEnable(gl.GL_LIGHTING);
6803
- }
6804
- }
6805
-
68066386 void drawSelf(ClickInfo info, int level, boolean select)
68076387 {
68086388 if (bRep == null)
....@@ -7374,83 +6954,83 @@
73746954 int spotw = spot.x + spot.width;
73756955 int spoth = spot.y + spot.height;
73766956 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7377
- if (CameraPane.Xmin > spot.x)
7378
- {
7379
- CameraPane.Xmin = spot.x;
7380
- }
7381
- if (CameraPane.Xmax < spotw)
7382
- {
7383
- CameraPane.Xmax = spotw;
7384
- }
7385
- if (CameraPane.Ymin > spot.y)
7386
- {
7387
- CameraPane.Ymin = spot.y;
7388
- }
7389
- if (CameraPane.Ymax < spoth)
7390
- {
7391
- CameraPane.Ymax = spoth;
7392
- }
6957
+// if (CameraPane.Xmin > spot.x)
6958
+// {
6959
+// CameraPane.Xmin = spot.x;
6960
+// }
6961
+// if (CameraPane.Xmax < spotw)
6962
+// {
6963
+// CameraPane.Xmax = spotw;
6964
+// }
6965
+// if (CameraPane.Ymin > spot.y)
6966
+// {
6967
+// CameraPane.Ymin = spot.y;
6968
+// }
6969
+// if (CameraPane.Ymax < spoth)
6970
+// {
6971
+// CameraPane.Ymax = spoth;
6972
+// }
73936973 spot.translate(32, 32);
73946974 spotw = spot.x + spot.width;
73956975 spoth = spot.y + spot.height;
73966976 info.g.setColor(Color.blue);
73976977 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7398
- if (CameraPane.Xmin > spot.x)
7399
- {
7400
- CameraPane.Xmin = spot.x;
7401
- }
7402
- if (CameraPane.Xmax < spotw)
7403
- {
7404
- CameraPane.Xmax = spotw;
7405
- }
7406
- if (CameraPane.Ymin > spot.y)
7407
- {
7408
- CameraPane.Ymin = spot.y;
7409
- }
7410
- if (CameraPane.Ymax < spoth)
7411
- {
7412
- CameraPane.Ymax = spoth;
7413
- }
7414
- info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7415
- info.g.drawLine(spotw, spoth, spotw - 15, spoth);
6978
+// if (CameraPane.Xmin > spot.x)
6979
+// {
6980
+// CameraPane.Xmin = spot.x;
6981
+// }
6982
+// if (CameraPane.Xmax < spotw)
6983
+// {
6984
+// CameraPane.Xmax = spotw;
6985
+// }
6986
+// if (CameraPane.Ymin > spot.y)
6987
+// {
6988
+// CameraPane.Ymin = spot.y;
6989
+// }
6990
+// if (CameraPane.Ymax < spoth)
6991
+// {
6992
+// CameraPane.Ymax = spoth;
6993
+// }
6994
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6995
+ //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
74166996 spot.translate(0, -32);
74176997 info.g.setColor(Color.green);
74186998 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7419
- if (CameraPane.Xmin > spot.x)
7420
- {
7421
- CameraPane.Xmin = spot.x;
7422
- }
7423
- if (CameraPane.Xmax < spotw)
7424
- {
7425
- CameraPane.Xmax = spotw;
7426
- }
7427
- if (CameraPane.Ymin > spot.y)
7428
- {
7429
- CameraPane.Ymin = spot.y;
7430
- }
7431
- if (CameraPane.Ymax < spoth)
7432
- {
7433
- CameraPane.Ymax = spoth;
7434
- }
6999
+// if (CameraPane.Xmin > spot.x)
7000
+// {
7001
+// CameraPane.Xmin = spot.x;
7002
+// }
7003
+// if (CameraPane.Xmax < spotw)
7004
+// {
7005
+// CameraPane.Xmax = spotw;
7006
+// }
7007
+// if (CameraPane.Ymin > spot.y)
7008
+// {
7009
+// CameraPane.Ymin = spot.y;
7010
+// }
7011
+// if (CameraPane.Ymax < spoth)
7012
+// {
7013
+// CameraPane.Ymax = spoth;
7014
+// }
74357015 info.g.drawArc(boundary.x, boundary.y,
74367016 boundary.width, boundary.height, 0, 360);
74377017 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
7438
- if (CameraPane.Xmin > boundary.x)
7439
- {
7440
- CameraPane.Xmin = boundary.x;
7441
- }
7442
- if (CameraPane.Xmax < boundary.x + boundary.width)
7443
- {
7444
- CameraPane.Xmax = boundary.x + boundary.width;
7445
- }
7446
- if (CameraPane.Ymin > boundary.y)
7447
- {
7448
- CameraPane.Ymin = boundary.y;
7449
- }
7450
- if (CameraPane.Ymax < boundary.y + boundary.height)
7451
- {
7452
- CameraPane.Ymax = boundary.y + boundary.height;
7453
- }
7018
+// if (CameraPane.Xmin > boundary.x)
7019
+// {
7020
+// CameraPane.Xmin = boundary.x;
7021
+// }
7022
+// if (CameraPane.Xmax < boundary.x + boundary.width)
7023
+// {
7024
+// CameraPane.Xmax = boundary.x + boundary.width;
7025
+// }
7026
+// if (CameraPane.Ymin > boundary.y)
7027
+// {
7028
+// CameraPane.Ymin = boundary.y;
7029
+// }
7030
+// if (CameraPane.Ymax < boundary.y + boundary.height)
7031
+// {
7032
+// CameraPane.Ymax = boundary.y + boundary.height;
7033
+// }
74547034 return;
74557035 }
74567036 }
....@@ -7467,7 +7047,7 @@
74677047 startX = info.x;
74687048 startY = info.y;
74697049
7470
- hitSomething = 0;
7050
+ hitSomething = -1;
74717051 cVector origin = new cVector();
74727052 //LA.xformPos(origin, toParent, origin);
74737053 Rectangle spot = new Rectangle();
....@@ -7500,7 +7080,7 @@
75007080 }
75017081
75027082 //System.out.println("info.modifiers = " + info.modifiers);
7503
- modified = (info.modifiers & CameraPane.META) != 0;
7083
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
75047084 //System.out.println("modified = " + modified);
75057085 //new Exception().printStackTrace();
75067086 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7528,7 +7108,7 @@
75287108 return true;
75297109 }
75307110
7531
- void doEditDrag0(ClickInfo info)
7111
+ void doEditDrag0(ClickInfo info, boolean opposite)
75327112 {
75337113 if (hitSomething == 0)
75347114 {
....@@ -7543,6 +7123,7 @@
75437123 //System.out.println("hitSomething = " + hitSomething);
75447124
75457125 double scale = 0.005f * info.camera.Distance();
7126
+
75467127 cVector xlate = new cVector();
75477128 //cVector xlate2 = new cVector();
75487129 switch (hitSomething)
....@@ -7553,9 +7134,9 @@
75537134
75547135 case hitCenter: // Translate
75557136
7556
- scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance();
7137
+ scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
75577138
7558
- if (modified)
7139
+ if (modified || opposite)
75597140 {
75607141 //assert(false);
75617142 /*
....@@ -7601,10 +7182,10 @@
76017182 }
76027183 LA.xformDir(up, ClickInfo.matbuffer, up);
76037184 // if (!CameraPane.LOCALTRANSFORM)
7604
- LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up);
7185
+ LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
76057186 LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
76067187 // if (!CameraPane.LOCALTRANSFORM)
7607
- LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away);
7188
+ LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
76087189 //LA.vecCross(up, cVector.Z, right2);
76097190
76107191 cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
....@@ -7649,6 +7230,7 @@
76497230
76507231 if (modified)
76517232 {
7233
+ // Rotate 90 degrees
76527234 angle /= (Math.PI / 4);
76537235 angle = Math.floor(angle + 0.5);
76547236 angle *= (Math.PI / 4);
....@@ -7662,7 +7244,7 @@
76627244 }
76637245 /**/
76647246
7665
- switch (info.pane.renderCamera.viewCode)
7247
+ switch (info.pane.RenderCamera().viewCode)
76667248 {
76677249 case 1: // '\001'
76687250 LA.matZRotate(toParent, angle);
....@@ -7690,24 +7272,27 @@
76907272
76917273 case hitScale: // scale
76927274 double hScale = (double) (info.x - centerPt.x) / 32;
7275
+ double sign = 1;
7276
+ if (hScale < 0)
7277
+ {
7278
+ sign = -1;
7279
+ }
7280
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
76937281 if (hScale < 0.01)
76947282 {
7695
- hScale = 0.01;
7283
+ //hScale = 0.01;
76967284 }
7697
- hScale = Math.pow(hScale, scale * 50);
7698
- if (hScale < 0.01)
7699
- {
7700
- hScale = 0.01;
7701
- }
7285
+
77027286 double vScale = (double) (info.y - centerPt.y) / 32;
7703
- if (vScale < 0.01)
7287
+ sign = 1;
7288
+ if (vScale < 0)
77047289 {
7705
- vScale = 0.01;
7290
+ sign = -1;
77067291 }
7707
- vScale = Math.pow(vScale, scale * 50);
7292
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
77087293 if (vScale < 0.01)
77097294 {
7710
- vScale = 0.01;
7295
+ //vScale = 0.01;
77117296 }
77127297 LA.matCopy(startMat, toParent);
77137298 /**/
....@@ -7718,17 +7303,24 @@
77187303 }
77197304 /**/
77207305
7721
- switch (info.pane.renderCamera.viewCode)
7306
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7307
+
7308
+ if (totalScale < 0.01)
7309
+ {
7310
+ totalScale = 0.01;
7311
+ }
7312
+
7313
+ switch (info.pane.RenderCamera().viewCode)
77227314 {
77237315 case 3: // '\001'
77247316 if (modified)
77257317 {
77267318 //LA.matScale(toParent, 1, hScale, vScale);
7727
- LA.matScale(toParent, vScale, 1, 1);
7319
+ LA.matScale(toParent, totalScale, 1, 1);
77287320 } // vScale, 1);
77297321 else
77307322 {
7731
- LA.matScale(toParent, vScale, vScale, vScale);
7323
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
77327324 } // vScale, 1);
77337325 break;
77347326
....@@ -7736,10 +7328,10 @@
77367328 if (modified)
77377329 {
77387330 //LA.matScale(toParent, hScale, 1, vScale);
7739
- LA.matScale(toParent, 1, vScale, 1);
7331
+ LA.matScale(toParent, 1, totalScale, 1);
77407332 } else
77417333 {
7742
- LA.matScale(toParent, vScale, 1, vScale);
7334
+ LA.matScale(toParent, totalScale, 1, totalScale);
77437335 }
77447336 break;
77457337
....@@ -7747,10 +7339,10 @@
77477339 if (modified)
77487340 {
77497341 //LA.matScale(toParent, hScale, vScale, 1);
7750
- LA.matScale(toParent, 1, 1, vScale);
7342
+ LA.matScale(toParent, 1, 1, totalScale);
77517343 } else
77527344 {
7753
- LA.matScale(toParent, vScale, vScale, 1);
7345
+ LA.matScale(toParent, totalScale, totalScale, 1);
77547346 }
77557347 break;
77567348 }
....@@ -7883,14 +7475,22 @@
78837475 //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")";
78847476 //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString();
78857477 //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString();
7478
+
7479
+ String objname;
7480
+
78867481 if (false) //parent != null)
78877482 {
7888
- return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
7483
+ objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
78897484 } else
78907485 {
7891
- return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this);
7486
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
78927487 } // + super.toString();
78937488 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
7489
+
7490
+ if (!Globals.ADVANCED)
7491
+ return objname;
7492
+
7493
+ return objname + " " + System.identityHashCode(this);
78947494 }
78957495
78967496 public int hashCode()
....@@ -7946,6 +7546,7 @@
79467546 objectUI.closeUI();
79477547 if (editWindow != null)
79487548 {
7549
+ editWindow.ctrlPanel.FlushUI();
79497550 editWindow.refreshContents();
79507551 } // ? new
79517552 objectUI = null;
....@@ -8081,7 +7682,7 @@
80817682 {
80827683 assert(bRep != null);
80837684 if (!(support instanceof GenericJoint)) // support.bRep != null)
8084
- GrafreeD.Assert(support.bRep == bRep.support);
7685
+ Grafreed.Assert(support.bRep == bRep.support);
80857686 }
80867687 else
80877688 {
....@@ -8130,9 +7731,9 @@
81307731 private static cVector edge2 = new cVector();
81317732 //private static cVector norm = new cVector();
81327733 /*transient private*/ int hitSomething;
8133
- private static final int hitCenter = 1;
8134
- private static final int hitScale = 2;
8135
- private static final int hitRotate = 3;
7734
+ static final int hitCenter = 1;
7735
+ static final int hitScale = 2;
7736
+ static final int hitRotate = 3;
81367737 /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag
81377738 /*transient*/ private Point centerPt;
81387739 /*transient*/ private int startX;
....@@ -8164,6 +7765,8 @@
81647765 {
81657766 Object3D targ = this;
81667767
7768
+ targ.NORMALPUSH = obj.NORMALPUSH;
7769
+
81677770 if (obj.material != null)
81687771 {
81697772 if ((mask&MATERIAL)!=0) // ==(COLOR|MATERIAL))