From 8761cf1264dd4b6ceb8b5bcaad40dd2d12e33d89 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 25 Mar 2021 18:53:05 +0100 Subject: [PATCH] [DEV] nearly updated --- .checkstyle | 2 +- .classpath | 21 +- ege.iml | 17 + {res => resources/res}/DragonBlender.blend | Bin {res => resources/res}/Tree1.obj | 0 {res => resources/res}/blendMap.png | Bin {res => resources/res}/box.obj | 0 {res => resources/res}/box.png | Bin {res => resources/res}/bunny.obj | 0 {res => resources/res}/cube-one.obj | 0 {res => resources/res}/cube.blend | Bin {res => resources/res}/cube.mtl | 0 {res => resources/res}/cube.obj | 0 {res => resources/res}/dirt.png | Bin {res => resources/res}/dragon.obj | 0 {res => resources/res}/drone.obj | 0 {res => resources/res}/exampleOBJ.obj | 0 {res => resources/res}/fern.obj | 0 {res => resources/res}/fern.png | Bin {res => resources/res}/fern_atlas.png | Bin {res => resources/res}/flower.png | Bin {res => resources/res}/grass.obj | 0 {res => resources/res}/grass.png | Bin {res => resources/res}/grassFlowers.png | Bin {res => resources/res}/grassModel.obj | 0 {res => resources/res}/grassTexture.png | Bin {res => resources/res}/grassy.png | Bin {res => resources/res}/health.png | Bin {res => resources/res}/heightmap.png | Bin {res => resources/res}/image.png | Bin {res => resources/res}/lamp.mtl | 0 {res => resources/res}/lamp.obj | 0 {res => resources/res}/lamp.png | Bin {res => resources/res}/lowPolyTree.obj | 0 {res => resources/res}/lowPolyTree.png | Bin {res => resources/res}/mud.png | Bin {res => resources/res}/path.png | Bin {res => resources/res}/person.blend | Bin {res => resources/res}/person.blend1 | Bin {res => resources/res}/person.obj | 0 {res => resources/res}/person_-xfw_zup.mtl | 0 {res => resources/res}/person_-xfw_zup.obj | 0 {res => resources/res}/person_-yfw_zup.mtl | 0 {res => resources/res}/person_-yfw_zup.obj | 0 {res => resources/res}/pine.obj | 0 {res => resources/res}/pine.png | Bin {res => resources/res}/playerTexture.png | Bin {res => resources/res}/skybox/back.png | Bin {res => resources/res}/skybox/bottom.png | Bin {res => resources/res}/skybox/front.png | Bin {res => resources/res}/skybox/left.png | Bin {res => resources/res}/skybox/right.png | Bin {res => resources/res}/skybox/top.png | Bin {res => resources/res}/skybox2/back.png | Bin {res => resources/res}/skybox2/bottom.png | Bin {res => resources/res}/skybox2/front.png | Bin {res => resources/res}/skybox2/left.png | Bin {res => resources/res}/skybox2/right.png | Bin {res => resources/res}/skybox2/top.png | Bin {res => resources/res}/socuwan.png | Bin {res => resources/res}/stall.blend | Bin {res => resources/res}/stall.obj | 0 {res => resources/res}/stallTexture.png | Bin {res => resources/res}/tree.obj | 0 {res => resources/res}/tree.png | Bin {res => resources/res}/tree_sample.png | Bin {res => resources/res}/white.png | Bin .../resources}/ege/data/simple3D.frag | 0 .../resources}/ege/data/simple3D.vert | 0 .../resources}/ege/data/wireColor.frag | 0 .../resources}/ege/data/wireColor.vert | 0 .../testDataLoxelEngine/data}/basic.frag | 0 .../testDataLoxelEngine/data}/basic.vert | 0 .../data}/basicMaterial.frag | 0 .../data}/basicMaterial.vert | 0 .../data}/blocks/.DS_Store | Bin .../data}/blocks/anvil_base.png | Bin .../data}/blocks/anvil_top_damaged_0.png | Bin .../data}/blocks/anvil_top_damaged_1.png | Bin .../data}/blocks/anvil_top_damaged_2.png | Bin .../data}/blocks/beacon.png | Bin .../data}/blocks/beacon.png.mcmeta | 0 .../data}/blocks/bed_feet_end.png | Bin .../data}/blocks/bed_feet_side.png | Bin .../data}/blocks/bed_feet_top.png | Bin .../data}/blocks/bed_head_end.png | Bin .../data}/blocks/bed_head_side.png | Bin .../data}/blocks/bed_head_top.png | Bin .../data}/blocks/bedrock.png | Bin .../data}/blocks/bookshelf.png | Bin .../data}/blocks/brewing_stand.png | Bin .../data}/blocks/brewing_stand_base.png | Bin .../data}/blocks/brick.png | Bin .../data}/blocks/cactus_bottom.png | Bin .../data}/blocks/cactus_side.png | Bin .../data}/blocks/cactus_top.png | Bin .../data}/blocks/cake_bottom.png | Bin .../data}/blocks/cake_inner.png | Bin .../data}/blocks/cake_side.png | Bin .../data}/blocks/cake_top.png | Bin .../data}/blocks/carrots_stage_0.png | Bin .../data}/blocks/carrots_stage_1.png | Bin .../data}/blocks/carrots_stage_2.png | Bin .../data}/blocks/carrots_stage_3.png | Bin .../data}/blocks/cauldron_bottom.png | Bin .../data}/blocks/cauldron_inner.png | Bin .../data}/blocks/cauldron_side.png | Bin .../data}/blocks/cauldron_top.png | Bin .../data}/blocks/chorus_flower.png | Bin .../data}/blocks/chorus_flower_dead.png | Bin .../data}/blocks/chorus_plant.png | Bin .../testDataLoxelEngine/data}/blocks/clay.png | Bin .../data}/blocks/coal_block.png | Bin .../data}/blocks/coal_ore.png | Bin .../data}/blocks/coarse_dirt.png | Bin .../data}/blocks/cobblestone.png | Bin .../data}/blocks/cobblestone_mossy.png | Bin .../data}/blocks/cocoa_stage_0.png | Bin .../data}/blocks/cocoa_stage_1.png | Bin .../data}/blocks/cocoa_stage_2.png | Bin .../data}/blocks/command_block.png | Bin .../data}/blocks/command_block.png.mcmeta | 0 .../data}/blocks/comparator_off.png | Bin .../data}/blocks/comparator_on.png | Bin .../data}/blocks/crafting_table_front.png | Bin .../data}/blocks/crafting_table_side.png | Bin .../data}/blocks/crafting_table_top.png | Bin .../blocks/daylight_detector_inverted_top.png | Bin .../data}/blocks/daylight_detector_side.png | Bin .../data}/blocks/daylight_detector_top.png | Bin .../data}/blocks/deadbush.png | Bin .../data}/blocks/destroy_stage_0.png | Bin .../data}/blocks/destroy_stage_1.png | Bin .../data}/blocks/destroy_stage_2.png | Bin .../data}/blocks/destroy_stage_3.png | Bin .../data}/blocks/destroy_stage_4.png | Bin .../data}/blocks/destroy_stage_5.png | Bin .../data}/blocks/destroy_stage_6.png | Bin .../data}/blocks/destroy_stage_7.png | Bin .../data}/blocks/destroy_stage_8.png | Bin .../data}/blocks/destroy_stage_9.png | Bin .../data}/blocks/diamond.png.mcmeta | 0 .../data}/blocks/diamond_block.png | Bin .../data}/blocks/diamond_block.png.mcmeta | 0 .../data}/blocks/diamond_ore.png | Bin .../data}/blocks/diamond_ore.png.mcmeta | 0 .../testDataLoxelEngine/data}/blocks/dirt.png | Bin .../data}/blocks/dirt_podzol_side.png | Bin .../data}/blocks/dirt_podzol_top.png | Bin .../blocks/dispenser_front_horizontal.png | Bin .../data}/blocks/dispenser_front_vertical.png | Bin .../data}/blocks/door_acacia_lower.png | Bin .../data}/blocks/door_acacia_upper.png | Bin .../data}/blocks/door_dark_oak_lower.png | Bin .../data}/blocks/door_dark_oak_upper.png | Bin .../data}/blocks/door_iron_lower.png | Bin .../data}/blocks/door_iron_upper.png | Bin .../data}/blocks/door_wood_lower.png | Bin .../data}/blocks/door_wood_upper.png | Bin .../data}/blocks/double_plant_fern_bottom.png | Bin .../data}/blocks/double_plant_fern_top.png | Bin .../blocks/double_plant_paeonia_bottom.png | Bin .../data}/blocks/double_plant_paeonia_top.png | Bin .../data}/blocks/double_plant_rose_bottom.png | Bin .../data}/blocks/double_plant_rose_top.png | Bin .../blocks/double_plant_syringa_bottom.png | Bin .../data}/blocks/double_plant_syringa_top.png | Bin .../data}/blocks/dragon_egg.png | Bin .../data}/blocks/dragon_egg.png.mcmeta | 0 .../data}/blocks/dropper_front_horizontal.png | Bin .../data}/blocks/dropper_front_vertical.png | Bin .../data}/blocks/emerald_block.png | Bin .../data}/blocks/emerald_block.png.mcmeta | 0 .../data}/blocks/emerald_ore.png | Bin .../data}/blocks/emerald_ore.png.mcmeta | 0 .../data}/blocks/end_bricks.png | Bin .../data}/blocks/end_rod.png | Bin .../data}/blocks/end_stone.png | Bin .../data}/blocks/endframe_eye.png | Bin .../data}/blocks/endframe_eye.png.mcmeta | 0 .../data}/blocks/endframe_side.png | Bin .../data}/blocks/endframe_side.png.mcmeta | 0 .../data}/blocks/endframe_top.png | Bin .../data}/blocks/endframe_top.png.mcmeta | 0 .../data}/blocks/farmland_dry.png | Bin .../data}/blocks/farmland_wet.png | Bin .../testDataLoxelEngine/data}/blocks/fern.png | Bin .../data}/blocks/fire_layer_0.png | Bin .../data}/blocks/fire_layer_0.png.mcmeta | 0 .../data}/blocks/fire_layer_1.png | Bin .../data}/blocks/fire_layer_1.png.mcmeta | 0 .../data}/blocks/flower_dandelion.png | Bin .../data}/blocks/flower_rose.png | Bin .../data}/blocks/furnace_front_off.png | Bin .../data}/blocks/furnace_front_on.png | Bin .../data}/blocks/furnace_front_on.png.mcmeta | 0 .../data}/blocks/furnace_side.png | Bin .../data}/blocks/furnace_top.png | Bin .../data}/blocks/furnace_top.png.mcmeta | 0 .../data}/blocks/glass.png | Bin .../data}/blocks/glass_black.png | Bin .../data}/blocks/glass_blue.png | Bin .../data}/blocks/glass_brown.png | Bin .../data}/blocks/glass_cyan.png | Bin .../data}/blocks/glass_gray.png | Bin .../data}/blocks/glass_green.png | Bin .../data}/blocks/glass_light_blue.png | Bin .../data}/blocks/glass_lime.png | Bin .../data}/blocks/glass_magenta.png | Bin .../data}/blocks/glass_orange.png | Bin .../data}/blocks/glass_pane_top.png | Bin .../data}/blocks/glass_pink.png | Bin .../data}/blocks/glass_purple.png | Bin .../data}/blocks/glass_red.png | Bin .../data}/blocks/glass_silver.png | Bin .../data}/blocks/glass_white.png | Bin .../data}/blocks/glass_yellow.png | Bin .../data}/blocks/glowstone.png | Bin .../data}/blocks/glowstone.png.mcmeta | 0 .../data}/blocks/gold_block.png | Bin .../data}/blocks/gold_ore.png | Bin .../data}/blocks/gold_ore.png.mcmeta | 0 .../data}/blocks/gold_top.png | Bin .../data}/blocks/grass_path_side.png | Bin .../data}/blocks/grass_path_top.png | Bin .../data}/blocks/grass_side_block.png | Bin .../data}/blocks/grass_side_overlay.png | Bin .../data}/blocks/grass_side_overlay2.png | Bin .../data}/blocks/grass_side_snowed.png | Bin .../data}/blocks/grass_top.png | Bin .../data}/blocks/gravel.png | Bin .../data}/blocks/hardened_clay.png | Bin .../blocks/hardened_clay_stained_black.png | Bin .../blocks/hardened_clay_stained_blue.png | Bin .../blocks/hardened_clay_stained_brown.png | Bin .../blocks/hardened_clay_stained_cyan.png | Bin .../blocks/hardened_clay_stained_gray.png | Bin .../blocks/hardened_clay_stained_green.png | Bin .../hardened_clay_stained_light_blue.png | Bin .../blocks/hardened_clay_stained_lime.png | Bin .../blocks/hardened_clay_stained_magenta.png | Bin .../blocks/hardened_clay_stained_orange.png | Bin .../blocks/hardened_clay_stained_pink.png | Bin .../blocks/hardened_clay_stained_purple.png | Bin .../blocks/hardened_clay_stained_red.png | Bin .../blocks/hardened_clay_stained_silver.png | Bin .../blocks/hardened_clay_stained_white.png | Bin .../blocks/hardened_clay_stained_yellow.png | Bin .../data}/blocks/hay_block_side.png | Bin .../data}/blocks/hay_block_top.png | Bin .../data}/blocks/hopper_inside.png | Bin .../data}/blocks/hopper_outside.png | Bin .../data}/blocks/hopper_top.png | Bin .../testDataLoxelEngine/data}/blocks/ice.png | Bin .../data}/blocks/ice_packed.png | Bin .../data}/blocks/ice_packed.png.mcmeta | 0 .../data}/blocks/iron_bars.png | Bin .../data}/blocks/iron_bars_top.png | Bin .../data}/blocks/iron_block.png | Bin .../data}/blocks/iron_ore.png | Bin .../data}/blocks/iron_top.png | Bin .../data}/blocks/iron_trapdoor.png | Bin .../data}/blocks/itemframe_background.png | Bin .../data}/blocks/jukebox_side.png | Bin .../data}/blocks/jukebox_side.png.mcmeta | 0 .../data}/blocks/jukebox_top.png | Bin .../data}/blocks/lapis_block.png | Bin .../data}/blocks/lapis_ore.png | Bin .../data}/blocks/lava_flow.png | Bin .../data}/blocks/lava_flow.png.mcmeta | 0 .../data}/blocks/lava_flow.png.mcmeta copy | 0 .../data}/blocks/lava_still.png | Bin .../data}/blocks/lava_still.png.mcmeta | 0 .../data}/blocks/lava_still.png.mcmeta copy | 0 .../data}/blocks/leaves_acacia.png | Bin .../data}/blocks/leaves_big_oak.png | Bin .../data}/blocks/leaves_birch.png | Bin .../data}/blocks/leaves_jungle.png | Bin .../data}/blocks/leaves_oak.png | Bin .../data}/blocks/leaves_spruce.png | Bin .../data}/blocks/lever.png | Bin .../data}/blocks/log_acacia.png | Bin .../data}/blocks/log_acacia_top.png | Bin .../data}/blocks/log_big_oak.png | Bin .../data}/blocks/log_big_oak_top.png | Bin .../data}/blocks/log_birch.png | Bin .../data}/blocks/log_birch_top.png | Bin .../data}/blocks/log_jungle.png | Bin .../data}/blocks/log_jungle_top.png | Bin .../data}/blocks/log_oak.png | Bin .../data}/blocks/log_oak_top.png | Bin .../data}/blocks/log_spruce.png | Bin .../data}/blocks/log_spruce_top.png | Bin .../data}/blocks/melon_side.png | Bin .../data}/blocks/melon_stem_connected.png | Bin .../data}/blocks/melon_stem_disconnected.png | Bin .../data}/blocks/melon_top.png | Bin .../data}/blocks/mob_spawner.png | Bin .../data}/blocks/mushroom_block_inside.png | Bin .../blocks/mushroom_block_skin_brown.png | Bin .../data}/blocks/mushroom_block_skin_red.png | Bin .../data}/blocks/mushroom_block_skin_stem.png | Bin .../data}/blocks/mushroom_brown.png | Bin .../data}/blocks/mushroom_red.png | Bin .../data}/blocks/mycelium_side.png | Bin .../data}/blocks/mycelium_top.png | Bin .../data}/blocks/nether_brick.png | Bin .../data}/blocks/nether_portal.png | Bin .../data}/blocks/nether_portal.png.mcmeta | 0 .../data}/blocks/nether_wart_stage_0.png | Bin .../data}/blocks/nether_wart_stage_1.png | Bin .../data}/blocks/nether_wart_stage_2.png | Bin .../data}/blocks/netherrack.png | Bin .../data}/blocks/noteblock.png | Bin .../data}/blocks/obsidian.png | Bin .../data}/blocks/piston_bottom.png | Bin .../data}/blocks/piston_inner.png | Bin .../data}/blocks/piston_side.png | Bin .../data}/blocks/piston_top_normal.png | Bin .../data}/blocks/piston_top_sticky.png | Bin .../data}/blocks/planks_acacia.png | Bin .../data}/blocks/planks_big_oak.png | Bin .../data}/blocks/planks_birch.png | Bin .../data}/blocks/planks_jungle.png | Bin .../data}/blocks/planks_oak.png | Bin .../data}/blocks/planks_spruce.png | Bin .../data}/blocks/portal.png | Bin .../data}/blocks/portal.png.mcmeta | 0 .../data}/blocks/portal.png.mcmeta copy | 0 .../data}/blocks/portal_effect.png | Bin .../data}/blocks/portal_effect.png.mcmeta | 0 .../data}/blocks/potatoes_stage_0.png | Bin .../data}/blocks/potatoes_stage_1.png | Bin .../data}/blocks/potatoes_stage_2.png | Bin .../data}/blocks/potatoes_stage_3.png | Bin .../data}/blocks/prismarine_bricks.png | Bin .../data}/blocks/prismarine_bricks.png.mcmeta | 0 .../data}/blocks/prismarine_dark.png | Bin .../data}/blocks/prismarine_rough.png | Bin .../data}/blocks/prismarine_rough.png.mcmeta | 0 .../blocks/prismarine_rough.png.mcmeta copy | 0 .../data}/blocks/pumpkin_face_off.png | Bin .../data}/blocks/pumpkin_face_on.png | Bin .../data}/blocks/pumpkin_face_on.png.mcmeta | 0 .../data}/blocks/pumpkin_side.png | Bin .../data}/blocks/pumpkin_top.png | Bin .../data}/blocks/purpur_block.png | Bin .../data}/blocks/purpur_pillar.png | Bin .../data}/blocks/purpur_pillar_top.png | Bin .../data}/blocks/quartz_block_bottom.png | Bin .../data}/blocks/quartz_block_chiseled.png | Bin .../blocks/quartz_block_chiseled_top.png | Bin .../data}/blocks/quartz_block_lines.png | Bin .../data}/blocks/quartz_block_lines_top.png | Bin .../data}/blocks/quartz_block_side.png | Bin .../data}/blocks/quartz_block_top.png | Bin .../data}/blocks/quartz_ore.png | Bin .../data}/blocks/rail_activator.png | Bin .../data}/blocks/rail_activator_powered.png | Bin .../blocks/rail_activator_powered.png.mcmeta | 0 .../data}/blocks/rail_detector.png | Bin .../data}/blocks/rail_detector_powered.png | Bin .../blocks/rail_detector_powered.png.mcmeta | 0 .../data}/blocks/rail_golden.png | Bin .../data}/blocks/rail_golden_powered.png | Bin .../blocks/rail_golden_powered.png.mcmeta | 0 .../data}/blocks/rail_normal.png | Bin .../data}/blocks/rail_normal_turned.png | Bin .../data}/blocks/red_sand.png | Bin .../data}/blocks/red_sandstone_bottom.png | Bin .../data}/blocks/red_sandstone_carved.png | Bin .../data}/blocks/red_sandstone_carved_1.png | Bin .../data}/blocks/red_sandstone_carved_2.png | Bin .../data}/blocks/red_sandstone_normal.png | Bin .../data}/blocks/red_sandstone_smooth.png | Bin .../data}/blocks/red_sandstone_top.png | Bin .../data}/blocks/redstone_block.png | Bin .../data}/blocks/redstone_block.png.mcmeta | 0 .../data}/blocks/redstone_dust_cross.png | Bin .../data}/blocks/redstone_dust_dot.png | Bin .../data}/blocks/redstone_dust_line.png | Bin .../data}/blocks/redstone_dust_line0.png | Bin .../data}/blocks/redstone_dust_line1.png | Bin .../data}/blocks/redstone_lamp_off.png | Bin .../data}/blocks/redstone_lamp_on.png | Bin .../data}/blocks/redstone_lamp_on.png.mcmeta | 0 .../data}/blocks/redstone_ore.png | Bin .../data}/blocks/redstone_ore.png.mcmeta | 0 .../data}/blocks/redstone_torch_off.png | Bin .../data}/blocks/redstone_torch_on.png | Bin .../data}/blocks/redstone_torch_on.png.mcmeta | 0 .../data}/blocks/reeds.png | Bin .../data}/blocks/repeater_off.png | Bin .../data}/blocks/repeater_on.png | Bin .../testDataLoxelEngine/data}/blocks/sand.png | Bin .../data}/blocks/sandstone_bottom.png | Bin .../data}/blocks/sandstone_carved.png | Bin .../data}/blocks/sandstone_carved_1.png | Bin .../data}/blocks/sandstone_carved_2.png | Bin .../data}/blocks/sandstone_normal.png | Bin .../data}/blocks/sandstone_smooth.png | Bin .../data}/blocks/sandstone_top.png | Bin .../data}/blocks/sea_lantern.png | Bin .../data}/blocks/slime.png | Bin .../testDataLoxelEngine/data}/blocks/snow.png | Bin .../data}/blocks/soul_sand.png | Bin .../data}/blocks/sponge.png | Bin .../data}/blocks/sponge_wet.png | Bin .../data}/blocks/stone.png | Bin .../data}/blocks/stone_andesite.png | Bin .../data}/blocks/stone_andesite_smooth.png | Bin .../data}/blocks/stone_diorite.png | Bin .../data}/blocks/stone_diorite_smooth.png | Bin .../data}/blocks/stone_granite.png | Bin .../data}/blocks/stone_granite_smooth.png | Bin .../data}/blocks/stone_slab_side.png | Bin .../data}/blocks/stone_slab_top.png | Bin .../data}/blocks/stonebrick.png | Bin .../data}/blocks/stonebrick_1.png | Bin .../data}/blocks/stonebrick_2.png | Bin .../data}/blocks/stonebrick_carved.png | Bin .../data}/blocks/stonebrick_cracked.png | Bin .../data}/blocks/stonebrick_cracked_1.png | Bin .../data}/blocks/stonebrick_cracked_2.png | Bin .../data}/blocks/stonebrick_mossy.png | Bin .../data}/blocks/sunflower_head.png | Bin .../data}/blocks/sunflower_stem.png | Bin .../data}/blocks/tallgrass.png | Bin .../data}/blocks/tnt_bottom.png | Bin .../data}/blocks/tnt_side.png | Bin .../data}/blocks/tnt_top.png | Bin .../data}/blocks/trapdoor.png | Bin .../data}/blocks/trip_wire.png | Bin .../data}/blocks/trip_wire_source.png | Bin .../testDataLoxelEngine/data}/blocks/vine.png | Bin .../data}/blocks/water_flow.png | Bin .../data}/blocks/water_flow.png.mcmeta | 0 .../data}/blocks/water_static.png | Bin .../data}/blocks/water_still.png | Bin .../data}/blocks/water_still.png.mcmeta | 0 .../data}/blocks/waterlily.png | Bin .../testDataLoxelEngine/data}/blocks/web.png | Bin .../data}/blocks/wool_colored_black.png | Bin .../data}/blocks/wool_colored_blue.png | Bin .../data}/blocks/wool_colored_brown.png | Bin .../data}/blocks/wool_colored_cyan.png | Bin .../data}/blocks/wool_colored_gray.png | Bin .../data}/blocks/wool_colored_green.png | Bin .../data}/blocks/wool_colored_light_blue.png | Bin .../data}/blocks/wool_colored_lime.png | Bin .../data}/blocks/wool_colored_magenta.png | Bin .../data}/blocks/wool_colored_orange.png | Bin .../data}/blocks/wool_colored_pink.png | Bin .../data}/blocks/wool_colored_purple.png | Bin .../data}/blocks/wool_colored_red.png | Bin .../data}/blocks/wool_colored_silver.png | Bin .../data}/blocks/wool_colored_white.png | Bin .../data}/blocks/wool_colored_yellow.png | Bin src/engineTester/MainGameLoop.java | 140 ++- src/entities/Camera.java | 124 ++- src/entities/Entity.java | 109 +-- src/entities/Player.java | 66 +- src/module-info.java | 1 + src/objConverter/OBJFileLoader.java | 253 +++--- src/org/atriasoft/ege/Component.java | 4 +- .../atriasoft/ege/ControlCameraPlayer.java | 84 +- .../atriasoft/ege/ControlCameraPlayerFPS.java | 109 ++- .../atriasoft/ege/ControlCameraSimple.java | 127 ++- src/org/atriasoft/ege/ControlInterface.java | 14 +- src/org/atriasoft/ege/Ege.java | 11 + src/org/atriasoft/ege/Engine.java | 10 +- src/org/atriasoft/ege/Entity.java | 30 +- src/org/atriasoft/ege/Environement.java | 65 +- src/org/atriasoft/ege/camera/Camera.java | 61 +- .../ege/components/ComponentLight.java | 4 +- .../ege/components/ComponentPhysics.java | 203 ++--- .../ege/components/ComponentPosition.java | 16 +- .../components/ComponentPositionPlayer.java | 22 +- src/org/atriasoft/ege/engines/EngineAI.java | 9 +- .../atriasoft/ege/engines/EngineGravity.java | 69 +- .../atriasoft/ege/engines/EnginePhysics.java | 26 +- src/org/atriasoft/ege/geometry/AABB.java | 29 +- .../atriasoft/ege/geometry/Geometry3D.java | 133 ++- src/org/atriasoft/ege/geometry/Line.java | 31 +- src/org/atriasoft/ege/geometry/OBB.java | 27 +- src/org/atriasoft/ege/geometry/Ray.java | 37 +- src/org/atriasoft/ege/geometry/Sphere.java | 16 +- src/org/atriasoft/ege/geometry/Triangle.java | 19 +- .../map/ComponentDynamicMeshsVoxelMap.java | 237 ++--- src/org/atriasoft/ege/map/MapVoxel.java | 4 +- .../atriasoft/ege/physics/shape/Shape.java | 6 +- .../resource/ResourceListTexturedMesh.java | 191 ++-- .../resource/ResourceStaticColoredMesh.java | 40 +- .../ege/resource/ResourceStaticMesh.java | 58 +- .../ege/resource/ResourceStaticMeshObj.java | 59 +- .../resource/ResourceStaticTexturedMesh.java | 40 +- .../samples/LoxelEngine/LoxelApplication.java | 76 +- .../CollisionTestApplication.java | 127 +-- .../collisiontest/MainCollisionTest.java | 8 +- .../samples/lowPoly/LowPolyApplication.java | 176 ++-- .../s1_texturedCube/S1Application.java | 112 ++- .../atriasoft/ege/tools/MeshGenerator.java | 827 +++++++++--------- src/renderEngine/MasterRenderer.java | 112 ++- src/renderEngine/OBJLoader.java | 6 +- src/shaders/ShaderProgram.java | 5 +- src/shaders/StaticShader.java | 6 +- src/shaders/TerrainShader.java | 6 +- src/skybox/SkyboxShader.java | 2 +- src/terrains/Terrain.java | 167 ++-- src/toolbox/Maths.java | 54 +- .../test/atriasoft/{gameengine => ege}/.keep | 0 .../atriasoft/{gameengine => ege}/Log.java | 0 .../atriasoft/{gameengine => ege}/Log2.java | 0 .../{gameengine => ege}/TestBasicLog.java | 0 .../atriasoft/ege/TestTransformation3D.java | 77 ++ .../gameengine/TestTransformation3D.java | 76 -- 516 files changed, 2175 insertions(+), 2186 deletions(-) create mode 100644 ege.iml rename {res => resources/res}/DragonBlender.blend (100%) rename {res => resources/res}/Tree1.obj (100%) rename {res => resources/res}/blendMap.png (100%) rename {res => resources/res}/box.obj (100%) rename {res => resources/res}/box.png (100%) rename {res => resources/res}/bunny.obj (100%) rename {res => resources/res}/cube-one.obj (100%) rename {res => resources/res}/cube.blend (100%) rename {res => resources/res}/cube.mtl (100%) rename {res => resources/res}/cube.obj (100%) rename {res => resources/res}/dirt.png (100%) rename {res => resources/res}/dragon.obj (100%) rename {res => resources/res}/drone.obj (100%) rename {res => resources/res}/exampleOBJ.obj (100%) rename {res => resources/res}/fern.obj (100%) rename {res => resources/res}/fern.png (100%) rename {res => resources/res}/fern_atlas.png (100%) rename {res => resources/res}/flower.png (100%) rename {res => resources/res}/grass.obj (100%) rename {res => resources/res}/grass.png (100%) rename {res => resources/res}/grassFlowers.png (100%) rename {res => resources/res}/grassModel.obj (100%) rename {res => resources/res}/grassTexture.png (100%) rename {res => resources/res}/grassy.png (100%) rename {res => resources/res}/health.png (100%) rename {res => resources/res}/heightmap.png (100%) rename {res => resources/res}/image.png (100%) rename {res => resources/res}/lamp.mtl (100%) rename {res => resources/res}/lamp.obj (100%) rename {res => resources/res}/lamp.png (100%) rename {res => resources/res}/lowPolyTree.obj (100%) rename {res => resources/res}/lowPolyTree.png (100%) rename {res => resources/res}/mud.png (100%) rename {res => resources/res}/path.png (100%) rename {res => resources/res}/person.blend (100%) rename {res => resources/res}/person.blend1 (100%) rename {res => resources/res}/person.obj (100%) rename {res => resources/res}/person_-xfw_zup.mtl (100%) rename {res => resources/res}/person_-xfw_zup.obj (100%) rename {res => resources/res}/person_-yfw_zup.mtl (100%) rename {res => resources/res}/person_-yfw_zup.obj (100%) rename {res => resources/res}/pine.obj (100%) rename {res => resources/res}/pine.png (100%) rename {res => resources/res}/playerTexture.png (100%) rename {res => resources/res}/skybox/back.png (100%) rename {res => resources/res}/skybox/bottom.png (100%) rename {res => resources/res}/skybox/front.png (100%) rename {res => resources/res}/skybox/left.png (100%) rename {res => resources/res}/skybox/right.png (100%) rename {res => resources/res}/skybox/top.png (100%) rename {res => resources/res}/skybox2/back.png (100%) rename {res => resources/res}/skybox2/bottom.png (100%) rename {res => resources/res}/skybox2/front.png (100%) rename {res => resources/res}/skybox2/left.png (100%) rename {res => resources/res}/skybox2/right.png (100%) rename {res => resources/res}/skybox2/top.png (100%) rename {res => resources/res}/socuwan.png (100%) rename {res => resources/res}/stall.blend (100%) rename {res => resources/res}/stall.obj (100%) rename {res => resources/res}/stallTexture.png (100%) rename {res => resources/res}/tree.obj (100%) rename {res => resources/res}/tree.png (100%) rename {res => resources/res}/tree_sample.png (100%) rename {res => resources/res}/white.png (100%) rename {src/org/atriasoft => resources/resources}/ege/data/simple3D.frag (100%) rename {src/org/atriasoft => resources/resources}/ege/data/simple3D.vert (100%) rename {src/org/atriasoft => resources/resources}/ege/data/wireColor.frag (100%) rename {src/org/atriasoft => resources/resources}/ege/data/wireColor.vert (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/basic.frag (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/basic.vert (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/basicMaterial.frag (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/basicMaterial.vert (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/.DS_Store (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/anvil_base.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/anvil_top_damaged_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/anvil_top_damaged_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/anvil_top_damaged_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/beacon.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/beacon.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bed_feet_end.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bed_feet_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bed_feet_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bed_head_end.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bed_head_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bed_head_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bedrock.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/bookshelf.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/brewing_stand.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/brewing_stand_base.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/brick.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cactus_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cactus_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cactus_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cake_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cake_inner.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cake_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cake_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/carrots_stage_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/carrots_stage_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/carrots_stage_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/carrots_stage_3.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cauldron_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cauldron_inner.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cauldron_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cauldron_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/chorus_flower.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/chorus_flower_dead.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/chorus_plant.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/clay.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/coal_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/coal_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/coarse_dirt.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cobblestone.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cobblestone_mossy.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cocoa_stage_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cocoa_stage_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/cocoa_stage_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/command_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/command_block.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/comparator_off.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/comparator_on.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/crafting_table_front.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/crafting_table_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/crafting_table_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/daylight_detector_inverted_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/daylight_detector_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/daylight_detector_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/deadbush.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_3.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_4.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_5.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_6.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_7.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_8.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/destroy_stage_9.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/diamond.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/diamond_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/diamond_block.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/diamond_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/diamond_ore.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dirt.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dirt_podzol_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dirt_podzol_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dispenser_front_horizontal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dispenser_front_vertical.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_acacia_lower.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_acacia_upper.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_dark_oak_lower.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_dark_oak_upper.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_iron_lower.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_iron_upper.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_wood_lower.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/door_wood_upper.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_fern_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_fern_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_paeonia_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_paeonia_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_rose_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_rose_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_syringa_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/double_plant_syringa_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dragon_egg.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dragon_egg.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dropper_front_horizontal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/dropper_front_vertical.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/emerald_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/emerald_block.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/emerald_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/emerald_ore.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/end_bricks.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/end_rod.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/end_stone.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/endframe_eye.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/endframe_eye.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/endframe_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/endframe_side.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/endframe_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/endframe_top.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/farmland_dry.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/farmland_wet.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/fern.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/fire_layer_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/fire_layer_0.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/fire_layer_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/fire_layer_1.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/flower_dandelion.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/flower_rose.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/furnace_front_off.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/furnace_front_on.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/furnace_front_on.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/furnace_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/furnace_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/furnace_top.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_black.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_blue.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_brown.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_cyan.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_gray.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_green.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_light_blue.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_lime.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_magenta.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_orange.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_pane_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_pink.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_purple.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_red.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_silver.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_white.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glass_yellow.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glowstone.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/glowstone.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/gold_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/gold_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/gold_ore.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/gold_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_path_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_path_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_side_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_side_overlay.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_side_overlay2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_side_snowed.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/grass_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/gravel.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_black.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_blue.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_brown.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_cyan.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_gray.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_green.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_light_blue.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_lime.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_magenta.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_orange.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_pink.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_purple.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_red.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_silver.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_white.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hardened_clay_stained_yellow.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hay_block_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hay_block_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hopper_inside.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hopper_outside.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/hopper_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/ice.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/ice_packed.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/ice_packed.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/iron_bars.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/iron_bars_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/iron_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/iron_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/iron_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/iron_trapdoor.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/itemframe_background.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/jukebox_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/jukebox_side.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/jukebox_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lapis_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lapis_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lava_flow.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lava_flow.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lava_flow.png.mcmeta copy (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lava_still.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lava_still.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lava_still.png.mcmeta copy (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/leaves_acacia.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/leaves_big_oak.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/leaves_birch.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/leaves_jungle.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/leaves_oak.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/leaves_spruce.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/lever.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_acacia.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_acacia_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_big_oak.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_big_oak_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_birch.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_birch_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_jungle.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_jungle_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_oak.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_oak_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_spruce.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/log_spruce_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/melon_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/melon_stem_connected.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/melon_stem_disconnected.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/melon_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mob_spawner.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mushroom_block_inside.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mushroom_block_skin_brown.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mushroom_block_skin_red.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mushroom_block_skin_stem.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mushroom_brown.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mushroom_red.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mycelium_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/mycelium_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/nether_brick.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/nether_portal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/nether_portal.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/nether_wart_stage_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/nether_wart_stage_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/nether_wart_stage_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/netherrack.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/noteblock.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/obsidian.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/piston_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/piston_inner.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/piston_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/piston_top_normal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/piston_top_sticky.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/planks_acacia.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/planks_big_oak.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/planks_birch.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/planks_jungle.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/planks_oak.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/planks_spruce.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/portal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/portal.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/portal.png.mcmeta copy (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/portal_effect.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/portal_effect.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/potatoes_stage_0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/potatoes_stage_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/potatoes_stage_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/potatoes_stage_3.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/prismarine_bricks.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/prismarine_bricks.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/prismarine_dark.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/prismarine_rough.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/prismarine_rough.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/prismarine_rough.png.mcmeta copy (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/pumpkin_face_off.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/pumpkin_face_on.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/pumpkin_face_on.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/pumpkin_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/pumpkin_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/purpur_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/purpur_pillar.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/purpur_pillar_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_chiseled.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_chiseled_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_lines.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_lines_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_block_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/quartz_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_activator.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_activator_powered.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_activator_powered.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_detector.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_detector_powered.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_detector_powered.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_golden.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_golden_powered.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_golden_powered.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_normal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/rail_normal_turned.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sand.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_carved.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_carved_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_carved_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_normal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_smooth.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/red_sandstone_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_block.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_block.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_dust_cross.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_dust_dot.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_dust_line.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_dust_line0.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_dust_line1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_lamp_off.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_lamp_on.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_lamp_on.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_ore.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_ore.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_torch_off.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_torch_on.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/redstone_torch_on.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/reeds.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/repeater_off.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/repeater_on.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sand.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_carved.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_carved_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_carved_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_normal.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_smooth.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sandstone_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sea_lantern.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/slime.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/snow.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/soul_sand.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sponge.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sponge_wet.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_andesite.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_andesite_smooth.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_diorite.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_diorite_smooth.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_granite.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_granite_smooth.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_slab_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stone_slab_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_carved.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_cracked.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_cracked_1.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_cracked_2.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/stonebrick_mossy.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sunflower_head.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/sunflower_stem.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/tallgrass.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/tnt_bottom.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/tnt_side.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/tnt_top.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/trapdoor.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/trip_wire.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/trip_wire_source.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/vine.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/water_flow.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/water_flow.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/water_static.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/water_still.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/water_still.png.mcmeta (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/waterlily.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/web.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_black.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_blue.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_brown.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_cyan.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_gray.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_green.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_light_blue.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_lime.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_magenta.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_orange.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_pink.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_purple.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_red.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_silver.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_white.png (100%) rename {src/org/atriasoft/ege/samples/LoxelEngine/res => resources/testDataLoxelEngine/data}/blocks/wool_colored_yellow.png (100%) create mode 100644 src/org/atriasoft/ege/Ege.java rename test/src/test/atriasoft/{gameengine => ege}/.keep (100%) rename test/src/test/atriasoft/{gameengine => ege}/Log.java (100%) rename test/src/test/atriasoft/{gameengine => ege}/Log2.java (100%) rename test/src/test/atriasoft/{gameengine => ege}/TestBasicLog.java (100%) create mode 100644 test/src/test/atriasoft/ege/TestTransformation3D.java delete mode 100644 test/src/test/atriasoft/gameengine/TestTransformation3D.java diff --git a/.checkstyle b/.checkstyle index 34ed486..428926e 100644 --- a/.checkstyle +++ b/.checkstyle @@ -1,7 +1,7 @@ - + diff --git a/.classpath b/.classpath index d6db28f..5d41398 100644 --- a/.classpath +++ b/.classpath @@ -5,7 +5,7 @@ - + @@ -22,12 +22,7 @@ - - - - - - + @@ -37,7 +32,17 @@ - + + + + + + + + + + + diff --git a/ege.iml b/ege.iml new file mode 100644 index 0000000..275137a --- /dev/null +++ b/ege.iml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/DragonBlender.blend b/resources/res/DragonBlender.blend similarity index 100% rename from res/DragonBlender.blend rename to resources/res/DragonBlender.blend diff --git a/res/Tree1.obj b/resources/res/Tree1.obj similarity index 100% rename from res/Tree1.obj rename to resources/res/Tree1.obj diff --git a/res/blendMap.png b/resources/res/blendMap.png similarity index 100% rename from res/blendMap.png rename to resources/res/blendMap.png diff --git a/res/box.obj b/resources/res/box.obj similarity index 100% rename from res/box.obj rename to resources/res/box.obj diff --git a/res/box.png b/resources/res/box.png similarity index 100% rename from res/box.png rename to resources/res/box.png diff --git a/res/bunny.obj b/resources/res/bunny.obj similarity index 100% rename from res/bunny.obj rename to resources/res/bunny.obj diff --git a/res/cube-one.obj b/resources/res/cube-one.obj similarity index 100% rename from res/cube-one.obj rename to resources/res/cube-one.obj diff --git a/res/cube.blend b/resources/res/cube.blend similarity index 100% rename from res/cube.blend rename to resources/res/cube.blend diff --git a/res/cube.mtl b/resources/res/cube.mtl similarity index 100% rename from res/cube.mtl rename to resources/res/cube.mtl diff --git a/res/cube.obj b/resources/res/cube.obj similarity index 100% rename from res/cube.obj rename to resources/res/cube.obj diff --git a/res/dirt.png b/resources/res/dirt.png similarity index 100% rename from res/dirt.png rename to resources/res/dirt.png diff --git a/res/dragon.obj b/resources/res/dragon.obj similarity index 100% rename from res/dragon.obj rename to resources/res/dragon.obj diff --git a/res/drone.obj b/resources/res/drone.obj similarity index 100% rename from res/drone.obj rename to resources/res/drone.obj diff --git a/res/exampleOBJ.obj b/resources/res/exampleOBJ.obj similarity index 100% rename from res/exampleOBJ.obj rename to resources/res/exampleOBJ.obj diff --git a/res/fern.obj b/resources/res/fern.obj similarity index 100% rename from res/fern.obj rename to resources/res/fern.obj diff --git a/res/fern.png b/resources/res/fern.png similarity index 100% rename from res/fern.png rename to resources/res/fern.png diff --git a/res/fern_atlas.png b/resources/res/fern_atlas.png similarity index 100% rename from res/fern_atlas.png rename to resources/res/fern_atlas.png diff --git a/res/flower.png b/resources/res/flower.png similarity index 100% rename from res/flower.png rename to resources/res/flower.png diff --git a/res/grass.obj b/resources/res/grass.obj similarity index 100% rename from res/grass.obj rename to resources/res/grass.obj diff --git a/res/grass.png b/resources/res/grass.png similarity index 100% rename from res/grass.png rename to resources/res/grass.png diff --git a/res/grassFlowers.png b/resources/res/grassFlowers.png similarity index 100% rename from res/grassFlowers.png rename to resources/res/grassFlowers.png diff --git a/res/grassModel.obj b/resources/res/grassModel.obj similarity index 100% rename from res/grassModel.obj rename to resources/res/grassModel.obj diff --git a/res/grassTexture.png b/resources/res/grassTexture.png similarity index 100% rename from res/grassTexture.png rename to resources/res/grassTexture.png diff --git a/res/grassy.png b/resources/res/grassy.png similarity index 100% rename from res/grassy.png rename to resources/res/grassy.png diff --git a/res/health.png b/resources/res/health.png similarity index 100% rename from res/health.png rename to resources/res/health.png diff --git a/res/heightmap.png b/resources/res/heightmap.png similarity index 100% rename from res/heightmap.png rename to resources/res/heightmap.png diff --git a/res/image.png b/resources/res/image.png similarity index 100% rename from res/image.png rename to resources/res/image.png diff --git a/res/lamp.mtl b/resources/res/lamp.mtl similarity index 100% rename from res/lamp.mtl rename to resources/res/lamp.mtl diff --git a/res/lamp.obj b/resources/res/lamp.obj similarity index 100% rename from res/lamp.obj rename to resources/res/lamp.obj diff --git a/res/lamp.png b/resources/res/lamp.png similarity index 100% rename from res/lamp.png rename to resources/res/lamp.png diff --git a/res/lowPolyTree.obj b/resources/res/lowPolyTree.obj similarity index 100% rename from res/lowPolyTree.obj rename to resources/res/lowPolyTree.obj diff --git a/res/lowPolyTree.png b/resources/res/lowPolyTree.png similarity index 100% rename from res/lowPolyTree.png rename to resources/res/lowPolyTree.png diff --git a/res/mud.png b/resources/res/mud.png similarity index 100% rename from res/mud.png rename to resources/res/mud.png diff --git a/res/path.png b/resources/res/path.png similarity index 100% rename from res/path.png rename to resources/res/path.png diff --git a/res/person.blend b/resources/res/person.blend similarity index 100% rename from res/person.blend rename to resources/res/person.blend diff --git a/res/person.blend1 b/resources/res/person.blend1 similarity index 100% rename from res/person.blend1 rename to resources/res/person.blend1 diff --git a/res/person.obj b/resources/res/person.obj similarity index 100% rename from res/person.obj rename to resources/res/person.obj diff --git a/res/person_-xfw_zup.mtl b/resources/res/person_-xfw_zup.mtl similarity index 100% rename from res/person_-xfw_zup.mtl rename to resources/res/person_-xfw_zup.mtl diff --git a/res/person_-xfw_zup.obj b/resources/res/person_-xfw_zup.obj similarity index 100% rename from res/person_-xfw_zup.obj rename to resources/res/person_-xfw_zup.obj diff --git a/res/person_-yfw_zup.mtl b/resources/res/person_-yfw_zup.mtl similarity index 100% rename from res/person_-yfw_zup.mtl rename to resources/res/person_-yfw_zup.mtl diff --git a/res/person_-yfw_zup.obj b/resources/res/person_-yfw_zup.obj similarity index 100% rename from res/person_-yfw_zup.obj rename to resources/res/person_-yfw_zup.obj diff --git a/res/pine.obj b/resources/res/pine.obj similarity index 100% rename from res/pine.obj rename to resources/res/pine.obj diff --git a/res/pine.png b/resources/res/pine.png similarity index 100% rename from res/pine.png rename to resources/res/pine.png diff --git a/res/playerTexture.png b/resources/res/playerTexture.png similarity index 100% rename from res/playerTexture.png rename to resources/res/playerTexture.png diff --git a/res/skybox/back.png b/resources/res/skybox/back.png similarity index 100% rename from res/skybox/back.png rename to resources/res/skybox/back.png diff --git a/res/skybox/bottom.png b/resources/res/skybox/bottom.png similarity index 100% rename from res/skybox/bottom.png rename to resources/res/skybox/bottom.png diff --git a/res/skybox/front.png b/resources/res/skybox/front.png similarity index 100% rename from res/skybox/front.png rename to resources/res/skybox/front.png diff --git a/res/skybox/left.png b/resources/res/skybox/left.png similarity index 100% rename from res/skybox/left.png rename to resources/res/skybox/left.png diff --git a/res/skybox/right.png b/resources/res/skybox/right.png similarity index 100% rename from res/skybox/right.png rename to resources/res/skybox/right.png diff --git a/res/skybox/top.png b/resources/res/skybox/top.png similarity index 100% rename from res/skybox/top.png rename to resources/res/skybox/top.png diff --git a/res/skybox2/back.png b/resources/res/skybox2/back.png similarity index 100% rename from res/skybox2/back.png rename to resources/res/skybox2/back.png diff --git a/res/skybox2/bottom.png b/resources/res/skybox2/bottom.png similarity index 100% rename from res/skybox2/bottom.png rename to resources/res/skybox2/bottom.png diff --git a/res/skybox2/front.png b/resources/res/skybox2/front.png similarity index 100% rename from res/skybox2/front.png rename to resources/res/skybox2/front.png diff --git a/res/skybox2/left.png b/resources/res/skybox2/left.png similarity index 100% rename from res/skybox2/left.png rename to resources/res/skybox2/left.png diff --git a/res/skybox2/right.png b/resources/res/skybox2/right.png similarity index 100% rename from res/skybox2/right.png rename to resources/res/skybox2/right.png diff --git a/res/skybox2/top.png b/resources/res/skybox2/top.png similarity index 100% rename from res/skybox2/top.png rename to resources/res/skybox2/top.png diff --git a/res/socuwan.png b/resources/res/socuwan.png similarity index 100% rename from res/socuwan.png rename to resources/res/socuwan.png diff --git a/res/stall.blend b/resources/res/stall.blend similarity index 100% rename from res/stall.blend rename to resources/res/stall.blend diff --git a/res/stall.obj b/resources/res/stall.obj similarity index 100% rename from res/stall.obj rename to resources/res/stall.obj diff --git a/res/stallTexture.png b/resources/res/stallTexture.png similarity index 100% rename from res/stallTexture.png rename to resources/res/stallTexture.png diff --git a/res/tree.obj b/resources/res/tree.obj similarity index 100% rename from res/tree.obj rename to resources/res/tree.obj diff --git a/res/tree.png b/resources/res/tree.png similarity index 100% rename from res/tree.png rename to resources/res/tree.png diff --git a/res/tree_sample.png b/resources/res/tree_sample.png similarity index 100% rename from res/tree_sample.png rename to resources/res/tree_sample.png diff --git a/res/white.png b/resources/res/white.png similarity index 100% rename from res/white.png rename to resources/res/white.png diff --git a/src/org/atriasoft/ege/data/simple3D.frag b/resources/resources/ege/data/simple3D.frag similarity index 100% rename from src/org/atriasoft/ege/data/simple3D.frag rename to resources/resources/ege/data/simple3D.frag diff --git a/src/org/atriasoft/ege/data/simple3D.vert b/resources/resources/ege/data/simple3D.vert similarity index 100% rename from src/org/atriasoft/ege/data/simple3D.vert rename to resources/resources/ege/data/simple3D.vert diff --git a/src/org/atriasoft/ege/data/wireColor.frag b/resources/resources/ege/data/wireColor.frag similarity index 100% rename from src/org/atriasoft/ege/data/wireColor.frag rename to resources/resources/ege/data/wireColor.frag diff --git a/src/org/atriasoft/ege/data/wireColor.vert b/resources/resources/ege/data/wireColor.vert similarity index 100% rename from src/org/atriasoft/ege/data/wireColor.vert rename to resources/resources/ege/data/wireColor.vert diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/basic.frag b/resources/testDataLoxelEngine/data/basic.frag similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/basic.frag rename to resources/testDataLoxelEngine/data/basic.frag diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/basic.vert b/resources/testDataLoxelEngine/data/basic.vert similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/basic.vert rename to resources/testDataLoxelEngine/data/basic.vert diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/basicMaterial.frag b/resources/testDataLoxelEngine/data/basicMaterial.frag similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/basicMaterial.frag rename to resources/testDataLoxelEngine/data/basicMaterial.frag diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/basicMaterial.vert b/resources/testDataLoxelEngine/data/basicMaterial.vert similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/basicMaterial.vert rename to resources/testDataLoxelEngine/data/basicMaterial.vert diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/.DS_Store b/resources/testDataLoxelEngine/data/blocks/.DS_Store similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/.DS_Store rename to resources/testDataLoxelEngine/data/blocks/.DS_Store diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_base.png b/resources/testDataLoxelEngine/data/blocks/anvil_base.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_base.png rename to resources/testDataLoxelEngine/data/blocks/anvil_base.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_top_damaged_0.png b/resources/testDataLoxelEngine/data/blocks/anvil_top_damaged_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_top_damaged_0.png rename to resources/testDataLoxelEngine/data/blocks/anvil_top_damaged_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_top_damaged_1.png b/resources/testDataLoxelEngine/data/blocks/anvil_top_damaged_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_top_damaged_1.png rename to resources/testDataLoxelEngine/data/blocks/anvil_top_damaged_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_top_damaged_2.png b/resources/testDataLoxelEngine/data/blocks/anvil_top_damaged_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/anvil_top_damaged_2.png rename to resources/testDataLoxelEngine/data/blocks/anvil_top_damaged_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/beacon.png b/resources/testDataLoxelEngine/data/blocks/beacon.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/beacon.png rename to resources/testDataLoxelEngine/data/blocks/beacon.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/beacon.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/beacon.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/beacon.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/beacon.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_feet_end.png b/resources/testDataLoxelEngine/data/blocks/bed_feet_end.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_feet_end.png rename to resources/testDataLoxelEngine/data/blocks/bed_feet_end.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_feet_side.png b/resources/testDataLoxelEngine/data/blocks/bed_feet_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_feet_side.png rename to resources/testDataLoxelEngine/data/blocks/bed_feet_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_feet_top.png b/resources/testDataLoxelEngine/data/blocks/bed_feet_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_feet_top.png rename to resources/testDataLoxelEngine/data/blocks/bed_feet_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_head_end.png b/resources/testDataLoxelEngine/data/blocks/bed_head_end.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_head_end.png rename to resources/testDataLoxelEngine/data/blocks/bed_head_end.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_head_side.png b/resources/testDataLoxelEngine/data/blocks/bed_head_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_head_side.png rename to resources/testDataLoxelEngine/data/blocks/bed_head_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_head_top.png b/resources/testDataLoxelEngine/data/blocks/bed_head_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bed_head_top.png rename to resources/testDataLoxelEngine/data/blocks/bed_head_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bedrock.png b/resources/testDataLoxelEngine/data/blocks/bedrock.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bedrock.png rename to resources/testDataLoxelEngine/data/blocks/bedrock.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bookshelf.png b/resources/testDataLoxelEngine/data/blocks/bookshelf.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/bookshelf.png rename to resources/testDataLoxelEngine/data/blocks/bookshelf.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/brewing_stand.png b/resources/testDataLoxelEngine/data/blocks/brewing_stand.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/brewing_stand.png rename to resources/testDataLoxelEngine/data/blocks/brewing_stand.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/brewing_stand_base.png b/resources/testDataLoxelEngine/data/blocks/brewing_stand_base.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/brewing_stand_base.png rename to resources/testDataLoxelEngine/data/blocks/brewing_stand_base.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/brick.png b/resources/testDataLoxelEngine/data/blocks/brick.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/brick.png rename to resources/testDataLoxelEngine/data/blocks/brick.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cactus_bottom.png b/resources/testDataLoxelEngine/data/blocks/cactus_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cactus_bottom.png rename to resources/testDataLoxelEngine/data/blocks/cactus_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cactus_side.png b/resources/testDataLoxelEngine/data/blocks/cactus_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cactus_side.png rename to resources/testDataLoxelEngine/data/blocks/cactus_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cactus_top.png b/resources/testDataLoxelEngine/data/blocks/cactus_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cactus_top.png rename to resources/testDataLoxelEngine/data/blocks/cactus_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_bottom.png b/resources/testDataLoxelEngine/data/blocks/cake_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_bottom.png rename to resources/testDataLoxelEngine/data/blocks/cake_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_inner.png b/resources/testDataLoxelEngine/data/blocks/cake_inner.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_inner.png rename to resources/testDataLoxelEngine/data/blocks/cake_inner.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_side.png b/resources/testDataLoxelEngine/data/blocks/cake_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_side.png rename to resources/testDataLoxelEngine/data/blocks/cake_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_top.png b/resources/testDataLoxelEngine/data/blocks/cake_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cake_top.png rename to resources/testDataLoxelEngine/data/blocks/cake_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_0.png b/resources/testDataLoxelEngine/data/blocks/carrots_stage_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_0.png rename to resources/testDataLoxelEngine/data/blocks/carrots_stage_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_1.png b/resources/testDataLoxelEngine/data/blocks/carrots_stage_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_1.png rename to resources/testDataLoxelEngine/data/blocks/carrots_stage_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_2.png b/resources/testDataLoxelEngine/data/blocks/carrots_stage_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_2.png rename to resources/testDataLoxelEngine/data/blocks/carrots_stage_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_3.png b/resources/testDataLoxelEngine/data/blocks/carrots_stage_3.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/carrots_stage_3.png rename to resources/testDataLoxelEngine/data/blocks/carrots_stage_3.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_bottom.png b/resources/testDataLoxelEngine/data/blocks/cauldron_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_bottom.png rename to resources/testDataLoxelEngine/data/blocks/cauldron_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_inner.png b/resources/testDataLoxelEngine/data/blocks/cauldron_inner.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_inner.png rename to resources/testDataLoxelEngine/data/blocks/cauldron_inner.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_side.png b/resources/testDataLoxelEngine/data/blocks/cauldron_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_side.png rename to resources/testDataLoxelEngine/data/blocks/cauldron_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_top.png b/resources/testDataLoxelEngine/data/blocks/cauldron_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cauldron_top.png rename to resources/testDataLoxelEngine/data/blocks/cauldron_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/chorus_flower.png b/resources/testDataLoxelEngine/data/blocks/chorus_flower.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/chorus_flower.png rename to resources/testDataLoxelEngine/data/blocks/chorus_flower.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/chorus_flower_dead.png b/resources/testDataLoxelEngine/data/blocks/chorus_flower_dead.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/chorus_flower_dead.png rename to resources/testDataLoxelEngine/data/blocks/chorus_flower_dead.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/chorus_plant.png b/resources/testDataLoxelEngine/data/blocks/chorus_plant.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/chorus_plant.png rename to resources/testDataLoxelEngine/data/blocks/chorus_plant.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/clay.png b/resources/testDataLoxelEngine/data/blocks/clay.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/clay.png rename to resources/testDataLoxelEngine/data/blocks/clay.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/coal_block.png b/resources/testDataLoxelEngine/data/blocks/coal_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/coal_block.png rename to resources/testDataLoxelEngine/data/blocks/coal_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/coal_ore.png b/resources/testDataLoxelEngine/data/blocks/coal_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/coal_ore.png rename to resources/testDataLoxelEngine/data/blocks/coal_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/coarse_dirt.png b/resources/testDataLoxelEngine/data/blocks/coarse_dirt.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/coarse_dirt.png rename to resources/testDataLoxelEngine/data/blocks/coarse_dirt.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cobblestone.png b/resources/testDataLoxelEngine/data/blocks/cobblestone.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cobblestone.png rename to resources/testDataLoxelEngine/data/blocks/cobblestone.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cobblestone_mossy.png b/resources/testDataLoxelEngine/data/blocks/cobblestone_mossy.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cobblestone_mossy.png rename to resources/testDataLoxelEngine/data/blocks/cobblestone_mossy.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cocoa_stage_0.png b/resources/testDataLoxelEngine/data/blocks/cocoa_stage_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cocoa_stage_0.png rename to resources/testDataLoxelEngine/data/blocks/cocoa_stage_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cocoa_stage_1.png b/resources/testDataLoxelEngine/data/blocks/cocoa_stage_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cocoa_stage_1.png rename to resources/testDataLoxelEngine/data/blocks/cocoa_stage_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cocoa_stage_2.png b/resources/testDataLoxelEngine/data/blocks/cocoa_stage_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/cocoa_stage_2.png rename to resources/testDataLoxelEngine/data/blocks/cocoa_stage_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/command_block.png b/resources/testDataLoxelEngine/data/blocks/command_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/command_block.png rename to resources/testDataLoxelEngine/data/blocks/command_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/command_block.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/command_block.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/command_block.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/command_block.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/comparator_off.png b/resources/testDataLoxelEngine/data/blocks/comparator_off.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/comparator_off.png rename to resources/testDataLoxelEngine/data/blocks/comparator_off.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/comparator_on.png b/resources/testDataLoxelEngine/data/blocks/comparator_on.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/comparator_on.png rename to resources/testDataLoxelEngine/data/blocks/comparator_on.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/crafting_table_front.png b/resources/testDataLoxelEngine/data/blocks/crafting_table_front.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/crafting_table_front.png rename to resources/testDataLoxelEngine/data/blocks/crafting_table_front.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/crafting_table_side.png b/resources/testDataLoxelEngine/data/blocks/crafting_table_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/crafting_table_side.png rename to resources/testDataLoxelEngine/data/blocks/crafting_table_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/crafting_table_top.png b/resources/testDataLoxelEngine/data/blocks/crafting_table_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/crafting_table_top.png rename to resources/testDataLoxelEngine/data/blocks/crafting_table_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/daylight_detector_inverted_top.png b/resources/testDataLoxelEngine/data/blocks/daylight_detector_inverted_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/daylight_detector_inverted_top.png rename to resources/testDataLoxelEngine/data/blocks/daylight_detector_inverted_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/daylight_detector_side.png b/resources/testDataLoxelEngine/data/blocks/daylight_detector_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/daylight_detector_side.png rename to resources/testDataLoxelEngine/data/blocks/daylight_detector_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/daylight_detector_top.png b/resources/testDataLoxelEngine/data/blocks/daylight_detector_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/daylight_detector_top.png rename to resources/testDataLoxelEngine/data/blocks/daylight_detector_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/deadbush.png b/resources/testDataLoxelEngine/data/blocks/deadbush.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/deadbush.png rename to resources/testDataLoxelEngine/data/blocks/deadbush.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_0.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_0.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_1.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_1.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_2.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_2.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_3.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_3.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_3.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_3.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_4.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_4.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_4.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_4.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_5.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_5.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_5.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_5.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_6.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_6.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_6.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_6.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_7.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_7.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_7.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_7.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_8.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_8.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_8.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_8.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_9.png b/resources/testDataLoxelEngine/data/blocks/destroy_stage_9.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/destroy_stage_9.png rename to resources/testDataLoxelEngine/data/blocks/destroy_stage_9.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/diamond.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/diamond.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_block.png b/resources/testDataLoxelEngine/data/blocks/diamond_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_block.png rename to resources/testDataLoxelEngine/data/blocks/diamond_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_block.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/diamond_block.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_block.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/diamond_block.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_ore.png b/resources/testDataLoxelEngine/data/blocks/diamond_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_ore.png rename to resources/testDataLoxelEngine/data/blocks/diamond_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_ore.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/diamond_ore.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/diamond_ore.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/diamond_ore.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dirt.png b/resources/testDataLoxelEngine/data/blocks/dirt.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dirt.png rename to resources/testDataLoxelEngine/data/blocks/dirt.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dirt_podzol_side.png b/resources/testDataLoxelEngine/data/blocks/dirt_podzol_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dirt_podzol_side.png rename to resources/testDataLoxelEngine/data/blocks/dirt_podzol_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dirt_podzol_top.png b/resources/testDataLoxelEngine/data/blocks/dirt_podzol_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dirt_podzol_top.png rename to resources/testDataLoxelEngine/data/blocks/dirt_podzol_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dispenser_front_horizontal.png b/resources/testDataLoxelEngine/data/blocks/dispenser_front_horizontal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dispenser_front_horizontal.png rename to resources/testDataLoxelEngine/data/blocks/dispenser_front_horizontal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dispenser_front_vertical.png b/resources/testDataLoxelEngine/data/blocks/dispenser_front_vertical.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dispenser_front_vertical.png rename to resources/testDataLoxelEngine/data/blocks/dispenser_front_vertical.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_acacia_lower.png b/resources/testDataLoxelEngine/data/blocks/door_acacia_lower.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_acacia_lower.png rename to resources/testDataLoxelEngine/data/blocks/door_acacia_lower.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_acacia_upper.png b/resources/testDataLoxelEngine/data/blocks/door_acacia_upper.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_acacia_upper.png rename to resources/testDataLoxelEngine/data/blocks/door_acacia_upper.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_dark_oak_lower.png b/resources/testDataLoxelEngine/data/blocks/door_dark_oak_lower.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_dark_oak_lower.png rename to resources/testDataLoxelEngine/data/blocks/door_dark_oak_lower.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_dark_oak_upper.png b/resources/testDataLoxelEngine/data/blocks/door_dark_oak_upper.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_dark_oak_upper.png rename to resources/testDataLoxelEngine/data/blocks/door_dark_oak_upper.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_iron_lower.png b/resources/testDataLoxelEngine/data/blocks/door_iron_lower.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_iron_lower.png rename to resources/testDataLoxelEngine/data/blocks/door_iron_lower.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_iron_upper.png b/resources/testDataLoxelEngine/data/blocks/door_iron_upper.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_iron_upper.png rename to resources/testDataLoxelEngine/data/blocks/door_iron_upper.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_wood_lower.png b/resources/testDataLoxelEngine/data/blocks/door_wood_lower.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_wood_lower.png rename to resources/testDataLoxelEngine/data/blocks/door_wood_lower.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_wood_upper.png b/resources/testDataLoxelEngine/data/blocks/door_wood_upper.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/door_wood_upper.png rename to resources/testDataLoxelEngine/data/blocks/door_wood_upper.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_fern_bottom.png b/resources/testDataLoxelEngine/data/blocks/double_plant_fern_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_fern_bottom.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_fern_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_fern_top.png b/resources/testDataLoxelEngine/data/blocks/double_plant_fern_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_fern_top.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_fern_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_paeonia_bottom.png b/resources/testDataLoxelEngine/data/blocks/double_plant_paeonia_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_paeonia_bottom.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_paeonia_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_paeonia_top.png b/resources/testDataLoxelEngine/data/blocks/double_plant_paeonia_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_paeonia_top.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_paeonia_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_rose_bottom.png b/resources/testDataLoxelEngine/data/blocks/double_plant_rose_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_rose_bottom.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_rose_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_rose_top.png b/resources/testDataLoxelEngine/data/blocks/double_plant_rose_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_rose_top.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_rose_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_syringa_bottom.png b/resources/testDataLoxelEngine/data/blocks/double_plant_syringa_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_syringa_bottom.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_syringa_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_syringa_top.png b/resources/testDataLoxelEngine/data/blocks/double_plant_syringa_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/double_plant_syringa_top.png rename to resources/testDataLoxelEngine/data/blocks/double_plant_syringa_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dragon_egg.png b/resources/testDataLoxelEngine/data/blocks/dragon_egg.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dragon_egg.png rename to resources/testDataLoxelEngine/data/blocks/dragon_egg.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dragon_egg.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/dragon_egg.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dragon_egg.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/dragon_egg.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dropper_front_horizontal.png b/resources/testDataLoxelEngine/data/blocks/dropper_front_horizontal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dropper_front_horizontal.png rename to resources/testDataLoxelEngine/data/blocks/dropper_front_horizontal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dropper_front_vertical.png b/resources/testDataLoxelEngine/data/blocks/dropper_front_vertical.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/dropper_front_vertical.png rename to resources/testDataLoxelEngine/data/blocks/dropper_front_vertical.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_block.png b/resources/testDataLoxelEngine/data/blocks/emerald_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_block.png rename to resources/testDataLoxelEngine/data/blocks/emerald_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_block.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/emerald_block.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_block.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/emerald_block.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_ore.png b/resources/testDataLoxelEngine/data/blocks/emerald_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_ore.png rename to resources/testDataLoxelEngine/data/blocks/emerald_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_ore.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/emerald_ore.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/emerald_ore.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/emerald_ore.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/end_bricks.png b/resources/testDataLoxelEngine/data/blocks/end_bricks.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/end_bricks.png rename to resources/testDataLoxelEngine/data/blocks/end_bricks.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/end_rod.png b/resources/testDataLoxelEngine/data/blocks/end_rod.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/end_rod.png rename to resources/testDataLoxelEngine/data/blocks/end_rod.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/end_stone.png b/resources/testDataLoxelEngine/data/blocks/end_stone.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/end_stone.png rename to resources/testDataLoxelEngine/data/blocks/end_stone.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_eye.png b/resources/testDataLoxelEngine/data/blocks/endframe_eye.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_eye.png rename to resources/testDataLoxelEngine/data/blocks/endframe_eye.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_eye.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/endframe_eye.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_eye.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/endframe_eye.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_side.png b/resources/testDataLoxelEngine/data/blocks/endframe_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_side.png rename to resources/testDataLoxelEngine/data/blocks/endframe_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_side.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/endframe_side.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_side.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/endframe_side.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_top.png b/resources/testDataLoxelEngine/data/blocks/endframe_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_top.png rename to resources/testDataLoxelEngine/data/blocks/endframe_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_top.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/endframe_top.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/endframe_top.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/endframe_top.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/farmland_dry.png b/resources/testDataLoxelEngine/data/blocks/farmland_dry.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/farmland_dry.png rename to resources/testDataLoxelEngine/data/blocks/farmland_dry.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/farmland_wet.png b/resources/testDataLoxelEngine/data/blocks/farmland_wet.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/farmland_wet.png rename to resources/testDataLoxelEngine/data/blocks/farmland_wet.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fern.png b/resources/testDataLoxelEngine/data/blocks/fern.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fern.png rename to resources/testDataLoxelEngine/data/blocks/fern.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_0.png b/resources/testDataLoxelEngine/data/blocks/fire_layer_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_0.png rename to resources/testDataLoxelEngine/data/blocks/fire_layer_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_0.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/fire_layer_0.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_0.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/fire_layer_0.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_1.png b/resources/testDataLoxelEngine/data/blocks/fire_layer_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_1.png rename to resources/testDataLoxelEngine/data/blocks/fire_layer_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_1.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/fire_layer_1.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/fire_layer_1.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/fire_layer_1.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/flower_dandelion.png b/resources/testDataLoxelEngine/data/blocks/flower_dandelion.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/flower_dandelion.png rename to resources/testDataLoxelEngine/data/blocks/flower_dandelion.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/flower_rose.png b/resources/testDataLoxelEngine/data/blocks/flower_rose.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/flower_rose.png rename to resources/testDataLoxelEngine/data/blocks/flower_rose.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_front_off.png b/resources/testDataLoxelEngine/data/blocks/furnace_front_off.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_front_off.png rename to resources/testDataLoxelEngine/data/blocks/furnace_front_off.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_front_on.png b/resources/testDataLoxelEngine/data/blocks/furnace_front_on.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_front_on.png rename to resources/testDataLoxelEngine/data/blocks/furnace_front_on.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_front_on.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/furnace_front_on.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_front_on.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/furnace_front_on.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_side.png b/resources/testDataLoxelEngine/data/blocks/furnace_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_side.png rename to resources/testDataLoxelEngine/data/blocks/furnace_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_top.png b/resources/testDataLoxelEngine/data/blocks/furnace_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_top.png rename to resources/testDataLoxelEngine/data/blocks/furnace_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_top.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/furnace_top.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/furnace_top.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/furnace_top.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass.png b/resources/testDataLoxelEngine/data/blocks/glass.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass.png rename to resources/testDataLoxelEngine/data/blocks/glass.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_black.png b/resources/testDataLoxelEngine/data/blocks/glass_black.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_black.png rename to resources/testDataLoxelEngine/data/blocks/glass_black.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_blue.png b/resources/testDataLoxelEngine/data/blocks/glass_blue.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_blue.png rename to resources/testDataLoxelEngine/data/blocks/glass_blue.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_brown.png b/resources/testDataLoxelEngine/data/blocks/glass_brown.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_brown.png rename to resources/testDataLoxelEngine/data/blocks/glass_brown.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_cyan.png b/resources/testDataLoxelEngine/data/blocks/glass_cyan.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_cyan.png rename to resources/testDataLoxelEngine/data/blocks/glass_cyan.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_gray.png b/resources/testDataLoxelEngine/data/blocks/glass_gray.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_gray.png rename to resources/testDataLoxelEngine/data/blocks/glass_gray.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_green.png b/resources/testDataLoxelEngine/data/blocks/glass_green.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_green.png rename to resources/testDataLoxelEngine/data/blocks/glass_green.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_light_blue.png b/resources/testDataLoxelEngine/data/blocks/glass_light_blue.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_light_blue.png rename to resources/testDataLoxelEngine/data/blocks/glass_light_blue.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_lime.png b/resources/testDataLoxelEngine/data/blocks/glass_lime.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_lime.png rename to resources/testDataLoxelEngine/data/blocks/glass_lime.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_magenta.png b/resources/testDataLoxelEngine/data/blocks/glass_magenta.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_magenta.png rename to resources/testDataLoxelEngine/data/blocks/glass_magenta.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_orange.png b/resources/testDataLoxelEngine/data/blocks/glass_orange.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_orange.png rename to resources/testDataLoxelEngine/data/blocks/glass_orange.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_pane_top.png b/resources/testDataLoxelEngine/data/blocks/glass_pane_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_pane_top.png rename to resources/testDataLoxelEngine/data/blocks/glass_pane_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_pink.png b/resources/testDataLoxelEngine/data/blocks/glass_pink.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_pink.png rename to resources/testDataLoxelEngine/data/blocks/glass_pink.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_purple.png b/resources/testDataLoxelEngine/data/blocks/glass_purple.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_purple.png rename to resources/testDataLoxelEngine/data/blocks/glass_purple.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_red.png b/resources/testDataLoxelEngine/data/blocks/glass_red.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_red.png rename to resources/testDataLoxelEngine/data/blocks/glass_red.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_silver.png b/resources/testDataLoxelEngine/data/blocks/glass_silver.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_silver.png rename to resources/testDataLoxelEngine/data/blocks/glass_silver.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_white.png b/resources/testDataLoxelEngine/data/blocks/glass_white.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_white.png rename to resources/testDataLoxelEngine/data/blocks/glass_white.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_yellow.png b/resources/testDataLoxelEngine/data/blocks/glass_yellow.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glass_yellow.png rename to resources/testDataLoxelEngine/data/blocks/glass_yellow.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glowstone.png b/resources/testDataLoxelEngine/data/blocks/glowstone.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glowstone.png rename to resources/testDataLoxelEngine/data/blocks/glowstone.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glowstone.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/glowstone.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/glowstone.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/glowstone.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_block.png b/resources/testDataLoxelEngine/data/blocks/gold_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_block.png rename to resources/testDataLoxelEngine/data/blocks/gold_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_ore.png b/resources/testDataLoxelEngine/data/blocks/gold_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_ore.png rename to resources/testDataLoxelEngine/data/blocks/gold_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_ore.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/gold_ore.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_ore.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/gold_ore.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_top.png b/resources/testDataLoxelEngine/data/blocks/gold_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gold_top.png rename to resources/testDataLoxelEngine/data/blocks/gold_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_path_side.png b/resources/testDataLoxelEngine/data/blocks/grass_path_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_path_side.png rename to resources/testDataLoxelEngine/data/blocks/grass_path_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_path_top.png b/resources/testDataLoxelEngine/data/blocks/grass_path_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_path_top.png rename to resources/testDataLoxelEngine/data/blocks/grass_path_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_block.png b/resources/testDataLoxelEngine/data/blocks/grass_side_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_block.png rename to resources/testDataLoxelEngine/data/blocks/grass_side_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_overlay.png b/resources/testDataLoxelEngine/data/blocks/grass_side_overlay.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_overlay.png rename to resources/testDataLoxelEngine/data/blocks/grass_side_overlay.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_overlay2.png b/resources/testDataLoxelEngine/data/blocks/grass_side_overlay2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_overlay2.png rename to resources/testDataLoxelEngine/data/blocks/grass_side_overlay2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_snowed.png b/resources/testDataLoxelEngine/data/blocks/grass_side_snowed.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_side_snowed.png rename to resources/testDataLoxelEngine/data/blocks/grass_side_snowed.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_top.png b/resources/testDataLoxelEngine/data/blocks/grass_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/grass_top.png rename to resources/testDataLoxelEngine/data/blocks/grass_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gravel.png b/resources/testDataLoxelEngine/data/blocks/gravel.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/gravel.png rename to resources/testDataLoxelEngine/data/blocks/gravel.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_black.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_black.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_black.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_black.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_blue.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_blue.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_blue.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_blue.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_brown.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_brown.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_brown.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_brown.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_cyan.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_cyan.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_cyan.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_cyan.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_gray.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_gray.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_gray.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_gray.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_green.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_green.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_green.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_green.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_light_blue.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_light_blue.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_light_blue.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_light_blue.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_lime.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_lime.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_lime.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_lime.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_magenta.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_magenta.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_magenta.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_magenta.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_orange.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_orange.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_orange.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_orange.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_pink.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_pink.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_pink.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_pink.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_purple.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_purple.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_purple.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_purple.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_red.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_red.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_red.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_red.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_silver.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_silver.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_silver.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_silver.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_white.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_white.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_white.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_white.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_yellow.png b/resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_yellow.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hardened_clay_stained_yellow.png rename to resources/testDataLoxelEngine/data/blocks/hardened_clay_stained_yellow.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hay_block_side.png b/resources/testDataLoxelEngine/data/blocks/hay_block_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hay_block_side.png rename to resources/testDataLoxelEngine/data/blocks/hay_block_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hay_block_top.png b/resources/testDataLoxelEngine/data/blocks/hay_block_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hay_block_top.png rename to resources/testDataLoxelEngine/data/blocks/hay_block_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hopper_inside.png b/resources/testDataLoxelEngine/data/blocks/hopper_inside.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hopper_inside.png rename to resources/testDataLoxelEngine/data/blocks/hopper_inside.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hopper_outside.png b/resources/testDataLoxelEngine/data/blocks/hopper_outside.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hopper_outside.png rename to resources/testDataLoxelEngine/data/blocks/hopper_outside.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hopper_top.png b/resources/testDataLoxelEngine/data/blocks/hopper_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/hopper_top.png rename to resources/testDataLoxelEngine/data/blocks/hopper_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/ice.png b/resources/testDataLoxelEngine/data/blocks/ice.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/ice.png rename to resources/testDataLoxelEngine/data/blocks/ice.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/ice_packed.png b/resources/testDataLoxelEngine/data/blocks/ice_packed.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/ice_packed.png rename to resources/testDataLoxelEngine/data/blocks/ice_packed.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/ice_packed.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/ice_packed.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/ice_packed.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/ice_packed.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_bars.png b/resources/testDataLoxelEngine/data/blocks/iron_bars.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_bars.png rename to resources/testDataLoxelEngine/data/blocks/iron_bars.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_bars_top.png b/resources/testDataLoxelEngine/data/blocks/iron_bars_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_bars_top.png rename to resources/testDataLoxelEngine/data/blocks/iron_bars_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_block.png b/resources/testDataLoxelEngine/data/blocks/iron_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_block.png rename to resources/testDataLoxelEngine/data/blocks/iron_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_ore.png b/resources/testDataLoxelEngine/data/blocks/iron_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_ore.png rename to resources/testDataLoxelEngine/data/blocks/iron_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_top.png b/resources/testDataLoxelEngine/data/blocks/iron_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_top.png rename to resources/testDataLoxelEngine/data/blocks/iron_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_trapdoor.png b/resources/testDataLoxelEngine/data/blocks/iron_trapdoor.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/iron_trapdoor.png rename to resources/testDataLoxelEngine/data/blocks/iron_trapdoor.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/itemframe_background.png b/resources/testDataLoxelEngine/data/blocks/itemframe_background.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/itemframe_background.png rename to resources/testDataLoxelEngine/data/blocks/itemframe_background.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/jukebox_side.png b/resources/testDataLoxelEngine/data/blocks/jukebox_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/jukebox_side.png rename to resources/testDataLoxelEngine/data/blocks/jukebox_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/jukebox_side.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/jukebox_side.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/jukebox_side.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/jukebox_side.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/jukebox_top.png b/resources/testDataLoxelEngine/data/blocks/jukebox_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/jukebox_top.png rename to resources/testDataLoxelEngine/data/blocks/jukebox_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lapis_block.png b/resources/testDataLoxelEngine/data/blocks/lapis_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lapis_block.png rename to resources/testDataLoxelEngine/data/blocks/lapis_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lapis_ore.png b/resources/testDataLoxelEngine/data/blocks/lapis_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lapis_ore.png rename to resources/testDataLoxelEngine/data/blocks/lapis_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_flow.png b/resources/testDataLoxelEngine/data/blocks/lava_flow.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_flow.png rename to resources/testDataLoxelEngine/data/blocks/lava_flow.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_flow.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/lava_flow.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_flow.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/lava_flow.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_flow.png.mcmeta copy b/resources/testDataLoxelEngine/data/blocks/lava_flow.png.mcmeta copy similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_flow.png.mcmeta copy rename to resources/testDataLoxelEngine/data/blocks/lava_flow.png.mcmeta copy diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_still.png b/resources/testDataLoxelEngine/data/blocks/lava_still.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_still.png rename to resources/testDataLoxelEngine/data/blocks/lava_still.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_still.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/lava_still.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_still.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/lava_still.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_still.png.mcmeta copy b/resources/testDataLoxelEngine/data/blocks/lava_still.png.mcmeta copy similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lava_still.png.mcmeta copy rename to resources/testDataLoxelEngine/data/blocks/lava_still.png.mcmeta copy diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_acacia.png b/resources/testDataLoxelEngine/data/blocks/leaves_acacia.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_acacia.png rename to resources/testDataLoxelEngine/data/blocks/leaves_acacia.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_big_oak.png b/resources/testDataLoxelEngine/data/blocks/leaves_big_oak.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_big_oak.png rename to resources/testDataLoxelEngine/data/blocks/leaves_big_oak.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_birch.png b/resources/testDataLoxelEngine/data/blocks/leaves_birch.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_birch.png rename to resources/testDataLoxelEngine/data/blocks/leaves_birch.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_jungle.png b/resources/testDataLoxelEngine/data/blocks/leaves_jungle.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_jungle.png rename to resources/testDataLoxelEngine/data/blocks/leaves_jungle.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_oak.png b/resources/testDataLoxelEngine/data/blocks/leaves_oak.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_oak.png rename to resources/testDataLoxelEngine/data/blocks/leaves_oak.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_spruce.png b/resources/testDataLoxelEngine/data/blocks/leaves_spruce.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/leaves_spruce.png rename to resources/testDataLoxelEngine/data/blocks/leaves_spruce.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lever.png b/resources/testDataLoxelEngine/data/blocks/lever.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/lever.png rename to resources/testDataLoxelEngine/data/blocks/lever.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_acacia.png b/resources/testDataLoxelEngine/data/blocks/log_acacia.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_acacia.png rename to resources/testDataLoxelEngine/data/blocks/log_acacia.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_acacia_top.png b/resources/testDataLoxelEngine/data/blocks/log_acacia_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_acacia_top.png rename to resources/testDataLoxelEngine/data/blocks/log_acacia_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_big_oak.png b/resources/testDataLoxelEngine/data/blocks/log_big_oak.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_big_oak.png rename to resources/testDataLoxelEngine/data/blocks/log_big_oak.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_big_oak_top.png b/resources/testDataLoxelEngine/data/blocks/log_big_oak_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_big_oak_top.png rename to resources/testDataLoxelEngine/data/blocks/log_big_oak_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_birch.png b/resources/testDataLoxelEngine/data/blocks/log_birch.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_birch.png rename to resources/testDataLoxelEngine/data/blocks/log_birch.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_birch_top.png b/resources/testDataLoxelEngine/data/blocks/log_birch_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_birch_top.png rename to resources/testDataLoxelEngine/data/blocks/log_birch_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_jungle.png b/resources/testDataLoxelEngine/data/blocks/log_jungle.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_jungle.png rename to resources/testDataLoxelEngine/data/blocks/log_jungle.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_jungle_top.png b/resources/testDataLoxelEngine/data/blocks/log_jungle_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_jungle_top.png rename to resources/testDataLoxelEngine/data/blocks/log_jungle_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_oak.png b/resources/testDataLoxelEngine/data/blocks/log_oak.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_oak.png rename to resources/testDataLoxelEngine/data/blocks/log_oak.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_oak_top.png b/resources/testDataLoxelEngine/data/blocks/log_oak_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_oak_top.png rename to resources/testDataLoxelEngine/data/blocks/log_oak_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_spruce.png b/resources/testDataLoxelEngine/data/blocks/log_spruce.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_spruce.png rename to resources/testDataLoxelEngine/data/blocks/log_spruce.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_spruce_top.png b/resources/testDataLoxelEngine/data/blocks/log_spruce_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/log_spruce_top.png rename to resources/testDataLoxelEngine/data/blocks/log_spruce_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_side.png b/resources/testDataLoxelEngine/data/blocks/melon_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_side.png rename to resources/testDataLoxelEngine/data/blocks/melon_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_stem_connected.png b/resources/testDataLoxelEngine/data/blocks/melon_stem_connected.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_stem_connected.png rename to resources/testDataLoxelEngine/data/blocks/melon_stem_connected.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_stem_disconnected.png b/resources/testDataLoxelEngine/data/blocks/melon_stem_disconnected.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_stem_disconnected.png rename to resources/testDataLoxelEngine/data/blocks/melon_stem_disconnected.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_top.png b/resources/testDataLoxelEngine/data/blocks/melon_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/melon_top.png rename to resources/testDataLoxelEngine/data/blocks/melon_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mob_spawner.png b/resources/testDataLoxelEngine/data/blocks/mob_spawner.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mob_spawner.png rename to resources/testDataLoxelEngine/data/blocks/mob_spawner.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_inside.png b/resources/testDataLoxelEngine/data/blocks/mushroom_block_inside.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_inside.png rename to resources/testDataLoxelEngine/data/blocks/mushroom_block_inside.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_skin_brown.png b/resources/testDataLoxelEngine/data/blocks/mushroom_block_skin_brown.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_skin_brown.png rename to resources/testDataLoxelEngine/data/blocks/mushroom_block_skin_brown.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_skin_red.png b/resources/testDataLoxelEngine/data/blocks/mushroom_block_skin_red.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_skin_red.png rename to resources/testDataLoxelEngine/data/blocks/mushroom_block_skin_red.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_skin_stem.png b/resources/testDataLoxelEngine/data/blocks/mushroom_block_skin_stem.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_block_skin_stem.png rename to resources/testDataLoxelEngine/data/blocks/mushroom_block_skin_stem.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_brown.png b/resources/testDataLoxelEngine/data/blocks/mushroom_brown.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_brown.png rename to resources/testDataLoxelEngine/data/blocks/mushroom_brown.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_red.png b/resources/testDataLoxelEngine/data/blocks/mushroom_red.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mushroom_red.png rename to resources/testDataLoxelEngine/data/blocks/mushroom_red.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mycelium_side.png b/resources/testDataLoxelEngine/data/blocks/mycelium_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mycelium_side.png rename to resources/testDataLoxelEngine/data/blocks/mycelium_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mycelium_top.png b/resources/testDataLoxelEngine/data/blocks/mycelium_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/mycelium_top.png rename to resources/testDataLoxelEngine/data/blocks/mycelium_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_brick.png b/resources/testDataLoxelEngine/data/blocks/nether_brick.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_brick.png rename to resources/testDataLoxelEngine/data/blocks/nether_brick.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_portal.png b/resources/testDataLoxelEngine/data/blocks/nether_portal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_portal.png rename to resources/testDataLoxelEngine/data/blocks/nether_portal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_portal.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/nether_portal.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_portal.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/nether_portal.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_wart_stage_0.png b/resources/testDataLoxelEngine/data/blocks/nether_wart_stage_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_wart_stage_0.png rename to resources/testDataLoxelEngine/data/blocks/nether_wart_stage_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_wart_stage_1.png b/resources/testDataLoxelEngine/data/blocks/nether_wart_stage_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_wart_stage_1.png rename to resources/testDataLoxelEngine/data/blocks/nether_wart_stage_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_wart_stage_2.png b/resources/testDataLoxelEngine/data/blocks/nether_wart_stage_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/nether_wart_stage_2.png rename to resources/testDataLoxelEngine/data/blocks/nether_wart_stage_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/netherrack.png b/resources/testDataLoxelEngine/data/blocks/netherrack.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/netherrack.png rename to resources/testDataLoxelEngine/data/blocks/netherrack.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/noteblock.png b/resources/testDataLoxelEngine/data/blocks/noteblock.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/noteblock.png rename to resources/testDataLoxelEngine/data/blocks/noteblock.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/obsidian.png b/resources/testDataLoxelEngine/data/blocks/obsidian.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/obsidian.png rename to resources/testDataLoxelEngine/data/blocks/obsidian.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_bottom.png b/resources/testDataLoxelEngine/data/blocks/piston_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_bottom.png rename to resources/testDataLoxelEngine/data/blocks/piston_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_inner.png b/resources/testDataLoxelEngine/data/blocks/piston_inner.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_inner.png rename to resources/testDataLoxelEngine/data/blocks/piston_inner.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_side.png b/resources/testDataLoxelEngine/data/blocks/piston_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_side.png rename to resources/testDataLoxelEngine/data/blocks/piston_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_top_normal.png b/resources/testDataLoxelEngine/data/blocks/piston_top_normal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_top_normal.png rename to resources/testDataLoxelEngine/data/blocks/piston_top_normal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_top_sticky.png b/resources/testDataLoxelEngine/data/blocks/piston_top_sticky.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/piston_top_sticky.png rename to resources/testDataLoxelEngine/data/blocks/piston_top_sticky.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_acacia.png b/resources/testDataLoxelEngine/data/blocks/planks_acacia.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_acacia.png rename to resources/testDataLoxelEngine/data/blocks/planks_acacia.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_big_oak.png b/resources/testDataLoxelEngine/data/blocks/planks_big_oak.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_big_oak.png rename to resources/testDataLoxelEngine/data/blocks/planks_big_oak.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_birch.png b/resources/testDataLoxelEngine/data/blocks/planks_birch.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_birch.png rename to resources/testDataLoxelEngine/data/blocks/planks_birch.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_jungle.png b/resources/testDataLoxelEngine/data/blocks/planks_jungle.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_jungle.png rename to resources/testDataLoxelEngine/data/blocks/planks_jungle.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_oak.png b/resources/testDataLoxelEngine/data/blocks/planks_oak.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_oak.png rename to resources/testDataLoxelEngine/data/blocks/planks_oak.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_spruce.png b/resources/testDataLoxelEngine/data/blocks/planks_spruce.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/planks_spruce.png rename to resources/testDataLoxelEngine/data/blocks/planks_spruce.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal.png b/resources/testDataLoxelEngine/data/blocks/portal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal.png rename to resources/testDataLoxelEngine/data/blocks/portal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/portal.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/portal.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal.png.mcmeta copy b/resources/testDataLoxelEngine/data/blocks/portal.png.mcmeta copy similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal.png.mcmeta copy rename to resources/testDataLoxelEngine/data/blocks/portal.png.mcmeta copy diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal_effect.png b/resources/testDataLoxelEngine/data/blocks/portal_effect.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal_effect.png rename to resources/testDataLoxelEngine/data/blocks/portal_effect.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal_effect.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/portal_effect.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/portal_effect.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/portal_effect.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_0.png b/resources/testDataLoxelEngine/data/blocks/potatoes_stage_0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_0.png rename to resources/testDataLoxelEngine/data/blocks/potatoes_stage_0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_1.png b/resources/testDataLoxelEngine/data/blocks/potatoes_stage_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_1.png rename to resources/testDataLoxelEngine/data/blocks/potatoes_stage_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_2.png b/resources/testDataLoxelEngine/data/blocks/potatoes_stage_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_2.png rename to resources/testDataLoxelEngine/data/blocks/potatoes_stage_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_3.png b/resources/testDataLoxelEngine/data/blocks/potatoes_stage_3.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/potatoes_stage_3.png rename to resources/testDataLoxelEngine/data/blocks/potatoes_stage_3.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_bricks.png b/resources/testDataLoxelEngine/data/blocks/prismarine_bricks.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_bricks.png rename to resources/testDataLoxelEngine/data/blocks/prismarine_bricks.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_bricks.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/prismarine_bricks.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_bricks.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/prismarine_bricks.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_dark.png b/resources/testDataLoxelEngine/data/blocks/prismarine_dark.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_dark.png rename to resources/testDataLoxelEngine/data/blocks/prismarine_dark.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_rough.png b/resources/testDataLoxelEngine/data/blocks/prismarine_rough.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_rough.png rename to resources/testDataLoxelEngine/data/blocks/prismarine_rough.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_rough.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/prismarine_rough.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_rough.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/prismarine_rough.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_rough.png.mcmeta copy b/resources/testDataLoxelEngine/data/blocks/prismarine_rough.png.mcmeta copy similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/prismarine_rough.png.mcmeta copy rename to resources/testDataLoxelEngine/data/blocks/prismarine_rough.png.mcmeta copy diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_face_off.png b/resources/testDataLoxelEngine/data/blocks/pumpkin_face_off.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_face_off.png rename to resources/testDataLoxelEngine/data/blocks/pumpkin_face_off.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_face_on.png b/resources/testDataLoxelEngine/data/blocks/pumpkin_face_on.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_face_on.png rename to resources/testDataLoxelEngine/data/blocks/pumpkin_face_on.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_face_on.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/pumpkin_face_on.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_face_on.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/pumpkin_face_on.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_side.png b/resources/testDataLoxelEngine/data/blocks/pumpkin_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_side.png rename to resources/testDataLoxelEngine/data/blocks/pumpkin_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_top.png b/resources/testDataLoxelEngine/data/blocks/pumpkin_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/pumpkin_top.png rename to resources/testDataLoxelEngine/data/blocks/pumpkin_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/purpur_block.png b/resources/testDataLoxelEngine/data/blocks/purpur_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/purpur_block.png rename to resources/testDataLoxelEngine/data/blocks/purpur_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/purpur_pillar.png b/resources/testDataLoxelEngine/data/blocks/purpur_pillar.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/purpur_pillar.png rename to resources/testDataLoxelEngine/data/blocks/purpur_pillar.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/purpur_pillar_top.png b/resources/testDataLoxelEngine/data/blocks/purpur_pillar_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/purpur_pillar_top.png rename to resources/testDataLoxelEngine/data/blocks/purpur_pillar_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_bottom.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_bottom.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_chiseled.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_chiseled.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_chiseled.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_chiseled.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_chiseled_top.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_chiseled_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_chiseled_top.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_chiseled_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_lines.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_lines.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_lines.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_lines.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_lines_top.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_lines_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_lines_top.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_lines_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_side.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_side.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_top.png b/resources/testDataLoxelEngine/data/blocks/quartz_block_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_block_top.png rename to resources/testDataLoxelEngine/data/blocks/quartz_block_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_ore.png b/resources/testDataLoxelEngine/data/blocks/quartz_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/quartz_ore.png rename to resources/testDataLoxelEngine/data/blocks/quartz_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_activator.png b/resources/testDataLoxelEngine/data/blocks/rail_activator.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_activator.png rename to resources/testDataLoxelEngine/data/blocks/rail_activator.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_activator_powered.png b/resources/testDataLoxelEngine/data/blocks/rail_activator_powered.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_activator_powered.png rename to resources/testDataLoxelEngine/data/blocks/rail_activator_powered.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_activator_powered.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/rail_activator_powered.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_activator_powered.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/rail_activator_powered.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_detector.png b/resources/testDataLoxelEngine/data/blocks/rail_detector.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_detector.png rename to resources/testDataLoxelEngine/data/blocks/rail_detector.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_detector_powered.png b/resources/testDataLoxelEngine/data/blocks/rail_detector_powered.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_detector_powered.png rename to resources/testDataLoxelEngine/data/blocks/rail_detector_powered.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_detector_powered.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/rail_detector_powered.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_detector_powered.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/rail_detector_powered.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_golden.png b/resources/testDataLoxelEngine/data/blocks/rail_golden.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_golden.png rename to resources/testDataLoxelEngine/data/blocks/rail_golden.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_golden_powered.png b/resources/testDataLoxelEngine/data/blocks/rail_golden_powered.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_golden_powered.png rename to resources/testDataLoxelEngine/data/blocks/rail_golden_powered.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_golden_powered.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/rail_golden_powered.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_golden_powered.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/rail_golden_powered.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_normal.png b/resources/testDataLoxelEngine/data/blocks/rail_normal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_normal.png rename to resources/testDataLoxelEngine/data/blocks/rail_normal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_normal_turned.png b/resources/testDataLoxelEngine/data/blocks/rail_normal_turned.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/rail_normal_turned.png rename to resources/testDataLoxelEngine/data/blocks/rail_normal_turned.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sand.png b/resources/testDataLoxelEngine/data/blocks/red_sand.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sand.png rename to resources/testDataLoxelEngine/data/blocks/red_sand.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_bottom.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_bottom.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_carved.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_carved.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_carved.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_carved.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_carved_1.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_carved_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_carved_1.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_carved_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_carved_2.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_carved_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_carved_2.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_carved_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_normal.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_normal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_normal.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_normal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_smooth.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_smooth.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_smooth.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_smooth.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_top.png b/resources/testDataLoxelEngine/data/blocks/red_sandstone_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/red_sandstone_top.png rename to resources/testDataLoxelEngine/data/blocks/red_sandstone_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_block.png b/resources/testDataLoxelEngine/data/blocks/redstone_block.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_block.png rename to resources/testDataLoxelEngine/data/blocks/redstone_block.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_block.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/redstone_block.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_block.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/redstone_block.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_cross.png b/resources/testDataLoxelEngine/data/blocks/redstone_dust_cross.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_cross.png rename to resources/testDataLoxelEngine/data/blocks/redstone_dust_cross.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_dot.png b/resources/testDataLoxelEngine/data/blocks/redstone_dust_dot.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_dot.png rename to resources/testDataLoxelEngine/data/blocks/redstone_dust_dot.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_line.png b/resources/testDataLoxelEngine/data/blocks/redstone_dust_line.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_line.png rename to resources/testDataLoxelEngine/data/blocks/redstone_dust_line.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_line0.png b/resources/testDataLoxelEngine/data/blocks/redstone_dust_line0.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_line0.png rename to resources/testDataLoxelEngine/data/blocks/redstone_dust_line0.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_line1.png b/resources/testDataLoxelEngine/data/blocks/redstone_dust_line1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_dust_line1.png rename to resources/testDataLoxelEngine/data/blocks/redstone_dust_line1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_lamp_off.png b/resources/testDataLoxelEngine/data/blocks/redstone_lamp_off.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_lamp_off.png rename to resources/testDataLoxelEngine/data/blocks/redstone_lamp_off.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_lamp_on.png b/resources/testDataLoxelEngine/data/blocks/redstone_lamp_on.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_lamp_on.png rename to resources/testDataLoxelEngine/data/blocks/redstone_lamp_on.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_lamp_on.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/redstone_lamp_on.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_lamp_on.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/redstone_lamp_on.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_ore.png b/resources/testDataLoxelEngine/data/blocks/redstone_ore.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_ore.png rename to resources/testDataLoxelEngine/data/blocks/redstone_ore.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_ore.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/redstone_ore.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_ore.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/redstone_ore.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_torch_off.png b/resources/testDataLoxelEngine/data/blocks/redstone_torch_off.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_torch_off.png rename to resources/testDataLoxelEngine/data/blocks/redstone_torch_off.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_torch_on.png b/resources/testDataLoxelEngine/data/blocks/redstone_torch_on.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_torch_on.png rename to resources/testDataLoxelEngine/data/blocks/redstone_torch_on.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_torch_on.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/redstone_torch_on.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/redstone_torch_on.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/redstone_torch_on.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/reeds.png b/resources/testDataLoxelEngine/data/blocks/reeds.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/reeds.png rename to resources/testDataLoxelEngine/data/blocks/reeds.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/repeater_off.png b/resources/testDataLoxelEngine/data/blocks/repeater_off.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/repeater_off.png rename to resources/testDataLoxelEngine/data/blocks/repeater_off.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/repeater_on.png b/resources/testDataLoxelEngine/data/blocks/repeater_on.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/repeater_on.png rename to resources/testDataLoxelEngine/data/blocks/repeater_on.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sand.png b/resources/testDataLoxelEngine/data/blocks/sand.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sand.png rename to resources/testDataLoxelEngine/data/blocks/sand.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_bottom.png b/resources/testDataLoxelEngine/data/blocks/sandstone_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_bottom.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_carved.png b/resources/testDataLoxelEngine/data/blocks/sandstone_carved.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_carved.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_carved.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_carved_1.png b/resources/testDataLoxelEngine/data/blocks/sandstone_carved_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_carved_1.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_carved_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_carved_2.png b/resources/testDataLoxelEngine/data/blocks/sandstone_carved_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_carved_2.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_carved_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_normal.png b/resources/testDataLoxelEngine/data/blocks/sandstone_normal.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_normal.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_normal.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_smooth.png b/resources/testDataLoxelEngine/data/blocks/sandstone_smooth.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_smooth.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_smooth.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_top.png b/resources/testDataLoxelEngine/data/blocks/sandstone_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sandstone_top.png rename to resources/testDataLoxelEngine/data/blocks/sandstone_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sea_lantern.png b/resources/testDataLoxelEngine/data/blocks/sea_lantern.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sea_lantern.png rename to resources/testDataLoxelEngine/data/blocks/sea_lantern.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/slime.png b/resources/testDataLoxelEngine/data/blocks/slime.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/slime.png rename to resources/testDataLoxelEngine/data/blocks/slime.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/snow.png b/resources/testDataLoxelEngine/data/blocks/snow.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/snow.png rename to resources/testDataLoxelEngine/data/blocks/snow.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/soul_sand.png b/resources/testDataLoxelEngine/data/blocks/soul_sand.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/soul_sand.png rename to resources/testDataLoxelEngine/data/blocks/soul_sand.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sponge.png b/resources/testDataLoxelEngine/data/blocks/sponge.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sponge.png rename to resources/testDataLoxelEngine/data/blocks/sponge.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sponge_wet.png b/resources/testDataLoxelEngine/data/blocks/sponge_wet.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sponge_wet.png rename to resources/testDataLoxelEngine/data/blocks/sponge_wet.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone.png b/resources/testDataLoxelEngine/data/blocks/stone.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone.png rename to resources/testDataLoxelEngine/data/blocks/stone.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_andesite.png b/resources/testDataLoxelEngine/data/blocks/stone_andesite.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_andesite.png rename to resources/testDataLoxelEngine/data/blocks/stone_andesite.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_andesite_smooth.png b/resources/testDataLoxelEngine/data/blocks/stone_andesite_smooth.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_andesite_smooth.png rename to resources/testDataLoxelEngine/data/blocks/stone_andesite_smooth.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_diorite.png b/resources/testDataLoxelEngine/data/blocks/stone_diorite.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_diorite.png rename to resources/testDataLoxelEngine/data/blocks/stone_diorite.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_diorite_smooth.png b/resources/testDataLoxelEngine/data/blocks/stone_diorite_smooth.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_diorite_smooth.png rename to resources/testDataLoxelEngine/data/blocks/stone_diorite_smooth.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_granite.png b/resources/testDataLoxelEngine/data/blocks/stone_granite.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_granite.png rename to resources/testDataLoxelEngine/data/blocks/stone_granite.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_granite_smooth.png b/resources/testDataLoxelEngine/data/blocks/stone_granite_smooth.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_granite_smooth.png rename to resources/testDataLoxelEngine/data/blocks/stone_granite_smooth.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_slab_side.png b/resources/testDataLoxelEngine/data/blocks/stone_slab_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_slab_side.png rename to resources/testDataLoxelEngine/data/blocks/stone_slab_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_slab_top.png b/resources/testDataLoxelEngine/data/blocks/stone_slab_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stone_slab_top.png rename to resources/testDataLoxelEngine/data/blocks/stone_slab_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick.png b/resources/testDataLoxelEngine/data/blocks/stonebrick.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_1.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_1.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_2.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_2.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_carved.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_carved.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_carved.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_carved.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_cracked.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_cracked.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_cracked.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_cracked.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_cracked_1.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_cracked_1.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_cracked_1.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_cracked_1.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_cracked_2.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_cracked_2.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_cracked_2.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_cracked_2.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_mossy.png b/resources/testDataLoxelEngine/data/blocks/stonebrick_mossy.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/stonebrick_mossy.png rename to resources/testDataLoxelEngine/data/blocks/stonebrick_mossy.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sunflower_head.png b/resources/testDataLoxelEngine/data/blocks/sunflower_head.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sunflower_head.png rename to resources/testDataLoxelEngine/data/blocks/sunflower_head.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sunflower_stem.png b/resources/testDataLoxelEngine/data/blocks/sunflower_stem.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/sunflower_stem.png rename to resources/testDataLoxelEngine/data/blocks/sunflower_stem.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tallgrass.png b/resources/testDataLoxelEngine/data/blocks/tallgrass.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tallgrass.png rename to resources/testDataLoxelEngine/data/blocks/tallgrass.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tnt_bottom.png b/resources/testDataLoxelEngine/data/blocks/tnt_bottom.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tnt_bottom.png rename to resources/testDataLoxelEngine/data/blocks/tnt_bottom.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tnt_side.png b/resources/testDataLoxelEngine/data/blocks/tnt_side.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tnt_side.png rename to resources/testDataLoxelEngine/data/blocks/tnt_side.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tnt_top.png b/resources/testDataLoxelEngine/data/blocks/tnt_top.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/tnt_top.png rename to resources/testDataLoxelEngine/data/blocks/tnt_top.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/trapdoor.png b/resources/testDataLoxelEngine/data/blocks/trapdoor.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/trapdoor.png rename to resources/testDataLoxelEngine/data/blocks/trapdoor.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/trip_wire.png b/resources/testDataLoxelEngine/data/blocks/trip_wire.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/trip_wire.png rename to resources/testDataLoxelEngine/data/blocks/trip_wire.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/trip_wire_source.png b/resources/testDataLoxelEngine/data/blocks/trip_wire_source.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/trip_wire_source.png rename to resources/testDataLoxelEngine/data/blocks/trip_wire_source.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/vine.png b/resources/testDataLoxelEngine/data/blocks/vine.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/vine.png rename to resources/testDataLoxelEngine/data/blocks/vine.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_flow.png b/resources/testDataLoxelEngine/data/blocks/water_flow.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_flow.png rename to resources/testDataLoxelEngine/data/blocks/water_flow.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_flow.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/water_flow.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_flow.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/water_flow.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_static.png b/resources/testDataLoxelEngine/data/blocks/water_static.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_static.png rename to resources/testDataLoxelEngine/data/blocks/water_static.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_still.png b/resources/testDataLoxelEngine/data/blocks/water_still.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_still.png rename to resources/testDataLoxelEngine/data/blocks/water_still.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_still.png.mcmeta b/resources/testDataLoxelEngine/data/blocks/water_still.png.mcmeta similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/water_still.png.mcmeta rename to resources/testDataLoxelEngine/data/blocks/water_still.png.mcmeta diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/waterlily.png b/resources/testDataLoxelEngine/data/blocks/waterlily.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/waterlily.png rename to resources/testDataLoxelEngine/data/blocks/waterlily.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/web.png b/resources/testDataLoxelEngine/data/blocks/web.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/web.png rename to resources/testDataLoxelEngine/data/blocks/web.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_black.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_black.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_black.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_black.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_blue.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_blue.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_blue.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_blue.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_brown.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_brown.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_brown.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_brown.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_cyan.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_cyan.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_cyan.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_cyan.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_gray.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_gray.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_gray.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_gray.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_green.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_green.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_green.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_green.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_light_blue.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_light_blue.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_light_blue.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_light_blue.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_lime.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_lime.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_lime.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_lime.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_magenta.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_magenta.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_magenta.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_magenta.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_orange.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_orange.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_orange.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_orange.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_pink.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_pink.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_pink.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_pink.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_purple.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_purple.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_purple.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_purple.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_red.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_red.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_red.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_red.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_silver.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_silver.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_silver.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_silver.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_white.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_white.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_white.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_white.png diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_yellow.png b/resources/testDataLoxelEngine/data/blocks/wool_colored_yellow.png similarity index 100% rename from src/org/atriasoft/ege/samples/LoxelEngine/res/blocks/wool_colored_yellow.png rename to resources/testDataLoxelEngine/data/blocks/wool_colored_yellow.png diff --git a/src/engineTester/MainGameLoop.java b/src/engineTester/MainGameLoop.java index 60b9557..71d8ccd 100644 --- a/src/engineTester/MainGameLoop.java +++ b/src/engineTester/MainGameLoop.java @@ -1,12 +1,13 @@ package engineTester; - import java.util.ArrayList; import java.util.List; import java.util.Random; +import org.atriasoft.etk.Uri; import org.atriasoft.etk.math.Vector2f; import org.atriasoft.etk.math.Vector3f; + import entities.Camera; import entities.Entity; import entities.Light; @@ -31,8 +32,7 @@ import textures.ModelTexture; * */ public class MainGameLoop { - - + /** * Loads up the position data for two triangles (which together make a quad) * into a VAO. This VAO is then rendered to the screen every frame. @@ -41,115 +41,87 @@ public class MainGameLoop { */ public static void main(String[] args) { - DisplayManager manager = new DisplayManager(); - Loader loader = new Loader(); + final DisplayManager manager = new DisplayManager(); + final Loader loader = new Loader(); manager.init(); - - List entities = new ArrayList(); - Random random = new Random(); - - TexturedModel staticModel = new TexturedModel(OBJLoader.loadObjModel("res/tree.obj", loader), - new ModelTexture(loader.loadTexture("tree"))); + final List entities = new ArrayList(); + final Random random = new Random(); + + final TexturedModel staticModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "tree.obj", "sample"), loader), new ModelTexture(loader.loadTexture("tree"))); //ModelTexture texture = staticModel.getTexture(); //texture.setShineDamper(10); //texture.setReflectivity(1); - TexturedModel grassModel = new TexturedModel(OBJLoader.loadObjModel("res/grassModel.obj", loader), - new ModelTexture(loader.loadTexture("grassTexture"))); + final TexturedModel grassModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "grassModel.obj", "sample"), loader), new ModelTexture(loader.loadTexture("grassTexture"))); grassModel.getTexture().setHasTransparency(true); grassModel.getTexture().setUseFakeLighting(true); - TexturedModel flowerModel = new TexturedModel(OBJLoader.loadObjModel("res/grassModel.obj", loader), - new ModelTexture(loader.loadTexture("flower"))); + final TexturedModel flowerModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "grassModel.obj", "sample"), loader), new ModelTexture(loader.loadTexture("flower"))); flowerModel.getTexture().setHasTransparency(true); flowerModel.getTexture().setUseFakeLighting(true); - TexturedModel fernModel = new TexturedModel(OBJLoader.loadObjModel("res/fern.obj", loader), - new ModelTexture(loader.loadTexture("fern_atlas"))); + final TexturedModel fernModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "fern.obj", "sample"), loader), new ModelTexture(loader.loadTexture("fern_atlas"))); fernModel.getTexture().setHasTransparency(true); fernModel.getTexture().setNumberOfRows(2); - - TexturedModel lampModel = new TexturedModel(OBJLoader.loadObjModel("res/lamp.obj", loader), - new ModelTexture(loader.loadTexture("lamp"))); + + final TexturedModel lampModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "lamp.obj", "sample"), loader), new ModelTexture(loader.loadTexture("lamp"))); //lampModel.getTexture().setHasTransparency(true); lampModel.getTexture().setUseFakeLighting(true); // this permit to the light to glow - TexturedModel pineModel = new TexturedModel(OBJLoader.loadObjModel("res/pine.obj", loader), - new ModelTexture(loader.loadTexture("pine"))); + final TexturedModel pineModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "pine.obj", "sample"), loader), new ModelTexture(loader.loadTexture("pine"))); - List lights = new ArrayList(); - lights.add(new Light(new Vector3f(0,10000,-7000), new Vector3f(0.4f,0.4f,0.4f))); - lights.add(new Light(new Vector3f(185,10,-293), new Vector3f(2,0,0), new Vector3f(1,0.01f,0.002f))); - lights.add(new Light(new Vector3f(370,17,-300), new Vector3f(0,2,2), new Vector3f(1,0.01f,0.002f))); - lights.add(new Light(new Vector3f(293,7,-305), new Vector3f(2,2,0), new Vector3f(1,0.01f,0.002f))); - - entities.add(new Entity(lampModel, - new Vector3f(185, -4.7f, -293), - new Vector3f(0,0,0), - 1)); - entities.add(new Entity(lampModel, - new Vector3f(370, 4.2f, -300), - new Vector3f(0,0,0), - 1)); - entities.add(new Entity(lampModel, - new Vector3f(293, -6.8f, -305), - new Vector3f(0,0,0), - 1)); + final List lights = new ArrayList(); + lights.add(new Light(new Vector3f(0, 10000, -7000), new Vector3f(0.4f, 0.4f, 0.4f))); + lights.add(new Light(new Vector3f(185, 10, -293), new Vector3f(2, 0, 0), new Vector3f(1, 0.01f, 0.002f))); + lights.add(new Light(new Vector3f(370, 17, -300), new Vector3f(0, 2, 2), new Vector3f(1, 0.01f, 0.002f))); + lights.add(new Light(new Vector3f(293, 7, -305), new Vector3f(2, 2, 0), new Vector3f(1, 0.01f, 0.002f))); + entities.add(new Entity(lampModel, new Vector3f(185, -4.7f, -293), new Vector3f(0, 0, 0), 1)); + entities.add(new Entity(lampModel, new Vector3f(370, 4.2f, -300), new Vector3f(0, 0, 0), 1)); + entities.add(new Entity(lampModel, new Vector3f(293, -6.8f, -305), new Vector3f(0, 0, 0), 1)); - TerrainTexture backgroundTexture = new TerrainTexture(loader.loadTexture("grass")); - TerrainTexture rTexture = new TerrainTexture(loader.loadTexture("dirt")); - TerrainTexture gTexture = new TerrainTexture(loader.loadTexture("grassFlowers")); - TerrainTexture bTexture = new TerrainTexture(loader.loadTexture("path")); - TerrainTexturePack texturePack = new TerrainTexturePack(backgroundTexture, rTexture, gTexture, bTexture); - - TerrainTexture blendMap = new TerrainTexture(loader.loadTexture("blendMap")); + final TerrainTexture backgroundTexture = new TerrainTexture(loader.loadTexture("grass")); + final TerrainTexture rTexture = new TerrainTexture(loader.loadTexture("dirt")); + final TerrainTexture gTexture = new TerrainTexture(loader.loadTexture("grassFlowers")); + final TerrainTexture bTexture = new TerrainTexture(loader.loadTexture("path")); + final TerrainTexturePack texturePack = new TerrainTexturePack(backgroundTexture, rTexture, gTexture, bTexture); - Terrain terrain = new Terrain(0,-1,loader, texturePack, blendMap, "heightmap"); + final TerrainTexture blendMap = new TerrainTexture(loader.loadTexture("blendMap")); - - - for (int iii=0; iii<250; iii++) { - float x = random.nextFloat()*800 - 400; - float z = random.nextFloat() * -600; - float y = terrain.getHeightOfTerrain(x, z); - entities.add(new Entity(staticModel, - new Vector3f(x, y, z), - new Vector3f(0,0,0),3)); + final Terrain terrain = new Terrain(0, -1, loader, texturePack, blendMap, "heightmap"); + + for (int iii = 0; iii < 250; iii++) { + final float x = random.nextFloat() * 800 - 400; + final float z = random.nextFloat() * -600; + final float y = terrain.getHeightOfTerrain(x, z); + entities.add(new Entity(staticModel, new Vector3f(x, y, z), new Vector3f(0, 0, 0), 3)); } - for (int iii=0; iii<250; iii++) { - float x = random.nextFloat()*800 - 400; - float z = random.nextFloat() * -600; - float y = terrain.getHeightOfTerrain(x, z); - entities.add(new Entity(pineModel, - new Vector3f(x, y, z), - new Vector3f(0,0,0),0.5f)); + for (int iii = 0; iii < 250; iii++) { + final float x = random.nextFloat() * 800 - 400; + final float z = random.nextFloat() * -600; + final float y = terrain.getHeightOfTerrain(x, z); + entities.add(new Entity(pineModel, new Vector3f(x, y, z), new Vector3f(0, 0, 0), 0.5f)); } - for (int iii=0; iii<500; iii++) { - float x = random.nextFloat()*800 - 400; - float z = random.nextFloat() * -600; - float y = terrain.getHeightOfTerrain(x, z); - entities.add(new Entity(fernModel, - random.nextInt(4), - new Vector3f(x, y, z), - new Vector3f(0,0,0),0.6f)); + for (int iii = 0; iii < 500; iii++) { + final float x = random.nextFloat() * 800 - 400; + final float z = random.nextFloat() * -600; + final float y = terrain.getHeightOfTerrain(x, z); + entities.add(new Entity(fernModel, random.nextInt(4), new Vector3f(x, y, z), new Vector3f(0, 0, 0), 0.6f)); } - TexturedModel playerModel = new TexturedModel(OBJLoader.loadObjModel("res/person.obj", loader), - new ModelTexture(loader.loadTexture("playerTexture"))); + final TexturedModel playerModel = new TexturedModel(OBJLoader.loadObjModel(new Uri("RES", "person.obj", "sample"), loader), new ModelTexture(loader.loadTexture("playerTexture"))); - Player player = new Player(playerModel, new Vector3f(180,terrain.getHeightOfTerrain(180, -250),-250), new Vector3f(0,3.14f,0), 0.4f); - - Camera camera = new Camera(player); + final Player player = new Player(playerModel, new Vector3f(180, terrain.getHeightOfTerrain(180, -250), -250), new Vector3f(0, 3.14f, 0), 0.4f); + final Camera camera = new Camera(player); - List guis = new ArrayList(); - GuiTexture gui = new GuiTexture(loader.loadTexture("health"), new Vector2f(-0.75f, 0.9f), new Vector2f(0.25f, 0.25f)); + final List guis = new ArrayList(); + final GuiTexture gui = new GuiTexture(loader.loadTexture("health"), new Vector2f(-0.75f, 0.9f), new Vector2f(0.25f, 0.25f)); guis.add(gui); - GuiRenderer guiRenderer = new GuiRenderer(loader); - MasterRenderer renderer = new MasterRenderer(loader); + final GuiRenderer guiRenderer = new GuiRenderer(loader); + final MasterRenderer renderer = new MasterRenderer(loader); manager.setDrawer(new DisplayManagerDraw() { @Override @@ -161,13 +133,13 @@ public class MainGameLoop { camera.move(); renderer.processTerrain(terrain); renderer.processEntity(player); - for (Entity entity : entities) { + for (final Entity entity : entities) { entity.increaseRotation(0, 0.01f, 0.0f); renderer.processEntity(entity); } renderer.render(lights, camera); guiRenderer.render(guis); - } + } }); manager.loop(); guiRenderer.cleanUp(); @@ -175,5 +147,5 @@ public class MainGameLoop { loader.cleanUp(); manager.unInit(); } - + } diff --git a/src/entities/Camera.java b/src/entities/Camera.java index c50511f..14708cc 100644 --- a/src/entities/Camera.java +++ b/src/entities/Camera.java @@ -1,6 +1,5 @@ package entities; -import org.atriasoft.etk.math.Matrix4f; import org.atriasoft.etk.math.Vector3f; import renderEngine.DisplayManager; @@ -10,16 +9,72 @@ public class Camera { private float distanceFromPlayer = 20; private float angleAroundPlayer = 0; - private Vector3f position = new Vector3f(0,5,0); + private Vector3f position = new Vector3f(0, 5, 0); private float pitch = 0;// (float) Math.toRadians(10); private float yaw = 0; private float roll = 0; - + private Player player; - public Camera(Player player) { + public Camera(final Player player) { this.player = player; } + + private void CalculateAngleAroundPlayer() { + if (DisplayManager.isButtonLeftDown()) { + float angleChange = DisplayManager.getDX() * 0.003f; + this.angleAroundPlayer -= angleChange; + } + } + + private void calculateCameraPosition(final float horizontalDistance, final float verticalDistance) { + float theta = 3.141596f + this.player.getRotation().y() + this.angleAroundPlayer; + float offsetX = (float) (horizontalDistance * Math.sin(theta)); + float offsetZ = (float) (horizontalDistance * Math.cos(theta)); + this.position = new Vector3f(this.player.getPosition().x() + offsetX, this.player.getPosition().y() + 5 + verticalDistance, this.player.getPosition().z() + offsetZ); + } + + private float calculateHorizontalDistance() { + return (float) (this.distanceFromPlayer * Math.cos(this.pitch)); + } + + private void calculatePitch() { + if (DisplayManager.isButtonRightDown()) { + float pitchChange = DisplayManager.getDY() * 0.01f; + this.pitch += pitchChange; + if (this.pitch < 0) { + this.pitch = 0; + } else if (this.pitch > 3.14159f / 2f) { + this.pitch = 3.14159f / 2f; + } + } + } + + private float calculateVerticalDistance() { + return (float) (this.distanceFromPlayer * Math.sin(this.pitch)); + } + + private void calculateZoom() { + float zoomLevel = DisplayManager.getDWheel() * 1; + this.distanceFromPlayer -= zoomLevel; + } + + public float getPitch() { + return this.pitch; + } + + public Vector3f getPosition() { + return this.position; + } + + public float getRoll() { + return this.roll; + } + + public float getYaw() { + return this.yaw; + } + public void move() { calculateZoom(); calculatePitch(); @@ -27,66 +82,7 @@ public class Camera { float horinzontalDistance = calculateHorizontalDistance(); float verticalDistance = calculateVerticalDistance(); calculateCameraPosition(horinzontalDistance, verticalDistance); - this.yaw = 3.141596f - player.getRotation().y - angleAroundPlayer ; - } - - private void calculateCameraPosition (float horizontalDistance, float verticalDistance) { - float theta = 3.141596f + player.getRotation().y + angleAroundPlayer; - float offsetX = (float) (horizontalDistance * Math.sin(theta)); - float offsetZ = (float) (horizontalDistance * Math.cos(theta)); - position.x = player.getPosition().x + offsetX; - position.z = player.getPosition().z + offsetZ; - position.y = player.getPosition().y+5 + verticalDistance; - - } - - - private float calculateHorizontalDistance() { - return (float) (distanceFromPlayer * Math.cos(pitch)); - } - - private float calculateVerticalDistance() { - return (float) (distanceFromPlayer * Math.sin(pitch)); - } - - public Vector3f getPosition() { - return position; - } - - public float getPitch() { - return pitch; - } - - public float getYaw() { - return yaw; - } - - public float getRoll() { - return roll; - } - - private void calculateZoom() { - float zoomLevel = DisplayManager.getDWheel() * 1; - distanceFromPlayer -= zoomLevel; - } - - private void calculatePitch() { - if (DisplayManager.isButtonRightDown() ) { - float pitchChange = DisplayManager.getDY() * 0.01f; - pitch += pitchChange; - if (pitch < 0) { - pitch = 0; - } else if (pitch > 3.14159f/2f) { - pitch = 3.14159f/2f; - } - } - } - - private void CalculateAngleAroundPlayer() { - if (DisplayManager.isButtonLeftDown()) { - float angleChange = DisplayManager.getDX() * 0.003f; - angleAroundPlayer -= angleChange; - } + this.yaw = 3.141596f - this.player.getRotation().y() - this.angleAroundPlayer; } } diff --git a/src/entities/Entity.java b/src/entities/Entity.java index e13c2aa..edd8777 100644 --- a/src/entities/Entity.java +++ b/src/entities/Entity.java @@ -10,67 +10,78 @@ public class Entity { private Vector3f rotation; private float scale; private int textureIndex = 0; - public Entity(TexturedModel model, Vector3f position, Vector3f rotation, float scale) { - this.model = model; - this.position = position; - this.rotation = rotation; - this.scale = scale; - } - public Entity(TexturedModel model, int textureIndex, Vector3f position, Vector3f rotation, float scale) { + + public Entity(final TexturedModel model, final int textureIndex, final Vector3f position, final Vector3f rotation, final float scale) { this.model = model; this.textureIndex = textureIndex; this.position = position; this.rotation = rotation; this.scale = scale; } - - public float getTextureXOffset() { - int column = textureIndex%model.getTexture().getNumberOfRows(); - return (float)column/(float)model.getTexture().getNumberOfRows(); - } - public float getTextureYOffset() { - int row = textureIndex/model.getTexture().getNumberOfRows(); - return (float)row/(float)model.getTexture().getNumberOfRows(); - } - - public void increasePosition(float dx, float dy, float dz) { - this.position = new Vector3f(position.x + dx, position.y + dy, position.z + dz); - } - public void increasePosition(Vector3f delta) { - this.position = new Vector3f(position.x + delta.x, position.y + delta.y, position.z + delta.z); - } - public void increaseRotation(float dx, float dy, float dz) { - this.rotation = new Vector3f(rotation.x + dx, rotation.y + dy, rotation.z + dz); - } - public void increaseRotation(Vector3f delta) { - this.rotation = new Vector3f(rotation.x + delta.x, rotation.y + delta.y, rotation.z + delta.z); - } - - public TexturedModel getModel() { - return model; - } - public void setModel(TexturedModel model) { + public Entity(final TexturedModel model, final Vector3f position, final Vector3f rotation, final float scale) { this.model = model; - } - public Vector3f getPosition() { - return position; - } - public void setPosition(Vector3f position) { this.position = position; - } - public Vector3f getRotation() { - return rotation; - } - public void setRotation(Vector3f rotation) { this.rotation = rotation; - } - public float getScale() { - return scale; - } - public void setScale(float scale) { this.scale = scale; } + public TexturedModel getModel() { + return this.model; + } + + public Vector3f getPosition() { + return this.position; + } + + public Vector3f getRotation() { + return this.rotation; + } + + public float getScale() { + return this.scale; + } + + public float getTextureXOffset() { + int column = this.textureIndex % this.model.getTexture().getNumberOfRows(); + return (float) column / (float) this.model.getTexture().getNumberOfRows(); + } + + public float getTextureYOffset() { + int row = this.textureIndex / this.model.getTexture().getNumberOfRows(); + return (float) row / (float) this.model.getTexture().getNumberOfRows(); + } + + public void increasePosition(final float dx, final float dy, final float dz) { + this.position = new Vector3f(this.position.x() + dx, this.position.y() + dy, this.position.z() + dz); + } + + public void increasePosition(final Vector3f delta) { + this.position = new Vector3f(this.position.x() + delta.x(), this.position.y() + delta.y(), this.position.z() + delta.z()); + } + + public void increaseRotation(final float dx, final float dy, final float dz) { + this.rotation = new Vector3f(this.rotation.x() + dx, this.rotation.y() + dy, this.rotation.z() + dz); + } + + public void increaseRotation(final Vector3f delta) { + this.rotation = new Vector3f(this.rotation.x() + delta.x(), this.rotation.y() + delta.y(), this.rotation.z() + delta.z()); + } + + public void setModel(final TexturedModel model) { + this.model = model; + } + + public void setPosition(final Vector3f position) { + this.position = position; + } + + public void setRotation(final Vector3f rotation) { + this.rotation = rotation; + } + + public void setScale(final float scale) { + this.scale = scale; + } } diff --git a/src/entities/Player.java b/src/entities/Player.java index e27171c..5958296 100644 --- a/src/entities/Player.java +++ b/src/entities/Player.java @@ -7,12 +7,12 @@ import renderEngine.DisplayManager; import terrains.Terrain; public class Player extends Entity { - + private static final float RUN_SPEED = 35; private static final float TRUN_SPEED = (float) Math.toRadians(120); private static final float GRAVITY = -50; private static final float JUMP_POWER = 30; - + private static final float TERRAIN_HEIGHT = 0; private float currentSpeed = 0; @@ -21,36 +21,9 @@ public class Player extends Entity { private boolean isInAir = false; - public Player(TexturedModel model, Vector3f position, Vector3f rotation, float scale) { + public Player(final TexturedModel model, final Vector3f position, final Vector3f rotation, final float scale) { super(model, position, rotation, scale); - - } - - public void move(Terrain terrain) { - checkInputs(); - if (isInAir == false) { - super.increaseRotation(0, this.currentTurnSpeed * DisplayManager.getFrameTimeSecconds(), 0); - } - float distance = currentSpeed * DisplayManager.getFrameTimeSecconds(); - float dx = (float) (distance * Math.sin(super.getRotation().y)); - float dz = (float) (distance * Math.cos(super.getRotation().y)); - super.increasePosition(dx, 0, dz); - upwardSpeed += GRAVITY * DisplayManager.getFrameTimeSecconds(); - super.increasePosition(0, upwardSpeed * DisplayManager.getFrameTimeSecconds(), 0); - float terrainHeight = terrain.getHeightOfTerrain(super.getPosition().x, super.getPosition().z); - if (super.getPosition().y < terrainHeight) { - upwardSpeed = 0; - super.getPosition().y = terrainHeight; - isInAir = false; - } - } - - private void jump() { - if (isInAir == true) { - return; - } - this.upwardSpeed = JUMP_POWER; - isInAir = true; + } public void checkInputs() { @@ -70,10 +43,37 @@ public class Player extends Entity { } else if (DisplayManager.isKeyDown('d')) { this.currentTurnSpeed = -TRUN_SPEED; } else { - this.currentTurnSpeed = 0; + this.currentTurnSpeed = 0; } if (DisplayManager.isKeyDown(' ')) { - this.jump(); + jump(); + } + } + + private void jump() { + if (this.isInAir == true) { + return; + } + this.upwardSpeed = JUMP_POWER; + this.isInAir = true; + } + + public void move(final Terrain terrain) { + checkInputs(); + if (this.isInAir == false) { + super.increaseRotation(0, this.currentTurnSpeed * DisplayManager.getFrameTimeSecconds(), 0); + } + float distance = this.currentSpeed * DisplayManager.getFrameTimeSecconds(); + float dx = (float) (distance * Math.sin(super.getRotation().y())); + float dz = (float) (distance * Math.cos(super.getRotation().y())); + super.increasePosition(dx, 0, dz); + this.upwardSpeed += GRAVITY * DisplayManager.getFrameTimeSecconds(); + super.increasePosition(0, this.upwardSpeed * DisplayManager.getFrameTimeSecconds(), 0); + float terrainHeight = terrain.getHeightOfTerrain(super.getPosition().x(), super.getPosition().z()); + if (super.getPosition().y() < terrainHeight) { + this.upwardSpeed = 0; + super.setPosition(new Vector3f(super.getPosition().x(), terrainHeight, super.getPosition().z())); + this.isInAir = false; } } diff --git a/src/module-info.java b/src/module-info.java index 9922a41..72b57ef 100644 --- a/src/module-info.java +++ b/src/module-info.java @@ -14,5 +14,6 @@ open module org.atriasoft.ege { requires transitive org.atriasoft.gale; requires transitive org.atriasoft.etk; + requires transitive org.atriasoft.ewol; requires transitive org.atriasoft.ephysics; } diff --git a/src/objConverter/OBJFileLoader.java b/src/objConverter/OBJFileLoader.java index 4d344fd..0c760bb 100644 --- a/src/objConverter/OBJFileLoader.java +++ b/src/objConverter/OBJFileLoader.java @@ -1,163 +1,164 @@ package objConverter; import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.List; +import org.atriasoft.ege.samples.lowPoly.Log; +import org.atriasoft.etk.Uri; import org.atriasoft.etk.math.Vector2f; import org.atriasoft.etk.math.Vector3f; - public class OBJFileLoader { + private static float convertDataToArrays(final List vertices, final List textures, final List normals, final float[] verticesArray, final float[] texturesArray, + final float[] normalsArray) { + float furthestPoint = 0; + for (int i = 0; i < vertices.size(); i++) { + final Vertex currentVertex = vertices.get(i); + if (currentVertex.getLength() > furthestPoint) { + furthestPoint = currentVertex.getLength(); + } + final Vector3f position = currentVertex.getPosition(); + final Vector2f textureCoord = textures.get(currentVertex.getTextureIndex()); + final Vector3f normalVector = normals.get(currentVertex.getNormalIndex()); + verticesArray[i * 3] = position.x(); + verticesArray[i * 3 + 1] = position.y(); + verticesArray[i * 3 + 2] = position.z(); + texturesArray[i * 2] = textureCoord.x(); + texturesArray[i * 2 + 1] = 1 - textureCoord.y(); + normalsArray[i * 3] = normalVector.x(); + normalsArray[i * 3 + 1] = normalVector.y(); + normalsArray[i * 3 + 2] = normalVector.z(); + } + return furthestPoint; + } - private static final String RES_LOC = "res/"; - - public static ModelData loadOBJ(String objFileName) { - FileReader isr = null; - File objFile = new File(objFileName); - try { - isr = new FileReader(objFile); - } catch (FileNotFoundException e) { - System.err.println("File not found in res; don't use any extention"); - return null; - } - BufferedReader reader = new BufferedReader(isr); - String line; - List vertices = new ArrayList(); - List textures = new ArrayList(); - List normals = new ArrayList(); - List indices = new ArrayList(); - try { - while (true) { - line = reader.readLine(); - if (line.startsWith("v ")) { - String[] currentLine = line.split(" "); - Vector3f vertex = new Vector3f((float) Float.valueOf(currentLine[1]), - (float) Float.valueOf(currentLine[2]), - (float) Float.valueOf(currentLine[3])); - Vertex newVertex = new Vertex(vertices.size(), vertex); - vertices.add(newVertex); - - } else if (line.startsWith("vt ")) { - String[] currentLine = line.split(" "); - Vector2f texture = new Vector2f((float) Float.valueOf(currentLine[1]), - (float) Float.valueOf(currentLine[2])); - textures.add(texture); - } else if (line.startsWith("vn ")) { - String[] currentLine = line.split(" "); - Vector3f normal = new Vector3f((float) Float.valueOf(currentLine[1]), - (float) Float.valueOf(currentLine[2]), - (float) Float.valueOf(currentLine[3])); - normals.add(normal); - } else if (line.startsWith("f ")) { - break; - } - } - while (line != null && line.startsWith("f ")) { - String[] currentLine = line.split(" "); - String[] vertex1 = currentLine[1].split("/"); - String[] vertex2 = currentLine[2].split("/"); - String[] vertex3 = currentLine[3].split("/"); - processVertex(vertex1, vertices, indices); - processVertex(vertex2, vertices, indices); - processVertex(vertex3, vertices, indices); - line = reader.readLine(); - } - reader.close(); - } catch (IOException e) { - System.err.println("Error reading the file"); - } - removeUnusedVertices(vertices); - float[] verticesArray = new float[vertices.size() * 3]; - float[] texturesArray = new float[vertices.size() * 2]; - float[] normalsArray = new float[vertices.size() * 3]; - float furthest = convertDataToArrays(vertices, textures, normals, verticesArray, - texturesArray, normalsArray); - int[] indicesArray = convertIndicesListToArray(indices); - ModelData data = new ModelData(verticesArray, texturesArray, normalsArray, indicesArray, - furthest); - return data; - } - - private static void processVertex(String[] vertex, List vertices, List indices) { - int index = Integer.parseInt(vertex[0]) - 1; - Vertex currentVertex = vertices.get(index); - int textureIndex = Integer.parseInt(vertex[1]) - 1; - int normalIndex = Integer.parseInt(vertex[2]) - 1; - if (!currentVertex.isSet()) { - currentVertex.setTextureIndex(textureIndex); - currentVertex.setNormalIndex(normalIndex); - indices.add(index); - } else { - dealWithAlreadyProcessedVertex(currentVertex, textureIndex, normalIndex, indices, - vertices); - } - } - - private static int[] convertIndicesListToArray(List indices) { - int[] indicesArray = new int[indices.size()]; + private static int[] convertIndicesListToArray(final List indices) { + final int[] indicesArray = new int[indices.size()]; for (int i = 0; i < indicesArray.length; i++) { indicesArray[i] = indices.get(i); } return indicesArray; } - - private static float convertDataToArrays(List vertices, List textures, - List normals, float[] verticesArray, float[] texturesArray, - float[] normalsArray) { - float furthestPoint = 0; - for (int i = 0; i < vertices.size(); i++) { - Vertex currentVertex = vertices.get(i); - if (currentVertex.getLength() > furthestPoint) { - furthestPoint = currentVertex.getLength(); - } - Vector3f position = currentVertex.getPosition(); - Vector2f textureCoord = textures.get(currentVertex.getTextureIndex()); - Vector3f normalVector = normals.get(currentVertex.getNormalIndex()); - verticesArray[i * 3] = position.x; - verticesArray[i * 3 + 1] = position.y; - verticesArray[i * 3 + 2] = position.z; - texturesArray[i * 2] = textureCoord.x; - texturesArray[i * 2 + 1] = 1 - textureCoord.y; - normalsArray[i * 3] = normalVector.x; - normalsArray[i * 3 + 1] = normalVector.y; - normalsArray[i * 3 + 2] = normalVector.z; - } - return furthestPoint; - } - - private static void dealWithAlreadyProcessedVertex(Vertex previousVertex, int newTextureIndex, - int newNormalIndex, List indices, List vertices) { + + private static void dealWithAlreadyProcessedVertex(final Vertex previousVertex, final int newTextureIndex, final int newNormalIndex, final List indices, final List vertices) { if (previousVertex.hasSameTextureAndNormal(newTextureIndex, newNormalIndex)) { indices.add(previousVertex.getIndex()); } else { - Vertex anotherVertex = previousVertex.getDuplicateVertex(); + final Vertex anotherVertex = previousVertex.getDuplicateVertex(); if (anotherVertex != null) { - dealWithAlreadyProcessedVertex(anotherVertex, newTextureIndex, newNormalIndex, - indices, vertices); + OBJFileLoader.dealWithAlreadyProcessedVertex(anotherVertex, newTextureIndex, newNormalIndex, indices, vertices); } else { - Vertex duplicateVertex = new Vertex(vertices.size(), previousVertex.getPosition()); + final Vertex duplicateVertex = new Vertex(vertices.size(), previousVertex.getPosition()); duplicateVertex.setTextureIndex(newTextureIndex); duplicateVertex.setNormalIndex(newNormalIndex); previousVertex.setDuplicateVertex(duplicateVertex); vertices.add(duplicateVertex); indices.add(duplicateVertex.getIndex()); } - + } } - private static void removeUnusedVertices(List vertices){ - for(Vertex vertex:vertices){ - if(!vertex.isSet()){ + public static ModelData loadOBJ(final Uri objFileName) { + final InputStream stream = Uri.getStream(objFileName); + if (stream == null) { + Log.error("Can not read file: " + objFileName + " ==> load OBJ"); + return null; + } + /* + final FileReader isr = null; + final File objFile = new File(objFileName); + try { + isr = new FileReader(objFile); + } catch (final FileNotFoundException e) { + System.err.println("File not found in res; don't use any extention"); + return null; + } + */ + BufferedReader reader; + try { + reader = new BufferedReader(new InputStreamReader(stream, "UTF-8")); + } catch (final UnsupportedEncodingException e1) { + Log.error("Error in loading file: " + objFileName + " ==> load OBJ"); + e1.printStackTrace(); + return null; + } + String line; + final List vertices = new ArrayList<>(); + final List textures = new ArrayList<>(); + final List normals = new ArrayList<>(); + final List indices = new ArrayList<>(); + try { + while (true) { + line = reader.readLine(); + if (line.startsWith("v ")) { + final String[] currentLine = line.split(" "); + final Vector3f vertex = new Vector3f(Float.parseFloat(currentLine[1]), Float.parseFloat(currentLine[2]), Float.parseFloat(currentLine[3])); + final Vertex newVertex = new Vertex(vertices.size(), vertex); + vertices.add(newVertex); + + } else if (line.startsWith("vt ")) { + final String[] currentLine = line.split(" "); + final Vector2f texture = new Vector2f(Float.parseFloat(currentLine[1]), Float.parseFloat(currentLine[2])); + textures.add(texture); + } else if (line.startsWith("vn ")) { + final String[] currentLine = line.split(" "); + final Vector3f normal = new Vector3f(Float.parseFloat(currentLine[1]), Float.parseFloat(currentLine[2]), Float.parseFloat(currentLine[3])); + normals.add(normal); + } else if (line.startsWith("f ")) { + break; + } + } + while (line != null && line.startsWith("f ")) { + final String[] currentLine = line.split(" "); + final String[] vertex1 = currentLine[1].split("/"); + final String[] vertex2 = currentLine[2].split("/"); + final String[] vertex3 = currentLine[3].split("/"); + OBJFileLoader.processVertex(vertex1, vertices, indices); + OBJFileLoader.processVertex(vertex2, vertices, indices); + OBJFileLoader.processVertex(vertex3, vertices, indices); + line = reader.readLine(); + } + reader.close(); + } catch (final IOException e) { + System.err.println("Error reading the file"); + } + OBJFileLoader.removeUnusedVertices(vertices); + final float[] verticesArray = new float[vertices.size() * 3]; + final float[] texturesArray = new float[vertices.size() * 2]; + final float[] normalsArray = new float[vertices.size() * 3]; + final float furthest = OBJFileLoader.convertDataToArrays(vertices, textures, normals, verticesArray, texturesArray, normalsArray); + final int[] indicesArray = OBJFileLoader.convertIndicesListToArray(indices); + final ModelData data = new ModelData(verticesArray, texturesArray, normalsArray, indicesArray, furthest); + return data; + } + + private static void processVertex(final String[] vertex, final List vertices, final List indices) { + final int index = Integer.parseInt(vertex[0]) - 1; + final Vertex currentVertex = vertices.get(index); + final int textureIndex = Integer.parseInt(vertex[1]) - 1; + final int normalIndex = Integer.parseInt(vertex[2]) - 1; + if (!currentVertex.isSet()) { + currentVertex.setTextureIndex(textureIndex); + currentVertex.setNormalIndex(normalIndex); + indices.add(index); + } else { + OBJFileLoader.dealWithAlreadyProcessedVertex(currentVertex, textureIndex, normalIndex, indices, vertices); + } + } + + private static void removeUnusedVertices(final List vertices) { + for (final Vertex vertex : vertices) { + if (!vertex.isSet()) { vertex.setTextureIndex(0); vertex.setNormalIndex(0); } } } - + } \ No newline at end of file diff --git a/src/org/atriasoft/ege/Component.java b/src/org/atriasoft/ege/Component.java index 611e744..e83ef01 100644 --- a/src/org/atriasoft/ege/Component.java +++ b/src/org/atriasoft/ege/Component.java @@ -3,14 +3,14 @@ package org.atriasoft.ege; public abstract class Component { public abstract String getType(); /** - * @brief Evironement notify that a new component is added on the same Element + * Evironement notify that a new component is added on the same Element * @param component New component added */ public void addFriendComponent(Component component) { // nothing to do. } /** - * @brief Evironement notify that a component is removed on the same Element + * Evironement notify that a component is removed on the same Element * @param component Old component removed */ public void removeFriendComponent(Component component) { diff --git a/src/org/atriasoft/ege/ControlCameraPlayer.java b/src/org/atriasoft/ege/ControlCameraPlayer.java index 516f4e2..bf529d2 100644 --- a/src/org/atriasoft/ege/ControlCameraPlayer.java +++ b/src/org/atriasoft/ege/ControlCameraPlayer.java @@ -1,19 +1,19 @@ package org.atriasoft.ege; -import org.atriasoft.etk.math.Transform3D; -import org.atriasoft.etk.math.Vector2f; -import org.atriasoft.etk.math.Vector3f; -import org.atriasoft.ewol.event.EventEntry; -import org.atriasoft.gale.Gale; -import org.atriasoft.gale.event.EventInput; -import org.atriasoft.gale.event.EventTime; -import org.atriasoft.gale.key.KeyKeyboard; -import org.atriasoft.gale.key.KeyStatus; import org.atriasoft.ege.camera.Camera; import org.atriasoft.ege.components.ComponentPhysics; import org.atriasoft.ege.components.ComponentPlayer; import org.atriasoft.ege.components.ComponentPositionPlayer; import org.atriasoft.ege.internal.Log; +import org.atriasoft.etk.math.Transform3D; +import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.etk.math.Vector3f; +import org.atriasoft.gale.Gale; +import org.atriasoft.ewol.event.EventEntry; +import org.atriasoft.ewol.event.EventInput; +import org.atriasoft.ewol.event.EventTime; +import org.atriasoft.gale.key.KeyKeyboard; +import org.atriasoft.gale.key.KeyStatus; public class ControlCameraPlayer implements ControlInterface { private final Camera camera; @@ -52,24 +52,24 @@ public class ControlCameraPlayer implements ControlInterface { @Override public boolean onEventEntry(final EventEntry event) { - if (event.getType() == KeyKeyboard.up || (event.getType() == KeyKeyboard.character && (event.getChar() == 'z' || event.getChar() == 'Z'))) { - this.moveUp = getState(event.getStatus(), this.moveUp); + if (event.type() == KeyKeyboard.up || (event.type() == KeyKeyboard.character && (event.getChar() == 'z' || event.getChar() == 'Z'))) { + this.moveUp = getState(event.status(), this.moveUp); } - if (event.getType() == KeyKeyboard.left || (event.getType() == KeyKeyboard.character && (event.getChar() == 'q' || event.getChar() == 'Q'))) { - this.moveLeft = getState(event.getStatus(), this.moveLeft); + if (event.type() == KeyKeyboard.left || (event.type() == KeyKeyboard.character && (event.getChar() == 'q' || event.getChar() == 'Q'))) { + this.moveLeft = getState(event.status(), this.moveLeft); } - if (event.getType() == KeyKeyboard.right || (event.getType() == KeyKeyboard.character && (event.getChar() == 'd' || event.getChar() == 'D'))) { - this.moveRight = getState(event.getStatus(), this.moveRight); + if (event.type() == KeyKeyboard.right || (event.type() == KeyKeyboard.character && (event.getChar() == 'd' || event.getChar() == 'D'))) { + this.moveRight = getState(event.status(), this.moveRight); } - if (event.getType() == KeyKeyboard.down || (event.getType() == KeyKeyboard.character && (event.getChar() == 's' || event.getChar() == 'S'))) { - this.moveDown = getState(event.getStatus(), this.moveDown); + if (event.type() == KeyKeyboard.down || (event.type() == KeyKeyboard.character && (event.getChar() == 's' || event.getChar() == 'S'))) { + this.moveDown = getState(event.status(), this.moveDown); } - if (event.getType() == KeyKeyboard.shiftLeft || event.getType() == KeyKeyboard.shiftRight) { - this.walk = event.getSpecialKey().getShift(); + if (event.type() == KeyKeyboard.shiftLeft || event.type() == KeyKeyboard.shiftRight) { + this.walk = event.specialKey().getShift(); } - if (event.getType() == KeyKeyboard.f10) { - if (event.getStatus() == KeyStatus.up) { - if (this.fpsMode == false) { + if (event.type() == KeyKeyboard.f10) { + if (event.status() == KeyStatus.up) { + if (!this.fpsMode) { this.fpsMode = true; this.distanceFromCenter = 0; } else { @@ -85,17 +85,17 @@ public class ControlCameraPlayer implements ControlInterface { public boolean onEventInput(final EventInput event, final Vector2f relativePosition) { // Log.info("" + event); // TODO Auto-generated method stub - if (this.fpsMode == false) { - if (event.getInputId() == 4) { - if (event.getStatus() == KeyStatus.down) { + if (!this.fpsMode) { + if (event.inputId() == 4) { + if (event.status() == KeyStatus.down) { this.distanceFromCenter -= 0.2; } if (this.distanceFromCenter < 0.0) { this.distanceFromCenter = 0.0f; } return true; - } else if (event.getInputId() == 5) { - if (event.getStatus() == KeyStatus.down) { + } else if (event.inputId() == 5) { + if (event.status() == KeyStatus.down) { this.distanceFromCenter += 0.2; } if (this.distanceFromCenter < 0.3) { @@ -108,14 +108,14 @@ public class ControlCameraPlayer implements ControlInterface { } // TODO check if grabbing is enable ... // in grabbing mouse only: - if (Gale.getContext().isGrabPointerEvents() == false) { + if (!Gale.getContext().isGrabPointerEvents()) { return false; } - if (event.getStatus() == KeyStatus.move) { - final Vector2f delta = event.getPosition().clone(); + if (event.status() == KeyStatus.move) { + final Vector2f delta = event.pos(); //angleZ += delta.x; //this.camera.setYaw(this.camera.getYaw() + (float)Math.toRadians(delta.x)); - this.camera.setPitch(this.camera.getPitch() + (float) Math.toRadians(delta.y * this.player.getTurnSpeed())); + this.camera.setPitch(this.camera.getPitch() + (float) Math.toRadians(delta.y() * this.player.getTurnSpeed())); if (this.camera.getPitch() > 0) { this.camera.setPitch(0); } @@ -134,8 +134,8 @@ public class ControlCameraPlayer implements ControlInterface { this.playerPosition.setAngles(new Vector3f(0,0,-this.camera.getRoll())); */ if (this.playerPosition != null) { - final float playerZAngle = this.playerPosition.getAngles().z; - float tmpAngle = playerZAngle + (float) Math.toRadians(delta.x * this.player.getTurnSpeed()); + final float playerZAngle = this.playerPosition.getAngles().z(); + float tmpAngle = playerZAngle + (float) Math.toRadians(delta.x() * this.player.getTurnSpeed()); if (tmpAngle > Math.PI) { tmpAngle -= (float) Math.PI * 2.0f; @@ -160,7 +160,7 @@ public class ControlCameraPlayer implements ControlInterface { } float speed = 0; float walkFactor = 1; - if (this.walk == true) { + if (this.walk) { walkFactor = this.player.getWalkFactor(); } //distanceFromCenter = 6; @@ -175,7 +175,7 @@ public class ControlCameraPlayer implements ControlInterface { float playerZAngle = 0; Transform3D playerTransform = null; if (this.playerPosition != null) { - playerZAngle = this.playerPosition.getAngles().z; + playerZAngle = this.playerPosition.getAngles().z(); playerTransform = this.playerPosition.getTransform(); } else if (this.playerPhysics != null) { playerZAngle = 0; // TODO ... @@ -195,8 +195,14 @@ public class ControlCameraPlayer implements ControlInterface { final float dxStraf = (float) (distance * Math.sin((float) Math.PI * 0.5f + playerZAngle)); final float dyStraf = -(float) (distance * Math.cos((float) Math.PI * 0.5f + playerZAngle)); //Log.error("update position ..." + dx + " " + dy); - playerTransform.getPosition().x += dx + dxStraf; - playerTransform.getPosition().y += dy + dyStraf; + Vector3f tmpPos = playerTransform.getPosition(); + tmpPos = tmpPos.add(new Vector3f(dx + dxStraf, dy + dyStraf, 0)); + playerTransform = playerTransform.withPosition(tmpPos); + if (this.playerPosition != null) { + this.playerPosition.setTransform(playerTransform); + } else if (this.playerPhysics != null) { + this.playerPhysics.setTransform(playerTransform); + } // here the camera is behind the player, we need to move the camera ... //Log.info(" pitch: " + Math.toDegrees(this.camera.getPitch()) + " " + Math.toDegrees(playerZAngle)); final float horinzontalDistance = (float) (this.distanceFromCenter * Math.sin(this.camera.getPitch())); @@ -207,9 +213,7 @@ public class ControlCameraPlayer implements ControlInterface { final float offsetX = (float) (tmp * Math.sin(-theta)); final float offsetY = (float) (tmp * Math.cos(-theta)); //Log.info(" res" + offsetX + " " + offsetY); - this.camera.getPosition().x = playerTransform.getPosition().x + offsetX; - this.camera.getPosition().y = playerTransform.getPosition().y + offsetY; - this.camera.getPosition().z = playerTransform.getPosition().z + 1.6f + verticalDistance; + this.camera.setPosition(new Vector3f(playerTransform.getPosition().x() + offsetX, playerTransform.getPosition().y() + offsetY, playerTransform.getPosition().z() + 1.6f + verticalDistance)); } } diff --git a/src/org/atriasoft/ege/ControlCameraPlayerFPS.java b/src/org/atriasoft/ege/ControlCameraPlayerFPS.java index 1cfa201..0a8addd 100644 --- a/src/org/atriasoft/ege/ControlCameraPlayerFPS.java +++ b/src/org/atriasoft/ege/ControlCameraPlayerFPS.java @@ -1,21 +1,17 @@ package org.atriasoft.ege; +import org.atriasoft.ege.camera.Camera; +import org.atriasoft.ege.components.ComponentPlayer; +import org.atriasoft.ege.components.ComponentPositionPlayer; +import org.atriasoft.ege.internal.Log; import org.atriasoft.etk.math.Vector2f; import org.atriasoft.etk.math.Vector3f; import org.atriasoft.ewol.event.EventEntry; +import org.atriasoft.ewol.event.EventInput; +import org.atriasoft.ewol.event.EventTime; import org.atriasoft.gale.Gale; -import org.atriasoft.gale.event.EventInput; -import org.atriasoft.gale.event.EventTime; import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeyStatus; -import org.atriasoft.ege.internal.Log; -import org.atriasoft.ege.camera.Camera; -import org.atriasoft.ege.components.ComponentPlayer; -import org.atriasoft.ege.components.ComponentPosition; -import org.atriasoft.ege.components.ComponentPositionPlayer; - -import renderEngine.DisplayManager; - public class ControlCameraPlayerFPS implements ControlInterface { private Camera camera; @@ -26,14 +22,15 @@ public class ControlCameraPlayerFPS implements ControlInterface { private boolean moveDown = false; private boolean moveLeft = false; private boolean moveRight = false; - - public ControlCameraPlayerFPS(Camera camera, Entity playerEntity) { + + public ControlCameraPlayerFPS(final Camera camera, final Entity playerEntity) { this.camera = camera; this.playerEntity = playerEntity; - this.playerPosition = (ComponentPositionPlayer)this.playerEntity.getComponent("position"); - this.player = (ComponentPlayer)this.playerEntity.getComponent("player"); + this.playerPosition = (ComponentPositionPlayer) this.playerEntity.getComponent("position"); + this.player = (ComponentPlayer) this.playerEntity.getComponent("player"); } - private boolean getState(KeyStatus state, boolean previousState) { + + private boolean getState(final KeyStatus state, final boolean previousState) { if (state == KeyStatus.down) { return true; } @@ -42,88 +39,82 @@ public class ControlCameraPlayerFPS implements ControlInterface { } return previousState; } + @Override - public boolean onEventEntry(EventEntry event) { - if(event.getType() == KeyKeyboard.up - || (event.getType() == KeyKeyboard.character && (event.getChar() == 'z' || event.getChar() == 'z' ))) { - moveUp = getState(event.getStatus(), moveUp); + public boolean onEventEntry(final EventEntry event) { + if (event.type() == KeyKeyboard.up || (event.type() == KeyKeyboard.character && (event.getChar() == 'z' || event.getChar() == 'Z'))) { + this.moveUp = getState(event.status(), this.moveUp); } - if(event.getType() == KeyKeyboard.left - || (event.getType() == KeyKeyboard.character && (event.getChar() == 'q' || event.getChar() == 'Q' ))) { - moveLeft = getState(event.getStatus(), moveLeft); + if (event.type() == KeyKeyboard.left || (event.type() == KeyKeyboard.character && (event.getChar() == 'q' || event.getChar() == 'Q'))) { + this.moveLeft = getState(event.status(), this.moveLeft); } - if(event.getType() == KeyKeyboard.right - || (event.getType() == KeyKeyboard.character && (event.getChar() == 'd' || event.getChar() == 'D' ))) { - moveRight = getState(event.getStatus(), moveRight); + if (event.type() == KeyKeyboard.right || (event.type() == KeyKeyboard.character && (event.getChar() == 'd' || event.getChar() == 'D'))) { + this.moveRight = getState(event.status(), this.moveRight); } - if(event.getType() == KeyKeyboard.down - || (event.getType() == KeyKeyboard.character && (event.getChar() == 's' || event.getChar() == 'S' ))) { - moveDown = getState(event.getStatus(), moveDown); + if (event.type() == KeyKeyboard.down || (event.type() == KeyKeyboard.character && (event.getChar() == 's' || event.getChar() == 'S'))) { + this.moveDown = getState(event.status(), this.moveDown); } return false; } - + @Override - public boolean onEventInput(EventInput event, Vector2f relativePosition) { + public boolean onEventInput(final EventInput event, final Vector2f relativePosition) { // Log.info("" + event); // in grabbing mouse only: - if (Gale.getContext().isGrabPointerEvents() == false) { + if (!Gale.getContext().isGrabPointerEvents()) { return false; } - if (event.getStatus() == KeyStatus.move) { - Vector2f delta = event.getPosition().clone(); + if (event.status() == KeyStatus.move) { + Vector2f delta = event.pos(); //angleZ += delta.x; //this.camera.setYaw(this.camera.getYaw() + (float)Math.toRadians(delta.x)); - this.camera.setPitch(this.camera.getPitch() + (float)Math.toRadians(delta.y * this.player.getTurnSpeed())); - if (this.camera.getPitch()>0) { + this.camera.setPitch(this.camera.getPitch() + (float) Math.toRadians(delta.y() * this.player.getTurnSpeed())); + if (this.camera.getPitch() > 0) { this.camera.setPitch(0); } - if (this.camera.getPitch()<-Math.PI) { - this.camera.setPitch((float)-Math.PI); + if (this.camera.getPitch() < -Math.PI) { + this.camera.setPitch((float) -Math.PI); } - this.camera.setRoll(this.camera.getRoll() - (float)Math.toRadians(delta.x * this.player.getTurnSpeed())); + this.camera.setRoll(this.camera.getRoll() - (float) Math.toRadians(delta.x() * this.player.getTurnSpeed())); Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch()); - if (this.camera.getRoll()>Math.PI) { - this.camera.setRoll(this.camera.getRoll()-(float)Math.PI*2.0f); + if (this.camera.getRoll() > Math.PI) { + this.camera.setRoll(this.camera.getRoll() - (float) Math.PI * 2.0f); } - if (this.camera.getRoll()<-Math.PI) { - this.camera.setRoll(this.camera.getRoll()+(float)Math.PI*2.0f); + if (this.camera.getRoll() < -Math.PI) { + this.camera.setRoll(this.camera.getRoll() + (float) Math.PI * 2.0f); } - this.playerPosition.setAngles(new Vector3f(0,0,this.camera.getRoll())); + this.playerPosition.setAngles(new Vector3f(0, 0, this.camera.getRoll())); } return false; } - + @Override - public void periodicCall(EventTime event) { + public void periodicCall(final EventTime event) { float speed = 0; - if (moveUp != moveDown) { - if (moveUp) { + if (this.moveUp != this.moveDown) { + if (this.moveUp) { speed = this.player.getRunSpeed(); } else { speed = -this.player.getRunSpeed(); } } float distance = speed * event.getTimeDeltaCallSecond(); - float dx = (float) (distance * Math.sin(this.playerPosition.getAngles().z)); - float dy = (float) (distance * Math.cos(this.playerPosition.getAngles().z)); + float dx = (float) (distance * Math.sin(this.playerPosition.getAngles().z())); + float dy = (float) (distance * Math.cos(this.playerPosition.getAngles().z())); speed = 0; - if (moveRight != moveLeft) { - if (moveRight) { + if (this.moveRight != this.moveLeft) { + if (this.moveRight) { speed = this.player.getStrafSpeed(); } else { speed = -this.player.getStrafSpeed(); } } distance = speed * event.getTimeDeltaCallSecond(); - float dxStraf = (float) (distance * Math.sin((float)Math.PI*0.5f + this.playerPosition.getAngles().z)); - float dyStraf = (float) (distance * Math.cos((float)Math.PI*0.5f + this.playerPosition.getAngles().z)); + float dxStraf = (float) (distance * Math.sin((float) Math.PI * 0.5f + this.playerPosition.getAngles().z())); + float dyStraf = (float) (distance * Math.cos((float) Math.PI * 0.5f + this.playerPosition.getAngles().z())); //Log.error("update position ..." + dx + " " + dy); - this.playerPosition.getTransform().getPosition().x += dx + dxStraf; - this.playerPosition.getTransform().getPosition().y += dy + dyStraf; - this.camera.getPosition().x = this.playerPosition.getTransform().getPosition().x; - this.camera.getPosition().y = this.playerPosition.getTransform().getPosition().y; - this.camera.getPosition().z = this.playerPosition.getTransform().getPosition().z; + this.playerPosition.setTransform(this.playerPosition.getTransform().withPosition(this.playerPosition.getTransform().getPosition().add(dx + dxStraf, dy + dyStraf, 0))); + this.camera.setPosition(this.playerPosition.getTransform().getPosition()); } - + } diff --git a/src/org/atriasoft/ege/ControlCameraSimple.java b/src/org/atriasoft/ege/ControlCameraSimple.java index 2c611b9..4f8c761 100644 --- a/src/org/atriasoft/ege/ControlCameraSimple.java +++ b/src/org/atriasoft/ege/ControlCameraSimple.java @@ -1,17 +1,17 @@ package org.atriasoft.ege; +import org.atriasoft.ege.camera.Camera; +import org.atriasoft.ege.internal.Log; import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.etk.math.Vector3f; import org.atriasoft.ewol.event.EventEntry; -import org.atriasoft.gale.event.EventInput; -import org.atriasoft.gale.event.EventTime; +import org.atriasoft.ewol.event.EventInput; +import org.atriasoft.ewol.event.EventTime; import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeyStatus; -import org.atriasoft.ege.internal.Log; -import org.atriasoft.ege.camera.Camera; - public class ControlCameraSimple implements ControlInterface { - private Camera camera; + private final Camera camera; private float distanceFromCenter = 20; private float angleZ = 0; private float pitch = 0; @@ -21,11 +21,12 @@ public class ControlCameraSimple implements ControlInterface { private boolean moveRight = false; private boolean moveDown = false; private boolean ctrlIsSet = false; - - public ControlCameraSimple(Camera camera) { + + public ControlCameraSimple(final Camera camera) { this.camera = camera; } - private boolean getState(KeyStatus state, boolean previousState) { + + private boolean getState(final KeyStatus state, final boolean previousState) { if (state == KeyStatus.down) { return true; } @@ -34,93 +35,91 @@ public class ControlCameraSimple implements ControlInterface { } return previousState; } + @Override - public boolean onEventEntry(EventEntry event) { - if(event.getType() == KeyKeyboard.up) { - moveUp = getState(event.getStatus(), moveUp); + public boolean onEventEntry(final EventEntry event) { + if (event.type() == KeyKeyboard.up) { + this.moveUp = getState(event.status(), this.moveUp); } - if(event.getType() == KeyKeyboard.left) { - moveLeft = getState(event.getStatus(), moveLeft); + if (event.type() == KeyKeyboard.left) { + this.moveLeft = getState(event.status(), this.moveLeft); } - if(event.getSpecialKey().getCtrl() == false - && event.getType() == KeyKeyboard.right) { - moveRight = getState(event.getStatus(), moveRight); + if (!event.specialKey().getCtrl() && event.type() == KeyKeyboard.right) { + this.moveRight = getState(event.status(), this.moveRight); } - if(event.getSpecialKey().getCtrl() == false - && event.getType() == KeyKeyboard.down) { - moveDown = getState(event.getStatus(), moveDown); + if (!event.specialKey().getCtrl() && event.type() == KeyKeyboard.down) { + this.moveDown = getState(event.status(), this.moveDown); } - ctrlIsSet = event.getSpecialKey().getCtrl(); + this.ctrlIsSet = event.specialKey().getCtrl(); return false; } - + @Override - public boolean onEventInput(EventInput event, Vector2f relativePosition) { + public boolean onEventInput(final EventInput event, final Vector2f relativePosition) { Log.info("" + event); // TODO Auto-generated method stub - if (event.getInputId() == 4) { - if (event.getStatus() == KeyStatus.down) { - distanceFromCenter -= 1; + if (event.inputId() == 4) { + if (event.status() == KeyStatus.down) { + this.distanceFromCenter -= 1; } - } else if (event.getInputId() == 5) { - if (event.getStatus() == KeyStatus.down) { - distanceFromCenter += 1; + } else if (event.inputId() == 5) { + if (event.status() == KeyStatus.down) { + this.distanceFromCenter += 1; } - } else if (event.getInputId() == 2) { - if (event.getStatus() == KeyStatus.down) { - lastMousePosition = event.getPosition(); - } else if (event.getStatus() == KeyStatus.move) { - Vector2f delta = event.getPosition().clone(); - delta.less(lastMousePosition); - lastMousePosition = event.getPosition().clone(); + } else if (event.inputId() == 2) { + if (event.status() == KeyStatus.down) { + this.lastMousePosition = event.pos(); + } else if (event.status() == KeyStatus.move) { + Vector2f delta = event.pos(); + delta = delta.less(this.lastMousePosition); + this.lastMousePosition = event.pos(); //angleZ += delta.x; //this.camera.setYaw(this.camera.getYaw() + (float)Math.toRadians(delta.x)); - this.camera.setPitch(this.camera.getPitch() - (float)Math.toRadians(delta.y)); - if (this.camera.getPitch()>0) { + this.camera.setPitch(this.camera.getPitch() - (float) Math.toRadians(delta.y())); + if (this.camera.getPitch() > 0) { this.camera.setPitch(0); } - if (this.camera.getPitch()<-Math.PI) { - this.camera.setPitch((float)-Math.PI); + if (this.camera.getPitch() < -Math.PI) { + this.camera.setPitch((float) -Math.PI); } - this.camera.setRoll(this.camera.getRoll() + (float)Math.toRadians(delta.x)); + this.camera.setRoll(this.camera.getRoll() + (float) Math.toRadians(delta.x())); Log.info("Change camera: " + this.camera.getYaw() + " " + this.camera.getPitch()); - if (this.camera.getRoll()>Math.PI) { - this.camera.setRoll(this.camera.getRoll()-(float)Math.PI*2.0f); + if (this.camera.getRoll() > Math.PI) { + this.camera.setRoll(this.camera.getRoll() - (float) Math.PI * 2.0f); } - if (this.camera.getRoll()<-Math.PI) { - this.camera.setRoll(this.camera.getRoll()+(float)Math.PI*2.0f); + if (this.camera.getRoll() < -Math.PI) { + this.camera.setRoll(this.camera.getRoll() + (float) Math.PI * 2.0f); } } } return false; } - + @Override - public void periodicCall(EventTime event) { - if (moveLeft != moveRight) { - if (moveRight) { - camera.getPosition().x += 0.1; + public void periodicCall(final EventTime event) { + if (this.moveLeft != this.moveRight) { + if (this.moveRight) { + this.camera.setPosition(this.camera.getPosition().add(new Vector3f(0.1f, 0, 0))); } else { - camera.getPosition().x -= 0.1; + this.camera.setPosition(this.camera.getPosition().add(new Vector3f(-0.1f, 0, 0))); } } - if (ctrlIsSet == false) { - if (moveUp != moveDown) { - if (moveUp) { - camera.getPosition().y += 0.1; + if (!this.ctrlIsSet) { + if (this.moveUp != this.moveDown) { + if (this.moveUp) { + this.camera.setPosition(this.camera.getPosition().add(new Vector3f(0, 0.1f, 0))); } else { - camera.getPosition().y -= 0.1; + this.camera.setPosition(this.camera.getPosition().add(new Vector3f(0, -0.1f, 0))); } } - } else { - if (moveUp != moveDown) { - if (moveUp) { - camera.getPosition().z += 0.1; - } else { - camera.getPosition().z -= 0.1; - } + } else if (this.moveUp != this.moveDown) { + if (this.moveUp) { + + this.camera.setPosition(this.camera.getPosition().add(new Vector3f(0, 0, 0.1f))); + } else { + this.camera.setPosition(this.camera.getPosition().add(new Vector3f(0, 0, -0.1f))); } } } - + } diff --git a/src/org/atriasoft/ege/ControlInterface.java b/src/org/atriasoft/ege/ControlInterface.java index 0d904a3..62c25a6 100644 --- a/src/org/atriasoft/ege/ControlInterface.java +++ b/src/org/atriasoft/ege/ControlInterface.java @@ -2,15 +2,17 @@ package org.atriasoft.ege; import org.atriasoft.etk.math.Vector2f; import org.atriasoft.ewol.event.EventEntry; -import org.atriasoft.gale.event.EventInput; -import org.atriasoft.gale.event.EventTime; +import org.atriasoft.ewol.event.EventInput; +import org.atriasoft.ewol.event.EventTime; public interface ControlInterface { - public boolean onEventEntry(EventEntry event); - public boolean onEventInput(EventInput event, Vector2f relativePosition); + boolean onEventEntry(EventEntry event); + + boolean onEventInput(EventInput event, Vector2f relativePosition); + /** - * @brief Periodic call to update grapgic display + * Periodic call to update grapgic display * @param event Time generic event */ - public void periodicCall(EventTime event); + void periodicCall(EventTime event); } diff --git a/src/org/atriasoft/ege/Ege.java b/src/org/atriasoft/ege/Ege.java new file mode 100644 index 0000000..1d6a9af --- /dev/null +++ b/src/org/atriasoft/ege/Ege.java @@ -0,0 +1,11 @@ +package org.atriasoft.ege; + +import org.atriasoft.etk.Uri; + +public class Ege { + public static void init() { + Uri.addLibrary("ege", Ege.class, "/resources/ege/"); + } + + private Ege() {} +} diff --git a/src/org/atriasoft/ege/Engine.java b/src/org/atriasoft/ege/Engine.java index b64371a..c75e818 100644 --- a/src/org/atriasoft/ege/Engine.java +++ b/src/org/atriasoft/ege/Engine.java @@ -8,28 +8,28 @@ public abstract class Engine { this.env = env; } /** - * @brief An Entity component has been removed ==> need remove it in local if needed + * An Entity component has been removed ==> need remove it in local if needed * @param ref Referrence on the component */ public abstract void componentRemove(Component ref); /** - * @brief An Entity component has been added ==> need add it in local if needed + * An Entity component has been added ==> need add it in local if needed * @param ref Referrence on the component */ public abstract void componentAdd(Component ref); /** - * @brief Global game engine main cycle of update internal parameters + * Global game engine main cycle of update internal parameters * @param deltaMili time from the last update */ public abstract void update(long deltaMili); /** - * @brief Global game engine main cycle of draw + * Global game engine main cycle of draw * @param deltaMili time from the last render * @param camera Camera property to render the engine properties ... */ public abstract void render(long deltaMili, Camera camera); /** - * @brief Globalgame engine main cycle of draw + * Globalgame engine main cycle of draw * @param deltaMili time from the last render * @param camera Camera property to render the engine properties ... */ diff --git a/src/org/atriasoft/ege/Entity.java b/src/org/atriasoft/ege/Entity.java index 6ec972c..ae07187 100644 --- a/src/org/atriasoft/ege/Entity.java +++ b/src/org/atriasoft/ege/Entity.java @@ -19,7 +19,7 @@ public class Entity { protected float radius = 0; //!< Radius of the Entity (all Entity have a radius, if == 0 ==> then ghost ... /** - * @brief Constructor (when ructer is called just add Entity that did not change. + * Constructor (when ructer is called just add Entity that did not change. * The objest will be stored in a pool of Entity and keep a second time if needed == > reduce memory allocation, * when needed, the system will call the init and un-init function... */ @@ -45,17 +45,17 @@ public class Entity { } /** - * @brief remove this Entity from the physique engine + * remove this Entity from the physique engine */ public void dynamicDisable() {} /** - * @brief set the elment in the physique engine + * set the elment in the physique engine */ public void dynamicEnable() {} /** - * @brief Debug display of the current Entity + * Debug display of the current Entity * @param[in,out] draw Basic system to draw the debug shape and informations * @param camera Current camera for display */ @@ -78,7 +78,7 @@ public class Entity { // */ // } /** - * @brief Event arrive when an Entity has been remove from the system == > this permit to keep pointer of ennemy, and not search them every cycle ... + * Event arrive when an Entity has been remove from the system == > this permit to keep pointer of ennemy, and not search them every cycle ... * @param removedEntity Pointer on the Entity removed. */ public void entityIsRemoved(final Entity removedEntity) {}; @@ -109,7 +109,7 @@ public class Entity { } /** - * @brief get the Group of the Entity. + * get the Group of the Entity. * @return The group ID */ public int getGroup() { @@ -117,7 +117,7 @@ public class Entity { } /** - * @brief get the curent life ratio [0..1] + * get the curent life ratio [0..1] * @return The proportionnal life */ public float getLifeRatio() { @@ -128,7 +128,7 @@ public class Entity { }; /** - * @brief get the current space needed by the Entity in the workspace + * get the current space needed by the Entity in the workspace * @return The dimention needed. */ public float getRadius() { @@ -136,7 +136,7 @@ public class Entity { } /** - * @brief get the curent Entity Unique ID in the all Game. + * get the curent Entity Unique ID in the all Game. * @return The requested Unique ID. */ public int getUID() { @@ -144,7 +144,7 @@ public class Entity { } /** - * @brief init the Entity with the defined properties + * init the Entity with the defined properties * @param property Type of the next Entity * @param value pointer on the value type * @return true, the Entity is corectly initialized. @@ -203,7 +203,7 @@ public class Entity { } /* - * @brief Check if the Entity is dead. + * Check if the Entity is dead. * @return true if the Entity does not exist anymore, false otherwise. */ public boolean isDead() { @@ -211,7 +211,7 @@ public class Entity { }; /** - * @brief Request if the Entity might be removed from the system + * Request if the Entity might be removed from the system * @return true == > the object is removed */ public boolean needToRemove() { @@ -224,7 +224,7 @@ public class Entity { public void onDestroy() {}; /** - * @brief Call when the Entity life change. + * Call when the Entity life change. */ public void onLifeChange() {} @@ -266,7 +266,7 @@ public class Entity { }; /** - * @brief apply a fire on the Entity at a current power and a specific power. + * apply a fire on the Entity at a current power and a specific power. * @param groupIdSource Source Id of the group, by default all event arrive at all group, buf some event can not be obviously apply at the ennemy like reparing .... * @param type Type of event on the life propertied * @param power Power of the event (can be >0 for adding life). @@ -285,7 +285,7 @@ public class Entity { }; /** - * @brief set the group of the curent Entity + * set the group of the curent Entity * @param newGroup The new Group ID of the Entity. */ public void setGroup(final int newGroup) { diff --git a/src/org/atriasoft/ege/Environement.java b/src/org/atriasoft/ege/Environement.java index 987cc6f..933f8b9 100644 --- a/src/org/atriasoft/ege/Environement.java +++ b/src/org/atriasoft/ege/Environement.java @@ -5,15 +5,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.atriasoft.etk.math.Vector2f; -import org.atriasoft.ewol.event.EventEntry; -import org.atriasoft.gale.backend3d.OpenGL; -import org.atriasoft.gale.event.EventInput; -import org.atriasoft.gale.event.EventTime; -import org.atriasoft.gale.key.KeyKeyboard; -import org.atriasoft.gale.key.KeySpecial; -import org.atriasoft.gale.key.KeyStatus; -import org.atriasoft.gale.key.KeyType; +import org.atriasoft.echrono.Clock; import org.atriasoft.ege.camera.Camera; import org.atriasoft.ege.engines.EngineAI; import org.atriasoft.ege.engines.EngineDynamicMeshs; @@ -25,12 +17,21 @@ import org.atriasoft.ege.engines.EnginePlayer; import org.atriasoft.ege.engines.EngineRender; import org.atriasoft.ege.internal.Log; //import org.atriasoft.ege.resource.Mesh; +import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.ewol.event.EventEntry; +import org.atriasoft.ewol.event.EventInput; +import org.atriasoft.ewol.event.EventTime; +import org.atriasoft.gale.backend3d.OpenGL; +import org.atriasoft.gale.key.KeyKeyboard; +import org.atriasoft.gale.key.KeySpecial; +import org.atriasoft.gale.key.KeyStatus; +import org.atriasoft.gale.key.KeyType; public class Environement { - private static Map creators = new HashMap(); + private static Map creators = new HashMap<>(); /** - * @brief add a creator entity system + * add a creator entity system * @param type Type of the entity. * @param creator Function pointer that reference the entity creating. */ @@ -45,21 +46,21 @@ public class Environement { } - public Signal signalPlayTimeChange = new Signal(); + public Signal signalPlayTimeChange = new Signal<>(); private GameStatus propertyStatus = GameStatus.gameStop; // !< the display is running (not in pause) public float propertyRatio = 1.0f; // !< Speed ratio - protected List engines = new ArrayList(); // !< EGE sub engine interface (like physique, rendering, + protected List engines = new ArrayList<>(); // !< EGE sub engine interface (like physique, rendering, // audio, ...). - private final List listEntity = new ArrayList(); // !< List of all entity added in the Game + private final List listEntity = new ArrayList<>(); // !< List of all entity added in the Game - List controls = new ArrayList(); - long lastCallTime = 0; + List controls = new ArrayList<>(); + Clock lastCallTime; // ! list of all camera in the world - protected Map listCamera = new HashMap(); + protected Map listCamera = new HashMap<>(); protected long gameTime = 0; // !< time of the game running - private long startTime; + Clock startTime; //protected List listMeshToDrawFirst = new ArrayList(); public Environement() { @@ -74,7 +75,7 @@ public class Environement { } /** - * @brief Add a camera in the camera pool. + * Add a camera in the camera pool. * @param name Name of the camera. * @param camera Pointer on the camera to add. */ @@ -103,7 +104,7 @@ public class Environement { } /** - * @brief add an entity on the list availlable. + * add an entity on the list availlable. * @param newEntity Entity to add. */ public void addEntity(final Entity newEntity) { @@ -116,7 +117,7 @@ public class Environement { } /** - * @brief Remove all from the current environement + * Remove all from the current environement */ public void clear() { this.listEntity.clear(); @@ -127,7 +128,7 @@ public class Environement { } /** - * @brief Create an entity on the curent scene. + * Create an entity on the curent scene. * @param type Type of the entity that might be created. * @param description String that describe the content of the entity * properties. @@ -178,7 +179,7 @@ public class Environement { } /** - * @brief generate an event on all the sub entity of the game == > usefull for + * generate an event on all the sub entity of the game == > usefull for * explosion, or lazer fire ... * @param event event that might be apply ... */ @@ -271,7 +272,7 @@ public class Environement { // } /** - * @brief Get a specific camera. + * Get a specific camera. * @param name Name of the camera. * @return A pointer on the camera requested. */ @@ -280,7 +281,7 @@ public class Environement { } /** - * @brief Get List of all camera. + * Get List of all camera. * @return All the camera registerred. */ public Map getCameraList() { @@ -324,18 +325,18 @@ public class Environement { } public void periodicCall() { - if (this.lastCallTime == 0) { - this.startTime = System.nanoTime() / 1000; + if (this.lastCallTime == null) { + this.startTime = Clock.now(); this.lastCallTime = this.startTime; } - final long lastUpdate = this.lastCallTime; - this.lastCallTime = System.nanoTime() / 1000; - final EventTime event = new EventTime(this.lastCallTime, this.lastCallTime - this.startTime, this.lastCallTime - lastUpdate, this.lastCallTime - lastUpdate); + final Clock lastUpdate = this.lastCallTime; + this.lastCallTime = Clock.now(); + final EventTime event = new EventTime(this.lastCallTime, this.startTime, this.lastCallTime.less(lastUpdate), this.lastCallTime.less(lastUpdate)); for (final ControlInterface elem : this.controls) { elem.periodicCall(event); } for (final Engine engine : this.engines) { - engine.update((this.lastCallTime - lastUpdate) / 100); + engine.update(this.lastCallTime.less(lastUpdate).get() / 100); } }; @@ -388,7 +389,7 @@ public class Environement { } /** - * @brief remove an entity on the list availlable. + * remove an entity on the list availlable. * @param removeEntity Entity to remove. */ public void rmEntity(final Entity removeEntity) { diff --git a/src/org/atriasoft/ege/camera/Camera.java b/src/org/atriasoft/ege/camera/Camera.java index e96bdb3..2c53ba3 100644 --- a/src/org/atriasoft/ege/camera/Camera.java +++ b/src/org/atriasoft/ege/camera/Camera.java @@ -7,7 +7,7 @@ import org.atriasoft.etk.math.Vector3f; //import renderEngine.DisplayManager; public class Camera { - private Vector3f position = new Vector3f(0,0,2); + private Vector3f position = new Vector3f(0, 0, 2); private float pitch = 0; private float yaw = 0; private float roll = 0; @@ -15,43 +15,46 @@ public class Camera { public Camera() { } - + public Matrix4f getConvertionMatrix() { - Matrix4f matrix = new Matrix4f(); - matrix.setIdentity(); - matrix.rotate(new Vector3f(1,0,0), getPitch()); - matrix.rotate(new Vector3f(0,1,0), getYaw()); - matrix.rotate(new Vector3f(0,0,1), getRoll()); - matrix.translate(new Vector3f(-position.x,-position.y,-position.z)); + Matrix4f matrix = Matrix4f.IDENTITY; + matrix = matrix.rotate(new Vector3f(1, 0, 0), getPitch()); + matrix = matrix.rotate(new Vector3f(0, 1, 0), getYaw()); + matrix = matrix.rotate(new Vector3f(0, 0, 1), getRoll()); + matrix = matrix.translate(new Vector3f(-this.position.x(), -this.position.y(), -this.position.z())); return matrix; } - public Vector3f getPosition() { - return position; - } - public void setPosition(Vector3f position) { - this.position = position; - } - + public float getPitch() { - return pitch; + return this.pitch; } - - public void setPitch(float pitch) { + + public Vector3f getPosition() { + return this.position; + } + + public float getRoll() { + return this.roll; + } + + public float getYaw() { + return this.yaw; + } + + public void setPitch(final float pitch) { this.pitch = pitch; } - - public float getYaw() { - return yaw; + + public void setPosition(final Vector3f position) { + this.position = position; } - public void setYaw(float yaw) { - this.yaw = yaw; - } - - public float getRoll() { - return roll; - } - public void setRoll(float roll) { + + public void setRoll(final float roll) { this.roll = roll; } + public void setYaw(final float yaw) { + this.yaw = yaw; + } + } diff --git a/src/org/atriasoft/ege/components/ComponentLight.java b/src/org/atriasoft/ege/components/ComponentLight.java index 2a7c6de..342c0e5 100644 --- a/src/org/atriasoft/ege/components/ComponentLight.java +++ b/src/org/atriasoft/ege/components/ComponentLight.java @@ -36,9 +36,9 @@ public class ComponentLight extends Component { public Vector3f getPosition() { if (this.position != null) { - return this.position.getTransform().getPosition().clone().add(this.light.getPositionDelta()); + return this.position.getTransform().getPosition().add(this.light.getPositionDelta()); } else if (this.playerPhysics != null) { - return this.playerPhysics.getTransform().getPosition().clone().add(this.light.getPositionDelta()); + return this.playerPhysics.getTransform().getPosition().add(this.light.getPositionDelta()); } return null; } diff --git a/src/org/atriasoft/ege/components/ComponentPhysics.java b/src/org/atriasoft/ege/components/ComponentPhysics.java index 73faa13..f2b95bd 100644 --- a/src/org/atriasoft/ege/components/ComponentPhysics.java +++ b/src/org/atriasoft/ege/components/ComponentPhysics.java @@ -6,6 +6,17 @@ import java.util.List; import org.atriasoft.ege.Component; import org.atriasoft.ege.Environement; import org.atriasoft.ege.Signal; +import org.atriasoft.ege.camera.Camera; +import org.atriasoft.ege.engines.EnginePhysics; +import org.atriasoft.ege.internal.Log; +import org.atriasoft.ege.physics.shape.Box; +import org.atriasoft.ege.physics.shape.Capsule; +import org.atriasoft.ege.physics.shape.Concave; +import org.atriasoft.ege.physics.shape.Cone; +import org.atriasoft.ege.physics.shape.ConvexHull; +import org.atriasoft.ege.physics.shape.Cylinder; +import org.atriasoft.ege.physics.shape.Shape; +import org.atriasoft.ege.physics.shape.Sphere; import org.atriasoft.ephysics.body.BodyType; import org.atriasoft.ephysics.body.RigidBody; import org.atriasoft.ephysics.collision.ProxyShape; @@ -26,17 +37,6 @@ import org.atriasoft.etk.math.Quaternion; import org.atriasoft.etk.math.Transform3D; import org.atriasoft.etk.math.Vector3f; import org.atriasoft.gale.resource.ResourceColored3DObject; -import org.atriasoft.ege.camera.Camera; -import org.atriasoft.ege.engines.EnginePhysics; -import org.atriasoft.ege.internal.Log; -import org.atriasoft.ege.physics.shape.Box; -import org.atriasoft.ege.physics.shape.Capsule; -import org.atriasoft.ege.physics.shape.Concave; -import org.atriasoft.ege.physics.shape.Cone; -import org.atriasoft.ege.physics.shape.ConvexHull; -import org.atriasoft.ege.physics.shape.Cylinder; -import org.atriasoft.ege.physics.shape.Shape; -import org.atriasoft.ege.physics.shape.Sphere; public class ComponentPhysics extends Component { public Signal signalPosition = new Signal<>();; @@ -53,12 +53,12 @@ public class ComponentPhysics extends Component { protected List shape = new ArrayList<>(); //!< collision shape module ... (independent of bullet lib) /** - * @brief Create a basic position component (no orientation and position (0,0,0)) + * Create a basic position component (no orientation and position (0,0,0)) */ public ComponentPhysics(final Environement _env) { this.engine = (EnginePhysics) _env.getEngine(getType()); // Initial position and orientation of the rigid body - this.lastTransformEmit = new Transform3D(new Vector3f(0, 0, 0), Quaternion.identity()); + this.lastTransformEmit = new Transform3D(new Vector3f(0, 0, 0), Quaternion.IDENTITY); this.rigidBody = this.engine.getDynamicsWorld().createRigidBody(this.lastTransformEmit); this.rigidBody.setUserData(this); // set collision callback: @@ -71,8 +71,8 @@ public class ComponentPhysics extends Component { } /** - * @brief Create a basic position component - * @param[in] _transform transformation of the position + * Create a basic position component + * @param _transform transformation of the position */ public ComponentPhysics(final Environement _env, final Transform3D _transform) { this.engine = (EnginePhysics) _env.getEngine(getType()); @@ -106,12 +106,12 @@ public class ComponentPhysics extends Component { } /** - * @brief Apply an external force to the body at a given point (in world-space coordinates). - * If the point is not at the center of mass of the body, it will also generate some torque and therefore, change the angular velocity of the body. - * If the body is sleeping, calling this method will wake it up. Note that the force will we added to the sum of the applied forces and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. - * @param[in] _force The force to apply on the body - * @param[in] _point The point where the force is applied (in world-space coordinates) - */ + * Apply an external force to the body at a given point (in world-space coordinates). + * If the point is not at the center of mass of the body, it will also generate some torque and therefore, change the angular velocity of the body. + * If the body is sleeping, calling this method will wake it up. Note that the force will we added to the sum of the applied forces and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. + * @param _force The force to apply on the body + * @param _point The point where the force is applied (in world-space coordinates) + */ public void applyForce(final Vector3f _force, final Vector3f _point) { if (this.rigidBody == null) { return; @@ -120,12 +120,11 @@ public class ComponentPhysics extends Component { } /** - * @brief Apply an external force to the body at its center of mass. - * If the body is sleeping, calling this method will wake it up. - * @note The force will we added to the sum of the applied forces and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. - * @param[in] _force The external force to apply on the center of mass of the body - * @param[in] _static The torque will be apply while the user des not call the same function with 0 value ... - */ + * Apply an external force to the body at its center of mass. + * If the body is sleeping, calling this method will wake it up. + * @note The force will we added to the sum of the applied forces and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. + * @param _force The external force to apply on the center of mass of the body + */ public void applyForceToCenterOfMass(final Vector3f _force) { if (this.rigidBody == null) { return; @@ -141,12 +140,11 @@ public class ComponentPhysics extends Component { } /** - * @brief Apply an external force to the body at its center of mass. + * Apply an external force to the body at its center of mass. * If the body is sleeping, calling this method will wake it up. * @note The force is apply with a relative axis of the object * @note The force will we added to the sum of the applied forces and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. - * @param[in] _force The external force to apply on the center of mass of the body - * @param[in] _static The torque will be apply while the user des not call the same function with 0 value ... + * @param _force The external force to apply on the center of mass of the body */ public void applyRelativeForceToCenterOfMass(final Vector3f _force) { if (this.rigidBody == null) { @@ -160,18 +158,16 @@ public class ComponentPhysics extends Component { if (this.rigidBody == null) { return; } - final Vector3f force = this.rigidBody.getTransform().getOrientation().multiply(_force); - this.staticForceApplyCenterOfMass = force; + this.staticForceApplyCenterOfMass = this.rigidBody.getTransform().getOrientation().multiply(_force); } /** - * @brief Apply an external torque to the body. + * Apply an external torque to the body. * If the body is sleeping, calling this method will wake it up. * @note The torque is apply with a relative axis of the object * @note The force will we added to the sum of the applied torques and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. - * @param[in] _torque The external torque to apply on the body - * @param[in] _static The torque will be apply while the user des not call the same function with 0 value ... + * @param _torque The external torque to apply on the body */ public void applyRelativeTorque(final Vector3f _torque) { if (this.rigidBody == null) { @@ -185,16 +181,14 @@ public class ComponentPhysics extends Component { if (this.rigidBody == null) { return; } - final Vector3f torque = this.rigidBody.getTransform().getOrientation().multiply(_torque); - this.staticTorqueApply = torque; + this.staticTorqueApply = this.rigidBody.getTransform().getOrientation().multiply(_torque); } /** - * @brief Apply an external torque to the body. + * Apply an external torque to the body. * If the body is sleeping, calling this method will wake it up. * @note The force will we added to the sum of the applied torques and that this sum will be reset to zero at the end of each call of the DynamicsWorld::update() method. You can only apply a force to a dynamic body otherwise, this method will do nothing. - * @param[in] _torque The external torque to apply on the body - * @param[in] _static The torque will be apply while the user des not call the same function with 0 value ... + * @param _torque The external torque to apply on the body */ public void applyTorque(final Vector3f _torque) { if (this.rigidBody == null) { @@ -211,12 +205,12 @@ public class ComponentPhysics extends Component { } /** - * @brief Called when a new contact point is found between two bodies that were separated before. - * @param[in] _other The other component that have the impact - * @param[in] _normal Normal of the impact - * @param[in] _pos Position of the impact at the current object - * @param[in] _posOther Position of the impact at the other object - * @param[in] _penetrationDepth Depth penetration in the object + * Called when a new contact point is found between two bodies that were separated before. + * @param _other The other component that have the impact + * @param _normal Normal of the impact + * @param _pos Position of the impact at the current object + * @param _posOther Position of the impact at the other object + * @param _penetrationDepth Depth penetration in the object */ public void beginContact(final Component _other, final Vector3f _normal, final Vector3f _pos, final Vector3f _posOther, final float _penetrationDepth) { Log.warning(" collision [BEGIN] " + _pos + " depth=" + _penetrationDepth); @@ -228,8 +222,7 @@ public class ComponentPhysics extends Component { // Get the OpenGL matrix array of the transform final Matrix4f mmm = transform.getOpenGLMatrix(); - final Matrix4f transformationMatrix = mmm.clone(); - transformationMatrix.transpose(); + final Matrix4f transformationMatrix = mmm.transpose(); final Color tmpColor = new Color(1.0f, 0.0f, 0.0f, 0.3f); for (final Shape it : this.shape) { if (it.isBox()) { @@ -238,8 +231,8 @@ public class ComponentPhysics extends Component { final Transform3D transformLocal = new Transform3D(it.getOrigin(), it.getOrientation()); Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); - transformationMatrixLocal.transpose(); - transformationMatrixLocal = transformationMatrix.multiplyNew(transformationMatrixLocal); + transformationMatrixLocal = transformationMatrixLocal.transpose(); + transformationMatrixLocal = transformationMatrixLocal = transformationMatrix.multiply(transformationMatrixLocal); _draw.drawSquare(tmpElement.getSize(), transformationMatrixLocal, tmpColor); } else if (it.isCylinder()) { Log.debug(" Cylinder"); @@ -247,8 +240,8 @@ public class ComponentPhysics extends Component { final Transform3D transformLocal = new Transform3D(it.getOrigin(), it.getOrientation()); Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); - transformationMatrixLocal.transpose(); - transformationMatrixLocal = transformationMatrix.multiplyNew(transformationMatrixLocal); + transformationMatrixLocal = transformationMatrixLocal.transpose(); + transformationMatrixLocal = transformationMatrixLocal = transformationMatrix.multiply(transformationMatrixLocal); _draw.drawCylinder(tmpElement.getRadius(), tmpElement.getSize(), 10, 10, transformationMatrixLocal, tmpColor); } else if (it.isCapsule()) { Log.debug(" Capsule"); @@ -256,8 +249,8 @@ public class ComponentPhysics extends Component { final Transform3D transformLocal = new Transform3D(it.getOrigin(), it.getOrientation()); Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); - transformationMatrixLocal.transpose(); - transformationMatrixLocal = transformationMatrix.multiplyNew(transformationMatrixLocal); + transformationMatrixLocal = transformationMatrixLocal.transpose(); + transformationMatrixLocal = transformationMatrixLocal = transformationMatrix.multiply(transformationMatrixLocal); _draw.drawCapsule(tmpElement.getRadius(), tmpElement.getSize(), 10, 10, transformationMatrixLocal, tmpColor); } else if (it.isCone()) { Log.debug(" Cone"); @@ -265,8 +258,8 @@ public class ComponentPhysics extends Component { final Transform3D transformLocal = new Transform3D(it.getOrigin(), it.getOrientation()); Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); - transformationMatrixLocal.transpose(); - transformationMatrixLocal = transformationMatrix.multiplyNew(transformationMatrixLocal); + transformationMatrixLocal = transformationMatrixLocal.transpose(); + transformationMatrixLocal = transformationMatrixLocal = transformationMatrix.multiply(transformationMatrixLocal); _draw.drawCone(tmpElement.getRadius(), tmpElement.getSize(), 10, 10, transformationMatrixLocal, tmpColor); } else if (it.isSphere()) { @@ -275,8 +268,8 @@ public class ComponentPhysics extends Component { final Transform3D transformLocal = new Transform3D(it.getOrigin(), it.getOrientation()); Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); - transformationMatrixLocal.transpose(); - transformationMatrixLocal = transformationMatrix.multiplyNew(transformationMatrixLocal); + transformationMatrixLocal = transformationMatrixLocal.transpose(); + transformationMatrixLocal = transformationMatrixLocal = transformationMatrix.multiply(transformationMatrixLocal); _draw.drawSphere(tmpElement.getRadius(), 10, 10, transformationMatrixLocal, tmpColor); } else if (it.isConcave()) { @@ -284,9 +277,9 @@ public class ComponentPhysics extends Component { final Concave tmpElement = (Concave) it; final Transform3D transformLocal = new Transform3D(it.getOrigin(), it.getOrientation()); - final Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); - transformationMatrixLocal.transpose(); - transformationMatrixLocal.multiply(transformationMatrixLocal); + Matrix4f transformationMatrixLocal = transformLocal.getOpenGLMatrix(); + transformationMatrixLocal = transformationMatrixLocal.transpose(); + transformationMatrixLocal = transformationMatrixLocal.multiply(transformationMatrixLocal); _draw.drawTriangles(tmpElement.getVertex(), tmpElement.getIndices(), transformationMatrixLocal, tmpColor); } else if (it.isConvexHull()) { @@ -299,7 +292,7 @@ public class ComponentPhysics extends Component { // call done after all cycle update of the physical engine public void emitAll() { - // emit onbly of new ... + // emit only of new ... final Transform3D transform = getTransform(); if (this.lastTransformEmit != transform) { this.lastTransformEmit = transform; @@ -322,7 +315,7 @@ public class ComponentPhysics extends Component { Log.debug(" Box"); final Box tmpElement = (Box) it; // Half extents of the box in the x, y and z directions - final Vector3f halfExtents = new Vector3f(tmpElement.getSize().x, tmpElement.getSize().y, tmpElement.getSize().z); + final Vector3f halfExtents = new Vector3f(tmpElement.getSize().x(), tmpElement.getSize().y(), tmpElement.getSize().z()); // Create the box shape final BoxShape shape = new BoxShape(halfExtents, 0.0001f); this.listShape.add(shape); @@ -339,7 +332,7 @@ public class ComponentPhysics extends Component { // Create the Cylinder shape final CylinderShape shape = new CylinderShape(tmpElement.getRadius(), tmpElement.getSize()); // The ephysic use Y as UP ==> ege use Z as UP - final Quaternion orientation = it.getOrientation().multiplyNew(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); + final Quaternion orientation = it.getOrientation().multiply(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); final Transform3D transform = new Transform3D(it.getOrigin(), orientation); final ProxyShape proxyShape = this.rigidBody.addCollisionShape(shape, transform, it.getMass()); proxyShape.setUserData(this); @@ -350,7 +343,7 @@ public class ComponentPhysics extends Component { // Create the Capsule shape final CapsuleShape shape = new CapsuleShape(tmpElement.getRadius(), tmpElement.getSize()); // The ephysic use Y as UP ==> ege use Z as UP - final Quaternion orientation = it.getOrientation().multiplyNew(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); + final Quaternion orientation = it.getOrientation().multiply(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); final Transform3D transform = new Transform3D(it.getOrigin(), orientation); final ProxyShape proxyShape = this.rigidBody.addCollisionShape(shape, transform, it.getMass()); proxyShape.setUserData(this); @@ -361,7 +354,7 @@ public class ComponentPhysics extends Component { // Create the Cone shape final ConeShape shape = new ConeShape(tmpElement.getRadius(), tmpElement.getSize()); // The ephysic use Y as UP ==> ege use Z as UP - final Quaternion orientation = it.getOrientation().multiplyNew(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); + final Quaternion orientation = it.getOrientation().multiply(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); final Transform3D transform = new Transform3D(it.getOrigin(), orientation); final ProxyShape proxyShape = this.rigidBody.addCollisionShape(shape, transform, it.getMass()); proxyShape.setUserData(this); @@ -372,7 +365,7 @@ public class ComponentPhysics extends Component { // Create the box shape final SphereShape shape = new SphereShape(tmpElement.getRadius()); // The ephysic use Y as UP ==> ege use Z as UP - final Quaternion orientation = it.getOrientation().multiplyNew(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); + final Quaternion orientation = it.getOrientation().multiply(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); final Transform3D transform = new Transform3D(it.getOrigin(), orientation); final ProxyShape proxyShape = this.rigidBody.addCollisionShape(shape, transform, it.getMass()); proxyShape.setUserData(this); @@ -394,20 +387,20 @@ public class ComponentPhysics extends Component { // TODO : Manage memory leak ... final ConcaveShape shape = new ConcaveMeshShape(triangleMesh); // The ephysic use Y as UP ==> ege use Z as UP - final Quaternion orientation = it.getOrientation().multiplyNew(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); + final Quaternion orientation = it.getOrientation().multiply(new Quaternion(-0.707107f, 0.0f, 0.0f, 0.707107f)); final Transform3D transform = new Transform3D(it.getOrigin(), it.getOrientation()); final ProxyShape proxyShape = this.rigidBody.addCollisionShape(shape, transform, it.getMass()); proxyShape.setUserData(this); this.listProxyShape.add(proxyShape); } else { Log.debug(" ???"); - // TODO: UNKNOW type ... + // TODO UNKNOWN type ... } } } /** - * @brief Get the angular velocity (whole world). + * Get the angular velocity (whole world). * @return The angular velocity vector of the body */ public Vector3f getAngularVelocity() { @@ -418,7 +411,7 @@ public class ComponentPhysics extends Component { } /** - * @brief Get the linear velocity (whole world). + * Get the linear velocity (whole world). * @return The linear velocity vector of the body */ public Vector3f getLinearVelocity() { @@ -429,7 +422,7 @@ public class ComponentPhysics extends Component { } /** - * @brief Get the angular velocity (local Body). + * Get the angular velocity (local Body). * @return The angular velocity vector of the body */ public Vector3f getRelativeAngularVelocity() { @@ -437,11 +430,11 @@ public class ComponentPhysics extends Component { return new Vector3f(0, 0, 0); } final Vector3f value = this.rigidBody.getAngularVelocity(); - return this.rigidBody.getTransform().getOrientation().inverseNew().multiply(value); + return this.rigidBody.getTransform().getOrientation().inverse().multiply(value); } /** - * @brief Get the linear velocity (local Body). + * Get the linear velocity (local Body). * @return The linear velocity vector of the body */ public Vector3f getRelativeLinearVelocity() { @@ -449,7 +442,7 @@ public class ComponentPhysics extends Component { return new Vector3f(0, 0, 0); } final Vector3f value = this.rigidBody.getLinearVelocity(); - return this.rigidBody.getTransform().getOrientation().inverseNew().multiply(value); + return this.rigidBody.getTransform().getOrientation().inverse().multiply(value); } public List getShape() { @@ -457,12 +450,12 @@ public class ComponentPhysics extends Component { } /** - * @brief set a new transformation + * set a new transformation * @return Transformation of the position */ public Transform3D getTransform() { if (this.rigidBody == null) { - return Transform3D.identity(); + return Transform3D.IDENTITY; } return this.rigidBody.getTransform(); } @@ -473,12 +466,12 @@ public class ComponentPhysics extends Component { } /** - * @brief Called when a new contact point is found between two bodies. - * @param[in] _other The other component that have the impact - * @param[in] _normal Normal of the impact - * @param[in] _pos Position of the impact at the current object - * @param[in] _posOther Position of the impact at the other object - * @param[in] _penetrationDepth Depth penetration in the object + * Called when a new contact point is found between two bodies. + * @param _other The other component that have the impact + * @param _normal Normal of the impact + * @param _pos Position of the impact at the current object + * @param _posOther Position of the impact at the other object + * @param _penetrationDepth Depth penetration in the object */ public void newContact(final Component _other, final Vector3f _normal, final Vector3f _pos, final Vector3f _posOther, final float _penetrationDepth) { Log.warning(" collision [ NEW ] " + _pos + " depth=" + _penetrationDepth); @@ -488,7 +481,7 @@ public class ComponentPhysics extends Component { if (this.rigidBody == null) { return; } - final Matrix4f transformationMatrix = Matrix4f.identity(); + final Matrix4f transformationMatrix = Matrix4f.IDENTITY; final Color tmpColor = new Color(0.0f, 1.0f, 0.0f, 0.8f); final AABB value = this.rigidBody.getAABB(); _draw.drawCubeLine(value.getMin(), value.getMax(), tmpColor, transformationMatrix, true, true); @@ -500,9 +493,9 @@ public class ComponentPhysics extends Component { } /** - * @brief Set the angular velocity (whole world). - * @param[in] _linearVelocity The angular velocity vector of the body - */ + * Set the angular velocity (whole world). + * @param _angularVelocity The angular velocity vector of the body + */ public void setAngularVelocity(final Vector3f _angularVelocity) { if (this.rigidBody == null) { return; @@ -515,21 +508,15 @@ public class ComponentPhysics extends Component { return; } switch (_type) { - case BODY_STATIC: - this.rigidBody.setType(BodyType.STATIC); - break; - case BODY_KINEMATIC: - this.rigidBody.setType(BodyType.KINEMATIC); - break; - case BODY_DYNAMIC: - this.rigidBody.setType(BodyType.DYNAMIC); - break; + case BODY_STATIC -> this.rigidBody.setType(BodyType.STATIC); + case BODY_KINEMATIC -> this.rigidBody.setType(BodyType.KINEMATIC); + case BODY_DYNAMIC -> this.rigidBody.setType(BodyType.DYNAMIC); } } /** - * @brief Set the linear velocity (whole world). - * @param[in] _linearVelocity The linear velocity vector of the body + * Set the linear velocity (whole world). + * @param _linearVelocity The linear velocity vector of the body */ public void setLinearVelocity(final Vector3f _linearVelocity) { if (this.rigidBody == null) { @@ -539,9 +526,9 @@ public class ComponentPhysics extends Component { } /** - * @brief Set the angular velocity (local Body). - * @param[in] _linearVelocity The angular velocity vector of the body - */ + * Set the angular velocity (local Body). + * @param _angularVelocity The angular velocity vector of the body + */ public void setRelativeAngularVelocity(final Vector3f _angularVelocity) { if (this.rigidBody == null) { return; @@ -551,9 +538,9 @@ public class ComponentPhysics extends Component { } /** - * @brief Set the linear velocity (local Body). - * @param[in] _linearVelocity The linear velocity vector of the body - */ + * Set the linear velocity (local Body). + * @param _linearVelocity The linear velocity vector of the body + */ public void setRelativeLinearVelocity(final Vector3f _linearVelocity) { if (this.rigidBody == null) { return; @@ -571,8 +558,8 @@ public class ComponentPhysics extends Component { } /** - * @brief set a new transformation - * @param[in] _transform transformation of the position + * set a new transformation + * @param _transform transformation of the position */ public void setTransform(final Transform3D _transform) { if (this.rigidBody == null) { @@ -587,12 +574,12 @@ public class ComponentPhysics extends Component { return; } if (!this.staticForceApplyCenterOfMass.isZero()) { - final Vector3f tmp = this.staticForceApplyCenterOfMass.multiplyNew(_delta); + final Vector3f tmp = this.staticForceApplyCenterOfMass.multiply(_delta); Log.error("FORCE : " + tmp); this.rigidBody.applyForceToCenterOfMass(tmp); } if (!this.staticTorqueApply.isZero()) { - final Vector3f tmp = this.staticTorqueApply.multiplyNew(_delta); + final Vector3f tmp = this.staticTorqueApply.multiply(_delta); Log.error("TORQUE : " + tmp); this.rigidBody.applyTorque(tmp); } diff --git a/src/org/atriasoft/ege/components/ComponentPosition.java b/src/org/atriasoft/ege/components/ComponentPosition.java index 1ede1b9..3e47544 100644 --- a/src/org/atriasoft/ege/components/ComponentPosition.java +++ b/src/org/atriasoft/ege/components/ComponentPosition.java @@ -2,22 +2,22 @@ package org.atriasoft.ege.components; import org.atriasoft.ege.Component; import org.atriasoft.ege.Signal; -import org.atriasoft.etk.math.Transform3D; import org.atriasoft.ege.internal.Log; +import org.atriasoft.etk.math.Transform3D; public class ComponentPosition extends Component { - public Signal signalPosition; + public final Signal signalPosition = new Signal(); protected Transform3D transform; /** - * @brief Create a basic position component (no orientation and position (0,0,0)) + * Create a basic position component (no orientation and position (0,0,0)) */ public ComponentPosition() { - this.transform = Transform3D.identity(); + this.transform = Transform3D.IDENTITY; } /** - * @brief Create a basic position component + * Create a basic position component * @param transform transformation of the position */ public ComponentPosition(final Transform3D transform) { @@ -32,7 +32,7 @@ public class ComponentPosition extends Component { } /** - * @brief set a new transformation + * set a new transformation * @return Transformation of the position */ public Transform3D getTransform() { @@ -45,10 +45,10 @@ public class ComponentPosition extends Component { } /** - * @brief set a new transformation + * set a new transformation * @param transform transformation of the position */ - void setTransform(final Transform3D transform) { + public void setTransform(final Transform3D transform) { if (this.transform.isEqual(transform)) { return; } diff --git a/src/org/atriasoft/ege/components/ComponentPositionPlayer.java b/src/org/atriasoft/ege/components/ComponentPositionPlayer.java index 29220f6..8da3dae 100644 --- a/src/org/atriasoft/ege/components/ComponentPositionPlayer.java +++ b/src/org/atriasoft/ege/components/ComponentPositionPlayer.java @@ -1,29 +1,29 @@ package org.atriasoft.ege.components; +import org.atriasoft.etk.math.Quaternion; import org.atriasoft.etk.math.Transform3D; import org.atriasoft.etk.math.Vector3f; public class ComponentPositionPlayer extends ComponentPosition { - private Vector3f angles = new Vector3f(0,0,0); - - + private Vector3f angles = new Vector3f(0, 0, 0); + public ComponentPositionPlayer() { super(); } - - public ComponentPositionPlayer(Transform3D transform) { + + public ComponentPositionPlayer(final Transform3D transform) { super(transform); // TODO deduce angle of the player } - + public Vector3f getAngles() { - return angles; + return this.angles; } - - public void setAngles(Vector3f angles) { - this.angles = angles.clone(); + + public void setAngles(final Vector3f angles) { + this.angles = angles; // TODO update transform3D - this.transform.getOrientation().setEulerAngles(this.angles); + this.transform = this.transform.withOrientation(Quaternion.fromEulerAngles(this.angles)); } } diff --git a/src/org/atriasoft/ege/engines/EngineAI.java b/src/org/atriasoft/ege/engines/EngineAI.java index 0f0fc35..8749436 100644 --- a/src/org/atriasoft/ege/engines/EngineAI.java +++ b/src/org/atriasoft/ege/engines/EngineAI.java @@ -1,6 +1,7 @@ package org.atriasoft.ege.engines; -import java.util.Vector; +import java.util.ArrayList; +import java.util.List; import org.atriasoft.ege.internal.Log; import org.atriasoft.ege.Component; @@ -12,8 +13,8 @@ import org.atriasoft.ege.components.ComponentAI; public class EngineAI extends Engine { public static final String ENGINE_NAME = "ia"; private float accumulator = 0; - private static float TIME_STEP = 5.0f; - private Vector components = new Vector(); + private static final float TIME_STEP = 5.0f; + private final List components = new ArrayList(); public EngineAI(Environement env) { super(env); // TODO Auto-generated constructor stub @@ -26,7 +27,7 @@ public class EngineAI extends Engine { @Override public void componentAdd(Component ref) { - if (ref instanceof ComponentAI == false) { + if (!(ref instanceof ComponentAI)) { return; } components.add((ComponentAI)ref); diff --git a/src/org/atriasoft/ege/engines/EngineGravity.java b/src/org/atriasoft/ege/engines/EngineGravity.java index 64997c7..e2e4e2a 100644 --- a/src/org/atriasoft/ege/engines/EngineGravity.java +++ b/src/org/atriasoft/ege/engines/EngineGravity.java @@ -5,62 +5,59 @@ import java.util.Vector; import org.atriasoft.ege.Component; import org.atriasoft.ege.Engine; import org.atriasoft.ege.Environement; -import org.atriasoft.ege.Light; -import org.atriasoft.etk.math.Vector3f; -import org.atriasoft.ege.internal.Log; import org.atriasoft.ege.camera.Camera; -import org.atriasoft.ege.components.ComponentAI; import org.atriasoft.ege.components.ComponentGravity; -import org.atriasoft.ege.components.ComponentLight; -import org.atriasoft.ege.components.ComponentLightSun; +import org.atriasoft.etk.math.Vector3f; public class EngineGravity extends Engine { public static final String ENGINE_NAME = "gravity"; - private Vector components = new Vector(); - public EngineGravity(Environement env) { + private Vector components = new Vector<>(); + + public EngineGravity(final Environement env) { super(env); // TODO Auto-generated constructor stub } - + @Override - public void componentRemove(Component ref) { - components.remove(ref); - } - - @Override - public void componentAdd(Component ref) { + public void componentAdd(final Component ref) { if (ref instanceof ComponentGravity == true) { - components.add((ComponentGravity)ref); + this.components.add((ComponentGravity) ref); return; } } - + @Override - public void update(long deltaMili) { - // nothing to do ... + public void componentRemove(final Component ref) { + this.components.remove(ref); } - - @Override - public void render(long deltaMili, Camera camera) { - // nothing to do ... + + public Vector3f getGravityAtPosition(final Vector3f position) { + Vector3f out = Vector3f.ZERO; + for (ComponentGravity elem : this.components) { + out = out.add(elem.getGravityAtPosition(position)); + } + return out; } - - @Override - public void renderDebug(long deltaMili, Camera camera) { - // nothing to do ... - } - + @Override public String getType() { // TODO Auto-generated method stub return ENGINE_NAME; } - public Vector3f getGravityAtPosition(Vector3f position) { - Vector3f out = new Vector3f(); - for (ComponentGravity elem: components) { - out.add(elem.getGravityAtPosition(position)); - } - return out; + + @Override + public void render(final long deltaMili, final Camera camera) { + // nothing to do ... } - + + @Override + public void renderDebug(final long deltaMili, final Camera camera) { + // nothing to do ... + } + + @Override + public void update(final long deltaMili) { + // nothing to do ... + } + } diff --git a/src/org/atriasoft/ege/engines/EnginePhysics.java b/src/org/atriasoft/ege/engines/EnginePhysics.java index 6f9d4e9..9e0f5fc 100644 --- a/src/org/atriasoft/ege/engines/EnginePhysics.java +++ b/src/org/atriasoft/ege/engines/EnginePhysics.java @@ -6,6 +6,9 @@ import java.util.Vector; import org.atriasoft.ege.Component; import org.atriasoft.ege.Engine; import org.atriasoft.ege.Environement; +import org.atriasoft.ege.camera.Camera; +import org.atriasoft.ege.components.ComponentPhysics; +import org.atriasoft.ege.internal.Log; import org.atriasoft.ephysics.body.RigidBody; import org.atriasoft.ephysics.collision.ContactManifold; import org.atriasoft.ephysics.collision.shapes.AABB; @@ -18,9 +21,6 @@ import org.atriasoft.etk.Color; import org.atriasoft.etk.math.Matrix4f; import org.atriasoft.etk.math.Vector3f; import org.atriasoft.gale.resource.ResourceColored3DObject; -import org.atriasoft.ege.camera.Camera; -import org.atriasoft.ege.components.ComponentPhysics; -import org.atriasoft.ege.internal.Log; public class EnginePhysics extends Engine implements EventListener { public static final String ENGINE_NAME = "physics"; @@ -34,7 +34,7 @@ public class EnginePhysics extends Engine implements EventListener { //private final EngineGravity gravity; private final DynamicsWorld dynamicsWorld; - private final Vector components = new Vector(); + private final Vector components = new Vector<>(); private final ResourceColored3DObject debugDrawProperty = ResourceColored3DObject.create(); @@ -75,7 +75,7 @@ public class EnginePhysics extends Engine implements EventListener { component1.beginContact(component2, contact.normal, contact.localPoint1, contact.localPoint2, contact.penetrationDepth); } if (component2 != null) { - component2.beginContact(component1, contact.normal.multiplyNew(-1), contact.localPoint2, contact.localPoint1, contact.penetrationDepth); + component2.beginContact(component1, contact.normal.multiply(-1), contact.localPoint2, contact.localPoint1, contact.penetrationDepth); } } @@ -87,7 +87,7 @@ public class EnginePhysics extends Engine implements EventListener { @Override public void componentAdd(final Component ref) { - if (ref instanceof ComponentPhysics == false) { + if (!(ref instanceof ComponentPhysics)) { return; } final ComponentPhysics elem = (ComponentPhysics) ref; @@ -133,7 +133,7 @@ public class EnginePhysics extends Engine implements EventListener { component1.newContact(component2, contact.normal, contact.localPoint1, contact.localPoint2, contact.penetrationDepth); } if (component2 != null) { - component2.newContact(component1, contact.normal.multiplyNew(-1), contact.localPoint2, contact.localPoint1, contact.penetrationDepth); + component2.newContact(component1, contact.normal.multiply(-1), contact.localPoint2, contact.localPoint1, contact.penetrationDepth); } } @@ -152,17 +152,17 @@ public class EnginePhysics extends Engine implements EventListener { @Override public void renderDebug(final long deltaMili, final Camera camera) { - if (this.propertyDebugShape == true) { + if (this.propertyDebugShape) { for (final ComponentPhysics it : this.components) { it.drawShape(this.debugDrawProperty, camera); } } - if (this.propertyDebugAABB == true) { + if (this.propertyDebugAABB) { for (final ComponentPhysics it : this.components) { it.renderDebug(this.debugDrawProperty, camera); } } - final Matrix4f transformationMatrix = Matrix4f.identity(); + final Matrix4f transformationMatrix = Matrix4f.IDENTITY; final Color tmpColor = new Color(0.0f, 0.0f, 1.0f, 0.8f); final List islands = this.dynamicsWorld.getIslands(); for (final Island it : islands) { @@ -180,9 +180,9 @@ public class EnginePhysics extends Engine implements EventListener { for (final ContactManifold it : listContact) { for (int iii = 0; iii < it.getNbContactPoints(); iii++) { final ContactPoint contact = it.getContactPoint(iii); - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(contact.getWorldPointOnBody1())), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(contact.getWorldPointOnBody1())), new Color(0, 1, 0, 1)); - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(contact.getWorldPointOnBody2())), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(contact.getWorldPointOnBody2())), new Color(0, 1, 0, 1)); } } @@ -191,7 +191,7 @@ public class EnginePhysics extends Engine implements EventListener { public void setGravity(final Vector3f _axePower) { if (this.dynamicsWorld != null) { - final Vector3f gravity = _axePower.clone(); + final Vector3f gravity = _axePower; this.dynamicsWorld.setGravity(gravity); } } diff --git a/src/org/atriasoft/ege/geometry/AABB.java b/src/org/atriasoft/ege/geometry/AABB.java index 956322f..92e2970 100644 --- a/src/org/atriasoft/ege/geometry/AABB.java +++ b/src/org/atriasoft/ege/geometry/AABB.java @@ -1,33 +1,36 @@ package org.atriasoft.ege.geometry; -import org.atriasoft.etk.math.Matrix3f; import org.atriasoft.etk.math.Vector3f; public class AABB { public Vector3f position; public Vector3f size; // HALF SIZE! - public AABB(Vector3f position, Vector3f size) { + public AABB() { + this.position = Vector3f.ZERO; + this.size = Vector3f.ONE; + } + + public AABB(final Vector3f position, final Vector3f size) { this.position = position; this.size = size; } - public AABB() { - this.position = new Vector3f(); - this.size = new Vector3f(1.0f, 1.0f, 1.0f); - } - public void setMinMax(Vector3f min, Vector3f max) { - this.position = min.addNew(max).multiply(0.5f); - this.size = max.lessNew(min).multiply(0.5f); + + public Vector3f getMax() { + return new Vector3f(this.position.x() + this.size.x(), this.position.y() + this.size.y(), this.position.z() + this.size.z()); } public Vector3f getMin() { - return new Vector3f(position.x-size.x, position.y-size.y, position.z-size.z); + return new Vector3f(this.position.x() - this.size.x(), this.position.y() - this.size.y(), this.position.z() - this.size.z()); } - public Vector3f getMax() { - return new Vector3f(position.x+size.x, position.y+size.y, position.z+size.z); + + public void setMinMax(final Vector3f min, final Vector3f max) { + this.position = min.add(max).multiply(0.5f); + this.size = max.less(min).multiply(0.5f); } + @Override public String toString() { - return "AABB [position=" + position + ", size=" + size + "]"; + return "AABB [position=" + this.position + ", size=" + this.size + "]"; } } diff --git a/src/org/atriasoft/ege/geometry/Geometry3D.java b/src/org/atriasoft/ege/geometry/Geometry3D.java index dc5250a..ebe2e69 100644 --- a/src/org/atriasoft/ege/geometry/Geometry3D.java +++ b/src/org/atriasoft/ege/geometry/Geometry3D.java @@ -3,84 +3,109 @@ package org.atriasoft.ege.geometry; import org.atriasoft.etk.math.Vector3f; public class Geometry3D { - public static boolean CMP(float x, float y) { - return Math.abs(x-y) <= 0.000001f; + public static boolean CMP(final float x, final float y) { + return Math.abs(x - y) <= 0.000001f; } - public static boolean pointInSphere(Vector3f point, Sphere sphere) { - return Vector3f.length2(point, sphere.position) < sphere.radius * sphere.radius; - } - - public static boolean pointInPlane(Vector3f point, Plane plane) { - // This should probably use an epsilon! - //return Dot(point, plane.normal) - plane.distance == 0.0f; - return CMP(point.dot(plane.normal) - plane.distance, 0.0f); - } - - public static boolean pointInAABB(Vector3f point, AABB aabb) { + public static boolean pointInAABB(final Vector3f point, final AABB aabb) { Vector3f min = aabb.getMin(); Vector3f max = aabb.getMax(); - if (point.x < min.x || point.y < min.y || point.z < min.z) { + if (point.x() < min.x() || point.y() < min.y() || point.z() < min.z()) { return false; } - if (point.x > max.x || point.y > max.y || point.z > max.z) { + if (point.x() > max.x() || point.y() > max.y() || point.z() > max.z()) { return false; } return true; } - public static boolean pointInOBB(Vector3f point, OBB obb) { - Vector3f dir = point.lessNew(obb.position); + public static boolean pointInOBB(final Vector3f point, final OBB obb) { + Vector3f dir = point.less(obb.position); { int iii = 0; - Vector3f axis = obb.orientation.getRow(iii*3); + Vector3f axis = obb.orientation.getRow(iii * 3); float distance = Vector3f.length2(dir, axis); - float squareDistance = obb.size.x*obb.size.x; - if (distance > squareDistance - || distance < -squareDistance) { + float squareDistance = obb.size.x() * obb.size.x(); + if (distance > squareDistance || distance < -squareDistance) { return false; } } { int iii = 1; - Vector3f axis = obb.orientation.getRow(iii*3); + Vector3f axis = obb.orientation.getRow(iii * 3); float distance = Vector3f.length2(dir, axis); - float squareDistance = obb.size.y*obb.size.y; - if (distance > squareDistance - || distance < -squareDistance) { + float squareDistance = obb.size.y() * obb.size.y(); + if (distance > squareDistance || distance < -squareDistance) { return false; } } { int iii = 2; - Vector3f axis = obb.orientation.getRow(iii*3); + Vector3f axis = obb.orientation.getRow(iii * 3); float distance = Vector3f.length2(dir, axis); - float squareDistance = obb.size.z*obb.size.z; - if (distance > squareDistance - || distance < -squareDistance) { + float squareDistance = obb.size.z() * obb.size.z(); + if (distance > squareDistance || distance < -squareDistance) { return false; } } - + return true; } + + public static boolean pointInPlane(final Vector3f point, final Plane plane) { + // This should probably use an epsilon! + //return Dot(point, plane.normal) - plane.distance == 0.0f; + return CMP(point.dot(plane.normal) - plane.distance, 0.0f); + } + + public static boolean pointInSphere(final Vector3f point, final Sphere sphere) { + return Vector3f.length2(point, sphere.position) < sphere.radius * sphere.radius; + } + + public static boolean pointInTriangle(final Vector3f p, final Triangle t) { + // Move the triangle so that the point is + // now at the origin of the triangle + Vector3f a = t.p1.less(p); + Vector3f b = t.p2.less(p); + Vector3f c = t.p3.less(p); + // The point should be moved too, so they are both + // relative, but because we don't use p in the + // equation anymore, we don't need it! + // p -= p; // This would just equal the zero vector! + Vector3f normPBC = b.cross(c); // Normal of PBC (u) + Vector3f normPCA = c.cross(a); // Normal of PCA (v) + Vector3f normPAB = a.cross(b); // Normal of PAB (w) + // Test to see if the normals are facing + // the same direction, return false if not + float val = normPBC.dot(normPCA); + if (CMP(val, 0.0f) == false) { + return false; + } + val = normPBC.dot(normPAB); + if (CMP(val, 0.0f) == false) { + return false; + } + // All normals facing the same way, return true + return true; + } + // select the point under the oriented triangle - public static boolean pointUnderTriangle(Vector3f p, Triangle t) { + public static boolean pointUnderTriangle(final Vector3f p, final Triangle t) { // Move the triangle so that the point is // now at the origin of the triangle - Vector3f a = t.p1.lessNew(p); - Vector3f b = t.p2.lessNew(p); - Vector3f c = t.p3.lessNew(p); - + Vector3f a = t.p1.less(p); + Vector3f b = t.p2.less(p); + Vector3f c = t.p3.less(p); + // The point should be moved too, so they are both // relative, but because we don't use p in the // equation anymore, we don't need it! // p -= p; // This would just equal the zero vector! - + Vector3f normPBC = b.cross(c); // Normal of PBC (u) Vector3f normPCA = c.cross(a); // Normal of PCA (v) Vector3f normPAB = a.cross(b); // Normal of PAB (w) - + // Test to see if the normals are facing // the same direction, return false if not float val = normPBC.dot(normPCA); @@ -91,35 +116,9 @@ public class Geometry3D { if (val < 0.0f) { return false; } + + // All normals facing the same way, return true + return true; + } - // All normals facing the same way, return true - return true; - } - public static boolean pointInTriangle(Vector3f p, Triangle t) { - // Move the triangle so that the point is - // now at the origin of the triangle - Vector3f a = t.p1.lessNew(p); - Vector3f b = t.p2.lessNew(p); - Vector3f c = t.p3.lessNew(p); - // The point should be moved too, so they are both - // relative, but because we don't use p in the - // equation anymore, we don't need it! - // p -= p; // This would just equal the zero vector! - Vector3f normPBC = b.cross(c); // Normal of PBC (u) - Vector3f normPCA = c.cross(a); // Normal of PCA (v) - Vector3f normPAB = a.cross(b); // Normal of PAB (w) - // Test to see if the normals are facing - // the same direction, return false if not - float val = normPBC.dot(normPCA); - if (CMP(val, 0.0f) == false) { - return false; - } - val = normPBC.dot(normPAB); - if (CMP(val, 0.0f) == false) { - return false; - } - // All normals facing the same way, return true - return true; - } - } diff --git a/src/org/atriasoft/ege/geometry/Line.java b/src/org/atriasoft/ege/geometry/Line.java index 6b4e57e..6d3993b 100644 --- a/src/org/atriasoft/ege/geometry/Line.java +++ b/src/org/atriasoft/ege/geometry/Line.java @@ -5,25 +5,28 @@ import org.atriasoft.etk.math.Vector3f; public class Line { public Vector3f start; public Vector3f end; - - public Line(Vector3f start, Vector3f end) { + + public Line() { + this.start = Vector3f.ZERO; + this.end = Vector3f.ZERO; + } + + public Line(final Vector3f start, final Vector3f end) { this.start = start; this.end = end; } - public Line() { - this.start = new Vector3f(); - this.end = new Vector3f(); + + public float length() { + return this.start.less(this.end).length(); } + + public float length2() { + return this.start.less(this.end).length2(); + } + @Override public String toString() { - return "Line [start=" + start + ", end=" + end + "]"; + return "Line [start=" + this.start + ", end=" + this.end + "]"; } - - public float length2() { - return this.start.lessNew(this.end).length2(); - } - public float length() { - return this.start.lessNew(this.end).length(); - } - + } diff --git a/src/org/atriasoft/ege/geometry/OBB.java b/src/org/atriasoft/ege/geometry/OBB.java index 30b3e9b..4068af4 100644 --- a/src/org/atriasoft/ege/geometry/OBB.java +++ b/src/org/atriasoft/ege/geometry/OBB.java @@ -8,23 +8,26 @@ public class OBB { public Vector3f size; // HALF SIZE! public Matrix3f orientation; - public OBB(Vector3f position, Vector3f size, Matrix3f orientation) { + public OBB() { + this.position = Vector3f.ZERO; + this.size = new Vector3f(1.0f, 1.0f, 1.0f); + this.orientation = Matrix3f.IDENTITY; + } + + public OBB(final Vector3f position, final Vector3f size) { + this.position = position; + this.size = size; + this.orientation = Matrix3f.IDENTITY; + } + + public OBB(final Vector3f position, final Vector3f size, final Matrix3f orientation) { this.position = position; this.size = size; this.orientation = orientation; } - public OBB(Vector3f position, Vector3f size) { - this.position = position; - this.size = size; - this.orientation = Matrix3f.identity(); - } - public OBB() { - this.position = new Vector3f(); - this.size = new Vector3f(1.0f, 1.0f, 1.0f); - this.orientation = Matrix3f.identity(); - } + @Override public String toString() { - return "OBB [position=" + position + ", size=" + size + ", orientation=" + orientation + "]"; + return "OBB [position=" + this.position + ", size=" + this.size + ", orientation=" + this.orientation + "]"; } } diff --git a/src/org/atriasoft/ege/geometry/Ray.java b/src/org/atriasoft/ege/geometry/Ray.java index 9ad6cf9..7f02b18 100644 --- a/src/org/atriasoft/ege/geometry/Ray.java +++ b/src/org/atriasoft/ege/geometry/Ray.java @@ -3,27 +3,32 @@ package org.atriasoft.ege.geometry; import org.atriasoft.etk.math.Vector3f; public class Ray { - public Vector3f origin; - public Vector3f direction; - - public Ray() { - this.origin = new Vector3f(); - this.direction = new Vector3f(0.0f, 0.0f, 1.0f); - } - public Ray(Vector3f origin, Vector3f direction) { - this.origin = origin; - this.direction = direction; - } - public static Ray createFromPoint(Vector3f origin, Vector3f destination) { - Ray out = new Ray(origin, destination.lessNew(origin)); + public static Ray createFromPoint(final Vector3f origin, final Vector3f destination) { + Ray out = new Ray(origin, destination.less(origin)); out.normalizeDirection(); return out; } - public void normalizeDirection() { - direction.safeNormalize(); + + public Vector3f origin; + + public Vector3f direction; + + public Ray() { + this.origin = Vector3f.ZERO; + this.direction = new Vector3f(0.0f, 0.0f, 1.0f); } + + public Ray(final Vector3f origin, final Vector3f direction) { + this.origin = origin; + this.direction = direction; + } + + public void normalizeDirection() { + this.direction = this.direction.safeNormalize(); + } + @Override public String toString() { - return "Ray [origin=" + origin + ", direction=" + direction + "]"; + return "Ray [origin=" + this.origin + ", direction=" + this.direction + "]"; } } diff --git a/src/org/atriasoft/ege/geometry/Sphere.java b/src/org/atriasoft/ege/geometry/Sphere.java index d4adca7..77e3c01 100644 --- a/src/org/atriasoft/ege/geometry/Sphere.java +++ b/src/org/atriasoft/ege/geometry/Sphere.java @@ -5,17 +5,19 @@ import org.atriasoft.etk.math.Vector3f; public class Sphere { public Vector3f position; public float radius; - - public Sphere(Vector3f position, float radius) { + + public Sphere() { + this.position = Vector3f.ZERO; + this.radius = 1.0f; + } + + public Sphere(final Vector3f position, final float radius) { this.position = position; this.radius = radius; } - public Sphere() { - this.position = new Vector3f(); - this.radius = 1.0f; - } + @Override public String toString() { - return "Sphere [position=" + position + ", radius=" + radius + "]"; + return "Sphere [position=" + this.position + ", radius=" + this.radius + "]"; } } diff --git a/src/org/atriasoft/ege/geometry/Triangle.java b/src/org/atriasoft/ege/geometry/Triangle.java index c8a091f..df80fbf 100644 --- a/src/org/atriasoft/ege/geometry/Triangle.java +++ b/src/org/atriasoft/ege/geometry/Triangle.java @@ -6,19 +6,22 @@ public class Triangle { public Vector3f p1; public Vector3f p2; public Vector3f p3; - public Triangle(Vector3f p1, Vector3f p2, Vector3f p3) { + + public Triangle() { + this.p1 = Vector3f.ZERO; + this.p2 = Vector3f.ZERO; + this.p3 = Vector3f.ZERO; + } + + public Triangle(final Vector3f p1, final Vector3f p2, final Vector3f p3) { this.p1 = p1; this.p2 = p2; this.p3 = p3; } - public Triangle() { - this.p1 = new Vector3f(); - this.p2 = new Vector3f(); - this.p3 = new Vector3f(); - } + @Override public String toString() { - return "Triangle [p1=" + p1 + ", p2=" + p2 + ", p3=" + p3 + "]"; + return "Triangle [p1=" + this.p1 + ", p2=" + this.p2 + ", p3=" + this.p3 + "]"; } - + } diff --git a/src/org/atriasoft/ege/map/ComponentDynamicMeshsVoxelMap.java b/src/org/atriasoft/ege/map/ComponentDynamicMeshsVoxelMap.java index a451905..b21f6f8 100644 --- a/src/org/atriasoft/ege/map/ComponentDynamicMeshsVoxelMap.java +++ b/src/org/atriasoft/ege/map/ComponentDynamicMeshsVoxelMap.java @@ -1,12 +1,12 @@ package org.atriasoft.ege.map; +import org.atriasoft.ege.components.ComponentDynamicMeshs; +import org.atriasoft.ege.internal.Log; +import org.atriasoft.ege.resource.ResourceListTexturedMesh; import org.atriasoft.etk.math.Vector2f; import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector3i; import org.atriasoft.gale.backend3d.OpenGL.RenderMode; -import org.atriasoft.ege.internal.Log; -import org.atriasoft.ege.components.ComponentDynamicMeshs; -import org.atriasoft.ege.resource.ResourceListTexturedMesh; public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs { private VoxelChunk chunk; @@ -15,198 +15,203 @@ public class ComponentDynamicMeshsVoxelMap extends ComponentDynamicMeshs { ResourceListTexturedMesh dirt = ResourceListTexturedMesh.create(RenderMode.triangle); ResourceListTexturedMesh grass = ResourceListTexturedMesh.create(RenderMode.triangle); - public ComponentDynamicMeshsVoxelMap(VoxelChunk chunk) { + public ComponentDynamicMeshsVoxelMap(final VoxelChunk chunk) { super(); this.chunk = chunk; - this.setMesh("unbreakable", unbreakable); - this.setMesh("stone", stone); - this.setMesh("dirt", dirt); - this.setMesh("grass", grass); + setMesh("unbreakable", this.unbreakable); + setMesh("stone", this.stone); + setMesh("dirt", this.dirt); + setMesh("grass", this.grass); } - - private void drawPlane(Vector3i base, int xxx, int yyy, int zzz, int type) { + + private void drawPlane(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) { //Log.warning("Add plane Z : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz)); - Vector3f v1 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz); - Vector3f v2 = new Vector3f(base.x + xxx , base.y + yyy+1, base.z + zzz); - Vector3f v3 = new Vector3f(base.x + xxx+1, base.y + yyy+1, base.z + zzz); - Vector3f v4 = new Vector3f(base.x + xxx+1, base.y + yyy , base.z + zzz); + Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz); + Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz); + Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy + 1, base.z() + zzz); + Vector3f v4 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz); Vector2f t1 = new Vector2f(0, 0); Vector2f t2 = new Vector2f(0, 1); Vector2f t3 = new Vector2f(1, 1); Vector2f t4 = new Vector2f(1, 0); Vector3f n1 = new Vector3f(0, 0, -1); if (type == VoxelType.NATIVE_UNBREAKABLE) { - unbreakable.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.unbreakable.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_DIRT) { - dirt.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.dirt.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_STONE) { - stone.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.stone.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_GRASS) { - grass.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.grass.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } } - private void drawPlane_anti(Vector3i base, int xxx, int yyy, int zzz, int type) { + + private void drawPlane_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) { //Log.warning("Add plane Z : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz)); - Vector3f v1 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz); - Vector3f v2 = new Vector3f(base.x + xxx , base.y + yyy+1, base.z + zzz); - Vector3f v3 = new Vector3f(base.x + xxx+1, base.y + yyy+1, base.z + zzz); - Vector3f v4 = new Vector3f(base.x + xxx+1, base.y + yyy , base.z + zzz); + Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz); + Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz); + Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy + 1, base.z() + zzz); + Vector3f v4 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz); Vector2f t1 = new Vector2f(0, 0); Vector2f t2 = new Vector2f(0, 1); Vector2f t3 = new Vector2f(1, 1); Vector2f t4 = new Vector2f(1, 0); Vector3f n1 = new Vector3f(0, 0, 1); if (type == VoxelType.NATIVE_UNBREAKABLE) { - unbreakable.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.unbreakable.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_DIRT) { - dirt.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.dirt.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_STONE) { - stone.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.stone.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_GRASS) { - grass.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.grass.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } } - private void drawPlaneVerticalX(Vector3i base, int xxx, int yyy, int zzz, int type) { + + private void drawPlaneVerticalX(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) { //Log.warning("Add plane X : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz)); - Vector3f v1 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz); - Vector3f v2 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz+1); - Vector3f v3 = new Vector3f(base.x + xxx , base.y + yyy+1, base.z + zzz+1); - Vector3f v4 = new Vector3f(base.x + xxx , base.y + yyy+1, base.z + zzz); + Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz); + Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1); + Vector3f v3 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz + 1); + Vector3f v4 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz); Vector2f t1 = new Vector2f(0, 0); Vector2f t2 = new Vector2f(0, 1); Vector2f t3 = new Vector2f(1, 1); Vector2f t4 = new Vector2f(1, 0); Vector3f n1 = new Vector3f(-1, 0, 0); if (type == VoxelType.NATIVE_UNBREAKABLE) { - unbreakable.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.unbreakable.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_DIRT) { - dirt.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.dirt.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_STONE) { - stone.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.stone.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_GRASS) { - grass.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.grass.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } } - private void drawPlaneVerticalX_anti(Vector3i base, int xxx, int yyy, int zzz, int type) { + + private void drawPlaneVerticalX_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) { //Log.warning("Add plane X : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz)); - Vector3f v1 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz); - Vector3f v2 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz+1); - Vector3f v3 = new Vector3f(base.x + xxx , base.y + yyy+1, base.z + zzz+1); - Vector3f v4 = new Vector3f(base.x + xxx , base.y + yyy+1, base.z + zzz); + Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz); + Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1); + Vector3f v3 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz + 1); + Vector3f v4 = new Vector3f(base.x() + xxx, base.y() + yyy + 1, base.z() + zzz); Vector2f t1 = new Vector2f(0, 0); Vector2f t2 = new Vector2f(0, 1); Vector2f t3 = new Vector2f(1, 1); Vector2f t4 = new Vector2f(1, 0); Vector3f n1 = new Vector3f(1, 0, 0); if (type == VoxelType.NATIVE_UNBREAKABLE) { - unbreakable.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.unbreakable.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_DIRT) { - dirt.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.dirt.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_STONE) { - stone.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.stone.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_GRASS) { - grass.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.grass.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } } - private void drawPlaneVerticalY(Vector3i base, int xxx, int yyy, int zzz, int type) { + + private void drawPlaneVerticalY(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) { //Log.warning("Add plane Y : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz)); - Vector3f v1 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz); - Vector3f v2 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz+1); - Vector3f v3 = new Vector3f(base.x + xxx+1, base.y + yyy , base.z + zzz+1); - Vector3f v4 = new Vector3f(base.x + xxx+1, base.y + yyy , base.z + zzz); + Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz); + Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1); + Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz + 1); + Vector3f v4 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz); Vector2f t1 = new Vector2f(0, 0); Vector2f t2 = new Vector2f(0, 1); Vector2f t3 = new Vector2f(1, 1); Vector2f t4 = new Vector2f(1, 0); Vector3f n1 = new Vector3f(0, 1, 0); if (type == VoxelType.NATIVE_UNBREAKABLE) { - unbreakable.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.unbreakable.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_DIRT) { - dirt.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.dirt.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_STONE) { - stone.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.stone.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } else if (type == VoxelType.NATIVE_GRASS) { - grass.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); + this.grass.addQuad(v1, v2, v3, v4, t1, t2, t3, t4, n1); } } - private void drawPlaneVerticalY_anti(Vector3i base, int xxx, int yyy, int zzz, int type) { + + private void drawPlaneVerticalY_anti(final Vector3i base, final int xxx, final int yyy, final int zzz, final int type) { //Log.warning("Add plane Y : " + (base.x + xxx) + ", " + (base.y + yyy) + ", " + (base.z + zzz)); - Vector3f v1 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz); - Vector3f v2 = new Vector3f(base.x + xxx , base.y + yyy , base.z + zzz+1); - Vector3f v3 = new Vector3f(base.x + xxx+1, base.y + yyy , base.z + zzz+1); - Vector3f v4 = new Vector3f(base.x + xxx+1, base.y + yyy , base.z + zzz); + Vector3f v1 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz); + Vector3f v2 = new Vector3f(base.x() + xxx, base.y() + yyy, base.z() + zzz + 1); + Vector3f v3 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz + 1); + Vector3f v4 = new Vector3f(base.x() + xxx + 1, base.y() + yyy, base.z() + zzz); Vector2f t1 = new Vector2f(0, 0); Vector2f t2 = new Vector2f(0, 1); Vector2f t3 = new Vector2f(1, 1); Vector2f t4 = new Vector2f(1, 0); Vector3f n1 = new Vector3f(0, -1, 0); if (type == VoxelType.NATIVE_UNBREAKABLE) { - unbreakable.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.unbreakable.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_DIRT) { - dirt.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.dirt.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_STONE) { - stone.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.stone.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } else if (type == VoxelType.NATIVE_GRASS) { - grass.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); + this.grass.addQuad(v1, v4, v3, v2, t1, t4, t3, t2, n1); } } @Override - public void update(float timeStep) { - Log.warning("update : " + timeStep); - if (chunk.haveChange() == false) { - return; - } - Log.warning(" ==> YES"); - Voxel[][][] data = chunk.getData(); - unbreakable.clear(); - stone.clear(); - dirt.clear(); - grass.clear(); - for (int xxx=0; xxx < VoxelChunk.VOXEL_CHUNK_SIZE; xxx++) { - for (int yyy=0; yyy < VoxelChunk.VOXEL_CHUNK_SIZE; yyy++) { - for (int zzz=0; zzz < VoxelChunk.VOXEL_CHUNK_SIZE; zzz++) { - Voxel current = data[xxx][yyy][zzz]; - if (current.active == false) { - continue; - } - Voxel bottom = chunk.getVoxel(xxx, yyy, zzz-1); - if (bottom == null || bottom.active == false) { - drawPlane(chunk.getPosition(), xxx, yyy, zzz, current.type); - } - Voxel up = chunk.getVoxel(xxx, yyy, zzz+1); - if (up == null || up.active == false) { - drawPlane_anti(chunk.getPosition(), xxx, yyy, zzz+1, current.type); - } - Voxel left = chunk.getVoxel(xxx-1, yyy, zzz); - if (left == null || left.active == false) { - drawPlaneVerticalX(chunk.getPosition(), xxx, yyy, zzz, current.type); - } - Voxel right = chunk.getVoxel(xxx+1, yyy, zzz); - if (right == null || right.active == false) { - drawPlaneVerticalX_anti(chunk.getPosition(), xxx+1, yyy, zzz, current.type); - } - Voxel front = chunk.getVoxel(xxx, yyy-1, zzz); - if (front == null || front.active == false) { - drawPlaneVerticalY_anti(chunk.getPosition(), xxx, yyy, zzz, current.type); - } - Voxel back = chunk.getVoxel(xxx, yyy+1, zzz); - if (back == null || back.active == false) { - drawPlaneVerticalY(chunk.getPosition(), xxx, yyy+1, zzz, current.type); - } - } - } - } - unbreakable.flush(); - stone.flush(); - dirt.flush(); - grass.flush(); - } - - @Override - public void render(String name) { + public void render(final String name) { //Log.warning("Render : " + name); super.render(name); } + @Override + public void update(final float timeStep) { + Log.warning("update : " + timeStep); + if (this.chunk.haveChange() == false) { + return; + } + Log.warning(" ==> YES"); + Voxel[][][] data = this.chunk.getData(); + this.unbreakable.clear(); + this.stone.clear(); + this.dirt.clear(); + this.grass.clear(); + for (int xxx = 0; xxx < VoxelChunk.VOXEL_CHUNK_SIZE; xxx++) { + for (int yyy = 0; yyy < VoxelChunk.VOXEL_CHUNK_SIZE; yyy++) { + for (int zzz = 0; zzz < VoxelChunk.VOXEL_CHUNK_SIZE; zzz++) { + Voxel current = data[xxx][yyy][zzz]; + if (current.active == false) { + continue; + } + Voxel bottom = this.chunk.getVoxel(xxx, yyy, zzz - 1); + if (bottom == null || bottom.active == false) { + drawPlane(this.chunk.getPosition(), xxx, yyy, zzz, current.type); + } + Voxel up = this.chunk.getVoxel(xxx, yyy, zzz + 1); + if (up == null || up.active == false) { + drawPlane_anti(this.chunk.getPosition(), xxx, yyy, zzz + 1, current.type); + } + Voxel left = this.chunk.getVoxel(xxx - 1, yyy, zzz); + if (left == null || left.active == false) { + drawPlaneVerticalX(this.chunk.getPosition(), xxx, yyy, zzz, current.type); + } + Voxel right = this.chunk.getVoxel(xxx + 1, yyy, zzz); + if (right == null || right.active == false) { + drawPlaneVerticalX_anti(this.chunk.getPosition(), xxx + 1, yyy, zzz, current.type); + } + Voxel front = this.chunk.getVoxel(xxx, yyy - 1, zzz); + if (front == null || front.active == false) { + drawPlaneVerticalY_anti(this.chunk.getPosition(), xxx, yyy, zzz, current.type); + } + Voxel back = this.chunk.getVoxel(xxx, yyy + 1, zzz); + if (back == null || back.active == false) { + drawPlaneVerticalY(this.chunk.getPosition(), xxx, yyy + 1, zzz, current.type); + } + } + } + } + this.unbreakable.flush(); + this.stone.flush(); + this.dirt.flush(); + this.grass.flush(); + } + } diff --git a/src/org/atriasoft/ege/map/MapVoxel.java b/src/org/atriasoft/ege/map/MapVoxel.java index c841115..b678c42 100644 --- a/src/org/atriasoft/ege/map/MapVoxel.java +++ b/src/org/atriasoft/ege/map/MapVoxel.java @@ -55,7 +55,7 @@ public class MapVoxel extends EngineMap { private void addNewChunk(Vector3i position) { // simple sun to have a global light ... Entity tmpEntity = new Entity(this.env); - tmpEntity.addComponent(new ComponentPosition(new Transform3D(new Vector3f(position.x,position.y,0)))); + tmpEntity.addComponent(new ComponentPosition(new Transform3D(new Vector3f(position.x(),position.y(),0)))); VoxelChunk tmpVoxelChunk = new VoxelChunk(this, position); tmpEntity.addComponent(tmpVoxelChunk); ComponentDynamicMeshsVoxelMap mesh = new ComponentDynamicMeshsVoxelMap(tmpVoxelChunk); @@ -72,7 +72,7 @@ public class MapVoxel extends EngineMap { new Uri("DATA", "basicMaterial.vert"), new Uri("DATA", "basicMaterial.frag"), (EngineLight)env.getEngine(EngineLight.ENGINE_NAME))); - ComponentPhysics physics = new ComponentPhysics(false); + ComponentPhysics physics = new ComponentPhysics(this.env); //PhysicMapVoxel box = new PhysicMapVoxel(tmpVoxelChunk); //physics.addShape(box); //physics.setStaticObject(true); diff --git a/src/org/atriasoft/ege/physics/shape/Shape.java b/src/org/atriasoft/ege/physics/shape/Shape.java index b82942b..a7e2cf0 100644 --- a/src/org/atriasoft/ege/physics/shape/Shape.java +++ b/src/org/atriasoft/ege/physics/shape/Shape.java @@ -9,9 +9,9 @@ import org.atriasoft.etk.math.Quaternion; import org.atriasoft.etk.math.Vector3f; public class Shape { - private Quaternion orientation = Quaternion.identity(); + private Quaternion orientation = Quaternion.IDENTITY; private float mass = 1; //!< element mass in "g" then 1000 for 1kg - private Vector3f origin = new Vector3f(0, 0, 0); + private Vector3f origin = Vector3f.ZERO; public void display() { @@ -22,7 +22,7 @@ public class Shape { } public Quaternion getOrientation() { - return this.orientation.clone(); + return this.orientation; } public Vector3f getOrigin() { diff --git a/src/org/atriasoft/ege/resource/ResourceListTexturedMesh.java b/src/org/atriasoft/ege/resource/ResourceListTexturedMesh.java index 7d5e1b0..5b945d9 100644 --- a/src/org/atriasoft/ege/resource/ResourceListTexturedMesh.java +++ b/src/org/atriasoft/ege/resource/ResourceListTexturedMesh.java @@ -4,108 +4,109 @@ import java.util.ArrayList; import java.util.List; import org.atriasoft.etk.Uri; -import org.atriasoft.etk.math.Vector3f; import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.etk.math.Vector3f; import org.atriasoft.gale.backend3d.OpenGL.RenderMode; import org.atriasoft.gale.resource.ResourceVirtualArrayObject; -import org.atriasoft.ege.internal.Log; - - public class ResourceListTexturedMesh extends ResourceStaticMesh { - protected List vertices = new ArrayList(); - protected List textureCoords = new ArrayList(); - protected List normals = new ArrayList(); - protected List indices = new ArrayList(); - - protected ResourceListTexturedMesh(Uri uriFile) { - super(uriFile); - addResourceType("ResourceListTexturedMesh"); - } - protected ResourceListTexturedMesh(RenderMode mode) { - super(mode); - addResourceType("ResourceListTexturedMesh"); - } - - private float[] toFloatArray(List values) { - float[] out = new float[values.size()]; - for (int iii=0; iii values) { - int[] out = new int[values.size()]; - for (int iii=0; iii values) { - float[] out = new float[values.size()*3]; - for (int iii=0; iii values) { - float[] out = new float[values.size()*2]; - for (int iii=0; iii vertices = new ArrayList<>(); + protected List textureCoords = new ArrayList<>(); + protected List normals = new ArrayList<>(); + + protected List indices = new ArrayList<>(); + + protected ResourceListTexturedMesh(final RenderMode mode) { + super(mode); + } + + protected ResourceListTexturedMesh(final Uri uriFile) { + super(uriFile); + } + + public void addQuad(final Vector3f v1, final Vector3f v2, final Vector3f v3, final Vector3f v4, final Vector2f t1, final Vector2f t2, final Vector2f t3, final Vector2f t4, final Vector3f n1) { + addTriangle(v1, v2, v3, t1, t2, t3, n1, n1, n1); + addTriangle(v1, v3, v4, t1, t3, t4, n1, n1, n1); + } + + public void addQuad(final Vector3f v1, final Vector3f v2, final Vector3f v3, final Vector3f v4, final Vector2f t1, final Vector2f t2, final Vector2f t3, final Vector2f t4, final Vector3f n1, + final Vector3f n2, final Vector3f n3, final Vector3f n4) { + addTriangle(v1, v2, v3, t1, t2, t3, n1, n2, n3); + addTriangle(v1, v3, v4, t1, t3, t4, n1, n3, n4); + } + + public void addTriangle(final Vector3f v1, final Vector3f v2, final Vector3f v3, final Vector2f t1, final Vector2f t2, final Vector2f t3, final Vector3f n1, final Vector3f n2, final Vector3f n3) { + this.vertices.add(v1); + this.vertices.add(v2); + this.vertices.add(v3); + this.textureCoords.add(t1); + this.textureCoords.add(t2); + this.textureCoords.add(t3); + this.normals.add(n1); + this.normals.add(n2); + this.normals.add(n3); + this.indices.add(this.vertices.size() - 3); + this.indices.add(this.vertices.size() - 2); + this.indices.add(this.vertices.size() - 1); + } + + public void clear() { + this.vertices.clear(); + this.textureCoords.clear(); + this.normals.clear(); + this.indices.clear(); + } + + /** + * Send the data to the graphic card. + */ + public void flush() { + // request to the manager to be call at the next update ... + this.vao = ResourceVirtualArrayObject.create(toFloatV3(this.vertices), toFloatV2(this.textureCoords), toFloatV3(this.normals), toIntArray(this.indices)); + this.vao.flush(); + } + + private float[] toFloatArray(final List values) { + float[] out = new float[values.size()]; + for (int iii = 0; iii < values.size(); iii++) { + out[iii] = values.get(iii); + } + return out; + } + + private float[] toFloatV2(final List values) { + float[] out = new float[values.size() * 2]; + for (int iii = 0; iii < values.size(); iii++) { + Vector2f tmp = values.get(iii); + out[iii * 2] = tmp.x(); + out[iii * 2 + 1] = tmp.y(); + } + return out; + } + + private float[] toFloatV3(final List values) { + float[] out = new float[values.size() * 3]; + for (int iii = 0; iii < values.size(); iii++) { + Vector3f tmp = values.get(iii); + out[iii * 3] = tmp.x(); + out[iii * 3 + 1] = tmp.y(); + out[iii * 3 + 2] = tmp.z(); + } + return out; + } + + private int[] toIntArray(final List values) { + int[] out = new int[values.size()]; + for (int iii = 0; iii < values.size(); iii++) { + out[iii] = values.get(iii); + } + return out; + } + } diff --git a/src/org/atriasoft/ege/resource/ResourceStaticColoredMesh.java b/src/org/atriasoft/ege/resource/ResourceStaticColoredMesh.java index 01c792c..5d8eddf 100644 --- a/src/org/atriasoft/ege/resource/ResourceStaticColoredMesh.java +++ b/src/org/atriasoft/ege/resource/ResourceStaticColoredMesh.java @@ -1,48 +1,42 @@ package org.atriasoft.ege.resource; import org.atriasoft.etk.Uri; -import org.atriasoft.ege.internal.Log; import org.atriasoft.gale.backend3d.OpenGL.RenderMode; import org.atriasoft.gale.resource.ResourceVirtualArrayObject; - public class ResourceStaticColoredMesh extends ResourceStaticMesh { + public static ResourceStaticColoredMesh create(final float[] vertices, final float[] colors, final float[] normals, final int[] indices, final RenderMode mode) { + ResourceStaticColoredMesh resource = new ResourceStaticColoredMesh(vertices, colors, normals, indices, mode); + getManager().localAdd(resource); + return resource; + } + protected float[] vertices = null; protected float[] colors = null; protected float[] normals = null; + protected int[] indices = null; - - protected ResourceStaticColoredMesh(Uri uriFile) { - super(uriFile); - addResourceType("ResourceStaticColoredMesh"); - } - protected ResourceStaticColoredMesh(float[] vertices, float[] colors, - float[] normals, int[] indices, RenderMode mode) { + + protected ResourceStaticColoredMesh(final float[] vertices, final float[] colors, final float[] normals, final int[] indices, final RenderMode mode) { super(mode); - addResourceType("ResourceStaticColoredMesh"); this.vertices = vertices; this.colors = colors; this.normals = normals; this.indices = indices; flush(); } + + protected ResourceStaticColoredMesh(final Uri uriFile) { + super(uriFile); + } + /** - * @brief Send the data to the graphic card. + * Send the data to the graphic card. */ public void flush() { // request to the manager to be call at the next update ... - vao = ResourceVirtualArrayObject.create(this.vertices, this.colors, null, this.normals, this.indices); - vao.flush(); + this.vao = ResourceVirtualArrayObject.create(this.vertices, this.colors, null, this.normals, this.indices); + this.vao.flush(); } - public static ResourceStaticColoredMesh create(float[] vertices, float[] colors, - float[] normals, int[] indices, RenderMode mode) { - ResourceStaticColoredMesh resource = new ResourceStaticColoredMesh(vertices, colors, normals, indices, mode); - if (resource.resourceHasBeenCorectlyInit() == false) { - Log.critical("resource Is not correctly init: ResourceVirtualBufferObject"); - } - getManager().localAdd(resource); - return resource; - } - } diff --git a/src/org/atriasoft/ege/resource/ResourceStaticMesh.java b/src/org/atriasoft/ege/resource/ResourceStaticMesh.java index 222a514..4a575de 100644 --- a/src/org/atriasoft/ege/resource/ResourceStaticMesh.java +++ b/src/org/atriasoft/ege/resource/ResourceStaticMesh.java @@ -5,53 +5,51 @@ import org.atriasoft.gale.backend3d.OpenGL.RenderMode; import org.atriasoft.gale.resource.Resource; import org.atriasoft.gale.resource.ResourceVirtualArrayObject; - public class ResourceStaticMesh extends Resource { protected ResourceVirtualArrayObject vao = null; protected RenderMode mode = RenderMode.quadStrip; - - protected ResourceStaticMesh(Uri uriFile) { - super(uriFile); - addResourceType("ResourceStaticMesh"); - } - protected ResourceStaticMesh(RenderMode mode) { + + protected ResourceStaticMesh(final RenderMode mode) { super(); - addResourceType("ResourceStaticMesh"); this.mode = mode; } + protected ResourceStaticMesh(final Uri uriFile) { + super(uriFile); + } + public void bindForRendering() { - if (vao == null) { + if (this.vao == null) { return; } - vao.bindForRendering(); - } - - public void unBindForRendering() { - if (vao == null) { - return; - } - vao.unBindForRendering(); - } - - public void render() { - if (vao == null) { - return; - } - vao.render(mode); + this.vao.bindForRendering(); } @Override public void cleanUp() { - vao.cleanUp(); + this.vao.cleanUp(); } - + public RenderMode getMode() { - return mode; + return this.mode; } - - public void setMode(RenderMode mode) { + + public void render() { + if (this.vao == null) { + return; + } + this.vao.render(this.mode); + } + + public void setMode(final RenderMode mode) { this.mode = mode; } - + + public void unBindForRendering() { + if (this.vao == null) { + return; + } + this.vao.unBindForRendering(); + } + } diff --git a/src/org/atriasoft/ege/resource/ResourceStaticMeshObj.java b/src/org/atriasoft/ege/resource/ResourceStaticMeshObj.java index cd4059d..def2bf1 100644 --- a/src/org/atriasoft/ege/resource/ResourceStaticMeshObj.java +++ b/src/org/atriasoft/ege/resource/ResourceStaticMeshObj.java @@ -1,7 +1,7 @@ package org.atriasoft.ege.resource; -import org.atriasoft.etk.Uri; import org.atriasoft.ege.internal.Log; +import org.atriasoft.etk.Uri; import org.atriasoft.gale.backend3d.OpenGL.RenderMode; import org.atriasoft.gale.resource.Resource; @@ -9,51 +9,44 @@ import objConverter.ModelData; import objConverter.OBJFileLoader; public class ResourceStaticMeshObj extends ResourceStaticTexturedMesh { - private final Uri uriFile; - - public ResourceStaticMeshObj(Uri uriFile) { - super(uriFile); - addResourceType("ResourceStaticMeshObj"); - this.uriFile = uriFile; - System.out.println("Load file " + uriFile); - ModelData data = OBJFileLoader.loadOBJ(uriFile.get()); - this.vertices = data.getVertices(); - this.textureCoords = data.getTextureCoords(); - this.normals = data.getNormals(); - this.indices = data.getIndices(); - mode = RenderMode.triangle; - flush(); - } - - public Uri getUriFile() { - return uriFile; - } - - - public static ResourceStaticMeshObj create(Uri uriObj) { + public static ResourceStaticMeshObj create(final Uri uriObj) { ResourceStaticMeshObj resource; Resource resource2; - String name = uriObj.getValue(); - if (name.isEmpty() == false && name != "---") { - resource2 = getManager().localKeep(name); - } else { + final String name = uriObj.getValue(); + if (name.isEmpty() || name.equals("---")) { Log.error("Can not create a shader without a filaname"); return null; } + resource2 = Resource.getManager().localKeep(name); if (resource2 != null) { if (resource2 instanceof ResourceStaticMeshObj) { resource2.keep(); - return (ResourceStaticMeshObj)resource2; + return (ResourceStaticMeshObj) resource2; } Log.critical("Request resource file : '" + name + "' With the wrong type (dynamic cast error)"); return null; } resource = new ResourceStaticMeshObj(uriObj); - if (resource.resourceHasBeenCorectlyInit() == false) { - Log.critical("resource Is not correctly init : ResourceProgram" ); - return null; - } - getManager().localAdd(resource); + Resource.getManager().localAdd(resource); return resource; } + + private final Uri uriFile; + + public ResourceStaticMeshObj(final Uri uriFile) { + super(uriFile); + this.uriFile = uriFile; + System.out.println("Load file " + uriFile); + final ModelData data = OBJFileLoader.loadOBJ(uriFile); + this.vertices = data.getVertices(); + this.textureCoords = data.getTextureCoords(); + this.normals = data.getNormals(); + this.indices = data.getIndices(); + this.mode = RenderMode.triangle; + flush(); + } + + public Uri getUriFile() { + return this.uriFile; + } } diff --git a/src/org/atriasoft/ege/resource/ResourceStaticTexturedMesh.java b/src/org/atriasoft/ege/resource/ResourceStaticTexturedMesh.java index 7ed0075..ab40755 100644 --- a/src/org/atriasoft/ege/resource/ResourceStaticTexturedMesh.java +++ b/src/org/atriasoft/ege/resource/ResourceStaticTexturedMesh.java @@ -1,47 +1,41 @@ package org.atriasoft.ege.resource; import org.atriasoft.etk.Uri; -import org.atriasoft.ege.internal.Log; import org.atriasoft.gale.backend3d.OpenGL.RenderMode; import org.atriasoft.gale.resource.ResourceVirtualArrayObject; - public class ResourceStaticTexturedMesh extends ResourceStaticMesh { + public static ResourceStaticTexturedMesh create(final float[] vertices, final float[] textureCoordinates, final float[] normals, final int[] indices, final RenderMode mode) { + ResourceStaticTexturedMesh resource = new ResourceStaticTexturedMesh(vertices, textureCoordinates, normals, indices, mode); + getManager().localAdd(resource); + return resource; + } + protected float[] vertices = null; protected float[] textureCoords = null; protected float[] normals = null; + protected int[] indices = null; - - protected ResourceStaticTexturedMesh(Uri uriFile) { - super(uriFile); - addResourceType("ResourceStaticTexturedMesh"); - } - protected ResourceStaticTexturedMesh(float[] vertices, float[] textureCoordinates, - float[] normals, int[] indices, RenderMode mode) { + + protected ResourceStaticTexturedMesh(final float[] vertices, final float[] textureCoordinates, final float[] normals, final int[] indices, final RenderMode mode) { super(mode); - addResourceType("ResourceStaticTexturedMesh"); this.vertices = vertices; this.textureCoords = textureCoordinates; this.normals = normals; this.indices = indices; } + + protected ResourceStaticTexturedMesh(final Uri uriFile) { + super(uriFile); + } + /** - * @brief Send the data to the graphic card. + * Send the data to the graphic card. */ public void flush() { // request to the manager to be call at the next update ... - vao = ResourceVirtualArrayObject.create(this.vertices, this.textureCoords, this.normals, this.indices); - vao.flush(); + this.vao = ResourceVirtualArrayObject.create(this.vertices, this.textureCoords, this.normals, this.indices); + this.vao.flush(); } - public static ResourceStaticTexturedMesh create(float[] vertices, float[] textureCoordinates, - float[] normals, int[] indices, RenderMode mode) { - ResourceStaticTexturedMesh resource = new ResourceStaticTexturedMesh(vertices, textureCoordinates, normals, indices, mode); - if (resource.resourceHasBeenCorectlyInit() == false) { - Log.critical("resource Is not correctly init: ResourceVirtualBufferObject"); - } - getManager().localAdd(resource); - return resource; - } - } diff --git a/src/org/atriasoft/ege/samples/LoxelEngine/LoxelApplication.java b/src/org/atriasoft/ege/samples/LoxelEngine/LoxelApplication.java index 255a230..8544179 100644 --- a/src/org/atriasoft/ege/samples/LoxelEngine/LoxelApplication.java +++ b/src/org/atriasoft/ege/samples/LoxelEngine/LoxelApplication.java @@ -10,23 +10,6 @@ import org.atriasoft.ege.Environement; import org.atriasoft.ege.GameStatus; import org.atriasoft.ege.Light; import org.atriasoft.ege.Material; -import org.atriasoft.etk.Color; -import org.atriasoft.etk.Uri; -import org.atriasoft.etk.math.Matrix4f; -import org.atriasoft.etk.math.Quaternion; -import org.atriasoft.etk.math.Transform3D; -import org.atriasoft.etk.math.Vector2f; -import org.atriasoft.etk.math.Vector3f; -import org.atriasoft.gale.Application; -import org.atriasoft.gale.Gale; -import org.atriasoft.gale.backend3d.OpenGL; -import org.atriasoft.gale.backend3d.OpenGL.Flag; -import org.atriasoft.gale.context.Context; -import org.atriasoft.gale.key.KeyKeyboard; -import org.atriasoft.gale.key.KeySpecial; -import org.atriasoft.gale.key.KeyStatus; -import org.atriasoft.gale.key.KeyType; -import org.atriasoft.gale.resource.ResourceColored3DObject; import org.atriasoft.ege.camera.Camera; import org.atriasoft.ege.components.ComponentGravityStatic; import org.atriasoft.ege.components.ComponentLight; @@ -47,21 +30,38 @@ import org.atriasoft.ege.engines.EnginePhysics; import org.atriasoft.ege.map.MapVoxel; import org.atriasoft.ege.physics.shape.Box; import org.atriasoft.ege.tools.MeshGenerator; +import org.atriasoft.etk.Color; +import org.atriasoft.etk.Uri; +import org.atriasoft.etk.math.Matrix4f; +import org.atriasoft.etk.math.Quaternion; +import org.atriasoft.etk.math.Transform3D; +import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.etk.math.Vector3f; +import org.atriasoft.gale.Application; +import org.atriasoft.gale.Gale; +import org.atriasoft.gale.backend3d.OpenGL; +import org.atriasoft.gale.backend3d.OpenGL.Flag; +import org.atriasoft.gale.context.Context; +import org.atriasoft.gale.key.KeyKeyboard; +import org.atriasoft.gale.key.KeySpecial; +import org.atriasoft.gale.key.KeyStatus; +import org.atriasoft.gale.key.KeyType; +import org.atriasoft.gale.resource.ResourceColored3DObject; public class LoxelApplication extends Application { // public static ComponentPosition relativeTestPos; // public static Box boxTest; - public static List testPoints = new ArrayList(); - public static List testPointsBox = new ArrayList(); - public static List testPointsCollide = new ArrayList(); + public static List testPoints = new ArrayList<>(); + public static List testPointsBox = new ArrayList<>(); + public static List testPointsCollide = new ArrayList<>(); public static Vector3f testRpos; public static Quaternion testQTransfert; public static Vector3f box1HalfSize; public static Vector3f box2HalfSize; private Environement env; private ComponentPosition objectPosition; - private final Quaternion basicRotation = Quaternion.identity(); - private final Quaternion basicRotation2 = Quaternion.identity(); + private Quaternion basicRotation = Quaternion.IDENTITY; + private Quaternion basicRotation2 = Quaternion.IDENTITY; private boolean creationDone; private ControlCameraPlayer simpleControl; private ComponentPosition lightPosition; @@ -179,8 +179,8 @@ public class LoxelApplication extends Application { { // add a cube to test collision ... final Entity localBox = new Entity(this.env); - final Quaternion orientation = new Quaternion(0.5f, 0.2f, 0.4f, 1); - orientation.normalize(); + Quaternion orientation = new Quaternion(0.5f, 0.2f, 0.4f, 1); + orientation = orientation.normalize(); localBox.addComponent(new ComponentStaticMesh(new Uri("RES", "cube-one.obj"))); localBox.addComponent(new ComponentTexture(new Uri("DATA", "blocks/clay.png"))); localBox.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert"), new Uri("DATA", "basic.frag"))); @@ -216,8 +216,8 @@ public class LoxelApplication extends Application { { // this is the floor final Entity localBox = new Entity(this.env); - final Quaternion orientation = new Quaternion(0, 0, 0, 1); - orientation.normalize(); + Quaternion orientation = new Quaternion(0, 0, 0, 1); + orientation = orientation.normalize(); localBox.addComponent(new ComponentStaticMesh(new Uri("RES", "cube-one.obj"))); localBox.addComponent(new ComponentTexture(new Uri("DATA", "blocks/dirt.png"))); localBox.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert"), new Uri("DATA", "basic.frag"))); @@ -318,8 +318,8 @@ public class LoxelApplication extends Application { // start the engine. this.env.setPropertyStatus(GameStatus.gameStart); - this.basicRotation.setEulerAngles(new Vector3f(0.005f, 0.005f, 0.01f)); - this.basicRotation2.setEulerAngles(new Vector3f(0.003f, 0.01f, 0.001f)); + this.basicRotation = Quaternion.fromEulerAngles(new Vector3f(0.005f, 0.005f, 0.01f)); + this.basicRotation2 = Quaternion.fromEulerAngles(new Vector3f(0.003f, 0.01f, 0.001f)); final Engine tmpEngine = this.env.getEngine("physics"); if (tmpEngine != null) { @@ -371,29 +371,29 @@ public class LoxelApplication extends Application { final Vector3f elem = LoxelApplication.testPoints.get(iii); final boolean collide = LoxelApplication.testPointsCollide.get(iii); if (collide) { - this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 0, 0, 1)); } else if (iii == 0) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(0, 1, 0, 1)); } else if (iii == 7) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 1, 0, 1)); } else { - this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 1, 1, 1)); } } for (int iii = 0; iii < LoxelApplication.testPointsBox.size(); iii++) { final Vector3f elem = LoxelApplication.testPointsBox.get(iii); if (iii == 0) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(0, 1, 0, 1)); } else if (iii == 7) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 1, 0, 1)); } else { - this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(0, 0, 1, 1)); } } @@ -403,7 +403,7 @@ public class LoxelApplication extends Application { //Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z)).multiply(testQTransfert.getMatrix4()).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); //Matrix4f transformation = testQTransfert.getMatrix4().multiply(Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z))).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); //Matrix4f transformation = testQTransfert.getMatrix4().multiply(Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z))).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); - final Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x, testRpos.y, testRpos.z)).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0, 0, 14))) + final Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x(), testRpos.y(), testRpos.z())).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0, 0, 14))) .multiply(testQTransfert.getMatrix4()); // OK sans la box1 orientation ... //Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z)).multiply(testQTransfert.getMatrix4()).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); @@ -442,8 +442,8 @@ public class LoxelApplication extends Application { return; } this.angleLight += 0.01; - this.lightPosition.getTransform().getPosition().x = 5 + (float) Math.cos(this.angleLight) * 7.0f; - this.lightPosition.getTransform().getPosition().y = 5 + (float) Math.sin(this.angleLight) * 7.0f; + this.lightPosition.setTransform(this.lightPosition.getTransform() + .withPosition(new Vector3f(5 + (float) Math.cos(this.angleLight) * 7.0f, 5 + (float) Math.sin(this.angleLight) * 7.0f, this.lightPosition.getTransform().getPosition().z()))); this.env.periodicCall(); markDrawingIsNeeded(); } diff --git a/src/org/atriasoft/ege/samples/collisiontest/CollisionTestApplication.java b/src/org/atriasoft/ege/samples/collisiontest/CollisionTestApplication.java index 694a49a..0812b89 100644 --- a/src/org/atriasoft/ege/samples/collisiontest/CollisionTestApplication.java +++ b/src/org/atriasoft/ege/samples/collisiontest/CollisionTestApplication.java @@ -10,23 +10,6 @@ import org.atriasoft.ege.Environement; import org.atriasoft.ege.GameStatus; import org.atriasoft.ege.Light; import org.atriasoft.ege.Material; -import org.atriasoft.etk.Color; -import org.atriasoft.etk.Uri; -import org.atriasoft.etk.math.Matrix4f; -import org.atriasoft.etk.math.Quaternion; -import org.atriasoft.etk.math.Transform3D; -import org.atriasoft.etk.math.Vector2f; -import org.atriasoft.etk.math.Vector3f; -import org.atriasoft.gale.Application; -import org.atriasoft.gale.Gale; -import org.atriasoft.gale.backend3d.OpenGL; -import org.atriasoft.gale.backend3d.OpenGL.Flag; -import org.atriasoft.gale.context.Context; -import org.atriasoft.gale.key.KeyKeyboard; -import org.atriasoft.gale.key.KeySpecial; -import org.atriasoft.gale.key.KeyStatus; -import org.atriasoft.gale.key.KeyType; -import org.atriasoft.gale.resource.ResourceColored3DObject; import org.atriasoft.ege.camera.Camera; import org.atriasoft.ege.components.ComponentGravityStatic; import org.atriasoft.ege.components.ComponentLight; @@ -47,28 +30,45 @@ import org.atriasoft.ege.engines.EnginePhysics; import org.atriasoft.ege.map.MapVoxel; import org.atriasoft.ege.physics.shape.Box; import org.atriasoft.ege.tools.MeshGenerator; +import org.atriasoft.etk.Color; +import org.atriasoft.etk.Uri; +import org.atriasoft.etk.math.Matrix4f; +import org.atriasoft.etk.math.Quaternion; +import org.atriasoft.etk.math.Transform3D; +import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.etk.math.Vector3f; +import org.atriasoft.gale.Application; +import org.atriasoft.gale.Gale; +import org.atriasoft.gale.backend3d.OpenGL; +import org.atriasoft.gale.backend3d.OpenGL.Flag; +import org.atriasoft.gale.context.Context; +import org.atriasoft.gale.key.KeyKeyboard; +import org.atriasoft.gale.key.KeySpecial; +import org.atriasoft.gale.key.KeyStatus; +import org.atriasoft.gale.key.KeyType; +import org.atriasoft.gale.resource.ResourceColored3DObject; public class CollisionTestApplication extends Application { - // public static ComponentPosition relativeTestPos; - // public static Box boxTest; - public static List testPoints = new ArrayList(); - public static List testPointsBox = new ArrayList(); - public static List testPointsCollide = new ArrayList(); - public static Vector3f testRpos; - public static Quaternion testQTransfert; public static Vector3f box1HalfSize; public static Vector3f box2HalfSize; - private Environement env; - private ComponentPosition objectPosition; - private final Quaternion basicRotation = Quaternion.identity(); - private final Quaternion basicRotation2 = Quaternion.identity(); - private boolean creationDone; - private ControlCameraPlayer simpleControl; - private ComponentPosition lightPosition; + // public static ComponentPosition relativeTestPos; + // public static Box boxTest; + public static List testPoints = new ArrayList<>(); + public static List testPointsBox = new ArrayList<>(); + public static List testPointsCollide = new ArrayList<>(); + public static Quaternion testQTransfert; + public static Vector3f testRpos; private float angleLight = 0; + private Quaternion basicRotation = Quaternion.IDENTITY; + private Quaternion basicRotation2 = Quaternion.IDENTITY; + private boolean creationDone; + private ResourceColored3DObject debugDrawProperty; + private Environement env; + private ComponentPosition lightPosition; private MapVoxel map; private ComponentPlayer objectPlayer; - private ResourceColored3DObject debugDrawProperty; + private ComponentPosition objectPosition; + private ControlCameraPlayer simpleControl; public CollisionTestApplication() { this.creationDone = false; @@ -95,7 +95,7 @@ public class CollisionTestApplication extends Application { // simple sun to have a global light ... final Entity sun = new Entity(this.env); sun.addComponent(new ComponentPosition(new Transform3D(new Vector3f(1000, 1000, 1000)))); - sun.addComponent(new ComponentLightSun(new Light(new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0, 0, 0), new Vector3f(0.8f, 0, 0)))); + sun.addComponent(new ComponentLightSun(new Light(new Vector3f(0.4f, 0.4f, 0.4f), Vector3f.ZERO, new Vector3f(0.8f, 0, 0)))); this.env.addEntity(sun); // add a cube to show where in the light ... @@ -112,17 +112,17 @@ public class CollisionTestApplication extends Application { { // this is the floor final Entity localBox = new Entity(this.env); - final Quaternion orientation = new Quaternion(0, 0, 0, 1); - orientation.normalize(); + Quaternion orientation = new Quaternion(0, 0, 0, 1); + orientation = orientation.normalize(); localBox.addComponent(new ComponentStaticMesh(new Uri("RES", "cube-one.obj"))); - localBox.addComponent(new ComponentTexture(new Uri("DATA", "blocks/dirt.png"))); - localBox.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert"), new Uri("DATA", "basic.frag"))); + localBox.addComponent(new ComponentTexture(new Uri("DATA", "blocks/dirt.png", "loxelEngine"))); + localBox.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert", "loxelEngine"), new Uri("DATA", "basic.frag", "loxelEngine"))); final ComponentPhysics physics2 = new ComponentPhysics(this.env); physics2.setBodyType(PhysicBodyType.BODY_STATIC); - physics2.setTransform(new Transform3D(new Vector3f(0, 0, 0.0f), orientation)); + physics2.setTransform(new Transform3D(Vector3f.ZERO, orientation)); final Box box2 = new Box(); box2.setSize(new Vector3f(5.0f, 5.0f, 0.5f)); - box2.setOrigin(new Vector3f(0, 0, 0)); + box2.setOrigin(Vector3f.ZERO); box2.setMass(0); physics2.addShape(box2); localBox.addComponent(physics2); @@ -132,15 +132,15 @@ public class CollisionTestApplication extends Application { // add a cube to test collision ... final Entity localBox = new Entity(this.env); localBox.addComponent(new ComponentStaticMesh(new Uri("RES", "cube-one.obj"))); - localBox.addComponent(new ComponentTexture(new Uri("DATA", "blocks/clay.png"))); - localBox.addComponent(new ComponentLight(new Light(new Vector3f(0, 1, 0), new Vector3f(0, 0, 0), new Vector3f(0.8f, 0.03f, 0.002f)))); - localBox.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert"), new Uri("DATA", "basic.frag"))); + localBox.addComponent(new ComponentTexture(new Uri("DATA", "blocks/clay.png", "loxelEngine"))); + localBox.addComponent(new ComponentLight(new Light(new Vector3f(0, 1, 0), Vector3f.ZERO, new Vector3f(0.8f, 0.03f, 0.002f)))); + localBox.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert", "loxelEngine"), new Uri("DATA", "basic.frag", "loxelEngine"))); final ComponentPhysics physics2 = new ComponentPhysics(this.env); //physics2.setTransform(new Transform3D(new Vector3f(0, 0, 0.90f))); physics2.setTransform(new Transform3D(new Vector3f(0, 0, 1.20f))); final Box box2 = new Box(); box2.setSize(new Vector3f(0.5f, 0.5f, 0.5f)); - box2.setOrigin(new Vector3f(0, 0, 0)); + box2.setOrigin(Vector3f.ZERO); box2.setMass(100); physics2.addShape(box2); localBox.addComponent(physics2); @@ -148,9 +148,9 @@ public class CollisionTestApplication extends Application { } final Entity gird = new Entity(this.env); - gird.addComponent(new ComponentPosition(new Transform3D(new Vector3f(0, 0, 0)))); + gird.addComponent(new ComponentPosition(new Transform3D(Vector3f.ZERO))); gird.addComponent(new ComponentStaticMesh(MeshGenerator.createGrid(5))); - gird.addComponent(new ComponentRenderColoredStaticMesh(new Uri("DATA_EGE", "wireColor.vert"), new Uri("DATA_EGE", "wireColor.frag"))); + gird.addComponent(new ComponentRenderColoredStaticMesh(new Uri("DATA", "wireColor.vert", "ege"), new Uri("DATA", "wireColor.frag", "ege"))); this.env.addEntity(gird); final Entity player = new Entity(this.env); @@ -164,7 +164,7 @@ public class CollisionTestApplication extends Application { //player.addComponent(new ComponentStaticMesh(new Uri("RES", "person.obj"))); player.addComponent(new ComponentStaticMesh(new Uri("RES", "person_-yfw_zup.obj"))); player.addComponent(new ComponentTexture(new Uri("RES", "playerTexture.png"))); - player.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert"), new Uri("DATA", "basicMaterial.frag"), + player.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert", "loxelEngine"), new Uri("DATA", "basicMaterial.frag", "loxelEngine"), (EngineLight) this.env.getEngine(EngineLight.ENGINE_NAME))); final ComponentPhysics physics = new ComponentPhysics(this.env, playerTransform); physics.setBodyType(PhysicBodyType.BODY_DYNAMIC); @@ -185,7 +185,7 @@ public class CollisionTestApplication extends Application { //player.addComponent(new ComponentStaticMesh(new Uri("RES", "person.obj"))); player.addComponent(new ComponentStaticMesh(new Uri("RES", "person_-yfw_zup.obj"))); player.addComponent(new ComponentTexture(new Uri("RES", "playerTexture.png"))); - player.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert"), new Uri("DATA", "basicMaterial.frag"), + player.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert", "loxelEngine"), new Uri("DATA", "basicMaterial.frag", "loxelEngine"), (EngineLight) this.env.getEngine(EngineLight.ENGINE_NAME))); this.env.addEntity(player); } @@ -200,8 +200,8 @@ public class CollisionTestApplication extends Application { // start the engine. this.env.setPropertyStatus(GameStatus.gameStart); - this.basicRotation.setEulerAngles(new Vector3f(0.005f, 0.005f, 0.01f)); - this.basicRotation2.setEulerAngles(new Vector3f(0.003f, 0.01f, 0.001f)); + this.basicRotation = Quaternion.fromEulerAngles(new Vector3f(0.005f, 0.005f, 0.01f)); + this.basicRotation2 = Quaternion.fromEulerAngles(new Vector3f(0.003f, 0.01f, 0.001f)); final Engine tmpEngine = this.env.getEngine("physics"); if (tmpEngine != null) { @@ -254,45 +254,46 @@ public class CollisionTestApplication extends Application { final Vector3f elem = CollisionTestApplication.testPoints.get(iii); final boolean collide = CollisionTestApplication.testPointsCollide.get(iii); if (collide) { - this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 0, 0, 1)); } else if (iii == 0) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(0, 1, 0, 1)); } else if (iii == 7) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 1, 0, 1)); } else { - this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 1, 1, 1)); } } for (int iii = 0; iii < CollisionTestApplication.testPointsBox.size(); iii++) { final Vector3f elem = CollisionTestApplication.testPointsBox.get(iii); if (iii == 0) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(0, 1, 0, 1)); } else if (iii == 7) { - this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.05f, 0.05f, 0.05f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(1, 1, 0, 1)); } else { - this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.identity().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(elem.x, elem.y, elem.z + 14))), + this.debugDrawProperty.drawSquare(new Vector3f(0.1f, 0.1f, 0.1f), Matrix4f.IDENTITY.multiply(Matrix4f.createMatrixTranslate(new Vector3f(elem.x(), elem.y(), elem.z() + 14))), new Color(0, 0, 1, 1)); } } - if (testRpos != null) { + if (CollisionTestApplication.testRpos != null) { //debugDrawProperty.drawSquare(box2HalfSize, testQTransfert.getMatrix4().multiplyNew(Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z+14))), new Color(0,1,0,0.5f)); //Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z)).multiply(testQTransfert.getMatrix4()).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); //Matrix4f transformation = testQTransfert.getMatrix4().multiply(Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z))).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); //Matrix4f transformation = testQTransfert.getMatrix4().multiply(Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z))).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); - final Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x, testRpos.y, testRpos.z)).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0, 0, 14))) - .multiply(testQTransfert.getMatrix4()); + final Matrix4f transformation = Matrix4f + .createMatrixTranslate(new Vector3f(CollisionTestApplication.testRpos.x(), CollisionTestApplication.testRpos.y(), CollisionTestApplication.testRpos.z())) + .multiply(Matrix4f.createMatrixTranslate(new Vector3f(0, 0, 14))).multiply(CollisionTestApplication.testQTransfert.getMatrix4()); // OK sans la box1 orientation ... //Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z)).multiply(testQTransfert.getMatrix4()).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); //Matrix4f transformation = Matrix4f.createMatrixTranslate(new Vector3f(testRpos.x,testRpos.y,testRpos.z)).multiply(testQTransfert.getMatrix4()).multiply(Matrix4f.createMatrixTranslate(new Vector3f(0,0,14))); - this.debugDrawProperty.drawSquare(box2HalfSize, transformation, new Color(0, 1, 0, 0.5f)); - this.debugDrawProperty.drawSquare(box1HalfSize, Matrix4f.createMatrixTranslate(new Vector3f(0, 0, 14)), new Color(0, 0, 1, 0.5f)); + this.debugDrawProperty.drawSquare(CollisionTestApplication.box2HalfSize, transformation, new Color(0, 1, 0, 0.5f)); + this.debugDrawProperty.drawSquare(CollisionTestApplication.box1HalfSize, Matrix4f.createMatrixTranslate(new Vector3f(0, 0, 14)), new Color(0, 0, 1, 0.5f)); } // Restore context of matrix @@ -325,8 +326,8 @@ public class CollisionTestApplication extends Application { return; } this.angleLight += 0.01; - this.lightPosition.getTransform().getPosition().x = 5 + (float) Math.cos(this.angleLight) * 7.0f; - this.lightPosition.getTransform().getPosition().y = 5 + (float) Math.sin(this.angleLight) * 7.0f; + final Vector3f posss = this.lightPosition.getTransform().getPosition().add(new Vector3f(5 + (float) Math.cos(this.angleLight) * 7.0f, 5 + (float) Math.sin(this.angleLight) * 7.0f, 0)); + this.lightPosition.setTransform(this.lightPosition.getTransform().withPosition(posss)); this.env.periodicCall(); markDrawingIsNeeded(); } diff --git a/src/org/atriasoft/ege/samples/collisiontest/MainCollisionTest.java b/src/org/atriasoft/ege/samples/collisiontest/MainCollisionTest.java index 652973d..adc1028 100644 --- a/src/org/atriasoft/ege/samples/collisiontest/MainCollisionTest.java +++ b/src/org/atriasoft/ege/samples/collisiontest/MainCollisionTest.java @@ -1,13 +1,17 @@ package org.atriasoft.ege.samples.collisiontest; +import org.atriasoft.ege.Ege; import org.atriasoft.etk.Uri; import org.atriasoft.gale.Gale; public class MainCollisionTest { public static void main(final String[] args) { - Uri.setGroup("DATA", "src/org/atriasoft/ege/samples/LoxelEngine/res/"); - Uri.setGroup("DATA_EGE", "src/org/atriasoft/ege/data/"); + Gale.init(); + Ege.init(); + Uri.setGroup("DATA", "data/"); Uri.setGroup("RES", "res"); + Uri.addLibrary("loxelEngine", MainCollisionTest.class, "testDataLoxelEngine/"); + Uri.setApplication(MainCollisionTest.class, ""); Gale.run(new CollisionTestApplication(), args); } } diff --git a/src/org/atriasoft/ege/samples/lowPoly/LowPolyApplication.java b/src/org/atriasoft/ege/samples/lowPoly/LowPolyApplication.java index 3a450c4..038c429 100644 --- a/src/org/atriasoft/ege/samples/lowPoly/LowPolyApplication.java +++ b/src/org/atriasoft/ege/samples/lowPoly/LowPolyApplication.java @@ -6,17 +6,6 @@ import org.atriasoft.ege.Environement; import org.atriasoft.ege.GameStatus; import org.atriasoft.ege.Light; import org.atriasoft.ege.Material; -import org.atriasoft.etk.Color; -import org.atriasoft.etk.Uri; -import org.atriasoft.etk.math.Matrix4f; -import org.atriasoft.etk.math.Quaternion; -import org.atriasoft.etk.math.Transform3D; -import org.atriasoft.etk.math.Vector2f; -import org.atriasoft.etk.math.Vector3f; -import org.atriasoft.gale.Application; -import org.atriasoft.gale.backend3d.OpenGL; -import org.atriasoft.gale.backend3d.OpenGL.Flag; -import org.atriasoft.gale.context.Context; import org.atriasoft.ege.camera.Camera; import org.atriasoft.ege.components.ComponentLight; import org.atriasoft.ege.components.ComponentLightSun; @@ -29,6 +18,17 @@ import org.atriasoft.ege.components.ComponentStaticMesh; import org.atriasoft.ege.components.ComponentTexture; import org.atriasoft.ege.engines.EngineLight; import org.atriasoft.ege.tools.MeshGenerator; +import org.atriasoft.etk.Color; +import org.atriasoft.etk.Uri; +import org.atriasoft.etk.math.Matrix4f; +import org.atriasoft.etk.math.Quaternion; +import org.atriasoft.etk.math.Transform3D; +import org.atriasoft.etk.math.Vector2f; +import org.atriasoft.etk.math.Vector3f; +import org.atriasoft.gale.Application; +import org.atriasoft.gale.backend3d.OpenGL; +import org.atriasoft.gale.backend3d.OpenGL.Flag; +import org.atriasoft.gale.context.Context; import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeySpecial; import org.atriasoft.gale.key.KeyStatus; @@ -37,119 +37,95 @@ import org.atriasoft.gale.key.KeyType; public class LowPolyApplication extends Application { private Environement env; private ComponentPosition objectPosition; - private Quaternion basicRotation = Quaternion.identity(); - private Quaternion basicRotation2 = Quaternion.identity(); + private Quaternion basicRotation = Quaternion.IDENTITY; + private Quaternion basicRotation2 = Quaternion.IDENTITY; private boolean creationDone; private ControlCameraSimple simpleControl; private Material materialCube; private ComponentPosition lightPosition; private float angleLight = 0; - public LowPolyApplication(){ - creationDone = false; + + public LowPolyApplication() { + this.creationDone = false; } + @Override - public void onCreate(Context context) { - env = new Environement(); + public void onCreate(final Context context) { + this.env = new Environement(); this.canDraw = true; setSize(new Vector2f(800, 600)); setTitle("Low Poly sample"); - + // simple sun to have a global light ... Entity sun = new Entity(this.env); - sun.addComponent(new ComponentPosition(new Transform3D(new Vector3f(1000,1000,1000)))); - sun.addComponent(new ComponentLightSun(new Light(new Vector3f(0.4f,0.4f,0.4f), new Vector3f(0,0,0), new Vector3f(0.8f,0,0)))); - env.addEntity(sun); + sun.addComponent(new ComponentPosition(new Transform3D(new Vector3f(1000, 1000, 1000)))); + sun.addComponent(new ComponentLightSun(new Light(new Vector3f(0.4f, 0.4f, 0.4f), new Vector3f(0, 0, 0), new Vector3f(0.8f, 0, 0)))); + this.env.addEntity(sun); // add a cube to show where in the light ... Entity localLight = new Entity(this.env); - lightPosition = new ComponentPosition(new Transform3D(new Vector3f(-10,-10,0))); - localLight.addComponent(lightPosition); + this.lightPosition = new ComponentPosition(new Transform3D(new Vector3f(-10, -10, 0))); + localLight.addComponent(this.lightPosition); localLight.addComponent(new ComponentStaticMesh(new Uri("RES", "cube.obj"))); localLight.addComponent(new ComponentTexture(new Uri("RES", "grass.png"))); - localLight.addComponent(new ComponentLight(new Light(new Vector3f(0,2,0), new Vector3f(0,0,0), new Vector3f(0.8f,0.01f,0.002f)))); - localLight.addComponent(new ComponentRenderTexturedStaticMesh( - new Uri("DATA", "basic.vert"), - new Uri("DATA", "basic.frag"))); - env.addEntity(localLight); + localLight.addComponent(new ComponentLight(new Light(new Vector3f(0, 2, 0), new Vector3f(0, 0, 0), new Vector3f(0.8f, 0.01f, 0.002f)))); + localLight.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert"), new Uri("DATA", "basic.frag"))); + this.env.addEntity(localLight); Entity gird = new Entity(this.env); - gird.addComponent(new ComponentPosition(new Transform3D(new Vector3f(0,0,0)))); + gird.addComponent(new ComponentPosition(new Transform3D(new Vector3f(0, 0, 0)))); gird.addComponent(new ComponentStaticMesh(MeshGenerator.createGrid(5))); - gird.addComponent(new ComponentRenderColoredStaticMesh( - new Uri("DATA_EGE", "wireColor.vert"), - new Uri("DATA_EGE", "wireColor.frag"))); - env.addEntity(gird); - + gird.addComponent(new ComponentRenderColoredStaticMesh(new Uri("DATA_EGE", "wireColor.vert"), new Uri("DATA_EGE", "wireColor.frag"))); + this.env.addEntity(gird); + Entity basicTree = new Entity(this.env); - objectPosition = new ComponentPosition(new Transform3D(new Vector3f(0,0,0))); - basicTree.addComponent(objectPosition); - materialCube = new Material(); - basicTree.addComponent(new ComponentMaterial(materialCube)); + this.objectPosition = new ComponentPosition(new Transform3D(new Vector3f(0, 0, 0))); + basicTree.addComponent(this.objectPosition); + this.materialCube = new Material(); + basicTree.addComponent(new ComponentMaterial(this.materialCube)); basicTree.addComponent(new ComponentStaticMesh(new Uri("RES", "cube.obj"))); basicTree.addComponent(new ComponentTexture(new Uri("RES", "grass.png"))); - basicTree.addComponent(new ComponentRenderTexturedMaterialsStaticMesh( - new Uri("DATA", "basicMaterial.vert"), - new Uri("DATA", "basicMaterial.frag"), - (EngineLight)env.getEngine(EngineLight.ENGINE_NAME))); - env.addEntity(basicTree); + basicTree.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert"), new Uri("DATA", "basicMaterial.frag"), + (EngineLight) this.env.getEngine(EngineLight.ENGINE_NAME))); + this.env.addEntity(basicTree); - for (int xxx=-10; xxx<10; xxx++) { - for (int yyy=-10; yyy<10; yyy++) { + for (int xxx = -10; xxx < 10; xxx++) { + for (int yyy = -10; yyy < 10; yyy++) { Entity superGrass = new Entity(this.env); - superGrass.addComponent(new ComponentPosition(new Transform3D(new Vector3f(xxx,yyy,-1)))); + superGrass.addComponent(new ComponentPosition(new Transform3D(new Vector3f(xxx, yyy, -1)))); superGrass.addComponent(new ComponentMaterial(new Material())); superGrass.addComponent(new ComponentStaticMesh(new Uri("RES", "cube-one.obj"))); superGrass.addComponent(new ComponentTexture(new Uri("RES", "dirt.png"))); - superGrass.addComponent(new ComponentRenderTexturedMaterialsStaticMesh( - new Uri("DATA", "basicMaterial.vert"), - new Uri("DATA", "basicMaterial.frag"), - (EngineLight)env.getEngine(EngineLight.ENGINE_NAME))); - env.addEntity(superGrass); + superGrass.addComponent(new ComponentRenderTexturedMaterialsStaticMesh(new Uri("DATA", "basicMaterial.vert"), new Uri("DATA", "basicMaterial.frag"), + (EngineLight) this.env.getEngine(EngineLight.ENGINE_NAME))); + this.env.addEntity(superGrass); } } - Camera mainView = new Camera(); - env.addCamera("default", mainView); - mainView.setPitch((float)Math.PI*-0.25f); - mainView.setPosition(new Vector3f(0,-5,5)); + this.env.addCamera("default", mainView); + mainView.setPitch((float) Math.PI * -0.25f); + mainView.setPosition(new Vector3f(0, -5, 5)); this.simpleControl = new ControlCameraSimple(mainView); - env.addControlInterface(simpleControl); + this.env.addControlInterface(this.simpleControl); // start the engine. - env.setPropertyStatus(GameStatus.gameStart); + this.env.setPropertyStatus(GameStatus.gameStart); - basicRotation.setEulerAngles(new Vector3f(0.005f,0.005f,0.01f)); - basicRotation2.setEulerAngles(new Vector3f(0.003f,0.01f,0.001f)); + this.basicRotation = Quaternion.fromEulerAngles(new Vector3f(0.005f, 0.005f, 0.01f)); + this.basicRotation2 = Quaternion.fromEulerAngles(new Vector3f(0.003f, 0.01f, 0.001f)); // ready to let Gale & Ege manage the display Log.info("==> Init APPL (END)"); - creationDone = true; + this.creationDone = true; } @Override - public void onRegenerateDisplay(Context context) { - //Log.verbose("Regenerate Gale Application"); - if (!this.creationDone) { - return; - } - //materialCube.setAmbientFactor(new Vector3f(1.0f,1.0f,1.0f)); - // apply a little rotation to show the element move - //objectPosition.getTransform().applyRotation(basicRotation); - //objectPosition.getTransform().applyRotation(basicRotation2); - angleLight += 0.01; - lightPosition.getTransform().getPosition().x = (float)Math.cos(angleLight) * 7.0f; - lightPosition.getTransform().getPosition().y = (float)Math.sin(angleLight) * 7.0f; - env.periodicCall(); - markDrawingIsNeeded(); - } - - @Override - public void onDraw(Context context) { + public void onDraw(final Context context) { //Log.info("==> appl Draw ..."); Vector2f size = getSize(); if (!this.creationDone) { - OpenGL.setViewPort(new Vector2f(0,0), size); + OpenGL.setViewPort(new Vector2f(0, 0), size); Color bgColor = new Color(0.8f, 0.5f, 0.5f, 1.0f); OpenGL.clearColor(bgColor); return; @@ -157,12 +133,12 @@ public class LowPolyApplication extends Application { // Store openGl context. OpenGL.push(); // set projection matrix: - Matrix4f tmpProjection = Matrix4f.createMatrixPerspective(3.14f*0.5f, getAspectRatio(), 0.1f, 50000); + Matrix4f tmpProjection = Matrix4f.createMatrixPerspective(3.14f * 0.5f, getAspectRatio(), 0.1f, 50000); OpenGL.setMatrix(tmpProjection); // set the basic openGL view port: (Draw in all the windows...) - OpenGL.setViewPort(new Vector2f(0,0), size); - + OpenGL.setViewPort(new Vector2f(0, 0), size); + // clear background Color bgColor = new Color(0.0f, 1.0f, 0.0f, 1.0f); OpenGL.clearColor(bgColor); @@ -171,24 +147,36 @@ public class LowPolyApplication extends Application { OpenGL.clear(OpenGL.ClearFlag.clearFlag_depthBuffer); OpenGL.enable(Flag.flag_depthTest); - env.render(20, "default"); + this.env.render(20, "default"); // Restore context of matrix OpenGL.pop(); } + @Override - public void onPointer(KeySpecial special, - KeyType type, - int pointerID, - Vector2f pos, - KeyStatus state) { - env.onPointer(special, type, pointerID, pos, state); + public void onKeyboard(final KeySpecial special, final KeyKeyboard type, final Character value, final KeyStatus state) { + this.env.onKeyboard(special, type, value, state); } + @Override - public void onKeyboard(KeySpecial special, - KeyKeyboard type, - Character value, - KeyStatus state) { - env.onKeyboard(special, type, value, state); + public void onPointer(final KeySpecial special, final KeyType type, final int pointerID, final Vector2f pos, final KeyStatus state) { + this.env.onPointer(special, type, pointerID, pos, state); + } + + @Override + public void onRegenerateDisplay(final Context context) { + //Log.verbose("Regenerate Gale Application"); + if (!this.creationDone) { + return; + } + //materialCube.setAmbientFactor(new Vector3f(1.0f,1.0f,1.0f)); + // apply a little rotation to show the element move + //objectPosition.getTransform().applyRotation(basicRotation); + //objectPosition.getTransform().applyRotation(basicRotation2); + this.angleLight += 0.01; + this.lightPosition.setTransform(this.lightPosition.getTransform() + .withPosition(new Vector3f((float) Math.cos(this.angleLight) * 7.0f, (float) Math.sin(this.angleLight) * 7.0f, this.lightPosition.getTransform().getPosition().z()))); + this.env.periodicCall(); + markDrawingIsNeeded(); } } diff --git a/src/org/atriasoft/ege/samples/s1_texturedCube/S1Application.java b/src/org/atriasoft/ege/samples/s1_texturedCube/S1Application.java index 287e166..04c5247 100644 --- a/src/org/atriasoft/ege/samples/s1_texturedCube/S1Application.java +++ b/src/org/atriasoft/ege/samples/s1_texturedCube/S1Application.java @@ -4,6 +4,13 @@ import org.atriasoft.ege.ControlCameraSimple; import org.atriasoft.ege.Entity; import org.atriasoft.ege.Environement; import org.atriasoft.ege.GameStatus; +import org.atriasoft.ege.camera.Camera; +import org.atriasoft.ege.components.ComponentPosition; +import org.atriasoft.ege.components.ComponentRenderColoredStaticMesh; +import org.atriasoft.ege.components.ComponentRenderTexturedStaticMesh; +import org.atriasoft.ege.components.ComponentStaticMesh; +import org.atriasoft.ege.components.ComponentTexture; +import org.atriasoft.ege.tools.MeshGenerator; import org.atriasoft.etk.Color; import org.atriasoft.etk.Uri; import org.atriasoft.etk.math.Matrix4f; @@ -15,13 +22,6 @@ import org.atriasoft.gale.Application; import org.atriasoft.gale.backend3d.OpenGL; import org.atriasoft.gale.backend3d.OpenGL.Flag; import org.atriasoft.gale.context.Context; -import org.atriasoft.ege.camera.Camera; -import org.atriasoft.ege.components.ComponentPosition; -import org.atriasoft.ege.components.ComponentRenderColoredStaticMesh; -import org.atriasoft.ege.components.ComponentRenderTexturedStaticMesh; -import org.atriasoft.ege.components.ComponentStaticMesh; -import org.atriasoft.ege.components.ComponentTexture; -import org.atriasoft.ege.tools.MeshGenerator; import org.atriasoft.gale.key.KeyKeyboard; import org.atriasoft.gale.key.KeySpecial; import org.atriasoft.gale.key.KeyStatus; @@ -30,72 +30,60 @@ import org.atriasoft.gale.key.KeyType; public class S1Application extends Application { private Environement env; private ComponentPosition objectPosition; - private Quaternion basicRotation = Quaternion.identity(); - private Quaternion basicRotation2 = Quaternion.identity(); + private Quaternion basicRotation = Quaternion.IDENTITY; + private Quaternion basicRotation2 = Quaternion.IDENTITY; private boolean creationDone; private ControlCameraSimple simpleControl; - public S1Application(){ - creationDone = false; + + public S1Application() { + this.creationDone = false; } + @Override - public void onCreate(Context context) { - env = new Environement(); + public void onCreate(final Context context) { + this.env = new Environement(); this.canDraw = true; setSize(new Vector2f(800, 600)); setTitle("Low Poly sample"); - + Entity gird = new Entity(this.env); - gird.addComponent(new ComponentPosition(new Transform3D(new Vector3f(0,0,0)))); + gird.addComponent(new ComponentPosition(new Transform3D(new Vector3f(0, 0, 0)))); gird.addComponent(new ComponentStaticMesh(MeshGenerator.createGrid(5))); gird.addComponent(new ComponentRenderColoredStaticMesh(new Uri("DATA_EGE", "wireColor.vert"), new Uri("DATA_EGE", "wireColor.frag"))); - env.addEntity(gird); + this.env.addEntity(gird); Entity basicTree = new Entity(this.env); - objectPosition = new ComponentPosition(new Transform3D(new Vector3f(0,0,0))); - basicTree.addComponent(objectPosition); + this.objectPosition = new ComponentPosition(new Transform3D(new Vector3f(0, 0, 0))); + basicTree.addComponent(this.objectPosition); basicTree.addComponent(new ComponentStaticMesh(new Uri("RES", "cube.obj"))); basicTree.addComponent(new ComponentTexture(new Uri("RES", "dirt.png"))); basicTree.addComponent(new ComponentRenderTexturedStaticMesh(new Uri("DATA", "basic.vert"), new Uri("DATA", "basic.frag"))); - env.addEntity(basicTree); - + this.env.addEntity(basicTree); Camera mainView = new Camera(); - env.addCamera("default", mainView); - mainView.setPitch((float)Math.PI*-0.25f); - mainView.setPosition(new Vector3f(0,-5,5)); + this.env.addCamera("default", mainView); + mainView.setPitch((float) Math.PI * -0.25f); + mainView.setPosition(new Vector3f(0, -5, 5)); this.simpleControl = new ControlCameraSimple(mainView); - env.addControlInterface(simpleControl); + this.env.addControlInterface(this.simpleControl); // start the engine. - env.setPropertyStatus(GameStatus.gameStart); + this.env.setPropertyStatus(GameStatus.gameStart); - basicRotation.setEulerAngles(new Vector3f(0.005f,0.005f,0.01f)); - basicRotation2.setEulerAngles(new Vector3f(0.003f,0.01f,0.001f)); + this.basicRotation = Quaternion.fromEulerAngles(new Vector3f(0.005f, 0.005f, 0.01f)); + this.basicRotation2 = Quaternion.fromEulerAngles(new Vector3f(0.003f, 0.01f, 0.001f)); // ready to let Gale & Ege manage the display Log.info("==> Init APPL (END)"); - creationDone = true; + this.creationDone = true; } @Override - public void onRegenerateDisplay(Context context) { - //Log.verbose("Regenerate Gale Application"); - if (!this.creationDone) { - return; - } - // apply a litthe rotation to show the element move - objectPosition.getTransform().applyRotation(basicRotation); - objectPosition.getTransform().applyRotation(basicRotation2); - env.periodicCall(); - markDrawingIsNeeded(); - } - - @Override - public void onDraw(Context context) { + public void onDraw(final Context context) { //Log.info("==> appl Draw ..."); Vector2f size = getSize(); if (!this.creationDone) { - OpenGL.setViewPort(new Vector2f(0,0), size); + OpenGL.setViewPort(new Vector2f(0, 0), size); Color bgColor = new Color(0.8f, 0.5f, 0.5f, 1.0f); OpenGL.clearColor(bgColor); return; @@ -103,12 +91,12 @@ public class S1Application extends Application { // Store openGl context. OpenGL.push(); // set projection matrix: - Matrix4f tmpProjection = Matrix4f.createMatrixPerspective(3.14f*0.5f, getAspectRatio(), 0.1f, 50000); + Matrix4f tmpProjection = Matrix4f.createMatrixPerspective(3.14f * 0.5f, getAspectRatio(), 0.1f, 50000); OpenGL.setMatrix(tmpProjection); // set the basic openGL view port: (Draw in all the windows...) - OpenGL.setViewPort(new Vector2f(0,0), size); - + OpenGL.setViewPort(new Vector2f(0, 0), size); + // clear background Color bgColor = new Color(0.0f, 1.0f, 0.0f, 1.0f); OpenGL.clearColor(bgColor); @@ -117,24 +105,32 @@ public class S1Application extends Application { OpenGL.clear(OpenGL.ClearFlag.clearFlag_depthBuffer); OpenGL.enable(Flag.flag_depthTest); - env.render(20, "default"); + this.env.render(20, "default"); // Restore context of matrix OpenGL.pop(); } + @Override - public void onPointer(KeySpecial special, - KeyType type, - int pointerID, - Vector2f pos, - KeyStatus state) { - env.onPointer(special, type, pointerID, pos, state); + public void onKeyboard(final KeySpecial special, final KeyKeyboard type, final Character value, final KeyStatus state) { + this.env.onKeyboard(special, type, value, state); } + @Override - public void onKeyboard(KeySpecial special, - KeyKeyboard type, - Character value, - KeyStatus state) { - env.onKeyboard(special, type, value, state); + public void onPointer(final KeySpecial special, final KeyType type, final int pointerID, final Vector2f pos, final KeyStatus state) { + this.env.onPointer(special, type, pointerID, pos, state); + } + + @Override + public void onRegenerateDisplay(final Context context) { + //Log.verbose("Regenerate Gale Application"); + if (!this.creationDone) { + return; + } + // apply a litthe rotation to show the element move + this.objectPosition.setTransform(this.objectPosition.getTransform().rotate(this.basicRotation)); + this.objectPosition.setTransform(this.objectPosition.getTransform().rotate(this.basicRotation2)); + this.env.periodicCall(); + markDrawingIsNeeded(); } } diff --git a/src/org/atriasoft/ege/tools/MeshGenerator.java b/src/org/atriasoft/ege/tools/MeshGenerator.java index a7180a2..dcaaf7a 100644 --- a/src/org/atriasoft/ege/tools/MeshGenerator.java +++ b/src/org/atriasoft/ege/tools/MeshGenerator.java @@ -3,465 +3,466 @@ package org.atriasoft.ege.tools; import java.util.ArrayList; import java.util.List; +import org.atriasoft.ege.resource.ResourceStaticColoredMesh; import org.atriasoft.etk.Color; import org.atriasoft.etk.math.Vector3f; import org.atriasoft.gale.backend3d.OpenGL.RenderMode; -import org.atriasoft.ege.resource.ResourceStaticColoredMesh; class MeshData { - public List vertices = new ArrayList(); - public List colors = new ArrayList(); - public List indices = new ArrayList(); + public List vertices = new ArrayList<>(); + public List colors = new ArrayList<>(); + public List indices = new ArrayList<>(); - - public void addLine(Vector3f pos1, Vector3f pos2, Color color) { - vertices.add(pos1); - vertices.add(pos2); - colors.add(color); - colors.add(color); - indices.add(vertices.size()-2); - indices.add(vertices.size()-1); + public void addLine(final Vector3f pos1, final Vector3f pos2, final Color color) { + this.vertices.add(pos1); + this.vertices.add(pos2); + this.colors.add(color); + this.colors.add(color); + this.indices.add(this.vertices.size() - 2); + this.indices.add(this.vertices.size() - 1); } - public void addLines(List pos, Color color) { - for (int iii=1; iii pos, final Color color) { + for (int iii = 1; iii < pos.size(); iii++) { + addLine(pos.get(iii - 1), pos.get(iii), color); } } - public float[] getListOfVertices() { - float[] out = new float[vertices.size()*3]; - for (int iii=0; iii list = new ArrayList(); - list.add(new Vector3f(-1,-1,iii)); - list.add(new Vector3f(1,-1,iii)); - list.add(new Vector3f(1,1,iii)); - list.add(new Vector3f(-1,1,iii)); - list.add(new Vector3f(-1,-1,iii)); + List list = new ArrayList<>(); + list.add(new Vector3f(-1, -1, iii)); + list.add(new Vector3f(1, -1, iii)); + list.add(new Vector3f(1, 1, iii)); + list.add(new Vector3f(-1, 1, iii)); + list.add(new Vector3f(-1, -1, iii)); meshData.addLines(list, colorGray); } //out.addPoint(_materialName, new Vector3f(iii,-_lineCount,0), etk::color::white); //out.addPoint(_materialName, new Vector3f(iii,_lineCount,0), etk::color::white); } - return ResourceStaticColoredMesh.create(meshData.getListOfVertices(), meshData.getListOfColors(), - null, meshData.getListOfIndices(), RenderMode.line); + return ResourceStaticColoredMesh.create(meshData.getListOfVertices(), meshData.getListOfColors(), null, meshData.getListOfIndices(), RenderMode.line); } - -// public static ResourceMesh createCube(float _size=1.0f, -// const etk::String& _materialName="basics", -// Color _color=etk::color::green) { -// return createCube(new Vector3f(_size, _size, _size), _materialName, _color); -// } -// public static ResourceMesh createCube(const new Vector3f& _size=new Vector3f(1.0f, 1.0f, 1.0f), -// const etk::String& _materialName="basics", -// Color _color=etk::color::green) { -// EGE_VERBOSE(" create a cube _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); -// ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); -// if (out != null) { -// ememory::SharedPtr material = ememory::makeShared(); -// // set the element material properties : -// material.setAmbientFactor(vec4(1,1,1,1)); -// material.setDiffuseFactor(vec4(0,0,0,1)); -// material.setSpecularFactor(vec4(0,0,0,1)); -// material.setShininess(1); -// material.setRenderMode(gale::openGL::renderMode::triangle); -// out.addMaterial(_materialName, material); -// -// out.addFaceIndexing(_materialName); -// -// out.addQuad(_materialName, new Vector3f(-1,-1, 1)*_size, new Vector3f(-1,-1,-1)*_size, new Vector3f( 1,-1,-1)*_size, new Vector3f( 1,-1, 1)*_size, _color); -// out.addQuad(_materialName, new Vector3f(-1, 1,-1)*_size, new Vector3f(-1, 1, 1)*_size, new Vector3f( 1, 1, 1)*_size, new Vector3f( 1, 1,-1)*_size, _color); -// out.addQuad(_materialName, new Vector3f(-1, 1,-1)*_size, new Vector3f(-1,-1,-1)*_size, new Vector3f(-1,-1, 1)*_size, new Vector3f(-1, 1, 1)*_size, _color); -// out.addQuad(_materialName, new Vector3f( 1,-1,-1)*_size, new Vector3f( 1, 1,-1)*_size, new Vector3f( 1, 1, 1)*_size, new Vector3f( 1,-1, 1)*_size, _color); -// out.addQuad(_materialName, new Vector3f(-1,-1,-1)*_size, new Vector3f(-1, 1,-1)*_size, new Vector3f( 1, 1,-1)*_size, new Vector3f( 1,-1,-1)*_size, _color); -// out.addQuad(_materialName, new Vector3f(-1, 1, 1)*_size, new Vector3f(-1,-1, 1)*_size, new Vector3f( 1,-1, 1)*_size, new Vector3f( 1, 1, 1)*_size, _color); -// out.setNormalMode(ege::resource::Mesh::normalMode::face); -// out.calculateNormaleFace(_materialName); -// // generate the VBO -// out.generateVBO(); -// } else { -// EGE_ERROR("can not create the basic mesh interface"); -// } -// return out; -// } -// public static ResourceMesh createSphere(float _size=1.0f, -// const etk::String& _materialName="basics", -// Color _color=etk::color::green, -// int _lats = 10, -// int _longs = 10) { -// EGE_VERBOSE(" create a sphere _size=" << _radius << " _materialName=" << _materialName << " _color=" << _color); -// ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); -// if (out != null) { -// ememory::SharedPtr material = ememory::makeShared(); -// // set the element material properties : -// material.setAmbientFactor(vec4(1,1,1,1)); -// material.setDiffuseFactor(vec4(0,0,0,1)); -// material.setSpecularFactor(vec4(0,0,0,1)); -// material.setShininess(1); -// material.setRenderMode(gale::openGL::renderMode::triangle); -// out.addMaterial(_materialName, material); -// -// out.addFaceIndexing(_materialName); -// for(int iii=0; iii<=_lats; ++iii) { -// float lat0 = PI * (-0.5f + float(iii - 1) / _lats); -// float z0 = _radius*sin(lat0); -// float zr0 = _radius*cos(lat0); -// -// float lat1 = PI * (-0.5f + float(iii) / _lats); -// float z1 = _radius*sin(lat1); -// float zr1 = _radius*cos(lat1); -// -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// float x = cos(lng); -// float y = sin(lng); -// new Vector3f v1 = new Vector3f(x * zr1, y * zr1, z1); -// new Vector3f v4 = new Vector3f(x * zr0, y * zr0, z0); -// -// lng = 2 * PI * float(jjj) / _longs; -// x = cos(lng); -// y = sin(lng); -// new Vector3f v2 = new Vector3f(x * zr1, y * zr1, z1); -// new Vector3f v3 = new Vector3f(x * zr0, y * zr0, z0); -// -// out.addTriangle(_materialName, v1, v3, v2, _color); -// out.addTriangle(_materialName, v1, v4, v3, _color); -// } -// } -// out.setNormalMode(ege::resource::Mesh::normalMode::face); -// out.calculateNormaleFace(_materialName); -// // generate the VBO -// out.generateVBO(); -// } else { -// EGE_ERROR("can not create the basic mesh interface"); -// } -// return out; -// } -// public static ResourceMesh createCylinder(float _radius = 1.0f, -// float _size = 1.0f, -// const etk::String& _materialName="basics", -// Color _color=etk::color::green, -// int _lats = 10, -// int _longs = 10) { -// EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); -// ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); -// if (out != null) { -// ememory::SharedPtr material = ememory::makeShared(); -// // set the element material properties : -// material.setAmbientFactor(vec4(1,1,1,1)); -// material.setDiffuseFactor(vec4(0,0,0,1)); -// material.setSpecularFactor(vec4(0,0,0,1)); -// material.setShininess(1); -// material.setRenderMode(gale::openGL::renderMode::triangle); -// out.addMaterial(_materialName, material); -// -// out.addFaceIndexing(_materialName); -// -// // center to border (TOP) -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// -// float z = _size*0.5f; -// new Vector3f v1 = new Vector3f(0.0f, 0.0f, z); -// -// float x = cos(lng)*_radius; -// float y = sin(lng)*_radius; -// new Vector3f v2 = new Vector3f(x, y, z); -// -// lng = 2.0f * PI * float(jjj) / _longs; -// x = cos(lng)*_radius; -// y = sin(lng)*_radius; -// new Vector3f v3 = new Vector3f(x, y, z); -// out.addTriangle(_materialName, v1, v2, v3, _color); -// } -// // Cylinder -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// -// float z = _size*0.5f; -// -// float x = cos(lng)*_radius; -// float y = sin(lng)*_radius; -// new Vector3f v2 = new Vector3f(x, y, z); -// new Vector3f v2b = new Vector3f(x, y, -z); -// -// lng = 2.0f * PI * float(jjj) / _longs; -// x = cos(lng)*_radius; -// y = sin(lng)*_radius; -// new Vector3f v3 = new Vector3f(x, y, z); -// new Vector3f v3b = new Vector3f(x, y, -z); -// -// out.addQuad(_materialName, v3, v2, v2b, v3b, _color); -// } -// // center to border (BUTTOM) -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// -// float z = _size*-0.5f; -// new Vector3f v1 = new Vector3f(0.0f, 0.0f, z); -// -// float x = cos(lng)*_radius; -// float y = sin(lng)*_radius; -// new Vector3f v2 = new Vector3f(x, y, z); -// -// lng = 2.0f * PI * float(jjj) / _longs; -// x = cos(lng)*_radius; -// y = sin(lng)*_radius; -// new Vector3f v3 = new Vector3f(x, y, z); -// out.addTriangle(_materialName, v1, v3, v2, _color); -// } -// out.setNormalMode(ege::resource::Mesh::normalMode::face); -// out.calculateNormaleFace(_materialName); -// // generate the VBO -// out.generateVBO(); -// } else { -// EGE_ERROR("can not create the basic mesh interface"); -// } -// return out; -// } -// public static ResourceMesh createCapsule(float _radius = 1.0f, -// float _size = 1.0f, -// const etk::String& _materialName="basics", -// Color _color=etk::color::green, -// int _lats = 10, -// int _longs = 10) { -// EGE_VERBOSE(" create a capsule _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); -// ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); -// if (out != null) { -// ememory::SharedPtr material = ememory::makeShared(); -// // set the element material properties : -// material.setAmbientFactor(vec4(1,1,1,1)); -// material.setDiffuseFactor(vec4(0,0,0,1)); -// material.setSpecularFactor(vec4(0,0,0,1)); -// material.setShininess(1); -// material.setRenderMode(gale::openGL::renderMode::triangle); -// out.addMaterial(_materialName, material); -// -// out.addFaceIndexing(_materialName); -// -// // center to border (TOP) -// float offset = _size*0.5f; -// for(int iii=_lats/2+1; iii<=_lats; ++iii) { -// float lat0 = PI * (-0.5f + float(iii - 1) / _lats); -// float z0 = _radius*sin(lat0); -// float zr0 = _radius*cos(lat0); -// -// float lat1 = PI * (-0.5f + float(iii) / _lats); -// float z1 = _radius*sin(lat1); -// float zr1 = _radius*cos(lat1); -// -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// float x = cos(lng); -// float y = sin(lng); -// new Vector3f v1 = new Vector3f(x * zr1, y * zr1, z1+offset); -// new Vector3f v4 = new Vector3f(x * zr0, y * zr0, z0+offset); -// -// lng = 2 * PI * float(jjj) / _longs; -// x = cos(lng); -// y = sin(lng); -// new Vector3f v2 = new Vector3f(x * zr1, y * zr1, z1+offset); -// new Vector3f v3 = new Vector3f(x * zr0, y * zr0, z0+offset); -// out.addQuad(_materialName, v2, v1, v4, v3, _color); -// } -// } -// // Cylinder -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// -// float z = _size*0.5f; -// -// float x = cos(lng)*_radius; -// float y = sin(lng)*_radius; -// new Vector3f v2 = new Vector3f(x, y, z); -// new Vector3f v2b = new Vector3f(x, y, -z); -// -// lng = 2.0f * PI * float(jjj) / _longs; -// x = cos(lng)*_radius; -// y = sin(lng)*_radius; -// new Vector3f v3 = new Vector3f(x, y, z); -// new Vector3f v3b = new Vector3f(x, y, -z); -// -// out.addQuad(_materialName, v3, v2, v2b, v3b, _color); -// } -// // center to border (BUTTOM) -// offset = -_size*0.5f; -// for(int iii=0; iii<=_lats/2; ++iii) { -// float lat0 = PI * (-0.5f + float(iii - 1) / _lats); -// float z0 = _radius*sin(lat0); -// float zr0 = _radius*cos(lat0); -// -// float lat1 = PI * (-0.5f + float(iii) / _lats); -// float z1 = _radius*sin(lat1); -// float zr1 = _radius*cos(lat1); -// -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// float x = cos(lng); -// float y = sin(lng); -// new Vector3f v1 = new Vector3f(x * zr1, y * zr1, z1+offset); -// new Vector3f v4 = new Vector3f(x * zr0, y * zr0, z0+offset); -// -// lng = 2 * PI * float(jjj) / _longs; -// x = cos(lng); -// y = sin(lng); -// new Vector3f v2 = new Vector3f(x * zr1, y * zr1, z1+offset); -// new Vector3f v3 = new Vector3f(x * zr0, y * zr0, z0+offset); -// out.addQuad(_materialName, v2, v1, v4, v3, _color); -// } -// } -// out.setNormalMode(ege::resource::Mesh::normalMode::face); -// out.calculateNormaleFace(_materialName); -// // generate the VBO -// out.generateVBO(); -// } else { -// EGE_ERROR("can not create the basic mesh interface"); -// } -// return out; -// } -// public static ResourceMesh createCone(float _radius = 1.0f, -// float _size = 1.0f, -// const etk::String& _materialName="basics", -// Color _color=etk::color::green, -// int _lats = 10, -// int _longs = 10) { -// EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); -// ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); -// if (out != null) { -// ememory::SharedPtr material = ememory::makeShared(); -// // set the element material properties : -// material.setAmbientFactor(vec4(1,1,1,1)); -// material.setDiffuseFactor(vec4(0,0,0,1)); -// material.setSpecularFactor(vec4(0,0,0,1)); -// material.setShininess(1); -// material.setRenderMode(gale::openGL::renderMode::triangle); -// out.addMaterial(_materialName, material); -// -// out.addFaceIndexing(_materialName); -// -// // center to border (TOP) -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// new Vector3f v1 = new Vector3f(0.0f, 0.0f, _size/2); -// -// float x = cos(lng)*_radius; -// float y = sin(lng)*_radius; -// new Vector3f v2 = new Vector3f(x, y, -_size/2); -// -// lng = 2.0f * PI * float(jjj) / _longs; -// x = cos(lng)*_radius; -// y = sin(lng)*_radius; -// new Vector3f v3 = new Vector3f(x, y, -_size/2); -// out.addTriangle(_materialName, v1, v2, v3, _color); -// } -// // center to border (BUTTOM) -// for(int jjj=0; jjj<_longs; ++jjj) { -// float lng = 2.0f * PI * float(jjj - 1) / _longs; -// -// new Vector3f v1 = new Vector3f(0.0f, 0.0f, -_size/2); -// -// float x = cos(lng)*_radius; -// float y = sin(lng)*_radius; -// new Vector3f v2 = new Vector3f(x, y, -_size/2); -// -// lng = 2.0f * PI * float(jjj) / _longs; -// x = cos(lng)*_radius; -// y = sin(lng)*_radius; -// new Vector3f v3 = new Vector3f(x, y, -_size/2); -// out.addTriangle(_materialName, v1, v3, v2, _color); -// } -// out.setNormalMode(ege::resource::Mesh::normalMode::face); -// out.calculateNormaleFace(_materialName); -// // generate the VBO -// out.generateVBO(); -// } else { -// EGE_ERROR("can not create the basic mesh interface"); -// } -// return out; -// } + + private MeshGenerator() {} + + // public static ResourceMesh createCube(float _size=1.0f, + // const etk::String& _materialName="basics", + // Color _color=etk::color::green) { + // return createCube(new Vector3f(_size, _size, _size), _materialName, _color); + // } + // public static ResourceMesh createCube(const new Vector3f& _size=new Vector3f(1.0f, 1.0f, 1.0f), + // const etk::String& _materialName="basics", + // Color _color=etk::color::green) { + // EGE_VERBOSE(" create a cube _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); + // ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); + // if (out != null) { + // ememory::SharedPtr material = ememory::makeShared(); + // // set the element material properties : + // material.setAmbientFactor(vec4(1,1,1,1)); + // material.setDiffuseFactor(vec4(0,0,0,1)); + // material.setSpecularFactor(vec4(0,0,0,1)); + // material.setShininess(1); + // material.setRenderMode(gale::openGL::renderMode::triangle); + // out.addMaterial(_materialName, material); + // + // out.addFaceIndexing(_materialName); + // + // out.addQuad(_materialName, new Vector3f(-1,-1, 1)*_size, new Vector3f(-1,-1,-1)*_size, new Vector3f( 1,-1,-1)*_size, new Vector3f( 1,-1, 1)*_size, _color); + // out.addQuad(_materialName, new Vector3f(-1, 1,-1)*_size, new Vector3f(-1, 1, 1)*_size, new Vector3f( 1, 1, 1)*_size, new Vector3f( 1, 1,-1)*_size, _color); + // out.addQuad(_materialName, new Vector3f(-1, 1,-1)*_size, new Vector3f(-1,-1,-1)*_size, new Vector3f(-1,-1, 1)*_size, new Vector3f(-1, 1, 1)*_size, _color); + // out.addQuad(_materialName, new Vector3f( 1,-1,-1)*_size, new Vector3f( 1, 1,-1)*_size, new Vector3f( 1, 1, 1)*_size, new Vector3f( 1,-1, 1)*_size, _color); + // out.addQuad(_materialName, new Vector3f(-1,-1,-1)*_size, new Vector3f(-1, 1,-1)*_size, new Vector3f( 1, 1,-1)*_size, new Vector3f( 1,-1,-1)*_size, _color); + // out.addQuad(_materialName, new Vector3f(-1, 1, 1)*_size, new Vector3f(-1,-1, 1)*_size, new Vector3f( 1,-1, 1)*_size, new Vector3f( 1, 1, 1)*_size, _color); + // out.setNormalMode(ege::resource::Mesh::normalMode::face); + // out.calculateNormaleFace(_materialName); + // // generate the VBO + // out.generateVBO(); + // } else { + // EGE_ERROR("can not create the basic mesh interface"); + // } + // return out; + // } + // public static ResourceMesh createSphere(float _size=1.0f, + // const etk::String& _materialName="basics", + // Color _color=etk::color::green, + // int _lats = 10, + // int _longs = 10) { + // EGE_VERBOSE(" create a sphere _size=" << _radius << " _materialName=" << _materialName << " _color=" << _color); + // ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); + // if (out != null) { + // ememory::SharedPtr material = ememory::makeShared(); + // // set the element material properties : + // material.setAmbientFactor(vec4(1,1,1,1)); + // material.setDiffuseFactor(vec4(0,0,0,1)); + // material.setSpecularFactor(vec4(0,0,0,1)); + // material.setShininess(1); + // material.setRenderMode(gale::openGL::renderMode::triangle); + // out.addMaterial(_materialName, material); + // + // out.addFaceIndexing(_materialName); + // for(int iii=0; iii<=_lats; ++iii) { + // float lat0 = PI * (-0.5f + float(iii - 1) / _lats); + // float z0 = _radius*sin(lat0); + // float zr0 = _radius*cos(lat0); + // + // float lat1 = PI * (-0.5f + float(iii) / _lats); + // float z1 = _radius*sin(lat1); + // float zr1 = _radius*cos(lat1); + // + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // float x = cos(lng); + // float y = sin(lng); + // new Vector3f v1 = new Vector3f(x * zr1, y * zr1, z1); + // new Vector3f v4 = new Vector3f(x * zr0, y * zr0, z0); + // + // lng = 2 * PI * float(jjj) / _longs; + // x = cos(lng); + // y = sin(lng); + // new Vector3f v2 = new Vector3f(x * zr1, y * zr1, z1); + // new Vector3f v3 = new Vector3f(x * zr0, y * zr0, z0); + // + // out.addTriangle(_materialName, v1, v3, v2, _color); + // out.addTriangle(_materialName, v1, v4, v3, _color); + // } + // } + // out.setNormalMode(ege::resource::Mesh::normalMode::face); + // out.calculateNormaleFace(_materialName); + // // generate the VBO + // out.generateVBO(); + // } else { + // EGE_ERROR("can not create the basic mesh interface"); + // } + // return out; + // } + // public static ResourceMesh createCylinder(float _radius = 1.0f, + // float _size = 1.0f, + // const etk::String& _materialName="basics", + // Color _color=etk::color::green, + // int _lats = 10, + // int _longs = 10) { + // EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); + // ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); + // if (out != null) { + // ememory::SharedPtr material = ememory::makeShared(); + // // set the element material properties : + // material.setAmbientFactor(vec4(1,1,1,1)); + // material.setDiffuseFactor(vec4(0,0,0,1)); + // material.setSpecularFactor(vec4(0,0,0,1)); + // material.setShininess(1); + // material.setRenderMode(gale::openGL::renderMode::triangle); + // out.addMaterial(_materialName, material); + // + // out.addFaceIndexing(_materialName); + // + // // center to border (TOP) + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // + // float z = _size*0.5f; + // new Vector3f v1 = new Vector3f(0.0f, 0.0f, z); + // + // float x = cos(lng)*_radius; + // float y = sin(lng)*_radius; + // new Vector3f v2 = new Vector3f(x, y, z); + // + // lng = 2.0f * PI * float(jjj) / _longs; + // x = cos(lng)*_radius; + // y = sin(lng)*_radius; + // new Vector3f v3 = new Vector3f(x, y, z); + // out.addTriangle(_materialName, v1, v2, v3, _color); + // } + // // Cylinder + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // + // float z = _size*0.5f; + // + // float x = cos(lng)*_radius; + // float y = sin(lng)*_radius; + // new Vector3f v2 = new Vector3f(x, y, z); + // new Vector3f v2b = new Vector3f(x, y, -z); + // + // lng = 2.0f * PI * float(jjj) / _longs; + // x = cos(lng)*_radius; + // y = sin(lng)*_radius; + // new Vector3f v3 = new Vector3f(x, y, z); + // new Vector3f v3b = new Vector3f(x, y, -z); + // + // out.addQuad(_materialName, v3, v2, v2b, v3b, _color); + // } + // // center to border (BUTTOM) + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // + // float z = _size*-0.5f; + // new Vector3f v1 = new Vector3f(0.0f, 0.0f, z); + // + // float x = cos(lng)*_radius; + // float y = sin(lng)*_radius; + // new Vector3f v2 = new Vector3f(x, y, z); + // + // lng = 2.0f * PI * float(jjj) / _longs; + // x = cos(lng)*_radius; + // y = sin(lng)*_radius; + // new Vector3f v3 = new Vector3f(x, y, z); + // out.addTriangle(_materialName, v1, v3, v2, _color); + // } + // out.setNormalMode(ege::resource::Mesh::normalMode::face); + // out.calculateNormaleFace(_materialName); + // // generate the VBO + // out.generateVBO(); + // } else { + // EGE_ERROR("can not create the basic mesh interface"); + // } + // return out; + // } + // public static ResourceMesh createCapsule(float _radius = 1.0f, + // float _size = 1.0f, + // const etk::String& _materialName="basics", + // Color _color=etk::color::green, + // int _lats = 10, + // int _longs = 10) { + // EGE_VERBOSE(" create a capsule _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); + // ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); + // if (out != null) { + // ememory::SharedPtr material = ememory::makeShared(); + // // set the element material properties : + // material.setAmbientFactor(vec4(1,1,1,1)); + // material.setDiffuseFactor(vec4(0,0,0,1)); + // material.setSpecularFactor(vec4(0,0,0,1)); + // material.setShininess(1); + // material.setRenderMode(gale::openGL::renderMode::triangle); + // out.addMaterial(_materialName, material); + // + // out.addFaceIndexing(_materialName); + // + // // center to border (TOP) + // float offset = _size*0.5f; + // for(int iii=_lats/2+1; iii<=_lats; ++iii) { + // float lat0 = PI * (-0.5f + float(iii - 1) / _lats); + // float z0 = _radius*sin(lat0); + // float zr0 = _radius*cos(lat0); + // + // float lat1 = PI * (-0.5f + float(iii) / _lats); + // float z1 = _radius*sin(lat1); + // float zr1 = _radius*cos(lat1); + // + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // float x = cos(lng); + // float y = sin(lng); + // new Vector3f v1 = new Vector3f(x * zr1, y * zr1, z1+offset); + // new Vector3f v4 = new Vector3f(x * zr0, y * zr0, z0+offset); + // + // lng = 2 * PI * float(jjj) / _longs; + // x = cos(lng); + // y = sin(lng); + // new Vector3f v2 = new Vector3f(x * zr1, y * zr1, z1+offset); + // new Vector3f v3 = new Vector3f(x * zr0, y * zr0, z0+offset); + // out.addQuad(_materialName, v2, v1, v4, v3, _color); + // } + // } + // // Cylinder + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // + // float z = _size*0.5f; + // + // float x = cos(lng)*_radius; + // float y = sin(lng)*_radius; + // new Vector3f v2 = new Vector3f(x, y, z); + // new Vector3f v2b = new Vector3f(x, y, -z); + // + // lng = 2.0f * PI * float(jjj) / _longs; + // x = cos(lng)*_radius; + // y = sin(lng)*_radius; + // new Vector3f v3 = new Vector3f(x, y, z); + // new Vector3f v3b = new Vector3f(x, y, -z); + // + // out.addQuad(_materialName, v3, v2, v2b, v3b, _color); + // } + // // center to border (BUTTOM) + // offset = -_size*0.5f; + // for(int iii=0; iii<=_lats/2; ++iii) { + // float lat0 = PI * (-0.5f + float(iii - 1) / _lats); + // float z0 = _radius*sin(lat0); + // float zr0 = _radius*cos(lat0); + // + // float lat1 = PI * (-0.5f + float(iii) / _lats); + // float z1 = _radius*sin(lat1); + // float zr1 = _radius*cos(lat1); + // + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // float x = cos(lng); + // float y = sin(lng); + // new Vector3f v1 = new Vector3f(x * zr1, y * zr1, z1+offset); + // new Vector3f v4 = new Vector3f(x * zr0, y * zr0, z0+offset); + // + // lng = 2 * PI * float(jjj) / _longs; + // x = cos(lng); + // y = sin(lng); + // new Vector3f v2 = new Vector3f(x * zr1, y * zr1, z1+offset); + // new Vector3f v3 = new Vector3f(x * zr0, y * zr0, z0+offset); + // out.addQuad(_materialName, v2, v1, v4, v3, _color); + // } + // } + // out.setNormalMode(ege::resource::Mesh::normalMode::face); + // out.calculateNormaleFace(_materialName); + // // generate the VBO + // out.generateVBO(); + // } else { + // EGE_ERROR("can not create the basic mesh interface"); + // } + // return out; + // } + // public static ResourceMesh createCone(float _radius = 1.0f, + // float _size = 1.0f, + // const etk::String& _materialName="basics", + // Color _color=etk::color::green, + // int _lats = 10, + // int _longs = 10) { + // EGE_VERBOSE(" create a cylinder _size=" << _size << " _materialName=" << _materialName << " _color=" << _color); + // ememory::SharedPtr out = ege::resource::Mesh::create("---", "DATA:///color3.prog"); + // if (out != null) { + // ememory::SharedPtr material = ememory::makeShared(); + // // set the element material properties : + // material.setAmbientFactor(vec4(1,1,1,1)); + // material.setDiffuseFactor(vec4(0,0,0,1)); + // material.setSpecularFactor(vec4(0,0,0,1)); + // material.setShininess(1); + // material.setRenderMode(gale::openGL::renderMode::triangle); + // out.addMaterial(_materialName, material); + // + // out.addFaceIndexing(_materialName); + // + // // center to border (TOP) + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // new Vector3f v1 = new Vector3f(0.0f, 0.0f, _size/2); + // + // float x = cos(lng)*_radius; + // float y = sin(lng)*_radius; + // new Vector3f v2 = new Vector3f(x, y, -_size/2); + // + // lng = 2.0f * PI * float(jjj) / _longs; + // x = cos(lng)*_radius; + // y = sin(lng)*_radius; + // new Vector3f v3 = new Vector3f(x, y, -_size/2); + // out.addTriangle(_materialName, v1, v2, v3, _color); + // } + // // center to border (BUTTOM) + // for(int jjj=0; jjj<_longs; ++jjj) { + // float lng = 2.0f * PI * float(jjj - 1) / _longs; + // + // new Vector3f v1 = new Vector3f(0.0f, 0.0f, -_size/2); + // + // float x = cos(lng)*_radius; + // float y = sin(lng)*_radius; + // new Vector3f v2 = new Vector3f(x, y, -_size/2); + // + // lng = 2.0f * PI * float(jjj) / _longs; + // x = cos(lng)*_radius; + // y = sin(lng)*_radius; + // new Vector3f v3 = new Vector3f(x, y, -_size/2); + // out.addTriangle(_materialName, v1, v3, v2, _color); + // } + // out.setNormalMode(ege::resource::Mesh::normalMode::face); + // out.calculateNormaleFace(_materialName); + // // generate the VBO + // out.generateVBO(); + // } else { + // EGE_ERROR("can not create the basic mesh interface"); + // } + // return out; + // } } diff --git a/src/renderEngine/MasterRenderer.java b/src/renderEngine/MasterRenderer.java index 79def03..b72f496 100644 --- a/src/renderEngine/MasterRenderer.java +++ b/src/renderEngine/MasterRenderer.java @@ -5,10 +5,10 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.atriasoft.etk.Color; import org.atriasoft.etk.math.Matrix4f; import org.atriasoft.etk.math.Vector2f; import org.atriasoft.gale.backend3d.OpenGL; -import org.atriasoft.etk.Color; import org.lwjgl.opengl.GL11; import entities.Camera; @@ -26,6 +26,16 @@ public class MasterRenderer { private static final float FAR_PLANE = 10000; private static final Color SKY_COLOUR = new Color(0.5444f, 0.62f, 0.69f, 1.0f); + public static void disableCulling() { + OpenGL.disable(OpenGL.Flag.flag_cullFace); + OpenGL.disable(OpenGL.Flag.flag_back); + } + + public static void enableCulling() { + OpenGL.enable(OpenGL.Flag.flag_cullFace); + OpenGL.enable(OpenGL.Flag.flag_back); + } + private Matrix4f projectionMatrix; private StaticShader shader = new StaticShader(); @@ -34,65 +44,33 @@ public class MasterRenderer { private TerrainRenderer terrainRenderer; private TerrainShader terrainShader = new TerrainShader(); - private Map> entities = new HashMap>(); - private List terrains = new ArrayList(); + private Map> entities = new HashMap<>(); + + private List terrains = new ArrayList<>(); private SkyboxRenderer skyboxRenderer; - public MasterRenderer(Loader loader) { + public MasterRenderer(final Loader loader) { //enableCulling(); OpenGL.enable(OpenGL.Flag.flag_blend); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); createProjectionMatrix(); - renderer = new EntityRenderer(shader, projectionMatrix); - terrainRenderer = new TerrainRenderer(terrainShader, projectionMatrix); - skyboxRenderer = new SkyboxRenderer(loader, projectionMatrix); - } - - public static void enableCulling() { - OpenGL.enable(OpenGL.Flag.flag_cullFace); - OpenGL.enable(OpenGL.Flag.flag_back); - } - public static void disableCulling() { - OpenGL.disable(OpenGL.Flag.flag_cullFace); - OpenGL.disable(OpenGL.Flag.flag_back); + this.renderer = new EntityRenderer(this.shader, this.projectionMatrix); + this.terrainRenderer = new TerrainRenderer(this.terrainShader, this.projectionMatrix); + this.skyboxRenderer = new SkyboxRenderer(loader, this.projectionMatrix); } - public void render(List lights, Camera camera) { - prepare(); - skyboxRenderer.render(camera, SKY_COLOUR); - shader.start(); - shader.loadSkyColour(SKY_COLOUR); - shader.loadLights(lights); - shader.loadViewMatrix(camera); - renderer.render(entities); - shader.stop(); - entities.clear(); - terrainShader.start(); - terrainShader.loadSkyColour(SKY_COLOUR); - terrainShader.loadLights(lights); - terrainShader.loadViewMatrix(camera); - terrainRenderer.render(terrains); - terrainShader.stop(); - terrains.clear(); + public void cleanUp() { + this.shader.cleanUp(); + this.terrainShader.cleanUp(); } - public void processTerrain(Terrain terrain) { - terrains.add(terrain); + private void createProjectionMatrix() { + Vector2f windowsSize = DisplayManager.getSize(); + float aspectRatio = windowsSize.x() / windowsSize.y(); + this.projectionMatrix = Matrix4f.createMatrixPerspective(FOV, aspectRatio, NEAR_PLANE, FAR_PLANE); } - public void processEntity(Entity entity) { - TexturedModel entityModel = entity.getModel(); - List batch = entities.get(entityModel); - if (batch != null) { - batch.add(entity); - } else { - List newBatch = new ArrayList(); - newBatch.add(entity); - entities.put(entityModel, newBatch); - } - } - public void prepare() { OpenGL.enable(OpenGL.Flag.flag_depthTest); OpenGL.clear(OpenGL.ClearFlag.clearFlag_depthBuffer); @@ -100,19 +78,39 @@ public class MasterRenderer { OpenGL.clearColor(SKY_COLOUR); } - - public void cleanUp () { - shader.cleanUp(); - terrainShader.cleanUp(); + public void processEntity(final Entity entity) { + TexturedModel entityModel = entity.getModel(); + List batch = this.entities.get(entityModel); + if (batch != null) { + batch.add(entity); + } else { + List newBatch = new ArrayList<>(); + newBatch.add(entity); + this.entities.put(entityModel, newBatch); + } } - private void createProjectionMatrix() { - Vector2f windowsSize = DisplayManager.getSize(); - float aspectRatio = windowsSize.x / windowsSize.y; - projectionMatrix = Matrix4f.createMatrixPerspective(FOV, aspectRatio, NEAR_PLANE, FAR_PLANE); + public void processTerrain(final Terrain terrain) { + this.terrains.add(terrain); } - - + public void render(final List lights, final Camera camera) { + prepare(); + this.skyboxRenderer.render(camera, SKY_COLOUR); + this.shader.start(); + this.shader.loadSkyColour(SKY_COLOUR); + this.shader.loadLights(lights); + this.shader.loadViewMatrix(camera); + this.renderer.render(this.entities); + this.shader.stop(); + this.entities.clear(); + this.terrainShader.start(); + this.terrainShader.loadSkyColour(SKY_COLOUR); + this.terrainShader.loadLights(lights); + this.terrainShader.loadViewMatrix(camera); + this.terrainRenderer.render(this.terrains); + this.terrainShader.stop(); + this.terrains.clear(); + } } diff --git a/src/renderEngine/OBJLoader.java b/src/renderEngine/OBJLoader.java index 6e66b8e..ab692a4 100644 --- a/src/renderEngine/OBJLoader.java +++ b/src/renderEngine/OBJLoader.java @@ -1,13 +1,15 @@ package renderEngine; +import org.atriasoft.etk.Uri; + import models.RawModel; import objConverter.ModelData; import objConverter.OBJFileLoader; public class OBJLoader { - public static RawModel loadObjModel(String fileName, Loader loader) { + public static RawModel loadObjModel(Uri fileName, Loader loader) { System.out.println("Load file " + fileName); - ModelData data = OBJFileLoader.loadOBJ(fileName); + final ModelData data = OBJFileLoader.loadOBJ(fileName); return loader.loadToVAO(data.getVertices(), data.getTextureCoords(), data.getNormals(), data.getIndices()); } } diff --git a/src/shaders/ShaderProgram.java b/src/shaders/ShaderProgram.java index fc471aa..93dadd5 100644 --- a/src/shaders/ShaderProgram.java +++ b/src/shaders/ShaderProgram.java @@ -1,5 +1,6 @@ package shaders; +import org.atriasoft.etk.Uri; import org.atriasoft.gale.backend3d.OpenGL; import java.io.BufferedReader; @@ -22,8 +23,8 @@ public abstract class ShaderProgram { public ShaderProgram (String vertexFile, String fragmentFile) { - vertexShaderID = OpenGL.shaderLoad(vertexFile, OpenGL.ShaderType.vertex); - fragmentShaderID = OpenGL.shaderLoad(fragmentFile, OpenGL.ShaderType.fragment); + vertexShaderID = OpenGL.shaderLoad(new Uri("DATA", vertexFile), OpenGL.ShaderType.vertex); + fragmentShaderID = OpenGL.shaderLoad(new Uri("DATA", fragmentFile), OpenGL.ShaderType.fragment); programID = OpenGL.programCreate(); OpenGL.programAttach(programID, vertexShaderID); OpenGL.programAttach(programID, fragmentShaderID); diff --git a/src/shaders/StaticShader.java b/src/shaders/StaticShader.java index e431e9e..5936624 100644 --- a/src/shaders/StaticShader.java +++ b/src/shaders/StaticShader.java @@ -20,9 +20,9 @@ public class StaticShader extends ShaderProgram { private int location_transformationMatrix; private int location_projectionMatrix; private int location_viewMatrix; - private int location_lightPosition[]; - private int location_lightColour[]; - private int location_lightAttenuation[]; + private int[] location_lightPosition; + private int[] location_lightColour; + private int[] location_lightAttenuation; private int location_reflectivity; private int location_shineDamper; private int location_useFakeLighting; diff --git a/src/shaders/TerrainShader.java b/src/shaders/TerrainShader.java index d27aaf0..2f22c9a 100644 --- a/src/shaders/TerrainShader.java +++ b/src/shaders/TerrainShader.java @@ -19,9 +19,9 @@ public class TerrainShader extends ShaderProgram { private int location_transformationMatrix; private int location_projectionMatrix; private int location_viewMatrix; - private int location_lightPosition[]; - private int location_lightColour[]; - private int location_lightAttenuation[]; + private int[] location_lightPosition; + private int[] location_lightColour; + private int[] location_lightAttenuation; private int location_reflectivity; private int location_shineDamper; private int location_skyColor; diff --git a/src/skybox/SkyboxShader.java b/src/skybox/SkyboxShader.java index d51e3ac..e2ef8fe 100644 --- a/src/skybox/SkyboxShader.java +++ b/src/skybox/SkyboxShader.java @@ -38,7 +38,7 @@ public class SkyboxShader extends ShaderProgram { public void loadViewMatrix(Camera camera){ Matrix4f matrix = Maths.createViewMatrixNoTranslate(camera); rotation += ROTATE_SPEED * DisplayManager.getFrameTimeSecconds(); - matrix.rotate(new Vector3f(0,1,0), rotation); + matrix = matrix.rotate(new Vector3f(0,1,0), rotation); OpenGL.programLoadUniformMatrix(location_viewMatrix, matrix); } diff --git a/src/terrains/Terrain.java b/src/terrains/Terrain.java index 0e579c3..06bae22 100644 --- a/src/terrains/Terrain.java +++ b/src/terrains/Terrain.java @@ -11,14 +11,13 @@ import org.atriasoft.etk.math.Vector3f; import models.RawModel; import renderEngine.Loader; -import textures.ModelTexture; import toolbox.Maths; public class Terrain { private static final float SIZE = 800; private static final int MAX_HEIGHT = 40; - private static final int MAX_PIXEL_COLOUR = 256*256*256; - + private static final int MAX_PIXEL_COLOUR = 256 * 256 * 256; + private float x; private float z; private RawModel model; @@ -27,9 +26,7 @@ public class Terrain { private float[][] heights; - public Terrain(int gridX, int gridZ, Loader loader, - TerrainTexturePack texturePack, TerrainTexture blendMap, - String heightMap) { + public Terrain(final int gridX, final int gridZ, final Loader loader, final TerrainTexturePack texturePack, final TerrainTexture blendMap, final String heightMap) { this.texturePack = texturePack; this.blendMap = blendMap; this.x = gridX * SIZE; @@ -37,31 +34,17 @@ public class Terrain { this.model = generateTerrain(loader, heightMap); } - public float getHeightOfTerrain(float worldX, float worldZ) { - float terrainX = worldX - this.x; - float terrainZ = worldZ - this.z; - float gridSquareSize = SIZE / ((float)heights.length-1); - int gridX = (int) Math.floor(terrainX / gridSquareSize); - int gridZ = (int) Math.floor(terrainZ / gridSquareSize); - if (gridX >= heights.length-1 || gridZ >= heights.length -1 || gridX<0 || gridZ <0) { - return 0; - } - float xCoord = (terrainX % gridSquareSize)/gridSquareSize; - float zCoord = (terrainZ % gridSquareSize)/gridSquareSize; - float answer; - if (xCoord <= (1-zCoord)) { - answer = Maths.barryCentric(new Vector3f(0, heights[gridX][gridZ], 0), new Vector3f(1, - heights[gridX + 1][gridZ], 0), new Vector3f(0, - heights[gridX][gridZ + 1], 1), new Vector2f(xCoord, zCoord)); - } else { - answer = Maths.barryCentric(new Vector3f(1, heights[gridX + 1][gridZ], 0), new Vector3f(1, - heights[gridX + 1][gridZ + 1], 1), new Vector3f(0, - heights[gridX][gridZ + 1], 1), new Vector2f(xCoord, zCoord)); - } - return answer; + private Vector3f calculateNormal(final int x, final int z, final BufferedImage image) { + float heightL = getHeight(x - 1, z, image); + float heightR = getHeight(x + 1, z, image); + float heightD = getHeight(x, z - 1, image); + float heightU = getHeight(x, z + 1, image); + Vector3f normal = new Vector3f(heightL - heightR, 2f, heightD - heightU); + normal = normal.normalize(); + return normal; } - private RawModel generateTerrain(Loader loader, String heightMap) { + private RawModel generateTerrain(final Loader loader, final String heightMap) { BufferedImage image = null; try { @@ -70,35 +53,35 @@ public class Terrain { e.printStackTrace(); } int VERTEX_COUNT = image.getHeight(); - heights = new float[VERTEX_COUNT][VERTEX_COUNT]; + this.heights = new float[VERTEX_COUNT][VERTEX_COUNT]; int count = VERTEX_COUNT * VERTEX_COUNT; float[] vertices = new float[count * 3]; float[] normals = new float[count * 3]; - float[] textureCoords = new float[count*2]; - int[] indices = new int[6*(VERTEX_COUNT-1)*(VERTEX_COUNT-1)]; + float[] textureCoords = new float[count * 2]; + int[] indices = new int[6 * (VERTEX_COUNT - 1) * (VERTEX_COUNT - 1)]; int vertexPointer = 0; - for(int i=0;i=image.getWidth() || z<0 || z>=image.getHeight() ) { + private float getHeight(final int x, final int z, final BufferedImage image) { + if (x < 0 || x >= image.getWidth() || z < 0 || z >= image.getHeight()) { return 0; } float height = image.getRGB(x, z); - height += MAX_PIXEL_COLOUR/2.0f; - height /= MAX_PIXEL_COLOUR/2.0f; + height += MAX_PIXEL_COLOUR / 2.0f; + height /= MAX_PIXEL_COLOUR / 2.0f; height *= MAX_HEIGHT; return height; } - - public float getX() { - return x; + + public float getHeightOfTerrain(final float worldX, final float worldZ) { + float terrainX = worldX - this.x; + float terrainZ = worldZ - this.z; + float gridSquareSize = SIZE / ((float) this.heights.length - 1); + int gridX = (int) Math.floor(terrainX / gridSquareSize); + int gridZ = (int) Math.floor(terrainZ / gridSquareSize); + if (gridX >= this.heights.length - 1 || gridZ >= this.heights.length - 1 || gridX < 0 || gridZ < 0) { + return 0; + } + float xCoord = (terrainX % gridSquareSize) / gridSquareSize; + float zCoord = (terrainZ % gridSquareSize) / gridSquareSize; + float answer; + if (xCoord <= (1 - zCoord)) { + answer = Maths.barryCentric(new Vector3f(0, this.heights[gridX][gridZ], 0), new Vector3f(1, this.heights[gridX + 1][gridZ], 0), new Vector3f(0, this.heights[gridX][gridZ + 1], 1), + new Vector2f(xCoord, zCoord)); + } else { + answer = Maths.barryCentric(new Vector3f(1, this.heights[gridX + 1][gridZ], 0), new Vector3f(1, this.heights[gridX + 1][gridZ + 1], 1), new Vector3f(0, this.heights[gridX][gridZ + 1], 1), + new Vector2f(xCoord, zCoord)); + } + return answer; } - - public void setX(float x) { - this.x = x; - } - - public float getZ() { - return z; - } - - public void setZ(float z) { - this.z = z; - } - + public RawModel getModel() { - return model; + return this.model; } - - public void setModel(RawModel model) { + + public TerrainTexturePack getTexturePack() { + return this.texturePack; + } + + public float getX() { + return this.x; + } + + public float getZ() { + return this.z; + } + + public void setModel(final RawModel model) { this.model = model; } - - public TerrainTexture getBlendMap() { - return blendMap; + + public void setX(final float x) { + this.x = x; } - - public TerrainTexturePack getTexturePack() { - return texturePack; + + public void setZ(final float z) { + this.z = z; } } diff --git a/src/toolbox/Maths.java b/src/toolbox/Maths.java index 444cefe..574bf7e 100644 --- a/src/toolbox/Maths.java +++ b/src/toolbox/Maths.java @@ -8,46 +8,46 @@ import entities.Camera; public class Maths { - public static float barryCentric(Vector3f p1, Vector3f p2, Vector3f p3, Vector2f pos) { - float det = (p2.z - p3.z) * (p1.x - p3.x) + (p3.x - p2.x) * (p1.z - p3.z); - float l1 = ((p2.z - p3.z) * (pos.x - p3.x) + (p3.x - p2.x) * (pos.y - p3.z)) / det; - float l2 = ((p3.z - p1.z) * (pos.x - p3.x) + (p1.x - p3.x) * (pos.y - p3.z)) / det; + public static float barryCentric(final Vector3f p1, final Vector3f p2, final Vector3f p3, final Vector2f pos) { + float det = (p2.z() - p3.z()) * (p1.x() - p3.x()) + (p3.x() - p2.x()) * (p1.z() - p3.z()); + float l1 = ((p2.z() - p3.z()) * (pos.x() - p3.x()) + (p3.x() - p2.x()) * (pos.y() - p3.z())) / det; + float l2 = ((p3.z() - p1.z()) * (pos.x() - p3.x()) + (p1.x() - p3.x()) * (pos.y() - p3.z())) / det; float l3 = 1.0f - l1 - l2; - return l1 * p1.y + l2 * p2.y + l3 * p3.y; + return l1 * p1.y() + l2 * p2.y() + l3 * p3.y(); } - public static Matrix4f createTransformationMatrix(Vector3f translation, Vector3f rotation, float scale) { - // Need to rework all of this this is really not optimum ... - Matrix4f matrix = new Matrix4f(); - matrix.setIdentity(); - matrix.translate(translation); - matrix.rotate(new Vector3f(1,0,0), rotation.x); - matrix.rotate(new Vector3f(0,1,0), rotation.y); - matrix.rotate(new Vector3f(0,0,1), rotation.z); - matrix.scale(scale); + public static Matrix4f createTransformationMatrix(final Vector2f translation, final Vector2f scale) { + Matrix4f matrix = Matrix4f.IDENTITY; + matrix = matrix.translate(new Vector3f(translation.x(), translation.y(), 0)); + matrix = matrix.scale(new Vector3f(scale.x(), scale.y(), 1f)); return matrix; } - public static Matrix4f createViewMatrixNoTranslate(Camera camera) { + + public static Matrix4f createTransformationMatrix(final Vector3f translation, final Vector3f rotation, final float scale) { // Need to rework all of this this is really not optimum ... - Matrix4f matrix = new Matrix4f(); - matrix.setIdentity(); - matrix.rotate(new Vector3f(1,0,0), camera.getPitch()); - matrix.rotate(new Vector3f(0,1,0), camera.getYaw()); + Matrix4f matrix = Matrix4f.IDENTITY; + matrix = matrix.translate(translation); + matrix = matrix.rotate(new Vector3f(1, 0, 0), rotation.x()); + matrix = matrix.rotate(new Vector3f(0, 1, 0), rotation.y()); + matrix = matrix.rotate(new Vector3f(0, 0, 1), rotation.z()); + matrix = matrix.scale(scale); return matrix; } - public static Matrix4f createViewMatrix(Camera camera) { + + public static Matrix4f createViewMatrix(final Camera camera) { // Need to rework all of this this is really not optimum ... Matrix4f matrix = createViewMatrixNoTranslate(camera); Vector3f camarePos = camera.getPosition(); - matrix.translate(new Vector3f(-camarePos.x,-camarePos.y,-camarePos.z)); + matrix = matrix.translate(new Vector3f(-camarePos.x(), -camarePos.y(), -camarePos.z())); return matrix; } - public static Matrix4f createTransformationMatrix(Vector2f translation, Vector2f scale) { - Matrix4f matrix = new Matrix4f(); - matrix.setIdentity(); - matrix.translate(new Vector3f(translation.x, translation.y, 0)); - matrix.scale(new Vector3f(scale.x, scale.y, 1f)); + + public static Matrix4f createViewMatrixNoTranslate(final Camera camera) { + // Need to rework all of this this is really not optimum ... + Matrix4f matrix = Matrix4f.IDENTITY; + matrix = matrix.rotate(new Vector3f(1, 0, 0), camera.getPitch()); + matrix = matrix.rotate(new Vector3f(0, 1, 0), camera.getYaw()); return matrix; } - + } diff --git a/test/src/test/atriasoft/gameengine/.keep b/test/src/test/atriasoft/ege/.keep similarity index 100% rename from test/src/test/atriasoft/gameengine/.keep rename to test/src/test/atriasoft/ege/.keep diff --git a/test/src/test/atriasoft/gameengine/Log.java b/test/src/test/atriasoft/ege/Log.java similarity index 100% rename from test/src/test/atriasoft/gameengine/Log.java rename to test/src/test/atriasoft/ege/Log.java diff --git a/test/src/test/atriasoft/gameengine/Log2.java b/test/src/test/atriasoft/ege/Log2.java similarity index 100% rename from test/src/test/atriasoft/gameengine/Log2.java rename to test/src/test/atriasoft/ege/Log2.java diff --git a/test/src/test/atriasoft/gameengine/TestBasicLog.java b/test/src/test/atriasoft/ege/TestBasicLog.java similarity index 100% rename from test/src/test/atriasoft/gameengine/TestBasicLog.java rename to test/src/test/atriasoft/ege/TestBasicLog.java diff --git a/test/src/test/atriasoft/ege/TestTransformation3D.java b/test/src/test/atriasoft/ege/TestTransformation3D.java new file mode 100644 index 0000000..ee79095 --- /dev/null +++ b/test/src/test/atriasoft/ege/TestTransformation3D.java @@ -0,0 +1,77 @@ +package test.atriasoft.ege; + +import org.atriasoft.ege.geometry.AABB; +import org.atriasoft.ege.geometry.Geometry3D; +import org.atriasoft.ege.geometry.OBB; +import org.atriasoft.ege.geometry.Plane; +import org.atriasoft.ege.geometry.Sphere; +import org.atriasoft.ege.geometry.Triangle; +import org.atriasoft.etk.math.Matrix3f; +import org.atriasoft.etk.math.Vector3f; +import org.junit.Assert; +import org.junit.jupiter.api.Test; + +public class TestTransformation3D { + + @Test + void testPointInAABB() { + final AABB shape = new AABB(new Vector3f(4, 4, 4), new Vector3f(1, 2, 3)); + Assert.assertFalse(Geometry3D.pointInAABB(new Vector3f(0, 0, 0), shape)); + Assert.assertFalse(Geometry3D.pointInAABB(new Vector3f(6, 6, 6), shape)); + Assert.assertTrue(Geometry3D.pointInAABB(new Vector3f(3, 3, 3), shape)); + Assert.assertTrue(Geometry3D.pointInAABB(new Vector3f(4, 4, 4), shape)); + Assert.assertTrue(Geometry3D.pointInAABB(new Vector3f(4, 4, 1.0001f), shape)); + Assert.assertTrue(Geometry3D.pointInAABB(new Vector3f(4, 2.0001f, 4), shape)); + Assert.assertTrue(Geometry3D.pointInAABB(new Vector3f(3.0001f, 4, 4), shape)); + } + + @Test + void testPointInLine() { + final Sphere shape = new Sphere(new Vector3f(4, 4, 4), 2); + Assert.assertFalse(Geometry3D.pointInSphere(new Vector3f(0, 0, 0), shape)); + Assert.assertFalse(Geometry3D.pointInSphere(new Vector3f(6, 6, 6), shape)); + Assert.assertTrue(Geometry3D.pointInSphere(new Vector3f(3, 3, 3), shape)); + Assert.assertTrue(Geometry3D.pointInSphere(new Vector3f(4, 4, 4), shape)); + Assert.assertTrue(Geometry3D.pointInSphere(new Vector3f(4, 4, 2.0001f), shape)); + Assert.assertTrue(Geometry3D.pointInSphere(new Vector3f(4, 2.0001f, 4), shape)); + Assert.assertTrue(Geometry3D.pointInSphere(new Vector3f(2.0001f, 4, 4), shape)); + } + + @Test + void testPointInOBB() { + final Matrix3f orientation = Matrix3f.IDENTITY; + orientation.multiply(Matrix3f.createMatrixRotate(new Vector3f(0, 0, 1), (float) Math.toRadians(45))); + final OBB shape = new OBB(new Vector3f(4, 4, 4), new Vector3f(1, 2, 3), orientation); + Assert.assertFalse(Geometry3D.pointInOBB(new Vector3f(0, 0, 0), shape)); + Assert.assertFalse(Geometry3D.pointInOBB(new Vector3f(6, 6, 6), shape)); + Assert.assertTrue(Geometry3D.pointInOBB(new Vector3f(3, 3, 3), shape)); + Assert.assertTrue(Geometry3D.pointInOBB(new Vector3f(4, 4, 4), shape)); + Assert.assertTrue(Geometry3D.pointInOBB(new Vector3f(4, 4, 1.0001f), shape)); + Assert.assertTrue(Geometry3D.pointInOBB(new Vector3f(4, 2.0001f, 4), shape)); + Assert.assertTrue(Geometry3D.pointInOBB(new Vector3f(3.0001f, 4, 4), shape)); + } + + @Test + void testPointInPlane() { + final Plane shape = new Plane((new Vector3f(4, 4, 4)).normalize(), (float) Math.sqrt(1 * 1 + 1 * 1)); + Assert.assertFalse(Geometry3D.pointInPlane(new Vector3f(0, 0, 0), shape)); + Assert.assertFalse(Geometry3D.pointInPlane(new Vector3f(6, 6, 6), shape)); + Assert.assertTrue(Geometry3D.pointInPlane(new Vector3f(3, 3, 3), shape)); + Assert.assertTrue(Geometry3D.pointInPlane(new Vector3f(4, 4, 4), shape)); + Assert.assertTrue(Geometry3D.pointInPlane(new Vector3f(4, 4, 1.0001f), shape)); + Assert.assertTrue(Geometry3D.pointInPlane(new Vector3f(4, 2.0001f, 4), shape)); + Assert.assertTrue(Geometry3D.pointInPlane(new Vector3f(3.0001f, 4, 4), shape)); + } + + @Test + void testPointInTriangle() { + final Triangle shape = new Triangle(new Vector3f(1, 0, 0), new Vector3f(0, 1, 0), new Vector3f(0, 0, 1)); + // assertTrue(Geometry3D.pointInTriangle(new Vector3f(1,0,0), shape)); + // assertTrue(Geometry3D.pointInTriangle(new Vector3f(0,1,0), shape)); + // assertTrue(Geometry3D.pointInTriangle(new Vector3f(0,0,1), shape)); + // assertFalse(Geometry3D.pointInTriangle(new Vector3f(5252,25252521,41458), shape)); + // assertFalse(Geometry3D.pointInTriangle(new Vector3f(1,1,1), shape)); + Assert.assertFalse(Geometry3D.pointInTriangle(new Vector3f(0.1f, 0.1f, 0.1f), shape)); + Assert.assertFalse(Geometry3D.pointInTriangle(new Vector3f(0, 0, 0), shape)); + } +} diff --git a/test/src/test/atriasoft/gameengine/TestTransformation3D.java b/test/src/test/atriasoft/gameengine/TestTransformation3D.java deleted file mode 100644 index 1ec8188..0000000 --- a/test/src/test/atriasoft/gameengine/TestTransformation3D.java +++ /dev/null @@ -1,76 +0,0 @@ -package test.atriasoft.ege; - -import org.atriasoft.ege.geometry.AABB; -import org.atriasoft.ege.geometry.OBB; -import org.atriasoft.ege.geometry.Geometry3D; -import org.atriasoft.ege.geometry.Plane; -import org.atriasoft.ege.geometry.Sphere; -import org.atriasoft.ege.geometry.Triangle; -import org.atriasoft.etk.math.Matrix3f; -import org.atriasoft.etk.math.Vector3f; -import org.junit.jupiter.api.Test; - - -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class TestTransformation3D{ - - @Test - void testPointInLine() { - Sphere shape = new Sphere(new Vector3f(4,4,4), 2); - assertFalse(Geometry3D.pointInSphere(new Vector3f(0,0,0), shape)); - assertFalse(Geometry3D.pointInSphere(new Vector3f(6,6,6), shape)); - assertTrue(Geometry3D.pointInSphere(new Vector3f(3,3,3), shape)); - assertTrue(Geometry3D.pointInSphere(new Vector3f(4,4,4), shape)); - assertTrue(Geometry3D.pointInSphere(new Vector3f(4,4,2.0001f), shape)); - assertTrue(Geometry3D.pointInSphere(new Vector3f(4,2.0001f,4), shape)); - assertTrue(Geometry3D.pointInSphere(new Vector3f(2.0001f,4,4), shape)); - } - @Test - void testPointInAABB() { - AABB shape = new AABB(new Vector3f(4,4,4), new Vector3f(1,2,3)); - assertFalse(Geometry3D.pointInAABB(new Vector3f(0,0,0), shape)); - assertFalse(Geometry3D.pointInAABB(new Vector3f(6,6,6), shape)); - assertTrue(Geometry3D.pointInAABB(new Vector3f(3,3,3), shape)); - assertTrue(Geometry3D.pointInAABB(new Vector3f(4,4,4), shape)); - assertTrue(Geometry3D.pointInAABB(new Vector3f(4,4,1.0001f), shape)); - assertTrue(Geometry3D.pointInAABB(new Vector3f(4,2.0001f,4), shape)); - assertTrue(Geometry3D.pointInAABB(new Vector3f(3.0001f,4,4), shape)); - } - @Test - void testPointInOBB() { - Matrix3f orientation = Matrix3f.identity(); - orientation.multiply(Matrix3f.createMatrixRotate(new Vector3f(0,0,1), (float)Math.toRadians(45))); - OBB shape = new OBB(new Vector3f(4,4,4), new Vector3f(1,2,3), orientation); - assertFalse(Geometry3D.pointInOBB(new Vector3f(0,0,0), shape)); - assertFalse(Geometry3D.pointInOBB(new Vector3f(6,6,6), shape)); - assertTrue(Geometry3D.pointInOBB(new Vector3f(3,3,3), shape)); - assertTrue(Geometry3D.pointInOBB(new Vector3f(4,4,4), shape)); - assertTrue(Geometry3D.pointInOBB(new Vector3f(4,4,1.0001f), shape)); - assertTrue(Geometry3D.pointInOBB(new Vector3f(4,2.0001f,4), shape)); - assertTrue(Geometry3D.pointInOBB(new Vector3f(3.0001f,4,4), shape)); - } - @Test - void testPointInPlane() { - Plane shape = new Plane((new Vector3f(4,4,4)).normalize(), (float)Math.sqrt(1*1+1*1)); - assertFalse(Geometry3D.pointInPlane(new Vector3f(0,0,0), shape)); - assertFalse(Geometry3D.pointInPlane(new Vector3f(6,6,6), shape)); - assertTrue(Geometry3D.pointInPlane(new Vector3f(3,3,3), shape)); - assertTrue(Geometry3D.pointInPlane(new Vector3f(4,4,4), shape)); - assertTrue(Geometry3D.pointInPlane(new Vector3f(4,4,1.0001f), shape)); - assertTrue(Geometry3D.pointInPlane(new Vector3f(4,2.0001f,4), shape)); - assertTrue(Geometry3D.pointInPlane(new Vector3f(3.0001f,4,4), shape)); - } - @Test - void testPointInTriangle() { - Triangle shape = new Triangle(new Vector3f(1,0,0), new Vector3f(0,1,0), new Vector3f(0,0,1)); -// assertTrue(Geometry3D.pointInTriangle(new Vector3f(1,0,0), shape)); -// assertTrue(Geometry3D.pointInTriangle(new Vector3f(0,1,0), shape)); -// assertTrue(Geometry3D.pointInTriangle(new Vector3f(0,0,1), shape)); -// assertFalse(Geometry3D.pointInTriangle(new Vector3f(5252,25252521,41458), shape)); -// assertFalse(Geometry3D.pointInTriangle(new Vector3f(1,1,1), shape)); - assertFalse(Geometry3D.pointInTriangle(new Vector3f(0.1f,0.1f,0.1f), shape)); - assertFalse(Geometry3D.pointInTriangle(new Vector3f(0,0,0), shape)); - } -}