32 void Update(
float deltaTime);
37 Camera3D* FindCameraForScreen(uint8_t targetScreen);
38 Node3D* GetAudioReceiver();
40 void SetActiveCamera(
Camera3D* activeCamera);
43 void SetAudioReceiver(
Node3D* newReceiver);
45 Node* SpawnNode(
TypeId actorType, glm::vec3 position = {});
46 Node* SpawnNode(
const char* typeName, glm::vec3 position = {});
47 Node* SpawnScene(
const char* sceneName, glm::vec3 position = {});
48 Node* SpawnScene(
Scene* scene, glm::vec3 position = {});
49 void DespawnScene(
Node* sceneRoot);
53 template<
class NodeClass>
56 return (NodeClass*)SpawnNode(NodeClass::GetStaticType(), position);
60 void SetRootNode(
Node* node);
62 void DestroyRootNode();
63 Node* FindNode(
const std::string& name);
65 std::vector<Node*> FindNodesWithTag(
const char* tag);
66 std::vector<Node*> FindNodesWithName(
const char* name);
67 std::vector<Node*> GatherNodes();
68 void GatherNodes(std::vector<Node*>& outNodes);
72 Node* FindNodeByUuid(uint64_t uuid);
73 void RegisterNodeUuid(
Node* node);
74 void UnregisterNodeUuid(
Node* node);
76 bool FindNavPath(glm::vec3 start, glm::vec3 end, std::vector<glm::vec3>& outPath);
77 bool FindRandomNavPoint(glm::vec3& outPoint);
78 bool FindClosestNavPoint(glm::vec3 inPoint, glm::vec3& outPoint);
79 void BuildNavigationData();
80 void EnableAutoNavRebuild(
bool enable);
81 bool IsAutoNavRebuildEnabled()
const;
82 void InvalidateNavMesh();
85 int32_t GetIndex()
const;
87 void AddLine(
const Line& line);
88 void RemoveLine(
const Line& line);
89 void RemoveAllLines();
90 const std::vector<Line>& GetLines()
const;
92 const std::vector<class Light3D*>& GetLights();
93 std::vector<FadingLight>& GetFadingLights();
95 void SetAmbientLightColor(glm::vec4 color);
96 glm::vec4 GetAmbientLightColor()
const;
98 void SetShadowColor(glm::vec4 shadowColor);
99 glm::vec4 GetShadowColor()
const;
104 void SetGravity(glm::vec3 gravity);
105 glm::vec3 GetGravity()
const;
107 btDynamicsWorld* GetDynamicsWorld();
108 btDbvtBroadphase* GetBroadphase();
114 uint8_t collisionMask,
116 uint32_t numIgnoredObjects = 0,
117 btCollisionObject** ignoreObjects =
nullptr,
118 bool ignorePureOverlap =
true);
123 uint8_t collisionMask,
124 bool ignorePureOverlap,
131 uint8_t collisionMask,
135 btConvexShape* convexShape,
139 uint8_t collisionMask,
141 uint32_t numIgnoreObjects = 0,
142 btCollisionObject** ignoreObjects =
nullptr);
144 void RegisterNode(
Node* node,
bool subRoot);
145 void UnregisterNode(
Node* node,
bool subRoot);
146 const std::vector<Audio3D*>& GetAudios()
const;
148 void LoadScene(
const char* name,
bool instant);
149 void QueueRootScene(
const char* name);
150 void QueueRootNode(
Node* node);
152 void GetLoadedSceneNames(std::vector<std::string>& outNames);
154 void EnableInternalEdgeSmoothing(
bool enable);
155 bool IsInternalEdgeSmoothingEnabled()
const;
157 void DirtyAllWidgets();
159 void UpdateRenderSettings();
160 void AddNewlyRegisteredNode(
Node* node);
163 Node* SpawnDefaultRoot();
164 void PlaceNewlySpawnedNode(
NodePtr node, glm::vec3 position);
166 void OverrideDynamicsWorld(btDiscreteDynamicsWorld* world);
167 void RestoreDynamicsWorld();
174 auto typedNodeFind = [&](
Node* node) ->
bool
176 if (node->Is(T::ClassRuntimeId()))
178 ret =
static_cast<T*
>(node);
185 if (mRootNode !=
nullptr)
187 mRootNode->ForEach(typedNodeFind);
196 auto typedNodeGather = [&](
Node* node) ->
bool
198 if (node->Is(T::ClassRuntimeId()))
200 outNodes.push_back(
static_cast<T*
>(node));
206 if (mRootNode !=
nullptr)
208 mRootNode->Traverse(typedNodeGather);
214 void UpdateLines(
float deltaTime);
215 void ExtractPersistingNodes();
219 static std::unordered_set<NodePtrWeak> sNewlyRegisteredNodes;
222 std::vector<NodePtr> mPersistingNodes;
223 std::vector<Line> mLines;
224 std::vector<class Light3D*> mLights;
225 std::vector<class Audio3D*> mAudios;
226 std::vector<FadingLight> mFadingLights;
228 std::string mLoadedSceneName;
229 std::string mQueuedSceneName;
230 glm::vec4 mAmbientLightColor;
231 glm::vec4 mShadowColor;
234 Camera3D* mCameraOverride =
nullptr;
236 bool mPendingClear =
false;
237 bool mAutoNavRebuild =
false;
240 btDefaultCollisionConfiguration* mCollisionConfig =
nullptr;
241 btCollisionDispatcher* mCollisionDispatcher =
nullptr;
242 btDbvtBroadphase* mBroadphase =
nullptr;
243 btSequentialImpulseConstraintSolver* mSolver =
nullptr;
244 btDiscreteDynamicsWorld* mDynamicsWorld =
nullptr;
245 btDiscreteDynamicsWorld* mDefaultDynamicsWorld =
nullptr;;
246 std::vector<PrimitivePair> mCurrentOverlaps;
247 std::vector<PrimitivePair> mPreviousOverlaps;
250 std::unordered_map<uint64_t, Node*> mUuidMap;
Definition Particle3d.h:34
Definition ParticleSystem.h:66