Camera.java | ●●●●● patch | view | raw | blame | history | |
CameraPane.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history |
Camera.java
.. .. @@ -288,25 +288,15 @@ 288 288 // Zoom 289 289 double factor = Math.exp(-dy/300.0); // (1 + dy/100); 290 290 291 - if (viewCode != 0)292 - {293 - LA.vecSub(location, lookAt, location);291 + LA.vecSub(location, lookAt, location);294 292 295 - cVector p = location;293 + cVector p = location;296 294 297 - p.x *= factor;298 - p.y *= factor;299 - p.z *= factor;295 + p.x *= factor;296 + p.y *= factor;297 + p.z *= factor;300 298 301 - LA.vecAdd(location, lookAt, location);302 - }303 - else304 - if (//shaper_fovy < 180 && factor > 1 ||305 - shaper_fovy * factor < 150)306 - {307 - shaper_fovy *= factor;308 - //System.out.println("fovy = " + shaper_fovy);309 - }299 + LA.vecAdd(location, lookAt, location);310 300 } 311 301 else 312 302 { .. .. @@ -340,9 +330,12 @@ 340 330 location.set(lookAt); 341 331 lookAt.set(cStatic.point1); 342 332 343 - cStatic.point1.set(locationBuf);344 - locationBuf.set(lookAtBuf);345 - lookAtBuf.set(cStatic.point1);333 + if (viewCode == 0 && locationBuf != null)334 + {335 + cStatic.point1.set(locationBuf);336 + locationBuf.set(lookAtBuf);337 + lookAtBuf.set(cStatic.point1);338 + }346 339 // UP.mul(-1); 347 340 348 341 RotatePosition(dx,-dy); .. .. @@ -354,9 +347,12 @@ 354 347 location.set(lookAt); 355 348 lookAt.set(cStatic.point1); 356 349 357 - cStatic.point1.set(locationBuf);358 - locationBuf.set(lookAtBuf);359 - lookAtBuf.set(cStatic.point1);350 + if (viewCode == 0 && locationBuf != null)351 + {352 + cStatic.point1.set(locationBuf);353 + locationBuf.set(lookAtBuf);354 + lookAtBuf.set(cStatic.point1);355 + }360 356 361 357 computeTransform(); 362 358 } .. .. @@ -386,8 +382,13 @@ 386 382 { 387 383 double K = 0.25; 388 384 385 + if (!CameraPane.capsLocked)386 + K = 1;387 +389 388 locationBuf.y = location.y * K + locationBuf.y * (1 - K); 390 389 lookAtBuf.y = lookAt.y * K + lookAtBuf.y * (1 - K); 390 +391 + K = 0.1;391 392 392 393 upBuf.x = UP.x * K + upBuf.x * (1 - K); 393 394 upBuf.y = UP.y * K + upBuf.y * (1 - K); .. .. @@ -421,19 +422,19 @@ 421 422 up2.x = UP2.x; 422 423 up2.y = UP2.y; 423 424 up2.z = UP2.z; 424 - LA.vecSub(lookAt, location, away);425 - LA.vecNormalize(away);426 425 LA.vecCross(away, up2, right2); 427 426 if (!(right2.length2() > 0)) 428 427 { 428 + System.out.println("NO UP VECTOR: " + up2);429 + System.out.println("lookAtBuf: " + lookAtBuf);430 + System.out.println("locationBuf: " + locationBuf);429 431 System.exit(0); 432 +430 433 // old problem... 431 434 assert (right2.length2() <= 0 || right2.length2() > 0); // weirdest thing ever 432 435 up2.x = UP.x = 0; 433 436 up2.y = UP.y = 1; 434 437 up2.z = UP.z = 0; 435 - LA.vecSub(lookAt, location, away);436 - LA.vecNormalize(away);437 438 LA.vecCross(away, up2, right2); 438 439 } 439 440 } CameraPane.java
.. .. @@ -11865,7 +11865,10 @@ 11865 11865 } 11866 11866 11867 11867 if (Globals.isLIVE() && DrawMode() == DEFAULT || pingthread.live) // may 2013 11868 + {11869 + renderCamera.computeTransform();11868 11870 repaint(); 11871 + }11869 11872 11870 11873 displaydone = true; 11871 11874 } .. .. @@ -14421,7 +14424,7 @@ 14421 14424 //} 14422 14425 14423 14426 SetMouseMode(e.getModifiers(), WHEEL | e.getModifiersEx()); 14424 - drag(anchorX, anchorY + e.getUnitsToScroll()*8, 0, 0);14427 + drag(anchorX, anchorY + e.getUnitsToScroll()*8, e.getModifiers(), e.getModifiersEx());14425 14428 anchorX = ax; 14426 14429 anchorY = ay; 14427 14430 prevX = px; .. .. @@ -14667,7 +14670,7 @@ 14667 14670 if (mute) 14668 14671 return; 14669 14672 14670 - if (capsLocked)14673 + if (capsLocked && manipCamera.viewCode == 0)14671 14674 { 14672 14675 eye.x = manipCamera.location.x; 14673 14676 eye.y = manipCamera.location.y + 0.25; .. .. @@ -14958,6 +14961,18 @@ 14958 14961 targetLookAt.set(manipCamera.lookAt); 14959 14962 } 14960 14963 14964 + void ViewAngle(float dy)14965 + {14966 + double factor = Math.exp(-dy/300.0); // (1 + dy/100);14967 +14968 + if (manipCamera.shaper_fovy * factor > 1 &&14969 + manipCamera.shaper_fovy * factor < 150)14970 + {14971 + manipCamera.shaper_fovy *= factor;14972 + //System.out.println("fovy = " + shaper_fovy);14973 + }14974 + }14975 +14961 14976 void GoDown(int mod) 14962 14977 { 14963 14978 MODIFIERS |= COMMAND; .. .. @@ -14968,6 +14983,9 @@ 14968 14983 // if (isVR) 14969 14984 // manipCamera.RotateInterest(0, speed); 14970 14985 // else 14986 + if (isVR)14987 + ViewAngle(-speed*delta);14988 + else14971 14989 manipCamera.Translate(0, -speed*delta, getWidth()); 14972 14990 } 14973 14991 else .. .. @@ -15004,6 +15022,9 @@ 15004 15022 // if (isVR) 15005 15023 // manipCamera.RotateInterest(0, -speed); 15006 15024 // else 15025 + if (isVR)15026 + ViewAngle(speed*delta);15027 + else15007 15028 manipCamera.Translate(0, speed*delta, getWidth()); 15008 15029 } 15009 15030 else .. .. @@ -15034,13 +15055,13 @@ 15034 15055 MODIFIERS |= COMMAND; 15035 15056 /**/ 15036 15057 if((mod&SHIFT) == SHIFT) 15037 - manipCamera.Translate(speed*delta, 0, getWidth());15058 + manipCamera.Translate(speed, 0, getWidth());15038 15059 else 15039 15060 { 15040 15061 if ((mouseMode&VR)!=0) 15041 - manipCamera.RotateInterest(-speed, 0);15062 + manipCamera.RotateInterest(-speed*manipCamera.shaper_fovy/90, 0);15042 15063 else 15043 - manipCamera.RotatePosition(speed, 0);15064 + manipCamera.RotatePosition(speed*manipCamera.shaper_fovy/90, 0);15044 15065 } 15045 15066 15046 15067 /**/ .. .. @@ -15066,13 +15087,13 @@ 15066 15087 MODIFIERS |= COMMAND; 15067 15088 /**/ 15068 15089 if((mod&SHIFT) == SHIFT) 15069 - manipCamera.Translate(-speed*delta, 0, getWidth());15090 + manipCamera.Translate(-speed, 0, getWidth());15070 15091 else 15071 15092 { 15072 15093 if ((mouseMode&VR)!=0) 15073 - manipCamera.RotateInterest(speed, 0);15094 + manipCamera.RotateInterest(speed*manipCamera.shaper_fovy/90, 0);15074 15095 else 15075 - manipCamera.RotatePosition(-speed, 0);15096 + manipCamera.RotatePosition(-speed*manipCamera.shaper_fovy/90, 0);15076 15097 } 15077 15098 15078 15099 /**/ .. .. @@ -15219,6 +15240,11 @@ 15219 15240 if ((mouseMode & ZOOM) != 0) 15220 15241 { 15221 15242 //if ((mouseMode & BACKFORTH) != 0) 15243 + if ((modifiersex & SHIFT) == SHIFT)15244 + {15245 + ViewAngle(dy);15246 + }15247 + else15222 15248 if ((mouseMode & VR) != 0) 15223 15249 manipCamera.BackForth(dx, dy, getWidth()); 15224 15250 else .. .. @@ -18210,7 +18236,7 @@ 18210 18236 18211 18237 private boolean keepshadow; 18212 18238 18213 - public boolean capsLocked = false; // VR18239 + static public boolean capsLocked = false; // VR18214 18240 18215 18241 static public int indexcount = 0; 18216 18242 /*static*/ cColor vertexOcclusion = new cColor(); Object3D.java
.. .. @@ -8869,7 +8869,7 @@ 8869 8869 double diry = ray.viewDirection.y; 8870 8870 double dirz = ray.viewDirection.z; 8871 8871 8872 - if (this.fromParent != null)8872 + if (this.fromParent != null && !(this instanceof TextureNode))8873 8873 { 8874 8874 eye.x = eyex; 8875 8875 eye.y = eyey; .. .. @@ -8894,7 +8894,7 @@ 8894 8894 8895 8895 boolean touch = false; 8896 8896 8897 - if (bRep != null)8897 + if (bRep != null && link2support)8898 8898 { 8899 8899 if (bbox == null) 8900 8900 {