载入中...
搜索中...
未找到
SceneLoader.h
浏览该文件的文档.
Definition Module.h:43
3D bone hierarchy + bind-pose local TRS for skeletal animation. Independent of ik::Skeleton3D (FABRIK...
Definition AnimSkeleton.h:14
Definition Graphics.h:56
CPU-side decoded 3D model (Assimp scene owned via medialoader::ModelScene). Does not upload to GPU — ...
Definition ModelData.h:23
ECS mount point for one scene graph (full scene or nested subtree root). Isomorphic to eve::ui::UIHos...
Definition SceneHost.h:80
Loads a 3D scene (glTF / OBJ / FBX / GLB ... via Assimp/medialoader) into the ECS scene tree.
Definition SceneLoader.h:137
bool loadAsync(const std::string &path, const LoadOptions &options={}, std::function< void(scene::SceneHost *)> done=nullptr)
Decode path on a worker thread, then apply it on the main thread the next time pollAsync() is called ...
Definition SceneLoader.cpp:986
Module_REG(SceneLoader)
int pendingAsyncCount() const
Number of async loads still waiting to be mounted.
Definition SceneLoader.cpp:1057
static bool applyTreeDiff(scene::SceneHost *host, const scene::NodeDesc &newRoot, const SceneDiff &diff, graphics::Graphics *gfx, const MeshSlotMap *slots)
Apply a diff to the host arena in place. Creates/destroys Renderable3D for added/removed mesh objects...
Definition SceneLoader.cpp:633
std::unordered_map< const aiMesh *, graphics::Mesh * > MeshCache
Definition SceneLoader.h:220
graphics::Light3D * light(const std::string &path, int index)
Definition SceneLoader.cpp:1069
void clearPrewarm(const std::string &path)
Drop a decoded prewarm result and release its CPU scene.
Definition SceneLoader.cpp:1051
int lightCount(const std::string &path)
Number of imported Light3D entities for path; 0 if none / disabled.
Definition SceneLoader.cpp:1064
int animationCount(const std::string &path)
Number of imported animation clips for path; 0 if none / disabled.
Definition SceneLoader.cpp:1090
bool prewarmAsync(const std::string &path, const LoadOptions &options={})
Decode and retain a scene without creating ECS/GPU objects.
Definition SceneLoader.cpp:1026
scene::SceneHost * load(const std::string &path, bool linkRenderables=true, const LoadOptions &options={})
Full load: build the GameObject tree from path, mount it, return host.
Definition SceneLoader.cpp:871
std::unordered_map< std::string, CpuImage > CpuImageMap
Definition SceneLoader.h:227
SceneDiff diff(const std::string &path)
Dry-run diff for path against the currently mounted tree (no mutation).
Definition SceneLoader.cpp:921
bool reload(const std::string &path, SceneDiff *out=nullptr, const LoadOptions &options={})
Hot-reload path. Re-decodes, diffs, and applies only what changed. Returns false if the file failed t...
Definition SceneLoader.cpp:897
scene::SceneHost * host(const std::string &path)
The mounted host for path, or nullptr if not loaded.
Definition SceneLoader.cpp:952
animation::AnimSkeleton * skeleton(const std::string &path)
Imported skeleton for path (nullptr when the scene has no animations).
Definition SceneLoader.cpp:1095
animation::AnimClip * clip(const std::string &path, int index)
Definition SceneLoader.cpp:1100
static scene::NodeDesc buildNodeDesc(const aiScene *scene, MeshSlotMap *slotsOut=nullptr)
Flatten an Assimp scene into a scene::NodeDesc tree (id = object id).
Definition SceneLoader.cpp:591
bool reloadChecked(const std::string &path)
Script-friendly reload: returns true when anything was updated.
Definition SceneLoader.h:157
static void fillSceneBounds(scene::SceneHost *host, const MeshSlotMap &slots)
Fill node bounds from Assimp mesh AABBs (mesh GameObjects get the exact local-space AABB; ancestors g...
Definition SceneLoader.cpp:746
static SceneDiff diffTree(scene::SceneHost *host, const scene::NodeDesc &newRoot)
Diff a mounted host tree against a freshly built NodeDesc tree.
Definition SceneLoader.cpp:599
void unload(const std::string &path)
Drop the loaded scene for path, destroying linked Renderable3D objects.
Definition SceneLoader.cpp:964
bool prewarmed(const std::string &path) const
True when a decoded scene is ready for load() to consume.
Definition SceneLoader.cpp:1047
int nodeCount(const std::string &path)
Number of GameObjects (SceneNodes) currently mounted for path; 0 if none.
Definition SceneLoader.cpp:957
int pollAsync()
Mount every decoded-but-not-applied scene. Must be called on the main / render thread....
Definition SceneLoader.cpp:1008
std::unordered_map< std::string, graphics::Texture * > TextureCache
Caches shared across the loader: textures by source key, GPU meshes per aiMesh.
Definition SceneLoader.h:219
int cameraCount(const std::string &path)
Number of imported Camera3D entities for path; 0 if none / disabled.
Definition SceneLoader.cpp:1077
Fixed-size worker pool. Owns worker std::threads; tasks run FIFO. Squirrel VM is not thread-safe — do...
Definition ThreadPool.h:24
std::unordered_map< std::string, std::vector< MeshSlot > > MeshSlotMap
Definition SceneLoader.h:87
Definition Build.cpp:11
@ Loaded
Declarative scene-node description (build once / on dirty → flatten into SceneHost::Tree)....
Definition NodeDesc.h:15
Options controlling how a 3D scene file is decoded and mounted.
Definition SceneLoader.h:99
bool mipmaps
Generate mipmaps + anisotropic filtering for imported textures.
Definition SceneLoader.h:108
bool sharedMeshes
Reuse one GPU mesh when several nodes reference the same aiMesh.
Definition SceneLoader.h:106
bool generateNormalsIfMissing
Definition SceneLoader.h:101
bool importAnimations
Import aiAnimation clips (skeleton + clips exposed via accessors).
Definition SceneLoader.h:114
bool improveCacheLocality
Definition SceneLoader.h:104
bool importCameras
Import aiCamera entries as inactive graphics::Camera3D entities.
Definition SceneLoader.h:112
bool joinIdenticalVertices
Definition SceneLoader.h:102
A GPU mesh reference for one Assimp mesh referenced by an aiNode. The loader uploads one Renderable3D...
Definition SceneLoader.h:82
Definition SceneLoader.h:65
std::vector< SceneDiffEntry > entries
Definition SceneLoader.h:66
CPU-decoded texture (RGBA8) keyed by the same source+suffix key as TextureCache.
Definition SceneLoader.h:222
std::vector< uint8_t > rgba
Definition SceneLoader.h:225