Update every module, to get the prop refactors.

This commit is contained in:
Relintai 2020-04-04 17:29:23 +02:00
parent 2a29c595a4
commit 768af776e4
18 changed files with 9 additions and 551 deletions

2
HEADS
View File

@ -1 +1 @@
{"engine": {"3.2": "da4eb7101d986af0ba6a15efaaed3dee77370d80", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "eef846860cf44d06a36146f7856c074f68a0139b"}, "entity_spell_system": {"master": "dc0c6d224b7ee3683267596efedde8184ac335e4"}, "ui_extensions": {"master": "38acc650db260a831dc26ca96fe9d9a087230bdc"}, "voxelman": {"master": "04b68ff62da5d5e1d9ce5c7b7ffa07f7d6b9e486"}, "texture_packer": {"master": "b17c174906f84de93d84aa60d010ffe603efaa28"}, "fastnoise": {"master": "ea3b34d972fb5f76474daabd7c1e192419811348"}, "mesh_data_resource": {"master": "4bda19b12be2c2a79a6121de6d22e48f3934e726"}, "procedural_animations": {"master": "45efc21f3e8af941d96b53d54f82572a6644fef7"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "fast_quadratic_mesh_simplifier": {"master": "dc598c59322185032835f964db069964244e58bc"}, "props": {"master": "9547a07ad07babf9bd3194814c6191c55ba4f7f0"}}
{"engine": {"3.2": "da4eb7101d986af0ba6a15efaaed3dee77370d80", "master": "8c73e813134001e575b6f59e3b0100471c007410"}, "world_generator": {"master": "b03cbf18f7ecb26aca7a823ad680403620bde845"}, "entity_spell_system": {"master": "dc0c6d224b7ee3683267596efedde8184ac335e4"}, "ui_extensions": {"master": "38acc650db260a831dc26ca96fe9d9a087230bdc"}, "voxelman": {"master": "2d2b7c8c3e2ca34a5ee911fa975d0c933269daa6"}, "texture_packer": {"master": "b17c174906f84de93d84aa60d010ffe603efaa28"}, "fastnoise": {"master": "ea3b34d972fb5f76474daabd7c1e192419811348"}, "mesh_data_resource": {"master": "4bda19b12be2c2a79a6121de6d22e48f3934e726"}, "procedural_animations": {"master": "45efc21f3e8af941d96b53d54f82572a6644fef7"}, "ess_data": {"master": "3bd637fdd3304b64a18287a49a6b7387acf2f5de"}, "fast_quadratic_mesh_simplifier": {"master": "dc598c59322185032835f964db069964244e58bc"}, "props": {"master": "e1f43af57110a2ac518b883012fb7e6d3eb8d120"}}

View File

@ -1,11 +1,6 @@
[gd_resource type="DungeonRoomData" load_steps=4 format=2]
[gd_resource type="DungeonRoomData" load_steps=2 format=2]
[ext_resource path="res://scripts/dungeon_start_rooms/start_room.gd" type="Script" id=1]
[ext_resource path="res://data/props/1_test.tres" type="PropData" id=2]
[sub_resource type="WorldGeneratorPropData" id=1]
prop = ExtResource( 2 )
[resource]
target_script = ExtResource( 1 )
prop_datas = [ SubResource( 1 ) ]

View File

@ -1,3 +0,0 @@
[gd_resource type="PropData" format=2]
[resource]

View File

@ -1,14 +0,0 @@
[gd_resource type="PropData" load_steps=4 format=2]
[ext_resource path="res://data/character_models/upperarm.dae" type="MeshDataResource" id=1]
[ext_resource path="res://data/voxel_textures/test_brick_albedo.png" type="Texture" id=2]
[sub_resource type="PropDataMesh" id=1]
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
snap_axis = Vector3( 0, -1, 0 )
[resource]
resource_name = "adad"
props = [ SubResource( 1 ) ]

View File

@ -1,59 +0,0 @@
[gd_resource type="PropData" load_steps=12 format=2]
[ext_resource path="res://data/basic_models/ship_base.dae" type="MeshDataResource" id=1]
[ext_resource path="res://data/ship_parts/ship_simple.png" type="Texture" id=2]
[sub_resource type="PropDataMesh" id=1]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, 0.5, -0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=2]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, -0.5, -0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=3]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, 1.5, -0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=4]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, -1.5, -0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=5]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, -1.5, 0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=6]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, -0.5, 0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=7]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, 0.5, 0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataMesh" id=8]
transform = Transform( 0.5, 0, 0, 0, 0.5, 0, 0, 0, 1, 1.5, 0.5, 0 )
mesh = ExtResource( 1 )
texture = ExtResource( 2 )
snap_to_mesh = false
[sub_resource type="PropDataLight" id=9]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2.55548 )
light_color = Color( 0.223529, 0.921569, 0, 1 )
[resource]
props = [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ) ]

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/ship_simple.png-46b1c437745362ec2041eef3ff05d760.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://data/ship_parts/ship_simple.png"
dest_files=[ "res://.import/ship_simple.png-46b1c437745362ec2041eef3ff05d760.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=false
flags/mipmaps=true
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -1,31 +0,0 @@
[gd_resource type="PropData" load_steps=8 format=2]
[ext_resource path="res://data/ship_parts/1_wall_simple.tres" type="PropData" id=1]
[sub_resource type="PropDataProp" id=1]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=2]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 2, 1, -2 )
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=3]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -2.38419e-07, 1, -4 )
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=4]
transform = Transform( 1.31134e-07, 0, -1, 0, 1, 0, 1, 0, 1.31134e-07, -2, 1, -2 )
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=5]
transform = Transform( 3.55271e-15, 1, -2.98023e-08, -1.31134e-07, 2.98023e-08, 1, 1, 0, 1.31134e-07, -1, 2, -2 )
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=6]
transform = Transform( 3.55271e-15, 1, -2.98023e-08, -1.31134e-07, 2.98023e-08, 1, 1, 0, 1.31134e-07, 1, 2, -2 )
prop = ExtResource( 1 )
[resource]
snap_to_mesh = true
props = [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ]

View File

@ -1,19 +1,15 @@
[gd_resource type="VoxelmanLibraryMerger" load_steps=12 format=2]
[gd_resource type="VoxelmanLibraryMerger" load_steps=9 format=2]
[ext_resource path="res://data/materials/1_standard_material.tres" type="Material" id=1]
[ext_resource path="res://data/voxel_surfaces/4_dungeon_stone.tres" type="VoxelSurfaceMerger" id=2]
[ext_resource path="res://data/voxel_surfaces/2_test.tres" type="VoxelSurfaceMerger" id=3]
[ext_resource path="res://data/voxel_surfaces/1_stone.tres" type="VoxelSurfaceMerger" id=4]
[ext_resource path="res://data/voxel_surfaces/3_test2.tres" type="VoxelSurfaceMerger" id=5]
[ext_resource path="res://data/materials/4_standard_material_prop.tres" type="Material" id=6]
[ext_resource path="res://data/voxel_surfaces/0_air.tres" type="VoxelSurfaceMerger" id=7]
[ext_resource path="res://data/materials/5_standard_material_nouv2.tres" type="Material" id=8]
[ext_resource path="res://data/materials/6_standard_material_prop_nouv2.tres" type="Material" id=9]
[ext_resource path="res://data/materials/7_standard_material_notex.tres" type="Material" id=10]
[ext_resource path="res://data/materials/8_standard_material_prop_notex.tres" type="Material" id=11]
[resource]
materials = [ ExtResource( 1 ), ExtResource( 8 ), ExtResource( 8 ), ExtResource( 10 ) ]
prop_materials = [ ExtResource( 6 ), ExtResource( 9 ), ExtResource( 9 ), ExtResource( 11 ) ]
texture_flags = 1
voxel_surfaces = [ ExtResource( 7 ), ExtResource( 4 ), ExtResource( 3 ), ExtResource( 5 ), ExtResource( 2 ) ]

View File

@ -1,12 +1,10 @@
[gd_scene load_steps=11 format=2]
[gd_scene load_steps=10 format=2]
[ext_resource path="res://data/models/armature_model_orig_v2.tscn" type="PackedScene" id=1]
[ext_resource path="res://data/voxel_libraries/1_main_lib_merger_empty.tres" type="VoxelmanLibraryMerger" id=2]
[ext_resource path="res://prop_tool/dada.tres" type="PropData" id=3]
[ext_resource path="res://default_bus_layout.tres" type="AudioBusLayout" id=3]
[ext_resource path="res://voxelman/world/TVVoxelWorld.gd" type="Script" id=4]
[ext_resource path="res://dungeon_generator/MainDungeonGenerator.gd" type="Script" id=5]
[ext_resource path="res://dev/character_dev_mat.tres" type="Material" id=6]
[sub_resource type="VoxelmanLevelGenerator" id=1]
script = ExtResource( 5 )
@ -70,7 +68,6 @@ show_loading_screen = false
[node name="character" parent="." instance=ExtResource( 1 )]
automatic_build = false
use_threads = false
material = ExtResource( 6 )
[node name="AnimationTree" parent="character" index="1"]
parameters/playback = SubResource( 2 )

View File

@ -1,11 +1,9 @@
[gd_resource type="VoxelmanLevelGenerator" load_steps=3 format=2]
[ext_resource path="res://dungeon_generator/MainDungeonGenerator.gd" type="Script" id=1]
[ext_resource path="res://prop_tool/dada.tres" type="PropData" id=2]
[resource]
script = ExtResource( 1 )
prop = ExtResource( 2 )
gen_type = 1
_level_seed = 35
_spawn_mobs = false

View File

@ -1,9 +0,0 @@
[gd_scene load_steps=2 format=2]
[sub_resource type="CubeMesh" id=1]
[node name="Spatial" type="Spatial"]
[node name="MeshInstance" type="MeshInstance" parent="."]
mesh = SubResource( 1 )
material/0 = null

View File

@ -1,37 +0,0 @@
[gd_resource type="PropData" load_steps=7 format=2]
[ext_resource path="res://data/character_models/spine1.dae" type="MeshDataResource" id=1]
[sub_resource type="PropDataLight" id=4]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 13.073, 0, 11.7378 )
light_color = Color( 0.909804, 0.129412, 0.129412, 1 )
light_size = 4
[sub_resource type="PropDataLight" id=5]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -12.2294, 0, -23.6387 )
light_color = Color( 0.266667, 0.937255, 0.0823529, 1 )
light_size = 18
[sub_resource type="PackedScene" id=3]
_bundled = {
"conn_count": 0,
"conns": PoolIntArray( ),
"editable_instances": [ ],
"names": PoolStringArray( ),
"node_count": 0,
"node_paths": [ ],
"nodes": PoolIntArray( ),
"variants": [ ],
"version": 2
}
[sub_resource type="PropDataScene" id=6]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.06597, 0, 16.5242 )
scene = SubResource( 3 )
[sub_resource type="PropDataMesh" id=7]
transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 )
mesh = ExtResource( 1 )
[resource]
props = [ SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ) ]

View File

@ -1,41 +0,0 @@
[gd_resource type="PropData" load_steps=9 format=2]
[ext_resource path="res://data/character_models/spine1.dae" type="MeshDataResource" id=1]
[ext_resource path="res://prop_tool/dada.tres" type="PropData" id=2]
[sub_resource type="PropDataLight" id=1]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 13.073, 0, 11.7378 )
light_color = Color( 0.909804, 0.129412, 0.129412, 1 )
light_size = 4
[sub_resource type="PropDataLight" id=2]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.322, 0, -0.816227 )
light_color = Color( 0.266667, 0.937255, 0.0823529, 1 )
light_size = 6
[sub_resource type="PackedScene" id=3]
_bundled = {
"conn_count": 0,
"conns": PoolIntArray( ),
"editable_instances": [ ],
"names": PoolStringArray( ),
"node_count": 0,
"node_paths": [ ],
"nodes": PoolIntArray( ),
"variants": [ ],
"version": 2
}
[sub_resource type="PropDataScene" id=4]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.06597, 0, 16.5242 )
scene = SubResource( 3 )
[sub_resource type="PropDataMesh" id=5]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 6.52468 )
mesh = ExtResource( 1 )
[sub_resource type="PropDataProp" id=6]
prop = ExtResource( 2 )
[resource]
props = [ SubResource( 1 ), SubResource( 2 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ) ]

File diff suppressed because one or more lines are too long

View File

@ -1,44 +0,0 @@
[gd_resource type="PropData" load_steps=9 format=2]
[ext_resource path="res://prop_tool/ToolTes2at.tres" type="PropData" id=1]
[sub_resource type="PropDataLight" id=4]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 13.073, 0, 11.7378 )
light_color = Color( 0.909804, 0.129412, 0.129412, 1 )
[sub_resource type="PropDataLight" id=5]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -4.322, 0, -0.816227 )
light_color = Color( 0.266667, 0.937255, 0.0823529, 1 )
[sub_resource type="PackedScene" id=3]
_bundled = {
"conn_count": 0,
"conns": PoolIntArray( ),
"editable_instances": [ ],
"names": PoolStringArray( ),
"node_count": 0,
"node_paths": [ ],
"nodes": PoolIntArray( ),
"variants": [ ],
"version": 2
}
[sub_resource type="PropDataScene" id=6]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.06597, 0, 16.5242 )
scene = SubResource( 3 )
snap_to_mesh = false
snap_axis = Vector3( 0, -1, 0 )
[sub_resource type="PropDataProp" id=7]
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=8]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -6.80673 )
prop = ExtResource( 1 )
[sub_resource type="PropDataProp" id=9]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 20.5188, 0, 15.6823 )
prop = ExtResource( 1 )
[resource]
props = [ SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ) ]

View File

@ -30,10 +30,6 @@ var _textures : Array
var _prop_material : SpatialMaterial
var _entities_spawned : bool
#func _enter_tree():
# create_debug_immediate_geometry()
func _create_meshers():
var mesher : TVVoxelMesher = TVVoxelMesher.new()
mesher.base_light_value = 0.45
@ -51,145 +47,6 @@ func _create_meshers():
_prop_texture_packer.background_color = Color(0, 0, 0, 1)
_prop_texture_packer.texture_flags = Texture.FLAG_MIPMAPS
func spawn_prop_entities(parent_transform : Transform, prop : PropData):
for i in range(prop.get_prop_count()):
var p : PropDataEntry = prop.get_prop(i)
if p is PropDataEntity:
var pentity : PropDataEntity = p as PropDataEntity
if pentity.entity_data_id != 0:
Entities.spawn_mob(pentity.entity_data_id, pentity.level, parent_transform.origin)
if p is PropDataProp and p.prop != null:
var vmanpp : PropDataProp = p as PropDataProp
spawn_prop_entities(get_prop_mesh_transform(parent_transform * p.transform, vmanpp.snap_to_mesh, vmanpp.snap_axis), p.prop)
func build_phase_prop_mesh() -> void:
for i in range(get_mesher_count()):
get_mesher(i).reset()
if get_prop_count() == 0:
next_phase()
return
if has_meshes(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH):
create_meshes(MESH_INDEX_PROP, lod_num + 1)
# if _prop_material == null:
# _prop_material = SpatialMaterial.new()
# _prop_material.flags_vertex_lighting = true
# _prop_material.vertex_color_use_as_albedo = true
# _prop_material.params_specular_mode = SpatialMaterial.SPECULAR_DISABLED
# _prop_material.metallic = 0
VisualServer.instance_geometry_set_material_override(get_mesh_rid_index(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH_INSTANCE, 0), library.get_prop_material(0).get_rid())
for i in range(get_mesher_count()):
get_mesher(i).material = _prop_material
for i in range(get_prop_count()):
var prop : VoxelChunkPropData = get_prop(i)
if prop.mesh != null and prop.mesh_texture != null:
var at : AtlasTexture = _prop_texture_packer.add_texture(prop.mesh_texture)
_textures.append(at)
if prop.prop != null:
prop.prop.add_textures_into(_prop_texture_packer)
if _prop_texture_packer.get_texture_count() > 0:
_prop_texture_packer.merge()
_prop_material.albedo_texture = _prop_texture_packer.get_generated_texture(0)
for i in range(get_prop_count()):
var prop : VoxelChunkPropData = get_prop(i)
if prop.mesh != null:
var t : Transform = get_prop_transform(prop, prop.snap_to_mesh, prop.snap_axis)
for i in range(get_mesher_count()):
prop.prop.add_meshes_into(get_mesher(i), _prop_texture_packer, t, voxel_world)
if prop.prop != null:
var vmanpp : PropData = prop.prop as PropData
var t : Transform = get_prop_transform(prop, vmanpp.snap_to_mesh, vmanpp.snap_axis)
for i in range(get_mesher_count()):
prop.prop.add_meshes_into(get_mesher(i), _prop_texture_packer, t, voxel_world)
for i in range(get_mesher_count()):
get_mesher(i).bake_colors(self)
get_mesher(i).build_mesh_into(get_mesh_rid_index(MESH_INDEX_PROP, MESH_TYPE_INDEX_MESH, 0))
get_mesher(i).material = null
if not _entities_spawned:
for i in range(get_prop_count()):
var prop : VoxelChunkPropData = get_prop(i)
if prop.prop != null:
spawn_prop_entities(get_prop_transform(prop, false, Vector3(0, -1, 0)), prop.prop)
next_phase()
func build_phase_lights() -> void:
var vl : VoxelLight = VoxelLight.new()
for i in range(get_prop_count()):
var prop : VoxelChunkPropData = get_prop(i)
if prop.light == null and prop.prop == null:
continue
var t : Transform = get_prop_transform(prop, prop.snap_to_mesh, prop.snap_axis)
if prop.light != null:
var pl : PropDataLight = prop.light
vl.set_world_position(prop.x + position_x * size_x, prop.y + position_y * size_y, prop.z + position_z * size_z)
vl.color = pl.light_color
vl.size = pl.light_size
bake_light(vl)
if prop.prop != null:
prop.prop.add_prop_lights_into(self, t, true)
func get_prop_transform(prop : VoxelChunkPropData, snap_to_mesh: bool, snap_axis: Vector3) -> Transform:
var pos : Vector3 = Vector3(prop.x * voxel_scale, prop.y * voxel_scale, prop.z * voxel_scale)
var t : Transform = Transform(Basis(prop.rotation).scaled(prop.scale), pos)
if snap_to_mesh:
var global_pos : Vector3 = voxel_world.to_global(t.origin)
var world_snap_axis : Vector3 = voxel_world.to_global(t.xform(snap_axis))
var world_snap_dir : Vector3 = (world_snap_axis - global_pos) * 100
var space_state : PhysicsDirectSpaceState = voxel_world.direct_space_state
var result : Dictionary = space_state.intersect_ray(global_pos - world_snap_dir, global_pos + world_snap_dir, [], 1)
if result.size() > 0:
t.origin = voxel_world.to_local(result["position"])
return t
func get_prop_mesh_transform(base_transform : Transform, snap_to_mesh: bool, snap_axis: Vector3) -> Transform:
if snap_to_mesh:
var pos : Vector3 = voxel_world.to_global(base_transform.origin)
var world_snap_axis : Vector3 = voxel_world.to_global(base_transform.xform(snap_axis))
var world_snap_dir : Vector3 = (world_snap_axis - pos) * 100
var space_state : PhysicsDirectSpaceState = voxel_world.get_world().direct_space_state
var result : Dictionary = space_state.intersect_ray(pos - world_snap_dir, pos + world_snap_dir, [], 1)
if result.size() > 0:
base_transform.origin = voxel_world.to_local(result["position"])
return base_transform
func _build_phase(phase):
if phase == VoxelChunkDefault.BUILD_PHASE_SETUP:
._build_phase(phase)
@ -198,8 +55,11 @@ func _build_phase(phase):
clear_baked_lights()
generate_random_ao()
bake_lights()
next_phase()
#set_physics_process_internal(true)
active_build_phase_type = VoxelChunkDefault.BUILD_PHASE_TYPE_PHYSICS_PROCESS
# active_build_phase_type = VoxelChunkDefault.BUILD_PHASE_TYPE_PHYSICS_PROCESS
return
# elif phase == VoxelChunkDefault.BUILD_PHASE_TERRARIN_MESH:
# for i in range(get_mesher_count()):
@ -297,10 +157,6 @@ func _build_phase(phase):
# next_phase();
#
# return
elif phase == VoxelChunkDefault.BUILD_PHASE_PROP_MESH:
# set_physics_process_internal(true)
active_build_phase_type = VoxelChunkDefault.BUILD_PHASE_TYPE_PHYSICS_PROCESS
return
else:
._build_phase(phase)
@ -329,18 +185,3 @@ func generate_random_ao() -> void:
set_voxel(int(val * 255.0), x, y, z, VoxelChunkDefault.DEFAULT_CHANNEL_RANDOM_AO)
func _build_phase_physics_process(phase):
if current_build_phase == VoxelChunkDefault.BUILD_PHASE_LIGHTS:
build_phase_lights()
# set_physics_process_internal(false)
active_build_phase_type = VoxelChunkDefault.BUILD_PHASE_TYPE_NORMAL
next_phase()
elif current_build_phase == VoxelChunkDefault.BUILD_PHASE_PROP_MESH:
build_phase_prop_mesh()
# set_physics_process_internal(false)
active_build_phase_type = VoxelChunkDefault.BUILD_PHASE_TYPE_NORMAL
next_phase()
else:
._build_phase_physics_process(phase)