add createGeometryWithNormals to SceneManager
This commit is contained in:
@@ -62,9 +62,10 @@ namespace thermion_filament
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MaterialInstance* _highlightMaterialInstance;
|
MaterialInstance* _highlightMaterialInstance = nullptr;
|
||||||
CustomGeometry* _newGeometry;
|
bool _isGeometryEntity = false;
|
||||||
FilamentInstance* _newInstance;
|
bool _isGltfAsset = false;
|
||||||
|
FilamentInstance* _newInstance = nullptr;
|
||||||
Entity _entity;
|
Entity _entity;
|
||||||
Engine* const _engine;
|
Engine* const _engine;
|
||||||
SceneManager* const _sceneManager;
|
SceneManager* const _sceneManager;
|
||||||
@@ -238,6 +239,23 @@ namespace thermion_filament
|
|||||||
bool keepData = false
|
bool keepData = false
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Creates an entity with the specified geometry/material/normals and adds to the scene.
|
||||||
|
/// If [keepData] is true, stores
|
||||||
|
///
|
||||||
|
EntityId createGeometryWithNormals(
|
||||||
|
float *vertices,
|
||||||
|
uint32_t numVertices,
|
||||||
|
float *normals,
|
||||||
|
uint32_t numNormals,
|
||||||
|
uint16_t *indices,
|
||||||
|
uint32_t numIndices,
|
||||||
|
filament::RenderableManager::PrimitiveType primitiveType = RenderableManager::PrimitiveType::TRIANGLES,
|
||||||
|
const char *materialPath = nullptr,
|
||||||
|
bool keepData = false
|
||||||
|
);
|
||||||
|
|
||||||
friend class FilamentViewer;
|
friend class FilamentViewer;
|
||||||
|
|
||||||
Gizmo* gizmo = nullptr;
|
Gizmo* gizmo = nullptr;
|
||||||
@@ -250,8 +268,8 @@ namespace thermion_filament
|
|||||||
return _geometry.find(entity) != _geometry.end();
|
return _geometry.find(entity) != _geometry.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomGeometry* const getGeometry(EntityId entityId) {
|
const CustomGeometry* const getGeometry(EntityId entityId) {
|
||||||
return _geometry[entityId];
|
return _geometry[entityId].get();
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene* const getScene() {
|
Scene* const getScene() {
|
||||||
@@ -282,6 +300,7 @@ namespace thermion_filament
|
|||||||
gltfio::TextureProvider *_stbDecoder = nullptr;
|
gltfio::TextureProvider *_stbDecoder = nullptr;
|
||||||
gltfio::TextureProvider *_ktxDecoder = nullptr;
|
gltfio::TextureProvider *_ktxDecoder = nullptr;
|
||||||
std::mutex _mutex;
|
std::mutex _mutex;
|
||||||
|
std::mutex _stencilMutex;
|
||||||
|
|
||||||
utils::NameComponentManager *_ncm;
|
utils::NameComponentManager *_ncm;
|
||||||
|
|
||||||
@@ -290,8 +309,8 @@ namespace thermion_filament
|
|||||||
gltfio::FilamentInstance *>
|
gltfio::FilamentInstance *>
|
||||||
_instances;
|
_instances;
|
||||||
tsl::robin_map<EntityId, gltfio::FilamentAsset *> _assets;
|
tsl::robin_map<EntityId, gltfio::FilamentAsset *> _assets;
|
||||||
tsl::robin_map<EntityId, CustomGeometry*> _geometry;
|
tsl::robin_map<EntityId, unique_ptr<CustomGeometry>> _geometry;
|
||||||
tsl::robin_map<EntityId, HighlightOverlay *> _highlighted;
|
tsl::robin_map<EntityId, unique_ptr<HighlightOverlay>> _highlighted;
|
||||||
|
|
||||||
tsl::robin_map<EntityId, std::tuple<math::float3, bool, math::quatf, bool, float>> _transformUpdates;
|
tsl::robin_map<EntityId, std::tuple<math::float3, bool, math::quatf, bool, float>> _transformUpdates;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user