feat: add Kenney road and nature assets and implement map builder script
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
extends SceneTree
|
||||
|
||||
## Dev tool: print AABBs of prop models used by the city builder.
|
||||
|
||||
const PATHS := [
|
||||
"res://assets/props/roads/road-straight.glb",
|
||||
"res://assets/props/roads/road-crossroad-line.glb",
|
||||
"res://assets/props/roads/road-crossing.glb",
|
||||
"res://assets/props/roads/light-curved.glb",
|
||||
"res://assets/props/roads/light-curved-double.glb",
|
||||
"res://assets/props/roads/construction-barrier.glb",
|
||||
"res://assets/props/roads/construction-cone.glb",
|
||||
"res://assets/props/nature/tree_default.glb",
|
||||
"res://assets/props/nature/tree_detailed.glb",
|
||||
"res://assets/props/nature/tree_oak.glb",
|
||||
"res://assets/props/nature/tree_tall.glb",
|
||||
]
|
||||
|
||||
|
||||
func _initialize() -> void:
|
||||
for p in PATHS:
|
||||
var scene = load(p)
|
||||
if scene == null:
|
||||
print("measure: FAILED ", p)
|
||||
continue
|
||||
var inst: Node3D = scene.instantiate()
|
||||
get_root().add_child(inst)
|
||||
var aabb := AABB()
|
||||
var first := true
|
||||
for mi in inst.find_children("*", "MeshInstance3D", true, false):
|
||||
var b: AABB = mi.global_transform * mi.get_aabb()
|
||||
aabb = b if first else aabb.merge(b)
|
||||
first = false
|
||||
print("measure: %s size=%s min=%s" % [p.get_file(), aabb.size, aabb.position])
|
||||
inst.queue_free()
|
||||
quit()
|
||||
@@ -0,0 +1 @@
|
||||
uid://dd4g4l7mg66ro
|
||||
Reference in New Issue
Block a user