temporarily disable UnprojectTexture

This commit is contained in:
Nick Fisher
2024-11-02 10:17:18 +08:00
parent 902f67e97d
commit 124938dbc2
7 changed files with 396 additions and 350 deletions

View File

@@ -3,13 +3,16 @@
#include <stddef.h>
#include <filament/Engine.h>
#include <filament/Frustum.h>
#include <filament/VertexBuffer.h>
#include <filament/IndexBuffer.h>
#include <filament/TransformManager.h>
#include <filament/Texture.h>
#include <filament/RenderableManager.h>
#include <filament/Viewport.h>
#include <filament/Frustum.h>
#include <utils/Entity.h>
#include <utils/EntityManager.h>
namespace thermion
{
@@ -32,9 +35,13 @@ public:
Engine* engine);
~CustomGeometry();
VertexBuffer* vertexBuffer() const;
IndexBuffer* indexBuffer() const;
Box getBoundingBox() const;
utils::Entity createInstance(MaterialInstance *materialInstance);
private:
Engine* _engine;
VertexBuffer* vertexBuffer;
IndexBuffer* indexBuffer;
float* vertices = nullptr;
float* normals = nullptr;
@@ -45,11 +52,6 @@ public:
Box boundingBox;
RenderableManager::PrimitiveType primitiveType;
private:
Engine* _engine;
bool _vertexBufferFreed = false;
bool _indexBufferFreed = false;
void computeBoundingBox();
};

View File

@@ -230,7 +230,12 @@ namespace thermion
/// @param out a pointer large enough to store four floats (the min/max coordinates of the bounding box)
/// @return
///
Aabb2 getBoundingBox(View* view, EntityId entity);
Aabb2 getScreenSpaceBoundingBox(View* view, EntityId entity);
/// @brief returns the 3D bounding box of the renderable instance for the given entity.
/// @return the bounding box
///
Aabb3 getRenderableBoundingBox(EntityId entity);
///
/// Creates an entity with the specified geometry/material/normals and adds to the scene.
@@ -256,11 +261,15 @@ namespace thermion
return _unlitMaterialProvider;
}
bool isGeometryInstance(EntityId entity) {
return std::find(_geometryInstances.begin(), _geometryInstances.end(), entity) != _geometryInstances.end();
}
bool isGeometryEntity(EntityId entity) {
return _geometry.find(entity) != _geometry.end();
}
const CustomGeometry* const getGeometry(EntityId entityId) {
CustomGeometry* const getGeometry(EntityId entityId) {
return _geometry[entityId].get();
}
@@ -336,6 +345,7 @@ namespace thermion
_instances;
tsl::robin_map<EntityId, gltfio::FilamentAsset *> _assets;
tsl::robin_map<EntityId, unique_ptr<CustomGeometry>> _geometry;
std::vector<EntityId> _geometryInstances;
tsl::robin_map<EntityId, unique_ptr<HighlightOverlay>> _highlighted;
tsl::robin_map<EntityId, math::mat4> _transformUpdates;
std::set<Texture*> _textures;