2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
2017-09-01 14:07:55 +00:00
|
|
|
/* scene_tree.h */
|
2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 12:16:55 +00:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
2021-01-01 19:13:46 +00:00
|
|
|
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
2014-02-10 01:10:30 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2018-01-04 23:50:27 +00:00
|
|
|
|
2020-09-10 14:04:30 +00:00
|
|
|
#ifndef SCENE_TREE_H
|
|
|
|
#define SCENE_TREE_H
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2021-09-03 17:40:47 +00:00
|
|
|
#include "core/multiplayer/multiplayer_api.h"
|
2018-09-11 16:13:45 +00:00
|
|
|
#include "core/os/main_loop.h"
|
|
|
|
#include "core/os/thread_safe.h"
|
2020-11-07 22:33:38 +00:00
|
|
|
#include "core/templates/self_list.h"
|
2017-06-07 21:18:55 +00:00
|
|
|
#include "scene/resources/mesh.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
#include "scene/resources/world_2d.h"
|
2020-03-27 07:44:44 +00:00
|
|
|
#include "scene/resources/world_3d.h"
|
2016-08-14 21:49:50 +00:00
|
|
|
|
2020-03-04 01:51:12 +00:00
|
|
|
#undef Window
|
|
|
|
|
2015-05-17 19:33:35 +00:00
|
|
|
class PackedScene;
|
2014-02-10 01:10:30 +00:00
|
|
|
class Node;
|
2020-03-04 01:51:12 +00:00
|
|
|
class Window;
|
2015-09-20 16:03:46 +00:00
|
|
|
class Material;
|
|
|
|
class Mesh;
|
2020-02-07 01:52:05 +00:00
|
|
|
class SceneDebugger;
|
2020-09-05 01:05:30 +00:00
|
|
|
class Tween;
|
2014-06-30 01:41:02 +00:00
|
|
|
|
2021-06-04 16:03:15 +00:00
|
|
|
class SceneTreeTimer : public RefCounted {
|
|
|
|
GDCLASS(SceneTreeTimer, RefCounted);
|
2016-08-07 00:39:50 +00:00
|
|
|
|
2021-05-21 05:23:35 +00:00
|
|
|
double time_left = 0.0;
|
2021-02-19 12:57:41 +00:00
|
|
|
bool process_always = true;
|
2021-02-26 23:37:20 +00:00
|
|
|
bool ignore_time_scale = false;
|
2017-03-05 15:44:50 +00:00
|
|
|
|
2016-08-07 00:39:50 +00:00
|
|
|
protected:
|
|
|
|
static void _bind_methods();
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
public:
|
2021-05-21 05:23:35 +00:00
|
|
|
void set_time_left(double p_time);
|
|
|
|
double get_time_left() const;
|
2016-08-07 00:39:50 +00:00
|
|
|
|
2021-02-19 12:57:41 +00:00
|
|
|
void set_process_always(bool p_process_always);
|
|
|
|
bool is_process_always();
|
2017-02-13 23:34:33 +00:00
|
|
|
|
2021-02-26 23:37:20 +00:00
|
|
|
void set_ignore_time_scale(bool p_ignore);
|
|
|
|
bool is_ignore_time_scale();
|
|
|
|
|
2019-10-19 16:45:17 +00:00
|
|
|
void release_connections();
|
|
|
|
|
2016-08-07 00:39:50 +00:00
|
|
|
SceneTreeTimer();
|
|
|
|
};
|
|
|
|
|
2014-11-06 00:20:42 +00:00
|
|
|
class SceneTree : public MainLoop {
|
2014-02-10 01:10:30 +00:00
|
|
|
_THREAD_SAFE_CLASS_
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
GDCLASS(SceneTree, MainLoop);
|
2014-04-15 01:43:44 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
public:
|
2016-10-27 14:50:26 +00:00
|
|
|
typedef void (*IdleCallback)();
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
private:
|
2014-02-10 01:10:30 +00:00
|
|
|
struct Group {
|
2017-03-05 15:44:50 +00:00
|
|
|
Vector<Node *> nodes;
|
2021-02-09 17:24:36 +00:00
|
|
|
bool changed = false;
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2020-12-11 14:54:03 +00:00
|
|
|
Window *root = nullptr;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2020-12-11 14:54:03 +00:00
|
|
|
uint64_t tree_version = 1;
|
2021-05-21 05:23:35 +00:00
|
|
|
double physics_process_time = 1.0;
|
|
|
|
double process_time = 1.0;
|
2020-12-11 14:54:03 +00:00
|
|
|
bool accept_quit = true;
|
|
|
|
bool quit_on_go_back = true;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-04-07 14:17:16 +00:00
|
|
|
#ifdef DEBUG_ENABLED
|
2020-12-11 14:54:03 +00:00
|
|
|
bool debug_collisions_hint = false;
|
|
|
|
bool debug_navigation_hint = false;
|
2017-04-07 14:17:16 +00:00
|
|
|
#endif
|
2021-02-19 12:57:41 +00:00
|
|
|
bool paused = false;
|
2020-12-11 14:54:03 +00:00
|
|
|
int root_lock = 0;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Map<StringName, Group> group_map;
|
2020-12-11 14:54:03 +00:00
|
|
|
bool _quit = false;
|
|
|
|
bool initialized = false;
|
2017-12-19 21:48:30 +00:00
|
|
|
|
2020-12-11 14:54:03 +00:00
|
|
|
StringName tree_changed_name = "tree_changed";
|
|
|
|
StringName node_added_name = "node_added";
|
|
|
|
StringName node_removed_name = "node_removed";
|
|
|
|
StringName node_renamed_name = "node_renamed";
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2020-12-11 14:54:03 +00:00
|
|
|
int64_t current_frame = 0;
|
|
|
|
int node_count = 0;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2014-10-12 05:13:22 +00:00
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
|
Node *edited_scene_root;
|
|
|
|
#endif
|
2014-02-10 01:10:30 +00:00
|
|
|
struct UGCall {
|
|
|
|
StringName group;
|
|
|
|
StringName call;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
bool operator<(const UGCall &p_with) const { return group == p_with.group ? call < p_with.call : group < p_with.group; }
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2020-12-11 14:54:03 +00:00
|
|
|
// Safety for when a node is deleted while a group is being called.
|
|
|
|
int call_lock = 0;
|
|
|
|
Set<Node *> call_skip; // Skip erased nodes.
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
List<ObjectID> delete_queue;
|
|
|
|
|
2020-03-17 06:33:00 +00:00
|
|
|
Map<UGCall, Vector<Variant>> unique_group_calls;
|
2020-12-11 14:54:03 +00:00
|
|
|
bool ugc_locked = false;
|
2014-02-10 01:10:30 +00:00
|
|
|
void _flush_ugc();
|
|
|
|
|
2018-07-02 05:30:40 +00:00
|
|
|
_FORCE_INLINE_ void _update_group_order(Group &g, bool p_use_priority = false);
|
2014-02-10 01:10:30 +00:00
|
|
|
void _update_listener();
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Array _get_nodes_in_group(const StringName &p_group);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-05-17 19:33:35 +00:00
|
|
|
Node *current_scene;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2015-09-20 16:03:46 +00:00
|
|
|
Color debug_collisions_color;
|
|
|
|
Color debug_collision_contact_color;
|
|
|
|
Color debug_navigation_color;
|
|
|
|
Color debug_navigation_disabled_color;
|
2017-06-07 21:18:55 +00:00
|
|
|
Ref<ArrayMesh> debug_contact_mesh;
|
2015-09-20 16:03:46 +00:00
|
|
|
Ref<Material> navigation_material;
|
|
|
|
Ref<Material> navigation_disabled_material;
|
|
|
|
Ref<Material> collision_material;
|
|
|
|
int collision_debug_contacts;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void _change_scene(Node *p_to);
|
2014-02-10 01:10:30 +00:00
|
|
|
//void _call_group(uint32_t p_call_flags,const StringName& p_group,const StringName& p_function,const Variant& p_arg1,const Variant& p_arg2);
|
|
|
|
|
2020-03-17 06:33:00 +00:00
|
|
|
List<Ref<SceneTreeTimer>> timers;
|
2020-09-05 01:05:30 +00:00
|
|
|
List<Ref<Tween>> tweens;
|
2016-08-07 00:39:50 +00:00
|
|
|
|
2016-08-14 21:49:50 +00:00
|
|
|
///network///
|
|
|
|
|
2018-05-08 08:51:04 +00:00
|
|
|
Ref<MultiplayerAPI> multiplayer;
|
2020-12-11 14:54:03 +00:00
|
|
|
bool multiplayer_poll = true;
|
2016-08-14 21:49:50 +00:00
|
|
|
|
2015-09-20 16:03:46 +00:00
|
|
|
static SceneTree *singleton;
|
2017-03-05 15:44:50 +00:00
|
|
|
friend class Node;
|
2016-08-14 21:49:50 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void tree_changed();
|
2017-10-19 00:30:27 +00:00
|
|
|
void node_added(Node *p_node);
|
2014-02-10 01:10:30 +00:00
|
|
|
void node_removed(Node *p_node);
|
2019-05-24 13:27:22 +00:00
|
|
|
void node_renamed(Node *p_node);
|
2020-09-05 01:05:30 +00:00
|
|
|
void process_tweens(float p_delta, bool p_physics_frame);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
Group *add_to_group(const StringName &p_group, Node *p_node);
|
|
|
|
void remove_from_group(const StringName &p_group, Node *p_node);
|
2018-07-02 05:30:40 +00:00
|
|
|
void make_group_changed(const StringName &p_group);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void _notify_group_pause(const StringName &p_group, int p_notification);
|
2020-02-19 19:27:19 +00:00
|
|
|
Variant _call_group_flags(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
|
|
|
|
Variant _call_group(const Variant **p_args, int p_argcount, Callable::CallError &r_error);
|
2017-01-14 13:03:53 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void _flush_delete_queue();
|
2020-12-11 14:54:03 +00:00
|
|
|
// Optimization.
|
2017-03-05 15:44:50 +00:00
|
|
|
friend class CanvasItem;
|
2020-03-26 21:49:16 +00:00
|
|
|
friend class Node3D;
|
2017-03-05 15:44:50 +00:00
|
|
|
friend class Viewport;
|
2014-04-10 03:18:27 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
SelfList<Node>::List xform_change_list;
|
|
|
|
|
2020-02-07 01:52:05 +00:00
|
|
|
#ifdef DEBUG_ENABLED // No live editor in release build.
|
|
|
|
friend class LiveEditor;
|
2015-08-02 15:29:37 +00:00
|
|
|
#endif
|
2016-10-27 14:50:26 +00:00
|
|
|
|
|
|
|
enum {
|
2017-03-05 15:44:50 +00:00
|
|
|
MAX_IDLE_CALLBACKS = 256
|
2016-10-27 14:50:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static IdleCallback idle_callbacks[MAX_IDLE_CALLBACKS];
|
|
|
|
static int idle_callback_count;
|
|
|
|
void _call_idle_callbacks();
|
|
|
|
|
2020-03-04 16:36:09 +00:00
|
|
|
void _main_window_focus_in();
|
|
|
|
void _main_window_close();
|
|
|
|
void _main_window_go_back();
|
|
|
|
|
2021-08-22 15:37:22 +00:00
|
|
|
enum CallInputType {
|
|
|
|
CALL_INPUT_TYPE_INPUT,
|
|
|
|
CALL_INPUT_TYPE_UNHANDLED_INPUT,
|
|
|
|
CALL_INPUT_TYPE_UNHANDLED_KEY_INPUT,
|
|
|
|
};
|
|
|
|
|
2020-03-04 16:36:09 +00:00
|
|
|
//used by viewport
|
2021-08-22 15:37:22 +00:00
|
|
|
void _call_input_pause(const StringName &p_group, CallInputType p_call_type, const Ref<InputEvent> &p_input, Viewport *p_viewport);
|
2020-03-04 16:36:09 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
protected:
|
|
|
|
void _notification(int p_notification);
|
|
|
|
static void _bind_methods();
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum {
|
2019-04-04 13:34:03 +00:00
|
|
|
NOTIFICATION_TRANSFORM_CHANGED = 2000
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2017-12-24 02:17:48 +00:00
|
|
|
enum GroupCallFlags {
|
2017-03-05 15:44:50 +00:00
|
|
|
GROUP_CALL_DEFAULT = 0,
|
|
|
|
GROUP_CALL_REVERSE = 1,
|
|
|
|
GROUP_CALL_REALTIME = 2,
|
|
|
|
GROUP_CALL_UNIQUE = 4,
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2020-03-04 01:51:12 +00:00
|
|
|
_FORCE_INLINE_ Window *get_root() const { return root; }
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void call_group_flags(uint32_t p_call_flags, const StringName &p_group, const StringName &p_function, VARIANT_ARG_LIST);
|
|
|
|
void notify_group_flags(uint32_t p_call_flags, const StringName &p_group, int p_notification);
|
|
|
|
void set_group_flags(uint32_t p_call_flags, const StringName &p_group, const String &p_name, const Variant &p_value);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void call_group(const StringName &p_group, const StringName &p_function, VARIANT_ARG_LIST);
|
|
|
|
void notify_group(const StringName &p_group, int p_notification);
|
|
|
|
void set_group(const StringName &p_group, const String &p_name, const Variant &p_value);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-10-30 18:43:19 +00:00
|
|
|
void flush_transform_notifications();
|
|
|
|
|
2020-12-22 09:50:29 +00:00
|
|
|
virtual void initialize() override;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2021-05-21 05:23:35 +00:00
|
|
|
virtual bool physics_process(double p_time) override;
|
|
|
|
virtual bool process(double p_time) override;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2020-12-22 09:50:29 +00:00
|
|
|
virtual void finalize() override;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
|
|
|
void set_auto_accept_quit(bool p_enable);
|
2017-01-11 19:34:32 +00:00
|
|
|
void set_quit_on_go_back(bool p_enable);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2020-06-04 20:03:45 +00:00
|
|
|
void quit(int p_exit_code = EXIT_SUCCESS);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2021-05-21 05:23:35 +00:00
|
|
|
_FORCE_INLINE_ double get_physics_process_time() const { return physics_process_time; }
|
|
|
|
_FORCE_INLINE_ double get_process_time() const { return process_time; }
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-04-07 14:17:16 +00:00
|
|
|
#ifdef TOOLS_ENABLED
|
2017-03-05 15:44:50 +00:00
|
|
|
bool is_node_being_edited(const Node *p_node) const;
|
2017-04-07 14:17:16 +00:00
|
|
|
#else
|
|
|
|
bool is_node_being_edited(const Node *p_node) const { return false; }
|
|
|
|
#endif
|
2016-01-02 20:18:45 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
void set_pause(bool p_enabled);
|
|
|
|
bool is_paused() const;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_camera(const RID &p_camera);
|
2014-02-10 01:10:30 +00:00
|
|
|
RID get_camera() const;
|
|
|
|
|
2017-04-07 14:17:16 +00:00
|
|
|
#ifdef DEBUG_ENABLED
|
2015-09-19 02:10:58 +00:00
|
|
|
void set_debug_collisions_hint(bool p_enabled);
|
|
|
|
bool is_debugging_collisions_hint() const;
|
|
|
|
|
2015-09-20 16:03:46 +00:00
|
|
|
void set_debug_navigation_hint(bool p_enabled);
|
|
|
|
bool is_debugging_navigation_hint() const;
|
2017-04-07 14:17:16 +00:00
|
|
|
#else
|
|
|
|
void set_debug_collisions_hint(bool p_enabled) {}
|
|
|
|
bool is_debugging_collisions_hint() const { return false; }
|
|
|
|
|
|
|
|
void set_debug_navigation_hint(bool p_enabled) {}
|
|
|
|
bool is_debugging_navigation_hint() const { return false; }
|
|
|
|
#endif
|
2015-09-20 16:03:46 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_debug_collisions_color(const Color &p_color);
|
2015-09-20 16:03:46 +00:00
|
|
|
Color get_debug_collisions_color() const;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_debug_collision_contact_color(const Color &p_color);
|
2015-09-20 16:03:46 +00:00
|
|
|
Color get_debug_collision_contact_color() const;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_debug_navigation_color(const Color &p_color);
|
2015-09-20 16:03:46 +00:00
|
|
|
Color get_debug_navigation_color() const;
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_debug_navigation_disabled_color(const Color &p_color);
|
2015-09-20 16:03:46 +00:00
|
|
|
Color get_debug_navigation_disabled_color() const;
|
|
|
|
|
|
|
|
Ref<Material> get_debug_navigation_material();
|
|
|
|
Ref<Material> get_debug_navigation_disabled_material();
|
|
|
|
Ref<Material> get_debug_collision_material();
|
2017-06-07 21:18:55 +00:00
|
|
|
Ref<ArrayMesh> get_debug_contact_mesh();
|
2015-09-20 16:03:46 +00:00
|
|
|
|
|
|
|
int get_collision_debug_contact_count() { return collision_debug_contacts; }
|
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
int64_t get_frame() const;
|
|
|
|
|
|
|
|
int get_node_count() const;
|
|
|
|
|
|
|
|
void queue_delete(Object *p_object);
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void get_nodes_in_group(const StringName &p_group, List<Node *> *p_list);
|
2021-02-22 13:54:12 +00:00
|
|
|
Node *get_first_node_in_group(const StringName &p_group);
|
2017-03-05 15:44:50 +00:00
|
|
|
bool has_group(const StringName &p_identifier) const;
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-12-06 20:36:34 +00:00
|
|
|
//void change_scene(const String& p_path);
|
|
|
|
//Node *get_loaded_scene();
|
2014-10-28 01:54:32 +00:00
|
|
|
|
2014-10-12 05:13:22 +00:00
|
|
|
void set_edited_scene_root(Node *p_node);
|
|
|
|
Node *get_edited_scene_root() const;
|
2014-04-15 01:43:44 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void set_current_scene(Node *p_scene);
|
|
|
|
Node *get_current_scene() const;
|
|
|
|
Error change_scene(const String &p_path);
|
|
|
|
Error change_scene_to(const Ref<PackedScene> &p_scene);
|
2015-05-17 19:33:35 +00:00
|
|
|
Error reload_current_scene();
|
|
|
|
|
2021-05-21 05:23:35 +00:00
|
|
|
Ref<SceneTreeTimer> create_timer(double p_delay_sec, bool p_process_always = true);
|
2020-09-05 01:05:30 +00:00
|
|
|
Ref<Tween> create_tween();
|
|
|
|
Array get_processed_tweens();
|
2016-08-07 00:39:50 +00:00
|
|
|
|
2015-05-17 19:33:35 +00:00
|
|
|
//used by Main::start, don't use otherwise
|
2017-03-05 15:44:50 +00:00
|
|
|
void add_current_scene(Node *p_current);
|
2015-05-17 19:33:35 +00:00
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
static SceneTree *get_singleton() { return singleton; }
|
2015-05-17 19:33:35 +00:00
|
|
|
|
2020-07-10 10:34:39 +00:00
|
|
|
void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
|
2015-05-17 19:33:35 +00:00
|
|
|
|
2016-08-14 21:49:50 +00:00
|
|
|
//network API
|
|
|
|
|
2018-05-08 08:51:04 +00:00
|
|
|
Ref<MultiplayerAPI> get_multiplayer() const;
|
2018-06-02 12:32:30 +00:00
|
|
|
void set_multiplayer_poll_enabled(bool p_enabled);
|
|
|
|
bool is_multiplayer_poll_enabled() const;
|
2018-05-08 08:51:04 +00:00
|
|
|
void set_multiplayer(Ref<MultiplayerAPI> p_multiplayer);
|
2016-08-14 21:49:50 +00:00
|
|
|
|
2016-10-27 14:50:26 +00:00
|
|
|
static void add_idle_callback(IdleCallback p_callback);
|
2019-06-25 01:24:07 +00:00
|
|
|
|
|
|
|
//default texture settings
|
|
|
|
|
2014-11-06 00:20:42 +00:00
|
|
|
SceneTree();
|
|
|
|
~SceneTree();
|
2014-02-10 01:10:30 +00:00
|
|
|
};
|
|
|
|
|
2017-12-24 02:17:48 +00:00
|
|
|
VARIANT_ENUM_CAST(SceneTree::GroupCallFlags);
|
2014-04-15 01:43:44 +00:00
|
|
|
|
2020-09-10 14:04:30 +00:00
|
|
|
#endif // SCENE_TREE_H
|