Normand Briere
2019-06-09 79d0f9a45d36656051a77a7b0837aa0318f81ee5
Object3D.java
....@@ -775,7 +775,7 @@
775775 if (step == 0)
776776 step = 1;
777777 if (maxcount == 0)
778
- maxcount = 2048; // 4;
778
+ maxcount = 128; // 2048; // 4;
779779 // if (acceleration == 0)
780780 // acceleration = 10;
781781 if (delay == 0) // serial
....@@ -6950,8 +6950,8 @@
69506950 // {
69516951 // CameraPane.Ymax = spoth;
69526952 // }
6953
- info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6954
- info.g.drawLine(spotw, spoth, spotw - 15, spoth);
6953
+ // bonhommes info.g.drawLine(spotw, spoth, spotw, spoth - 15);
6954
+ //info.g.drawLine(spotw, spoth, spotw - 15, spoth);
69556955 spot.translate(0, -32);
69566956 info.g.setColor(Color.green);
69576957 info.g.fillRect(spot.x, spot.y, spot.width, spot.height);
....@@ -7006,7 +7006,7 @@
70067006 startX = info.x;
70077007 startY = info.y;
70087008
7009
- hitSomething = 0;
7009
+ hitSomething = -1;
70107010 cVector origin = new cVector();
70117011 //LA.xformPos(origin, toParent, origin);
70127012 Rectangle spot = new Rectangle();
....@@ -7082,6 +7082,7 @@
70827082 //System.out.println("hitSomething = " + hitSomething);
70837083
70847084 double scale = 0.005f * info.camera.Distance();
7085
+
70857086 cVector xlate = new cVector();
70867087 //cVector xlate2 = new cVector();
70877088 switch (hitSomething)
....@@ -7230,24 +7231,27 @@
72307231
72317232 case hitScale: // scale
72327233 double hScale = (double) (info.x - centerPt.x) / 32;
7234
+ double sign = 1;
7235
+ if (hScale < 0)
7236
+ {
7237
+ sign = -1;
7238
+ }
7239
+ hScale = sign*Math.pow(sign*hScale, scale * 50);
72337240 if (hScale < 0.01)
72347241 {
7235
- hScale = 0.01;
7242
+ //hScale = 0.01;
72367243 }
7237
- hScale = Math.pow(hScale, scale * 50);
7238
- if (hScale < 0.01)
7239
- {
7240
- hScale = 0.01;
7241
- }
7244
+
72427245 double vScale = (double) (info.y - centerPt.y) / 32;
7243
- if (vScale < 0.01)
7246
+ sign = 1;
7247
+ if (vScale < 0)
72447248 {
7245
- vScale = 0.01;
7249
+ sign = -1;
72467250 }
7247
- vScale = Math.pow(vScale, scale * 50);
7251
+ vScale = sign*Math.pow(sign*vScale, scale * 50);
72487252 if (vScale < 0.01)
72497253 {
7250
- vScale = 0.01;
7254
+ //vScale = 0.01;
72517255 }
72527256 LA.matCopy(startMat, toParent);
72537257 /**/
....@@ -7258,17 +7262,24 @@
72587262 }
72597263 /**/
72607264
7265
+ double totalScale = Math.sqrt(hScale*hScale + vScale*vScale) / Math.sqrt(2);
7266
+
7267
+ if (totalScale < 0.01)
7268
+ {
7269
+ totalScale = 0.01;
7270
+ }
7271
+
72617272 switch (info.pane.RenderCamera().viewCode)
72627273 {
72637274 case 3: // '\001'
72647275 if (modified)
72657276 {
72667277 //LA.matScale(toParent, 1, hScale, vScale);
7267
- LA.matScale(toParent, vScale, 1, 1);
7278
+ LA.matScale(toParent, totalScale, 1, 1);
72687279 } // vScale, 1);
72697280 else
72707281 {
7271
- LA.matScale(toParent, vScale, vScale, vScale);
7282
+ LA.matScale(toParent, totalScale, totalScale, totalScale);
72727283 } // vScale, 1);
72737284 break;
72747285
....@@ -7276,10 +7287,10 @@
72767287 if (modified)
72777288 {
72787289 //LA.matScale(toParent, hScale, 1, vScale);
7279
- LA.matScale(toParent, 1, vScale, 1);
7290
+ LA.matScale(toParent, 1, totalScale, 1);
72807291 } else
72817292 {
7282
- LA.matScale(toParent, vScale, 1, vScale);
7293
+ LA.matScale(toParent, totalScale, 1, totalScale);
72837294 }
72847295 break;
72857296
....@@ -7287,10 +7298,10 @@
72877298 if (modified)
72887299 {
72897300 //LA.matScale(toParent, hScale, vScale, 1);
7290
- LA.matScale(toParent, 1, 1, vScale);
7301
+ LA.matScale(toParent, 1, 1, totalScale);
72917302 } else
72927303 {
7293
- LA.matScale(toParent, vScale, vScale, 1);
7304
+ LA.matScale(toParent, totalScale, totalScale, 1);
72947305 }
72957306 break;
72967307 }
....@@ -7431,7 +7442,7 @@
74317442 objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")";
74327443 } else
74337444 {
7434
- objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count /*- 1*/) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
7445
+ objname = GetName() + (Math.abs(count) == 1000 ? (count == 1000 ? " " : " * ") : (" (" + (count - 1) + ")")) + /*(IsSelected()?"(selected) ":"") + (touched?"(touched) ":"") */ "";
74357446 } // + super.toString();
74367447 //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName();
74377448
....@@ -7679,9 +7690,9 @@
76797690 private static cVector edge2 = new cVector();
76807691 //private static cVector norm = new cVector();
76817692 /*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;
7693
+ static final int hitCenter = 1;
7694
+ static final int hitScale = 2;
7695
+ static final int hitRotate = 3;
76857696 /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag
76867697 /*transient*/ private Point centerPt;
76877698 /*transient*/ private int startX;