some greyboxing attempt
This commit is contained in:
Binary file not shown.
Binary file not shown.
39
assets/greyboxing/city_col.tscn
Normal file
39
assets/greyboxing/city_col.tscn
Normal file
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://482s38k0yv35" path="res://maps/Components/stairs.tscn" id="8_pxgdh"]
|
||||
[ext_resource type="PackedScene" uid="uid://cmfagvnymc2yr" path="res://assets/ladder/ladder.fbx" id="9_ukfuy"]
|
||||
[ext_resource type="PackedScene" uid="uid://bod7boex72igr" path="res://assets/ladder/ladder-top.fbx" id="10_wctvs"]
|
||||
[ext_resource type="PackedScene" uid="uid://b7w8cn15vsiy0" path="res://assets/greyboxing/city.blend" id="11_wctvs"]
|
||||
[ext_resource type="PackedScene" uid="uid://dyw5lds1w724m" path="res://assets/greyboxing/city_col.tscn" id="11_wctvs"]
|
||||
|
||||
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_0xm2m"]
|
||||
sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1)
|
||||
@@ -32,7 +32,7 @@ ssil_enabled = true
|
||||
[node name="Main" type="Node3D"]
|
||||
|
||||
[node name="Player" parent="." instance=ExtResource("1_2vsi6")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.7981, 101, 0.300598)
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.7981, 116.718, 0.300598)
|
||||
|
||||
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
|
||||
environment = SubResource("Environment_1bvp3")
|
||||
@@ -48,7 +48,6 @@ visible = false
|
||||
|
||||
[node name="Greybox" type="CSGCombiner3D" parent="."]
|
||||
transform = Transform3D(0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 0, 0, 0)
|
||||
visible = false
|
||||
use_collision = true
|
||||
collision_layer = 3
|
||||
collision_mask = 5
|
||||
@@ -60,6 +59,7 @@ size = Vector3(398.5, 1, 288.5)
|
||||
material = ExtResource("3_cieeo")
|
||||
|
||||
[node name="GuardTower" type="CSGCombiner3D" parent="Greybox"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -83.7691, 0, 0.750248)
|
||||
|
||||
[node name="CSGBox3D6" type="CSGBox3D" parent="Greybox/GuardTower"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 45.75, 0)
|
||||
@@ -1186,3 +1186,4 @@ transform = Transform3D(0, -8, -3.49691e-08, 0, -3.49691e-07, 0.8, -8, 0, 0, 13.
|
||||
texture = ExtResource("3_ruo5i")
|
||||
|
||||
[node name="city" parent="." instance=ExtResource("11_wctvs")]
|
||||
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 0, 0)
|
||||
|
||||
32
tools/generate_collisions.gd
Normal file
32
tools/generate_collisions.gd
Normal file
@@ -0,0 +1,32 @@
|
||||
@tool
|
||||
extends Node3D
|
||||
|
||||
@export_tool_button("Clear collisions", "Callable") var clear_col_action = clear_collisions
|
||||
@export_tool_button("Generate collisions", "Callable") var generate_col_action = generate_collisions
|
||||
|
||||
func get_all_children_of_type(node, type) -> Array:
|
||||
var nodes : Array = []
|
||||
for child in node.get_children():
|
||||
if is_instance_of(child, type):
|
||||
nodes.append(child)
|
||||
if child.get_child_count() > 0:
|
||||
nodes.append_array(get_all_children_of_type(child, type))
|
||||
return nodes
|
||||
|
||||
func clear_collisions_on_meshes(meshes: Array):
|
||||
for mesh_instance: MeshInstance3D in meshes:
|
||||
for child in mesh_instance.get_children():
|
||||
child.queue_free()
|
||||
|
||||
func generate_collisions_on_meshes(meshes: Array):
|
||||
for mesh_instance: MeshInstance3D in meshes:
|
||||
mesh_instance.create_trimesh_collision()
|
||||
|
||||
func generate_collisions():
|
||||
var mesh_instances = get_all_children_of_type(self, MeshInstance3D)
|
||||
clear_collisions_on_meshes(mesh_instances)
|
||||
generate_collisions_on_meshes(mesh_instances)
|
||||
|
||||
func clear_collisions():
|
||||
var mesh_instances = get_all_children_of_type(self, MeshInstance3D)
|
||||
clear_collisions_on_meshes(mesh_instances)
|
||||
1
tools/generate_collisions.gd.uid
Normal file
1
tools/generate_collisions.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://do8vihuwc4iib
|
||||
Reference in New Issue
Block a user