Normand Briere
2019-05-13 f924d3e00db476c06f55f3d5aaef307e17575340
Object3D.java
....@@ -797,7 +797,7 @@
797797
798798 if (marked && Globals.isLIVE() && live &&
799799 //TEMP21aug2018
800
- Globals.DrawMode() == iCameraPane.SHADOW &&
800
+ (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW) &&
801801 currentframe != Globals.framecount)
802802 {
803803 currentframe = Globals.framecount;
....@@ -912,6 +912,11 @@
912912 fromParent = null; // LA.newMatrix();
913913 bRep = null; // new BoundaryRep();
914914
915
+ if (oname != null && oname.equals("LeftHand"))
916
+ {
917
+ name = oname;
918
+ }
919
+
915920 /*
916921 float hue = (float)Math.random();
917922 Color col;
....@@ -954,7 +959,7 @@
954959
955960 public Object clone()
956961 {
957
- return GrafreeD.clone(this);
962
+ return Grafreed.clone(this);
958963 }
959964
960965 Object3D copyExpand()
....@@ -1470,7 +1475,7 @@
14701475 BoundaryRep.SEUIL = other.material.cameralight;
14711476
14721477 // Set default to 0.1
1473
- BoundaryRep.SEUIL /= 2;
1478
+ BoundaryRep.SEUIL /= 4; // 2;
14741479 System.out.println("SEUIL = " + BoundaryRep.SEUIL);
14751480 }
14761481
....@@ -1729,7 +1734,7 @@
17291734 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17301735 o.bRep = transientrep;
17311736 if (clone)
1732
- o.bRep = (BoundaryRep) GrafreeD.clone(transientrep);
1737
+ o.bRep = (BoundaryRep) Grafreed.clone(transientrep);
17331738 o.CreateMaterial();
17341739 o.SetAttributes(this, -1);
17351740 //parent
....@@ -1742,7 +1747,7 @@
17421747 Object3D o = new Object3D((clone?"Ge:":"Li:") + this.name);
17431748 o.bRep = bRep;
17441749 if (clone)
1745
- o.bRep = (BoundaryRep) GrafreeD.clone(bRep);
1750
+ o.bRep = (BoundaryRep) Grafreed.clone(bRep);
17461751 o.CreateMaterial();
17471752 //o.overwriteThis(this, -1);
17481753 o.SetAttributes(this, -1);
....@@ -2477,13 +2482,13 @@
24772482 return retval;
24782483 }
24792484
2480
- void doEditDrag(ClickInfo info)
2485
+ void doEditDrag(ClickInfo info, boolean opposite)
24812486 {
24822487 switch (doSomething)
24832488 {
24842489 case 1: // '\001'
24852490 //super.
2486
- doEditDrag0(info);
2491
+ doEditDrag0(info, opposite);
24872492 break;
24882493
24892494 case 2: // '\002'
....@@ -2496,11 +2501,11 @@
24962501 {
24972502 //sel.hitSomething = childToDrag.hitSomething;
24982503 //childToDrag.doEditDrag(info);
2499
- sel.doEditDrag(info);
2504
+ sel.doEditDrag(info, opposite);
25002505 } else
25012506 {
25022507 //super.
2503
- doEditDrag0(info);
2508
+ doEditDrag0(info, opposite);
25042509 }
25052510 }
25062511 break;
....@@ -2983,6 +2988,31 @@
29832988 blockloop = false;
29842989 }
29852990
2991
+ void TransformChildren()
2992
+ {
2993
+ if (toParent != null)
2994
+ {
2995
+ for (int i=Size(); --i>=0;)
2996
+ {
2997
+ Object3D v = get(i);
2998
+
2999
+ if (v.toParent == null)
3000
+ {
3001
+ v.toParent = LA.newMatrix();
3002
+ v.fromParent = LA.newMatrix();
3003
+ }
3004
+
3005
+ LA.matConcat(v.toParent, toParent, v.toParent);
3006
+ LA.matConcat(fromParent, v.fromParent, v.fromParent);
3007
+ }
3008
+
3009
+ toParent = null; // LA.matIdentity(toParent);
3010
+ fromParent = null; // LA.matIdentity(fromParent);
3011
+
3012
+ Touch();
3013
+ }
3014
+ }
3015
+
29863016 void TransformGeometry()
29873017 {
29883018 Object3D obj = this;
....@@ -3204,7 +3234,7 @@
32043234
32053235 BoundaryRep sup = bRep.support;
32063236 bRep.support = null;
3207
- BoundaryRep temprep = (BoundaryRep) GrafreeD.clone(bRep);
3237
+ BoundaryRep temprep = (BoundaryRep) Grafreed.clone(bRep);
32083238 // bRep.SplitInTwo(onlyone); // thread...
32093239 temprep.SplitInTwo(reduction34, onlyone);
32103240 bRep = temprep;
....@@ -3728,7 +3758,7 @@
37283758 if (child == null)
37293759 continue;
37303760
3731
- if (GrafreeD.RENDERME > 0)
3761
+ if (Grafreed.RENDERME > 0)
37323762 {
37333763 if (child instanceof Merge)
37343764 ((Merge)child).renderme();
....@@ -3879,7 +3909,7 @@
38793909 if (child == null)
38803910 continue;
38813911
3882
- if (GrafreeD.RENDERME > 0)
3912
+ if (Grafreed.RENDERME > 0)
38833913 {
38843914 if (child instanceof Merge)
38853915 ((Merge)child).renderme();
....@@ -4074,7 +4104,7 @@
40744104 if (child == null)
40754105 continue;
40764106
4077
- if (GrafreeD.RENDERME > 0)
4107
+ if (Grafreed.RENDERME > 0)
40784108 {
40794109 if (child instanceof Merge)
40804110 ((Merge)child).renderme();
....@@ -5379,7 +5409,7 @@
53795409 return
53805410 CameraPane.SUPPORT && !CameraPane.movingcamera && link2master && /*live &&*/ support != null
53815411 // PROBLEM with CROWD!!
5382
- && (Globals.DrawMode() == iCameraPane.SHADOW || Globals.CROWD);
5412
+ && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD);
53835413 }
53845414
53855415 static boolean DEBUG_SELECTION = false;
....@@ -6984,7 +7014,7 @@
69847014 }
69857015
69867016 //System.out.println("info.modifiers = " + info.modifiers);
6987
- modified = (info.modifiers & CameraPane.META) != 0;
7017
+ modified = (info.modifiers & CameraPane.SHIFT) != 0; // Was META
69887018 //System.out.println("modified = " + modified);
69897019 //new Exception().printStackTrace();
69907020 //viewCode = info.pane.renderCamera.viewCode;
....@@ -7012,7 +7042,7 @@
70127042 return true;
70137043 }
70147044
7015
- void doEditDrag0(ClickInfo info)
7045
+ void doEditDrag0(ClickInfo info, boolean opposite)
70167046 {
70177047 if (hitSomething == 0)
70187048 {
....@@ -7039,7 +7069,7 @@
70397069
70407070 scale *= 0.05f * Globals.theRenderer.RenderCamera().Distance();
70417071
7042
- if (modified)
7072
+ if (modified || opposite)
70437073 {
70447074 //assert(false);
70457075 /*
....@@ -7133,6 +7163,7 @@
71337163
71347164 if (modified)
71357165 {
7166
+ // Rotate 90 degrees
71367167 angle /= (Math.PI / 4);
71377168 angle = Math.floor(angle + 0.5);
71387169 angle *= (Math.PI / 4);
....@@ -7367,14 +7398,22 @@
73677398 //return super.toString() + " (id=" + list + ")" + " (brep=" + bRep + ")";
73687399 //return name + " (id=" + list + ")" + " (brep=" + bRep + ") " + super.toString();
73697400 //return name + " (#tri = " + (bRep==null?0:bRep.VertexCount()) + ") " + super.toString();
7401
+
7402
+ String objname;
7403
+
73707404 if (false) //parent != null)
73717405 {
7372
- return name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
7406
+ objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
73737407 } else
73747408 {
7375
- return GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ") ")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ +System.identityHashCode(this);
7409
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
73767410 } // + super.toString();
73777411 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
7412
+
7413
+ if (!Globals.ADVANCED)
7414
+ return objname;
7415
+
7416
+ return objname + " " + System.identityHashCode(this);
73787417 }
73797418
73807419 public int hashCode()
....@@ -7566,7 +7605,7 @@
75667605 {
75677606 assert(bRep != null);
75687607 if (!(support instanceof GenericJoint)) // support.bRep != null)
7569
- GrafreeD.Assert(support.bRep == bRep.support);
7608
+ Grafreed.Assert(support.bRep == bRep.support);
75707609 }
75717610 else
75727611 {