4#include "game/nodes/Node.h"
5#include "math/GLMath.hpp"
6#include "misc/Globals.h"
8#include "SpatialNode.generated.h"
10namespace ne RNAMESPACE() {
35 void setRelativeLocation(
const glm::vec3& location);
44 void setRelativeRotation(
const glm::vec3& rotation);
53 void setRelativeScale(
const glm::vec3& scale);
63 void setWorldLocation(
const glm::vec3& location);
73 void setWorldRotation(
const glm::vec3& rotation);
83 void setWorldScale(
const glm::vec3& scale);
112 glm::mat4x4 getRelativeRotationMatrix();
122 glm::vec3 getWorldLocation();
133 glm::vec3 getWorldRotation();
140 glm::quat getWorldRotationQuaternion();
150 glm::vec3 getWorldScale();
157 glm::vec3 getWorldForwardDirection();
164 glm::vec3 getWorldRightDirection();
171 glm::vec3 getWorldUpDirection();
179 glm::mat4x4 getWorldMatrix();
194 std::pair<std::recursive_mutex, sgc::GcPtr<SpatialNode>>* getClosestSpatialParent();
204 virtual void onAfterDeserialized()
override;
216 virtual void onSpawning()
override;
231 virtual void onAfterAttachedToNewParent(
bool bThisNodeBeingAttached)
override;
256 void applyAttachmentRule(
258 const glm::vec3& worldLocationBeforeAttachment,
260 const glm::vec3& worldRotationBeforeAttachment,
262 const glm::vec3& worldScaleBeforeAttachment);
273 void recalculateWorldMatrix(
bool bNotifyChildren =
true);
276 void recalculateLocalMatrix();
284 void recalculateWorldMatrixForNodeAndNotifyChildren(
Node* pNode);
288 void warnIfExceedingWorldBounds();
299 glm::vec3 worldLocation = glm::vec3(0.0F, 0.0F, 0.0F);
305 glm::vec3 worldRotation = glm::vec3(0.0F, 0.0F, 0.0F);
311 glm::vec3 worldScale = glm::vec3(1.0F, 1.0F, 1.0F);
314 glm::vec3 worldForward = Globals::WorldDirection::forward;
317 glm::vec3 worldRight = Globals::WorldDirection::right;
320 glm::vec3 worldUp = Globals::WorldDirection::up;
323 glm::quat worldRotationQuaternion = glm::identity<glm::quat>();
329 glm::mat4x4 worldMatrix = glm::identity<glm::mat4x4>();
332 bool bInOnWorldLocationRotationScaleChanged =
false;
340 glm::mat4x4 relativeRotationMatrix = glm::identity<glm::mat4x4>();
343 glm::quat relativeRotationQuaternion = glm::identity<glm::quat>();
352 glm::vec3 relativeLocation = glm::vec3(0.0F, 0.0F, 0.0F);
360 glm::vec3 relativeRotation = glm::vec3(0.0F, 0.0F, 0.0F);
368 glm::vec3 relativeScale = glm::vec3(1.0F, 1.0F, 1.0F);
371 std::pair<std::recursive_mutex, sgc::GcPtr<
SpatialNode>> mtxSpatialParent{};
374 std::pair<std::recursive_mutex, LocalSpaceInformation> mtxLocalSpace{};
377 std::pair<std::recursive_mutex, WorldMatrixInformation> mtxWorldMatrix{};
379 ne_SpatialNode_GENERATED
383File_SpatialNode_GENERATED
Definition: GuidProperty.h:30
AttachmentRule
Definition: Node.h:51
Definition: SerializeProperty.h:42
Definition: SpatialNode.h:12
glm::vec3 getRelativeRotation() const
Definition: SpatialNode.h:98
glm::vec3 getRelativeScale() const
Definition: SpatialNode.h:105
virtual void onWorldLocationRotationScaleChanged()
Definition: SpatialNode.h:242
glm::vec3 getRelativeLocation() const
Definition: SpatialNode.h:90