Normand Briere
2019-04-24 07750666120cf38c7ad4f3a3a583a8c4d582bb0e
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;
....@@ -20,6 +21,19 @@
2021 static final long serialVersionUID = 5022536242724664900L;
2122
2223 ScriptNode scriptnode;
24
+
25
+ void InitOthers()
26
+ {
27
+ if (projectedVertices == null || projectedVertices.length <= 2)
28
+ {
29
+ projectedVertices = new Object3D.cVector2[3];
30
+ }
31
+ for (int i = 0; i < 3; i++)
32
+ {
33
+ projectedVertices[i] = new cVector2(); // Others
34
+ }
35
+ projectedVertices[0].x = 100; // bump
36
+ }
2337
2438 void MinMax(cVector minima, cVector maxima)
2539 {
....@@ -285,7 +299,6 @@
285299 return parent.GetName() + "#";
286300 }
287301
288
- boolean timeline = false;
289302 boolean live = false;
290303 boolean hide = false;
291304 boolean link2master = false; // performs reset support/master at each frame
....@@ -296,6 +309,8 @@
296309 boolean random = false;
297310 boolean speedup = false;
298311 boolean rewind = false;
312
+
313
+ float NORMALPUSH = 0;
299314
300315 Object3D support;
301316
....@@ -416,16 +431,16 @@
416431 {
417432 Object3D copy = this;
418433
419
- Camera parentcam = CameraPane.theRenderer.manipCamera;
434
+ Camera parentcam = Globals.theRenderer.ManipCamera();
420435
421
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[0])
436
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0])
422437 {
423
- parentcam = CameraPane.theRenderer.cameras[1];
438
+ parentcam = Globals.theRenderer.Cameras()[1];
424439 }
425440
426
- if (CameraPane.theRenderer.manipCamera == CameraPane.theRenderer.cameras[1])
441
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1])
427442 {
428
- parentcam = CameraPane.theRenderer.cameras[0];
443
+ parentcam = Globals.theRenderer.Cameras()[0];
429444 }
430445
431446 if (this == parentcam)
....@@ -433,7 +448,7 @@
433448 //assert(this instanceof Camera);
434449
435450 for (int count = parentcam.GetTransformCount(); --count>=0;)
436
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.toParent, CameraPane.theRenderer.targetLookAt);
451
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt());
437452 }
438453
439454 copy.marked ^= true;
....@@ -453,7 +468,7 @@
453468 //assert(this instanceof Camera);
454469
455470 for (int count = parentcam.GetTransformCount(); --count>=0;)
456
- LA.xformPos(CameraPane.theRenderer.targetLookAt, parentcam.fromParent, CameraPane.theRenderer.targetLookAt);
471
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt());
457472 }
458473
459474 copy.Touch(); // display list issue
....@@ -588,7 +603,7 @@
588603 return;
589604 }
590605
591
- if (CameraPane.fromscript)
606
+ if (Globals.fromscript)
592607 {
593608 transformcount = 0;
594609 return;
....@@ -746,7 +761,7 @@
746761
747762 int GetTransformCount()
748763 {
749
- // marde pour serialization de Texture
764
+ // patch pour serialization de Texture
750765 resetmaxcount();
751766 resettransformcount();
752767 resetstep();
....@@ -780,9 +795,12 @@
780795 // factor = CameraPane.STEP;
781796 // }
782797
783
- if (marked && CameraPane.isLIVE() && live && CameraPane.drawMode == CameraPane.SHADOW && currentframe != CameraPane.framecount)
798
+ if (marked && Globals.isLIVE() && live &&
799
+ //TEMP21aug2018
800
+ Globals.DrawMode() == iCameraPane.SHADOW &&
801
+ currentframe != Globals.framecount)
784802 {
785
- currentframe = CameraPane.framecount;
803
+ currentframe = Globals.framecount;
786804
787805 // System.err.println("transformcount = " + transformcount);
788806 // System.err.println("factor = " + factor);
....@@ -2131,15 +2149,8 @@
21312149 if (/*parent != null &&*/ material == null)
21322150 {
21332151 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
2152
+
2153
+ InitOthers();
21432154
21442155 if (this instanceof Camera)
21452156 {
....@@ -4162,6 +4173,22 @@
41624173 }
41634174 }
41644175
4176
+ void RepairShadow()
4177
+ {
4178
+ if (blockloop)
4179
+ return;
4180
+
4181
+ if (this.material != null)
4182
+ this.InitOthers();
4183
+
4184
+ for (int i=0; i<Size(); i++)
4185
+ {
4186
+ blockloop = true;
4187
+ get(i).RepairShadow();
4188
+ blockloop = false;
4189
+ }
4190
+ }
4191
+
41654192 void RepairTexture()
41664193 {
41674194 if (this instanceof FileObject || blockloop)
....@@ -4828,7 +4855,7 @@
48284855 return globalTransform;
48294856 }
48304857
4831
- void PreprocessOcclusion(CameraPane cp)
4858
+ void PreprocessOcclusion(iCameraPane cp)
48324859 {
48334860 /*
48344861 if (AOdone)
....@@ -4975,7 +5002,8 @@
49755002 } else //
49765003 if (editWindow != null)
49775004 {
4978
- editWindow.cameraView.lighttouched = true;
5005
+ //editWindow.cameraView.lighttouched = true;
5006
+ Globals.lighttouched = true;
49795007 }
49805008 }
49815009
....@@ -5287,25 +5315,22 @@
52875315 }
52885316 }
52895317
5290
- void draw(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5318
+ void draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
52915319 {
52925320 Draw(display, root, selected, blocked);
52935321 }
52945322
5295
- static cMaterial[] materialstack = new cMaterial[65536];
5296
- static boolean[] selectedstack = new boolean[65536];
5297
- static int materialdepth = 0;
5298
-
52995323 boolean NeedSupport()
53005324 {
53015325 return
53025326 CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
53035327 // PROBLEM with CROWD!!
5304
- && (CameraPane.drawMode == CameraPane.SHADOW || CameraPane.CROWD);
5328
+ && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
53055329 }
53065330
5331
+ static boolean DEBUG_SELECTION = false;
53075332
5308
- void Draw(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5333
+ void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
53095334 {
53105335 Invariants(); // june 2013
53115336
....@@ -5314,7 +5339,7 @@
53145339 // System.err.println("Draw " + this + " Frame # " + ((Mocap)((Merge)support).object).frame);
53155340 }
53165341
5317
- if (display.drawMode == CameraPane.SELECTION &&
5342
+ if (display.DrawMode() == iCameraPane.SELECTION &&
53185343 hide)
53195344 return;
53205345
....@@ -5333,7 +5358,7 @@
53335358 if (this instanceof Checker)
53345359 return;
53355360
5336
- if (display.drawMode == display.SHADOW && PASSTEST)
5361
+ if (display.DrawMode() == display.SHADOW && PASSTEST)
53375362 return;
53385363
53395364 if (count <= 0)
....@@ -5341,13 +5366,13 @@
53415366 return;
53425367 }
53435368
5344
- if ((//display.drawMode == CameraPane.SHADOW ||
5345
- display.drawMode == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency())
5369
+ if ((//display.DrawMode() == CameraPane.SHADOW ||
5370
+ display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency())
53465371 {
53475372 return;
53485373 }
53495374
5350
- javax.media.opengl.GL gl = display.GetGL();
5375
+ //javax.media.opengl.GL gl = display.GetGL();
53515376
53525377 /*
53535378 if (touched)
....@@ -5383,15 +5408,15 @@
53835408
53845409 boolean compiled = false;
53855410
5386
- boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION;
5411
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
53875412
5388
- if (!selectmode && //display.drawMode != display.SELECTION &&
5413
+ if (!selectmode && //display.DrawMode() != display.SELECTION &&
53895414 (touched || (bRep != null && bRep.displaylist <= 0)))
53905415 {
5391
- display.lighttouched = true;
5416
+ Globals.lighttouched = true;
53925417 } // 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 &&
5418
+ //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
5419
+ if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
53955420 (touched || (bRep != null && bRep.displaylist <= 0)))
53965421 {
53975422 if (!(this instanceof Composite))
....@@ -5399,7 +5424,7 @@
53995424 //if (displaylist == -1 && usecalllists)
54005425 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54015426 {
5402
- bRep.displaylist = gl.glGenLists(1);
5427
+ bRep.displaylist = display.GenList();
54035428 assert(bRep.displaylist != 0);
54045429 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54055430 //System.out.println("\tgen list " + list);
....@@ -5411,18 +5436,20 @@
54115436 if (usecalllists)
54125437 {
54135438 // System.err.println("new list " + bRep.displaylist + " for " + this);
5414
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5439
+ display.NewList(bRep.displaylist);
54155440 }
5441
+
54165442 CallList(display, root, selected, blocked);
5443
+
54175444 // compiled = true;
54185445 if (usecalllists)
54195446 {
54205447 // System.err.println("end list " + bRep.displaylist + " for " + this);
5421
- gl.glEndList();
5448
+ display.EndList();
54225449 }
54235450 //gl.glDrawBuffer(gl.GL_BACK);
54245451 // XXX touched = false;
5425
- display.lighttouched = true; // all panes...
5452
+ Globals.lighttouched = true; // all panes...
54265453 }
54275454
54285455 touched = GetBRep() == null; // this instanceof Composite || this instanceof FileObject; // false;
....@@ -5461,12 +5488,12 @@
54615488
54625489 // frustum culling
54635490 if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid
5464
- && display.drawMode != CameraPane.SELECTION)
5491
+ && display.DrawMode() != iCameraPane.SELECTION)
54655492 {
5466
- if (display.drawMode == CameraPane.SHADOW)
5493
+ if (display.DrawMode() == iCameraPane.SHADOW)
54675494 {
54685495 if (!link2master // tricky to cull in shadow mode.
5469
- && GetBRep().FrustumCull(this, gl, display.lightCamera, true))
5496
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54705497 {
54715498 //System.out.print("CULLED");
54725499 culled = true;
....@@ -5474,7 +5501,7 @@
54745501 }
54755502 else
54765503 //GetBRep().getBounds(v0, v1, this);
5477
- if (GetBRep().FrustumCull(this, gl, display.renderCamera, false))
5504
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
54785505 culled = true;
54795506
54805507 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5510,11 +5537,11 @@
55105537
55115538
55125539 if (!culled)
5513
- if (display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION)
5540
+ if (display.DrawMode() == display.SELECTION || display.IsDebugSelection())
55145541 {
55155542 if (GetBRep() != null)
55165543 {
5517
- CameraPane.NextIndex(this, gl);
5544
+ display.NextIndex();
55185545 // vertex color conflict : gl.glCallList(list);
55195546 DrawNode(display, root, selected);
55205547 if (this instanceof BezierPatch)
....@@ -5536,55 +5563,7 @@
55365563 color[2] /= 2;
55375564 gl.glMaterialfv(gl.GL_BACK, gl.GL_AMBIENT_AND_DIFFUSE, color, 0);
55385565 */
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
- }
5566
+ display.PushMaterial(this, selected);
55885567
55895568 //System.out.println("call list " + list);
55905569 //System.out.println();
....@@ -5619,30 +5598,15 @@
56195598
56205599 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
56215600 assert(bRep.displaylist != 0);
5622
- gl.glCallList(bRep.displaylist);
5601
+ display.CallList(bRep.displaylist);
56235602 // june 2013 drawSelf(display, root, selected);
56245603 }
56255604 }
56265605 }
56275606
56285607 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
- }
5608
+
5609
+ display.PopMaterial(this, selected);
56465610 }
56475611
56485612 if (this instanceof Texture || this instanceof TextureNode)
....@@ -5684,7 +5648,7 @@
56845648 // resetMasterNode();
56855649 }
56865650
5687
- void CallList(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5651
+ void CallList(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
56885652 {
56895653 if (GetBRep() == null)
56905654 {
....@@ -5767,7 +5731,7 @@
57675731 boolean flipV = false; // true;
57685732 int texres = 0; // 0 = low, 1 = normal, 2 = high res texture
57695733
5770
- void drawSelf(CameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
5734
+ void drawSelf(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
57715735 {
57725736 if (hide)
57735737 return;
....@@ -5826,16 +5790,7 @@
58265790 // // ??????????????????????????? Touch();
58275791 // }
58285792
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
- }
5793
+display.PushMaterial2(this, selected);
58395794
58405795 Object3D child;
58415796 boolean sel;
....@@ -5887,19 +5842,7 @@
58875842 */
58885843 //depth += 1;
58895844
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
-
5845
+display.PopMaterial2(this);
59035846 /*
59045847 display.ReleaseTextures(tex);
59055848 */
....@@ -5910,9 +5853,9 @@
59105853
59115854 //static cVector min,max;
59125855
5913
- void DrawNode(CameraPane display, Object3D /*Composite*/ root, boolean selected)
5856
+ void DrawNode(iCameraPane display, Object3D /*Composite*/ root, boolean selected)
59145857 {
5915
- if (display.drawMode == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
5858
+ if (display.DrawMode() == display.SHADOW && projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000)
59165859 return; // no shadow for transparent objects
59175860
59185861 if (hide)
....@@ -5957,9 +5900,9 @@
59575900
59585901 // bRep.lock = true;
59595902
5960
- javax.media.opengl.GL gl = display.GetGL();
5903
+ //javax.media.opengl.GL gl = display.GetGL();
59615904
5962
- if (CameraPane.BOXMODE) // || CameraPane.movingcamera)
5905
+ if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59635906 {
59645907 int fc = bRep.FaceCount();
59655908 int vc = bRep.VertexCount();
....@@ -5974,23 +5917,7 @@
59745917
59755918 bRep.getMinMax(min, max, 100);
59765919
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();
5920
+ display.DrawBox(min, max);
59945921
59955922 return;
59965923 }
....@@ -6034,7 +5961,7 @@
60345961 {
60355962 //throw new Error();
60365963
6037
- boolean selectmode = display.drawMode == display.SELECTION || CameraPane.DEBUG_SELECTION;
5964
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
60385965
60395966 int[] strips = bRep.getRawIndices();
60405967
....@@ -6044,178 +5971,14 @@
60445971 new Exception().printStackTrace();
60455972 return;
60465973 }
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
- }
5974
+
5975
+ display.DrawGeometry(bRep, flipV, selectmode);
62135976 } else // catch (Error e)
62145977 {
62155978 // TRIANGLE ARRAY
62165979 if (IsOpaque()) // Static())
62175980 {
6218
- gl.glBegin(gl.GL_TRIANGLES);
5981
+ display.StartTriangles();
62195982 int facecount = bRep.FaceCount();
62205983 for (int i = 0; i < facecount; i++)
62215984 {
....@@ -6278,9 +6041,9 @@
62786041 // // r.norm.dot(v3) > -0.5)
62796042 // // continue;
62806043
6281
- drawFace(p, q, r, display, face);
6044
+ display.DrawFace(this, p, q, r, face);
62826045 }
6283
- gl.glEnd();
6046
+ display.EndTriangles();
62846047 }
62856048 else
62866049 {
....@@ -6309,8 +6072,8 @@
63096072 //System.out.println("SORT");
63106073
63116074 java.util.Arrays.sort(facescompare);
6312
-
6313
- gl.glBegin(gl.GL_TRIANGLES);
6075
+
6076
+ display.StartTriangles();
63146077 for (int i = 0; i < facecount; i++)
63156078 {
63166079 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6322,13 +6085,14 @@
63226085 Vertex q = bRep.GetVertex(face.q);
63236086 Vertex r = bRep.GetVertex(face.r);
63246087
6325
- drawFace(p, q, r, display, face);
6088
+ display.DrawFace(this, p, q, r, face);
63266089 }
6327
- gl.glEnd();
6090
+ display.EndTriangles();
63286091 }
63296092
63306093 if (false) // live && support != null && support.bRep != null) // debug weights
63316094 {
6095
+ /*
63326096 gl.glDisable(gl.GL_LIGHTING);
63336097 float[] colorV = new float[3];
63346098
....@@ -6407,6 +6171,7 @@
64076171 // gl.glEnd();
64086172 }
64096173 }
6174
+ */
64106175 }
64116176 }
64126177
....@@ -6451,7 +6216,7 @@
64516216 center.add(r);
64526217 center.mul(1.0/3);
64536218
6454
- center.sub(CameraPane.theRenderer.eyeCamera.location);
6219
+ center.sub(Globals.theRenderer.EyeCamera().location);
64556220
64566221 distance = center.dot(center);
64576222 }
....@@ -6462,347 +6227,11 @@
64626227
64636228 transient FaceCompare[] facescompare = null;
64646229
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
-
66396230 void Print(Vertex v)
66406231 {
66416232 //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")");
66426233 }
66436234
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
-
68066235 void drawSelf(ClickInfo info, int level, boolean select)
68076236 {
68086237 if (bRep == null)
....@@ -7374,83 +6803,83 @@
73746803 int spotw = spot.x + spot.width;
73756804 int spoth = spot.y + spot.height;
73766805 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
- }
6806
+// if (CameraPane.Xmin > spot.x)
6807
+// {
6808
+// CameraPane.Xmin = spot.x;
6809
+// }
6810
+// if (CameraPane.Xmax < spotw)
6811
+// {
6812
+// CameraPane.Xmax = spotw;
6813
+// }
6814
+// if (CameraPane.Ymin > spot.y)
6815
+// {
6816
+// CameraPane.Ymin = spot.y;
6817
+// }
6818
+// if (CameraPane.Ymax < spoth)
6819
+// {
6820
+// CameraPane.Ymax = spoth;
6821
+// }
73936822 spot.translate(32, 32);
73946823 spotw = spot.x + spot.width;
73956824 spoth = spot.y + spot.height;
73966825 info.g.setColor(Color.blue);
73976826 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
- }
6827
+// if (CameraPane.Xmin > spot.x)
6828
+// {
6829
+// CameraPane.Xmin = spot.x;
6830
+// }
6831
+// if (CameraPane.Xmax < spotw)
6832
+// {
6833
+// CameraPane.Xmax = spotw;
6834
+// }
6835
+// if (CameraPane.Ymin > spot.y)
6836
+// {
6837
+// CameraPane.Ymin = spot.y;
6838
+// }
6839
+// if (CameraPane.Ymax < spoth)
6840
+// {
6841
+// CameraPane.Ymax = spoth;
6842
+// }
74146843 info.g.drawLine(spotw, spoth, spotw, spoth - 15);
74156844 info.g.drawLine(spotw, spoth, spotw - 15, spoth);
74166845 spot.translate(0, -32);
74176846 info.g.setColor(Color.green);
74186847 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
- }
6848
+// if (CameraPane.Xmin > spot.x)
6849
+// {
6850
+// CameraPane.Xmin = spot.x;
6851
+// }
6852
+// if (CameraPane.Xmax < spotw)
6853
+// {
6854
+// CameraPane.Xmax = spotw;
6855
+// }
6856
+// if (CameraPane.Ymin > spot.y)
6857
+// {
6858
+// CameraPane.Ymin = spot.y;
6859
+// }
6860
+// if (CameraPane.Ymax < spoth)
6861
+// {
6862
+// CameraPane.Ymax = spoth;
6863
+// }
74356864 info.g.drawArc(boundary.x, boundary.y,
74366865 boundary.width, boundary.height, 0, 360);
74376866 //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
- }
6867
+// if (CameraPane.Xmin > boundary.x)
6868
+// {
6869
+// CameraPane.Xmin = boundary.x;
6870
+// }
6871
+// if (CameraPane.Xmax < boundary.x + boundary.width)
6872
+// {
6873
+// CameraPane.Xmax = boundary.x + boundary.width;
6874
+// }
6875
+// if (CameraPane.Ymin > boundary.y)
6876
+// {
6877
+// CameraPane.Ymin = boundary.y;
6878
+// }
6879
+// if (CameraPane.Ymax < boundary.y + boundary.height)
6880
+// {
6881
+// CameraPane.Ymax = boundary.y + boundary.height;
6882
+// }
74546883 return;
74556884 }
74566885 }
....@@ -7553,7 +6982,7 @@
75536982
75546983 case hitCenter: // Translate
75556984
7556
- scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance();
6985
+ scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
75576986
75586987 if (modified)
75596988 {
....@@ -7601,10 +7030,10 @@
76017030 }
76027031 LA.xformDir(up, ClickInfo.matbuffer, up);
76037032 // if (!CameraPane.LOCALTRANSFORM)
7604
- LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up);
7033
+ LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
76057034 LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
76067035 // if (!CameraPane.LOCALTRANSFORM)
7607
- LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away);
7036
+ LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
76087037 //LA.vecCross(up, cVector.Z, right2);
76097038
76107039 cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
....@@ -7662,7 +7091,7 @@
76627091 }
76637092 /**/
76647093
7665
- switch (info.pane.renderCamera.viewCode)
7094
+ switch (info.pane.RenderCamera().viewCode)
76667095 {
76677096 case 1: // '\001'
76687097 LA.matZRotate(toParent, angle);
....@@ -7718,7 +7147,7 @@
77187147 }
77197148 /**/
77207149
7721
- switch (info.pane.renderCamera.viewCode)
7150
+ switch (info.pane.RenderCamera().viewCode)
77227151 {
77237152 case 3: // '\001'
77247153 if (modified)
....@@ -8164,6 +7593,8 @@
81647593 {
81657594 Object3D targ = this;
81667595
7596
+ targ.NORMALPUSH = obj.NORMALPUSH;
7597
+
81677598 if (obj.material != null)
81687599 {
81697600 if ((mask&MATERIAL)!=0) // ==(COLOR|MATERIAL))