diff --git a/entities/environment/birchtree/BirchTree_1.glb b/entities/environment/birchtree/BirchTree_1.glb new file mode 100644 index 0000000..b68f597 Binary files /dev/null and b/entities/environment/birchtree/BirchTree_1.glb differ diff --git a/entities/environment/birchtree/BirchTree_1.glb.import b/entities/environment/birchtree/BirchTree_1.glb.import new file mode 100644 index 0000000..17529cc --- /dev/null +++ b/entities/environment/birchtree/BirchTree_1.glb.import @@ -0,0 +1,1065 @@ +[remap] + +importer="scene" +type="PackedScene" +path="res://.import/BirchTree_1.glb-0ed9b9af0bf80854878b8f5051793fa4.scn" + +[deps] + +source_file="res://entities/environment/birchtree/BirchTree_1.glb" +dest_files=[ "res://.import/BirchTree_1.glb-0ed9b9af0bf80854878b8f5051793fa4.scn" ] + +[params] + +nodes/root_type="Spatial" +nodes/root_name="Scene Root" +nodes/root_scale=1.0 +nodes/custom_script="" +nodes/storage=0 +nodes/use_legacy_names=false +materials/location=1 +materials/storage=1 +materials/keep_on_reimport=true +meshes/octahedral_compression=true +meshes/compress=4286 +meshes/ensure_tangents=true +meshes/storage=0 +meshes/light_baking=0 +meshes/lightmap_texel_size=0.1 +skins/use_named_skins=true +external_files/store_in_subdir=false +animation/import=true +animation/fps=15 +animation/filter_script="" +animation/storage=false +animation/keep_custom_tracks=false +animation/optimizer/enabled=true +animation/optimizer/max_linear_error=0.05 +animation/optimizer/max_angular_error=0.01 +animation/optimizer/max_angle=22 +animation/optimizer/remove_unused_tracks=true +animation/clips/amount=0 +animation/clip_1/name="" +animation/clip_1/start_frame=0 +animation/clip_1/end_frame=0 +animation/clip_1/loops=false +animation/clip_2/name="" +animation/clip_2/start_frame=0 +animation/clip_2/end_frame=0 +animation/clip_2/loops=false +animation/clip_3/name="" +animation/clip_3/start_frame=0 +animation/clip_3/end_frame=0 +animation/clip_3/loops=false +animation/clip_4/name="" +animation/clip_4/start_frame=0 +animation/clip_4/end_frame=0 +animation/clip_4/loops=false +animation/clip_5/name="" +animation/clip_5/start_frame=0 +animation/clip_5/end_frame=0 +animation/clip_5/loops=false +animation/clip_6/name="" +animation/clip_6/start_frame=0 +animation/clip_6/end_frame=0 +animation/clip_6/loops=false +animation/clip_7/name="" +animation/clip_7/start_frame=0 +animation/clip_7/end_frame=0 +animation/clip_7/loops=false +animation/clip_8/name="" +animation/clip_8/start_frame=0 +animation/clip_8/end_frame=0 +animation/clip_8/loops=false +animation/clip_9/name="" +animation/clip_9/start_frame=0 +animation/clip_9/end_frame=0 +animation/clip_9/loops=false +animation/clip_10/name="" +animation/clip_10/start_frame=0 +animation/clip_10/end_frame=0 +animation/clip_10/loops=false +animation/clip_11/name="" +animation/clip_11/start_frame=0 +animation/clip_11/end_frame=0 +animation/clip_11/loops=false +animation/clip_12/name="" +animation/clip_12/start_frame=0 +animation/clip_12/end_frame=0 +animation/clip_12/loops=false +animation/clip_13/name="" +animation/clip_13/start_frame=0 +animation/clip_13/end_frame=0 +animation/clip_13/loops=false +animation/clip_14/name="" +animation/clip_14/start_frame=0 +animation/clip_14/end_frame=0 +animation/clip_14/loops=false +animation/clip_15/name="" +animation/clip_15/start_frame=0 +animation/clip_15/end_frame=0 +animation/clip_15/loops=false +animation/clip_16/name="" +animation/clip_16/start_frame=0 +animation/clip_16/end_frame=0 +animation/clip_16/loops=false +animation/clip_17/name="" +animation/clip_17/start_frame=0 +animation/clip_17/end_frame=0 +animation/clip_17/loops=false +animation/clip_18/name="" +animation/clip_18/start_frame=0 +animation/clip_18/end_frame=0 +animation/clip_18/loops=false +animation/clip_19/name="" +animation/clip_19/start_frame=0 +animation/clip_19/end_frame=0 +animation/clip_19/loops=false +animation/clip_20/name="" +animation/clip_20/start_frame=0 +animation/clip_20/end_frame=0 +animation/clip_20/loops=false +animation/clip_21/name="" +animation/clip_21/start_frame=0 +animation/clip_21/end_frame=0 +animation/clip_21/loops=false +animation/clip_22/name="" +animation/clip_22/start_frame=0 +animation/clip_22/end_frame=0 +animation/clip_22/loops=false +animation/clip_23/name="" +animation/clip_23/start_frame=0 +animation/clip_23/end_frame=0 +animation/clip_23/loops=false +animation/clip_24/name="" +animation/clip_24/start_frame=0 +animation/clip_24/end_frame=0 +animation/clip_24/loops=false +animation/clip_25/name="" +animation/clip_25/start_frame=0 +animation/clip_25/end_frame=0 +animation/clip_25/loops=false +animation/clip_26/name="" +animation/clip_26/start_frame=0 +animation/clip_26/end_frame=0 +animation/clip_26/loops=false +animation/clip_27/name="" +animation/clip_27/start_frame=0 +animation/clip_27/end_frame=0 +animation/clip_27/loops=false +animation/clip_28/name="" +animation/clip_28/start_frame=0 +animation/clip_28/end_frame=0 +animation/clip_28/loops=false +animation/clip_29/name="" +animation/clip_29/start_frame=0 +animation/clip_29/end_frame=0 +animation/clip_29/loops=false +animation/clip_30/name="" +animation/clip_30/start_frame=0 +animation/clip_30/end_frame=0 +animation/clip_30/loops=false +animation/clip_31/name="" +animation/clip_31/start_frame=0 +animation/clip_31/end_frame=0 +animation/clip_31/loops=false +animation/clip_32/name="" +animation/clip_32/start_frame=0 +animation/clip_32/end_frame=0 +animation/clip_32/loops=false +animation/clip_33/name="" +animation/clip_33/start_frame=0 +animation/clip_33/end_frame=0 +animation/clip_33/loops=false +animation/clip_34/name="" +animation/clip_34/start_frame=0 +animation/clip_34/end_frame=0 +animation/clip_34/loops=false +animation/clip_35/name="" +animation/clip_35/start_frame=0 +animation/clip_35/end_frame=0 +animation/clip_35/loops=false +animation/clip_36/name="" +animation/clip_36/start_frame=0 +animation/clip_36/end_frame=0 +animation/clip_36/loops=false +animation/clip_37/name="" +animation/clip_37/start_frame=0 +animation/clip_37/end_frame=0 +animation/clip_37/loops=false +animation/clip_38/name="" +animation/clip_38/start_frame=0 +animation/clip_38/end_frame=0 +animation/clip_38/loops=false +animation/clip_39/name="" +animation/clip_39/start_frame=0 +animation/clip_39/end_frame=0 +animation/clip_39/loops=false +animation/clip_40/name="" +animation/clip_40/start_frame=0 +animation/clip_40/end_frame=0 +animation/clip_40/loops=false +animation/clip_41/name="" +animation/clip_41/start_frame=0 +animation/clip_41/end_frame=0 +animation/clip_41/loops=false +animation/clip_42/name="" +animation/clip_42/start_frame=0 +animation/clip_42/end_frame=0 +animation/clip_42/loops=false +animation/clip_43/name="" +animation/clip_43/start_frame=0 +animation/clip_43/end_frame=0 +animation/clip_43/loops=false +animation/clip_44/name="" +animation/clip_44/start_frame=0 +animation/clip_44/end_frame=0 +animation/clip_44/loops=false +animation/clip_45/name="" +animation/clip_45/start_frame=0 +animation/clip_45/end_frame=0 +animation/clip_45/loops=false +animation/clip_46/name="" +animation/clip_46/start_frame=0 +animation/clip_46/end_frame=0 +animation/clip_46/loops=false +animation/clip_47/name="" +animation/clip_47/start_frame=0 +animation/clip_47/end_frame=0 +animation/clip_47/loops=false +animation/clip_48/name="" +animation/clip_48/start_frame=0 +animation/clip_48/end_frame=0 +animation/clip_48/loops=false +animation/clip_49/name="" +animation/clip_49/start_frame=0 +animation/clip_49/end_frame=0 +animation/clip_49/loops=false +animation/clip_50/name="" +animation/clip_50/start_frame=0 +animation/clip_50/end_frame=0 +animation/clip_50/loops=false +animation/clip_51/name="" +animation/clip_51/start_frame=0 +animation/clip_51/end_frame=0 +animation/clip_51/loops=false +animation/clip_52/name="" +animation/clip_52/start_frame=0 +animation/clip_52/end_frame=0 +animation/clip_52/loops=false +animation/clip_53/name="" +animation/clip_53/start_frame=0 +animation/clip_53/end_frame=0 +animation/clip_53/loops=false +animation/clip_54/name="" +animation/clip_54/start_frame=0 +animation/clip_54/end_frame=0 +animation/clip_54/loops=false +animation/clip_55/name="" +animation/clip_55/start_frame=0 +animation/clip_55/end_frame=0 +animation/clip_55/loops=false +animation/clip_56/name="" +animation/clip_56/start_frame=0 +animation/clip_56/end_frame=0 +animation/clip_56/loops=false +animation/clip_57/name="" +animation/clip_57/start_frame=0 +animation/clip_57/end_frame=0 +animation/clip_57/loops=false +animation/clip_58/name="" +animation/clip_58/start_frame=0 +animation/clip_58/end_frame=0 +animation/clip_58/loops=false +animation/clip_59/name="" +animation/clip_59/start_frame=0 +animation/clip_59/end_frame=0 +animation/clip_59/loops=false +animation/clip_60/name="" +animation/clip_60/start_frame=0 +animation/clip_60/end_frame=0 +animation/clip_60/loops=false +animation/clip_61/name="" +animation/clip_61/start_frame=0 +animation/clip_61/end_frame=0 +animation/clip_61/loops=false +animation/clip_62/name="" +animation/clip_62/start_frame=0 +animation/clip_62/end_frame=0 +animation/clip_62/loops=false +animation/clip_63/name="" +animation/clip_63/start_frame=0 +animation/clip_63/end_frame=0 +animation/clip_63/loops=false +animation/clip_64/name="" +animation/clip_64/start_frame=0 +animation/clip_64/end_frame=0 +animation/clip_64/loops=false +animation/clip_65/name="" +animation/clip_65/start_frame=0 +animation/clip_65/end_frame=0 +animation/clip_65/loops=false +animation/clip_66/name="" +animation/clip_66/start_frame=0 +animation/clip_66/end_frame=0 +animation/clip_66/loops=false +animation/clip_67/name="" +animation/clip_67/start_frame=0 +animation/clip_67/end_frame=0 +animation/clip_67/loops=false +animation/clip_68/name="" +animation/clip_68/start_frame=0 +animation/clip_68/end_frame=0 +animation/clip_68/loops=false +animation/clip_69/name="" +animation/clip_69/start_frame=0 +animation/clip_69/end_frame=0 +animation/clip_69/loops=false +animation/clip_70/name="" +animation/clip_70/start_frame=0 +animation/clip_70/end_frame=0 +animation/clip_70/loops=false +animation/clip_71/name="" +animation/clip_71/start_frame=0 +animation/clip_71/end_frame=0 +animation/clip_71/loops=false +animation/clip_72/name="" +animation/clip_72/start_frame=0 +animation/clip_72/end_frame=0 +animation/clip_72/loops=false +animation/clip_73/name="" +animation/clip_73/start_frame=0 +animation/clip_73/end_frame=0 +animation/clip_73/loops=false +animation/clip_74/name="" +animation/clip_74/start_frame=0 +animation/clip_74/end_frame=0 +animation/clip_74/loops=false +animation/clip_75/name="" +animation/clip_75/start_frame=0 +animation/clip_75/end_frame=0 +animation/clip_75/loops=false +animation/clip_76/name="" +animation/clip_76/start_frame=0 +animation/clip_76/end_frame=0 +animation/clip_76/loops=false +animation/clip_77/name="" +animation/clip_77/start_frame=0 +animation/clip_77/end_frame=0 +animation/clip_77/loops=false +animation/clip_78/name="" +animation/clip_78/start_frame=0 +animation/clip_78/end_frame=0 +animation/clip_78/loops=false +animation/clip_79/name="" +animation/clip_79/start_frame=0 +animation/clip_79/end_frame=0 +animation/clip_79/loops=false +animation/clip_80/name="" +animation/clip_80/start_frame=0 +animation/clip_80/end_frame=0 +animation/clip_80/loops=false +animation/clip_81/name="" +animation/clip_81/start_frame=0 +animation/clip_81/end_frame=0 +animation/clip_81/loops=false +animation/clip_82/name="" +animation/clip_82/start_frame=0 +animation/clip_82/end_frame=0 +animation/clip_82/loops=false +animation/clip_83/name="" +animation/clip_83/start_frame=0 +animation/clip_83/end_frame=0 +animation/clip_83/loops=false +animation/clip_84/name="" +animation/clip_84/start_frame=0 +animation/clip_84/end_frame=0 +animation/clip_84/loops=false +animation/clip_85/name="" +animation/clip_85/start_frame=0 +animation/clip_85/end_frame=0 +animation/clip_85/loops=false +animation/clip_86/name="" +animation/clip_86/start_frame=0 +animation/clip_86/end_frame=0 +animation/clip_86/loops=false +animation/clip_87/name="" +animation/clip_87/start_frame=0 +animation/clip_87/end_frame=0 +animation/clip_87/loops=false +animation/clip_88/name="" +animation/clip_88/start_frame=0 +animation/clip_88/end_frame=0 +animation/clip_88/loops=false +animation/clip_89/name="" +animation/clip_89/start_frame=0 +animation/clip_89/end_frame=0 +animation/clip_89/loops=false +animation/clip_90/name="" +animation/clip_90/start_frame=0 +animation/clip_90/end_frame=0 +animation/clip_90/loops=false +animation/clip_91/name="" +animation/clip_91/start_frame=0 +animation/clip_91/end_frame=0 +animation/clip_91/loops=false +animation/clip_92/name="" +animation/clip_92/start_frame=0 +animation/clip_92/end_frame=0 +animation/clip_92/loops=false +animation/clip_93/name="" +animation/clip_93/start_frame=0 +animation/clip_93/end_frame=0 +animation/clip_93/loops=false +animation/clip_94/name="" +animation/clip_94/start_frame=0 +animation/clip_94/end_frame=0 +animation/clip_94/loops=false +animation/clip_95/name="" +animation/clip_95/start_frame=0 +animation/clip_95/end_frame=0 +animation/clip_95/loops=false +animation/clip_96/name="" +animation/clip_96/start_frame=0 +animation/clip_96/end_frame=0 +animation/clip_96/loops=false +animation/clip_97/name="" +animation/clip_97/start_frame=0 +animation/clip_97/end_frame=0 +animation/clip_97/loops=false +animation/clip_98/name="" +animation/clip_98/start_frame=0 +animation/clip_98/end_frame=0 +animation/clip_98/loops=false +animation/clip_99/name="" +animation/clip_99/start_frame=0 +animation/clip_99/end_frame=0 +animation/clip_99/loops=false +animation/clip_100/name="" +animation/clip_100/start_frame=0 +animation/clip_100/end_frame=0 +animation/clip_100/loops=false +animation/clip_101/name="" +animation/clip_101/start_frame=0 +animation/clip_101/end_frame=0 +animation/clip_101/loops=false +animation/clip_102/name="" +animation/clip_102/start_frame=0 +animation/clip_102/end_frame=0 +animation/clip_102/loops=false +animation/clip_103/name="" +animation/clip_103/start_frame=0 +animation/clip_103/end_frame=0 +animation/clip_103/loops=false +animation/clip_104/name="" +animation/clip_104/start_frame=0 +animation/clip_104/end_frame=0 +animation/clip_104/loops=false +animation/clip_105/name="" +animation/clip_105/start_frame=0 +animation/clip_105/end_frame=0 +animation/clip_105/loops=false +animation/clip_106/name="" +animation/clip_106/start_frame=0 +animation/clip_106/end_frame=0 +animation/clip_106/loops=false +animation/clip_107/name="" +animation/clip_107/start_frame=0 +animation/clip_107/end_frame=0 +animation/clip_107/loops=false +animation/clip_108/name="" +animation/clip_108/start_frame=0 +animation/clip_108/end_frame=0 +animation/clip_108/loops=false +animation/clip_109/name="" +animation/clip_109/start_frame=0 +animation/clip_109/end_frame=0 +animation/clip_109/loops=false +animation/clip_110/name="" +animation/clip_110/start_frame=0 +animation/clip_110/end_frame=0 +animation/clip_110/loops=false +animation/clip_111/name="" +animation/clip_111/start_frame=0 +animation/clip_111/end_frame=0 +animation/clip_111/loops=false +animation/clip_112/name="" +animation/clip_112/start_frame=0 +animation/clip_112/end_frame=0 +animation/clip_112/loops=false +animation/clip_113/name="" +animation/clip_113/start_frame=0 +animation/clip_113/end_frame=0 +animation/clip_113/loops=false +animation/clip_114/name="" +animation/clip_114/start_frame=0 +animation/clip_114/end_frame=0 +animation/clip_114/loops=false +animation/clip_115/name="" +animation/clip_115/start_frame=0 +animation/clip_115/end_frame=0 +animation/clip_115/loops=false +animation/clip_116/name="" +animation/clip_116/start_frame=0 +animation/clip_116/end_frame=0 +animation/clip_116/loops=false +animation/clip_117/name="" +animation/clip_117/start_frame=0 +animation/clip_117/end_frame=0 +animation/clip_117/loops=false +animation/clip_118/name="" +animation/clip_118/start_frame=0 +animation/clip_118/end_frame=0 +animation/clip_118/loops=false +animation/clip_119/name="" +animation/clip_119/start_frame=0 +animation/clip_119/end_frame=0 +animation/clip_119/loops=false +animation/clip_120/name="" +animation/clip_120/start_frame=0 +animation/clip_120/end_frame=0 +animation/clip_120/loops=false +animation/clip_121/name="" +animation/clip_121/start_frame=0 +animation/clip_121/end_frame=0 +animation/clip_121/loops=false +animation/clip_122/name="" +animation/clip_122/start_frame=0 +animation/clip_122/end_frame=0 +animation/clip_122/loops=false +animation/clip_123/name="" +animation/clip_123/start_frame=0 +animation/clip_123/end_frame=0 +animation/clip_123/loops=false +animation/clip_124/name="" +animation/clip_124/start_frame=0 +animation/clip_124/end_frame=0 +animation/clip_124/loops=false +animation/clip_125/name="" +animation/clip_125/start_frame=0 +animation/clip_125/end_frame=0 +animation/clip_125/loops=false +animation/clip_126/name="" +animation/clip_126/start_frame=0 +animation/clip_126/end_frame=0 +animation/clip_126/loops=false +animation/clip_127/name="" +animation/clip_127/start_frame=0 +animation/clip_127/end_frame=0 +animation/clip_127/loops=false +animation/clip_128/name="" +animation/clip_128/start_frame=0 +animation/clip_128/end_frame=0 +animation/clip_128/loops=false +animation/clip_129/name="" +animation/clip_129/start_frame=0 +animation/clip_129/end_frame=0 +animation/clip_129/loops=false +animation/clip_130/name="" +animation/clip_130/start_frame=0 +animation/clip_130/end_frame=0 +animation/clip_130/loops=false +animation/clip_131/name="" +animation/clip_131/start_frame=0 +animation/clip_131/end_frame=0 +animation/clip_131/loops=false +animation/clip_132/name="" +animation/clip_132/start_frame=0 +animation/clip_132/end_frame=0 +animation/clip_132/loops=false +animation/clip_133/name="" +animation/clip_133/start_frame=0 +animation/clip_133/end_frame=0 +animation/clip_133/loops=false +animation/clip_134/name="" +animation/clip_134/start_frame=0 +animation/clip_134/end_frame=0 +animation/clip_134/loops=false +animation/clip_135/name="" +animation/clip_135/start_frame=0 +animation/clip_135/end_frame=0 +animation/clip_135/loops=false +animation/clip_136/name="" +animation/clip_136/start_frame=0 +animation/clip_136/end_frame=0 +animation/clip_136/loops=false +animation/clip_137/name="" +animation/clip_137/start_frame=0 +animation/clip_137/end_frame=0 +animation/clip_137/loops=false +animation/clip_138/name="" +animation/clip_138/start_frame=0 +animation/clip_138/end_frame=0 +animation/clip_138/loops=false +animation/clip_139/name="" +animation/clip_139/start_frame=0 +animation/clip_139/end_frame=0 +animation/clip_139/loops=false +animation/clip_140/name="" +animation/clip_140/start_frame=0 +animation/clip_140/end_frame=0 +animation/clip_140/loops=false +animation/clip_141/name="" +animation/clip_141/start_frame=0 +animation/clip_141/end_frame=0 +animation/clip_141/loops=false +animation/clip_142/name="" +animation/clip_142/start_frame=0 +animation/clip_142/end_frame=0 +animation/clip_142/loops=false +animation/clip_143/name="" +animation/clip_143/start_frame=0 +animation/clip_143/end_frame=0 +animation/clip_143/loops=false +animation/clip_144/name="" +animation/clip_144/start_frame=0 +animation/clip_144/end_frame=0 +animation/clip_144/loops=false +animation/clip_145/name="" +animation/clip_145/start_frame=0 +animation/clip_145/end_frame=0 +animation/clip_145/loops=false +animation/clip_146/name="" +animation/clip_146/start_frame=0 +animation/clip_146/end_frame=0 +animation/clip_146/loops=false +animation/clip_147/name="" +animation/clip_147/start_frame=0 +animation/clip_147/end_frame=0 +animation/clip_147/loops=false +animation/clip_148/name="" +animation/clip_148/start_frame=0 +animation/clip_148/end_frame=0 +animation/clip_148/loops=false +animation/clip_149/name="" +animation/clip_149/start_frame=0 +animation/clip_149/end_frame=0 +animation/clip_149/loops=false +animation/clip_150/name="" +animation/clip_150/start_frame=0 +animation/clip_150/end_frame=0 +animation/clip_150/loops=false +animation/clip_151/name="" +animation/clip_151/start_frame=0 +animation/clip_151/end_frame=0 +animation/clip_151/loops=false +animation/clip_152/name="" +animation/clip_152/start_frame=0 +animation/clip_152/end_frame=0 +animation/clip_152/loops=false +animation/clip_153/name="" +animation/clip_153/start_frame=0 +animation/clip_153/end_frame=0 +animation/clip_153/loops=false +animation/clip_154/name="" +animation/clip_154/start_frame=0 +animation/clip_154/end_frame=0 +animation/clip_154/loops=false +animation/clip_155/name="" +animation/clip_155/start_frame=0 +animation/clip_155/end_frame=0 +animation/clip_155/loops=false +animation/clip_156/name="" +animation/clip_156/start_frame=0 +animation/clip_156/end_frame=0 +animation/clip_156/loops=false +animation/clip_157/name="" +animation/clip_157/start_frame=0 +animation/clip_157/end_frame=0 +animation/clip_157/loops=false +animation/clip_158/name="" +animation/clip_158/start_frame=0 +animation/clip_158/end_frame=0 +animation/clip_158/loops=false +animation/clip_159/name="" +animation/clip_159/start_frame=0 +animation/clip_159/end_frame=0 +animation/clip_159/loops=false +animation/clip_160/name="" +animation/clip_160/start_frame=0 +animation/clip_160/end_frame=0 +animation/clip_160/loops=false +animation/clip_161/name="" +animation/clip_161/start_frame=0 +animation/clip_161/end_frame=0 +animation/clip_161/loops=false +animation/clip_162/name="" +animation/clip_162/start_frame=0 +animation/clip_162/end_frame=0 +animation/clip_162/loops=false +animation/clip_163/name="" +animation/clip_163/start_frame=0 +animation/clip_163/end_frame=0 +animation/clip_163/loops=false +animation/clip_164/name="" +animation/clip_164/start_frame=0 +animation/clip_164/end_frame=0 +animation/clip_164/loops=false +animation/clip_165/name="" +animation/clip_165/start_frame=0 +animation/clip_165/end_frame=0 +animation/clip_165/loops=false +animation/clip_166/name="" +animation/clip_166/start_frame=0 +animation/clip_166/end_frame=0 +animation/clip_166/loops=false +animation/clip_167/name="" +animation/clip_167/start_frame=0 +animation/clip_167/end_frame=0 +animation/clip_167/loops=false +animation/clip_168/name="" +animation/clip_168/start_frame=0 +animation/clip_168/end_frame=0 +animation/clip_168/loops=false +animation/clip_169/name="" +animation/clip_169/start_frame=0 +animation/clip_169/end_frame=0 +animation/clip_169/loops=false +animation/clip_170/name="" +animation/clip_170/start_frame=0 +animation/clip_170/end_frame=0 +animation/clip_170/loops=false +animation/clip_171/name="" +animation/clip_171/start_frame=0 +animation/clip_171/end_frame=0 +animation/clip_171/loops=false +animation/clip_172/name="" +animation/clip_172/start_frame=0 +animation/clip_172/end_frame=0 +animation/clip_172/loops=false +animation/clip_173/name="" +animation/clip_173/start_frame=0 +animation/clip_173/end_frame=0 +animation/clip_173/loops=false +animation/clip_174/name="" +animation/clip_174/start_frame=0 +animation/clip_174/end_frame=0 +animation/clip_174/loops=false +animation/clip_175/name="" +animation/clip_175/start_frame=0 +animation/clip_175/end_frame=0 +animation/clip_175/loops=false +animation/clip_176/name="" +animation/clip_176/start_frame=0 +animation/clip_176/end_frame=0 +animation/clip_176/loops=false +animation/clip_177/name="" +animation/clip_177/start_frame=0 +animation/clip_177/end_frame=0 +animation/clip_177/loops=false +animation/clip_178/name="" +animation/clip_178/start_frame=0 +animation/clip_178/end_frame=0 +animation/clip_178/loops=false +animation/clip_179/name="" +animation/clip_179/start_frame=0 +animation/clip_179/end_frame=0 +animation/clip_179/loops=false +animation/clip_180/name="" +animation/clip_180/start_frame=0 +animation/clip_180/end_frame=0 +animation/clip_180/loops=false +animation/clip_181/name="" +animation/clip_181/start_frame=0 +animation/clip_181/end_frame=0 +animation/clip_181/loops=false +animation/clip_182/name="" +animation/clip_182/start_frame=0 +animation/clip_182/end_frame=0 +animation/clip_182/loops=false +animation/clip_183/name="" +animation/clip_183/start_frame=0 +animation/clip_183/end_frame=0 +animation/clip_183/loops=false +animation/clip_184/name="" +animation/clip_184/start_frame=0 +animation/clip_184/end_frame=0 +animation/clip_184/loops=false +animation/clip_185/name="" +animation/clip_185/start_frame=0 +animation/clip_185/end_frame=0 +animation/clip_185/loops=false +animation/clip_186/name="" +animation/clip_186/start_frame=0 +animation/clip_186/end_frame=0 +animation/clip_186/loops=false +animation/clip_187/name="" +animation/clip_187/start_frame=0 +animation/clip_187/end_frame=0 +animation/clip_187/loops=false +animation/clip_188/name="" +animation/clip_188/start_frame=0 +animation/clip_188/end_frame=0 +animation/clip_188/loops=false +animation/clip_189/name="" +animation/clip_189/start_frame=0 +animation/clip_189/end_frame=0 +animation/clip_189/loops=false +animation/clip_190/name="" +animation/clip_190/start_frame=0 +animation/clip_190/end_frame=0 +animation/clip_190/loops=false +animation/clip_191/name="" +animation/clip_191/start_frame=0 +animation/clip_191/end_frame=0 +animation/clip_191/loops=false +animation/clip_192/name="" +animation/clip_192/start_frame=0 +animation/clip_192/end_frame=0 +animation/clip_192/loops=false +animation/clip_193/name="" +animation/clip_193/start_frame=0 +animation/clip_193/end_frame=0 +animation/clip_193/loops=false +animation/clip_194/name="" +animation/clip_194/start_frame=0 +animation/clip_194/end_frame=0 +animation/clip_194/loops=false +animation/clip_195/name="" +animation/clip_195/start_frame=0 +animation/clip_195/end_frame=0 +animation/clip_195/loops=false +animation/clip_196/name="" +animation/clip_196/start_frame=0 +animation/clip_196/end_frame=0 +animation/clip_196/loops=false +animation/clip_197/name="" +animation/clip_197/start_frame=0 +animation/clip_197/end_frame=0 +animation/clip_197/loops=false +animation/clip_198/name="" +animation/clip_198/start_frame=0 +animation/clip_198/end_frame=0 +animation/clip_198/loops=false +animation/clip_199/name="" +animation/clip_199/start_frame=0 +animation/clip_199/end_frame=0 +animation/clip_199/loops=false +animation/clip_200/name="" +animation/clip_200/start_frame=0 +animation/clip_200/end_frame=0 +animation/clip_200/loops=false +animation/clip_201/name="" +animation/clip_201/start_frame=0 +animation/clip_201/end_frame=0 +animation/clip_201/loops=false +animation/clip_202/name="" +animation/clip_202/start_frame=0 +animation/clip_202/end_frame=0 +animation/clip_202/loops=false +animation/clip_203/name="" +animation/clip_203/start_frame=0 +animation/clip_203/end_frame=0 +animation/clip_203/loops=false +animation/clip_204/name="" +animation/clip_204/start_frame=0 +animation/clip_204/end_frame=0 +animation/clip_204/loops=false +animation/clip_205/name="" +animation/clip_205/start_frame=0 +animation/clip_205/end_frame=0 +animation/clip_205/loops=false +animation/clip_206/name="" +animation/clip_206/start_frame=0 +animation/clip_206/end_frame=0 +animation/clip_206/loops=false +animation/clip_207/name="" +animation/clip_207/start_frame=0 +animation/clip_207/end_frame=0 +animation/clip_207/loops=false +animation/clip_208/name="" +animation/clip_208/start_frame=0 +animation/clip_208/end_frame=0 +animation/clip_208/loops=false +animation/clip_209/name="" +animation/clip_209/start_frame=0 +animation/clip_209/end_frame=0 +animation/clip_209/loops=false +animation/clip_210/name="" +animation/clip_210/start_frame=0 +animation/clip_210/end_frame=0 +animation/clip_210/loops=false +animation/clip_211/name="" +animation/clip_211/start_frame=0 +animation/clip_211/end_frame=0 +animation/clip_211/loops=false +animation/clip_212/name="" +animation/clip_212/start_frame=0 +animation/clip_212/end_frame=0 +animation/clip_212/loops=false +animation/clip_213/name="" +animation/clip_213/start_frame=0 +animation/clip_213/end_frame=0 +animation/clip_213/loops=false +animation/clip_214/name="" +animation/clip_214/start_frame=0 +animation/clip_214/end_frame=0 +animation/clip_214/loops=false +animation/clip_215/name="" +animation/clip_215/start_frame=0 +animation/clip_215/end_frame=0 +animation/clip_215/loops=false +animation/clip_216/name="" +animation/clip_216/start_frame=0 +animation/clip_216/end_frame=0 +animation/clip_216/loops=false +animation/clip_217/name="" +animation/clip_217/start_frame=0 +animation/clip_217/end_frame=0 +animation/clip_217/loops=false +animation/clip_218/name="" +animation/clip_218/start_frame=0 +animation/clip_218/end_frame=0 +animation/clip_218/loops=false +animation/clip_219/name="" +animation/clip_219/start_frame=0 +animation/clip_219/end_frame=0 +animation/clip_219/loops=false +animation/clip_220/name="" +animation/clip_220/start_frame=0 +animation/clip_220/end_frame=0 +animation/clip_220/loops=false +animation/clip_221/name="" +animation/clip_221/start_frame=0 +animation/clip_221/end_frame=0 +animation/clip_221/loops=false +animation/clip_222/name="" +animation/clip_222/start_frame=0 +animation/clip_222/end_frame=0 +animation/clip_222/loops=false +animation/clip_223/name="" +animation/clip_223/start_frame=0 +animation/clip_223/end_frame=0 +animation/clip_223/loops=false +animation/clip_224/name="" +animation/clip_224/start_frame=0 +animation/clip_224/end_frame=0 +animation/clip_224/loops=false +animation/clip_225/name="" +animation/clip_225/start_frame=0 +animation/clip_225/end_frame=0 +animation/clip_225/loops=false +animation/clip_226/name="" +animation/clip_226/start_frame=0 +animation/clip_226/end_frame=0 +animation/clip_226/loops=false +animation/clip_227/name="" +animation/clip_227/start_frame=0 +animation/clip_227/end_frame=0 +animation/clip_227/loops=false +animation/clip_228/name="" +animation/clip_228/start_frame=0 +animation/clip_228/end_frame=0 +animation/clip_228/loops=false +animation/clip_229/name="" +animation/clip_229/start_frame=0 +animation/clip_229/end_frame=0 +animation/clip_229/loops=false +animation/clip_230/name="" +animation/clip_230/start_frame=0 +animation/clip_230/end_frame=0 +animation/clip_230/loops=false +animation/clip_231/name="" +animation/clip_231/start_frame=0 +animation/clip_231/end_frame=0 +animation/clip_231/loops=false +animation/clip_232/name="" +animation/clip_232/start_frame=0 +animation/clip_232/end_frame=0 +animation/clip_232/loops=false +animation/clip_233/name="" +animation/clip_233/start_frame=0 +animation/clip_233/end_frame=0 +animation/clip_233/loops=false +animation/clip_234/name="" +animation/clip_234/start_frame=0 +animation/clip_234/end_frame=0 +animation/clip_234/loops=false +animation/clip_235/name="" +animation/clip_235/start_frame=0 +animation/clip_235/end_frame=0 +animation/clip_235/loops=false +animation/clip_236/name="" +animation/clip_236/start_frame=0 +animation/clip_236/end_frame=0 +animation/clip_236/loops=false +animation/clip_237/name="" +animation/clip_237/start_frame=0 +animation/clip_237/end_frame=0 +animation/clip_237/loops=false +animation/clip_238/name="" +animation/clip_238/start_frame=0 +animation/clip_238/end_frame=0 +animation/clip_238/loops=false +animation/clip_239/name="" +animation/clip_239/start_frame=0 +animation/clip_239/end_frame=0 +animation/clip_239/loops=false +animation/clip_240/name="" +animation/clip_240/start_frame=0 +animation/clip_240/end_frame=0 +animation/clip_240/loops=false +animation/clip_241/name="" +animation/clip_241/start_frame=0 +animation/clip_241/end_frame=0 +animation/clip_241/loops=false +animation/clip_242/name="" +animation/clip_242/start_frame=0 +animation/clip_242/end_frame=0 +animation/clip_242/loops=false +animation/clip_243/name="" +animation/clip_243/start_frame=0 +animation/clip_243/end_frame=0 +animation/clip_243/loops=false +animation/clip_244/name="" +animation/clip_244/start_frame=0 +animation/clip_244/end_frame=0 +animation/clip_244/loops=false +animation/clip_245/name="" +animation/clip_245/start_frame=0 +animation/clip_245/end_frame=0 +animation/clip_245/loops=false +animation/clip_246/name="" +animation/clip_246/start_frame=0 +animation/clip_246/end_frame=0 +animation/clip_246/loops=false +animation/clip_247/name="" +animation/clip_247/start_frame=0 +animation/clip_247/end_frame=0 +animation/clip_247/loops=false +animation/clip_248/name="" +animation/clip_248/start_frame=0 +animation/clip_248/end_frame=0 +animation/clip_248/loops=false +animation/clip_249/name="" +animation/clip_249/start_frame=0 +animation/clip_249/end_frame=0 +animation/clip_249/loops=false +animation/clip_250/name="" +animation/clip_250/start_frame=0 +animation/clip_250/end_frame=0 +animation/clip_250/loops=false +animation/clip_251/name="" +animation/clip_251/start_frame=0 +animation/clip_251/end_frame=0 +animation/clip_251/loops=false +animation/clip_252/name="" +animation/clip_252/start_frame=0 +animation/clip_252/end_frame=0 +animation/clip_252/loops=false +animation/clip_253/name="" +animation/clip_253/start_frame=0 +animation/clip_253/end_frame=0 +animation/clip_253/loops=false +animation/clip_254/name="" +animation/clip_254/start_frame=0 +animation/clip_254/end_frame=0 +animation/clip_254/loops=false +animation/clip_255/name="" +animation/clip_255/start_frame=0 +animation/clip_255/end_frame=0 +animation/clip_255/loops=false +animation/clip_256/name="" +animation/clip_256/start_frame=0 +animation/clip_256/end_frame=0 +animation/clip_256/loops=false diff --git a/entities/environment/birchtree/Black.material b/entities/environment/birchtree/Black.material new file mode 100644 index 0000000..3769ec9 Binary files /dev/null and b/entities/environment/birchtree/Black.material differ diff --git a/entities/environment/birchtree/DarkGreen.material b/entities/environment/birchtree/DarkGreen.material new file mode 100644 index 0000000..919631a Binary files /dev/null and b/entities/environment/birchtree/DarkGreen.material differ diff --git a/entities/environment/birchtree/Green.material b/entities/environment/birchtree/Green.material new file mode 100644 index 0000000..d00aea8 Binary files /dev/null and b/entities/environment/birchtree/Green.material differ diff --git a/entities/environment/birchtree/White.material b/entities/environment/birchtree/White.material new file mode 100644 index 0000000..32d72e9 Binary files /dev/null and b/entities/environment/birchtree/White.material differ diff --git a/entities/environment/birchtree/birchtree.tscn b/entities/environment/birchtree/birchtree.tscn new file mode 100644 index 0000000..da84334 --- /dev/null +++ b/entities/environment/birchtree/birchtree.tscn @@ -0,0 +1,14 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://entities/environment/birchtree/BirchTree_1.glb" type="PackedScene" id=1] + +[sub_resource type="BoxShape" id=1] +extents = Vector3( 0.643397, 1, 0.536359 ) + +[node name="Birchtree" type="StaticBody"] + +[node name="CommonTree_4" parent="." instance=ExtResource( 1 )] + +[node name="CollisionShape" type="CollisionShape" parent="."] +transform = Transform( 1, 0, 0, 0, 1.245, 0, 0, 0, 1, 0, 1.12837, 0 ) +shape = SubResource( 1 ) diff --git a/project.godot b/project.godot index 4c8af13..2be809e 100644 --- a/project.godot +++ b/project.godot @@ -9,6 +9,11 @@ config_version=4 _global_script_classes=[ { +"base": "Camera", +"class": "CameraController", +"language": "GDScript", +"path": "res://utils/camera/CameraController.gd" +}, { "base": "Reference", "class": "Delaunator", "language": "GDScript", @@ -25,6 +30,7 @@ _global_script_classes=[ { "path": "res://utils/terrain/Terrain.gd" } ] _global_script_class_icons={ +"CameraController": "", "Delaunator": "", "PoissonDiscSampling": "", "Terrain": "" @@ -44,10 +50,23 @@ Global="*res://utils/Global.gd" common/drop_mouse_on_gui_input_disabled=true +[input] + +main_command={ +"deadzone": 0.5, +"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null) + ] +} +alt_command={ +"deadzone": 0.5, +"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) + ] +} + [physics] common/enable_pause_aware_picking=true [rendering] -environment/default_environment="res://default_env.tres" +environment/default_environment="res://world/default_env.tres" diff --git a/ui/map/cursor/Cursor.gd b/ui/map/cursor/Cursor.gd new file mode 100644 index 0000000..e4d7547 --- /dev/null +++ b/ui/map/cursor/Cursor.gd @@ -0,0 +1,8 @@ +extends Sprite + +func _on_Camera_camera_moved(new_location): + var map_x = new_location.x + var map_y = new_location.z + position.x = map_x + position.y = map_y + pass # Replace with function body. diff --git a/ui/map/cursor/cursor.png b/ui/map/cursor/cursor.png new file mode 100644 index 0000000..7b1ce1a Binary files /dev/null and b/ui/map/cursor/cursor.png differ diff --git a/ui/map/cursor/cursor.png.import b/ui/map/cursor/cursor.png.import new file mode 100644 index 0000000..881ad88 --- /dev/null +++ b/ui/map/cursor/cursor.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/cursor.png-c6b2f949aa939fd4f4289acd7e6ebaee.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://ui/map/cursor/cursor.png" +dest_files=[ "res://.import/cursor.png-c6b2f949aa939fd4f4289acd7e6ebaee.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/ui/map/map.gd b/ui/map/map.gd index f840151..1334eaf 100644 --- a/ui/map/map.gd +++ b/ui/map/map.gd @@ -1,5 +1,7 @@ extends Node2D +signal map_clicked + var terrain func heightmap(): @@ -91,6 +93,12 @@ func _draw(): # draw_voronoi_cells_convex_hull() # draw_voronoi_edges(Color("#ff0000")) +func _process(_delta): + if Input.is_action_pressed("alt_command"): + var new_position = get_viewport().get_mouse_position() / scale + if new_position.x <= 2000 and new_position.y <= 2000: + emit_signal("map_clicked", new_position) + func _on_Game_world_loaded(game_terrain): terrain = game_terrain update() diff --git a/ui/map/map.tscn b/ui/map/map.tscn index 3ad22d3..31f5e94 100644 --- a/ui/map/map.tscn +++ b/ui/map/map.tscn @@ -1,6 +1,12 @@ -[gd_scene load_steps=2 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://ui/map/map.gd" type="Script" id=1] +[ext_resource path="res://ui/map/cursor/cursor.png" type="Texture" id=2] +[ext_resource path="res://ui/map/cursor/Cursor.gd" type="Script" id=3] [node name="Map" type="Node2D"] script = ExtResource( 1 ) + +[node name="Cursor" type="Sprite" parent="."] +texture = ExtResource( 2 ) +script = ExtResource( 3 ) diff --git a/utils/Global.gd b/utils/Global.gd index 6ce19df..59cc6a7 100644 --- a/utils/Global.gd +++ b/utils/Global.gd @@ -1,6 +1,7 @@ extends Node var debug = true +var terrain # Debuging messages func print_debug(message): diff --git a/utils/camera/CamBase.gd b/utils/camera/CamBase.gd new file mode 100644 index 0000000..111b695 --- /dev/null +++ b/utils/camera/CamBase.gd @@ -0,0 +1,98 @@ +extends Spatial + +const MOVE_MARGIN = 20 +const MOVE_SPEED = 30 + +const ray_length = 1000 +onready var cam = $Camera + +var team = 0 +var selected_units = [] +onready var selection_box = $SelectionBox +var start_sel_pos = Vector2() + +func _process(delta): + var m_pos = get_viewport().get_mouse_position() +# calc_move(m_pos, delta) + if Input.is_action_just_pressed("main_command"): + move_selected_units(m_pos) + if Input.is_action_just_pressed("alt_command"): + selection_box.start_sel_pos = m_pos + start_sel_pos = m_pos + if Input.is_action_pressed("alt_command"): + selection_box.m_pos = m_pos + selection_box.is_visible = true + else: + selection_box.is_visible = false + if Input.is_action_just_released("alt_command"): + select_units(m_pos) + +func calc_move(m_pos, delta): + var v_size = get_viewport().size + var move_vec = Vector3() + if m_pos.x < MOVE_MARGIN: + move_vec.x -= 1 + if m_pos.y < MOVE_MARGIN: + move_vec.z -= 1 + if m_pos.x > v_size.x - MOVE_MARGIN: + move_vec.x += 1 + if m_pos.y > v_size.y - MOVE_MARGIN: + move_vec.z += 1 + move_vec = move_vec.rotated(Vector3(0, 1, 0), rotation_degrees.y) + global_translate(move_vec * delta * MOVE_SPEED) + +func move_selected_units(m_pos): + var result = raycast_from_mouse(m_pos, 1) + if result: + var unit_index = 0 + for unit in selected_units: + var new_position = result.position + new_position.x = new_position.x + unit_index + unit.move_to(new_position) + unit_index += 1 + +func select_units(m_pos): + var new_selected_units = [] + if m_pos.distance_squared_to(start_sel_pos) < 16: + var u = get_unit_under_mouse(m_pos) + if u != null: + new_selected_units.append(u) + else: + new_selected_units = get_units_in_box(start_sel_pos, m_pos) + + for unit in selected_units: + unit.deselect() + for unit in new_selected_units: + unit.select() + selected_units = new_selected_units + +func get_unit_under_mouse(m_pos): + var result = raycast_from_mouse(m_pos, 3) + if result and result.collider.is_in_group("units"): + return result.collider + +func get_units_in_box(top_left, bot_right): + if top_left.x > bot_right.x: + var tmp = top_left.x + top_left.x = bot_right.x + bot_right.x = tmp + if top_left.y > bot_right.y: + var tmp = top_left.y + top_left.y = bot_right.y + bot_right.y = tmp + var box = Rect2(top_left, bot_right - top_left) + var box_selected_units = [] + for unit in get_tree().get_nodes_in_group("units"): + if box.has_point(cam.unproject_position(unit.global_transform.origin)): + box_selected_units.append(unit) + return box_selected_units + +func raycast_from_mouse(m_pos, collision_mask): + var ray_start = cam.project_ray_origin(m_pos) + var ray_end = ray_start + cam.project_ray_normal(m_pos) * ray_length + var space_state = get_world().direct_space_state + return space_state.intersect_ray(ray_start, ray_end, [], collision_mask) + + +func _on_Camera_camera_moved(new_location): + pass # Replace with function body. diff --git a/utils/camera/CamBase.tscn b/utils/camera/CamBase.tscn new file mode 100644 index 0000000..7e9ecb6 --- /dev/null +++ b/utils/camera/CamBase.tscn @@ -0,0 +1,34 @@ +[gd_scene load_steps=5 format=2] + +[ext_resource path="res://utils/camera/SelectionBox.gd" type="Script" id=1] +[ext_resource path="res://utils/camera/CamBase.gd" type="Script" id=2] +[ext_resource path="res://utils/camera/CameraController.gd" type="Script" id=3] +[ext_resource path="res://utils/camera/CameraInput.gd" type="Script" id=4] + +[node name="CamBase" type="Spatial"] +transform = Transform( 1, 0, 0, 0, 0.0238738, 0.999715, 0, -0.999715, 0.0238738, 0, 0, 16.935 ) +script = ExtResource( 2 ) + +[node name="Camera" type="Camera" parent="."] +transform = Transform( 1, 0, 0, 0, 0.910272, -0.41401, 0, 0.41401, 0.910272, 0, 0, 6.618 ) +size = 20.0 +near = 0.01 +far = 8192.0 +script = ExtResource( 3 ) +movement_speed = 70.017 +min_zoom = 51.0 +zoom_sensibility = 2.818 +rotation_sensibility = 1.0 + +[node name="Node" type="Node" parent="Camera"] +script = ExtResource( 4 ) + +[node name="SelectionBox" type="Control" parent="."] +margin_right = 40.0 +margin_bottom = 40.0 +script = ExtResource( 1 ) + +[connection signal="on_change_action" from="Camera/Node" to="Camera" method="change_action"] +[connection signal="on_change_velocity" from="Camera/Node" to="Camera" method="change_velocity"] +[connection signal="on_rotate_view" from="Camera/Node" to="Camera" method="rotate_view"] +[connection signal="on_zoom" from="Camera/Node" to="Camera" method="zoom"] diff --git a/utils/camera/CameraController.gd b/utils/camera/CameraController.gd new file mode 100644 index 0000000..fda1053 --- /dev/null +++ b/utils/camera/CameraController.gd @@ -0,0 +1,140 @@ +extends Camera +class_name CameraController + +signal camera_moved(new_location) + +enum CAMERA_ACTIONS{ + MOVING, + ROTATING_VIEW, +} + +export(float,1,100) var movement_speed = 30 +export(float,0.01,0.99) var movement_damping = 0.74 +export(float,0.01, 3.1415) var max_rotation = 1.2 +export(float,0.01, 3.1415) var min_rotation = 0.5 + +#Value in percentage of screen portion +#A value of 0.3 means that when you place the cursor 30% or less away from an edge it will start pushing the camera +export(float, 0.0,1.0) var edge_size = 0.0 + +#EDIT HERE--->**,***<--- ZOOM MIN AND MAX LIMITS +export(float, 10,100) var min_zoom = 25 +export(float, 10,100) var max_zoom = 100 + +export(float, 1,3) var zoom_sensibility = 2.5 + +export(float, 1,3) var rotation_sensibility = 2.3 +export(float, 1.0, 10.0) var height = 5.0 +var pitch : float +var yaw : float +var current_action = CAMERA_ACTIONS.MOVING +var velocity : Vector2 + +func _ready(): +# Input.set_mouse_mode(Input.MOUSE_MODE_CONFINED) + + pitch = rotation.x + yaw = rotation.y + +# var new_rotation = (max_zoom - fov) * (max_rotation - min_rotation) / max_zoom + min_rotation + transform.basis = Basis(Vector3(1, 0, 0), (min_rotation + max_rotation) / 2.0) + fov = (min_zoom + max_zoom) / 2.0 + +func change_action(action): + current_action = action + match(current_action): +# CAMERA_ACTIONS.MOVING: +# Input.set_mouse_mode(Input.MOUSE_MODE_CONFINED) + CAMERA_ACTIONS.ROTATING_VIEW: + Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) + +func _process(delta): + + match(current_action): + CAMERA_ACTIONS.MOVING: + #CAMERA MOVEMENT + velocity.x = clamp(velocity.x * movement_damping,-1.0,1.0) + velocity.y = clamp(velocity.y * movement_damping,-1.0,1.0) + + if velocity != Vector2.ZERO: + move(velocity) + + +func change_velocity(_velocity : Vector2): + velocity = _velocity + +func move(_velocity : Vector2): + #Move along cameras X axis + global_transform.origin += global_transform.basis.x * velocity.x * movement_speed * get_process_delta_time() + #Calculate a forward camera direction that is perpendicular to the XZ plane + var forward = global_transform.basis.x.cross(Vector3.UP) + #Move the camera along that forward direction + global_transform.origin += forward * velocity.y * movement_speed * get_process_delta_time() + + var y_offset = 0 + var space_state = get_world().direct_space_state + var result = space_state.intersect_ray(Vector3(global_transform.origin.x, 100, global_transform.origin.z), Vector3(global_transform.origin.x, 0, global_transform.origin.z)) + if result: + y_offset = result.position.y + else: + y_offset = 0 + global_transform.origin.y = max(5 + y_offset * 1.3, 10) + + emit_signal("camera_moved", global_transform.origin) + + +func zoom(direction : float): + #Zooming using fov + var new_fov = fov + (sign(direction) * pow(abs(direction),zoom_sensibility)/100 * get_process_delta_time()) + fov = clamp(new_fov,min_zoom,max_zoom) + + # Linear equation + var slope = (min_rotation - max_rotation) / (max_zoom - min_zoom) + var b = max_rotation - slope * min_zoom + var new_rotation = slope * fov + b + transform.basis = Basis(Vector3(1, 0, 0), new_rotation) + + +func rotate_view(axis : Vector2): + + var pitch_rotation_amount = -axis.y/100 * get_process_delta_time() * rotation_sensibility + var yaw_rotation_amount = -axis.x/100 * get_process_delta_time() * rotation_sensibility + + pitch += pitch_rotation_amount + pitch = clamp(pitch,-PI/2,0) + + yaw += yaw_rotation_amount + + rotation.x = pitch + rotation.y = yaw + +func _on_Map_map_clicked(position): + global_transform.origin.x = position.x + global_transform.origin.z = position.y + + + var y_offset = 0 + var space_state = get_world().direct_space_state + var result = space_state.intersect_ray(Vector3(global_transform.origin.x, 100, global_transform.origin.z), Vector3(global_transform.origin.x, 0, global_transform.origin.z)) + if result: + y_offset = result.position.y + else: + y_offset = 0 + global_transform.origin.y = max(height + y_offset * 1.3, 30) + pass # Replace with function body. + + +func _on_World_character_created(position): + global_transform.origin.x = position.x + global_transform.origin.z = position.y + + + var y_offset = 0 + var space_state = get_world().direct_space_state + var result = space_state.intersect_ray(Vector3(global_transform.origin.x, 100, global_transform.origin.z), Vector3(global_transform.origin.x, 0, global_transform.origin.z)) + if result: + y_offset = result.position.y + else: + y_offset = 0 + global_transform.origin.y = max(height + y_offset * 1.3, 30) + pass # Replace with function body. diff --git a/utils/camera/CameraInput.gd b/utils/camera/CameraInput.gd new file mode 100644 index 0000000..4c0e185 --- /dev/null +++ b/utils/camera/CameraInput.gd @@ -0,0 +1,158 @@ +extends Node + +export(float,0.001,1.0) var screen_edge_size : float = 0.3 +export(float) var mouse_wheel_damping = 0.9 + +#USED TO CALCULATE RAW MOVEMENT WHILE PUSHING AN EDGE +var horizontal : float = 0.0 +var vertical : float = 0.0 + +#USED TO STORE MOUSE WHEEL INERTIA TO ENABLE SMOOTH STOPPING +var mouse_wheel : float = 0.0 + +signal on_change_velocity(velocity) +signal on_rotate_view(relative) +signal on_change_action(new_state) +signal on_zoom(value) + +var current_action + +#TOUCH VARIABLE FOR MOBILE +var touch_count : int = 0 +var swipe_start : Vector2 + +func _ready(): + connect("on_change_action",self,"change_action") + emit_signal("on_change_action",CameraController.CAMERA_ACTIONS.MOVING) + +func change_action(action): + current_action = action + +func toggle_action(): + current_action = 1 - current_action + +func start_swipe(position : Vector2): + swipe_start = position + +func move_swipe(position : Vector2): + if blocked_movement: + return + + var delta = (position - swipe_start)*-1 + var direction_x = sign(delta.x) + var direction_y = sign(delta.y) + + var view_size = get_viewport().get_visible_rect().size - Vector2.ONE + + horizontal = range_lerp(abs(delta.x),0,view_size.x,0.0,1.0) + vertical = range_lerp(abs(delta.y),0,view_size.y,0.0,1.0) + + #Applies direction + horizontal *= direction_x + vertical *= direction_y + +var touches = [ Vector2.ZERO, Vector2.ZERO ] +var start_pinch_distance : float +var last_pinch_distance : float +var pinching : float + +var blocked_movement : bool = false + +func _input(event): + + if OS.get_name() == "Android" or OS.get_name() == "iOS": + #MOBILE############## + if event is InputEventScreenTouch: + #SET TOUCH STARTING POSTIION + touches[event.index] = event.position + if event.pressed: + touch_count += 1 + start_swipe(event.position) + else: + touch_count -= 1 + #RENABLE SWIPE MOVEMENT BECAUSE EVERY TOUCH WAS LIFTED + if blocked_movement and touch_count <= 0: + blocked_movement = false + + #RESET PINCHING VALUE WHEN A NEW TOUCH IS DETECTED OR HAS BEEN LIFTED + pinching = 0.0 + if touch_count == 2: + #STARTED ZOOMING, BLOCK MOVEMENT UNTIL EVERY TOUCH IS LIFTED + blocked_movement = true + start_pinch_distance = (touches[1] - touches[0]).length() + + if event is InputEventScreenDrag: + if touch_count == 2: + #UPDATE TOUCHES POSITIONS + touches[event.index] = event.position + #CALCULATE DISTANCE BETWEEN TOUCHES + var pinch_distance = (touches[1] - touches[0]).length() + var pinch_direction = 1 if pinch_distance > last_pinch_distance else -1 + #CALCULATE PINCH DELTA + pinching = abs(start_pinch_distance - pinch_distance) * pinch_direction + #USE MOUSE WHEEL BUFFER TO ENABLE SMOOTHING + mouse_wheel += pinching * get_process_delta_time() + last_pinch_distance = pinch_distance + else: + if current_action == CameraController.CAMERA_ACTIONS.MOVING: + move_swipe(event.position) + elif current_action == CameraController.CAMERA_ACTIONS.ROTATING_VIEW: + emit_signal("on_rotate_view",event.relative) + + ###############MOBILE + else: + #PC################## + #Camera edge pushing + if event is InputEventMouseMotion: + #ROTATE VIEW + if current_action == CameraController.CAMERA_ACTIONS.ROTATING_VIEW: + emit_signal("on_rotate_view",event.relative) + #Gets screen size + var view_size = get_viewport().get_visible_rect().size - Vector2.ONE + #Get mouse position in percentage values relative to the screen + var delta = (event.position) / view_size + #Convert it to a range between [-1,1] + delta = (delta * 2) - Vector2.ONE + + if current_action == CameraController.CAMERA_ACTIONS.MOVING: + #Store it an buffer to use it on _process + #Calculates delta based on percentage between the edge size and the actual edge + horizontal = max(abs(delta.x) - (1.0 - screen_edge_size),0) + vertical = max(abs(delta.y) - (1.0 - screen_edge_size),0) + #Converts it to an [0.0,1.0] range + horizontal = range_lerp(horizontal,0.0,screen_edge_size,0.0,1.0) + vertical = range_lerp(vertical,0.0,screen_edge_size,0.0,1.0) + #Applies direction + horizontal *= sign(delta.x) + vertical *= sign(delta.y) + elif current_action == CameraController.CAMERA_ACTIONS.ROTATING_VIEW: + horizontal = delta.x + vertical = delta.y + pass + + + if event is InputEventMouseButton: + #WHEEL SCROLL + if event.button_index == BUTTON_WHEEL_UP or event.button_index == BUTTON_WHEEL_DOWN: + if event.pressed and not event.is_echo(): + var direction = (-1 if event.button_index == BUTTON_WHEEL_UP else 0) + (1 if event.button_index == BUTTON_WHEEL_DOWN else 0) + mouse_wheel += direction * get_process_delta_time() * 1000 + ###################PC + +func _process(delta): + + #PC###### + match(current_action): + CameraController.CAMERA_ACTIONS.MOVING: + #RESIDUAL MOVEMENT + if horizontal != 0 or vertical != 0: + emit_signal("on_change_velocity",Vector2(horizontal, vertical)) + + #MOUSE WHEEL + if mouse_wheel != 0: + mouse_wheel = mouse_wheel * mouse_wheel_damping + emit_signal("on_zoom",mouse_wheel) + #######PC + + + diff --git a/utils/camera/SelectionBox.gd b/utils/camera/SelectionBox.gd new file mode 100644 index 0000000..7efffc1 --- /dev/null +++ b/utils/camera/SelectionBox.gd @@ -0,0 +1,17 @@ +extends Control + +var is_visible = false +var m_pos = Vector2() +var start_sel_pos = Vector2() +const sel_box_col = Color(0, 1, 0) +const sel_box_line_width = 3 + +func _draw(): + if is_visible and start_sel_pos != m_pos: + draw_line(start_sel_pos, Vector2(m_pos.x, start_sel_pos.y), sel_box_col, sel_box_line_width) + draw_line(start_sel_pos, Vector2(start_sel_pos.x, m_pos.y), sel_box_col, sel_box_line_width) + draw_line(m_pos, Vector2(m_pos.x, start_sel_pos.y), sel_box_col, sel_box_line_width) + draw_line(m_pos, Vector2(start_sel_pos.x, m_pos.y), sel_box_col, sel_box_line_width) + +func _process(delta): + update() diff --git a/utils/terrain/Terrain.gd b/utils/terrain/Terrain.gd index b97a366..4483c5f 100644 --- a/utils/terrain/Terrain.gd +++ b/utils/terrain/Terrain.gd @@ -63,6 +63,7 @@ class Triangle: var list_points = [] for edge in edges(): list_points.append(Point.new(_terrain._triangles[edge._idx], _terrain)) + list_points.invert() return list_points func triangles_adjacent(): diff --git a/world/World.gd b/world/World.gd new file mode 100644 index 0000000..a3f2520 --- /dev/null +++ b/world/World.gd @@ -0,0 +1,43 @@ +extends Spatial + +var terrain + +func _ready(): + pass + + +func draw_world(): + # for i in range(0, 1, 1): + # print(i) + var st = SurfaceTool.new() + + st.begin(Mesh.PRIMITIVE_TRIANGLES) + st.add_smooth_group(true) + for triangle in terrain.get_triangles(): + for point in triangle.points(): + var factor = Vector3(1, 24*5, 1) + # if point.get_data("river") and i == 0: + # factor.y -= 0 + # if i == 1: + # factor.y -= 2.0 + st.add_vertex(point.point3d() * factor) + + st.generate_normals() + # st.generate_tangents() + st.index() + # Commit to a mesh. + var mesh = st.commit() + + var mi = MeshInstance.new() + mi.mesh = mesh + var material = load("res://world/world.material") + mi.set_surface_material(0, material) + mi.create_trimesh_collision() + mi.cast_shadow = GeometryInstance.SHADOW_CASTING_SETTING_ON + print(mi) + add_child(mi) + +func _on_Game_world_loaded(game_terrain): + terrain = game_terrain + draw_world() + diff --git a/default_env.tres b/world/default_env.tres similarity index 100% rename from default_env.tres rename to world/default_env.tres diff --git a/world/game.gd b/world/game.gd index 1175dae..5492cf2 100644 --- a/world/game.gd +++ b/world/game.gd @@ -1,17 +1,17 @@ -extends Spatial +extends Node signal world_loaded export(int) var width = 2000 export(int) var height = 2000 -export(int) var spacing = 20 +export(int) var spacing = 5 export(int, 1, 9) var octaves = 5 export(int, 1, 30) var wavelength = 8 export(int) var border_width = 200 export(int) var terraces = 24 export(int) var terrace_height = 5 export(float) var mountain_height = 6.0 / 24.0 -export(int) var river_proba = 100 +export(int) var river_proba = 200 var rng = RandomNumberGenerator.new() var noise = OpenSimplexNoise.new() @@ -24,7 +24,7 @@ func _ready(): noise.octaves = octaves # terrain = Terrain.new(width,height,spacing,false) - var terrain_name="bonjour" + var terrain_name="bonjourazeazea" terrain = Terrain.new() print(terrain.list()) @@ -36,6 +36,7 @@ func _ready(): if terrain.is_created() or terrain.is_loaded(): init_data() + add_trees() emit_signal("world_loaded", terrain) else: Global.print_debug("Pas de terrain, pas de construction ...") @@ -47,13 +48,14 @@ func init_data(): point.set_elevation(point_find_elevation(point.point2d())) point.set_data("water", point_is_water(point)) point.set_data("mountain", point_is_mountain(point)) - point.set_data("river", point_is_river(point)) + # point.set_data("river", point_is_river(point)) fill_oceans() for point in terrain.get_points(): if point.get_data("water") and not point.get_data("ocean"): point.set_elevation(0.1) + point.set_data("water", false) point.set_data("coast", point_is_coast(point)) if point.get_data("river"): set_river_path(point) @@ -87,7 +89,6 @@ func set_river_path(point): var start_elevation = point.get_elevation() var waypoints = [] var stack = [] - var end stack.append(point.get_index()) var came_from = {} @@ -97,7 +98,6 @@ func set_river_path(point): waypoints.append(current_point_id) start_elevation = terrain.get_point(current_point_id).get_elevation() stack = [] - end = current_point_id if terrain.get_point(current_point_id).get_data("ocean"): break for neighbour in terrain.get_point(current_point_id).points_around(): @@ -116,6 +116,7 @@ func set_river_path(point): path.append(point.get_index()) for index in path: terrain.get_point(index).set_data("river", true) + terrain.get_point(index).set_data("water", true) # Point @@ -140,7 +141,7 @@ func point_find_elevation(point): elevation = min(elevation, 1) - # elevation = elevation * terraces + elevation = round(elevation * terraces) / terraces return elevation func point_is_water(point): @@ -192,3 +193,23 @@ func edge_is_river(edge): if edge.start().get_data("river") and edge.end().get_data("river"): return true return false + +func add_trees(): + rng.randomize() + var treescene = load("res://entities/environment/birchtree/birchtree.tscn") + for point in terrain.get_points(): + if not point.get_data("water"): + var num = rng.randi_range(0, 5) + if num == 1: + var tree = treescene.instance() + tree.translation = Vector3(point.point3d() * Vector3(1, 24*5, 1)) + add_child(tree) + + # for point in points.size(): + # if points_data[i].elevation > 0: + # var num = rng.randi_range(0, 20) + # if num == 2: + # var tree = treescene.instance() + # tree.translation = Vector3(points[i].x, points_data[i].elevation * terrace_height, points[i].y) + + # add_child(tree) diff --git a/world/game.tscn b/world/game.tscn index 3c60c82..30a9446 100644 --- a/world/game.tscn +++ b/world/game.tscn @@ -1,16 +1,59 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://ui/ui.tscn" type="PackedScene" id=1] [ext_resource path="res://world/game.gd" type="Script" id=2] +[ext_resource path="res://world/default_env.tres" type="Environment" id=3] +[ext_resource path="res://world/World.gd" type="Script" id=4] +[ext_resource path="res://utils/camera/CamBase.tscn" type="PackedScene" id=5] -[node name="Game" type="Spatial"] +[sub_resource type="PlaneMesh" id=1] +size = Vector2( 2000, 2000 ) + +[sub_resource type="SpatialMaterial" id=2] +albedo_color = Color( 0.054902, 0.533333, 0.741176, 1 ) + +[node name="Game" type="Node"] script = ExtResource( 2 ) [node name="UI" parent="." instance=ExtResource( 1 )] [node name="Map" parent="UI" index="0"] -scale = Vector2( 0.5, 0.5 ) +scale = Vector2( 0.25, 0.25 ) + +[node name="Cursor" parent="UI/Map" index="0"] +scale = Vector2( 4, 4 ) +z_index = 3 + +[node name="World" type="Spatial" parent="."] +script = ExtResource( 4 ) + +[node name="Water" type="MeshInstance" parent="World"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1000, -0.1, 1000 ) +mesh = SubResource( 1 ) +material/0 = SubResource( 2 ) + +[node name="WorldEnvironment" type="WorldEnvironment" parent="World"] +environment = ExtResource( 3 ) + +[node name="CamBase" parent="World" instance=ExtResource( 5 )] + +[node name="Camera" parent="World/CamBase" index="0"] +transform = Transform( 1, 0, 0, 0, 0.910272, -0.41401, 0, 0.41401, 0.910272, 0, -1.90735e-06, 6.618 ) +movement_speed = 48.076 +min_zoom = 10.0 +zoom_sensibility = 1.436 +rotation_sensibility = 3.0 + +[node name="DirectionalLight" type="DirectionalLight" parent="World"] +transform = Transform( 1, 0, 0, 0, 0.512597, 0.858629, 0, -0.858629, 0.512597, 0, 1.41623, 0 ) +light_energy = 0.1 +shadow_enabled = true [connection signal="world_loaded" from="." to="UI/Map" method="_on_Game_world_loaded"] +[connection signal="world_loaded" from="." to="World" method="_on_Game_world_loaded"] +[connection signal="map_clicked" from="UI/Map" to="World/CamBase/Camera" method="_on_Map_map_clicked"] +[connection signal="camera_moved" from="World/CamBase/Camera" to="UI/Map/Cursor" method="_on_Camera_camera_moved"] [editable path="UI"] +[editable path="UI/Map"] +[editable path="World/CamBase"] diff --git a/world/world.material b/world/world.material new file mode 100644 index 0000000..e4ba4f6 Binary files /dev/null and b/world/world.material differ diff --git a/world/world.tres b/world/world.tres new file mode 100644 index 0000000..f8baa3f --- /dev/null +++ b/world/world.tres @@ -0,0 +1,4 @@ +[gd_resource type="SpatialMaterial" format=2] + +[resource] +albedo_color = Color( 0.109804, 0.305882, 0.0745098, 1 )