X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d-demos.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fexamples%2FOctreeDemo.java;h=41239657a8c3faff895a2d970baf7613d855aba8;hp=5e5e15fc63a26433c271bea66a703808eee06a87;hb=8ef719db477953b45babc141ed63b6a76244ba90;hpb=04e601452e1e31d14f13b50c1fce9cc6081a8bf2 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java index 5e5e15f..4123965 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/examples/OctreeDemo.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine demos. Copyright ©2012-2018, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu + * Sixth 3D engine demos. Copyright ©2012-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu * * This program is free software; you can redistribute it and/or * modify it under the terms of version 3 of the GNU Lesser General Public License @@ -9,10 +9,10 @@ package eu.svjatoslav.sixth.e3d.examples; import eu.svjatoslav.sixth.e3d.geometry.Point3D; +import eu.svjatoslav.sixth.e3d.gui.ViewFrame; import eu.svjatoslav.sixth.e3d.gui.ViewPanel; +import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationUserInputTracker; import eu.svjatoslav.sixth.e3d.math.Transform; -import eu.svjatoslav.sixth.e3d.gui.ViewFrame; -import eu.svjatoslav.sixth.e3d.gui.humaninput.WorldNavigationTracker; import eu.svjatoslav.sixth.e3d.renderer.octree.OctreeVolume; import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Camera; import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.LightSource; @@ -29,7 +29,7 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe.Grid3D import java.awt.event.KeyEvent; import java.util.Vector; -public class OctreeDemo extends WorldNavigationTracker { +public class OctreeDemo extends WorldNavigationUserInputTracker { private static final double magnification = 5; private final LineAppearance gridAppearance = new LineAppearance(40, new Color(255, @@ -124,18 +124,18 @@ public class OctreeDemo extends WorldNavigationTracker { Color.WHITE, Color.PURPLE); shapeCollection.addShape(message); - viewPanel.getKeyboardFocusTracker().setFocusOwner(this); + viewPanel.getKeyboardFocusStack().pushFocusOwner(this); viewPanel.repaintDuringNextViewUpdate(); } @Override - public void keyPressed(final KeyEvent event, final ViewPanel viewPanel) { + public boolean keyPressed(final KeyEvent event, final ViewPanel viewPanel) { if ('r' == event.getKeyChar()) { raytrace(); - return; + return true; } - super.keyPressed(event, viewPanel); + return super.keyPressed(event, viewPanel); } private void putPixel(final int x, final int y, final int z,