Normand Briere
2019-04-28 f1c718cce66e5651a0dae91375db6ebfaded1a92
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
....@@ -602,7 +603,7 @@
602603 return;
603604 }
604605
605
- if (CameraPane.fromscript)
606
+ if (Globals.fromscript)
606607 {
607608 transformcount = 0;
608609 return;
....@@ -2905,7 +2906,8 @@
29052906 {
29062907 if (bRep != null)
29072908 {
2908
- bRep.GenUV();
2909
+ bRep.GenUV(); //1);
2910
+ //bRep.UnfoldUV();
29092911 Touch();
29102912 }
29112913 }
....@@ -4854,7 +4856,7 @@
48544856 return globalTransform;
48554857 }
48564858
4857
- void PreprocessOcclusion(CameraPane cp)
4859
+ void PreprocessOcclusion(iCameraPane cp)
48584860 {
48594861 /*
48604862 if (AOdone)
....@@ -5327,6 +5329,7 @@
53275329 && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
53285330 }
53295331
5332
+ static boolean DEBUG_SELECTION = false;
53305333
53315334 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
53325335 {
....@@ -5365,12 +5368,12 @@
53655368 }
53665369
53675370 if ((//display.DrawMode() == CameraPane.SHADOW ||
5368
- display.DrawMode() == CameraPane.SELECTION || CameraPane.DEBUG_SELECTION) && HasTransparency())
5371
+ display.DrawMode() == iCameraPane.SELECTION || display.IsDebugSelection()) && HasTransparency())
53695372 {
53705373 return;
53715374 }
53725375
5373
- javax.media.opengl.GL gl = display.GetGL();
5376
+ //javax.media.opengl.GL gl = display.GetGL();
53745377
53755378 /*
53765379 if (touched)
....@@ -5406,7 +5409,7 @@
54065409
54075410 boolean compiled = false;
54085411
5409
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
5412
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
54105413
54115414 if (!selectmode && //display.DrawMode() != display.SELECTION &&
54125415 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5422,7 +5425,7 @@
54225425 //if (displaylist == -1 && usecalllists)
54235426 if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013
54245427 {
5425
- bRep.displaylist = gl.glGenLists(1);
5428
+ bRep.displaylist = display.GenList();
54265429 assert(bRep.displaylist != 0);
54275430 // System.err.println("glGenLists: " + bRep.displaylist + " for " + this);
54285431 //System.out.println("\tgen list " + list);
....@@ -5434,14 +5437,16 @@
54345437 if (usecalllists)
54355438 {
54365439 // System.err.println("new list " + bRep.displaylist + " for " + this);
5437
- gl.glNewList(bRep.displaylist, gl.GL_COMPILE); //_AND_EXECUTE);
5440
+ display.NewList(bRep.displaylist);
54385441 }
5442
+
54395443 CallList(display, root, selected, blocked);
5444
+
54405445 // compiled = true;
54415446 if (usecalllists)
54425447 {
54435448 // System.err.println("end list " + bRep.displaylist + " for " + this);
5444
- gl.glEndList();
5449
+ display.EndList();
54455450 }
54465451 //gl.glDrawBuffer(gl.GL_BACK);
54475452 // XXX touched = false;
....@@ -5484,12 +5489,12 @@
54845489
54855490 // frustum culling
54865491 if (CameraPane.FRUSTUM && !blocked && !IsInfinite() && GetBRep() != null // && GetBRep().VertexCount() != 1260 // default grid
5487
- && display.DrawMode() != CameraPane.SELECTION)
5492
+ && display.DrawMode() != iCameraPane.SELECTION)
54885493 {
5489
- if (display.DrawMode() == CameraPane.SHADOW)
5494
+ if (display.DrawMode() == iCameraPane.SHADOW)
54905495 {
54915496 if (!link2master // tricky to cull in shadow mode.
5492
- && GetBRep().FrustumCull(this, gl, display.LightCamera(), true))
5497
+ && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
54935498 {
54945499 //System.out.print("CULLED");
54955500 culled = true;
....@@ -5497,7 +5502,7 @@
54975502 }
54985503 else
54995504 //GetBRep().getBounds(v0, v1, this);
5500
- if (GetBRep().FrustumCull(this, gl, display.RenderCamera(), false))
5505
+ if (GetBRep().FrustumCull(this, null, display.RenderCamera(), false))
55015506 culled = true;
55025507
55035508 // LA.xformPos(v0, display.renderCamera.toScreen, v0);
....@@ -5533,11 +5538,11 @@
55335538
55345539
55355540 if (!culled)
5536
- if (display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION)
5541
+ if (display.DrawMode() == display.SELECTION || display.IsDebugSelection())
55375542 {
55385543 if (GetBRep() != null)
55395544 {
5540
- CameraPane.NextIndex(this, gl);
5545
+ display.NextIndex();
55415546 // vertex color conflict : gl.glCallList(list);
55425547 DrawNode(display, root, selected);
55435548 if (this instanceof BezierPatch)
....@@ -5594,7 +5599,7 @@
55945599
55955600 // System.err.println("glCallList: " + bRep.displaylist + " for " + this);
55965601 assert(bRep.displaylist != 0);
5597
- gl.glCallList(bRep.displaylist);
5602
+ display.CallList(bRep.displaylist);
55985603 // june 2013 drawSelf(display, root, selected);
55995604 }
56005605 }
....@@ -5894,9 +5899,10 @@
58945899 return;
58955900 }
58965901
5902
+ //bRep.GenUV(1/material.diffuseness);
58975903 // bRep.lock = true;
58985904
5899
- javax.media.opengl.GL gl = display.GetGL();
5905
+ //javax.media.opengl.GL gl = display.GetGL();
59005906
59015907 if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
59025908 {
....@@ -5913,23 +5919,7 @@
59135919
59145920 bRep.getMinMax(min, max, 100);
59155921
5916
- gl.glBegin(gl.GL_LINES);
5917
-
5918
- gl.glVertex3d(min.x, min.y, min.z);
5919
- gl.glVertex3d(min.x, min.y, max.z);
5920
- gl.glVertex3d(min.x, min.y, min.z);
5921
- gl.glVertex3d(min.x, max.y, min.z);
5922
- gl.glVertex3d(min.x, min.y, min.z);
5923
- gl.glVertex3d(max.x, min.y, min.z);
5924
-
5925
- gl.glVertex3d(max.x, max.y, max.z);
5926
- gl.glVertex3d(min.x, max.y, max.z);
5927
- gl.glVertex3d(max.x, max.y, max.z);
5928
- gl.glVertex3d(max.x, min.y, max.z);
5929
- gl.glVertex3d(max.x, max.y, max.z);
5930
- gl.glVertex3d(max.x, max.y, min.z);
5931
-
5932
- gl.glEnd();
5922
+ display.DrawBox(min, max);
59335923
59345924 return;
59355925 }
....@@ -5973,7 +5963,7 @@
59735963 {
59745964 //throw new Error();
59755965
5976
- boolean selectmode = display.DrawMode() == display.SELECTION || CameraPane.DEBUG_SELECTION;
5966
+ boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
59775967
59785968 int[] strips = bRep.getRawIndices();
59795969
....@@ -5983,178 +5973,14 @@
59835973 new Exception().printStackTrace();
59845974 return;
59855975 }
5986
-
5987
- // TRIANGLE STRIP ARRAY
5988
- if (bRep.trimmed)
5989
- {
5990
- float[] v = bRep.getRawVertices();
5991
- float[] n = bRep.getRawNormals();
5992
- float[] c = bRep.getRawColors();
5993
- float[] uv = bRep.getRawUVMap();
5994
-
5995
- int count2 = 0;
5996
- int count3 = 0;
5997
-
5998
- if (n.length > 0)
5999
- {
6000
- for (int i = 0; i < strips.length; i++)
6001
- {
6002
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6003
-
6004
- /*
6005
- boolean locked = false;
6006
- float eps = 0.1f;
6007
- boolean wrap = CameraPane.UVWRAP; // true; // UV WRAP TEXTURE ISSUE: true = artifacts, false = nice
6008
-
6009
- int dot = 0;
6010
-
6011
- if ((dot&1) == 0)
6012
- dot |= (Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps) ? 3 : 1;
6013
-
6014
- if (wrap || (dot&2) != 0) // Math.abs(qv.s - pv.s) < eps && Math.abs(qv.t - pv.t) < eps)
6015
- gl.glTexCoord2f((float) qv.s, (float) qv.t);
6016
- else
6017
- {
6018
- locked = true;
6019
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6020
- }
6021
- //System.out.println("vertexq = " + qv.x + ", " + qv.y + ", " + qv.z);
6022
- gl.glVertex3f((float) qv.x, (float) qv.y, (float) qv.z);
6023
- if (hasnorm)
6024
- {
6025
- //System.out.println("normalr = " + rv.norm.x + ", " + rv.norm.y + ", " + rv.norm.z);
6026
- gl.glNormal3f((float) rv.norm.x, (float) rv.norm.y, (float) rv.norm.z);
6027
- }
6028
-
6029
- if ((dot&4) == 0)
6030
- dot |= (Math.abs(rv.s - pv.s) < eps && Math.abs(rv.t - pv.t) < eps) ? 12 : 4;
6031
-
6032
- if (wrap || !locked && (dot&8) != 0)
6033
- gl.glTexCoord2f((float) rv.s, (float) rv.t);
6034
- else
6035
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6036
-
6037
- f.dot = dot;
6038
- */
6039
-
6040
- if (!selectmode)
6041
- {
6042
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6043
- {
6044
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6045
- } else
6046
- {
6047
- gl.glNormal3f(0, 0, 1);
6048
- }
6049
-
6050
- if (c != null)
6051
- //System.out.println("glcolor = " + c[count3] + ", " + c[count3+1] + ", " + c[count3+2]);
6052
- {
6053
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6054
- }
6055
- }
6056
- if (flipV)
6057
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6058
- else
6059
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6060
- //System.out.println("vertex1 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6061
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6062
-
6063
- count2 += 2;
6064
- count3 += 3;
6065
- if (!selectmode)
6066
- {
6067
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6068
- {
6069
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6070
- } else
6071
- {
6072
- gl.glNormal3f(0, 0, 1);
6073
- }
6074
- if (c != null)
6075
- {
6076
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6077
- }
6078
- }
6079
- if (flipV)
6080
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6081
- else
6082
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6083
- //System.out.println("vertex2 = " + v[count3] + ", " + v[count3+1] + ", " + v[count3+2]);
6084
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6085
-
6086
- count2 += 2;
6087
- count3 += 3;
6088
- for (int j = 0; j < strips[i] - 2; j++)
6089
- {
6090
- //gl.glTexCoord2d(...);
6091
- if (!selectmode)
6092
- {
6093
- if (n[count3] != 0 || n[count3 + 1] != 0 || n[count3 + 2] != 0)
6094
- {
6095
- gl.glNormal3f(n[count3], n[count3 + 1], n[count3 + 2]);
6096
- } else
6097
- {
6098
- gl.glNormal3f(0, 0, 1);
6099
- }
6100
- if (c != null)
6101
- {
6102
- gl.glColor4f(c[count3/3], c[count3/3 /* + 1*/], c[count3/3 /* + 2*/], 1);
6103
- }
6104
- }
6105
-
6106
- if (flipV)
6107
- gl.glTexCoord2f(uv[count2], 1-uv[count2 + 1]);
6108
- else
6109
- gl.glTexCoord2f(uv[count2], uv[count2 + 1]);
6110
- //System.out.println("coord3 = " + uv[count2] + ", " + uv[count2+1]);
6111
- gl.glVertex3f(v[count3], v[count3 + 1], v[count3 + 2]);
6112
- count2 += 2;
6113
- count3 += 3;
6114
- }
6115
-
6116
- gl.glEnd();
6117
- }
6118
- }
6119
-
6120
- assert count3 == v.length;
6121
- }
6122
- else // !trimmed
6123
- {
6124
- int count = 0;
6125
- for (int i = 0; i < strips.length; i++)
6126
- {
6127
- gl.glBegin(gl.GL_TRIANGLE_STRIP);
6128
-
6129
- Vertex p = bRep.GetVertex(bRep.indices[count++]);
6130
- Vertex q = bRep.GetVertex(bRep.indices[count++]);
6131
-
6132
- drawVertex(gl, p, selectmode);
6133
- drawVertex(gl, q, selectmode);
6134
-
6135
- for (int j = 0; j < strips[i] - 2; j++)
6136
- {
6137
- Vertex r = bRep.GetVertex(bRep.indices[count++]);
6138
-
6139
-// if (j%2 == 0)
6140
-// drawFace(p, q, r, display, null);
6141
-// else
6142
-// drawFace(p, r, q, display, null);
6143
-
6144
-// p = q;
6145
-// q = r;
6146
- drawVertex(gl, r, selectmode);
6147
- }
6148
-
6149
- gl.glEnd();
6150
- }
6151
- }
5976
+
5977
+ display.DrawGeometry(bRep, flipV, selectmode);
61525978 } else // catch (Error e)
61535979 {
61545980 // TRIANGLE ARRAY
61555981 if (IsOpaque()) // Static())
61565982 {
6157
- gl.glBegin(gl.GL_TRIANGLES);
5983
+ display.StartTriangles();
61585984 int facecount = bRep.FaceCount();
61595985 for (int i = 0; i < facecount; i++)
61605986 {
....@@ -6219,7 +6045,7 @@
62196045
62206046 display.DrawFace(this, p, q, r, face);
62216047 }
6222
- gl.glEnd();
6048
+ display.EndTriangles();
62236049 }
62246050 else
62256051 {
....@@ -6248,8 +6074,8 @@
62486074 //System.out.println("SORT");
62496075
62506076 java.util.Arrays.sort(facescompare);
6251
-
6252
- gl.glBegin(gl.GL_TRIANGLES);
6077
+
6078
+ display.StartTriangles();
62536079 for (int i = 0; i < facecount; i++)
62546080 {
62556081 Face face = bRep.GetFace(facescompare[i].index);
....@@ -6263,11 +6089,12 @@
62636089
62646090 display.DrawFace(this, p, q, r, face);
62656091 }
6266
- gl.glEnd();
6092
+ display.EndTriangles();
62676093 }
62686094
62696095 if (false) // live && support != null && support.bRep != null) // debug weights
62706096 {
6097
+ /*
62716098 gl.glDisable(gl.GL_LIGHTING);
62726099 float[] colorV = new float[3];
62736100
....@@ -6346,6 +6173,7 @@
63466173 // gl.glEnd();
63476174 }
63486175 }
6176
+ */
63496177 }
63506178 }
63516179
....@@ -6390,7 +6218,7 @@
63906218 center.add(r);
63916219 center.mul(1.0/3);
63926220
6393
- center.sub(CameraPane.theRenderer.eyeCamera.location);
6221
+ center.sub(Globals.theRenderer.EyeCamera().location);
63946222
63956223 distance = center.dot(center);
63966224 }
....@@ -6404,22 +6232,6 @@
64046232 void Print(Vertex v)
64056233 {
64066234 //System.err.println("(" + v.x + ", " + v.y + ", " + v.z + ")");
6407
- }
6408
-
6409
- void drawVertex(javax.media.opengl.GL gl, Vertex pv, boolean selectmode)
6410
- {
6411
- if (!selectmode)
6412
- {
6413
- gl.glNormal3f((float) pv.norm.x, (float) pv.norm.y, (float) pv.norm.z);
6414
- gl.glColor4f(pv.AO, pv.AO, pv.AO, 1);
6415
-
6416
- if (flipV)
6417
- gl.glTexCoord2f((float) pv.s, 1-(float) pv.t);
6418
- else
6419
- gl.glTexCoord2f((float) pv.s, (float) pv.t);
6420
- }
6421
-
6422
- gl.glVertex3f((float) pv.x, (float) pv.y, (float) pv.z);
64236235 }
64246236
64256237 void drawSelf(ClickInfo info, int level, boolean select)
....@@ -6993,83 +6805,83 @@
69936805 int spotw = spot.x + spot.width;
69946806 int spoth = spot.y + spot.height;
69956807 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
6996
- if (CameraPane.Xmin > spot.x)
6997
- {
6998
- CameraPane.Xmin = spot.x;
6999
- }
7000
- if (CameraPane.Xmax < spotw)
7001
- {
7002
- CameraPane.Xmax = spotw;
7003
- }
7004
- if (CameraPane.Ymin > spot.y)
7005
- {
7006
- CameraPane.Ymin = spot.y;
7007
- }
7008
- if (CameraPane.Ymax < spoth)
7009
- {
7010
- CameraPane.Ymax = spoth;
7011
- }
6808
+// if (CameraPane.Xmin > spot.x)
6809
+// {
6810
+// CameraPane.Xmin = spot.x;
6811
+// }
6812
+// if (CameraPane.Xmax < spotw)
6813
+// {
6814
+// CameraPane.Xmax = spotw;
6815
+// }
6816
+// if (CameraPane.Ymin > spot.y)
6817
+// {
6818
+// CameraPane.Ymin = spot.y;
6819
+// }
6820
+// if (CameraPane.Ymax < spoth)
6821
+// {
6822
+// CameraPane.Ymax = spoth;
6823
+// }
70126824 spot.translate(32, 32);
70136825 spotw = spot.x + spot.width;
70146826 spoth = spot.y + spot.height;
70156827 info.g.setColor(Color.blue);
70166828 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7017
- if (CameraPane.Xmin > spot.x)
7018
- {
7019
- CameraPane.Xmin = spot.x;
7020
- }
7021
- if (CameraPane.Xmax < spotw)
7022
- {
7023
- CameraPane.Xmax = spotw;
7024
- }
7025
- if (CameraPane.Ymin > spot.y)
7026
- {
7027
- CameraPane.Ymin = spot.y;
7028
- }
7029
- if (CameraPane.Ymax < spoth)
7030
- {
7031
- CameraPane.Ymax = spoth;
7032
- }
6829
+// if (CameraPane.Xmin > spot.x)
6830
+// {
6831
+// CameraPane.Xmin = spot.x;
6832
+// }
6833
+// if (CameraPane.Xmax < spotw)
6834
+// {
6835
+// CameraPane.Xmax = spotw;
6836
+// }
6837
+// if (CameraPane.Ymin > spot.y)
6838
+// {
6839
+// CameraPane.Ymin = spot.y;
6840
+// }
6841
+// if (CameraPane.Ymax < spoth)
6842
+// {
6843
+// CameraPane.Ymax = spoth;
6844
+// }
70336845 info.g.drawLine(spotw, spoth, spotw, spoth - 15);
70346846 info.g.drawLine(spotw, spoth, spotw - 15, spoth);
70356847 spot.translate(0, -32);
70366848 info.g.setColor(Color.green);
70376849 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7038
- if (CameraPane.Xmin > spot.x)
7039
- {
7040
- CameraPane.Xmin = spot.x;
7041
- }
7042
- if (CameraPane.Xmax < spotw)
7043
- {
7044
- CameraPane.Xmax = spotw;
7045
- }
7046
- if (CameraPane.Ymin > spot.y)
7047
- {
7048
- CameraPane.Ymin = spot.y;
7049
- }
7050
- if (CameraPane.Ymax < spoth)
7051
- {
7052
- CameraPane.Ymax = spoth;
7053
- }
6850
+// if (CameraPane.Xmin > spot.x)
6851
+// {
6852
+// CameraPane.Xmin = spot.x;
6853
+// }
6854
+// if (CameraPane.Xmax < spotw)
6855
+// {
6856
+// CameraPane.Xmax = spotw;
6857
+// }
6858
+// if (CameraPane.Ymin > spot.y)
6859
+// {
6860
+// CameraPane.Ymin = spot.y;
6861
+// }
6862
+// if (CameraPane.Ymax < spoth)
6863
+// {
6864
+// CameraPane.Ymax = spoth;
6865
+// }
70546866 info.g.drawArc(boundary.x, boundary.y,
70556867 boundary.width, boundary.height, 0, 360);
70566868 //info.g.drawArc(spot.x, spotw, spot.width/2, boundary.height/2, 0, 360);
7057
- if (CameraPane.Xmin > boundary.x)
7058
- {
7059
- CameraPane.Xmin = boundary.x;
7060
- }
7061
- if (CameraPane.Xmax < boundary.x + boundary.width)
7062
- {
7063
- CameraPane.Xmax = boundary.x + boundary.width;
7064
- }
7065
- if (CameraPane.Ymin > boundary.y)
7066
- {
7067
- CameraPane.Ymin = boundary.y;
7068
- }
7069
- if (CameraPane.Ymax < boundary.y + boundary.height)
7070
- {
7071
- CameraPane.Ymax = boundary.y + boundary.height;
7072
- }
6869
+// if (CameraPane.Xmin > boundary.x)
6870
+// {
6871
+// CameraPane.Xmin = boundary.x;
6872
+// }
6873
+// if (CameraPane.Xmax < boundary.x + boundary.width)
6874
+// {
6875
+// CameraPane.Xmax = boundary.x + boundary.width;
6876
+// }
6877
+// if (CameraPane.Ymin > boundary.y)
6878
+// {
6879
+// CameraPane.Ymin = boundary.y;
6880
+// }
6881
+// if (CameraPane.Ymax < boundary.y + boundary.height)
6882
+// {
6883
+// CameraPane.Ymax = boundary.y + boundary.height;
6884
+// }
70736885 return;
70746886 }
70756887 }
....@@ -7172,7 +6984,7 @@
71726984
71736985 case hitCenter: // Translate
71746986
7175
- scale *= 0.05f * info.pane.theRenderer.renderCamera.Distance();
6987
+ scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
71766988
71776989 if (modified)
71786990 {
....@@ -7220,10 +7032,10 @@
72207032 }
72217033 LA.xformDir(up, ClickInfo.matbuffer, up);
72227034 // if (!CameraPane.LOCALTRANSFORM)
7223
- LA.xformDir(up, info.pane.theRenderer.renderCamera.toScreen, up);
7035
+ LA.xformDir(up, Globals.theRenderer.RenderCamera().toScreen, up);
72247036 LA.xformDir(info.camera.away, ClickInfo.matbuffer, away);
72257037 // if (!CameraPane.LOCALTRANSFORM)
7226
- LA.xformDir(away, info.pane.theRenderer.renderCamera.toScreen, away);
7038
+ LA.xformDir(away, Globals.theRenderer.RenderCamera().toScreen, away);
72277039 //LA.vecCross(up, cVector.Z, right2);
72287040
72297041 cVector delta = LA.newVector(info.x - startX, startY - info.y, 0);
....@@ -7281,7 +7093,7 @@
72817093 }
72827094 /**/
72837095
7284
- switch (info.pane.renderCamera.viewCode)
7096
+ switch (info.pane.RenderCamera().viewCode)
72857097 {
72867098 case 1: // '\001'
72877099 LA.matZRotate(toParent, angle);
....@@ -7337,7 +7149,7 @@
73377149 }
73387150 /**/
73397151
7340
- switch (info.pane.renderCamera.viewCode)
7152
+ switch (info.pane.RenderCamera().viewCode)
73417153 {
73427154 case 3: // '\001'
73437155 if (modified)