Camera.java | ●●●●● patch | view | raw | blame | history | |
CameraPane.java | ●●●●● patch | view | raw | blame | history | |
GroupEditor.java | ●●●●● patch | view | raw | blame | history | |
Object3D.java | ●●●●● patch | view | raw | blame | history | |
iCameraPane.java | ●●●●● patch | view | raw | blame | history |
Camera.java
.. .. @@ -99,6 +99,13 @@ 99 99 perspective = true; 100 100 } 101 101 102 + private void Swap(cVector loc, cVector lat)103 + {104 + cStatic.point1.set(loc);105 + loc.set(lat);106 + lat.set(cStatic.point1);107 + }108 +102 109 private void initCamera() 103 110 { 104 111 focalLength = 1; .. .. @@ -326,32 +333,23 @@ 326 333 { 327 334 right.mul(-1); 328 335 329 - cStatic.point1.set(location);330 - location.set(lookAt);331 - lookAt.set(cStatic.point1);336 + Swap(location, lookAt);332 337 333 338 if (viewCode == 0 && locationBuf != null) 334 339 { 335 - cStatic.point1.set(locationBuf);336 - locationBuf.set(lookAtBuf);337 - lookAtBuf.set(cStatic.point1);340 + Swap(locationBuf, lookAtBuf);338 341 } 339 - // UP.mul(-1);340 342 341 343 RotatePosition(dx,-dy); 342 344 343 345 // UP.mul(-1); 344 346 right.mul(-1); 345 347 346 - cStatic.point1.set(location);347 - location.set(lookAt);348 - lookAt.set(cStatic.point1);348 + Swap(location, lookAt);349 349 350 350 if (viewCode == 0 && locationBuf != null) 351 351 { 352 - cStatic.point1.set(locationBuf);353 - locationBuf.set(lookAtBuf);354 - lookAtBuf.set(cStatic.point1);352 + Swap(locationBuf, lookAtBuf);355 353 } 356 354 357 355 computeTransform(); CameraPane.java
.. .. @@ -15639,7 +15639,7 @@ 15639 15639 */ 15640 15640 } 15641 15641 15642 - void keyPressed(int key, int modifiers)15642 + boolean keyPressed(int key, int modifiers)15643 15643 { 15644 15644 //if(!isRenderer) 15645 15645 // return; .. .. @@ -15651,7 +15651,7 @@ 15651 15651 SetMouseMode(0, modifiers); 15652 15652 } 15653 15653 15654 - Globals.theRenderer.keyPressed(key);15654 + return Globals.theRenderer.keyPressed(key);15655 15655 } 15656 15656 15657 15657 int kompactbit = 4; // power bit .. .. @@ -15669,7 +15669,7 @@ 15669 15669 static Cursor blankCursor = Toolkit.getDefaultToolkit().createCustomCursor( 15670 15670 cursorImg, new Point(0, 0), "blank cursor"); 15671 15671 15672 - public void keyPressed(int key)15672 + public boolean keyPressed(int key)15673 15673 { 15674 15674 // Set the blank cursor to the JFrame. 15675 15675 //object.editWindow.frame. .. .. @@ -16146,18 +16146,20 @@ 16146 16146 Globals.ONESTEP = true; 16147 16147 repaint(); 16148 16148 break; 16149 - case BACKSPACE:16150 - // almost working enablebackspace = true;16151 - Globals.WALK ^= true;16152 -16153 - // SwitchCameras(false);16154 - repaint();16155 - break;16149 +// case BACKSPACE:16150 +// // almost working enablebackspace = true;16151 +// Globals.WALK ^= true;16152 +//16153 +// // SwitchCameras(false);16154 +// repaint();16155 +// break;16156 16156 16157 16157 default: 16158 - break;16158 + return (false);16159 16159 } 16160 16160 //System.out.println("shaper_fovy = " + manipCamera.shaper_fovy); 16161 +16162 + return (true);16161 16163 } 16162 16164 16163 16165 static double OCCLUSIONBOOST = 1; // 0.5; .. .. @@ -16180,6 +16182,7 @@ 16180 16182 switch (e.getID()) 16181 16183 { 16182 16184 case KeyEvent.KEY_PRESSED: 16185 + boolean repaintit = false;16183 16186 16184 16187 if (capsLocked) 16185 16188 { .. .. @@ -16187,6 +16190,7 @@ 16187 16190 modifiers = e.getModifiersEx(); 16188 16191 keyPressed(e.getKeyChar(), modifiers); 16189 16192 //Globals.theRenderer.keyPressed(e.getKeyChar()); 16193 + repaintit = true;16190 16194 } 16191 16195 else 16192 16196 { .. .. @@ -16196,17 +16200,23 @@ 16196 16200 { 16197 16201 case DOWN_ARROW: 16198 16202 lightCamera.DECAL /= 2; 16203 + repaintit = true;16199 16204 break; 16200 16205 case UP_ARROW: 16201 16206 lightCamera.DECAL *= 2; 16207 + repaintit = true;16202 16208 break; 16203 16209 case LEFT_ARROW: 16204 16210 lightCamera.SCALE /= 2; 16211 + repaintit = true;16205 16212 break; 16206 16213 case RIGHT_ARROW: 16207 16214 lightCamera.SCALE *= 2; 16215 + repaintit = true;16208 16216 break; 16209 16217 default: 16218 + modifiers = e.getModifiersEx();16219 + repaintit = keyPressed(e.getKeyChar(), modifiers);16210 16220 break; 16211 16221 } 16212 16222 .. .. @@ -16217,25 +16227,30 @@ 16217 16227 { 16218 16228 case DOWN_ARROW: 16219 16229 GoDown(e.getModifiersEx()); 16230 + repaintit = true;16220 16231 break; 16221 16232 case UP_ARROW: 16222 16233 GoUp(e.getModifiersEx()); 16234 + repaintit = true;16223 16235 break; 16224 16236 case LEFT_ARROW: 16225 16237 GoLeft(e.getModifiersEx()); 16238 + repaintit = true;16226 16239 break; 16227 16240 case RIGHT_ARROW: 16228 16241 GoRight(e.getModifiersEx()); 16242 + repaintit = true;16229 16243 break; 16230 16244 default: 16231 16245 modifiers = e.getModifiersEx(); 16232 - keyPressed(e.getKeyChar(), modifiers);16246 + repaintit = keyPressed(e.getKeyChar(), modifiers);16233 16247 break; 16234 16248 } 16235 16249 } 16236 16250 } 16237 16251 16238 - repaint();16252 + if (repaintit)16253 + repaint();16239 16254 break; 16240 16255 // if (!autorepeat) 16241 16256 // { .. .. @@ -16311,7 +16326,8 @@ 16311 16326 keys[e.getKeyCode()] = false; 16312 16327 modifiers = e.getModifiersEx(); 16313 16328 keyReleased(e.getKeyChar(), e.getModifiersEx()); 16314 - repaint();16329 + //if (e.getKeyCode() != 65535)16330 + // repaint();16315 16331 break; 16316 16332 // { 16317 16333 // switch (e.getKeyCode()) GroupEditor.java
.. .. @@ -1119,13 +1119,17 @@ 1119 1119 antialiasCB.setToolTipText("Final render"); 1120 1120 antialiasCB.addItemListener(this); 1121 1121 1122 + oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);1123 + restoreCameraButton.setToolTipText("Restore viewpoint");1124 + restoreCameraButton.addActionListener(this);1125 +1122 1126 oe.toolbarPanel.add(screenfitButton = GetButton("icons/fit.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); 1123 1127 screenfitButton.setToolTipText("Screen fit"); 1124 1128 screenfitButton.addActionListener(this); 1125 1129 1126 - oe.toolbarPanel.add(restoreCameraButton = GetButton("icons/eye.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);1127 - restoreCameraButton.setToolTipText("Restore viewpoint");1128 - restoreCameraButton.addActionListener(this);1130 + oe.toolbarPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);1131 + flashSelectionButton.setToolTipText("Highlight selection");1132 + flashSelectionButton.addActionListener(this);1129 1133 1130 1134 versionManagerPanel.add(saveVersionButton = GetButton("icons/down_arrow.png", !Globals.NIMBUSLAF)); //, oe.aConstraints); 1131 1135 saveVersionButton.setToolTipText("Duplicate current version"); .. .. @@ -1314,9 +1318,9 @@ 1314 1318 //unselectButton.setToolTipText("Unselect"); 1315 1319 //unselectButton.addActionListener(this); 1316 1320 1317 - editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);1318 - flashSelectionButton.setToolTipText("Highlight selection");1319 - flashSelectionButton.addActionListener(this);1321 +// editCommandsPanel.add(flashSelectionButton = GetButton("icons/flash-light.png", !Globals.NIMBUSLAF)); //, oe.aConstraints);1322 +// flashSelectionButton.setToolTipText("Highlight selection");1323 +// flashSelectionButton.addActionListener(this);1320 1324 1321 1325 editCommandsPanel.preferredHeight = 1; 1322 1326 .. .. @@ -5587,6 +5591,7 @@ 5587 5591 editButton.setEnabled(enabled); 5588 5592 uneditButton.setEnabled(enabled); 5589 5593 //unselectButton.setEnabled(enabled); 5594 + screenfitButton.setEnabled(enabled);5590 5595 flashSelectionButton.setEnabled(enabled); 5591 5596 5592 5597 clearPanelButton.setEnabled(!listUI.isEmpty()); Object3D.java
.. .. @@ -1204,7 +1204,8 @@ 1204 1204 if (maxcount == 0) 1205 1205 { 1206 1206 System.out.println("maxcount == 0"); 1207 - System.exit(0); // maxcount = 128; // 2048; // 4;1207 + //System.exit(0);1208 + maxcount = 128; // 2048; // 4;1208 1209 } 1209 1210 // if (acceleration == 0) 1210 1211 // acceleration = 10; iCameraPane.java
.. .. @@ -92,7 +92,7 @@ 92 92 93 93 void processKeyEvent(java.awt.event.KeyEvent e); 94 94 95 - void keyPressed(int key);95 + boolean keyPressed(int key);96 96 97 97 // For scripts 98 98 void ToggleLive();