|
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 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) -> 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) -> 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_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_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 void | create_default_3d_scene (rtti::context &ctx, scene &scn) |
| Creates a default 3D scene. | |
| static void | focus_camera_on_entities (entt::handle camera, hpp::span< const entt::handle > entities) |
| Focuses a camera on a specified entity. | |
| static void | focus_camera_on_entities (entt::handle camera, hpp::span< const entt::handle > entities, float duration) |
| 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) |
| Focuses a camera on bounds with a timed transition. | |
| static void | focus_camera_on_bounds (entt::handle camera, const math::bbox &bounds, float duration) |
| 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 |
| 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. | |
Provides default initialization and creation functions for various entities and assets.
Definition at line 22 of file defaults.h.
|
static |
Calculates the bounding box of an entity.
| entity | The entity to calculate the bounds for. |
Definition at line 876 of file defaults.cpp.
|
static |
Calculates the bounding sphere of an entity.
| entity | The entity to calculate the bounds for. |
Definition at line 893 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 632 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 592 of file defaults.cpp.
|
static |
Creates a default 3D scene.
| ctx | The context for creation. |
| scn | The scene to create. |
Definition at line 639 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 727 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 790 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 754 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 659 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 433 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 538 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. |
Definition at line 523 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 494 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 625 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 457 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. |
Definition at line 479 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 466 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 570 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 615 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 608 of file defaults.cpp.
|
static |
Deinitializes default settings and assets.
| ctx | The context for deinitialization. |
Definition at line 272 of file defaults.cpp.
|
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). |
|
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). |
|
static |
Focuses a camera on a specified entity.
| camera | The camera to focus. |
| entity | The entity to focus on. |
Definition at line 822 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 848 of file defaults.cpp.
|
static |
Initializes default settings and assets.
| ctx | The context for initialization. |
Definition at line 265 of file defaults.cpp.
|
static |
Initializes default assets.
| ctx | The context for initialization. |
Definition at line 301 of file defaults.cpp.