Normand Briere
2019-05-05 623dc0fa8cbd9473830a1786f6d49fa808a09439
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;
....@@ -430,16 +431,16 @@
430431 {
431432 Object3D copy = this;
432433
433
- Camera parentcam = CameraPane.theRenderer.ManipCamera();
434
+ Camera parentcam = Globals.theRenderer.ManipCamera();
434435
435
- if (CameraPane.theRenderer.ManipCamera() == CameraPane.theRenderer.Cameras()[0])
436
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[0])
436437 {
437
- parentcam = CameraPane.theRenderer.Cameras()[1];
438
+ parentcam = Globals.theRenderer.Cameras()[1];
438439 }
439440
440
- if (CameraPane.theRenderer.ManipCamera() == CameraPane.theRenderer.Cameras()[1])
441
+ if (Globals.theRenderer.ManipCamera() == Globals.theRenderer.Cameras()[1])
441442 {
442
- parentcam = CameraPane.theRenderer.Cameras()[0];
443
+ parentcam = Globals.theRenderer.Cameras()[0];
443444 }
444445
445446 if (this == parentcam)
....@@ -447,7 +448,7 @@
447448 //assert(this instanceof Camera);
448449
449450 for (int count = parentcam.GetTransformCount(); --count>=0;)
450
- LA.xformPos(CameraPane.theRenderer.TargetLookAt(), parentcam.toParent, CameraPane.theRenderer.TargetLookAt());
451
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.toParent, Globals.theRenderer.TargetLookAt());
451452 }
452453
453454 copy.marked ^= true;
....@@ -467,7 +468,7 @@
467468 //assert(this instanceof Camera);
468469
469470 for (int count = parentcam.GetTransformCount(); --count>=0;)
470
- LA.xformPos(CameraPane.theRenderer.TargetLookAt(), parentcam.fromParent, CameraPane.theRenderer.TargetLookAt());
471
+ LA.xformPos(Globals.theRenderer.TargetLookAt(), parentcam.fromParent, Globals.theRenderer.TargetLookAt());
471472 }
472473
473474 copy.Touch(); // display list issue
....@@ -953,7 +954,7 @@
953954
954955 public Object clone()
955956 {
956
- return GrafreeD.clone(this);
957
+ return Grafreed.clone(this);
957958 }
958959
959960 Object3D copyExpand()
....@@ -1728,7 +1729,7 @@
17281729 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17291730 o.bRep = transientrep;
17301731 if (clone)
1731
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1732
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17321733 o.CreateMaterial();
17331734 o.SetAttributes(this, -1);
17341735 //parent
....@@ -1741,7 +1742,7 @@
17411742 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17421743 o.bRep = bRep;
17431744 if (clone)
1744
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1745
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17451746 o.CreateMaterial();
17461747 //o.overwriteThis(this, -1);
17471748 o.SetAttributes(this, -1);
....@@ -2299,6 +2300,7 @@
22992300 {
23002301 if (newWindow)
23012302 {
2303
+ new Exception().printStackTrace();
23022304 System.exit(0);
23032305 if (parent != null)
23042306 {
....@@ -2475,13 +2477,13 @@
24752477 return retval;
24762478 }
24772479
2478
- void doEditDrag(ClickInfo info)
2480
+ void doEditDrag(ClickInfo info, boolean opposite)
24792481 {
24802482 switch (doSomething)
24812483 {
24822484 case 1: // '\001'
24832485 //super.
2484
- doEditDrag0(info);
2486
+ doEditDrag0(info, opposite);
24852487 break;
24862488
24872489 case 2: // '\002'
....@@ -2494,11 +2496,11 @@
24942496 {
24952497 //sel.hitSomething = childToDrag.hitSomething;
24962498 //childToDrag.doEditDrag(info);
2497
- sel.doEditDrag(info);
2499
+ sel.doEditDrag(info, opposite);
24982500 } else
24992501 {
25002502 //super.
2501
- doEditDrag0(info);
2503
+ doEditDrag0(info, opposite);
25022504 }
25032505 }
25042506 break;
....@@ -2905,7 +2907,8 @@
29052907 {
29062908 if (bRep != null)
29072909 {
2908
- bRep.GenUV();
2910
+ bRep.GenUV(); //1);
2911
+ //bRep.UnfoldUV();
29092912 Touch();
29102913 }
29112914 }
....@@ -3201,7 +3204,7 @@
32013204
32023205 BoundaryRep sup = bRep.support;
32033206 bRep.support = null;
3204
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3207
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32053208 // bRep.SplitInTwo(onlyone); // thread...
32063209 temprep.SplitInTwo(reduction34, onlyone);
32073210 bRep = temprep;
....@@ -3725,7 +3728,7 @@
37253728 if (child == null)
37263729 continue;
37273730
3728
- if (GrafreeD.RENDERME > 0)
3731
+ if (Grafreed.RENDERME > 0)
37293732 {
37303733 if (child instanceof Merge)
37313734 ((Merge)child).renderme();
....@@ -3876,7 +3879,7 @@
38763879 if (child == null)
38773880 continue;
38783881
3879
- if (GrafreeD.RENDERME > 0)
3882
+ if (Grafreed.RENDERME > 0)
38803883 {
38813884 if (child instanceof Merge)
38823885 ((Merge)child).renderme();
....@@ -4071,7 +4074,7 @@
40714074 if (child == null)
40724075 continue;
40734076
4074
- if (GrafreeD.RENDERME > 0)
4077
+ if (Grafreed.RENDERME > 0)
40754078 {
40764079 if (child instanceof Merge)
40774080 ((Merge)child).renderme();
....@@ -5156,10 +5159,34 @@
51565159
51575160 // System.out.println("Fullname = " + fullname);
51585161
5159
- if (fullname.name.indexOf(":") == -1)
5160
- return fullname.name;
5162
+ // Does not work on Windows due to C:
5163
+// if (fullname.name.indexOf(":") == -1)
5164
+// return fullname.name;
5165
+//
5166
+// return fullname.name.substring(0,fullname.name.indexOf(":"));
51615167
5162
- return fullname.name.substring(0,fullname.name.indexOf(":"));
5168
+ String[] split = fullname.name.split(":");
5169
+
5170
+ if (split.length == 0)
5171
+ {
5172
+ return "";
5173
+ }
5174
+
5175
+ if (split.length <= 2)
5176
+ {
5177
+ if (fullname.name.endsWith(":"))
5178
+ {
5179
+ // Windows
5180
+ return fullname.name.substring(0, fullname.name.length()-1);
5181
+ }
5182
+
5183
+ return split[0];
5184
+ }
5185
+
5186
+ // Windows
5187
+ assert(split.length == 4);
5188
+
5189
+ return split[0] + ":" + split[1];
51635190 }
51645191
51655192 static String GetBump(cTexture fullname)
....@@ -5168,10 +5195,38 @@
51685195 return "";
51695196
51705197 // System.out.println("Fullname = " + fullname);
5171
- if (fullname.name.indexOf(":") == -1)
5172
- return "";
5173
-
5174
- return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5198
+ // Does not work on Windows due to C:
5199
+// if (fullname.name.indexOf(":") == -1)
5200
+// return "";
5201
+//
5202
+// return fullname.name.substring(fullname.name.indexOf(":")+1,fullname.name.length());
5203
+ String[] split = fullname.name.split(":");
5204
+
5205
+ if (split.length == 0)
5206
+ {
5207
+ return "";
5208
+ }
5209
+
5210
+ if (split.length == 1)
5211
+ {
5212
+ return "";
5213
+ }
5214
+
5215
+ if (split.length == 2)
5216
+ {
5217
+ if (fullname.name.endsWith(":"))
5218
+ {
5219
+ // Windows
5220
+ return "";
5221
+ }
5222
+
5223
+ return split[1];
5224
+ }
5225
+
5226
+ // Windows
5227
+ assert(split.length == 4);
5228
+
5229
+ return split[2] + ":" + split[3];
51755230 }
51765231
51775232 String GetPigmentTexture()
....@@ -5245,7 +5300,7 @@
52455300 System.out.print("; textures = " + textures);
52465301 System.out.println("; usedtextures = " + usedtextures);
52475302
5248
- if (GetTextures() == null)
5303
+ if (GetTextures() == null) // What is that??
52495304 GetTextures().name = ":";
52505305
52515306 String texname = tex;
....@@ -5371,7 +5426,7 @@
53715426 return;
53725427 }
53735428
5374
- javax.media.opengl.GL gl = display.GetGL();
5429
+ //javax.media.opengl.GL gl = display.GetGL();
53755430
53765431 /*
53775432 if (touched)
....@@ -5423,7 +5478,7 @@
54235478 //if (displaylist == -1 && usecalllists)
54245479 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54255480 {
5426
- bRep.displaylist = gl.glGenLists(1);
5481
+ bRep.displaylist = display.GenList();
54275482 assert(bRep.displaylist != 0);
54285483 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54295484 //System.out.println("\tgen list " + list);
....@@ -5435,14 +5490,16 @@
54355490 if (usecalllists)
54365491 {
54375492 // System.err.println("new list " + bRep.displaylist + " for " + this);
5438
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5493
+ display.NewList(bRep.displaylist);
54395494 }
5495
+
54405496 CallList(display, root, selected, blocked);
5497
+
54415498 // compiled = true;
54425499 if (usecalllists)
54435500 {
54445501 // System.err.println("end list " + bRep.displaylist + " for " + this);
5445
- gl.glEndList();
5502
+ display.EndList();
54465503 }
54475504 //gl.glDrawBuffer(gl.GL_BACK);
54485505 // XXX touched = false;
....@@ -5490,7 +5547,7 @@
54905547 if (display.DrawMode() == iCameraPane.SHADOW)
54915548 {
54925549 if (!link2master // tricky to cull in shadow mode.
5493
- && GetBRep().FrustumCull(this, gl, display.LightCamera(), true))
5550
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54945551 {
54955552 //System.out.print("CULLED");
54965553 culled = true;
....@@ -5498,7 +5555,7 @@
54985555 }
54995556 else
55005557 //GetBRep().getBounds(v0, v1, this);
5501
- if (GetBRep().FrustumCull(this, gl, display.RenderCamera(), false))
5558
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
55025559 culled = true;
55035560
55045561 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5538,7 +5595,7 @@
55385595 {
55395596 if (GetBRep() != null)
55405597 {
5541
- CameraPane.NextIndex(this, gl);
5598
+ display.NextIndex();
55425599 // vertex color conflict : gl.glCallList(list);
55435600 DrawNode(display, root, selected);
55445601 if (this instanceof BezierPatch)
....@@ -5595,7 +5652,7 @@
55955652
55965653 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
55975654 assert(bRep.displaylist != 0);
5598
- gl.glCallList(bRep.displaylist);
5655
+ display.CallList(bRep.displaylist);
55995656 // june 2013 drawSelf(display, root, selected);
56005657 }
56015658 }
....@@ -5895,9 +5952,10 @@
58955952 return;
58965953 }
58975954
5955
+ //bRep.GenUV(1/material.diffuseness);
58985956 // bRep.lock = true;
58995957
5900
- javax.media.opengl.GL gl = display.GetGL();
5958
+ //javax.media.opengl.GL gl = display.GetGL();
59015959
59025960 if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59035961 {
....@@ -5914,23 +5972,7 @@
59145972
59155973 bRep.getMinMax(min, max, 100);
59165974
5917
- gl.glBegin(gl.GL_LINES);
5918
-
5919
- gl.glVertex3d(min.x, min.y, min.z);
5920
- gl.glVertex3d(min.x, min.y, max.z);
5921
- gl.glVertex3d(min.x, min.y, min.z);
5922
- gl.glVertex3d(min.x, max.y, min.z);
5923
- gl.glVertex3d(min.x, min.y, min.z);
5924
- gl.glVertex3d(max.x, min.y, min.z);
5925
-
5926
- gl.glVertex3d(max.x, max.y, max.z);
5927
- gl.glVertex3d(min.x, max.y, max.z);
5928
- gl.glVertex3d(max.x, max.y, max.z);
5929
- gl.glVertex3d(max.x, min.y, max.z);
5930
- gl.glVertex3d(max.x, max.y, max.z);
5931
- gl.glVertex3d(max.x, max.y, min.z);
5932
-
5933
- gl.glEnd();
5975
+ display.DrawBox(min, max);
59345976
59355977 return;
59365978 }
....@@ -5984,178 +6026,14 @@
59846026 new Exception().printStackTrace();
59856027 return;
59866028 }
5987
-
5988
- // TRIANGLE STRIP ARRAY
5989
- if (bRep.trimmed)
5990
- {
5991
- float[] v = bRep.getRawVertices();
5992
- float[] n = bRep.getRawNormals();
5993
- float[] c = bRep.getRawColors();
5994
- float[] uv = bRep.getRawUVMap();
5995
-
5996
- int count2 = 0;
5997
- int count3 = 0;
5998
-
5999
- if (n.length > 0)
6000
- {
6001
- for (int i = 0; i < strips.length; i++)
6002
- {
6003
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6004
-
6005
- /*
6006
- boolean locked = false;
6007
- float eps = 0.1f;
6008
- boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
6009
-
6010
- int dot = 0;
6011
-
6012
- if ((dot&1) == 0)
6013
- dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
6014
-
6015
- if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
6016
- gl.glTexCoord2f((float) qv.s, (float) qv.t);
6017
- else
6018
- {
6019
- locked = true;
6020
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6021
- }
6022
- //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6023
- gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
6024
- if (hasnorm)
6025
- {
6026
- //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6027
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6028
- }
6029
-
6030
- if ((dot&4) == 0)
6031
- dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
6032
-
6033
- if (wrap || !locked && (dot&8) != 0)
6034
- gl.glTexCoord2f((float) rv.s, (float) rv.t);
6035
- else
6036
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6037
-
6038
- f.dot = dot;
6039
- */
6040
-
6041
- if (!selectmode)
6042
- {
6043
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6044
- {
6045
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6046
- } else
6047
- {
6048
- gl.glNormal3f(0, 0, 1);
6049
- }
6050
-
6051
- if (c != null)
6052
- //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
6053
- {
6054
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6055
- }
6056
- }
6057
- if (flipV)
6058
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6059
- else
6060
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6061
- //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6062
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6063
-
6064
- count2 += 2;
6065
- count3 += 3;
6066
- if (!selectmode)
6067
- {
6068
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6069
- {
6070
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6071
- } else
6072
- {
6073
- gl.glNormal3f(0, 0, 1);
6074
- }
6075
- if (c != null)
6076
- {
6077
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6078
- }
6079
- }
6080
- if (flipV)
6081
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6082
- else
6083
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6084
- //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6085
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6086
-
6087
- count2 += 2;
6088
- count3 += 3;
6089
- for (int j = 0; j < strips[i] - 2; j++)
6090
- {
6091
- //gl.glTexCoord2d(...);
6092
- if (!selectmode)
6093
- {
6094
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6095
- {
6096
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6097
- } else
6098
- {
6099
- gl.glNormal3f(0, 0, 1);
6100
- }
6101
- if (c != null)
6102
- {
6103
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6104
- }
6105
- }
6106
-
6107
- if (flipV)
6108
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6109
- else
6110
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6111
- //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
6112
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6113
- count2 += 2;
6114
- count3 += 3;
6115
- }
6116
-
6117
- gl.glEnd();
6118
- }
6119
- }
6120
-
6121
- assert count3 == v.length;
6122
- }
6123
- else // !trimmed
6124
- {
6125
- int count = 0;
6126
- for (int i = 0; i < strips.length; i++)
6127
- {
6128
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6129
-
6130
- Vertex p = bRep.GetVertex(bRep.indices[count++]);
6131
- Vertex q = bRep.GetVertex(bRep.indices[count++]);
6132
-
6133
- drawVertex(gl, p, selectmode);
6134
- drawVertex(gl, q, selectmode);
6135
-
6136
- for (int j = 0; j < strips[i] - 2; j++)
6137
- {
6138
- Vertex r = bRep.GetVertex(bRep.indices[count++]);
6139
-
6140
-// if (j%2 == 0)
6141
-// drawFace(p, q, r, display, null);
6142
-// else
6143
-// drawFace(p, r, q, display, null);
6144
-
6145
-// p = q;
6146
-// q = r;
6147
- drawVertex(gl, r, selectmode);
6148
- }
6149
-
6150
- gl.glEnd();
6151
- }
6152
- }
6029
+
6030
+ display.DrawGeometry(bRep, flipV, selectmode);
61536031 } else // catch (Error e)
61546032 {
61556033 // TRIANGLE ARRAY
61566034 if (IsOpaque()) // Static())
61576035 {
6158
- gl.glBegin(gl.GL_TRIANGLES);
6036
+ display.StartTriangles();
61596037 int facecount = bRep.FaceCount();
61606038 for (int i = 0; i < facecount; i++)
61616039 {
....@@ -6220,7 +6098,7 @@
62206098
62216099 display.DrawFace(this, p, q, r, face);
62226100 }
6223
- gl.glEnd();
6101
+ display.EndTriangles();
62246102 }
62256103 else
62266104 {
....@@ -6249,8 +6127,8 @@
62496127 //System.out.println("SORT");
62506128
62516129 java.util.Arrays.sort(facescompare);
6252
-
6253
- gl.glBegin(gl.GL_TRIANGLES);
6130
+
6131
+ display.StartTriangles();
62546132 for (int i = 0; i < facecount; i++)
62556133 {
62566134 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6264,11 +6142,12 @@
62646142
62656143 display.DrawFace(this, p, q, r, face);
62666144 }
6267
- gl.glEnd();
6145
+ display.EndTriangles();
62686146 }
62696147
62706148 if (false) // live && support != null && support.bRep != null) // debug weights
62716149 {
6150
+ /*
62726151 gl.glDisable(gl.GL_LIGHTING);
62736152 float[] colorV = new float[3];
62746153
....@@ -6347,6 +6226,7 @@
63476226 // gl.glEnd();
63486227 }
63496228 }
6229
+ */
63506230 }
63516231 }
63526232
....@@ -6391,7 +6271,7 @@
63916271 center.add(r);
63926272 center.mul(1.0/3);
63936273
6394
- center.sub(CameraPane.theRenderer.eyeCamera.location);
6274
+ center.sub(Globals.theRenderer.EyeCamera().location);
63956275
63966276 distance = center.dot(center);
63976277 }
....@@ -6405,22 +6285,6 @@
64056285 void Print(Vertex v)
64066286 {
64076287 //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")");
6408
- }
6409
-
6410
- void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode)
6411
- {
6412
- if (!selectmode)
6413
- {
6414
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6415
- gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
6416
-
6417
- if (flipV)
6418
- gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
6419
- else
6420
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6421
- }
6422
-
6423
- gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
64246288 }
64256289
64266290 void drawSelf(ClickInfo info, int level, boolean select)
....@@ -7120,7 +6984,7 @@
71206984 }
71216985
71226986 //System.out.println("info.modifiers = " + info.modifiers);
7123
- modified = (info.modifiers & CameraPane.META) != 0;
6987
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
71246988 //System.out.println("modified = " + modified);
71256989 //new Exception().printStackTrace();
71266990 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7148,7 +7012,7 @@
71487012 return true;
71497013 }
71507014
7151
- void doEditDrag0(ClickInfo info)
7015
+ void doEditDrag0(ClickInfo info, boolean opposite)
71527016 {
71537017 if (hitSomething == 0)
71547018 {
....@@ -7173,9 +7037,9 @@
71737037
71747038 case hitCenter: // Translate
71757039
7176
- scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance();
7040
+ scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
71777041
7178
- if (modified)
7042
+ if (modified || opposite)
71797043 {
71807044 //assert(false);
71817045 /*
....@@ -7221,10 +7085,10 @@
72217085 }
72227086 LA.xformDir(up, ClickInfo.matbuffer, up);
72237087 // if (!CameraPane.LOCALTRANSFORM)
7224
- LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up);
7088
+ LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
72257089 LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
72267090 // if (!CameraPane.LOCALTRANSFORM)
7227
- LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away);
7091
+ LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72287092 //LA.vecCross(up, cVector.Z, right2);
72297093
72307094 cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
....@@ -7269,6 +7133,7 @@
72697133
72707134 if (modified)
72717135 {
7136
+ // Rotate 90 degrees
72727137 angle /= (Math.PI / 4);
72737138 angle = Math.floor(angle + 0.5);
72747139 angle *= (Math.PI / 4);
....@@ -7282,7 +7147,7 @@
72827147 }
72837148 /**/
72847149
7285
- switch (info.pane.renderCamera.viewCode)
7150
+ switch (info.pane.RenderCamera().viewCode)
72867151 {
72877152 case 1: // '\001'
72887153 LA.matZRotate(toParent, angle);
....@@ -7338,7 +7203,7 @@
73387203 }
73397204 /**/
73407205
7341
- switch (info.pane.renderCamera.viewCode)
7206
+ switch (info.pane.RenderCamera().viewCode)
73427207 {
73437208 case 3: // '\001'
73447209 if (modified)
....@@ -7566,6 +7431,7 @@
75667431 objectUI.closeUI();
75677432 if (editWindow != null)
75687433 {
7434
+ editWindow.ctrlPanel.FlushUI();
75697435 editWindow.refreshContents();
75707436 } // ? new
75717437 objectUI = null;
....@@ -7701,7 +7567,7 @@
77017567 {
77027568 assert(bRep != null);
77037569 if (!(support instanceof GenericJoint)) // support.bRep != null)
7704
- GrafreeD.Assert(support.bRep == bRep.support);
7570
+ Grafreed.Assert(support.bRep == bRep.support);
77057571 }
77067572 else
77077573 {