Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
EcsData.h
1#pragma once
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"
19#include "tiny_gltf.h"
20
21#include <filesystem>
22#include <future>
23#include <glm/glm.hpp>
24#include <glm/gtc/quaternion.hpp>
25#include <memory>
26#include <optional>
27#include <string>
28#include <vector>
29
30class btCollisionShape;
31class btRigidBody;
32
33namespace Engine::Components
34{
35 class Mesh;
36} // namespace Engine::Components
37
38namespace Engine::Entities
39{
40 class SceneNode;
41} // namespace Engine::Entities
42
43namespace Engine::Core
44{
45 struct MaterialData;
46} // namespace Engine::Core
47
48namespace Engine::Rendering
49{
50 enum PipelineNames : int;
51} // namespace Engine::Rendering
52
53namespace Engine::Assets
54{
55 class Animation;
56 class Skin;
57 class Mesh;
58} // namespace Engine::Assets
59
60namespace glm
61{
62 typedef vec3 eulr;
63}
64
69namespace Engine::Ecs {
70
75 std::filesystem::path path;
76 std::future<tinygltf::Image> future;
77 };
78
82 struct Parent
83 {
84 entt::entity parent;
85 };
86
93 {
94 };
95
100 {
102 std::optional<Engine::Assets::GltfRenderableHandle> renderable;
103
106
109
111
112 };
113
118 {
119 std::vector<StaticMeshData> meshData;
120 };
121
129
134 std::filesystem::path path;
135
137 std::future<Engine::Assets::Textures::ExrHeader> future;
138 };
139
144 std::filesystem::path path;
145 std::future<Engine::Assets::Textures::Ktx2TextureData> future;
146 };
147
152 std::filesystem::path path;
153 std::future<tinygltf::Model> future;
154 };
155
164
168 struct ImageData {
169 tinygltf::Image image;
170 };
171
175 struct Model {
176 tinygltf::Model model;
177 };
178
183 {
184 btRigidBody* rigidBody = nullptr;
185 btCollisionShape* collisionShape = nullptr;
186 bool isKinematic = false;
187 bool isStatic = false;
188 };
189
194 {
195 };
196
203 {
204 };
205
216 {
221 static void push(entt::entity entity)
222 {
223 entities.push_back(entity);
224 }
225
230 static std::vector<entt::entity>& get()
231 {
232 return entities;
233 }
234
238 static void clear()
239 {
240 entities.clear();
241 }
242
247 static void reserveAdditional(size_t additionalEntities)
248 {
249 entities.reserve(entities.size() + additionalEntities);
250 }
251
256 static bool empty()
257 {
258 return entities.empty();
259 }
260
261 private:
262 inline static std::vector<entt::entity> entities;
263 };
264
269 std::weak_ptr<Engine::Entities::SceneNode> node;
270 };
271
277 std::vector<Engine::Components::Mesh*> components;
278 };
279
283 struct Tick
284 {
286 int32_t priority = 0;
287 };
288
293 {
294 uint32_t index;
295 };
296
300 struct Mesh
301 {
302 tinygltf::Mesh mesh;
303 };
304
309 {
310 tinygltf::Node node;
311 };
312
317 {
318 std::vector<Vertex> vertices;
319 std::vector<uint32_t> indices;
320 std::vector<BoneVertexData> boneVertexData;
321 };
322
326 using Meshlet = meshopt_Meshlet;
327
331 struct MeshletData {
332 std::vector<meshopt_Meshlet> meshlets;
333 std::vector<uint32_t> meshletVertices;
334 std::vector<uint8_t> meshletTriangles;
335 };
336
342 std::vector<PrimitiveData> data;
343 std::vector<Asset::MeshPath> materialPaths;
345 };
346
351 glm::vec3 center = { 0.0f, 0.0f, 0.0f };
352 float radius = 0.0f;
353 };
354
362 uint32_t packed;
363
371 static PackedTriangle pack(uint8_t i0, uint8_t i1, uint8_t i2) {
372 return { static_cast<uint32_t>(i0) |
373 (static_cast<uint32_t>(i1) << 8) |
374 (static_cast<uint32_t>(i2) << 16) };
375 }
376 };
377
378 // Backwards compatibility alias
380
386 std::vector<Vertex> vertices;
387 std::vector<PackedTriangle> triangles;
388 };
389
395 std::vector<Engine::Rendering::ClusterLodData> clusters;
396 std::vector<Engine::Rendering::ClusterGroupData> groups;
400 size_t lodLevelCount = 0;
401 };
402
414
427
432 std::optional<PrimitiveData> data = std::nullopt;
433 std::optional<MeshletData> meshletData = std::nullopt;
434 std::optional<UnpackedMeshletData> unpackedData = std::nullopt;
435 std::optional<LodHierarchyResult> lodHierarchy = std::nullopt;
439 };
440
445 {
446 std::vector<Ecs::MeshPrimitive> primitives;
448 };
449
454 {
455 glm::vec4 color;
456 };
457
462 {
464 };
465
469 struct ModelFuture {
470 std::future<tinygltf::Model> future;
471 };
472
476 struct Transform {
478 Transform() = default;
479
484 explicit Transform(glm::mat4 matrix);
485
490 explicit Transform(glm::vec3 position);
491
496 explicit Transform(glm::quat rotation);
497
503 explicit Transform(glm::vec3 position, glm::quat rotation);
504
511 explicit Transform(glm::vec3 position, glm::eulr rotation, glm::vec3 scale);
512
513 glm::mat4 matrix = glm::mat4(1.0f);
514
516 [[nodiscard]] glm::vec3 getPosition() const;
517
519 [[nodiscard]] glm::quat getRotation() const;
520
522 [[nodiscard]] glm::vec3 getRotationEuler() const;
523
525 [[nodiscard]] glm::vec3 getScale() const;
526
531 void setPosition(const glm::vec3& newPosition);
532
537 void setRotation(const glm::vec3& newRotation);
538
543 void setRotation(const glm::quat& newQuaternion);
544
549 void setScale(const glm::vec3& newScale);
550
555 void setFacing(const glm::vec3& newFacing);
556 };
557
562 glm::mat4 matrix = glm::mat4(1.0f);
563 };
564
569 uint32_t depth;
570 };
571
575 struct ActiveCamera { };
576
581 float fov = 60.0f;
582 float nearPlane = 0.01f;
583 float farPlane = 1000.0f;
584 float aspectRatio = 16.0f / 9.0f;
585 };
586
590 struct LightData {};
591
597 {
598 glm::vec3 color{1.0f};
599 float intensity = 1.0f;
601 uint32_t enabled = 1u;
602 uint32_t castsShadows = 1u;
603 uint32_t hasDirectionOverride = 0u;
604 glm::vec3 direction{0.0f, -1.0f, 0.0f};
605 entt::entity sceneNodeEntity = entt::null;
606 };
607
613 {
614 glm::vec3 color{1.0f};
615 float intensity = 1.0f;
616 float radius = 10.0f;
617 float cullDistance = 100.0f;
618 uint32_t enabled = 1u;
619 entt::entity sceneNodeEntity = entt::null;
620 };
621
622
623 // ============================================================================
624 // Asset Loading Pipeline Components
625 // ============================================================================
626
631 uint32_t uvCount = 0;
632 int materialIndex = -1;
633 };
634
640 struct RawMeshData {
641 std::vector<Vertex> vertices;
642 std::vector<uint32_t> indices;
643 };
644
658
666
667 // Forward declaration for pipeline
668 namespace AssetPipeline {
669 struct RawGeometryData;
670 }
671
678 // Store as void* to avoid forward declaration issues
679 // Will be cast to AssetPipeline::RawGeometryData* when used
680 void* rawGeometryData = nullptr;
681 };
682
683 // ============================================================================
684 // Skeletal Mesh Components
685 // ============================================================================
686
694
705
711
719 std::vector<glm::mat4> boneMatrices;
720 uint32_t gpuBoneMatrixOffset = 0;
721 };
722
731 struct DevicePose {
732 glm::vec3 position = glm::vec3(0.0f);
733 glm::quat orientation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f);
734 };
738 double timestamp = 0.0;
739 };
740}
Animation clip loaded from glTF animation data.
The mesh asset stores geometry data and.
Definition MeshAsset.h:20
Skeleton definition loaded from glTF skin data.
Definition SkinAsset.h:30
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 ...
Definition Tick.h:24
Represents a node in the scene graph, containing information about its position, rotation,...
Definition SceneGraph.h:27
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
Definition EcsData.h:379
meshopt_Meshlet Meshlet
Meshoptimizer meshlet descriptor type.
Definition EcsData.h:326
AssetLoadingStage
Tracks the current stage of asset loading in the pipeline.
Definition EcsData.h:648
@ GEOMETRY_VALIDATED
Geometry validation has completed.
Definition EcsData.h:652
@ MATERIAL_LOADED
Material data has been loaded.
Definition EcsData.h:651
@ VERTICES_ASSEMBLED
Vertex buffers have been assembled.
Definition EcsData.h:654
@ COMPLETE
Asset load completed successfully.
Definition EcsData.h:655
@ FAILED
Asset load failed. See AssetLoadingStatus::lastError.
Definition EcsData.h:656
@ PENDING
Load request is queued and no work has completed.
Definition EcsData.h:649
@ GEOMETRY_EXTRACTED
Geometry data has been extracted from the source asset.
Definition EcsData.h:653
@ METADATA_EXTRACTED
Source metadata has been extracted.
Definition EcsData.h:650
PipelineNames
Named graphics pipelines used by material selection and shader lookup.
Definition EcsData.h:61
vec3 eulr
Euler rotation in degrees for engine transform APIs.
Definition EcsData.h:62
Identifies a named mesh-like asset inside an asset file.
Definition AssetPath.h:89
Wrapper for EXR file header information with owned data.
Definition ExrLoader.h:28
CPU-side material description consumed by renderer material upload code.
Tag for the active camera in the scene.
Definition EcsData.h:575
Animation playback state for an entity with a skeletal mesh.
Definition EcsData.h:698
float playbackSpeed
Playback speed multiplier.
Definition EcsData.h:701
float playbackTime
Current playback position in seconds.
Definition EcsData.h:700
Engine::Assets::AnimationClipHandle currentAnimation
Animation clip currently evaluated.
Definition EcsData.h:699
bool isLooping
Wrap playback time when the animation reaches its duration.
Definition EcsData.h:702
bool isPlaying
Advance and evaluate the animation during the animation tick.
Definition EcsData.h:703
Async glTF image load request tracked by the ECS asset pipeline.
Definition EcsData.h:74
std::filesystem::path path
Source image path.
Definition EcsData.h:75
std::future< tinygltf::Image > future
Future that resolves to decoded tinygltf image data.
Definition EcsData.h:76
Status information for asset loading pipeline.
Definition EcsData.h:662
std::string lastError
Last error message reported by the loader.
Definition EcsData.h:664
AssetLoadingStage stage
Current load pipeline stage.
Definition EcsData.h:663
Tag applied while an asset request is queued but the runtime asset is not loaded.
Definition EcsData.h:93
Tag component indicating bone transforms need GPU upload. Analogous to TransformDirty for world trans...
Definition EcsData.h:710
Bounding sphere used for culling and bounds aggregation.
Definition EcsData.h:350
float radius
Sphere radius.
Definition EcsData.h:352
glm::vec3 center
Sphere center in producer-defined space.
Definition EcsData.h:351
Camera properties for projection matrix calculation.
Definition EcsData.h:580
float fov
Vertical field of view in degrees.
Definition EcsData.h:581
float farPlane
Far clipping plane distance.
Definition EcsData.h:583
float nearPlane
Near clipping plane distance.
Definition EcsData.h:582
float aspectRatio
Projection aspect ratio, width divided by height.
Definition EcsData.h:584
Complete result of meshlet generation for all primitives of a mesh. This is returned from the backgro...
Definition EcsData.h:420
BoundingSphere meshBoundingSphere
Local-space bounds for the full mesh.
Definition EcsData.h:424
std::vector< PrimitiveMeshletResult > primitiveResults
Per-primitive results in source order.
Definition EcsData.h:423
Engine::Assets::SkinHandle skin
Skin binding for skinned meshes, or null for static meshes.
Definition EcsData.h:425
Asset::MeshPath meshPath
Mesh asset path for the completed generation job.
Definition EcsData.h:421
entt::entity meshEntity
Mesh asset ECS entity receiving the generated data.
Definition EcsData.h:422
Stores computed bone matrices for GPU upload.
Definition EcsData.h:718
std::vector< glm::mat4 > boneMatrices
Final skinning matrices in joint order.
Definition EcsData.h:719
uint32_t gpuBoneMatrixOffset
Offset into the renderer bone matrix buffer.
Definition EcsData.h:720
Runtime directional light data mirrored from Components::DirectionalLight. sceneNodeEntity points to ...
Definition EcsData.h:597
uint32_t hasDirectionOverride
1 when direction overrides the scene node orientation.
Definition EcsData.h:603
float angularDiameterDegrees
Apparent sun disk diameter in degrees.
Definition EcsData.h:600
float intensity
Light intensity multiplier.
Definition EcsData.h:599
glm::vec3 color
Linear RGB light color.
Definition EcsData.h:598
uint32_t enabled
1 when the light contributes to rendering, 0 when disabled.
Definition EcsData.h:601
entt::entity sceneNodeEntity
Scene node entity used for transform-derived direction.
Definition EcsData.h:605
uint32_t castsShadows
1 when the light casts shadows.
Definition EcsData.h:602
glm::vec3 direction
Direction used when hasDirectionOverride is 1.
Definition EcsData.h:604
Loaded EXR header data used before full texture payload loading.
Definition EcsData.h:126
Engine::Assets::Textures::ExrHeader header
Parsed EXR header.
Definition EcsData.h:127
Async EXR header load request tracked by the ECS asset pipeline.
Definition EcsData.h:133
std::filesystem::path path
Source EXR path.
Definition EcsData.h:134
std::future< Engine::Assets::Textures::ExrHeader > future
Future that resolves to parsed EXR header metadata.
Definition EcsData.h:137
Async glTF model load request tracked by the ECS asset pipeline.
Definition EcsData.h:151
std::filesystem::path path
Source glTF path.
Definition EcsData.h:152
std::future< tinygltf::Model > future
Future that resolves to a parsed tinygltf model.
Definition EcsData.h:153
ECS wrapper for loaded tinygltf image data.
Definition EcsData.h:168
tinygltf::Image image
Loaded image payload.
Definition EcsData.h:169
Async KTX2 texture load request tracked by the ECS asset pipeline.
Definition EcsData.h:143
std::filesystem::path path
Source KTX2 path.
Definition EcsData.h:144
std::future< Engine::Assets::Textures::Ktx2TextureData > future
Future that resolves to KTX2 texture data.
Definition EcsData.h:145
Tag for ECS entities that provide renderer light data.
Definition EcsData.h:590
Result of LOD hierarchy generation for a mesh primitive. Contains per-cluster and per-group data for ...
Definition EcsData.h:394
UnpackedMeshletData unpackedData
GPU-ready vertex and triangle data for LOD meshlets.
Definition EcsData.h:398
MeshletData meshletData
Meshlet data for all LOD clusters.
Definition EcsData.h:397
size_t lodLevelCount
Number of generated LOD levels.
Definition EcsData.h:400
std::vector< Engine::Rendering::ClusterLodData > clusters
Per-cluster LOD records for all generated levels.
Definition EcsData.h:395
std::vector< Engine::Rendering::ClusterGroupData > groups
Cluster groups used by GPU LOD selection.
Definition EcsData.h:396
size_t baseLevelClusterCount
Number of clusters at LOD 0.
Definition EcsData.h:399
Flat diffuse color material payload.
Definition EcsData.h:454
glm::vec4 color
RGBA material color.
Definition EcsData.h:455
Material payload waiting to be registered as a material asset.
Definition EcsData.h:159
Engine::Rendering::PipelineNames type
Rendering pipeline selected for the material.
Definition EcsData.h:161
Asset::MeshPath path
Asset key for the material inside its source file.
Definition EcsData.h:160
Engine::Core::MaterialData * data
Material data owned by the pipeline until registration.
Definition EcsData.h:162
Material state for normal visualization.
Definition EcsData.h:462
bool debugMode
Enables normal-debug output for materials that read this component.
Definition EcsData.h:463
References to MeshComponents for ECS-based iteration. Multiple mesh components can share one SceneNod...
Definition EcsData.h:276
std::vector< Engine::Components::Mesh * > components
Mesh components attached to the scene node entity.
Definition EcsData.h:277
Mesh index inside a glTF scene.
Definition EcsData.h:293
uint32_t index
Index into the glTF scene mesh array.
Definition EcsData.h:294
Renderer-facing primitive collection for one mesh asset.
Definition EcsData.h:445
std::vector< Ecs::MeshPrimitive > primitives
Primitive records in source mesh order.
Definition EcsData.h:446
Ecs::BoundingSphere boundingSphere
Local-space bounds for all primitives.
Definition EcsData.h:447
Runtime mesh primitive data consumed by the renderer.
Definition EcsData.h:431
Asset::MeshPath materialPath
Material path used for pipeline and material-buffer lookup.
Definition EcsData.h:438
std::optional< PrimitiveData > data
Optimized CPU geometry.
Definition EcsData.h:432
std::optional< MeshletData > meshletData
Meshlet descriptors for mesh shaders.
Definition EcsData.h:433
Ecs::BoundingSphere boundingSphere
Local-space primitive bounds.
Definition EcsData.h:436
std::optional< LodHierarchyResult > lodHierarchy
Generated LOD hierarchy.
Definition EcsData.h:435
Engine::Assets::MaterialHandle material
Material asset handle assigned to this primitive.
Definition EcsData.h:437
std::optional< UnpackedMeshletData > unpackedData
Pre-expanded meshlet data.
Definition EcsData.h:434
ECS wrapper for one glTF mesh object.
Definition EcsData.h:301
tinygltf::Mesh mesh
Raw glTF mesh data.
Definition EcsData.h:302
Meshlet descriptors and index streams for one primitive.
Definition EcsData.h:331
std::vector< meshopt_Meshlet > meshlets
Meshoptimizer meshlet descriptors.
Definition EcsData.h:332
std::vector< uint32_t > meshletVertices
Local vertex indices referenced by each meshlet.
Definition EcsData.h:333
std::vector< uint8_t > meshletTriangles
Packed local triangle indices referenced by each meshlet.
Definition EcsData.h:334
Async glTF model load future without a path.
Definition EcsData.h:469
std::future< tinygltf::Model > future
Future that resolves to a parsed tinygltf model.
Definition EcsData.h:470
ECS wrapper for one glTF node object.
Definition EcsData.h:309
tinygltf::Node node
Raw glTF node data.
Definition EcsData.h:310
ECS wrapper for a loaded tinygltf model.
Definition EcsData.h:175
tinygltf::Model model
Loaded glTF model payload.
Definition EcsData.h:176
GPU-ready packed triangle data (matches shader layout). Stores 3 x 8-bit local indices packed into a ...
Definition EcsData.h:361
uint32_t packed
3 x 8-bit indices: (i2 << 16) | (i1 << 8) | i0
Definition EcsData.h:362
static PackedTriangle pack(uint8_t i0, uint8_t i1, uint8_t i2)
Packs three local triangle indices into one 32-bit value.
Definition EcsData.h:371
Parent entity link for component-owned ECS entities.
Definition EcsData.h:83
entt::entity parent
Entity that owns or contains this entity.
Definition EcsData.h:84
Temporary holder for raw geometry data during pipeline execution.
Definition EcsData.h:677
void * rawGeometryData
Opaque pointer owned by the active pipeline stage.
Definition EcsData.h:680
Runtime point light data mirrored from Components::PointLight. sceneNodeEntity points to the transfor...
Definition EcsData.h:613
float cullDistance
Maximum distance used by CPU/GPU culling.
Definition EcsData.h:617
float radius
Effective light radius in world units.
Definition EcsData.h:616
float intensity
Light intensity multiplier.
Definition EcsData.h:615
entt::entity sceneNodeEntity
Scene node entity used as the light position.
Definition EcsData.h:619
glm::vec3 color
Linear RGB light color.
Definition EcsData.h:614
uint32_t enabled
1 when the light contributes to rendering, 0 when disabled.
Definition EcsData.h:618
Result of primitive extraction before meshlet generation.
Definition EcsData.h:340
std::vector< Asset::MeshPath > materialPaths
Resolved material path for each primitive.
Definition EcsData.h:343
Asset::MeshPath path
Mesh asset path being loaded.
Definition EcsData.h:341
std::vector< PrimitiveData > data
CPU primitive geometry extracted from the glTF mesh.
Definition EcsData.h:342
Engine::Assets::SkinHandle skin
Skin binding for skinned meshes, or null for static meshes.
Definition EcsData.h:344
CPU geometry for one mesh primitive before renderer upload.
Definition EcsData.h:317
std::vector< uint32_t > indices
Triangle index buffer data.
Definition EcsData.h:319
std::vector< BoneVertexData > boneVertexData
Per-vertex bone weights and indices.
Definition EcsData.h:320
std::vector< Vertex > vertices
Vertex buffer data.
Definition EcsData.h:318
Result of meshlet generation for a single primitive. Used to transfer data from background thread to ...
Definition EcsData.h:407
BoundingSphere boundingSphere
Local-space bounds for the primitive.
Definition EcsData.h:410
UnpackedMeshletData unpackedData
GPU-ready expanded meshlet data generated off the main thread.
Definition EcsData.h:411
std::optional< LodHierarchyResult > lodHierarchy
Optional LOD hierarchy for large primitives.
Definition EcsData.h:412
MeshletData meshletData
Meshlet descriptors and index ranges generated for the primitive.
Definition EcsData.h:408
PrimitiveData optimizedData
Optimized primitive geometry after meshoptimizer passes.
Definition EcsData.h:409
Metadata about a primitive being loaded from gltf file.
Definition EcsData.h:630
uint32_t uvCount
Number of UV sets present on the primitive.
Definition EcsData.h:631
int materialIndex
glTF material index, or -1 when no material is assigned.
Definition EcsData.h:632
Raw mesh geometry data extracted from a glTF file.
Definition EcsData.h:640
std::vector< uint32_t > indices
Raw triangle indices extracted from the source mesh.
Definition EcsData.h:642
std::vector< Vertex > vertices
Raw vertex data extracted from the source mesh.
Definition EcsData.h:641
Global dirty entity collector for renderer transform uploads.
Definition EcsData.h:216
static bool empty()
Checks whether any renderer transform updates are queued.
Definition EcsData.h:256
static void clear()
Removes all queued dirty entities.
Definition EcsData.h:238
static std::vector< entt::entity > & get()
Returns the mutable dirty entity list for the current frame.
Definition EcsData.h:230
static void push(entt::entity entity)
Adds an entity to the renderer transform dirty list.
Definition EcsData.h:221
static void reserveAdditional(size_t additionalEntities)
Reserve memory for entities when batch spawning to avoid reallocation.
Definition EcsData.h:247
static std::vector< entt::entity > entities
Definition EcsData.h:262
Scene node reference used to propagate transform dirty flags through children.
Definition EcsData.h:268
std::weak_ptr< Engine::Entities::SceneNode > node
Scene node represented by the ECS entity.
Definition EcsData.h:269
Physics body state for entities synchronized with Bullet.
Definition EcsData.h:183
bool isKinematic
True when the engine writes the ECS transform into Bullet each frame.
Definition EcsData.h:186
btRigidBody * rigidBody
Bullet rigid body owned by the physics component.
Definition EcsData.h:184
btCollisionShape * collisionShape
Bullet collision shape owned by the physics component.
Definition EcsData.h:185
bool isStatic
True when the body does not move during physics simulation.
Definition EcsData.h:187
Skeletal mesh data component. Similar to StaticMeshData but references skin/animation.
Definition EcsData.h:690
Engine::Assets::SkinHandle skin
Skin binding used to evaluate bone transforms.
Definition EcsData.h:692
Asset::MeshPath asset
Source mesh asset path.
Definition EcsData.h:691
Mesh component state for one static mesh reference.
Definition EcsData.h:100
Asset::MeshPath asset
Asset path used to request the mesh.
Definition EcsData.h:105
Engine::Components::Mesh * owner
Owning mesh component, or nullptr after detach.
Definition EcsData.h:110
std::optional< Engine::Assets::GltfRenderableHandle > renderable
Renderer-side glTF renderable handle after upload.
Definition EcsData.h:102
Engine::Assets::GeometryMeshHandle mesh
Geometry handle owned by the asset registry.
Definition EcsData.h:104
Engine::Assets::MeshAssetRef assetRef
Resolved mesh asset reference used by Engine::Components::Mesh.
Definition EcsData.h:108
Collection of static mesh references attached to one entity.
Definition EcsData.h:118
std::vector< StaticMeshData > meshData
Static mesh entries attached to the same entity.
Definition EcsData.h:119
Tick registration for objects that receive engine tick callbacks.
Definition EcsData.h:284
Engine::Core::ITickable * tickable
Object that receives tick callbacks.
Definition EcsData.h:285
int32_t priority
Higher priorities tick earlier.
Definition EcsData.h:286
Depth of an entity in the transform hierarchy.
Definition EcsData.h:568
uint32_t depth
Root-relative hierarchy depth.
Definition EcsData.h:569
Legacy tag for transforms that need GPU upload.
Definition EcsData.h:203
Tag for dirty transforms (used by scene graph synchronization)
Definition EcsData.h:194
glm::quat getRotation() const
Returns the local rotation extracted from the matrix axes.
Transform(glm::vec3 position)
Creates a transform with the given position and identity rotation and scale.
glm::mat4 matrix
Column-major local transform matrix.
Definition EcsData.h:513
void setPosition(const glm::vec3 &newPosition)
Sets local position and preserves rotation and scale.
void setScale(const glm::vec3 &newScale)
Sets local scale and preserves position and rotation.
void setRotation(const glm::vec3 &newRotation)
Sets local rotation from Euler angles in degrees and preserves position and scale.
Transform(glm::mat4 matrix)
Creates a transform from a full matrix.
void setRotation(const glm::quat &newQuaternion)
Sets local rotation from a quaternion and preserves position and scale.
Transform()=default
Creates an identity transform.
void setFacing(const glm::vec3 &newFacing)
Rotates the transform so local -Z faces the given direction.
glm::vec3 getRotationEuler() const
Returns the local Euler rotation in degrees.
Transform(glm::vec3 position, glm::quat rotation)
Creates a transform with the given position and rotation.
Transform(glm::vec3 position, glm::eulr rotation, glm::vec3 scale)
Creates a transform with position, Euler rotation, and scale.
glm::vec3 getPosition() const
Returns the local position stored in the translation column.
glm::vec3 getScale() const
Returns local scale from the lengths of the basis vectors.
Transform(glm::quat rotation)
Creates a transform with the given rotation and identity position and scale.
Pre-packed GPU-ready data for a primitive's meshlets. Generated on background thread during meshlet g...
Definition EcsData.h:385
std::vector< PackedTriangle > triangles
Packed triangle indices expanded into meshlet order.
Definition EcsData.h:387
std::vector< Vertex > vertices
Vertices expanded into meshlet order for direct GPU upload.
Definition EcsData.h:386
World-space pose for a tracked XR device.
Definition EcsData.h:731
glm::vec3 position
Device position in world space.
Definition EcsData.h:732
glm::quat orientation
Device orientation in world space.
Definition EcsData.h:733
VR tracking input populated from OpenXR each frame. Used by the IK system to drive skeletal animation...
Definition EcsData.h:727
double timestamp
Source timestamp for the tracking frame.
Definition EcsData.h:738
DevicePose hmd
Head-mounted display pose.
Definition EcsData.h:735
DevicePose leftHand
Left-hand controller pose.
Definition EcsData.h:736
DevicePose rightHand
Right-hand controller pose.
Definition EcsData.h:737
Cached world transform matrix written by the scene graph.
Definition EcsData.h:561
glm::mat4 matrix
Column-major world transform matrix.
Definition EcsData.h:562