Normand Briere
2019-06-17 e36047725ce3217618d4e5807ac7c8769b9e3598
Object3D.java
....@@ -174,7 +174,7 @@
174174 {
175175 Object3D o = hashtable.get(GetUUID());
176176
177
- assert(this.bRep == o.bRep);
177
+ Grafreed.Assert(this.bRep == o.bRep);
178178 if (this.bRep != null)
179179 assert(this.bRep.support == o.transientrep);
180180
....@@ -563,12 +563,14 @@
563563 toParent = LA.newMatrix();
564564 fromParent = LA.newMatrix();
565565 }
566
+
566567 if (toParentMarked == null)
567568 {
568569 if (maxcount != 1)
569570 {
570571 new Exception().printStackTrace();
571572 }
573
+
572574 toParentMarked = LA.newMatrix();
573575 fromParentMarked = LA.newMatrix();
574576 }
....@@ -4349,6 +4351,55 @@
43494351 }
43504352 }
43514353
4354
+ void RepairSOV()
4355
+ {
4356
+ if (blockloop)
4357
+ return;
4358
+
4359
+ String texname = this.GetPigmentTexture();
4360
+
4361
+ if (texname.startsWith("sov"))
4362
+ {
4363
+ String[] s = texname.split("/");
4364
+
4365
+ String[] sname = s[1].split("Color.pn");
4366
+
4367
+ texname = sname[0];
4368
+
4369
+ if (sname.length > 1)
4370
+ {
4371
+ texname += "Color.jpg";
4372
+ }
4373
+
4374
+ this.SetPigmentTexture("sov/" + texname);
4375
+ }
4376
+
4377
+ texname = this.GetBumpTexture();
4378
+
4379
+ if (texname.startsWith("sov"))
4380
+ {
4381
+ String[] s = texname.split("/");
4382
+
4383
+ String[] sname = s[1].split("Bump.pn");
4384
+
4385
+ texname = sname[0];
4386
+
4387
+ if (sname.length > 1)
4388
+ {
4389
+ texname += "Bump.jpg";
4390
+ }
4391
+
4392
+ this.SetBumpTexture("sov/" + texname);
4393
+ }
4394
+
4395
+ for (int i=0; i<Size(); i++)
4396
+ {
4397
+ blockloop = true;
4398
+ get(i).RepairSOV();
4399
+ blockloop = false;
4400
+ }
4401
+ }
4402
+
43524403 void RepairTexture()
43534404 {
43544405 if (this instanceof FileObject || blockloop)
....@@ -5572,12 +5623,23 @@
55725623 boolean NeedSupport()
55735624 {
55745625 return
5575
- CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null
5626
+ CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null
55765627 // PROBLEM with CROWD!!
55775628 && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
55785629 }
55795630
55805631 static boolean DEBUG_SELECTION = false;
5632
+
5633
+ boolean IsLive()
5634
+ {
5635
+ if (live)
5636
+ return true;
5637
+
5638
+ if (parent == null)
5639
+ return false;
5640
+
5641
+ return parent.IsLive();
5642
+ }
55815643
55825644 void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked)
55835645 {
....@@ -5640,7 +5702,7 @@
56405702 support = support;
56415703
56425704 //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5643
- boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
5705
+ boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch);
56445706
56455707 if (!usecalllists && bRep != null && bRep.displaylist > 0)
56465708 {
....@@ -5660,10 +5722,12 @@
56605722 boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection();
56615723
56625724 if (!selectmode && //display.DrawMode() != display.SELECTION &&
5663
- (touched || (bRep != null && bRep.displaylist <= 0)))
5725
+ //(touched || (bRep != null && bRep.displaylist <= 0)))
5726
+ (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0)))
56645727 {
56655728 Globals.lighttouched = true;
56665729 } // all panes...
5730
+
56675731 //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW &&
56685732 if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW &&
56695733 (touched || (bRep != null && bRep.displaylist <= 0)))
....@@ -5831,16 +5895,27 @@
58315895 tex = GetTextures();
58325896 }
58335897
5834
- boolean failed = false;
5898
+ boolean failedPigment = false;
5899
+ boolean failedBump = false;
58355900
58365901 try
58375902 {
5838
- display.BindTextures(tex, texres);
5903
+ display.BindPigmentTexture(tex, texres);
58395904 }
58405905 catch (Exception e)
58415906 {
58425907 System.err.println("FAILED: " + this);
5843
- failed = true;
5908
+ failedPigment = true;
5909
+ }
5910
+
5911
+ try
5912
+ {
5913
+ display.BindBumpTexture(tex, texres);
5914
+ }
5915
+ catch (Exception e)
5916
+ {
5917
+ //System.err.println("FAILED: " + this);
5918
+ failedBump = true;
58445919 }
58455920
58465921 if (!compiled)
....@@ -5863,8 +5938,11 @@
58635938 }
58645939 }
58655940
5866
- if (!failed)
5867
- display.ReleaseTextures(tex);
5941
+ if (!failedBump)
5942
+ display.ReleaseBumpTexture(tex);
5943
+
5944
+ if (!failedPigment)
5945
+ display.ReleasePigmentTexture(tex);
58685946
58695947 display.PopMaterial(this, selected);
58705948 }
....@@ -7089,7 +7167,7 @@
70897167 spot.translate(32, 32);
70907168 spotw = spot.x + spot.width;
70917169 spoth = spot.y + spot.height;
7092
- info.g.setColor(Color.blue);
7170
+ info.g.setColor(Color.cyan);
70937171 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
70947172 // if (CameraPane.Xmin > spot.x)
70957173 // {
....@@ -7107,11 +7185,12 @@
71077185 // {
71087186 // CameraPane.Ymax = spoth;
71097187 // }
7110
- // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
7111
- //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
7188
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15
7189
+ //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15
71127190 spot.translate(0, -32);
7113
- info.g.setColor(Color.green);
7191
+ info.g.setColor(Color.yellow);
71147192 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
7193
+ info.g.setColor(Color.green);
71157194 // if (CameraPane.Xmin > spot.x)
71167195 // {
71177196 // CameraPane.Xmin = spot.x;
....@@ -7429,19 +7508,20 @@
74297508 switch (info.pane.RenderCamera().viewCode)
74307509 {
74317510 case 3: // '\001'
7432
- if (modified)
7511
+ if (modified || opposite)
74337512 {
74347513 //LA.matScale(toParent, 1, hScale, vScale);
74357514 LA.matScale(toParent, totalScale, 1, 1);
74367515 } // vScale, 1);
74377516 else
74387517 {
7518
+ // EXCEPTION!
74397519 LA.matScale(toParent, totalScale, totalScale, totalScale);
74407520 } // vScale, 1);
74417521 break;
74427522
74437523 case 2: // '\002'
7444
- if (modified)
7524
+ if (modified || opposite)
74457525 {
74467526 //LA.matScale(toParent, hScale, 1, vScale);
74477527 LA.matScale(toParent, 1, totalScale, 1);
....@@ -7452,7 +7532,7 @@
74527532 break;
74537533
74547534 case 1: // '\003'
7455
- if (modified)
7535
+ if (modified || opposite)
74567536 {
74577537 //LA.matScale(toParent, hScale, vScale, 1);
74587538 LA.matScale(toParent, 1, 1, totalScale);