feature!:
This is a breaking change needed to fully implement instancing and stencil highlighting.
Previously, users would work directly with entities (on the Dart side, ThermionEntity), e.g.
final entity = await viewer.loadGlb("some.glb");
However, Filament "entities" are a lower-level abstraction.
Loading a glTF file, for example, inserts multiple entities into the scene.
For example, each mesh, light, and camera within a glTF asset will be assigned an entity. A top-level (non-renderable) entity will also be created for the glTF asset, which can be used to transform the entire hierarchy.
"Asset" is a better representation for loading/inserting objects into the scene; think of this as a bundle of entities.
Unless you need to work directly with transforms, instancing, materials and renderables, you can work directly with ThermionAsset.
This commit is contained in:
20
thermion_dart/native/src/c_api/TNameComponentManager.cpp
Normal file
20
thermion_dart/native/src/c_api/TNameComponentManager.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <utils/NameComponentManager.h>
|
||||
|
||||
#include "c_api/APIExport.h"
|
||||
#include "c_api/APIBoundaryTypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
EMSCRIPTEN_KEEPALIVE const char *NameComponentManager_getName(TNameComponentManager *tNameComponentManager, EntityId entity)
|
||||
{
|
||||
auto ncm = reinterpret_cast<utils::NameComponentManager *>(tNameComponentManager);
|
||||
auto instance = ncm->getInstance(utils::Entity::import(entity));
|
||||
return ncm->getName(instance);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user