9#include "Engine/Asset/AssetHandles.h"
10#include "Engine/Files/AssetPath.h"
11#include "Engine/Mesh/MeshAssetRef.h"
12#include "Engine/Mesh/Vertex.h"
13#include "Engine/Renderer/RenderData.h"
14#include "Engine/Texture/ExrLoader.h"
15#include "Engine/Texture/Ktx2Loader.h"
16#include "Engine/Core/Tick.h"
17#include "entt/entt.hpp"
18#include "meshoptimizer.h"
24#include <glm/gtc/quaternion.hpp>
30class btCollisionShape;
75 std::filesystem::path
path;
102 std::optional<Engine::Assets::GltfRenderableHandle>
renderable;
137 std::future<Engine::Assets::Textures::ExrHeader>
future;
145 std::future<Engine::Assets::Textures::Ktx2TextureData>
future;
221 static void push(entt::entity entity)
230 static std::vector<entt::entity>&
get()
269 std::weak_ptr<Engine::Entities::SceneNode>
node;
342 std::vector<PrimitiveData>
data;
372 return {
static_cast<uint32_t
>(i0) |
373 (
static_cast<uint32_t
>(i1) << 8) |
374 (
static_cast<uint32_t
>(i2) << 16) };
395 std::vector<Engine::Rendering::ClusterLodData>
clusters;
396 std::vector<Engine::Rendering::ClusterGroupData>
groups;
432 std::optional<PrimitiveData>
data = std::nullopt;
503 explicit Transform(glm::vec3 position, glm::quat rotation);
669 struct RawGeometryData;
Animation clip loaded from glTF animation data.
The mesh asset stores geometry data and.
Skeleton definition loaded from glTF skin data.
A component which can be attached as many times to an actor as one wants. It makes it possible to ren...
This is the interface which is used to call a tick function on an object. Everything which should be ...
Represents a node in the scene graph, containing information about its position, rotation,...
AssetHandle< AnimationClipHandleTag > AnimationClipHandle
Handle to an animation clip.
AssetHandle< SkinHandleTag > SkinHandle
Handle to skin binding data.
Asset::Ref< Asset::MeshPath, Mesh > MeshAssetRef
Asset reference to mesh geometry loaded from a mesh asset path.
AssetHandle< GeometryMeshHandleTag > GeometryMeshHandle
Handle to non-skinned mesh geometry.
constexpr NullAssetHandle Null
Null value assignable to any typed asset handle.
AssetHandle< MaterialHandleTag > MaterialHandle
Handle to a material payload.
EnTT component data used by engine systems.
PackedTriangle UnpackedTriangle
meshopt_Meshlet Meshlet
Meshoptimizer meshlet descriptor type.
AssetLoadingStage
Tracks the current stage of asset loading in the pipeline.
@ GEOMETRY_VALIDATED
Geometry validation has completed.
@ MATERIAL_LOADED
Material data has been loaded.
@ VERTICES_ASSEMBLED
Vertex buffers have been assembled.
@ COMPLETE
Asset load completed successfully.
@ FAILED
Asset load failed. See AssetLoadingStatus::lastError.
@ PENDING
Load request is queued and no work has completed.
@ GEOMETRY_EXTRACTED
Geometry data has been extracted from the source asset.
@ METADATA_EXTRACTED
Source metadata has been extracted.
PipelineNames
Named graphics pipelines used by material selection and shader lookup.
vec3 eulr
Euler rotation in degrees for engine transform APIs.
Identifies a named mesh-like asset inside an asset file.
CPU-side material description consumed by renderer material upload code.
Tag for the active camera in the scene.
Animation playback state for an entity with a skeletal mesh.
float playbackSpeed
Playback speed multiplier.
float playbackTime
Current playback position in seconds.
Engine::Assets::AnimationClipHandle currentAnimation
Animation clip currently evaluated.
bool isLooping
Wrap playback time when the animation reaches its duration.
bool isPlaying
Advance and evaluate the animation during the animation tick.
Async glTF image load request tracked by the ECS asset pipeline.
std::filesystem::path path
Source image path.
std::future< tinygltf::Image > future
Future that resolves to decoded tinygltf image data.
Status information for asset loading pipeline.
std::string lastError
Last error message reported by the loader.
AssetLoadingStage stage
Current load pipeline stage.
Tag applied while an asset request is queued but the runtime asset is not loaded.
Bounding sphere used for culling and bounds aggregation.
float radius
Sphere radius.
glm::vec3 center
Sphere center in producer-defined space.
Camera properties for projection matrix calculation.
float fov
Vertical field of view in degrees.
float farPlane
Far clipping plane distance.
float nearPlane
Near clipping plane distance.
float aspectRatio
Projection aspect ratio, width divided by height.
Complete result of meshlet generation for all primitives of a mesh. This is returned from the backgro...
BoundingSphere meshBoundingSphere
Local-space bounds for the full mesh.
std::vector< PrimitiveMeshletResult > primitiveResults
Per-primitive results in source order.
Engine::Assets::SkinHandle skin
Skin binding for skinned meshes, or null for static meshes.
Asset::MeshPath meshPath
Mesh asset path for the completed generation job.
entt::entity meshEntity
Mesh asset ECS entity receiving the generated data.
Runtime directional light data mirrored from Components::DirectionalLight. sceneNodeEntity points to ...
uint32_t hasDirectionOverride
1 when direction overrides the scene node orientation.
float angularDiameterDegrees
Apparent sun disk diameter in degrees.
float intensity
Light intensity multiplier.
glm::vec3 color
Linear RGB light color.
uint32_t enabled
1 when the light contributes to rendering, 0 when disabled.
entt::entity sceneNodeEntity
Scene node entity used for transform-derived direction.
uint32_t castsShadows
1 when the light casts shadows.
glm::vec3 direction
Direction used when hasDirectionOverride is 1.
Async glTF model load request tracked by the ECS asset pipeline.
std::filesystem::path path
Source glTF path.
std::future< tinygltf::Model > future
Future that resolves to a parsed tinygltf model.
ECS wrapper for loaded tinygltf image data.
tinygltf::Image image
Loaded image payload.
Async KTX2 texture load request tracked by the ECS asset pipeline.
std::filesystem::path path
Source KTX2 path.
std::future< Engine::Assets::Textures::Ktx2TextureData > future
Future that resolves to KTX2 texture data.
Tag for ECS entities that provide renderer light data.
Result of LOD hierarchy generation for a mesh primitive. Contains per-cluster and per-group data for ...
UnpackedMeshletData unpackedData
GPU-ready vertex and triangle data for LOD meshlets.
MeshletData meshletData
Meshlet data for all LOD clusters.
size_t lodLevelCount
Number of generated LOD levels.
std::vector< Engine::Rendering::ClusterLodData > clusters
Per-cluster LOD records for all generated levels.
std::vector< Engine::Rendering::ClusterGroupData > groups
Cluster groups used by GPU LOD selection.
size_t baseLevelClusterCount
Number of clusters at LOD 0.
Flat diffuse color material payload.
glm::vec4 color
RGBA material color.
Material payload waiting to be registered as a material asset.
Engine::Rendering::PipelineNames type
Rendering pipeline selected for the material.
Asset::MeshPath path
Asset key for the material inside its source file.
Engine::Core::MaterialData * data
Material data owned by the pipeline until registration.
Material state for normal visualization.
bool debugMode
Enables normal-debug output for materials that read this component.
References to MeshComponents for ECS-based iteration. Multiple mesh components can share one SceneNod...
std::vector< Engine::Components::Mesh * > components
Mesh components attached to the scene node entity.
Mesh index inside a glTF scene.
uint32_t index
Index into the glTF scene mesh array.
Renderer-facing primitive collection for one mesh asset.
std::vector< Ecs::MeshPrimitive > primitives
Primitive records in source mesh order.
Ecs::BoundingSphere boundingSphere
Local-space bounds for all primitives.
Runtime mesh primitive data consumed by the renderer.
Asset::MeshPath materialPath
Material path used for pipeline and material-buffer lookup.
std::optional< PrimitiveData > data
Optimized CPU geometry.
std::optional< MeshletData > meshletData
Meshlet descriptors for mesh shaders.
Ecs::BoundingSphere boundingSphere
Local-space primitive bounds.
std::optional< LodHierarchyResult > lodHierarchy
Generated LOD hierarchy.
Engine::Assets::MaterialHandle material
Material asset handle assigned to this primitive.
std::optional< UnpackedMeshletData > unpackedData
Pre-expanded meshlet data.
ECS wrapper for one glTF mesh object.
tinygltf::Mesh mesh
Raw glTF mesh data.
Meshlet descriptors and index streams for one primitive.
std::vector< meshopt_Meshlet > meshlets
Meshoptimizer meshlet descriptors.
std::vector< uint32_t > meshletVertices
Local vertex indices referenced by each meshlet.
std::vector< uint8_t > meshletTriangles
Packed local triangle indices referenced by each meshlet.
Async glTF model load future without a path.
std::future< tinygltf::Model > future
Future that resolves to a parsed tinygltf model.
ECS wrapper for one glTF node object.
tinygltf::Node node
Raw glTF node data.
ECS wrapper for a loaded tinygltf model.
tinygltf::Model model
Loaded glTF model payload.
GPU-ready packed triangle data (matches shader layout). Stores 3 x 8-bit local indices packed into a ...
uint32_t packed
3 x 8-bit indices: (i2 << 16) | (i1 << 8) | i0
static PackedTriangle pack(uint8_t i0, uint8_t i1, uint8_t i2)
Packs three local triangle indices into one 32-bit value.
Parent entity link for component-owned ECS entities.
entt::entity parent
Entity that owns or contains this entity.
Temporary holder for raw geometry data during pipeline execution.
void * rawGeometryData
Opaque pointer owned by the active pipeline stage.
Runtime point light data mirrored from Components::PointLight. sceneNodeEntity points to the transfor...
float cullDistance
Maximum distance used by CPU/GPU culling.
float radius
Effective light radius in world units.
float intensity
Light intensity multiplier.
entt::entity sceneNodeEntity
Scene node entity used as the light position.
glm::vec3 color
Linear RGB light color.
uint32_t enabled
1 when the light contributes to rendering, 0 when disabled.
Result of primitive extraction before meshlet generation.
std::vector< Asset::MeshPath > materialPaths
Resolved material path for each primitive.
Asset::MeshPath path
Mesh asset path being loaded.
std::vector< PrimitiveData > data
CPU primitive geometry extracted from the glTF mesh.
Engine::Assets::SkinHandle skin
Skin binding for skinned meshes, or null for static meshes.
CPU geometry for one mesh primitive before renderer upload.
std::vector< uint32_t > indices
Triangle index buffer data.
std::vector< BoneVertexData > boneVertexData
Per-vertex bone weights and indices.
std::vector< Vertex > vertices
Vertex buffer data.
Result of meshlet generation for a single primitive. Used to transfer data from background thread to ...
BoundingSphere boundingSphere
Local-space bounds for the primitive.
UnpackedMeshletData unpackedData
GPU-ready expanded meshlet data generated off the main thread.
std::optional< LodHierarchyResult > lodHierarchy
Optional LOD hierarchy for large primitives.
MeshletData meshletData
Meshlet descriptors and index ranges generated for the primitive.
PrimitiveData optimizedData
Optimized primitive geometry after meshoptimizer passes.
Raw mesh geometry data extracted from a glTF file.
std::vector< uint32_t > indices
Raw triangle indices extracted from the source mesh.
std::vector< Vertex > vertices
Raw vertex data extracted from the source mesh.
Global dirty entity collector for renderer transform uploads.
static bool empty()
Checks whether any renderer transform updates are queued.
static void clear()
Removes all queued dirty entities.
static std::vector< entt::entity > & get()
Returns the mutable dirty entity list for the current frame.
static void push(entt::entity entity)
Adds an entity to the renderer transform dirty list.
static void reserveAdditional(size_t additionalEntities)
Reserve memory for entities when batch spawning to avoid reallocation.
static std::vector< entt::entity > entities
Scene node reference used to propagate transform dirty flags through children.
std::weak_ptr< Engine::Entities::SceneNode > node
Scene node represented by the ECS entity.
Physics body state for entities synchronized with Bullet.
bool isKinematic
True when the engine writes the ECS transform into Bullet each frame.
btRigidBody * rigidBody
Bullet rigid body owned by the physics component.
btCollisionShape * collisionShape
Bullet collision shape owned by the physics component.
bool isStatic
True when the body does not move during physics simulation.
Skeletal mesh data component. Similar to StaticMeshData but references skin/animation.
Engine::Assets::SkinHandle skin
Skin binding used to evaluate bone transforms.
Asset::MeshPath asset
Source mesh asset path.
Mesh component state for one static mesh reference.
Asset::MeshPath asset
Asset path used to request the mesh.
Engine::Components::Mesh * owner
Owning mesh component, or nullptr after detach.
std::optional< Engine::Assets::GltfRenderableHandle > renderable
Renderer-side glTF renderable handle after upload.
Engine::Assets::GeometryMeshHandle mesh
Geometry handle owned by the asset registry.
Engine::Assets::MeshAssetRef assetRef
Resolved mesh asset reference used by Engine::Components::Mesh.
Collection of static mesh references attached to one entity.
std::vector< StaticMeshData > meshData
Static mesh entries attached to the same entity.
Tick registration for objects that receive engine tick callbacks.
Engine::Core::ITickable * tickable
Object that receives tick callbacks.
int32_t priority
Higher priorities tick earlier.
Pre-packed GPU-ready data for a primitive's meshlets. Generated on background thread during meshlet g...
std::vector< PackedTriangle > triangles
Packed triangle indices expanded into meshlet order.
std::vector< Vertex > vertices
Vertices expanded into meshlet order for direct GPU upload.