Fixed lines data issues

This commit is contained in:
2025-04-30 23:19:00 +03:00
parent bc0dcfaead
commit dd3867fbf1
37 changed files with 770 additions and 872 deletions

View File

@@ -25,14 +25,6 @@ shape = SubResource( 1 )
transform = Transform( 1, 0, 0, 0, 0.915396, 0.402555, 0, -0.402555, 0.915396, 0, 4.61468, 0.296666 ) transform = Transform( 1, 0, 0, 0, 0.915396, 0.402555, 0, -0.402555, 0.915396, 0, 4.61468, 0.296666 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="bus-stop" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 50.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="bus-stop" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -8,48 +8,22 @@ extents = Vector3( 0.7, 1, 0.6 )
[node name="business-bar1" type="Spatial"] [node name="business-bar1" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="business-bar1" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 15.2012 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 15.2012 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="door1-portal2" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 6, 15.2079 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal2" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal2/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal2/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal2/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal2/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="business-bar1" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="Spatial" type="Spatial" parent="LOD"]
visible = false

View File

@@ -9,54 +9,28 @@ extents = Vector3( 0.7, 1, 0.6 )
[node name="business-cafe1" type="Spatial"] [node name="business-cafe1" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 11.6464 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 11.6464 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="door1-portal2" parent="LOD/0" instance=ExtResource( 2 )] [node name="MergeGroup" type="MergeGroup" parent="."]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.35364 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal2" groups=["smart_object"]] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal2/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal2/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal2/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal2/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 )
[node name="residental-house-stair2" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair2" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 12 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 12 )
[node name="business-cafe1" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="business-cafe1" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -4,14 +4,6 @@
[node name="business-office1" type="Spatial"] [node name="business-office1" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="business-office1" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 150.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="business-office1" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -9,54 +9,28 @@ extents = Vector3( 0.7, 1, 0.6 )
[node name="business-store1" type="Spatial"] [node name="business-store1" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 11.3964 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 11.3964 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="door1-portal2" parent="LOD/0" instance=ExtResource( 2 )] [node name="MergeGroup" type="MergeGroup" parent="."]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.63923 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal2" groups=["smart_object"]] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal2/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal2/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal2/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal2/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 12 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 12 )
[node name="residental-house-stair2" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair2" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 0, 0, -9 ) transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 0, 0, -9 )
[node name="business-store1" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="business-store1" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -19,66 +19,58 @@ polygon_points = PoolVector2Array( 46.5459, -47.5139, 48.291, 48.4641, -47.4376,
[node name="gym-exterior" type="Spatial"] [node name="gym-exterior" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="scene_gym" type="Spatial" parent="." groups=["actuator"]]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 350.0
[node name="scene_gym" type="Spatial" parent="LOD/0" groups=["actuator"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -32.3505, 2.70111, 0.0815773 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -32.3505, 2.70111, 0.0815773 )
[node name="Area" type="Area" parent="LOD/0/scene_gym"] [node name="Area" type="Area" parent="scene_gym"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/scene_gym/Area"] [node name="CollisionShape" type="CollisionShape" parent="scene_gym/Area"]
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="scene_shooting_gallery" type="Spatial" parent="LOD/0" groups=["actuator"]] [node name="scene_shooting_gallery" type="Spatial" parent="." groups=["actuator"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.74583, 3.20716, -0.052886 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -5.74583, 3.20716, -0.052886 )
[node name="Area" type="Area" parent="LOD/0/scene_shooting_gallery"] [node name="Area" type="Area" parent="scene_shooting_gallery"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/scene_shooting_gallery/Area"] [node name="CollisionShape" type="CollisionShape" parent="scene_shooting_gallery/Area"]
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="gym-exterior" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="gym-exterior" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="Occluder" type="Occluder" parent="LOD/0"] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -28.5533 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -28.5533 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="Occluder2" type="Occluder" parent="LOD/0"] [node name="Occluder2" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 28.688 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 28.688 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="Occluder3" type="Occluder" parent="LOD/0"] [node name="Occluder3" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 28, 0, -0.312035 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 28, 0, -0.312035 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="Occluder4" type="Occluder" parent="LOD/0"] [node name="Occluder4" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -29, 0, -0.312035 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -29, 0, -0.312035 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="Occluder5" type="Occluder" parent="LOD/0"] [node name="Occluder5" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -47, 13, -0.312035 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -47, 13, -0.312035 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="Occluder6" type="Occluder" parent="LOD/0"] [node name="Occluder6" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 47, 13, -0.312035 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 47, 13, -0.312035 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="Occluder7" type="Occluder" parent="LOD/0"] [node name="Occluder7" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13, 47.688 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13, 47.688 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="Occluder8" type="Occluder" parent="LOD/0"] [node name="Occluder8" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13, -47.312 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 13, -47.312 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="Occluder9" type="Occluder" parent="LOD/0"] [node name="Occluder9" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 48, -0.312035 ) transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 48, -0.312035 )
shape = SubResource( 5 ) shape = SubResource( 5 )
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -17,59 +17,51 @@ polygon_points = PoolVector2Array( 13.0002, -0.955048, 13.5094, 5.5803, 0.237133
[node name="home-exterior" type="Spatial"] [node name="home-exterior" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="scene_home" type="Spatial" parent="." groups=["actuator"]]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 300.0
[node name="scene_home" type="Spatial" parent="LOD/0" groups=["actuator"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 18.7743 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 18.7743 )
[node name="Area" type="Area" parent="LOD/0/scene_home"] [node name="Area" type="Area" parent="scene_home"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/scene_home/Area"] [node name="CollisionShape" type="CollisionShape" parent="scene_home/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 1.40819 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 1.40819 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="CollisionShape2" type="CollisionShape" parent="LOD/0/scene_home/Area"] [node name="CollisionShape2" type="CollisionShape" parent="scene_home/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.4, -0.375477 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.4, -0.375477 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="home-exterior" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="home-exterior" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="Occluder" type="Occluder" parent="LOD/0"] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -19.8075 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -19.8075 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Occluder2" type="Occluder" parent="LOD/0"] [node name="Occluder2" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19.8664 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19.8664 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Occluder3" type="Occluder" parent="LOD/0"] [node name="Occluder3" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -19.317, 0, 0.375481 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -19.317, 0, 0.375481 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Occluder4" type="Occluder" parent="LOD/0"] [node name="Occluder4" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 19.5775, 0, 0.375481 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 19.5775, 0, 0.375481 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="Occluder5" type="Occluder" parent="LOD/0"] [node name="Occluder5" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 35.8901, 0, 0.375481 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 35.8901, 0, 0.375481 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="Occluder6" type="Occluder" parent="LOD/0"] [node name="Occluder6" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 21.5775, 0, 0.375481 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 21.5775, 0, 0.375481 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="Occluder7" type="Occluder" parent="LOD/0"] [node name="Occluder7" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 21.5775, 0, -0.15785 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 21.5775, 0, -0.15785 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="Occluder8" type="Occluder" parent="LOD/0"] [node name="Occluder8" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 21.5775, 0, -19.708 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 21.5775, 0, -19.708 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -22,18 +22,6 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0804744, 0, 17.4263 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.32854, -0.380188 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.32854, -0.380188 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="LOD" type="LOD" parent="."]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 150.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="logistics-center-exterior" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -16.2969 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -16.2969 )
shape = SubResource( 2 ) shape = SubResource( 2 )
@@ -45,3 +33,7 @@ shape = SubResource( 2 )
[node name="Occluder3" type="Occluder" parent="."] [node name="Occluder3" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="MergeGroup" type="MergeGroup" parent="."]
[node name="logistics-center-exterior" parent="MergeGroup" instance=ExtResource( 1 )]

View File

@@ -29,18 +29,6 @@ shape = SubResource( 3 )
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 39.7202, 0, 0.157095 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 39.7202, 0, 0.157095 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LOD" type="LOD" parent="."]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 350.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="office-exterior" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
[node name="scene_office" type="Spatial" parent="." groups=["actuator"]] [node name="scene_office" type="Spatial" parent="." groups=["actuator"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19.0407 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19.0407 )
@@ -49,3 +37,7 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19.0407 )
[node name="CollisionShape" type="CollisionShape" parent="scene_office/Area"] [node name="CollisionShape" type="CollisionShape" parent="scene_office/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.000112534, 2.48236, -4.51659 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.000112534, 2.48236, -4.51659 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="."]
[node name="office-exterior" parent="MergeGroup" instance=ExtResource( 1 )]

View File

@@ -4,14 +4,6 @@
[node name="power-in-box" type="Spatial"] [node name="power-in-box" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="power-in-box" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 50.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="power-in-box" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -5,24 +5,8 @@
[node name="power-pole-wire" type="Spatial"] [node name="power-pole-wire" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="power-pole" parent="MergeGroup" instance=ExtResource( 2 )]
lod_range = 60.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="power-pole-wire" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="power-pole" parent="LOD/0/MergeGroup" instance=ExtResource( 2 )]
[node name="power-pole-wire" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
lod_range = 150.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/1"]
[node name="power-pole" parent="LOD/1/MergeGroup" instance=ExtResource( 2 )]
[node name="2" type="Spatial" parent="LOD"]
visible = false

View File

@@ -4,14 +4,6 @@
[node name="power-pole" type="Spatial"] [node name="power-pole" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="power-pole" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 80.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="power-pole" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -12,139 +12,6 @@ polygon_points = PoolVector2Array( 12.3046, -2.07897, 12.3844, 1.81323, -10.6155
[node name="garage" type="Spatial"] [node name="garage" type="Spatial"]
[node name="LOD" type="LOD" parent="."]
[node name="MergeGroup" type="MergeGroup" parent="LOD"]
lod_range = 35.0
[node name="residental-garage" parent="LOD/MergeGroup" instance=ExtResource( 1 )]
[node name="residental-garage-roof1" parent="LOD/MergeGroup" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0 )
[node name="residental-garage-door" parent="LOD/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 13.3215, 1, 0 )
[node name="residental-wall1_1" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 12, 0, -5 )
[node name="residental-wall1_2" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 10, 0, -5 )
[node name="residental-wall1_3" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 8, 0, -5 )
[node name="residental-wall1_4" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 6, 0, -5 )
[node name="residental-wall1_5" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 4, 0, -5 )
[node name="residental-wall1_6" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 2, 0, -5 )
[node name="residental-wall1_7" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 0, 0, -5 )
[node name="residental-wall1_8" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -2, 0, -5 )
[node name="residental-wall1_9" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -4, 0, -5 )
[node name="residental-wall1_10" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -6, 0, -5 )
[node name="residental-wall1_11" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -8, 0, -5 )
[node name="residental-wall1_12" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -10, 0, -5 )
[node name="residental-wall1_13" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -10, 0, 5 )
[node name="residental-wall1_14" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -8, 0, 5 )
[node name="residental-wall1_15" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -6, 0, 5 )
[node name="residental-wall1_16" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -4, 0, 5 )
[node name="residental-wall1_17" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -2, 0, 5 )
[node name="residental-wall1_18" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 5 )
[node name="residental-wall1_19" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 2, 0, 5 )
[node name="residental-wall1_20" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 4, 0, 5 )
[node name="residental-wall1_21" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 6, 0, 5 )
[node name="residental-wall1_22" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 8, 0, 5 )
[node name="residental-wall1_23" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 10, 0, 5 )
[node name="residental-wall1_24" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 12, 0, 5 )
[node name="residental-wall-corner_1" parent="LOD/MergeGroup" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -11, 0, -5 )
[node name="residental-wall1_25" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 0, -4 )
[node name="residental-wall1_26" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 0, -2 )
[node name="residental-wall1_27" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 0, 0 )
[node name="residental-wall1_28" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 0, 2 )
[node name="residental-wall1_31" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 0, 4 )
[node name="residental-wall-corner_2" parent="LOD/MergeGroup" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -11, 0, 5 )
[node name="residental-wall-corner_3" parent="LOD/MergeGroup" instance=ExtResource( 5 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 13, 0, 5 )
[node name="residental-wall1_32" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 3.0598e-07, 0, -1, 0, 1, 0, 1, 0, 3.0598e-07, 13, 0, 4 )
[node name="residental-wall1_33" parent="LOD/MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 3.0598e-07, 0, -1, 0, 1, 0, 1, 0, 3.0598e-07, 13, 0, -4 )
[node name="residental-garage-enterance" parent="LOD/MergeGroup" instance=ExtResource( 6 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 13, 0, 0 )
[node name="residental-wall-corner_4" parent="LOD/MergeGroup" instance=ExtResource( 5 )]
transform = Transform( 1.31134e-07, 0, -1, 0, 1, 0, 1, 0, 1.31134e-07, 13, 0, -5 )
[node name="MergeGroup1" type="MergeGroup" parent="LOD"]
visible = false
lod_range = 20.0
[node name="residental-garage" parent="LOD/MergeGroup1" instance=ExtResource( 1 )]
[node name="residental-garage-roof1" parent="LOD/MergeGroup1" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0 )
[node name="3" type="Spatial" parent="LOD"]
visible = false
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.43748, 4.26318 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.43748, 4.26318 )
shape = SubResource( 5 ) shape = SubResource( 5 )
@@ -152,3 +19,123 @@ shape = SubResource( 5 )
[node name="Occluder2" type="Occluder" parent="."] [node name="Occluder2" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.43748, -4.71023 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.43748, -4.71023 )
shape = SubResource( 5 ) shape = SubResource( 5 )
[node name="MergeGroup" type="MergeGroup" parent="."]
lod_range = 35.0
[node name="residental-garage" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0 )
[node name="residental-garage-roof1" parent="MergeGroup" instance=ExtResource( 2 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0 )
[node name="residental-garage-door" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 13.3215, 1, 0 )
[node name="residental-wall1_1" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 12, 1, -5 )
[node name="residental-wall1_2" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 10, 1, -5 )
[node name="residental-wall1_3" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 8, 1, -5 )
[node name="residental-wall1_4" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 6, 1, -5 )
[node name="residental-wall1_5" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 4, 1, -5 )
[node name="residental-wall1_6" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 2, 1, -5 )
[node name="residental-wall1_7" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 0, 1, -5 )
[node name="residental-wall1_8" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -2, 1, -5 )
[node name="residental-wall1_9" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -4, 1, -5 )
[node name="residental-wall1_10" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -6, 1, -5 )
[node name="residental-wall1_11" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -8, 1, -5 )
[node name="residental-wall1_12" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, -10, 1, -5 )
[node name="residental-wall1_13" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -10, 1, 5 )
[node name="residental-wall1_14" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -8, 1, 5 )
[node name="residental-wall1_15" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -6, 1, 5 )
[node name="residental-wall1_16" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -4, 1, 5 )
[node name="residental-wall1_17" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -2, 1, 5 )
[node name="residental-wall1_18" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, 5 )
[node name="residental-wall1_19" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 2, 1, 5 )
[node name="residental-wall1_20" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 4, 1, 5 )
[node name="residental-wall1_21" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 6, 1, 5 )
[node name="residental-wall1_22" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 8, 1, 5 )
[node name="residental-wall1_23" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 10, 1, 5 )
[node name="residental-wall1_24" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 12, 1, 5 )
[node name="residental-wall-corner_1" parent="MergeGroup" instance=ExtResource( 5 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -11, 1, -5 )
[node name="residental-wall1_25" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 1, -4 )
[node name="residental-wall1_26" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 1, -2 )
[node name="residental-wall1_27" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 1, 0 )
[node name="residental-wall1_28" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 1, 2 )
[node name="residental-wall1_31" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( -2.18557e-07, 0, 1, 0, 1, 0, -1, 0, -2.18557e-07, -11, 1, 4 )
[node name="residental-wall-corner_2" parent="MergeGroup" instance=ExtResource( 5 )]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -11, 1, 5 )
[node name="residental-wall-corner_3" parent="MergeGroup" instance=ExtResource( 5 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 13, 1, 5 )
[node name="residental-wall1_32" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 3.0598e-07, 0, -1, 0, 1, 0, 1, 0, 3.0598e-07, 13, 1, 4 )
[node name="residental-wall1_33" parent="MergeGroup" instance=ExtResource( 4 )]
transform = Transform( 3.0598e-07, 0, -1, 0, 1, 0, 1, 0, 3.0598e-07, 13, 1, -4 )
[node name="residental-garage-enterance" parent="MergeGroup" instance=ExtResource( 6 )]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 13, 1, 0 )
[node name="residental-wall-corner_4" parent="MergeGroup" instance=ExtResource( 5 )]
transform = Transform( 1.31134e-07, 0, -1, 0, 1, 0, 1, 0, 1.31134e-07, 13, 1, -5 )

View File

@@ -1,9 +1,8 @@
[gd_scene load_steps=7 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://astream/terrain/details/residental-house1.gltf" type="PackedScene" id=1] [ext_resource path="res://astream/terrain/details/residental-house1.gltf" type="PackedScene" id=1]
[ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2] [ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2]
[ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3] [ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3]
[ext_resource path="res://astream/terrain/details/residental-hut1-lod.gltf" type="PackedScene" id=4]
[sub_resource type="OccluderShapeSphere" id=2] [sub_resource type="OccluderShapeSphere" id=2]
spheres = [ Plane( 6, 6, -3, 6 ), Plane( -6, 6, -3, 6 ), Plane( 6, 6, 6, 6 ), Plane( -6, 6, 6, 6 ) ] spheres = [ Plane( 6, 6, -3, 6 ), Plane( -6, 6, -3, 6 ), Plane( 6, 6, 6, 6 ), Plane( -6, 6, 6, 6 ) ]
@@ -16,44 +15,29 @@ extents = Vector3( 0.7, 1, 0.6 )
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="LOD" type="LOD" parent="."] [node name="BuildingLayoutInstance" type="BuildingLayoutInstance" parent="."]
size = 8
walls = PoolIntArray( 0, 0, 0, 0, 0, 0, 0, 0 )
[node name="0" type="Spatial" parent="LOD"] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
lod_range = 100.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.5131 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house1" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house1" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 )
[node name="1" type="Spatial" parent="LOD"]
visible = false
lod_range = 500.0
[node name="residental-hut1-lod" parent="LOD/1" instance=ExtResource( 4 )]
transform = Transform( 1.7, 0, 0, 0, 1, 0, 0, 0, 1.2, 0, 0, 2.03699 )
[node name="2" type="Spatial" parent="LOD"]
visible = false
[node name="BuildingLayoutInstance" type="BuildingLayoutInstance" parent="."]
size = 8

View File

@@ -4,49 +4,17 @@
[ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2] [ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2]
[ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3] [ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[sub_resource type="OccluderShapePolygon" id=2] [sub_resource type="OccluderShapePolygon" id=2]
polygon_points = PoolVector2Array( 12.3016, -1.14993, 12.5691, 6.87287, -11.3924, 6.33801, -11.7133, -1.36388 ) polygon_points = PoolVector2Array( 12.3016, -1.14993, 12.5691, 6.87287, -11.3924, 6.33801, -11.7133, -1.36388 )
[sub_resource type="OccluderShapePolygon" id=3] [sub_resource type="OccluderShapePolygon" id=3]
polygon_points = PoolVector2Array( 11.693, -0.802464, 11.8306, 5.6631, -10.5008, 6.53434, -10.2715, -1.07759 ) polygon_points = PoolVector2Array( 11.693, -0.802464, 11.8306, 5.6631, -10.5008, 6.53434, -10.2715, -1.07759 )
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[node name="residental-house10" type="Spatial"] [node name="residental-house10" type="Spatial"]
[node name="LOD" type="LOD" parent="."]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, -10.6561 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -13 )
[node name="residental-house10" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 11.4243 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 11.4243 )
shape = SubResource( 2 ) shape = SubResource( 2 )
@@ -62,3 +30,26 @@ shape = SubResource( 2 )
[node name="Occluder4" type="Occluder" parent="."] [node name="Occluder4" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -11.3515, 0, 0 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -11.3515, 0, 0 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="door1-portal" parent="." instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, -10.6561 )
[node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -13 )
[node name="residental-house10" parent="MergeGroup" instance=ExtResource( 1 )]

View File

@@ -3,46 +3,17 @@
[ext_resource path="res://astream/terrain/details/residental-house11.gltf" type="PackedScene" id=1] [ext_resource path="res://astream/terrain/details/residental-house11.gltf" type="PackedScene" id=1]
[ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2] [ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[sub_resource type="OccluderShapePolygon" id=2] [sub_resource type="OccluderShapePolygon" id=2]
polygon_points = PoolVector2Array( 13.298, -1.1693, 13.6648, 6.21337, -10.8677, 5.84653, -10.8218, -0.94003 ) polygon_points = PoolVector2Array( 13.298, -1.1693, 13.6648, 6.21337, -10.8677, 5.84653, -10.8218, -0.94003 )
[sub_resource type="OccluderShapePolygon" id=3] [sub_resource type="OccluderShapePolygon" id=3]
polygon_points = PoolVector2Array( 25.2986, -0.829023, 25.7265, 6.28454, -26.0474, 6.17757, -25.7265, -0.775539 ) polygon_points = PoolVector2Array( 25.2986, -0.829023, 25.7265, 6.28454, -26.0474, 6.17757, -25.7265, -0.775539 )
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[node name="residental-house11" type="Spatial"] [node name="residental-house11" type="Spatial"]
[node name="LOD" type="LOD" parent="."]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 250.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 13.5, 1, 1 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house11" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -15.9386 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -15.9386 )
shape = SubResource( 2 ) shape = SubResource( 2 )
@@ -62,3 +33,23 @@ shape = SubResource( 2 )
[node name="Occluder5" type="Occluder" parent="."] [node name="Occluder5" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -10, 0, 0 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -10, 0, 0 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="door1-portal" parent="." instance=ExtResource( 2 )]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 13.5, 1, 1 )
[node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house11" parent="MergeGroup" instance=ExtResource( 1 )]

View File

@@ -29,46 +29,38 @@ shape = SubResource( 2 )
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -22, 0, 0 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -22, 0, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 4 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 350.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 4 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -1.90735e-06, 0.1, -13 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -1.90735e-06, 0.1, -13 )
skeleton = NodePath("../MergeGroup/residental-house12-simple-first-floor") skeleton = NodePath("../MergeGroup/residental-house12-simple-first-floor")
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house12-simple-first-floor" parent="LOD/0/MergeGroup" instance=ExtResource( 2 )] [node name="residental-house12-simple-first-floor" parent="MergeGroup" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 0, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 0, -12.8 )
[node name="residental-house12-simple-second-floor" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 7, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 7, -12.8 )
[node name="residental-house12-simple-second-floor2" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor2" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 13, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 13, -12.8 )
[node name="residental-house12-simple-second-floor3" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor3" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 19, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 19, -12.8 )
[node name="residental-house12-simple-second-floor4" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor4" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 25, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 25, -12.8 )
[node name="residental-house12-simple-second-floor5" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor5" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 31, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 31, -12.8 )
[node name="residental-house12-simple-second-floor6" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor6" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 37, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 37, -12.8 )
[node name="residental-house12-simple-second-floor7" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor7" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 43, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 43, -12.8 )
[node name="residental-house12-simple-second-floor8" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house12-simple-second-floor8" parent="MergeGroup" instance=ExtResource( 1 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 49, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 49, -12.8 )
[node name="residental-house12-simple-roof" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house12-simple-roof" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 55, -12.8 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 20, 55, -12.8 )
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -30,31 +30,22 @@ shape = SubResource( 3 )
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5.61597, 0, 0 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, -5.61597, 0, 0 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 250.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 0, 7.91488 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 0, 7.91488 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house13" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house13" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -27,34 +27,25 @@ shape = SubResource( 3 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.18915, 9.16854 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.18915, 9.16854 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, -12.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -13 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -13 )
[node name="residental-house2" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house2" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
visible = false transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, -12.5131 )
[node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )

View File

@@ -35,34 +35,25 @@ shape = SubResource( 3 )
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 12.5886, 0, -1.08897 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 12.5886, 0, -1.08897 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, -18.5131 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1, -18.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -19 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -19 )
[node name="residental-house4" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house4" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -4,6 +4,9 @@
[ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2] [ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2]
[ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3] [ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[sub_resource type="OccluderShapePolygon" id=2] [sub_resource type="OccluderShapePolygon" id=2]
polygon_points = PoolVector2Array( 11.1717, -0.227351, 11.4926, 12.2452, -11.4349, 12.3369, -11.5266, -0.273208 ) polygon_points = PoolVector2Array( 11.1717, -0.227351, 11.4926, 12.2452, -11.4349, 12.3369, -11.5266, -0.273208 )
@@ -13,11 +16,24 @@ polygon_points = PoolVector2Array( 9.98366, 0.136333, 9.93017, 12.0636, -9.48501
[sub_resource type="OccluderShapePolygon" id=4] [sub_resource type="OccluderShapePolygon" id=4]
polygon_points = PoolVector2Array( 10.7324, -0.131092, 10.6255, 12.0636, -8.95016, 12.4914, -8.7897, -0.291551 ) polygon_points = PoolVector2Array( 10.7324, -0.131092, 10.6255, 12.0636, -8.95016, 12.4914, -8.7897, -0.291551 )
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[node name="residental-house5" type="Spatial"] [node name="residental-house5" type="Spatial"]
[node name="door1-portal" parent="." instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.5131 )
[node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10.9887 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10.9887 )
shape = SubResource( 2 ) shape = SubResource( 2 )
@@ -34,34 +50,9 @@ shape = SubResource( 3 )
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 10.6966, 0.0534847, 2.70653 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 10.6966, 0.0534847, 2.70653 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
lod_range = 250.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 )
[node name="residental-house5" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house5" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -1,9 +1,8 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://astream/terrain/details/residental-house7.gltf" type="PackedScene" id=1] [ext_resource path="res://astream/terrain/details/residental-house7.gltf" type="PackedScene" id=1]
[ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2] [ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2]
[ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3] [ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3]
[ext_resource path="res://astream/terrain/details/residental-hut1-lod.gltf" type="PackedScene" id=4]
[sub_resource type="OccluderShapePolygon" id=2] [sub_resource type="OccluderShapePolygon" id=2]
polygon_points = PoolVector2Array( 11.3615, 0.373477, 11.3222, 7.37125, -11.5188, 7.41056, -11.3222, 0.137596 ) polygon_points = PoolVector2Array( 11.3615, 0.373477, 11.3222, 7.37125, -11.5188, 7.41056, -11.3222, 0.137596 )
@@ -32,41 +31,25 @@ shape = SubResource( 3 )
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 11.2319, 0, 0.353821 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 11.2319, 0, 0.353821 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 100.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.5131 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -8.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -9 )
[node name="residental-house7" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house7" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
lod_range = 500.0
[node name="residental-hut1-lod" parent="LOD/1" instance=ExtResource( 4 )]
transform = Transform( 1.7, 0, 0, 0, 1, 0, 0, 0, 1.05, 0, 0, 0.494991 )
[node name="2" type="Spatial" parent="LOD"]
visible = false

View File

@@ -31,34 +31,25 @@ shape = SubResource( 3 )
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 12.8026, 0, 0.0163574 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 12.8026, 0, 0.0163574 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="LOD" type="LOD" parent="."] [node name="door1-portal" parent="." instance=ExtResource( 2 )]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5, 1, -12.5131 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5, 1, -12.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"] [node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"] [node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -13 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, -13 )
[node name="residental-house8" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )] [node name="residental-house8" parent="MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -1,12 +1,8 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://astream/terrain/details/residental-house9.gltf" type="PackedScene" id=1] [ext_resource path="res://astream/terrain/details/residental-house9.gltf" type="PackedScene" id=1]
[ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2] [ext_resource path="res://astream/terrain/details/parts/door1-portal.tscn" type="PackedScene" id=2]
[ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3] [ext_resource path="res://astream/terrain/details/parts/residental-house-stair.tscn" type="PackedScene" id=3]
[ext_resource path="res://astream/terrain/details/residental-hut1-lod.gltf" type="PackedScene" id=4]
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[sub_resource type="OccluderShapePolygon" id=2] [sub_resource type="OccluderShapePolygon" id=2]
polygon_points = PoolVector2Array( 15.9386, -0.668566, 15.8851, 12.5423, -17.9176, 12.2749, -18.2385, -0.882509 ) polygon_points = PoolVector2Array( 15.9386, -0.668566, 15.8851, 12.5423, -17.9176, 12.2749, -18.2385, -0.882509 )
@@ -14,47 +10,11 @@ polygon_points = PoolVector2Array( 15.9386, -0.668566, 15.8851, 12.5423, -17.917
[sub_resource type="OccluderShapePolygon" id=3] [sub_resource type="OccluderShapePolygon" id=3]
polygon_points = PoolVector2Array( 20.2709, 0.187198, 20.6453, 12.0075, -16.0456, 11.9005, -16.2595, -0.882509 ) polygon_points = PoolVector2Array( 20.2709, 0.187198, 20.6453, 12.0075, -16.0456, 11.9005, -16.2595, -0.882509 )
[sub_resource type="BoxShape" id=1]
extents = Vector3( 0.7, 1, 0.6 )
[node name="residental-house9" type="Spatial"] [node name="residental-house9" type="Spatial"]
[node name="LOD" type="LOD" parent="."]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 200.0
[node name="door1-portal" parent="LOD/0" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 5, 1, -15.5131 )
skeleton = NodePath("../../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, -16 )
[node name="residental-house9" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
lod_range = 500.0
[node name="residental-hut1-lod" parent="LOD/1" instance=ExtResource( 4 )]
transform = Transform( 2.55, 0, 0, 0, 1.4, 0, 0, 0, 2.2, -0.916183, 0, 4.03123 )
[node name="2" type="Spatial" parent="LOD"]
visible = false
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -14.8154 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -14.8154 )
shape = SubResource( 2 ) shape = SubResource( 2 )
@@ -66,3 +26,26 @@ shape = SubResource( 2 )
[node name="Occluder3" type="Occluder" parent="."] [node name="Occluder3" type="Occluder" parent="."]
transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 ) transform = Transform( -4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 0, 0 )
shape = SubResource( 3 ) shape = SubResource( 3 )
[node name="door1-portal" parent="." instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 5, 1, -15.5131 )
[node name="enter_destination" type="Spatial" parent="door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 )
[node name="MergeGroup" type="MergeGroup" parent="."]
[node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, -16 )
[node name="residental-house9" parent="MergeGroup" instance=ExtResource( 1 )]

View File

@@ -9,40 +9,26 @@ extents = Vector3( 0.7, 1, 0.6 )
[node name="residental-hut1" type="Spatial"] [node name="residental-hut1" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="residental-hut1" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 100.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"] [node name="door1-portal" parent="MergeGroup" instance=ExtResource( 2 )]
[node name="residental-hut1" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="door1-portal" parent="LOD/0/MergeGroup" instance=ExtResource( 2 )]
transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -7.48604 ) transform = Transform( -1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 1, 1, -7.48604 )
skeleton = NodePath("../../../..") skeleton = NodePath("../..")
[node name="enter_destination" type="Spatial" parent="LOD/0/MergeGroup/door1-portal" groups=["smart_object"]] [node name="enter_destination" type="Spatial" parent="MergeGroup/door1-portal" groups=["smart_object"]]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.905, 0, 0.65 )
[node name="actions" type="Node" parent="LOD/0/MergeGroup/door1-portal/enter_destination"] [node name="actions" type="Node" parent="MergeGroup/door1-portal/enter_destination"]
[node name="EnterDestination" type="Node" parent="LOD/0/MergeGroup/door1-portal/enter_destination/actions"] [node name="EnterDestination" type="Node" parent="MergeGroup/door1-portal/enter_destination/actions"]
[node name="Area" type="Area" parent="LOD/0/MergeGroup/door1-portal/enter_destination"] [node name="Area" type="Area" parent="MergeGroup/door1-portal/enter_destination"]
[node name="CollisionShape" type="CollisionShape" parent="LOD/0/MergeGroup/door1-portal/enter_destination/Area"] [node name="CollisionShape" type="CollisionShape" parent="MergeGroup/door1-portal/enter_destination/Area"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.1, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="residental-house-stair" parent="LOD/0/MergeGroup" instance=ExtResource( 3 )] [node name="residental-house-stair" parent="MergeGroup" instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -7.97294 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -7.97294 )
[node name="1" type="Spatial" parent="LOD"]
visible = false
lod_range = 500.0
[node name="residental-hut1" parent="LOD/1" instance=ExtResource( 1 )]
[node name="2" type="Spatial" parent="LOD"]
visible = false

View File

@@ -4,14 +4,6 @@
[node name="residental-parking1" type="Spatial"] [node name="residental-parking1" type="Spatial"]
[node name="LOD" type="LOD" parent="."] [node name="MergeGroup" type="MergeGroup" parent="."]
[node name="0" type="Spatial" parent="LOD"] [node name="residental-parking" parent="MergeGroup" instance=ExtResource( 1 )]
lod_range = 110.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="residental-parking" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false

View File

@@ -25,18 +25,6 @@ transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 9.30597 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.141865, 2.25391, 0.0472889 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.141865, 2.25391, 0.0472889 )
shape = SubResource( 1 ) shape = SubResource( 1 )
[node name="LOD" type="LOD" parent="."]
[node name="0" type="Spatial" parent="LOD"]
lod_range = 300.0
[node name="MergeGroup" type="MergeGroup" parent="LOD/0"]
[node name="townhall-exterior" parent="LOD/0/MergeGroup" instance=ExtResource( 1 )]
[node name="1" type="Spatial" parent="LOD"]
visible = false
[node name="Occluder" type="Occluder" parent="."] [node name="Occluder" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 7.81175 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 7.81175 )
shape = SubResource( 2 ) shape = SubResource( 2 )
@@ -52,3 +40,7 @@ shape = SubResource( 3 )
[node name="Occluder4" type="Occluder" parent="."] [node name="Occluder4" type="Occluder" parent="."]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 26.4111, -2.98485 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 26.4111, -2.98485 )
shape = SubResource( 4 ) shape = SubResource( 4 )
[node name="MergeGroup" type="MergeGroup" parent="."]
[node name="townhall-exterior" parent="MergeGroup" instance=ExtResource( 1 )]

View File

@@ -52,7 +52,7 @@ buildings_path = "res://astream/buildings.json"
[world] [world]
world_extent = 3072 world_extent = 3072
tile_size = 128 tile_size = 128
view_distance = 2 view_distance = 3
[road] [road]
road_lines_path = "res://astream/road_lines.json" road_lines_path = "res://astream/road_lines.json"
center_mesh = "res://astream/road/road-lanes_road-lane-center.mesh" center_mesh = "res://astream/road/road-lanes_road-lane-center.mesh"

View File

@@ -374,6 +374,11 @@ flecs::entity BuildingsData::get_building_entity(const String &key)
void BuildingsData::remove_scene_item(const String &key, const String &bkey) void BuildingsData::remove_scene_item(const String &key, const String &bkey)
{ {
flecs::entity e = ecs().lookup(key.ascii().ptr()); flecs::entity e = ecs().lookup(key.ascii().ptr());
flecs::entity be = get_building_entity(bkey);
assert(be.is_valid());
assert(be.has<CBuildingData>());
if (be.has<CBuildingInstanced>())
be.remove<CBuildingInstanced>();
if (!e.is_valid()) { if (!e.is_valid()) {
print_error("bad scene: " + key); print_error("bad scene: " + key);
flecs::query_builder<const CBuildingInstance> qb = flecs::query_builder<const CBuildingInstance> qb =
@@ -412,32 +417,51 @@ void BuildingsData::add_scene_item(const String &key, const String &bkey)
flecs::entity e = ecs().lookup(key.ascii().ptr()); flecs::entity e = ecs().lookup(key.ascii().ptr());
assert(e.is_valid()); assert(e.is_valid());
assert(e.has<CSceneData>()); assert(e.has<CSceneData>());
flecs::entity be = get_building_entity(bkey);
assert(be.is_valid());
assert(be.has<CBuildingData>());
const CBuildingData *b = be.get<CBuildingData>();
CSceneData *d = e.get_mut<CSceneData>(); CSceneData *d = e.get_mut<CSceneData>();
assert(d); assert(d);
String ename = "bi:" + bkey; String ename = "bi:" + bkey;
// print_line("creating entity: " + ename + " on top of: " + key); // print_line("creating entity: " + ename + " on top of: " + key);
flecs::entity ce = e.lookup(ename.ascii().ptr()); flecs::entity ce = e.lookup(ename.ascii().ptr());
if (ce.is_valid()) if (!ce.is_valid())
ce.destruct(); ce = ecs().entity(ename.ascii().ptr()).child_of(e);
ce = ecs().entity(ename.ascii().ptr()).child_of(e); assert(ce.is_valid());
if (!ce.has<CBuildingInstance>())
ce.set<CBuildingInstance>({ bkey, nullptr });
// print_line("child name: " + String(ce.name()));
}
void BuildingsData::instance_scene_item(const String &key, const String &bkey)
{
flecs::entity be = get_building_entity(bkey);
assert(be.is_valid());
assert(be.has<CBuildingData>());
if (be.has<CBuildingInstanced>())
return;
Ref<PackedScene> ps = scene_get_packed_scene(key); Ref<PackedScene> ps = scene_get_packed_scene(key);
if (!ps.is_valid()) if (!ps.is_valid())
return; return;
Node *where = SceneTree::get_singleton()->get_current_scene(); Node *where = SceneTree::get_singleton()->get_current_scene();
assert(where); assert(where);
flecs::entity e = ecs().lookup(key.ascii().ptr());
assert(e.is_valid());
assert(e.has<CSceneData>());
const CBuildingData *b = be.get<CBuildingData>();
String ename = "bi:" + bkey;
flecs::entity ce = e.lookup(ename.ascii().ptr());
if (!ce.is_valid())
return;
if (ce.get<CBuildingInstance>()->node)
return;
if (ps.is_valid()) { if (ps.is_valid()) {
Spatial *scene = Object::cast_to<Spatial>(ps->instance()); Spatial *scene = Object::cast_to<Spatial>(ps->instance());
assert(scene); assert(scene);
where->call_deferred("add_child", scene); where->call_deferred("add_child", scene);
scene->set_transform(b->building.xform); scene->set_transform(b->building.xform);
ce.set<CBuildingInstance>({ bkey, scene }); ce.set<CBuildingInstance>({ bkey, scene });
} else }
ce.set<CBuildingInstance>({ bkey, nullptr });
// print_line("child name: " + String(ce.name()));
} }
Ref<PackedScene> BuildingsData::scene_get_packed_scene(const String &key) Ref<PackedScene> BuildingsData::scene_get_packed_scene(const String &key)

View File

@@ -59,6 +59,7 @@ public:
Transform cam_xform; Transform cam_xform;
int tile_x; int tile_x;
int tile_z; int tile_z;
int load_count;
}; };
struct CBuildingTileData { struct CBuildingTileData {
using tile_key_t = std::tuple<int, int>; using tile_key_t = std::tuple<int, int>;
@@ -107,6 +108,7 @@ public:
static AABB get_scene_aabb(const String &key); static AABB get_scene_aabb(const String &key);
static void remove_scene_item(const String &key, const String &bkey); static void remove_scene_item(const String &key, const String &bkey);
static void add_scene_item(const String &key, const String &bkey); static void add_scene_item(const String &key, const String &bkey);
static void instance_scene_item(const String &key, const String &bkey);
static Ref<PackedScene> scene_get_packed_scene(const String &key); static Ref<PackedScene> scene_get_packed_scene(const String &key);
static int scene_get_item_count(const String &key); static int scene_get_item_count(const String &key);
// String scene_get_item(const String &key, int index) const; // String scene_get_item(const String &key, int index) const;

View File

@@ -254,10 +254,13 @@ BuildingsData::BuildingsData(flecs::world &ecs_)
} }
}); });
ecs_.system("UpdateEye").kind(flecs::OnUpdate).run([&](flecs::iter &it) { ecs_.system("UpdateEye").kind(flecs::OnUpdate).run([&](flecs::iter &it) {
if (!SceneTree::get_singleton()->get_current_scene())
return;
Viewport *viewport = SceneTree::get_singleton() Viewport *viewport = SceneTree::get_singleton()
->get_current_scene() ->get_current_scene()
->get_viewport(); ->get_viewport();
int i, j, l; if (!viewport)
return;
int tile_size = config.get_value("world", "tile_size"); int tile_size = config.get_value("world", "tile_size");
int view_distance = config.get_value("world", "view_distance"); int view_distance = config.get_value("world", "view_distance");
assert(tile_size > 0); assert(tile_size > 0);
@@ -266,6 +269,7 @@ BuildingsData::BuildingsData(flecs::world &ecs_)
Vector3 eye = xform.origin; Vector3 eye = xform.origin;
int tile_x = int(eye.x / tile_size); int tile_x = int(eye.x / tile_size);
int tile_z = int(eye.z / tile_size); int tile_z = int(eye.z / tile_size);
int load_count = 0;
bool need_update = true; bool need_update = true;
if (it.world().has<CBuildingsEye>()) { if (it.world().has<CBuildingsEye>()) {
int old_x = it.world().get<CBuildingsEye>()->tile_x; int old_x = it.world().get<CBuildingsEye>()->tile_x;
@@ -274,8 +278,11 @@ BuildingsData::BuildingsData(flecs::world &ecs_)
need_update = false; need_update = false;
else else
print_line("UpdateEye need update"); print_line("UpdateEye need update");
load_count =
it.world().get<CBuildingsEye>()->load_count;
} }
it.world().set<CBuildingsEye>({ xform, tile_x, tile_z }); it.world().set<CBuildingsEye>(
{ xform, tile_x, tile_z, load_count });
if (!need_update) if (!need_update)
return; return;
if (!it.world().has<CBuildingTileData>()) if (!it.world().has<CBuildingTileData>())
@@ -314,7 +321,7 @@ BuildingsData::BuildingsData(flecs::world &ecs_)
const CBuildingTile *bt = const CBuildingTile *bt =
e.get<CBuildingTile>(); e.get<CBuildingTile>();
std::tuple<int, int> tile = bt->tile; std::tuple<int, int> tile = bt->tile;
int erase_distance = view_distance + 1; int erase_distance = view_distance + 2;
int ed2 = erase_distance * erase_distance; int ed2 = erase_distance * erase_distance;
int t_x = std::get<0>(tile); int t_x = std::get<0>(tile);
@@ -348,12 +355,23 @@ BuildingsData::BuildingsData(flecs::world &ecs_)
return; return;
if (!scene_get_packed_scene(id).is_valid()) if (!scene_get_packed_scene(id).is_valid())
return; return;
if (e.world().get_mut<CBuildingsEye>()->load_count >
4) {
print_line("Limit reached");
return;
}
if (!has_scene(id)) if (!has_scene(id))
return; return;
else { else {
if (!e.has<CBuildingInstanced>()) { if (!e.has<CBuildingInstanced>()) {
add_scene_item(id, bd.building.key); add_scene_item(id, bd.building.key);
instance_scene_item(id,
bd.building.key);
e.add<CBuildingInstanced>(); e.add<CBuildingInstanced>();
e.world()
.get_mut<CBuildingsEye>()
->load_count++;
e.world().modified<CBuildingsEye>();
} }
} }
if (debug) if (debug)
@@ -392,6 +410,13 @@ BuildingsData::BuildingsData(flecs::world &ecs_)
.with<CBuildingLoaded>() .with<CBuildingLoaded>()
.write<CBuildingLoaded>() .write<CBuildingLoaded>()
.each([&](flecs::entity e, const CBuildingData &bd) {}); .each([&](flecs::entity e, const CBuildingData &bd) {});
ecs_.system("FinishBuildingsHandling")
.kind(flecs::OnUpdate)
.run([&](flecs::iter &it) {
if (it.world().has<CBuildingsEye>())
it.world().get_mut<CBuildingsEye>()->load_count =
0;
});
print_line("SpawnNode initialized"); print_line("SpawnNode initialized");
} }

View File

@@ -11,6 +11,7 @@
#include <core/math/geometry.h> #include <core/math/geometry.h>
#include <scene/3d/immediate_geometry.h> #include <scene/3d/immediate_geometry.h>
#include <scene/main/viewport.h> #include <scene/main/viewport.h>
#include <flecs.h>
#include "from_string.h" #include "from_string.h"
#include "buildings_data.h" #include "buildings_data.h"
#include "editor_event.h" #include "editor_event.h"
@@ -32,14 +33,14 @@ struct CLinesCommon {
LinesAccessor *lines; LinesAccessor *lines;
}; };
class LinesAccessor { struct LinesAccessor {
flecs::entity root_e; flecs::entity root_e;
public: public:
LinesAccessor() LinesAccessor(flecs::world &ecs)
{ {
BaseData::get_singleton()->get().component<CLine>(); root_e = ecs.module<LinesAccessor>();
root_e = BaseData::get_singleton()->get().entity("lines"); ecs.component<CLine>();
root_e.set<CLinesCommon>({ nullptr, this }); root_e.set<CLinesCommon>({ nullptr, this });
assert(root_e.is_valid()); assert(root_e.is_valid());
} }
@@ -316,14 +317,15 @@ public:
} }
}; };
class IndexAccessor { struct IndexAccessor {
flecs::entity root_e; flecs::entity root_e;
public: public:
IndexAccessor() IndexAccessor(flecs::world &ecs)
{ {
BaseData::get_singleton()->get().component<CLineIndex>(); ecs.module<IndexAccessor>();
root_e = BaseData::get_singleton()->get().entity("lines"); ecs.component<CLineIndex>();
root_e = ecs.get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
} }
inline const struct RoadLinesData::road_line_index & inline const struct RoadLinesData::road_line_index &
@@ -401,25 +403,19 @@ public:
ImmediateGeometry *RoadLinesData::debug_im = nullptr; ImmediateGeometry *RoadLinesData::debug_im = nullptr;
static Ref<Material> debug_material; static Ref<Material> debug_material;
RoadLinesData::RoadLinesData() RoadLinesData::RoadLinesData(flecs::world &ecs)
: initialized(false) : initialized(false)
{ {
BaseData::get_singleton()->get().component<LinesAccessor>(); ecs.module<RoadLinesData>();
flecs::entity root_e = BaseData::get_singleton()->get().entity("lines"); ecs.import <LinesAccessor>();
assert(root_e.is_valid()); ecs.import <IndexAccessor>();
root_e.emplace<LinesAccessor>();
assert(root_e.has<LinesAccessor>());
assert(root_e.get<LinesAccessor>());
root_e.emplace<IndexAccessor>();
assert(root_e.has<IndexAccessor>());
assert(root_e.get<IndexAccessor>());
load_data(); load_data();
} }
RoadLinesData *RoadLinesData::singleton = nullptr;
const struct RoadLinesData::road_line & const struct RoadLinesData::road_line &
RoadLinesData::get_line(const String &key) const RoadLinesData::get_line(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line(key); return lines->get_line(key);
@@ -427,7 +423,8 @@ RoadLinesData::get_line(const String &key) const
const struct RoadLinesData::road_line * const struct RoadLinesData::road_line *
RoadLinesData::get_line_ptr(const String &key) const RoadLinesData::get_line_ptr(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_ptr(key); return lines->get_line_ptr(key);
@@ -435,7 +432,8 @@ RoadLinesData::get_line_ptr(const String &key) const
const RoadLinesData::road_edge &RoadLinesData::get_line_edge(const String &key, const RoadLinesData::road_edge &RoadLinesData::get_line_edge(const String &key,
int edge) const int edge) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_edge(key, edge); return lines->get_line_edge(key, edge);
@@ -443,7 +441,8 @@ const RoadLinesData::road_edge &RoadLinesData::get_line_edge(const String &key,
RoadLinesData::road_edge_side RoadLinesData::road_edge_side
RoadLinesData::get_line_edge_left(const String &key, int edge) const RoadLinesData::get_line_edge_left(const String &key, int edge) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_edge_left(key, edge); return lines->get_line_edge_left(key, edge);
@@ -451,7 +450,8 @@ RoadLinesData::get_line_edge_left(const String &key, int edge) const
RoadLinesData::road_edge_side RoadLinesData::road_edge_side
RoadLinesData::get_line_edge_right(const String &key, int edge) const RoadLinesData::get_line_edge_right(const String &key, int edge) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_edge_right(key, edge); return lines->get_line_edge_right(key, edge);
@@ -477,7 +477,8 @@ RoadLinesData::get_line_edge_side(const String &key, int edge, int side) const
void RoadLinesData::set_line_edge_left(const String &key, int edge, void RoadLinesData::set_line_edge_left(const String &key, int edge,
road_edge_side &side) road_edge_side &side)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->set_line_edge_left(key, edge, side); lines->set_line_edge_left(key, edge, side);
@@ -487,7 +488,8 @@ void RoadLinesData::set_line_edge_left(const String &key, int edge,
void RoadLinesData::set_line_edge_right(const String &key, int edge, void RoadLinesData::set_line_edge_right(const String &key, int edge,
road_edge_side &side) road_edge_side &side)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->set_line_edge_right(key, edge, side); lines->set_line_edge_right(key, edge, side);
@@ -497,7 +499,8 @@ void RoadLinesData::set_line_edge_right(const String &key, int edge,
void RoadLinesData::set_line_edge(const String &key, int edge_id, void RoadLinesData::set_line_edge(const String &key, int edge_id,
const road_edge &edge) const road_edge &edge)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->set_line_edge(key, edge_id, edge); lines->set_line_edge(key, edge_id, edge);
@@ -507,21 +510,24 @@ void RoadLinesData::set_line_edge(const String &key, int edge_id,
} }
int RoadLinesData::get_line_edge_count(const String &key) const int RoadLinesData::get_line_edge_count(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_edge_count(key); return lines->get_line_edge_count(key);
} }
const Vector3 &RoadLinesData::get_line_point(const String &key, int index) const const Vector3 &RoadLinesData::get_line_point(const String &key, int index) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_point(key, index); return lines->get_line_point(key, index);
} }
const RoadLinesData::road_line &RoadLinesData::lines(const String &key) const const RoadLinesData::road_line &RoadLinesData::lines(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line(key); return lines->get_line(key);
@@ -529,14 +535,15 @@ const RoadLinesData::road_line &RoadLinesData::lines(const String &key) const
const RoadLinesData::road_line_index & const RoadLinesData::road_line_index &
RoadLinesData::indices(const String &key) const RoadLinesData::indices(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); IndexAccessor &indices =
assert(root_e.is_valid()); *BaseData::get_singleton()->get().get_mut<IndexAccessor>();
IndexAccessor &indices = *root_e.get_mut<IndexAccessor>(); BaseData::get_singleton()->get().modified<IndexAccessor>();
return indices[key]; return indices[key];
} }
void RoadLinesData::set_line(const String &key, const road_line &line) void RoadLinesData::set_line(const String &key, const road_line &line)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->set_line(key, line); lines->set_line(key, line);
@@ -544,7 +551,8 @@ void RoadLinesData::set_line(const String &key, const road_line &line)
} }
void RoadLinesData::update_line(const String &key) void RoadLinesData::update_line(const String &key)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->update_line(key); lines->update_line(key);
@@ -553,14 +561,16 @@ void RoadLinesData::update_line(const String &key)
const Transform &RoadLinesData::get_line_point_transform(const String &key, const Transform &RoadLinesData::get_line_point_transform(const String &key,
int index) const int index) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_line_point_transform(key, index); return lines->get_line_point_transform(key, index);
} }
bool RoadLinesData::has_line(const String &key) const bool RoadLinesData::has_line(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->has(key); return lines->has(key);
@@ -568,7 +578,8 @@ bool RoadLinesData::has_line(const String &key) const
void RoadLinesData::insert_line_point(const String &key, int index, void RoadLinesData::insert_line_point(const String &key, int index,
const Transform &xform) const Transform &xform)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->insert_line_point(key, index, xform); lines->insert_line_point(key, index, xform);
@@ -576,7 +587,8 @@ void RoadLinesData::insert_line_point(const String &key, int index,
} }
void RoadLinesData::erase_line_point(const String &key, int index) void RoadLinesData::erase_line_point(const String &key, int index)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->erase_line_point(key, index); lines->erase_line_point(key, index);
@@ -585,7 +597,8 @@ void RoadLinesData::erase_line_point(const String &key, int index)
void RoadLinesData::set_line_point_position(const String &key, int index, void RoadLinesData::set_line_point_position(const String &key, int index,
const Vector3 &position) const Vector3 &position)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->set_line_point_position(key, index, position); lines->set_line_point_position(key, index, position);
@@ -593,34 +606,26 @@ void RoadLinesData::set_line_point_position(const String &key, int index,
} }
void RoadLinesData::clear_all_line_indices() void RoadLinesData::clear_all_line_indices()
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); IndexAccessor &indices =
assert(root_e.is_valid()); *BaseData::get_singleton()->get().get_mut<IndexAccessor>();
IndexAccessor &indices = *root_e.get_mut<IndexAccessor>();
indices.clear_all_line_indices(); indices.clear_all_line_indices();
} }
void RoadLinesData::clear_line_indices(const String &key) void RoadLinesData::clear_line_indices(const String &key)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); IndexAccessor &indices =
assert(root_e.is_valid()); *BaseData::get_singleton()->get().get_mut<IndexAccessor>();
IndexAccessor &indices = *root_e.get_mut<IndexAccessor>();
indices.clear_line_indices(key); indices.clear_line_indices(key);
} }
void RoadLinesData::set_line_metadata(const String &key, void RoadLinesData::set_line_metadata(const String &key,
const Dictionary &metadata) const Dictionary &metadata)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->set_line_metadata(key, metadata); lines->set_line_metadata(key, metadata);
root_e.modified<LinesAccessor>(); root_e.modified<LinesAccessor>();
} }
RoadLinesData *RoadLinesData::get_singleton()
{
if (!singleton)
singleton = memnew(RoadLinesData);
assert(singleton->initialized);
return singleton;
}
RoadLinesData::~RoadLinesData() RoadLinesData::~RoadLinesData()
{ {
#if 0 #if 0
@@ -632,8 +637,6 @@ RoadLinesData::~RoadLinesData()
} }
void RoadLinesData::cleanup() void RoadLinesData::cleanup()
{ {
memdelete(singleton);
singleton = nullptr;
} }
String RoadLinesData::get_road_lines_path() String RoadLinesData::get_road_lines_path()
{ {
@@ -642,7 +645,8 @@ String RoadLinesData::get_road_lines_path()
void RoadLinesData::get_road_lines_key_list(List<String> *keys) void RoadLinesData::get_road_lines_key_list(List<String> *keys)
{ {
List<String> line_keys; List<String> line_keys;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
lines->get_key_list(&line_keys); lines->get_key_list(&line_keys);
@@ -658,7 +662,8 @@ void RoadLinesData::get_road_lines_key_list(List<String> *keys)
void RoadLinesData::get_lines_key_list(List<String> *keys) void RoadLinesData::get_lines_key_list(List<String> *keys)
{ {
assert(initialized); assert(initialized);
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
lines->get_key_list(keys); lines->get_key_list(keys);
@@ -666,14 +671,16 @@ void RoadLinesData::get_lines_key_list(List<String> *keys)
} }
const String &RoadLinesData::get_next_line(const String &key) const const String &RoadLinesData::get_next_line(const String &key) const
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
return lines->get_next(key); return lines->get_next(key);
} }
void RoadLinesData::erase_line(const String &key) void RoadLinesData::erase_line(const String &key)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->erase(key); lines->erase(key);
@@ -683,10 +690,13 @@ void RoadLinesData::load_data()
{ {
int i; int i;
ConfigFile config; ConfigFile config;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
IndexAccessor &line_indices = *root_e.get_mut<IndexAccessor>(); IndexAccessor &line_indices =
const LinesAccessor *lines = root_e.get<LinesAccessor>(); *BaseData::get_singleton()->get().get_mut<IndexAccessor>();
const LinesAccessor *lines =
BaseData::get_singleton()->get().get<LinesAccessor>();
Error result = config.load("res://config/stream.conf"); Error result = config.load("res://config/stream.conf");
ERR_FAIL_COND_MSG(result != OK, "Failed to load config"); ERR_FAIL_COND_MSG(result != OK, "Failed to load config");
assert(result == OK); assert(result == OK);
@@ -742,6 +752,8 @@ void RoadLinesData::load_data()
} }
update_line_edges(); update_line_edges();
initialized = true; initialized = true;
BaseData::get_singleton()->get().modified<LinesAccessor>();
BaseData::get_singleton()->get().modified<IndexAccessor>();
} }
void RoadLinesData::save_data() void RoadLinesData::save_data()
{ {
@@ -755,7 +767,8 @@ void RoadLinesData::save_data()
FileAccess::get_file_as_string(road_lines_path); FileAccess::get_file_as_string(road_lines_path);
Dictionary output; Dictionary output;
List<String> keys; List<String> keys;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
lines->get_key_list(&keys); lines->get_key_list(&keys);
@@ -846,9 +859,11 @@ void RoadLinesData::road_lines_curve_index(
std::vector<Vector3> &road_lines_nodes) std::vector<Vector3> &road_lines_nodes)
{ {
int i, j; int i, j;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
IndexAccessor &indices = *root_e.get_mut<IndexAccessor>(); IndexAccessor &indices =
*BaseData::get_singleton()->get().get_mut<IndexAccessor>();
indices.clear_line_indices(key); indices.clear_line_indices(key);
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
for (i = 0; i < (int)lines->get_line_points_count(key); i++) { for (i = 0; i < (int)lines->get_line_points_count(key); i++) {
@@ -906,7 +921,8 @@ void RoadLinesData::index_lines(
} }
static inline int get_segment_index(const String &road, int pos) static inline int get_segment_index(const String &road, int pos)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
int idx = rld->indices(road).indices[pos]; int idx = rld->indices(road).indices[pos];
return idx; return idx;
} }
@@ -914,9 +930,11 @@ void RoadLinesData::create_segments(const String &road,
std::vector<int> &segments) std::vector<int> &segments)
{ {
int i; int i;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const IndexAccessor &indices = *root_e.get<IndexAccessor>(); const IndexAccessor &indices =
*BaseData::get_singleton()->get().get<IndexAccessor>();
for (i = 0; i < (int)indices[road].indices.size() - 1; i++) { for (i = 0; i < (int)indices[road].indices.size() - 1; i++) {
segments.push_back(i); segments.push_back(i);
segments.push_back(i + 1); segments.push_back(i + 1);
@@ -929,9 +947,11 @@ void RoadLinesData::insert_close_points(std::vector<Vector3> &road_lines_nodes,
{ {
int i; int i;
List<String> keys; List<String> keys;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
IndexAccessor &indices = *root_e.get_mut<IndexAccessor>(); IndexAccessor &indices =
*BaseData::get_singleton()->get().get_mut<IndexAccessor>();
get_road_lines_key_list(&keys); get_road_lines_key_list(&keys);
List<String>::Element *e = keys.front(); List<String>::Element *e = keys.front();
for (i = 0; i < (int)road_lines_nodes.size(); i++) { for (i = 0; i < (int)road_lines_nodes.size(); i++) {
@@ -984,9 +1004,11 @@ void RoadLinesData::update_road_lines_nodes(
std::vector<Vector3> &road_lines_nodes) std::vector<Vector3> &road_lines_nodes)
{ {
List<String> keys; List<String> keys;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
IndexAccessor &indices = *root_e.get_mut<IndexAccessor>(); IndexAccessor &indices =
*BaseData::get_singleton()->get().get_mut<IndexAccessor>();
get_road_lines_key_list(&keys); get_road_lines_key_list(&keys);
std::unordered_map<uint32_t, std::tuple<String, String> > kcmp; std::unordered_map<uint32_t, std::tuple<String, String> > kcmp;
@@ -1176,7 +1198,8 @@ int RoadLinesData::get_debug_flags() const
void RoadLinesData::update_line_segments(const String &line) void RoadLinesData::update_line_segments(const String &line)
{ {
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
LinesAccessor *lines = root_e.get_mut<LinesAccessor>(); LinesAccessor *lines = root_e.get_mut<LinesAccessor>();
lines->update_line_segments(line); lines->update_line_segments(line);
@@ -1189,7 +1212,8 @@ Vector3 RoadLinesData::get_point_by_offsets(const String &line,
{ {
Vector3 ret; Vector3 ret;
int i; int i;
flecs::entity root_e = BaseData::get_singleton()->get().lookup("lines"); flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
assert(root_e.is_valid()); assert(root_e.is_valid());
const LinesAccessor *lines = root_e.get<LinesAccessor>(); const LinesAccessor *lines = root_e.get<LinesAccessor>();
assert(lines->has(line)); assert(lines->has(line));
@@ -1252,3 +1276,10 @@ void RoadLinesData::road_edge_side::update_test_points(
{ {
test_p[1] = test_p[0] + normal * lot_depth; test_p[1] = test_p[0] + normal * lot_depth;
} }
flecs::entity RoadLinesData::get_root_e() const
{
flecs::entity root_e =
BaseData::get_singleton()->get().get<LinesAccessor>()->root_e;
return root_e;
}

View File

@@ -4,6 +4,8 @@
#include <unordered_map> #include <unordered_map>
#include <core/io/json.h> #include <core/io/json.h>
#include <scene/resources/curve.h> #include <scene/resources/curve.h>
#include <flecs.h>
#include "base_data.h"
#include "callable.h" #include "callable.h"
class ImmediateGeometry; class ImmediateGeometry;
class RoadLinesData { class RoadLinesData {
@@ -14,11 +16,10 @@ class RoadLinesData {
bool initialized; bool initialized;
protected: protected:
RoadLinesData();
static RoadLinesData *singleton;
_Signal<void> lines_updated; _Signal<void> lines_updated;
public: public:
RoadLinesData(flecs::world &ecs);
struct line_segment { struct line_segment {
Vector3 p1; Vector3 p1;
Vector3 p2; Vector3 p2;
@@ -220,10 +221,14 @@ public:
test_edge(const String &key, int index) test_edge(const String &key, int index)
: line_key(key) : line_key(key)
, edge_index(index) , edge_index(index)
, left(RoadLinesData::get_singleton()->get_line_edge( , left(BaseData::get_singleton()
key, index)) ->get()
, right(RoadLinesData::get_singleton()->get_line_edge( .get<RoadLinesData>()
key, index)) ->get_line_edge(key, index))
, right(BaseData::get_singleton()
->get()
.get<RoadLinesData>()
->get_line_edge(key, index))
{ {
update_from_line(); update_from_line();
} }
@@ -234,7 +239,10 @@ public:
} }
void validate() void validate()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()
->get()
.get<RoadLinesData>();
RoadLinesData::road_edge edge = RoadLinesData::road_edge edge =
rld->get_line_edge(line_key, edge_index); rld->get_line_edge(line_key, edge_index);
if (edge.left.lot != left.lot) { if (edge.left.lot != left.lot) {
@@ -258,7 +266,10 @@ public:
} }
void update_from_line() void update_from_line()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()
->get()
.get<RoadLinesData>();
RoadLinesData::road_edge edge = RoadLinesData::road_edge edge =
rld->get_line_edge(line_key, edge_index); rld->get_line_edge(line_key, edge_index);
print_line("line: " + line_key + print_line("line: " + line_key +
@@ -285,7 +296,9 @@ public:
void update_line() void update_line()
{ {
print_line("update_line"); print_line("update_line");
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
RoadLinesData::road_edge_side tmp_left = RoadLinesData::road_edge_side tmp_left =
rld->get_line_edge_left(line_key, edge_index); rld->get_line_edge_left(line_key, edge_index);
RoadLinesData::road_edge_side tmp_right = RoadLinesData::road_edge_side tmp_right =
@@ -300,6 +313,9 @@ public:
validate(); validate();
rld->update_line_edges(); rld->update_line_edges();
validate(); validate();
BaseData::get_singleton()
->get()
.modified<RoadLinesData>();
} }
}; };
struct road_edge { struct road_edge {
@@ -426,7 +442,6 @@ public:
void clear_line_indices(const String &key); void clear_line_indices(const String &key);
void set_line_metadata(const String &key, const Dictionary &metadata); void set_line_metadata(const String &key, const Dictionary &metadata);
static RoadLinesData *get_singleton();
virtual ~RoadLinesData(); virtual ~RoadLinesData();
static void cleanup(); static void cleanup();
String get_road_lines_path(); String get_road_lines_path();
@@ -463,5 +478,8 @@ private:
std::unordered_map<uint32_t, std::vector<Vector3> > std::unordered_map<uint32_t, std::vector<Vector3> >
&road_lines_nodes_hash, &road_lines_nodes_hash,
std::vector<Vector3> &road_lines_nodes); std::vector<Vector3> &road_lines_nodes);
public:
flecs::entity get_root_e() const;
}; };
#endif #endif

View File

@@ -285,7 +285,8 @@ Node *RoadLinesEditor::scene()
void RoadLinesEditor::update_line_geometry() void RoadLinesEditor::update_line_geometry()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
if (!rld->has_line(current_line)) { if (!rld->has_line(current_line)) {
if (line_im) if (line_im)
line_im->clear(); line_im->clear();
@@ -331,6 +332,7 @@ void RoadLinesEditor::update_line_geometry()
// FIXME: update line segments on load and when line is changed // FIXME: update line segments on load and when line is changed
rld->update_line_segments(current_line); rld->update_line_segments(current_line);
} }
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::update_line_index_ui() void RoadLinesEditor::update_line_index_ui()
{ {
@@ -339,8 +341,11 @@ void RoadLinesEditor::update_line_index_ui()
} }
void RoadLinesEditor::select_line(const String &line_name) void RoadLinesEditor::select_line(const String &line_name)
{ {
const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
assert(root_e.is_valid());
print_line("selected line: " + line_name); print_line("selected line: " + line_name);
RoadLinesData *rld = RoadLinesData::get_singleton();
assert(rld->has_line(line_name)); assert(rld->has_line(line_name));
if (current_line != line_name) { if (current_line != line_name) {
current_line = line_name; current_line = line_name;
@@ -359,13 +364,15 @@ void RoadLinesEditor::select_line(const String &line_name)
bool RoadLinesEditor::line_exists(const String &line_name) bool RoadLinesEditor::line_exists(const String &line_name)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
return rld->has_line(line_name); return rld->has_line(line_name);
} }
void RoadLinesEditor::line_create_point() void RoadLinesEditor::line_create_point()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
/* Create point in line */ /* Create point in line */
print_line("line_create_point"); print_line("line_create_point");
Vector3 position = get_cursor_position(); Vector3 position = get_cursor_position();
@@ -378,6 +385,7 @@ void RoadLinesEditor::line_create_point()
update_line_index_ui(); update_line_index_ui();
EditorEvent::get_singleton()->event.emit( EditorEvent::get_singleton()->event.emit(
"road_lines_editor_set_line_index_ui", varray(line_index + 1)); "road_lines_editor_set_line_index_ui", varray(line_index + 1));
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::line_delete_point() void RoadLinesEditor::line_delete_point()
@@ -385,7 +393,8 @@ void RoadLinesEditor::line_delete_point()
/* Delete point from line */ /* Delete point from line */
print_line("line_delete_point"); print_line("line_delete_point");
int index = get_line_index(); int index = get_line_index();
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
if (rld->lines(current_line).points.size() < 2) if (rld->lines(current_line).points.size() < 2)
return; return;
rld->erase_line_point(current_line, index); rld->erase_line_point(current_line, index);
@@ -398,13 +407,15 @@ void RoadLinesEditor::line_delete_point()
index = MAX(0, index - 1); index = MAX(0, index - 1);
EditorEvent::get_singleton()->event.emit( EditorEvent::get_singleton()->event.emit(
"road_lines_editor_set_line_index_ui", varray(index)); "road_lines_editor_set_line_index_ui", varray(index));
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
static const String cursor_name = "%line_cursor"; static const String cursor_name = "%line_cursor";
void RoadLinesEditor::set_point_to_cursor() void RoadLinesEditor::set_point_to_cursor()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
print_line("set_point_to_cursor"); print_line("set_point_to_cursor");
Spatial *cursor = get_as_node<Spatial>(cursor_name); Spatial *cursor = get_as_node<Spatial>(cursor_name);
Transform xform = cursor->get_global_transform(); Transform xform = cursor->get_global_transform();
@@ -414,6 +425,7 @@ void RoadLinesEditor::set_point_to_cursor()
varray(current_line)); varray(current_line));
update_line_geometry(); update_line_geometry();
set_ui_point_position(rld->lines(current_line).points[index].origin); set_ui_point_position(rld->lines(current_line).points[index].origin);
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
int RoadLinesEditor::get_line_index() int RoadLinesEditor::get_line_index()
@@ -424,7 +436,8 @@ int RoadLinesEditor::get_line_index()
void RoadLinesEditor::move_cursor_to_point() void RoadLinesEditor::move_cursor_to_point()
{ {
print_line("move_cursor_to_point"); print_line("move_cursor_to_point");
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
int index = get_line_index(); int index = get_line_index();
Transform xform(Basis(), rld->lines(current_line).points[index].origin); Transform xform(Basis(), rld->lines(current_line).points[index].origin);
set_cursor_position(xform.origin); set_cursor_position(xform.origin);
@@ -538,7 +551,10 @@ int RoadLinesEditor::get_camera_mode() const
void RoadLinesEditor::update_ui() void RoadLinesEditor::update_ui()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
assert(root_e.is_valid());
get_as_node<Control>("%road_lines_base")->show(); get_as_node<Control>("%road_lines_base")->show();
get_as_node<Control>("%road_lines_edit_metadata_dlg")->hide(); get_as_node<Control>("%road_lines_edit_metadata_dlg")->hide();
get_as_node<Control>("%road_lines_buildings")->hide(); get_as_node<Control>("%road_lines_buildings")->hide();
@@ -575,12 +591,17 @@ void RoadLinesEditor::update_ui()
EditorEvent::get_singleton()->event.emit( EditorEvent::get_singleton()->event.emit(
"road_lines_editor_update_lines_list", "road_lines_editor_update_lines_list",
varray(elements, selected_index)); varray(elements, selected_index));
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::create_new_line_at_cursor(const String &line_name) void RoadLinesEditor::create_new_line_at_cursor(const String &line_name)
{ {
print_line("creating new line called: " + line_name); print_line("creating new line called: " + line_name);
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
if (!root_e.is_valid())
return;
struct RoadLinesData::road_line rline; struct RoadLinesData::road_line rline;
rline.flags = 0; rline.flags = 0;
rline.lanes = -1; rline.lanes = -1;
@@ -595,17 +616,22 @@ void RoadLinesEditor::create_new_line_at_cursor(const String &line_name)
update_line_index_ui(); update_line_index_ui();
update_ui(); update_ui();
rld->update_line_edges(); rld->update_line_edges();
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::delete_current_line() void RoadLinesEditor::delete_current_line()
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
assert(root_e.is_valid());
String delete_line = current_line; String delete_line = current_line;
current_line = rld->get_next_line(delete_line); current_line = rld->get_next_line(delete_line);
rld->erase_line(delete_line); rld->erase_line(delete_line);
update_line_index_ui(); update_line_index_ui();
update_ui(); update_ui();
rld->update_line_edges(); rld->update_line_edges();
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
Vector3 RoadLinesEditor::get_cursor_position() Vector3 RoadLinesEditor::get_cursor_position()
@@ -624,12 +650,14 @@ void RoadLinesEditor::set_cursor_position(const Vector3 &cursor_position)
} }
void RoadLinesEditor::set_point_position(const Vector3 &position) void RoadLinesEditor::set_point_position(const Vector3 &position)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
int index = get_line_index(); int index = get_line_index();
rld->set_line_point_position(current_line, index, position); rld->set_line_point_position(current_line, index, position);
EditorEvent::get_singleton()->event.emit("lines_changed_line", EditorEvent::get_singleton()->event.emit("lines_changed_line",
varray(current_line)); varray(current_line));
update_line_geometry(); update_line_geometry();
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::set_ui_cursor_position(const Vector3 &cursor_position) void RoadLinesEditor::set_ui_cursor_position(const Vector3 &cursor_position)
{ {
@@ -662,7 +690,8 @@ void RoadLinesEditor::set_ui_point_position(const Vector3 &point_position)
void RoadLinesEditor::set_line_index(int index) void RoadLinesEditor::set_line_index(int index)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
if (!rld->has_line(current_line)) { if (!rld->has_line(current_line)) {
print_error("bad line: " + current_line); print_error("bad line: " + current_line);
return; return;
@@ -679,6 +708,11 @@ void RoadLinesEditor::set_line_index(int index)
void RoadLinesEditor::line_list_filter_changed(const String &text) void RoadLinesEditor::line_list_filter_changed(const String &text)
{ {
const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
if (!root_e.is_valid())
return;
print_line("lines filter update: " + text); print_line("lines filter update: " + text);
filter_text = text.strip_edges(); filter_text = text.strip_edges();
update_ui(); update_ui();
@@ -686,6 +720,11 @@ void RoadLinesEditor::line_list_filter_changed(const String &text)
void RoadLinesEditor::activate() void RoadLinesEditor::activate()
{ {
const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
if (!root_e.is_valid())
return;
assert(!active); assert(!active);
print_line("activate::update UI"); print_line("activate::update UI");
update_ui(); update_ui();
@@ -796,13 +835,16 @@ const String &RoadLinesEditor::get_filter_text() const
} }
void RoadLinesEditor::get_matching_lines(List<String> *lines) void RoadLinesEditor::get_matching_lines(List<String> *lines)
{ {
RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
flecs::entity root_e = rld->get_root_e();
assert(root_e.is_valid());
if (!re.is_valid()) if (!re.is_valid())
re.instance(); re.instance();
re->compile(filter_text); re->compile(filter_text);
if (filter_text.length() > 0 && !re->is_valid()) if (filter_text.length() > 0 && !re->is_valid())
return; return;
List<String> line_keys; List<String> line_keys;
RoadLinesData *rld = RoadLinesData::get_singleton();
rld->get_lines_key_list(&line_keys); rld->get_lines_key_list(&line_keys);
assert(!line_keys.empty()); assert(!line_keys.empty());
lines->clear(); lines->clear();
@@ -817,6 +859,7 @@ void RoadLinesEditor::get_matching_lines(List<String> *lines)
e = e->next(); e = e->next();
} }
assert(!lines->empty()); assert(!lines->empty());
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::place_zebras() void RoadLinesEditor::place_zebras()
{ {
@@ -902,11 +945,13 @@ func place_zebras():
} }
void RoadLinesEditor::save_data() void RoadLinesEditor::save_data()
{ {
RoadLinesData::get_singleton()->save_data(); BaseData::get_singleton()->get().get_mut<RoadLinesData>()->save_data();
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadLinesEditor::update_current_line_metadata(const String &text) void RoadLinesEditor::update_current_line_metadata(const String &text)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
BaseData::get_singleton()->get().get_mut<RoadLinesData>();
assert(rld->has_line(current_line)); assert(rld->has_line(current_line));
if (!text.begins_with("{")) if (!text.begins_with("{"))
return; return;
@@ -924,10 +969,12 @@ void RoadLinesEditor::update_current_line_metadata(const String &text)
return; return;
} }
rld->set_line_metadata(current_line, v); rld->set_line_metadata(current_line, v);
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
String RoadLinesEditor::get_current_line_metadata() const String RoadLinesEditor::get_current_line_metadata() const
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
assert(rld->has_line(current_line)); assert(rld->has_line(current_line));
return JSON::print(rld->lines(current_line).metadata, "\t", true); return JSON::print(rld->lines(current_line).metadata, "\t", true);
} }
@@ -1020,7 +1067,9 @@ void RoadLinesEditor::event_handler(const String &event,
assert(c); assert(c);
create_edge_editor_ui(c); create_edge_editor_ui(c);
} else if (event == "road_lines_edge_editor::update") { } else if (event == "road_lines_edge_editor::update") {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
int index = args[0]; int index = args[0];
const Dictionary &data = args[1]; const Dictionary &data = args[1];
print_line("Update for index: " + itos(index)); print_line("Update for index: " + itos(index));
@@ -1040,6 +1089,7 @@ void RoadLinesEditor::event_handler(const String &event,
rld->set_line_edge(current_line, index, edge); rld->set_line_edge(current_line, index, edge);
rld->update_line_edges(); rld->update_line_edges();
print_line("Update for index: " + itos(index) + " done"); print_line("Update for index: " + itos(index) + " done");
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
} }
class EdgeEditorHandler { class EdgeEditorHandler {
@@ -1275,7 +1325,9 @@ class EdgeEditorHandler {
PopupMenu *menu = Object::cast_to<PopupMenu>(args[0]); PopupMenu *menu = Object::cast_to<PopupMenu>(args[0]);
int id = args[1]; int id = args[1];
int item_index = menu->get_item_index(id); int item_index = menu->get_item_index(id);
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
RoadLinesData::road_line rl = RoadLinesData::road_line rl =
rld->get_line(current_line); rld->get_line(current_line);
String pname = get_pname(menu, id); String pname = get_pname(menu, id);
@@ -1290,6 +1342,9 @@ class EdgeEditorHandler {
set_lot(side, pname, dir_offt); set_lot(side, pname, dir_offt);
rld->set_line_edge_left(current_line, index, rld->set_line_edge_left(current_line, index,
side); side);
BaseData::get_singleton()
->get()
.modified<RoadLinesData>();
} else if (pname.begins_with("residental-") || } else if (pname.begins_with("residental-") ||
pname.begins_with("business-")) { pname.begins_with("business-")) {
RoadLinesData::road_edge_side side = RoadLinesData::road_edge_side side =
@@ -1345,7 +1400,9 @@ class EdgeEditorHandler {
int id = args[1]; int id = args[1];
int item_index = menu->get_item_index(id); int item_index = menu->get_item_index(id);
String pname = get_pname(menu, id); String pname = get_pname(menu, id);
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
RoadLinesData::road_line rl = RoadLinesData::road_line rl =
rld->get_line(current_line); rld->get_line(current_line);
if (pname.begins_with("lot-")) { if (pname.begins_with("lot-")) {
@@ -1359,6 +1416,10 @@ class EdgeEditorHandler {
set_lot(side, pname, dir_offt); set_lot(side, pname, dir_offt);
rld->set_line_edge_right(current_line, index, rld->set_line_edge_right(current_line, index,
side); side);
BaseData::get_singleton()
->get()
.modified<RoadLinesData>();
} else if (pname.begins_with("residental-") || } else if (pname.begins_with("residental-") ||
pname.begins_with("business-")) { pname.begins_with("business-")) {
RoadLinesData::road_edge_side side = RoadLinesData::road_edge_side side =
@@ -1422,7 +1483,8 @@ public:
for (i = 0; i < top->get_child_count(); i++) for (i = 0; i < top->get_child_count(); i++)
top->get_child(i)->queue_delete(); top->get_child(i)->queue_delete();
print_line("line index: " + itos(index)); print_line("line index: " + itos(index));
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
if (index < 0 || if (index < 0 ||
index >= (int)rld->lines(current_line).points.size() - 1) index >= (int)rld->lines(current_line).points.size() - 1)
return; return;
@@ -1588,7 +1650,8 @@ public:
static EdgeEditorHandler *edge_editor = nullptr; static EdgeEditorHandler *edge_editor = nullptr;
void RoadLinesEditor::create_edge_editor_ui(Control *top) void RoadLinesEditor::create_edge_editor_ui(Control *top)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
assert(current_line.length() > 0); assert(current_line.length() > 0);
int index = get_line_index(); int index = get_line_index();
if (index < 0) if (index < 0)

View File

@@ -25,6 +25,7 @@
#include "contours.h" #include "contours.h"
#include "wedge.h" #include "wedge.h"
#include "road_lot.h" #include "road_lot.h"
#include "base_data.h"
#include "road_processing.h" #include "road_processing.h"
class DebugGeo : public ImmediateGeometry { class DebugGeo : public ImmediateGeometry {
@@ -353,7 +354,9 @@ out2:;
{ {
int i; int i;
List<String> keys; List<String> keys;
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
rld->get_road_lines_key_list(&keys); rld->get_road_lines_key_list(&keys);
List<String>::Element *e = keys.front(); List<String>::Element *e = keys.front();
bool ok = true; bool ok = true;
@@ -379,13 +382,16 @@ out2:;
break; break;
e = e->next(); e = e->next();
} }
BaseData::get_singleton()->get().modified<RoadLinesData>();
return !ok; return !ok;
} }
void test_lines() void test_lines()
{ {
int i; int i;
List<String> keys; List<String> keys;
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
rld->get_road_lines_key_list(&keys); rld->get_road_lines_key_list(&keys);
List<String>::Element *e = keys.front(); List<String>::Element *e = keys.front();
while (e) { while (e) {
@@ -399,12 +405,15 @@ out2:;
} }
e = e->next(); e = e->next();
} }
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void calculate_lot_depths() void calculate_lot_depths()
{ {
int i; int i;
List<String> keys; List<String> keys;
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
rld->get_road_lines_key_list(&keys); rld->get_road_lines_key_list(&keys);
List<String>::Element *e = keys.front(); List<String>::Element *e = keys.front();
while (e) { while (e) {
@@ -430,6 +439,7 @@ out2:;
} }
e = e->next(); e = e->next();
} }
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
/* FIXME: need to generate lots from wedges, not lines (because intersections) /* FIXME: need to generate lots from wedges, not lines (because intersections)
and join lots on the same line segment if they are adjacent and of similar depth and join lots on the same line segment if they are adjacent and of similar depth
@@ -437,7 +447,9 @@ out2:;
void create_structures() void create_structures()
{ {
List<String> keys; List<String> keys;
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
rld->get_road_lines_key_list(&keys); rld->get_road_lines_key_list(&keys);
List<String>::Element *e = keys.front(); List<String>::Element *e = keys.front();
print_line("create structures"); print_line("create structures");
@@ -628,12 +640,15 @@ out2:;
#endif #endif
print_line("structures generated: " + print_line("structures generated: " +
itos(structures_generated)); itos(structures_generated));
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void create_edges() void create_edges()
{ {
int i; int i;
List<String> keys; List<String> keys;
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld = BaseData::get_singleton()
->get()
.get_mut<RoadLinesData>();
edges.clear(); edges.clear();
rld->get_road_lines_key_list(&keys); rld->get_road_lines_key_list(&keys);
List<String>::Element *e = keys.front(); List<String>::Element *e = keys.front();
@@ -678,6 +693,7 @@ out2:;
} }
e = e->next(); e = e->next();
} }
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void sort_neighbors() void sort_neighbors()
{ {
@@ -821,7 +837,9 @@ out2:;
struct side_ref side_ref1 = struct side_ref side_ref1 =
side_refs[{ idx2, idx1 }]; side_refs[{ idx2, idx1 }];
struct RoadLinesData::road_edge_side mside1 = struct RoadLinesData::road_edge_side mside1 =
RoadLinesData::get_singleton() BaseData::get_singleton()
->get()
.get<RoadLinesData>()
->get_line_edge_side( ->get_line_edge_side(
side_ref1.line_key, side_ref1.line_key,
side_ref1.edge, side_ref1.edge,
@@ -831,7 +849,9 @@ out2:;
struct side_ref side_ref2 = struct side_ref side_ref2 =
side_refs[{ idx1, idx3 }]; side_refs[{ idx1, idx3 }];
struct RoadLinesData::road_edge_side mside2 = struct RoadLinesData::road_edge_side mside2 =
RoadLinesData::get_singleton() BaseData::get_singleton()
->get()
.get<RoadLinesData>()
->get_line_edge_side( ->get_line_edge_side(
side_ref2.line_key, side_ref2.line_key,
side_ref2.edge, side_ref2.edge,
@@ -1036,7 +1056,8 @@ out2:;
void road_setup2() void road_setup2()
{ {
int i, j; int i, j;
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()->get().get<RoadLinesData>();
// update_lot_depths(); // update_lot_depths();
ImmediateGeometry *d = rld->get_debug_node(); ImmediateGeometry *d = rld->get_debug_node();
d->clear(); d->clear();
@@ -1433,13 +1454,19 @@ public:
float get_lot_depth(const struct wedge &wedge) float get_lot_depth(const struct wedge &wedge)
{ {
RoadLinesData::road_edge_side mside1 = RoadLinesData::road_edge_side mside1 =
RoadLinesData::get_singleton()->get_line_edge_side( BaseData::get_singleton()
wedge.side1_ref.line_key, wedge.side1_ref.edge, ->get()
wedge.side1_ref.side); .get<RoadLinesData>()
->get_line_edge_side(wedge.side1_ref.line_key,
wedge.side1_ref.edge,
wedge.side1_ref.side);
RoadLinesData::road_edge_side mside2 = RoadLinesData::road_edge_side mside2 =
RoadLinesData::get_singleton()->get_line_edge_side( BaseData::get_singleton()
wedge.side2_ref.line_key, wedge.side2_ref.edge, ->get()
wedge.side2_ref.side); .get<RoadLinesData>()
->get_line_edge_side(wedge.side2_ref.line_key,
wedge.side2_ref.edge,
wedge.side2_ref.side);
float lot_depth_max = float lot_depth_max =
MIN(mside1.lot_depth_eff, mside2.lot_depth_eff); MIN(mside1.lot_depth_eff, mside2.lot_depth_eff);
return lot_depth_max; return lot_depth_max;
@@ -1560,13 +1587,19 @@ public:
assert(lanes[k].use_mesh.length() > 0); assert(lanes[k].use_mesh.length() > 0);
} }
RoadLinesData::road_edge_side mside1 = RoadLinesData::road_edge_side mside1 =
RoadLinesData::get_singleton()->get_line_edge_side( BaseData::get_singleton()
wedge.side1_ref.line_key, wedge.side1_ref.edge, ->get()
wedge.side1_ref.side); .get<RoadLinesData>()
->get_line_edge_side(wedge.side1_ref.line_key,
wedge.side1_ref.edge,
wedge.side1_ref.side);
RoadLinesData::road_edge_side mside2 = RoadLinesData::road_edge_side mside2 =
RoadLinesData::get_singleton()->get_line_edge_side( BaseData::get_singleton()
wedge.side2_ref.line_key, wedge.side2_ref.edge, ->get()
wedge.side2_ref.side); .get<RoadLinesData>()
->get_line_edge_side(wedge.side2_ref.line_key,
wedge.side2_ref.edge,
wedge.side2_ref.side);
print_line("m1: " + String::num(mside1.lot_depth_eff)); print_line("m1: " + String::num(mside1.lot_depth_eff));
print_line("m2: " + String::num(mside2.lot_depth_eff)); print_line("m2: " + String::num(mside2.lot_depth_eff));
/* for each lane */ /* for each lane */
@@ -1861,8 +1894,8 @@ public:
void RoadProcessing::road_setup(Node *target, int debug_flags) void RoadProcessing::road_setup(Node *target, int debug_flags)
{ {
RoadLinesData *rld = RoadLinesData::get_singleton(); RoadLinesData *rld =
int i, j; BaseData::get_singleton()->get().get_mut<RoadLinesData>();
RoadLinesProcessing *r = RoadLinesProcessing *r =
BaseData::get_singleton()->get().get_mut<RoadLinesProcessing>(); BaseData::get_singleton()->get().get_mut<RoadLinesProcessing>();
r->set_debug_flags(debug_flags); r->set_debug_flags(debug_flags);
@@ -1896,6 +1929,7 @@ void RoadProcessing::road_setup(Node *target, int debug_flags)
.get_mut<RoadMeshProcessing>() .get_mut<RoadMeshProcessing>()
->create_road_meshes(target); ->create_road_meshes(target);
r->road_setup2(); r->road_setup2();
BaseData::get_singleton()->get().modified<RoadLinesData>();
} }
void RoadProcessing::remove_road_meshes(Node *target) void RoadProcessing::remove_road_meshes(Node *target)
@@ -1909,7 +1943,7 @@ void RoadProcessing::remove_road_meshes(Node *target)
void RoadProcessing::load_data() void RoadProcessing::load_data()
{ {
/* Not needed but still */ /* Not needed but still */
RoadLinesData::get_singleton(); BaseData::get_singleton()->get().get<RoadLinesData>();
ConfigFile config; ConfigFile config;
Error result = config.load("res://config/stream.conf"); Error result = config.load("res://config/stream.conf");
ERR_FAIL_COND_MSG(result != OK, "Failed to load config"); ERR_FAIL_COND_MSG(result != OK, "Failed to load config");
@@ -2044,6 +2078,7 @@ RoadProcessing::RoadProcessing(flecs::world &ecs)
ecs.import <Contours>(); ecs.import <Contours>();
ecs.import <RoadLinesProcessing>(); ecs.import <RoadLinesProcessing>();
ecs.import <RoadMeshProcessing>(); ecs.import <RoadMeshProcessing>();
load_data();
} }
RoadProcessing::~RoadProcessing() RoadProcessing::~RoadProcessing()

View File

@@ -14,6 +14,7 @@
#include "road_processing.h" #include "road_processing.h"
#include "road_debug.h" #include "road_debug.h"
#include "buildings_data.h" #include "buildings_data.h"
#include "road_lines_data.h"
#include "base_data.h" #include "base_data.h"
#include "npc/npc.h" #include "npc/npc.h"
#include "stream.h" #include "stream.h"
@@ -556,6 +557,7 @@ StreamWorld::StreamWorld()
, count_shit(0) , count_shit(0)
{ {
BaseData::get_singleton()->get().import <BuildingsData>(); BaseData::get_singleton()->get().import <BuildingsData>();
BaseData::get_singleton()->get().import <RoadLinesData>();
BaseData::get_singleton()->get().import <RoadProcessing>(); BaseData::get_singleton()->get().import <RoadProcessing>();
BaseData::get_singleton() BaseData::get_singleton()
->get() ->get()
@@ -571,7 +573,6 @@ StreamWorld::StreamWorld()
.component<StreamWorld::components::WorldData>(); .component<StreamWorld::components::WorldData>();
Error result = config.load("res://config/stream.conf"); Error result = config.load("res://config/stream.conf");
ERR_FAIL_COND_MSG(result != OK, "Failed to load config"); ERR_FAIL_COND_MSG(result != OK, "Failed to load config");
RoadProcessing::load_data();
world_extent = config.get_value("world", "world_extent"); world_extent = config.get_value("world", "world_extent");
tile_size = config.get_value("world", "tile_size"); tile_size = config.get_value("world", "tile_size");
view_distance = config.get_value("world", "view_distance"); view_distance = config.get_value("world", "view_distance");

View File

@@ -157,7 +157,10 @@ void MainTabs::handle_event(const String &event, const Vector<Variant> &args)
} else if (event == "road_lines_editor_update_line_index_ui") { } else if (event == "road_lines_editor_update_line_index_ui") {
String current_line = args[0]; String current_line = args[0];
if (current_line.length() > 0) { if (current_line.length() > 0) {
RoadLinesData *rld = RoadLinesData::get_singleton(); const RoadLinesData *rld =
BaseData::get_singleton()
->get()
.get<RoadLinesData>();
SpinBox *sp_line_index = SpinBox *sp_line_index =
Object::cast_to<SpinBox>(ui_data["line_index"]); Object::cast_to<SpinBox>(ui_data["line_index"]);
int index = sp_line_index->get_value(); int index = sp_line_index->get_value();
@@ -275,16 +278,6 @@ void MainTabs::_notification(int which)
.get<WorldEditor::components::world_editor_node>() .get<WorldEditor::components::world_editor_node>()
->node; ->node;
#endif #endif
BuildingsEditor *editor =
world_editor_e
.get<WorldEditor::components::
buildings_editor_node>()
->node;
RoadLinesEditor *rleditor =
world_editor_e
.get<WorldEditor::components::
road_lines_editor_node>()
->node;
int i; int i;
if (!Engine::get_singleton()->is_editor_hint()) { if (!Engine::get_singleton()->is_editor_hint()) {
npc_editor = memnew(WindowDialog); npc_editor = memnew(WindowDialog);
@@ -631,16 +624,44 @@ void MainTabs::_notification(int which)
} break; } break;
} }
} }
if (!Engine::get_singleton()->is_editor_hint()) { if (!Engine::get_singleton()->is_editor_hint())
set_process(true);
} break;
case NOTIFICATION_PROCESS: {
if (handlers.empty() &&
!Engine::get_singleton()->is_editor_hint()) {
flecs::world ecs = BaseData::get_singleton()->get();
flecs::entity world_editor_e =
ecs.lookup("world_editor");
assert(world_editor_e.is_valid());
assert(world_editor_e.has<
WorldEditor::components::world_editor_node>());
assert(world_editor_e.has<
WorldEditor::components::buildings_editor_node>());
assert(world_editor_e
.has<WorldEditor::components::
road_lines_editor_node>());
flecs::entity root_e =
BaseData::get_singleton()->get().lookup(
"lines");
if (!root_e.is_valid())
return;
BuildingsEditor *editor =
world_editor_e
.get<WorldEditor::components::
buildings_editor_node>()
->node;
RoadLinesEditor *rleditor =
world_editor_e
.get<WorldEditor::components::
road_lines_editor_node>()
->node;
handlers.push_back(memnew( handlers.push_back(memnew(
HandleFullPositionSetting(editor, this))); HandleFullPositionSetting(editor, this)));
handlers.push_back(memnew(MenuHandler(rleditor, this))); handlers.push_back(memnew(MenuHandler(rleditor, this)));
handlers.push_back( handlers.push_back(
memnew(HandleLinesList(rleditor, this))); memnew(HandleLinesList(rleditor, this)));
set_process(true);
} }
} break;
case NOTIFICATION_PROCESS: {
mode_visibility<Button>(0, "%buildings_delete_building"); mode_visibility<Button>(0, "%buildings_delete_building");
mode_visibility<Spatial>(2, "%building_rot_cursor"); mode_visibility<Spatial>(2, "%building_rot_cursor");
mode_visibility<Button>(3, "%buildings_create_building"); mode_visibility<Button>(3, "%buildings_create_building");