.. | .. |
---|
14 | 14 | import //weka.core. |
---|
15 | 15 | matrix.Matrix; |
---|
16 | 16 | |
---|
| 17 | +import java.util.UUID; |
---|
| 18 | + |
---|
17 | 19 | //import net.sourceforge.sizeof.SizeOf; |
---|
18 | 20 | public class Object3D extends Vector<Object3D> implements java.io.Serializable, iSendInfo //, aurelienribon.tweenengine.TweenAccessor<Object3D> |
---|
19 | 21 | { |
---|
20 | 22 | //static final long serialVersionUID = -607422624994562685L; |
---|
21 | 23 | static final long serialVersionUID = 5022536242724664900L; |
---|
| 24 | + |
---|
| 25 | + private UUID uuid = UUID.randomUUID(); |
---|
| 26 | + |
---|
| 27 | + // TEMPORARY for mocap undo |
---|
| 28 | + mocap.reader.BVHReader.BVHResult bvh; |
---|
| 29 | + Object3D skeleton; |
---|
| 30 | + // |
---|
22 | 31 | |
---|
23 | 32 | ScriptNode scriptnode; |
---|
24 | 33 | |
---|
.. | .. |
---|
100 | 109 | |
---|
101 | 110 | // transient boolean reduced; // for morph reduction |
---|
102 | 111 | |
---|
103 | | -transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
104 | | -transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
| 112 | + transient com.bulletphysics.linearmath.Transform cache; // for fast merge |
---|
| 113 | + transient com.bulletphysics.linearmath.Transform cache_1; // for fast merge |
---|
105 | 114 | |
---|
106 | | -transient Object3D transientsupport; // for cloning |
---|
107 | | -transient boolean transientlink2master; |
---|
| 115 | + transient Object3D transientsupport; // for cloning |
---|
| 116 | + transient boolean transientlink2master; |
---|
108 | 117 | |
---|
109 | | -void SaveSupports() |
---|
110 | | -{ |
---|
111 | | - if (blockloop) |
---|
112 | | - return; |
---|
113 | | - |
---|
114 | | - transientsupport = support; |
---|
115 | | - transientlink2master = link2master; |
---|
116 | | - |
---|
117 | | - support = null; |
---|
118 | | - link2master = false; |
---|
119 | | - |
---|
120 | | - if (bRep != null) |
---|
| 118 | + void SaveSupports() |
---|
121 | 119 | { |
---|
122 | | - bRep.SaveSupports(); |
---|
123 | | - } |
---|
124 | | - |
---|
125 | | - for (int i = 0; i < Size(); i++) |
---|
126 | | - { |
---|
127 | | - Object3D child = (Object3D) get(i); |
---|
128 | | - if (child == null) |
---|
129 | | - continue; |
---|
130 | | - blockloop = true; |
---|
131 | | - child.SaveSupports(); |
---|
132 | | - blockloop = false; |
---|
133 | | - } |
---|
134 | | -} |
---|
| 120 | + if (blockloop) |
---|
| 121 | + return; |
---|
135 | 122 | |
---|
136 | | -void RestoreSupports() |
---|
137 | | -{ |
---|
138 | | - if (blockloop) |
---|
139 | | - return; |
---|
| 123 | + transientsupport = support; |
---|
| 124 | + transientlink2master = link2master; |
---|
140 | 125 | |
---|
141 | | - support = transientsupport; |
---|
142 | | - link2master = transientlink2master; |
---|
143 | | - transientsupport = null; |
---|
144 | | - transientlink2master = false; |
---|
145 | | - |
---|
146 | | - if (bRep != null) |
---|
147 | | - { |
---|
148 | | - bRep.RestoreSupports(); |
---|
| 126 | + support = null; |
---|
| 127 | + link2master = false; |
---|
| 128 | + |
---|
| 129 | + if (bRep != null) |
---|
| 130 | + { |
---|
| 131 | + bRep.SaveSupports(); |
---|
| 132 | + } |
---|
| 133 | + |
---|
| 134 | + for (int i = 0; i < Size(); i++) |
---|
| 135 | + { |
---|
| 136 | + Object3D child = (Object3D) get(i); |
---|
| 137 | + if (child == null) |
---|
| 138 | + continue; |
---|
| 139 | + blockloop = true; |
---|
| 140 | + child.SaveSupports(); |
---|
| 141 | + blockloop = false; |
---|
| 142 | + } |
---|
149 | 143 | } |
---|
150 | | - |
---|
151 | | - for (int i = 0; i < Size(); i++) |
---|
| 144 | + |
---|
| 145 | + void RestoreSupports() |
---|
152 | 146 | { |
---|
153 | | - Object3D child = (Object3D) get(i); |
---|
154 | | - if (child == null) |
---|
155 | | - continue; |
---|
156 | | - blockloop = true; |
---|
157 | | - child.RestoreSupports(); |
---|
158 | | - blockloop = false; |
---|
| 147 | + if (blockloop) |
---|
| 148 | + return; |
---|
| 149 | + |
---|
| 150 | + support = transientsupport; |
---|
| 151 | + link2master = transientlink2master; |
---|
| 152 | + transientsupport = null; |
---|
| 153 | + transientlink2master = false; |
---|
| 154 | + |
---|
| 155 | + if (bRep != null) |
---|
| 156 | + { |
---|
| 157 | + bRep.RestoreSupports(); |
---|
| 158 | + } |
---|
| 159 | + |
---|
| 160 | + for (int i = 0; i < Size(); i++) |
---|
| 161 | + { |
---|
| 162 | + Object3D child = (Object3D) get(i); |
---|
| 163 | + if (child == null) |
---|
| 164 | + continue; |
---|
| 165 | + blockloop = true; |
---|
| 166 | + child.RestoreSupports(); |
---|
| 167 | + blockloop = false; |
---|
| 168 | + } |
---|
159 | 169 | } |
---|
160 | | -} |
---|
| 170 | + |
---|
| 171 | + void ExtractBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 172 | + { |
---|
| 173 | + if (hashtable.containsKey(GetUUID())) |
---|
| 174 | + { |
---|
| 175 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 176 | + |
---|
| 177 | + Grafreed.Assert(this.bRep == o.bRep); |
---|
| 178 | + if (this.bRep != null) |
---|
| 179 | + assert(this.bRep.support == o.transientrep); |
---|
| 180 | + |
---|
| 181 | + return; |
---|
| 182 | + } |
---|
| 183 | + |
---|
| 184 | + Object3D o = new Object3D(); |
---|
| 185 | + |
---|
| 186 | + hashtable.put(GetUUID(), o); |
---|
| 187 | + |
---|
| 188 | + for (int i=0; i<Size(); i++) |
---|
| 189 | + { |
---|
| 190 | + get(i).ExtractBigData(hashtable); |
---|
| 191 | + } |
---|
| 192 | + |
---|
| 193 | + ExtractBigData(o); |
---|
| 194 | + } |
---|
| 195 | + |
---|
| 196 | + void ExtractBigData(Object3D o) |
---|
| 197 | + { |
---|
| 198 | + o.bRep = this.bRep; |
---|
| 199 | + if (this.bRep != null) |
---|
| 200 | + { |
---|
| 201 | + o.transientrep = this.bRep.support; |
---|
| 202 | + o.bRep.support = null; |
---|
| 203 | + } |
---|
| 204 | + |
---|
| 205 | + // o.support = this.support; |
---|
| 206 | + // o.fileparent = this.fileparent; |
---|
| 207 | + // if (this.bRep != null) |
---|
| 208 | + // o.bRep = this.bRep.support; |
---|
| 209 | + |
---|
| 210 | + this.bRep = null; |
---|
| 211 | + // if (this.bRep != null) |
---|
| 212 | + // this.bRep.support = null; |
---|
| 213 | + // this.support = null; |
---|
| 214 | + // this.fileparent = null; |
---|
| 215 | + } |
---|
| 216 | + |
---|
| 217 | + void RestoreBigData(java.util.Hashtable<java.util.UUID, Object3D> hashtable) |
---|
| 218 | + { |
---|
| 219 | + if (!hashtable.containsKey(GetUUID())) |
---|
| 220 | + return; |
---|
| 221 | + |
---|
| 222 | + Object3D o = hashtable.get(GetUUID()); |
---|
| 223 | + |
---|
| 224 | + RestoreBigData(o); |
---|
| 225 | + |
---|
| 226 | + hashtable.remove(GetUUID()); |
---|
| 227 | + |
---|
| 228 | + for (int i=0; i<Size(); i++) |
---|
| 229 | + { |
---|
| 230 | + get(i).RestoreBigData(hashtable); |
---|
| 231 | + } |
---|
| 232 | + } |
---|
| 233 | + |
---|
| 234 | + void RestoreBigData(Object3D o) |
---|
| 235 | + { |
---|
| 236 | + this.bRep = o.bRep; |
---|
| 237 | + if (this.bRep != null) |
---|
| 238 | + this.bRep.support = o.transientrep; |
---|
| 239 | + // this.support = o.support; |
---|
| 240 | + // this.fileparent = o.fileparent; |
---|
| 241 | + } |
---|
161 | 242 | |
---|
162 | 243 | // MOCAP SUPPORT |
---|
163 | 244 | double tx,ty,tz,rx,ry,rz; |
---|
.. | .. |
---|
482 | 563 | toParent = LA.newMatrix(); |
---|
483 | 564 | fromParent = LA.newMatrix(); |
---|
484 | 565 | } |
---|
| 566 | + |
---|
485 | 567 | if (toParentMarked == null) |
---|
486 | 568 | { |
---|
487 | 569 | if (maxcount != 1) |
---|
488 | 570 | { |
---|
489 | 571 | new Exception().printStackTrace(); |
---|
490 | 572 | } |
---|
| 573 | + |
---|
491 | 574 | toParentMarked = LA.newMatrix(); |
---|
492 | 575 | fromParentMarked = LA.newMatrix(); |
---|
493 | 576 | } |
---|
.. | .. |
---|
775 | 858 | if (step == 0) |
---|
776 | 859 | step = 1; |
---|
777 | 860 | if (maxcount == 0) |
---|
778 | | - maxcount = 2048; // 4; |
---|
| 861 | + maxcount = 128; // 2048; // 4; |
---|
779 | 862 | // if (acceleration == 0) |
---|
780 | 863 | // acceleration = 10; |
---|
781 | 864 | if (delay == 0) // serial |
---|
.. | .. |
---|
2628 | 2711 | //Touch(); |
---|
2629 | 2712 | } |
---|
2630 | 2713 | |
---|
| 2714 | + void GenNormalsMeshS() |
---|
| 2715 | + { |
---|
| 2716 | + selection.GenNormalsMesh(); |
---|
| 2717 | +// for (int i=0; i<selection.size(); i++) |
---|
| 2718 | +// { |
---|
| 2719 | +// Object3D selectee = (Object3D) selection.elementAt(i); |
---|
| 2720 | +// selectee.GenNormals(crease); |
---|
| 2721 | +// } |
---|
| 2722 | + |
---|
| 2723 | + //Touch(); |
---|
| 2724 | + } |
---|
| 2725 | + |
---|
2631 | 2726 | void ClearColorsS() |
---|
2632 | 2727 | { |
---|
2633 | 2728 | selection.ClearColors(); |
---|
.. | .. |
---|
2759 | 2854 | if (child == null) |
---|
2760 | 2855 | continue; |
---|
2761 | 2856 | child.GenNormals(crease); |
---|
| 2857 | +// Children().release(i); |
---|
| 2858 | + } |
---|
| 2859 | + blockloop = false; |
---|
| 2860 | + } |
---|
| 2861 | + |
---|
| 2862 | + void GenNormalsMesh() |
---|
| 2863 | + { |
---|
| 2864 | + if (blockloop) |
---|
| 2865 | + return; |
---|
| 2866 | + |
---|
| 2867 | + blockloop = true; |
---|
| 2868 | + GenNormalsMesh0(); |
---|
| 2869 | + for (int i = 0; i < Children().Size(); i++) |
---|
| 2870 | + { |
---|
| 2871 | + Object3D child = (Object3D) Children().get(i); // reserve(i); |
---|
| 2872 | + if (child == null) |
---|
| 2873 | + continue; |
---|
| 2874 | + child.GenNormalsMesh(); |
---|
2762 | 2875 | // Children().release(i); |
---|
2763 | 2876 | } |
---|
2764 | 2877 | blockloop = false; |
---|
.. | .. |
---|
2927 | 3040 | if (bRep != null) |
---|
2928 | 3041 | { |
---|
2929 | 3042 | bRep.GenerateNormals(crease); |
---|
| 3043 | + Touch(); |
---|
| 3044 | + } |
---|
| 3045 | + } |
---|
| 3046 | + |
---|
| 3047 | + void GenNormalsMesh0() |
---|
| 3048 | + { |
---|
| 3049 | + if (bRep != null) |
---|
| 3050 | + { |
---|
| 3051 | + bRep.GenerateNormalsMesh(); |
---|
2930 | 3052 | Touch(); |
---|
2931 | 3053 | } |
---|
2932 | 3054 | } |
---|
.. | .. |
---|
5371 | 5493 | } |
---|
5372 | 5494 | } |
---|
5373 | 5495 | |
---|
| 5496 | + UUID GetUUID() |
---|
| 5497 | + { |
---|
| 5498 | + if (uuid == null) |
---|
| 5499 | + { |
---|
| 5500 | + // Serial |
---|
| 5501 | + uuid = UUID.randomUUID(); |
---|
| 5502 | + } |
---|
| 5503 | + |
---|
| 5504 | + return uuid; |
---|
| 5505 | + } |
---|
| 5506 | + |
---|
| 5507 | + Object3D GetObject(UUID uid) |
---|
| 5508 | + { |
---|
| 5509 | + if (blockloop) |
---|
| 5510 | + return null; |
---|
| 5511 | + |
---|
| 5512 | + if (GetUUID().equals(uid)) |
---|
| 5513 | + return this; |
---|
| 5514 | + |
---|
| 5515 | + int nb = Size(); |
---|
| 5516 | + for (int i = 0; i < nb; i++) |
---|
| 5517 | + { |
---|
| 5518 | + Object3D child = (Object3D) get(i); |
---|
| 5519 | + |
---|
| 5520 | + if (child == null) |
---|
| 5521 | + continue; |
---|
| 5522 | + |
---|
| 5523 | + blockloop = true; |
---|
| 5524 | + Object3D obj = child.GetObject(uid); |
---|
| 5525 | + blockloop = false; |
---|
| 5526 | + if (obj != null) |
---|
| 5527 | + return obj; |
---|
| 5528 | + } |
---|
| 5529 | + |
---|
| 5530 | + return null; |
---|
| 5531 | + } |
---|
| 5532 | + |
---|
5374 | 5533 | void SetBumpTexture(String tex) |
---|
5375 | 5534 | { |
---|
5376 | 5535 | if (GetTextures() == null) |
---|
.. | .. |
---|
5415 | 5574 | boolean NeedSupport() |
---|
5416 | 5575 | { |
---|
5417 | 5576 | return |
---|
5418 | | - CameraPane.SUPPORT && (!CameraPane.movingcamera || !Globals.FREEZEONMOVE) && link2master && /*live &&*/ support != null |
---|
| 5577 | + CameraPane.SUPPORT && (!CameraPane.movingcamera || (!Globals.FREEZEONMOVE && Globals.isLIVE())) && link2master && /*live &&*/ support != null |
---|
5419 | 5578 | // PROBLEM with CROWD!! |
---|
5420 | 5579 | && (Globals.DrawMode() == iCameraPane.SHADOW || !Globals.RENDERSHADOW || Globals.CROWD); |
---|
5421 | 5580 | } |
---|
5422 | 5581 | |
---|
5423 | 5582 | static boolean DEBUG_SELECTION = false; |
---|
| 5583 | + |
---|
| 5584 | + boolean IsLive() |
---|
| 5585 | + { |
---|
| 5586 | + if (live) |
---|
| 5587 | + return true; |
---|
| 5588 | + |
---|
| 5589 | + if (parent == null) |
---|
| 5590 | + return false; |
---|
| 5591 | + |
---|
| 5592 | + return parent.IsLive(); |
---|
| 5593 | + } |
---|
5424 | 5594 | |
---|
5425 | 5595 | void Draw(iCameraPane display, Object3D /*Composite*/ root, boolean selected, boolean blocked) |
---|
5426 | 5596 | { |
---|
.. | .. |
---|
5483 | 5653 | support = support; |
---|
5484 | 5654 | |
---|
5485 | 5655 | //boolean usecalllists = IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null || !link2master); // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5486 | | - boolean usecalllists = false; // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
| 5656 | + boolean usecalllists = IsLive(); // IsStatic() && GetBRep() != null && (!CameraPane.SUPPORT || support == null) && !link2master; // !(this instanceof cSpring) && !(this instanceof BezierPatch); |
---|
5487 | 5657 | |
---|
5488 | 5658 | if (!usecalllists && bRep != null && bRep.displaylist > 0) |
---|
5489 | 5659 | { |
---|
.. | .. |
---|
5503 | 5673 | boolean selectmode = display.DrawMode() == display.SELECTION || display.IsDebugSelection(); |
---|
5504 | 5674 | |
---|
5505 | 5675 | if (!selectmode && //display.DrawMode() != display.SELECTION && |
---|
5506 | | - (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5676 | + //(touched || (bRep != null && bRep.displaylist <= 0))) |
---|
| 5677 | + (Globals.isLIVE() || touched && (bRep != null && bRep.displaylist <= 0))) |
---|
5507 | 5678 | { |
---|
5508 | 5679 | Globals.lighttouched = true; |
---|
5509 | 5680 | } // all panes... |
---|
| 5681 | + |
---|
5510 | 5682 | //if (usecalllists && display.DrawMode() != display.SELECTION && display.DrawMode() != display.SHADOW && |
---|
5511 | 5683 | if (bRep != null && usecalllists && !selectmode && // june 2013 display.DrawMode() != display.SHADOW && |
---|
5512 | 5684 | (touched || (bRep != null && bRep.displaylist <= 0))) |
---|
.. | .. |
---|
6932 | 7104 | spot.translate(32, 32); |
---|
6933 | 7105 | spotw = spot.x + spot.width; |
---|
6934 | 7106 | spoth = spot.y + spot.height; |
---|
6935 | | - info.g.setColor(Color.blue); |
---|
| 7107 | + info.g.setColor(Color.cyan); |
---|
6936 | 7108 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
6937 | 7109 | // if (CameraPane.Xmin > spot.x) |
---|
6938 | 7110 | // { |
---|
.. | .. |
---|
6950 | 7122 | // { |
---|
6951 | 7123 | // CameraPane.Ymax = spoth; |
---|
6952 | 7124 | // } |
---|
6953 | | - info.g.drawLine(spotw, spoth, spotw, spoth - 15); |
---|
6954 | | - info.g.drawLine(spotw, spoth, spotw - 15, spoth); |
---|
| 7125 | + // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - boundary.height/2); // 15 |
---|
| 7126 | + //info.g.drawLine(spotw, spoth, spotw - boundary.width/2, spoth); // 15 |
---|
6955 | 7127 | spot.translate(0, -32); |
---|
6956 | | - info.g.setColor(Color.green); |
---|
| 7128 | + info.g.setColor(Color.yellow); |
---|
6957 | 7129 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
| 7130 | + info.g.setColor(Color.green); |
---|
6958 | 7131 | // if (CameraPane.Xmin > spot.x) |
---|
6959 | 7132 | // { |
---|
6960 | 7133 | // CameraPane.Xmin = spot.x; |
---|
.. | .. |
---|
7006 | 7179 | startX = info.x; |
---|
7007 | 7180 | startY = info.y; |
---|
7008 | 7181 | |
---|
7009 | | - hitSomething = 0; |
---|
| 7182 | + hitSomething = -1; |
---|
7010 | 7183 | cVector origin = new cVector(); |
---|
7011 | 7184 | //LA.xformPos(origin, toParent, origin); |
---|
7012 | 7185 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
7082 | 7255 | //System.out.println("hitSomething = " + hitSomething); |
---|
7083 | 7256 | |
---|
7084 | 7257 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7258 | + |
---|
7085 | 7259 | cVector xlate = new cVector(); |
---|
7086 | 7260 | //cVector xlate2 = new cVector(); |
---|
7087 | 7261 | switch (hitSomething) |
---|
.. | .. |
---|
7230 | 7404 | |
---|
7231 | 7405 | case hitScale: // scale |
---|
7232 | 7406 | double hScale = (double) (info.x - centerPt.x) / 32; |
---|
| 7407 | + double sign = 1; |
---|
| 7408 | + if (hScale < 0) |
---|
| 7409 | + { |
---|
| 7410 | + sign = -1; |
---|
| 7411 | + } |
---|
| 7412 | + hScale = sign*Math.pow(sign*hScale, scale * 50); |
---|
7233 | 7413 | if (hScale < 0.01) |
---|
7234 | 7414 | { |
---|
7235 | | - hScale = 0.01; |
---|
| 7415 | + //hScale = 0.01; |
---|
7236 | 7416 | } |
---|
7237 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7238 | | - if (hScale < 0.01) |
---|
7239 | | - { |
---|
7240 | | - hScale = 0.01; |
---|
7241 | | - } |
---|
| 7417 | + |
---|
7242 | 7418 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7243 | | - if (vScale < 0.01) |
---|
| 7419 | + sign = 1; |
---|
| 7420 | + if (vScale < 0) |
---|
7244 | 7421 | { |
---|
7245 | | - vScale = 0.01; |
---|
| 7422 | + sign = -1; |
---|
7246 | 7423 | } |
---|
7247 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7424 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7248 | 7425 | if (vScale < 0.01) |
---|
7249 | 7426 | { |
---|
7250 | | - vScale = 0.01; |
---|
| 7427 | + //vScale = 0.01; |
---|
7251 | 7428 | } |
---|
7252 | 7429 | LA.matCopy(startMat, toParent); |
---|
7253 | 7430 | /**/ |
---|
.. | .. |
---|
7258 | 7435 | } |
---|
7259 | 7436 | /**/ |
---|
7260 | 7437 | |
---|
| 7438 | + double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2); |
---|
| 7439 | + |
---|
| 7440 | + if (totalScale < 0.01) |
---|
| 7441 | + { |
---|
| 7442 | + totalScale = 0.01; |
---|
| 7443 | + } |
---|
| 7444 | + |
---|
7261 | 7445 | switch (info.pane.RenderCamera().viewCode) |
---|
7262 | 7446 | { |
---|
7263 | 7447 | case 3: // '\001' |
---|
7264 | | - if (modified) |
---|
| 7448 | + if (modified || opposite) |
---|
7265 | 7449 | { |
---|
7266 | 7450 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7267 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7451 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7268 | 7452 | } // vScale, 1); |
---|
7269 | 7453 | else |
---|
7270 | 7454 | { |
---|
7271 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7455 | + LA.matScale(toParent, 1, totalScale, totalScale); |
---|
7272 | 7456 | } // vScale, 1); |
---|
7273 | 7457 | break; |
---|
7274 | 7458 | |
---|
7275 | 7459 | case 2: // '\002' |
---|
7276 | | - if (modified) |
---|
| 7460 | + if (modified || opposite) |
---|
7277 | 7461 | { |
---|
7278 | 7462 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7279 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7463 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7280 | 7464 | } else |
---|
7281 | 7465 | { |
---|
7282 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7466 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7283 | 7467 | } |
---|
7284 | 7468 | break; |
---|
7285 | 7469 | |
---|
7286 | 7470 | case 1: // '\003' |
---|
7287 | | - if (modified) |
---|
| 7471 | + if (modified || opposite) |
---|
7288 | 7472 | { |
---|
7289 | 7473 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7290 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7474 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7291 | 7475 | } else |
---|
7292 | 7476 | { |
---|
7293 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7477 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7294 | 7478 | } |
---|
7295 | 7479 | break; |
---|
7296 | 7480 | } |
---|
.. | .. |
---|
7431 | 7615 | objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7432 | 7616 | } else |
---|
7433 | 7617 | { |
---|
7434 | | - objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
| 7618 | + objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ ""; |
---|
7435 | 7619 | } // + super.toString(); |
---|
7436 | 7620 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
7437 | 7621 | |
---|
.. | .. |
---|
7515 | 7699 | /*transient*/ cVector2[] projectedVertices = new cVector2[0]; |
---|
7516 | 7700 | |
---|
7517 | 7701 | Object3D /*Composite*/ parent; |
---|
7518 | | - Object3D /*Composite*/ fileparent; |
---|
| 7702 | + Object3D /*Composite*/ fileparent; // In the case of FileObject |
---|
7519 | 7703 | |
---|
7520 | 7704 | double[][] toParent; // dynamic matrix |
---|
7521 | 7705 | double[][] fromParent; |
---|
.. | .. |
---|
7679 | 7863 | private static cVector edge2 = new cVector(); |
---|
7680 | 7864 | //private static cVector norm = new cVector(); |
---|
7681 | 7865 | /*transient private*/ int hitSomething; |
---|
7682 | | - private static final int hitCenter = 1; |
---|
7683 | | - private static final int hitScale = 2; |
---|
7684 | | - private static final int hitRotate = 3; |
---|
| 7866 | + static final int hitCenter = 1; |
---|
| 7867 | + static final int hitScale = 2; |
---|
| 7868 | + static final int hitRotate = 3; |
---|
7685 | 7869 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7686 | 7870 | /*transient*/ private Point centerPt; |
---|
7687 | 7871 | /*transient*/ private int startX; |
---|