|
Unravel Engine C++ Reference
|
Provides default initialization and creation functions for various entities and assets. More...
#include <defaults.h>
Classes | |
| struct | asset_preview_result |
| Creates a default 3D scene for asset preview. More... | |
Public Types | |
| enum class | scene_preset { low , medium , high , showcase } |
| Quality presets for new scene creation (low = less expensive, high = more expensive). More... | |
Public Member Functions | |
| template<> | |
| auto | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< material > &asset, const usize32_t &size, bool focus_camera) -> asset_preview_result |
| template<> | |
| auto | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< prefab > &asset, const usize32_t &size, bool focus_camera) -> asset_preview_result |
| template<> | |
| auto | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< mesh > &asset, const usize32_t &size, bool focus_camera) -> asset_preview_result |
Static Public Member Functions | |
| static auto | init (rtti::context &ctx) -> bool |
| Initializes default settings and assets. | |
| static auto | deinit (rtti::context &ctx) -> bool |
| Deinitializes default settings and assets. | |
| static auto | init_assets (rtti::context &ctx) -> bool |
| Initializes default assets. | |
| static auto | create_embedded_mesh_entity (rtti::context &ctx, scene &scn, const std::string &name) -> entt::handle |
| Creates an embedded mesh entity. | |
| static auto | create_prefab_at (rtti::context &ctx, scene &scn, const std::string &key, const camera &cam, math::vec2 pos, bool align_to_surface=false) -> entt::handle |
| Creates a prefab entity at a specified position. | |
| static auto | create_prefab_at (rtti::context &ctx, scene &scn, const std::string &key, math::vec3 pos) -> entt::handle |
| Creates a prefab entity at a specified position. | |
| static auto | create_prefab_at (rtti::context &ctx, scene &scn, const std::string &key) -> entt::handle |
| Creates a prefab entity. | |
| static auto | create_mesh_entity_at (rtti::context &ctx, scene &scn, const std::string &key, const camera &cam, math::vec2 pos, bool align_to_surface=false) -> entt::handle |
| Creates a mesh entity at a specified position. | |
| static auto | create_mesh_entity_at (rtti::context &ctx, scene &scn, const std::string &key, math::vec3 pos={0.0f, 0.0f, 0.0f}) -> entt::handle |
| Creates a mesh entity at a specified position. | |
| static auto | create_terrain (rtti::context &ctx, scene &scn, math::vec3 pos={0.0f, 0.0f, 0.0f}) -> entt::handle |
| Creates a test heightfield terrain entity (embedded procedural mesh). | |
| static auto | create_light_entity (rtti::context &ctx, scene &scn, light_type type, const std::string &name) -> entt::handle |
| Creates a light entity. | |
| static auto | create_reflection_probe_entity (rtti::context &ctx, scene &scn, probe_type type, const std::string &name) -> entt::handle |
| Creates a reflection probe entity. | |
| static auto | create_camera_entity (rtti::context &ctx, scene &scn, const std::string &name) -> entt::handle |
| Creates a camera entity. | |
| static auto | create_volume_entity (rtti::context &ctx, scene &scn, const std::string &name, volume_mode mode=volume_mode::local) -> entt::handle |
| Creates a post process volume entity. | |
| static auto | create_ui_document_entity (rtti::context &ctx, scene &scn, const std::string &name) -> entt::handle |
| Creates a UI document entity. | |
| static auto | create_text_entity (rtti::context &ctx, scene &scn, const std::string &name) -> entt::handle |
| Creates a text entity. | |
| static auto | create_particle_emitter_entity (rtti::context &ctx, scene &scn, const std::string &name) -> entt::handle |
| Creates a particle emitter entity. | |
| static auto | create_audio_source_entity (rtti::context &ctx, scene &scn, const std::string &name) -> entt::handle |
| Creates a audio source entity. | |
| static auto | parse_scene_preset (hpp::string_view value, scene_preset &out) -> bool |
| Parse a preset name (low|medium|high|showcase; aliases: standard/default -> medium). Empty string resolves to medium. | |
| static auto | scene_preset_to_string (scene_preset preset) -> const char * |
| Stable string for logging / MCP / UI ("low", "medium", "high", "showcase"). | |
| static void | create_default_3d_scene (rtti::context &ctx, scene &scn) |
| Creates a default 3D scene. | |
| static void | create_scene_from_preset (rtti::context &ctx, scene &scn, scene_preset preset) |
| Creates a 3D scene from a quality preset. | |
| static void | focus_camera_on_entities (entt::handle camera, hpp::span< const entt::handle > entities, float duration=0.0f) |
| Focuses a camera on a specified entity with a timed transition. | |
| static void | focus_camera_on_bounds (entt::handle camera, const math::bsphere &bounds, float duration=0.0f) |
| Focuses a camera on bounds with a timed transition. | |
| static void | focus_camera_on_bounds (entt::handle camera, const math::bbox &bounds, float duration=0.0f) |
| Focuses a camera on bounds with a timed transition. | |
| template<typename T > | |
| static auto | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< T > &asset, const usize32_t &size, bool focus_camera=true) -> asset_preview_result |
| template<typename T > | |
| static void | focus_camera_on_3d_scene_for_asset_preview (rtti::context &ctx, const asset_preview_result &result) |
| static void | create_default_3d_scene_for_editing (rtti::context &ctx, scene &scn) |
| Creates a default 3D scene for editing. | |
| static auto | calc_bounds_global (entt::handle entity, int depth=-1) -> math::bbox |
| Calculates the bounding box of an entity. | |
| static auto | calc_bounds_sphere_global (entt::handle entity, bool use_bbox_diagonal=true) -> math::bsphere |
| Calculates the bounding sphere of an entity. | |
| template<> | |
| void | focus_camera_on_3d_scene_for_asset_preview (rtti::context &ctx, const asset_preview_result &result) |
| template<> | |
| void | focus_camera_on_3d_scene_for_asset_preview (rtti::context &ctx, const asset_preview_result &result) |
| template<> | |
| void | focus_camera_on_3d_scene_for_asset_preview (rtti::context &ctx, const asset_preview_result &result) |
Provides default initialization and creation functions for various entities and assets.
Definition at line 25 of file defaults.h.
|
strong |
Quality presets for new scene creation (low = less expensive, high = more expensive).
| Enumerator | |
|---|---|
| low | |
| medium | |
| high | |
| showcase | |
Definition at line 214 of file defaults.h.
|
static |
Calculates the bounding box of an entity.
| entity | The entity to calculate the bounds for. |
Definition at line 1427 of file defaults.cpp.
|
static |
Calculates the bounding sphere of an entity.
| entity | The entity to calculate the bounds for. |
Definition at line 1444 of file defaults.cpp.
|
static |
Creates a audio source entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the audio source entity. |
Definition at line 1036 of file defaults.cpp.
|
static |
Creates a camera entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the camera entity. |
Definition at line 999 of file defaults.cpp.
|
static |
Creates a default 3D scene.
| ctx | The context for creation. |
| scn | The scene to create. |
Definition at line 1084 of file defaults.cpp.
| auto unravel::defaults::create_default_3d_scene_for_asset_preview | ( | rtti::context & | ctx, |
| scene & | scn, | ||
| const asset_handle< material > & | asset, | ||
| const usize32_t & | size, | ||
| bool | focus_camera ) -> asset_preview_result |
Definition at line 1301 of file defaults.cpp.
| auto unravel::defaults::create_default_3d_scene_for_asset_preview | ( | rtti::context & | ctx, |
| scene & | scn, | ||
| const asset_handle< mesh > & | asset, | ||
| const usize32_t & | size, | ||
| bool | focus_camera ) -> asset_preview_result |
Definition at line 1366 of file defaults.cpp.
| auto unravel::defaults::create_default_3d_scene_for_asset_preview | ( | rtti::context & | ctx, |
| scene & | scn, | ||
| const asset_handle< prefab > & | asset, | ||
| const usize32_t & | size, | ||
| bool | focus_camera ) -> asset_preview_result |
Definition at line 1329 of file defaults.cpp.
|
static |
|
static |
Creates a default 3D scene for editing.
| ctx | The context for creation. |
| scn | The scene to create. |
Definition at line 1205 of file defaults.cpp.
|
static |
Creates an embedded mesh entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the entity. |
Definition at line 808 of file defaults.cpp.
|
static |
Creates a light entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| type | The type of light to create. |
| name | The name of the light entity. |
Definition at line 921 of file defaults.cpp.
|
static |
Creates a mesh entity at a specified position.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| key | The key of the mesh. |
| cam | The camera to use for positioning. |
| pos | The 2D position to place the mesh. |
| align_to_surface | When true, aligns the object to the hit surface normal (otherwise stays upright). |
Definition at line 897 of file defaults.cpp.
|
static |
Creates a mesh entity at a specified position.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| key | The key of the mesh. |
| pos | The 3D position to place the mesh. |
Definition at line 855 of file defaults.cpp.
|
static |
Creates a particle emitter entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the particle emitter entity. |
Definition at line 1029 of file defaults.cpp.
|
static |
Creates a prefab entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| key | The key of the prefab. |
Definition at line 820 of file defaults.cpp.
|
static |
Creates a prefab entity at a specified position.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| key | The key of the prefab. |
| cam | The camera to use for positioning. |
| pos | The 2D position to place the prefab. |
| align_to_surface | When true, aligns the object to the hit surface normal (otherwise stays upright). |
Definition at line 842 of file defaults.cpp.
|
static |
Creates a prefab entity at a specified position.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| key | The key of the prefab. |
| pos | The 3D position to place the prefab. |
Definition at line 829 of file defaults.cpp.
|
static |
Creates a reflection probe entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| type | The type of reflection probe to create. |
| name | The name of the reflection probe entity. |
Definition at line 947 of file defaults.cpp.
|
static |
Creates a 3D scene from a quality preset.
| ctx | The context for creation. |
| scn | The scene to create. |
| preset | The quality preset (low/medium/high). |
Definition at line 1089 of file defaults.cpp.
|
static |
Creates a test heightfield terrain entity (embedded procedural mesh).
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| pos | World position of the terrain origin. |
Definition at line 910 of file defaults.cpp.
|
static |
Creates a text entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the text entity. |
Definition at line 1019 of file defaults.cpp.
|
static |
Creates a UI document entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the UI document entity. |
Definition at line 1012 of file defaults.cpp.
|
static |
Creates a post process volume entity.
| ctx | The context for creation. |
| scn | The scene to create the entity in. |
| name | The name of the post process volume entity. |
Definition at line 968 of file defaults.cpp.
|
static |
Deinitializes default settings and assets.
| ctx | The context for deinitialization. |
Definition at line 603 of file defaults.cpp.
|
static |
Definition at line 1268 of file defaults.cpp.
|
static |
Definition at line 1275 of file defaults.cpp.
|
static |
Definition at line 1288 of file defaults.cpp.
|
static |
|
static |
Focuses a camera on bounds with a timed transition.
| camera | The camera to focus. |
| bounds | The bounding box to focus on. |
| duration | The duration of the transition in seconds. |
| ease_func | The easing function to apply (default is smooth_start_stop). |
Definition at line 802 of file defaults.cpp.
|
static |
Focuses a camera on bounds with a timed transition.
| camera | The camera to focus. |
| bounds | The bounding sphere to focus on. |
| duration | The duration of the transition in seconds. |
| ease_func | The easing function to apply (default is smooth_start_stop). |
Definition at line 797 of file defaults.cpp.
|
static |
Focuses a camera on a specified entity with a timed transition.
| camera | The camera to focus. |
| entities | The entities to focus on. |
| duration | The duration of the transition in seconds. |
Definition at line 1399 of file defaults.cpp.
|
static |
Initializes default settings and assets.
| ctx | The context for initialization. |
Definition at line 596 of file defaults.cpp.
|
static |
Initializes default assets.
| ctx | The context for initialization. |
Definition at line 633 of file defaults.cpp.
|
static |
Parse a preset name (low|medium|high|showcase; aliases: standard/default -> medium). Empty string resolves to medium.
Definition at line 1043 of file defaults.cpp.
|
static |
Stable string for logging / MCP / UI ("low", "medium", "high", "showcase").
Definition at line 1068 of file defaults.cpp.