Feat: load 3D models from card definition assets on game board
Client: - Added ModelCache autoload (autoloads/ModelCache.gd) - Downloads .glb files from CDN via HTTPRequest - Disk cache: user://remote_model_cache/<sha256>.glb - Memory cache: PackedScene per URL for instant re-instantiation - Concurrent requests for same URL queue and share one download - Loads via GLTFDocument.append_from_file + generate_scene - game_screen.gd: _add_unit_mesh now looks up cardDefinitionId → ContentCache.get_definition() → finds Model3D asset URL → calls ModelCache.load_model() to async replace placeholder geometry - Placeholder (sphere/cylinder/box) shown immediately - Real model swaps in on download completion - Guards against body being freed before model arrives - Added _unit_bodies dict for O(1) body lookup - project.godot: registered ModelCache autoload Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -24,6 +24,7 @@ CollectionCache="*res://autoloads/CollectionCache.gd"
|
||||
Chat="*res://autoloads/Chat.gd"
|
||||
Settings="*res://autoloads/Settings.gd"
|
||||
Game="*res://autoloads/Game.gd"
|
||||
ModelCache="*res://autoloads/ModelCache.gd"
|
||||
|
||||
[display]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user