Class Main
java.lang.Object
eu.svjatoslav.aukio.e3d.gui.humaninput.WorldNavigationUserInputTracker
eu.svjatoslav.aukio.e3d.examples.life_demo.Main
- All Implemented Interfaces:
eu.svjatoslav.aukio.e3d.gui.FrameListener, eu.svjatoslav.aukio.e3d.gui.humaninput.KeyboardInputHandler
public class Main
extends eu.svjatoslav.aukio.e3d.gui.humaninput.WorldNavigationUserInputTracker
Main entry point for Conway's Game of Life 3D demo.
Creates a 30x30 cell matrix where cells evolve based on Conway's rules.
The user can interact with cells by clicking to toggle their state.
Key controls:
- Space - Evolve one generation
- Enter - Evolve with history (leaves stars marking previous positions)
- C - Clear the matrix
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildScene(eu.svjatoslav.aukio.e3d.renderer.raster.ShapeCollection shapes, eu.svjatoslav.aukio.e3d.renderer.raster.lighting.LightingManager lighting, eu.svjatoslav.aukio.e3d.geometry.Camera camera) Builds the demo scene: the 30x30 cell matrix (initially all dead — a fixed starting pattern), the help panel, and the decorative grid, with the camera positioned to overview the board.booleankeyPressed(KeyEvent event, eu.svjatoslav.aukio.e3d.gui.ViewPanel viewPanel) Handle keyboard input.static voidEntry point for the Game of Life demo.Methods inherited from class eu.svjatoslav.aukio.e3d.gui.humaninput.WorldNavigationUserInputTracker
focusLost, focusReceived, keyReleased, onFrame
-
Constructor Details
-
Main
public Main()Creates a new Main instance for the Game of Life demo.
-
-
Method Details
-
main
Entry point for the Game of Life demo.- Parameters:
args- command line arguments (ignored)
-
buildScene
public static void buildScene(eu.svjatoslav.aukio.e3d.renderer.raster.ShapeCollection shapes, eu.svjatoslav.aukio.e3d.renderer.raster.lighting.LightingManager lighting, eu.svjatoslav.aukio.e3d.geometry.Camera camera) Builds the demo scene: the 30x30 cell matrix (initially all dead — a fixed starting pattern), the help panel, and the decorative grid, with the camera positioned to overview the board. Called by bothmain(String[])and the golden-image harness — must stay deterministic (no time, no unseeded randomness).- Parameters:
shapes- scene to add shapes tolighting- lighting to configure (unused here)camera- camera to position
-
keyPressed
Handle keyboard input.- Specified by:
keyPressedin interfaceeu.svjatoslav.aukio.e3d.gui.humaninput.KeyboardInputHandler- Overrides:
keyPressedin classeu.svjatoslav.aukio.e3d.gui.humaninput.WorldNavigationUserInputTracker
-