36#if PL_ENABLED(PL_PLATFORM_32BIT)
37 NUM_INPLACE_COMPONENTS = 12
39 NUM_INPLACE_COMPONENTS = 6
78 const plWorld* m_pWorld =
nullptr;
105 bool IsDynamic()
const;
108 bool IsStatic()
const;
121 void SetActiveFlag(
bool bEnabled);
127 bool GetActiveFlag()
const;
136 bool IsActive()
const;
156 void EnableChildChangesNotifications();
157 void DisableChildChangesNotifications();
160 void EnableParentChangesNotifications();
161 void DisableParentChangesNotifications();
192 plUInt32 GetChildCount()
const;
195 ChildIterator GetChildren();
198 ConstChildIterator GetChildren()
const;
225 const plWorld* GetWorld()
const;
239 void SetLocalPosition(
plVec3 vPosition);
240 plVec3 GetLocalPosition()
const;
242 void SetLocalRotation(
plQuat qRotation);
243 plQuat GetLocalRotation()
const;
245 void SetLocalScaling(
plVec3 vScaling);
246 plVec3 GetLocalScaling()
const;
248 void SetLocalUniformScaling(
float fScaling);
249 float GetLocalUniformScaling()
const;
253 void SetGlobalPosition(
const plVec3& vPosition);
254 plVec3 GetGlobalPosition()
const;
256 void SetGlobalRotation(
const plQuat& qRotation);
257 plQuat GetGlobalRotation()
const;
259 void SetGlobalScaling(
const plVec3& vScaling);
260 plVec3 GetGlobalScaling()
const;
262 void SetGlobalTransform(
const plTransform& transform);
269 void SetLocalPosition(
const plSimdVec4f& vPosition, UpdateBehaviorIfStatic updateBehavior = UpdateBehaviorIfStatic::UpdateImmediately);
272 void SetLocalRotation(
const plSimdQuat& qRotation, UpdateBehaviorIfStatic updateBehavior = UpdateBehaviorIfStatic::UpdateImmediately);
273 const plSimdQuat& GetLocalRotationSimd()
const;
275 void SetLocalScaling(
const plSimdVec4f& vScaling, UpdateBehaviorIfStatic updateBehavior = UpdateBehaviorIfStatic::UpdateImmediately);
278 void SetLocalUniformScaling(
const plSimdFloat& fScaling, UpdateBehaviorIfStatic updateBehavior = UpdateBehaviorIfStatic::UpdateImmediately);
283 void SetGlobalPosition(
const plSimdVec4f& vPosition);
286 void SetGlobalRotation(
const plSimdQuat& qRotation);
287 const plSimdQuat& GetGlobalRotationSimd()
const;
289 void SetGlobalScaling(
const plSimdVec4f& vScaling);
298 plVec3 GetGlobalDirForwards()
const;
300 plVec3 GetGlobalDirRight()
const;
302 plVec3 GetGlobalDirUp()
const;
304#if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
311 plVec3 GetLinearVelocity()
const;
314 plVec3 GetAngularVelocity()
const;
318 void UpdateGlobalTransform();
322 void EnableStaticTransformChangesNotifications();
323 void DisableStaticTransformChangesNotifications();
333 void UpdateLocalBounds();
337 void UpdateGlobalBounds();
340 void UpdateGlobalTransformAndBounds();
347 void EnableComponentChangesNotifications();
348 void DisableComponentChangesNotifications();
351 template <
typename T>
355 template <
typename T>
359 bool TryGetComponentOfBaseType(
const plRTTI* pType,
plComponent*& out_pComponent);
362 bool TryGetComponentOfBaseType(
const plRTTI* pType,
const plComponent*& out_pComponent)
const;
365 template <
typename T>
369 template <
typename T>
386 plUInt16 GetComponentVersion()
const;
393 bool SendMessage(
plMessage& ref_msg)
const;
396 bool SendMessageRecursive(
plMessage& ref_msg);
399 bool SendMessageRecursive(
plMessage& ref_msg)
const;
450 void SetTag(
const plTag& tag);
453 void RemoveTag(
const plTag& tag);
459 const plUInt16&
GetTeamID()
const {
return m_uiTeamID; }
462 void SetTeamID(plUInt16 uiId);
475 plUInt32 GetStableRandomSeed()
const;
482 void SetStableRandomSeed(plUInt32 uiSeed);
491 plVisibilityState GetVisibilityState(plUInt32 uiNumFramesBeforeInvisible = 5)
const;
495 friend class plGameObjectTest;
498 void SetNameInternal(
const char* szName);
499 const char* GetNameInternal()
const;
500 void SetGlobalKeyInternal(
const char* szKey);
501 const char* GetGlobalKeyInternal()
const;
503 bool SendMessageInternal(
plMessage& msg,
bool bWasPostedMsg);
504 bool SendMessageInternal(
plMessage& msg,
bool bWasPostedMsg)
const;
505 bool SendMessageRecursiveInternal(
plMessage& msg,
bool bWasPostedMsg);
506 bool SendMessageRecursiveInternal(
plMessage& msg,
bool bWasPostedMsg)
const;
515 void Reflection_AddComponent(
plComponent* pComponent);
516 void Reflection_RemoveComponent(
plComponent* pComponent);
519 plObjectMode::Enum Reflection_GetMode()
const;
520 void Reflection_SetMode(plObjectMode::Enum mode);
523 void Reflection_SetGlobalPosition(
const plVec3& vPosition);
524 void Reflection_SetGlobalRotation(
const plQuat& qRotation);
525 void Reflection_SetGlobalScaling(
const plVec3& vScaling);
526 void Reflection_SetGlobalTransform(
const plTransform& transform);
528 bool DetermineDynamicMode(
plComponent* pComponentToIgnore =
nullptr)
const;
529 void ConditionalMakeStatic(
plComponent* pComponentToIgnore =
nullptr);
530 void MakeStaticInternal();
532 void UpdateGlobalTransformAndBoundsRecursive();
533 void UpdateLastGlobalTransform();
542 void UpdateActiveState(
bool bParentActive);
544 void SendNotificationMessage(
plMessage& msg);
546 struct PL_CORE_DLL alignas(16) TransformationData
548 PL_DECLARE_POD_TYPE();
551 TransformationData* m_pParentData;
553#if PL_ENABLED(PL_PLATFORM_32BIT)
554 plUInt64 m_uiPadding;
563#if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
571 plUInt32 m_uiSpatialDataCategoryBitmask;
573 plUInt32 m_uiStableRandomSeed = 0;
575#if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
576 plUInt32 m_uiLastGlobalTransformUpdateCounter = 0;
578 plUInt32 m_uiPadding2[1];
582 void UpdateLocalTransform();
586 void UpdateGlobalTransformRecursive(plUInt32 uiUpdateCounter);
590 void UpdateGlobalTransformNonRecursive(plUInt32 uiUpdateCounter);
594 void UpdateGlobalTransformWithoutParent(plUInt32 uiUpdateCounter);
598 void UpdateGlobalTransformWithParent(plUInt32 uiUpdateCounter);
601 void UpdateGlobalBounds();
602 void UpdateGlobalBoundsAndSpatialData(
plSpatialSystem& ref_spatialSystem);
604 void UpdateLastGlobalTransform(plUInt32 uiUpdateCounter);
612#if PL_ENABLED(PL_PLATFORM_32BIT)
613 plUInt32 m_uiNamePadding;
618 plUInt32 m_uiParentIndex = 0;
619 plUInt32 m_uiFirstChildIndex = 0;
620 plUInt32 m_uiLastChildIndex = 0;
622 plUInt32 m_uiNextSiblingIndex = 0;
623 plUInt32 m_uiPrevSiblingIndex = 0;
624 plUInt32 m_uiChildCount = 0;
626 plUInt16 m_uiHierarchyLevel = 0;
629 plUInt16 m_uiTeamID = 0;
631 TransformationData* m_pTransformationData =
nullptr;
633#if PL_ENABLED(PL_PLATFORM_32BIT)
634 plUInt32 m_uiPadding = 0;
639 struct ComponentUserData
641 plUInt16 m_uiVersion;