.. | .. |
---|
775 | 775 | if (step == 0) |
---|
776 | 776 | step = 1; |
---|
777 | 777 | if (maxcount == 0) |
---|
778 | | - maxcount = 2048; // 4; |
---|
| 778 | + maxcount = 128; // 2048; // 4; |
---|
779 | 779 | // if (acceleration == 0) |
---|
780 | 780 | // acceleration = 10; |
---|
781 | 781 | if (delay == 0) // serial |
---|
.. | .. |
---|
6950 | 6950 | // { |
---|
6951 | 6951 | // CameraPane.Ymax = spoth; |
---|
6952 | 6952 | // } |
---|
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); |
---|
6955 | 6955 | spot.translate(0, -32); |
---|
6956 | 6956 | info.g.setColor(Color.green); |
---|
6957 | 6957 | info.g.fillRect(spot.x, spot.y, spot.width, spot.height); |
---|
.. | .. |
---|
7006 | 7006 | startX = info.x; |
---|
7007 | 7007 | startY = info.y; |
---|
7008 | 7008 | |
---|
7009 | | - hitSomething = 0; |
---|
| 7009 | + hitSomething = -1; |
---|
7010 | 7010 | cVector origin = new cVector(); |
---|
7011 | 7011 | //LA.xformPos(origin, toParent, origin); |
---|
7012 | 7012 | Rectangle spot = new Rectangle(); |
---|
.. | .. |
---|
7082 | 7082 | //System.out.println("hitSomething = " + hitSomething); |
---|
7083 | 7083 | |
---|
7084 | 7084 | double scale = 0.005f * info.camera.Distance(); |
---|
| 7085 | + |
---|
7085 | 7086 | cVector xlate = new cVector(); |
---|
7086 | 7087 | //cVector xlate2 = new cVector(); |
---|
7087 | 7088 | switch (hitSomething) |
---|
.. | .. |
---|
7230 | 7231 | |
---|
7231 | 7232 | case hitScale: // scale |
---|
7232 | 7233 | 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); |
---|
7233 | 7240 | if (hScale < 0.01) |
---|
7234 | 7241 | { |
---|
7235 | | - hScale = 0.01; |
---|
| 7242 | + //hScale = 0.01; |
---|
7236 | 7243 | } |
---|
7237 | | - hScale = Math.pow(hScale, scale * 50); |
---|
7238 | | - if (hScale < 0.01) |
---|
7239 | | - { |
---|
7240 | | - hScale = 0.01; |
---|
7241 | | - } |
---|
| 7244 | + |
---|
7242 | 7245 | double vScale = (double) (info.y - centerPt.y) / 32; |
---|
7243 | | - if (vScale < 0.01) |
---|
| 7246 | + sign = 1; |
---|
| 7247 | + if (vScale < 0) |
---|
7244 | 7248 | { |
---|
7245 | | - vScale = 0.01; |
---|
| 7249 | + sign = -1; |
---|
7246 | 7250 | } |
---|
7247 | | - vScale = Math.pow(vScale, scale * 50); |
---|
| 7251 | + vScale = sign*Math.pow(sign*vScale, scale * 50); |
---|
7248 | 7252 | if (vScale < 0.01) |
---|
7249 | 7253 | { |
---|
7250 | | - vScale = 0.01; |
---|
| 7254 | + //vScale = 0.01; |
---|
7251 | 7255 | } |
---|
7252 | 7256 | LA.matCopy(startMat, toParent); |
---|
7253 | 7257 | /**/ |
---|
.. | .. |
---|
7258 | 7262 | } |
---|
7259 | 7263 | /**/ |
---|
7260 | 7264 | |
---|
| 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 | + |
---|
7261 | 7272 | switch (info.pane.RenderCamera().viewCode) |
---|
7262 | 7273 | { |
---|
7263 | 7274 | case 3: // '\001' |
---|
7264 | 7275 | if (modified) |
---|
7265 | 7276 | { |
---|
7266 | 7277 | //LA.matScale(toParent, 1, hScale, vScale); |
---|
7267 | | - LA.matScale(toParent, vScale, 1, 1); |
---|
| 7278 | + LA.matScale(toParent, totalScale, 1, 1); |
---|
7268 | 7279 | } // vScale, 1); |
---|
7269 | 7280 | else |
---|
7270 | 7281 | { |
---|
7271 | | - LA.matScale(toParent, vScale, vScale, vScale); |
---|
| 7282 | + LA.matScale(toParent, totalScale, totalScale, totalScale); |
---|
7272 | 7283 | } // vScale, 1); |
---|
7273 | 7284 | break; |
---|
7274 | 7285 | |
---|
.. | .. |
---|
7276 | 7287 | if (modified) |
---|
7277 | 7288 | { |
---|
7278 | 7289 | //LA.matScale(toParent, hScale, 1, vScale); |
---|
7279 | | - LA.matScale(toParent, 1, vScale, 1); |
---|
| 7290 | + LA.matScale(toParent, 1, totalScale, 1); |
---|
7280 | 7291 | } else |
---|
7281 | 7292 | { |
---|
7282 | | - LA.matScale(toParent, vScale, 1, vScale); |
---|
| 7293 | + LA.matScale(toParent, totalScale, 1, totalScale); |
---|
7283 | 7294 | } |
---|
7284 | 7295 | break; |
---|
7285 | 7296 | |
---|
.. | .. |
---|
7287 | 7298 | if (modified) |
---|
7288 | 7299 | { |
---|
7289 | 7300 | //LA.matScale(toParent, hScale, vScale, 1); |
---|
7290 | | - LA.matScale(toParent, 1, 1, vScale); |
---|
| 7301 | + LA.matScale(toParent, 1, 1, totalScale); |
---|
7291 | 7302 | } else |
---|
7292 | 7303 | { |
---|
7293 | | - LA.matScale(toParent, vScale, vScale, 1); |
---|
| 7304 | + LA.matScale(toParent, totalScale, totalScale, 1); |
---|
7294 | 7305 | } |
---|
7295 | 7306 | break; |
---|
7296 | 7307 | } |
---|
.. | .. |
---|
7431 | 7442 | objname = name + " " + System.identityHashCode(this) + " (" + parent.name + " " + System.identityHashCode(parent) + ")"; |
---|
7432 | 7443 | } else |
---|
7433 | 7444 | { |
---|
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) ":"") */ ""; |
---|
7435 | 7446 | } // + super.toString(); |
---|
7436 | 7447 | //return name + " (" + (SizeOf.deepSizeOf(this)/1024) + "K) " + this.getClass().getName(); |
---|
7437 | 7448 | |
---|
.. | .. |
---|
7679 | 7690 | private static cVector edge2 = new cVector(); |
---|
7680 | 7691 | //private static cVector norm = new cVector(); |
---|
7681 | 7692 | /*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; |
---|
7685 | 7696 | /*transient*/ /*private*/ int viewCode; // Now used for transparency cache flag |
---|
7686 | 7697 | /*transient*/ private Point centerPt; |
---|
7687 | 7698 | /*transient*/ private int startX; |
---|