Unravel Engine C++ Reference
|
Provides default initialization and creation functions for various entities and assets. More...
#include <defaults.h>
Public Member Functions | |
template<> | |
void | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< material > &asset, const usize32_t &size) |
template<> | |
void | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< prefab > &asset, const usize32_t &size) |
template<> | |
void | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< mesh > &asset, const usize32_t &size) |
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 void | create_default_3d_scene (rtti::context &ctx, scene &scn) |
Creates a default 3D scene. | |
static void | focus_camera_on_entities (entt::handle camera, const std::vector< entt::handle > &entities) |
Focuses a camera on a specified entity. | |
static void | focus_camera_on_entities (entt::handle camera, const std::vector< 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 void | create_default_3d_scene_for_asset_preview (rtti::context &ctx, scene &scn, const asset_handle< T > &asset, const usize32_t &size) |
Creates a default 3D scene for asset preview. | |
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 837 of file defaults.cpp.
|
static |
Calculates the bounding sphere of an entity.
entity | The entity to calculate the bounds for. |
Definition at line 854 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 581 of file defaults.cpp.
|
static |
Creates a default 3D scene.
ctx | The context for creation. |
scn | The scene to create. |
Definition at line 615 of file defaults.cpp.
void unravel::defaults::create_default_3d_scene_for_asset_preview | ( | rtti::context & | ctx, |
scene & | scn, | ||
const asset_handle< material > & | asset, | ||
const usize32_t & | size ) |
Definition at line 703 of file defaults.cpp.
void unravel::defaults::create_default_3d_scene_for_asset_preview | ( | rtti::context & | ctx, |
scene & | scn, | ||
const asset_handle< mesh > & | asset, | ||
const usize32_t & | size ) |
Definition at line 755 of file defaults.cpp.
void unravel::defaults::create_default_3d_scene_for_asset_preview | ( | rtti::context & | ctx, |
scene & | scn, | ||
const asset_handle< prefab > & | asset, | ||
const usize32_t & | size ) |
Definition at line 724 of file defaults.cpp.
|
static |
Creates a default 3D scene for asset preview.
T | The type of the asset. |
ctx | The context for creation. |
scn | The scene to create. |
asset | The asset to preview. |
size | The size of the preview. |
|
static |
Creates a default 3D scene for editing.
ctx | The context for creation. |
scn | The scene to create. |
Definition at line 635 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 422 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 527 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 512 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 483 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 446 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 468 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 455 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 559 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 604 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 597 of file defaults.cpp.
|
static |
Deinitializes default settings and assets.
ctx | The context for deinitialization. |
Definition at line 261 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 783 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 809 of file defaults.cpp.
|
static |
Initializes default settings and assets.
ctx | The context for initialization. |
Definition at line 254 of file defaults.cpp.
|
static |
Initializes default assets.
ctx | The context for initialization. |
Definition at line 290 of file defaults.cpp.