.. | .. |
---|
22 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
23 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
24 | 24 | |
---|
| 25 | + // Use GetUUID for backward compatibility with null. |
---|
25 | 26 | private UUID uuid = UUID.randomUUID(); |
---|
26 | 27 | |
---|
27 | 28 | // TEMPORARY for mocap undo. No need to be transient. |
---|
.. | .. |
---|
32 | 33 | String skyboxname; |
---|
33 | 34 | String skyboxext; |
---|
34 | 35 | |
---|
35 | | - byte[] versions[]; |
---|
| 36 | + Object3D versionlist[]; |
---|
36 | 37 | int versionindex = -1; |
---|
37 | 38 | |
---|
38 | 39 | ScriptNode scriptnode; |
---|
.. | .. |
---|
222 | 223 | // o.bRep.support = null; |
---|
223 | 224 | // } |
---|
224 | 225 | o.selection = this.selection; |
---|
225 | | - o.versions = this.versions; |
---|
| 226 | + o.versionlist = this.versionlist; |
---|
226 | 227 | o.versionindex = this.versionindex; |
---|
227 | 228 | |
---|
228 | 229 | if (this.support != null) |
---|
.. | .. |
---|
245 | 246 | // this.support = null; |
---|
246 | 247 | // this.fileparent = null; |
---|
247 | 248 | } |
---|
| 249 | + |
---|
| 250 | +// Object3D GetObject(java.util.UUID uuid) |
---|
| 251 | +// { |
---|
| 252 | +// if (this.uuid.equals(uuid)) |
---|
| 253 | +// return this; |
---|
| 254 | +// |
---|
| 255 | +// if (blockloop) |
---|
| 256 | +// return null; |
---|
| 257 | +// |
---|
| 258 | +// blockloop = true; |
---|
| 259 | +// |
---|
| 260 | +// for (int i=0; i<Size(); i++) |
---|
| 261 | +// { |
---|
| 262 | +// Object3D o = get(i).GetObject(uuid); |
---|
| 263 | +// |
---|
| 264 | +// if (o != null) |
---|
| 265 | +// return o; |
---|
| 266 | +// } |
---|
| 267 | +// |
---|
| 268 | +// blockloop = false; |
---|
| 269 | +// |
---|
| 270 | +// return null; |
---|
| 271 | +// } |
---|
248 | 272 | |
---|
249 | 273 | void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
250 | 274 | { |
---|
.. | .. |
---|
280 | 304 | |
---|
281 | 305 | this.selection = o.selection; |
---|
282 | 306 | |
---|
283 | | - this.versions = o.versions; |
---|
| 307 | + this.versionlist = o.versionlist; |
---|
284 | 308 | this.versionindex = o.versionindex; |
---|
285 | 309 | // July 2019 if (this.bRep != null) |
---|
286 | 310 | // this.bRep.support = o.transientrep; |
---|
.. | .. |
---|
1014 | 1038 | |
---|
1015 | 1039 | if (material == null || material.multiply) |
---|
1016 | 1040 | return true; |
---|
| 1041 | + |
---|
| 1042 | + if (projectedVertices != null && projectedVertices.length > 2 && projectedVertices[2].y >= 10000) |
---|
| 1043 | + return false; |
---|
1017 | 1044 | |
---|
1018 | 1045 | // Transparent objects are dynamic because we have to sort the triangles. |
---|
1019 | 1046 | return material.opacity > 0.99; |
---|
.. | .. |
---|
2441 | 2468 | else |
---|
2442 | 2469 | { |
---|
2443 | 2470 | //((ObjEditor)editWindow).SetupUI2(null); |
---|
| 2471 | + if (objectUI != null) |
---|
| 2472 | + ((ObjEditor)objectUI).pinButton.setSelected(pinned); |
---|
| 2473 | + else |
---|
| 2474 | + //new Exception().printStackTrace(); |
---|
| 2475 | + System.err.println("objectUI is null"); |
---|
2444 | 2476 | } |
---|
2445 | 2477 | } |
---|
2446 | 2478 | |
---|
.. | .. |
---|
5909 | 5941 | if (support != null) |
---|
5910 | 5942 | support = support; |
---|
5911 | 5943 | |
---|
5912 | | - //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5913 | | - boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5944 | + boolean usecalllists = !IsLive() && IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5945 | + //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5946 | + |
---|
| 5947 | + //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass. |
---|
5914 | 5948 | |
---|
5915 | 5949 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5916 | 5950 | { |
---|
.. | .. |
---|
5920 | 5954 | // usecalllists &= !(parent instanceof RandomNode); |
---|
5921 | 5955 | // usecalllists = false; |
---|
5922 | 5956 | |
---|
5923 | | - if (GetBRep() != null) |
---|
5924 | | - usecalllists = usecalllists; |
---|
| 5957 | + if (display.DrawMode() == display.SHADOW) |
---|
| 5958 | + //GetBRep() != null) |
---|
| 5959 | + usecalllists = !!usecalllists; |
---|
5925 | 5960 | //System.out.println("draw " + this); |
---|
5926 | 5961 | //new Exception().printStackTrace(); |
---|
5927 | 5962 | |
---|
.. | .. |
---|
5943 | 5978 | if (!(this instanceof Composite)) |
---|
5944 | 5979 | touched = false; |
---|
5945 | 5980 | //if (displaylist == -1 && usecalllists) |
---|
5946 | | - if ((bRep != null && bRep.displaylist <= 0) && usecalllists) // june 2013 |
---|
| 5981 | + if (bRep.displaylist <= 0 && usecalllists) // && display.DrawMode() == display.DEFAULT) // june 2013 |
---|
5947 | 5982 | { |
---|
5948 | 5983 | bRep.displaylist = display.GenList(); |
---|
5949 | 5984 | assert(bRep.displaylist != 0); |
---|
.. | .. |
---|
5954 | 5989 | |
---|
5955 | 5990 | //System.out.println("\tnew list " + list); |
---|
5956 | 5991 | //gl.glDrawBuffer(gl.GL_NONE); |
---|
5957 | | - if (usecalllists) |
---|
| 5992 | + if (usecalllists && bRep.displaylist > 0) |
---|
5958 | 5993 | { |
---|
5959 | 5994 | // System.err.println("new list " + bRep.displaylist + " for " + this); |
---|
5960 | 5995 | display.NewList(bRep.displaylist); |
---|
.. | .. |
---|
5963 | 5998 | CallList(display, root, selected, blocked); |
---|
5964 | 5999 | |
---|
5965 | 6000 | // compiled = true; |
---|
5966 | | - if (usecalllists) |
---|
| 6001 | + if (usecalllists && bRep.displaylist > 0) |
---|
5967 | 6002 | { |
---|
5968 | 6003 | // System.err.println("end list " + bRep.displaylist + " for " + this); |
---|
5969 | 6004 | display.EndList(); |
---|
.. | .. |
---|
7493 | 7528 | hitSomething = hitScale; |
---|
7494 | 7529 | |
---|
7495 | 7530 | double scale = 0.005f * clickInfo.camera.Distance(); |
---|
7496 | | - double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32; |
---|
| 7531 | + double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
7497 | 7532 | double sign = 1; |
---|
7498 | 7533 | if (hScale < 0) |
---|
7499 | 7534 | { |
---|
.. | .. |
---|
7505 | 7540 | //hScale = 0.01; |
---|
7506 | 7541 | } |
---|
7507 | 7542 | |
---|
7508 | | - double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32; |
---|
| 7543 | + double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
7509 | 7544 | sign = 1; |
---|
7510 | 7545 | if (vScale < 0) |
---|
7511 | 7546 | { |
---|
.. | .. |
---|
7720 | 7755 | break; |
---|
7721 | 7756 | |
---|
7722 | 7757 | case hitScale: // scale |
---|
7723 | | - double hScale = (double) (clickInfo.x /*- centerPt.x*/) / 32; |
---|
| 7758 | + double hScale = (double) (clickInfo.x - centerPt.x) / 32; |
---|
7724 | 7759 | double sign = 1; |
---|
7725 | 7760 | if (hScale < 0) |
---|
7726 | 7761 | { |
---|
.. | .. |
---|
7732 | 7767 | //hScale = 0.01; |
---|
7733 | 7768 | } |
---|
7734 | 7769 | |
---|
7735 | | - double vScale = (double) (clickInfo.y /*- centerPt.y*/) / 32; |
---|
| 7770 | + double vScale = (double) (clickInfo.y - centerPt.y) / 32; |
---|
7736 | 7771 | sign = 1; |
---|
7737 | 7772 | if (vScale < 0) |
---|
7738 | 7773 | { |
---|