Normand Briere
2019-10-06 9cf2c36d644d0aaa28797f57a3e71591d8e66973
Object3D.java
....@@ -41,6 +41,8 @@
4141
4242 java.util.Hashtable<java.util.UUID, Object3D> versiontable; // = new java.util.Hashtable<java.util.UUID, Object3D>();
4343
44
+ transient int tabIndex; // Tabs can change between sessions.
45
+
4446 ScriptNode scriptnode;
4547
4648 void deepCopyNode(Object3D other)
....@@ -100,7 +102,7 @@
100102 other.softtouched = softtouched;
101103
102104 other.random = random;
103
- other.link2master = link2master;
105
+ other.link2master = Link2Support();
104106 other.transformcount = transformcount;
105107 other.marked = marked;
106108 other.skip = skip;
....@@ -220,7 +222,7 @@
220222 return;
221223
222224 transientsupport = support;
223
- transientlink2master = link2master;
225
+ transientlink2master = Link2Support();
224226
225227 support = null;
226228 link2master = false;
....@@ -633,7 +635,10 @@
633635 transient boolean keepdontselect;
634636 boolean dontselect = false;
635637 boolean hide = false;
638
+
636639 boolean link2master = false; // performs reset support/master at each frame (cannot rename due to serialization)
640
+ boolean link2support = false; // (cannot rename due to serialization)
641
+
637642 boolean marked = false; // animation node
638643 boolean skip = false; // centroid issue
639644 boolean skipmocap = false; // mocap data
....@@ -1137,6 +1142,8 @@
11371142 (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || !Globals.COMPUTESHADOWWHENLIVE) &&
11381143 currentframe != Globals.framecount)
11391144 {
1145
+ Globals.lighttouched = true;
1146
+
11401147 currentframe = Globals.framecount;
11411148
11421149 // System.err.println("transformcount = " + transformcount);
....@@ -3414,7 +3421,7 @@
34143421 }
34153422 }
34163423
3417
- public void Scale(int scale)
3424
+ public void Scale(float scale)
34183425 {
34193426 Object3D obj = this;
34203427
....@@ -6154,7 +6161,7 @@
61546161 boolean NeedSupport()
61556162 {
61566163 return
6157
- CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
6164
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && Link2Support() && /*live &&*/ support != null
61586165 // PROBLEM with CROWD!!
61596166 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
61606167 }
....@@ -6177,6 +6184,11 @@
61776184 return live && bRep != null;
61786185 }
61796186
6187
+ boolean Link2Support()
6188
+ {
6189
+ return link2master || link2support;
6190
+ }
6191
+
61806192 static cVector minima = new cVector();
61816193 static cVector maxima = new cVector();
61826194 static javax.vecmath.Point3d center = new javax.vecmath.Point3d();
....@@ -6190,7 +6202,7 @@
61906202 // System.err.println("Draw " + this + " Frame # " + ((Mocap)((Merge)support).object).frame);
61916203 }
61926204
6193
- if (live && link2master && support == null && !this.marked) // project on ground
6205
+ if (false) // live && Link2Support() && support == null && !this.marked) // project on ground
61946206 {
61956207 getBounds(minima, maxima, true);
61966208 center.x = (minima.x + maxima.x) / 2;
....@@ -6265,7 +6277,7 @@
62656277 support = support;
62666278
62676279 boolean usecalllists = !IsDynamic() &&
6268
- IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
6280
+ IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !Link2Support()); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
62696281 //boolean usecalllists = false; //!IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
62706282
62716283 //usecalllists &= display.DrawMode() == display.DEFAULT; // Don't compute list in shadow pass.
....@@ -6291,7 +6303,7 @@
62916303
62926304 if (!selectmode && //display.DrawMode() != display.SELECTION &&
62936305 //(touched || (bRep != null && bRep.displaylist <= 0)))
6294
- (Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE || touched && Globals.COMPUTESHADOWWHENLIVE)) // || (bRep != null && bRep.displaylist <= 0)))
6306
+ ((Globals.isLIVE() && Globals.COMPUTESHADOWWHENLIVE) || touched)) // || (bRep != null && bRep.displaylist <= 0)))
62956307 {
62966308 Globals.lighttouched = true;
62976309 } // all panes...
....@@ -6373,7 +6385,7 @@
63736385 {
63746386 if (display.DrawMode() == iCameraPane.SHADOW)
63756387 {
6376
- if (!link2master // tricky to cull in shadow mode.
6388
+ if (!Link2Support() // tricky to cull in shadow mode.
63776389 && GetBRep().FrustumCull(this, null, display.LightCamera(), true))
63786390 {
63796391 //System.out.print("CULLED");
....@@ -6846,7 +6858,8 @@
68466858
68476859 //javax.media.opengl.GL gl = display.GetGL();
68486860
6849
- if (CameraPane.BOXMODE && !selected) // || CameraPane.movingcamera)
6861
+ if (CameraPane.BOXMODE && //!Link2Support()) //
6862
+ !selected) // || CameraPane.movingcamera)
68506863 {
68516864 int fc = bRep.FaceCount();
68526865 int vc = bRep.VertexCount();
....@@ -8917,7 +8930,7 @@
89178930
89188931 boolean touch = false;
89198932
8920
- if (bRep != null && link2master)
8933
+ if (bRep != null && Link2Support())
89218934 {
89228935 if (bbox == null)
89238936 {