28 std::vector<entt::meta_any>
objects{entt::meta_any{}};
115 void unselect(
bool clear_selection_tools = true);
147 if(is_selected_impl(
entry,
object))
160 return selected && selected.type() == entt::resolve<T>();
193 if(active.type() == entt::resolve<T>())
195 return &active.cast<T&>();
205 if(active.type() == entt::resolve<T>())
207 return &active.cast<T&>();
216 std::vector<T*> result;
220 if(obj.type() == entt::resolve<T>())
222 result.emplace_back(&obj.cast<T&>());
232 std::vector<T*> result;
236 if(obj.type() == entt::resolve<T>())
238 result.emplace_back(&obj.cast<T&>());
248 std::vector<T> result;
252 if(obj.type() == entt::resolve<T>())
254 result.emplace_back(obj.cast<T>());
266 if(
focused.type() != entt::resolve<T>())
284 if(
focused.type() != entt::resolve<fs::path>())
296 if(
focused.type() == entt::resolve<T>())
310 return is_selected_impl(entry, el);
312 sanity_check_selection_data();
379 sanity_check_selection_data();
396 void do_action(
const std::string&
name,
const std::function<
void()>& action);
399 void do_action(
const std::string&
name,
const std::function<
void()>&
do_action,
const std::function<
void()>& undo_action);
402 void do_action(
const std::string&
name, std::shared_ptr<editing_action_t> action);
404 template<
typename ActionType,
typename... Args>
407 auto action = std::make_shared<ActionType>(std::forward<Args>(args)...);
411 void queue_action(
const std::string&
name,
const std::function<
void()>& action);
414 void queue_action(
const std::string&
name,
const std::function<
void()>&
do_action,
const std::function<
void()>& undo_action);
417 void queue_action(
const std::string&
name, std::shared_ptr<editing_action_t> action);
419 template<
typename ActionType,
typename... Args>
422 auto action = std::make_shared<ActionType>(std::forward<Args>(args)...);
426 void add_action(
const std::string&
name, std::shared_ptr<editing_action_t> action,
bool immediate =
true);
469 ImGuizmo::MODE
mode = ImGuizmo::LOCAL;
497 auto is_selected_impl(
const T&
entry,
const entt::meta_any& selected) ->
bool
499 if(selected.type() != entt::resolve<T>())
504 return selected.cast<
const T&>() ==
entry;
507 void sanity_check_selection_data()
516 scene* scn =
nullptr;
517 std::stringstream cache;
521 struct selection_cache
523 std::vector<hpp::uuid> uids;
526 std::map<std::string, scene_cache> caches_;
527 selection_cache selection_cache_;
530 void load_checkpoint(
rtti::context& ctx, scene_cache&
cache,
bool recover_selection =
false);
532 std::shared_ptr<int> sentinel_ = std::make_shared<int>(0);
534 bool waiting_for_compilation_before_play_{};
535 bool has_unsaved_changes_;
539 auto prompt_save_changes(
rtti::context& ctx,
const std::function<
void()>& on_save,
const std::function<
void()>& on_continue) -> bool;
std::chrono::duration< float > delta_t
path resolve_protocol(const path &_path)
Given the specified path/filename, resolve the final full filename. This will be based on either the ...
Represents a handle to an asset, providing access and management functions.
std::vector< entt::meta_any > objects
math::vec3 translation_snap
float rotation_degree_snap
auto has_pending_actions() const -> bool
auto is_prefab_mode() const -> bool
auto get_active_scene(rtti::context &ctx) -> scene *
auto get_selections() const -> hpp::span< const entt::meta_any >
auto try_get_active_selection_as() -> T *
bool show_grid
enable editor grid
void on_play_after_end(rtti::context &ctx)
auto is_focused(const T &entry) -> bool
auto try_get_selections_as() const -> std::vector< const T * >
auto get_select_mode() const -> select_mode
bool wireframe_selection
enable wireframe selection
ImGuizmo::OPERATION operation
current manipulation gizmo operation.
void push_undo_stack_enabled(bool enabled)
void unselect(const T &entry)
ImGuizmo::MODE mode
current manipulation gizmo space.
void queue_action(const std::string &name, Args &&... args)
void focus_path(const fs::path &object)
auto get_selections() -> hpp::span< entt::meta_any >
void pop_undo_stack_enabled()
auto init(rtti::context &ctx) -> bool
billboard_gizmos billboard_data
void on_play_before_begin(rtti::context &ctx)
auto can_undo() const -> bool
void on_frame_update(rtti::context &ctx, delta_t)
void on_script_recompile(rtti::context &ctx, const std::string &protocol, uint64_t version)
auto is_selected_type() -> bool
auto has_unsaved_changes() const -> bool
auto is_selected(const T &entry) -> bool
auto get_active_selection() const -> const entt::meta_any &
std::vector< std::shared_ptr< editing_action_t > > pending_actions
auto get_active_selection_as() const -> const T &
entt::handle prefab_entity
auto can_redo() const -> bool
void try_unselect()
Clears the selection data if it maches the type.
bool show_icon_gizmos
enable editor icon gizmos
auto try_get_active_focus_as() const -> const T *
void sync_prefab_entity(rtti::context &ctx, entt::handle entity, const asset_handle< prefab > &pfb)
void clear_unsaved_changes()
selection selection_data
selection data containing selected object
void queue_action(const std::string &name, const std::function< void()> &action)
auto try_get_active_selection_as() const -> const T *
void do_action(const std::string &name, const std::function< void()> &action)
auto get_active_selection() -> entt::meta_any &
auto try_get_selections_as_copy() const -> std::vector< T >
void sync_prefab_instances(rtti::context &ctx, scene *scn)
void on_prefab_updated(const asset_handle< prefab > &pfb)
auto try_get_selections_as() -> std::vector< T * >
void enter_prefab_mode(rtti::context &ctx, const asset_handle< prefab > &prefab, bool auto_save=false)
std::stack< bool > undo_stack_enabled
void do_action(const std::string &name, Args &&... args)
void select(const T &entry, select_mode mode=select_mode::normal)
auto deinit(rtti::context &ctx) -> bool
void add_action(const std::string &name, std::shared_ptr< editing_action_t > action, bool immediate=true)
void focus(entt::meta_any object)
Selects an object. Can be anything.
auto get_pending_actions_count() const -> size_t
auto is_focused(const asset_handle< T > &entry) -> bool
void exit_prefab_mode(rtti::context &ctx, save_option save_changes=save_option::prompt)
inverse_kinematics ik_data
undo_redo_stack undo_stack
void save_prefab_changes(rtti::context &ctx)
editing_mode current_mode
asset_handle< prefab > edited_prefab
snap snap_data
snap data containging various snap options
void unselect(bool clear_selection_tools=true)
Clears the selection data.
Represents a generic prefab with a buffer for serialized data.
Represents a scene in the ACE framework, managing entities and their relationships.
auto can_undo() const -> bool
auto can_redo() const -> bool