Api
Wiki pageBuilt-In Components
Public ECS component fields, scene JSON keys, defaults, and loader behavior.
#include <ECS/components/Transform.hpp>
#include <ECS/components/MeshRenderer.hpp>
#include <ECS/components/Rigidbody.hpp>
Scene JSON uses the same component type names as the C++ structs.
| Field | Type | Default | JSON key |
|---|
position | Position { x, y, z } | 0,0,0 | position: [x, y, z] |
rotation | Rotation { x, y, z, w } | 0,0,0,1 | rotation: [x, y, z, w] |
scale | Scale { x, y, z } | 1,1,1 | scale: [x, y, z] |
parent | EntityID | INVALID_ENTITY | numeric scene entity ID |
children | std::vector<EntityID> | empty | rebuilt by scene loader |
parent must be numeric to be resolved. Empty string parents from editor output are ignored and become INVALID_ENTITY.
| Field | Default | Loader rule |
|---|
fov | 60.0 | clamped to 1..179 |
aspectRatio | 16 / 9 | must be greater than 0 |
nearPlane | 0.1 | minimum 0.001 |
farPlane | 100.0 in struct, default factory fallback 1000.0 | at least nearPlane + 0.1 |
| Field | JSON key | Notes |
|---|
meshID | mesh | Mesh path, for example assets/monkey.obj. |
materialIDs | material | String or array of material IDs. |
enabled | enabled | Factory defaults to true. |
If no material is specified, the loader uses material names imported from the mesh. If none resolve, it falls back to basic.
| Field | JSON key | Notes |
|---|
type | type | 0 Spot, 1 Directional, 2 Point. |
color | color | [r, g, b, a], clamped 0..1. |
range | range | Minimum 0. |
| Field | Default | Loader rule |
|---|
type | SpotProjector | 0 Spot, 1 Directional, 2 Point. |
resolution | 1024 | minimum 16 |
nearPlane | 0.1 | minimum 0.001 |
farPlane | 100.0 | at least nearPlane + 0.1 |
fov | 90.0 | clamped to 1..179 |
aspectRatio | 1.0 | must be greater than 0 |
volumeExtents | 10,10,10 | [x, y, z], each minimum 0 |
Directional lights use volumeExtents for shadow volume sizing.
| Field | JSON key | Default |
|---|
animationName | animationName | empty |
time | time | 0.0 |
enabled | enabled | true |
Animation names often come from GLTF imports, for example assets/car_camera_movement.gltf_CameraAction.
| Field | Default | JSON key / rule |
|---|
type | Dynamic | "Static", "Dynamic", "Kinematic" or integer 0/1/2. |
mass | 1.0 | minimum 0. |
linearVelocity | 0,0,0 | [x, y, z]. |
drag | 0.0 | minimum 0. |
useGravity | true | boolean. |
lockRotation[3] | all false | boolean, array, or object {x,y,z}. |
lockMovement[3] | all false | boolean, array, or object {x,y,z}. |
freezeRotation | false | compatibility alias for locking all rotation axes. |
Physics bodies are created by the built-in physics system when an entity has Transform, Rigidbody, and one supported collider.
| Field | Default | Rule |
|---|
center[3] | 0,0,0 | [x, y, z] |
size[3] | 1,1,1 | each minimum 0.001 |
friction | 0.5 | minimum 0 |
restitution | 0.0 | clamped 0..1 |
isTrigger | false | boolean |
| Field | Default | Rule |
|---|
center[3] | 0,0,0 | [x, y, z] |
radius | 0.5 | minimum 0.001 |
friction | 0.5 | minimum 0 |
restitution | 0.0 | clamped 0..1 |
isTrigger | false | boolean |
| Field | Default | Rule |
|---|
center[3] | 0,0,0 | [x, y, z] |
radius | 0.5 | minimum 0.001 |
height | 2.0 | at least radius * 2 |
friction | 0.5 | minimum 0 |
restitution | 0.0 | clamped 0..1 |
isTrigger | false | boolean |
| Field | Default | Rule |
|---|
convex | false | boolean |
friction | 0.5 | minimum 0 |
restitution | 0.0 | clamped 0..1 |
isTrigger | false | boolean |
For dynamic objects, prefer primitive colliders or convex mesh colliders.
Post-processing is component-driven. A stack entity has PostProcessingSystem plus one or more effect components.
| Component | Fields |
|---|
PostProcessingSystem | enabled = true, priority = 0 |
ACES | enabled = true, exposure = 1.0 |
ColorAdjustment | enabled = false, brightness = 0, contrast = 1, saturation = 1, gamma = 1 |
Vignette | enabled = false, intensity = 0, radius = 0.75, softness = 0.45 |
ChromaticAberration | enabled = false, intensity = 0 |
FilmGrain | enabled = false, intensity = 0 |
Bloom | enabled = false, threshold = 1, intensity = 0, radius = 4, iterations = 5 |
ColorGradingLUT | enabled = false, texture = "", intensity = 1, size = 16 |
AutoExposure | enabled = false, targetLuminance = 0.18, minExposure = 0.25, maxExposure = 4, adaptationSpeed = 1 |
Loader clamps include:
| Component | Clamp |
|---|
ColorAdjustment.brightness | -1..1 |
ColorAdjustment.contrast, saturation | 0..4 |
ColorAdjustment.gamma | 0.01..8 |
Vignette.intensity | 0..1 |
Vignette.radius | 0..1.5 |
Vignette.softness | 0.001..1 |
ChromaticAberration.intensity | 0..32 |
FilmGrain.intensity | 0..1 |
Bloom.threshold | 0..10 |
Bloom.intensity | 0..4 |
Bloom.radius | 0.25..16 |
Bloom.iterations | 1..8 |
ColorGradingLUT.intensity | 0..1 |
ColorGradingLUT.size | 2..64 |
AutoExposure.targetLuminance | 0.001..1 |
AutoExposure.minExposure, maxExposure | 0.01..16, swapped if max is less than min |
AutoExposure.adaptationSpeed | 0..10 |