Plasma Engine  2.0
Loading...
Searching...
No Matches
GameObject_inl.h
1
2PL_ALWAYS_INLINE plGameObject::ConstChildIterator::ConstChildIterator(plGameObject* pObject, const plWorld* pWorld)
3 : m_pObject(pObject)
4 , m_pWorld(pWorld)
5{
6}
7
8PL_ALWAYS_INLINE const plGameObject& plGameObject::ConstChildIterator::operator*() const
9{
10 return *m_pObject;
11}
12
13PL_ALWAYS_INLINE const plGameObject* plGameObject::ConstChildIterator::operator->() const
14{
15 return m_pObject;
16}
17
18PL_ALWAYS_INLINE plGameObject::ConstChildIterator::operator const plGameObject*() const
19{
20 return m_pObject;
21}
22
23PL_ALWAYS_INLINE bool plGameObject::ConstChildIterator::IsValid() const
24{
25 return m_pObject != nullptr;
26}
27
29{
30 Next();
31}
32
34
35PL_ALWAYS_INLINE plGameObject::ChildIterator::ChildIterator(plGameObject* pObject, const plWorld* pWorld)
36 : ConstChildIterator(pObject, pWorld)
37{
38}
39
40PL_ALWAYS_INLINE plGameObject& plGameObject::ChildIterator::operator*()
41{
42 return *m_pObject;
43}
44
45PL_ALWAYS_INLINE plGameObject* plGameObject::ChildIterator::operator->()
46{
47 return m_pObject;
48}
49
50PL_ALWAYS_INLINE plGameObject::ChildIterator::operator plGameObject*()
51{
52 return m_pObject;
53}
54
56
57inline plGameObject::plGameObject() = default;
58
59PL_ALWAYS_INLINE plGameObject::plGameObject(const plGameObject& other)
60{
61 *this = other;
62}
63
65{
66 return plGameObjectHandle(m_InternalId);
67}
68
69PL_ALWAYS_INLINE bool plGameObject::IsDynamic() const
70{
71 return m_Flags.IsSet(plObjectFlags::Dynamic);
72}
73
74PL_ALWAYS_INLINE bool plGameObject::IsStatic() const
75{
76 return !m_Flags.IsSet(plObjectFlags::Dynamic);
77}
78
79PL_ALWAYS_INLINE bool plGameObject::GetActiveFlag() const
80{
81 return m_Flags.IsSet(plObjectFlags::ActiveFlag);
82}
83
84PL_ALWAYS_INLINE bool plGameObject::IsActive() const
85{
86 return m_Flags.IsSet(plObjectFlags::ActiveState);
87}
88
89PL_ALWAYS_INLINE void plGameObject::SetName(plStringView sName)
90{
91 m_sName.Assign(sName);
92}
93
94PL_ALWAYS_INLINE void plGameObject::SetName(const plHashedString& sName)
95{
96 m_sName = sName;
97}
98
99PL_ALWAYS_INLINE void plGameObject::SetGlobalKey(plStringView sKey)
100{
101 plHashedString sGlobalKey;
102 sGlobalKey.Assign(sKey);
103 SetGlobalKey(sGlobalKey);
104}
105
106PL_ALWAYS_INLINE plStringView plGameObject::GetName() const
107{
108 return m_sName.GetView();
109}
110
111PL_ALWAYS_INLINE void plGameObject::SetNameInternal(const char* szName)
112{
113 m_sName.Assign(szName);
114}
115
116PL_ALWAYS_INLINE const char* plGameObject::GetNameInternal() const
117{
118 return m_sName;
119}
120
121PL_ALWAYS_INLINE void plGameObject::SetGlobalKeyInternal(const char* szName)
122{
123 SetGlobalKey(szName);
124}
125
126PL_ALWAYS_INLINE bool plGameObject::HasName(const plTempHashedString& sName) const
127{
128 return m_sName == sName;
129}
130
135
136PL_ALWAYS_INLINE void plGameObject::DisableChildChangesNotifications()
137{
139}
140
145
146PL_ALWAYS_INLINE void plGameObject::DisableParentChangesNotifications()
147{
149}
150
152{
153 for (plUInt32 i = 0; i < children.GetCount(); ++i)
154 {
155 AddChild(children[i], preserve);
156 }
157}
158
160{
161 for (plUInt32 i = 0; i < children.GetCount(); ++i)
162 {
163 DetachChild(children[i], preserve);
164 }
165}
166
167PL_ALWAYS_INLINE plUInt32 plGameObject::GetChildCount() const
168{
169 return m_uiChildCount;
170}
171
172
173PL_ALWAYS_INLINE void plGameObject::SetLocalPosition(plVec3 vPosition)
174{
175 SetLocalPosition(plSimdConversion::ToVec3(vPosition));
176}
177
178PL_ALWAYS_INLINE plVec3 plGameObject::GetLocalPosition() const
179{
180 return plSimdConversion::ToVec3(m_pTransformationData->m_localPosition);
181}
182
183
184PL_ALWAYS_INLINE void plGameObject::SetLocalRotation(plQuat qRotation)
185{
186 SetLocalRotation(plSimdConversion::ToQuat(qRotation));
187}
188
189PL_ALWAYS_INLINE plQuat plGameObject::GetLocalRotation() const
190{
191 return plSimdConversion::ToQuat(m_pTransformationData->m_localRotation);
192}
193
194
195PL_ALWAYS_INLINE void plGameObject::SetLocalScaling(plVec3 vScaling)
196{
197 SetLocalScaling(plSimdConversion::ToVec3(vScaling));
198}
199
200PL_ALWAYS_INLINE plVec3 plGameObject::GetLocalScaling() const
201{
202 return plSimdConversion::ToVec3(m_pTransformationData->m_localScaling);
203}
204
205
206PL_ALWAYS_INLINE void plGameObject::SetLocalUniformScaling(float fScaling)
207{
208 SetLocalUniformScaling(plSimdFloat(fScaling));
209}
210
211PL_ALWAYS_INLINE float plGameObject::GetLocalUniformScaling() const
212{
213 return m_pTransformationData->m_localScaling.w();
214}
215
216PL_ALWAYS_INLINE plTransform plGameObject::GetLocalTransform() const
217{
218 return plSimdConversion::ToTransform(GetLocalTransformSimd());
219}
220
221
222PL_ALWAYS_INLINE void plGameObject::SetGlobalPosition(const plVec3& vPosition)
223{
224 SetGlobalPosition(plSimdConversion::ToVec3(vPosition));
225}
226
227PL_ALWAYS_INLINE plVec3 plGameObject::GetGlobalPosition() const
228{
229 return plSimdConversion::ToVec3(m_pTransformationData->m_globalTransform.m_Position);
230}
231
232
233PL_ALWAYS_INLINE void plGameObject::SetGlobalRotation(const plQuat& qRotation)
234{
235 SetGlobalRotation(plSimdConversion::ToQuat(qRotation));
236}
237
238PL_ALWAYS_INLINE plQuat plGameObject::GetGlobalRotation() const
239{
240 return plSimdConversion::ToQuat(m_pTransformationData->m_globalTransform.m_Rotation);
241}
242
243
244PL_ALWAYS_INLINE void plGameObject::SetGlobalScaling(const plVec3& vScaling)
245{
246 SetGlobalScaling(plSimdConversion::ToVec3(vScaling));
247}
248
249PL_ALWAYS_INLINE plVec3 plGameObject::GetGlobalScaling() const
250{
251 return plSimdConversion::ToVec3(m_pTransformationData->m_globalTransform.m_Scale);
252}
253
254
255PL_ALWAYS_INLINE void plGameObject::SetGlobalTransform(const plTransform& transform)
256{
257#if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
258 m_pTransformationData->m_lastGlobalTransform = m_pTransformationData->m_globalTransform;
259#endif
260
261 SetGlobalTransform(plSimdConversion::ToTransform(transform));
262}
263
264PL_ALWAYS_INLINE plTransform plGameObject::GetGlobalTransform() const
265{
266 return plSimdConversion::ToTransform(m_pTransformationData->m_globalTransform);
267}
268
270{
271 #if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
272 return plSimdConversion::ToTransform(m_pTransformationData->m_lastGlobalTransform);
273 #else
274 return plSimdConversion::ToTransform(m_pTransformationData->m_globalTransform);
275 #endif
276}
277
278
279PL_ALWAYS_INLINE void plGameObject::SetLocalPosition(const plSimdVec4f& vPosition, UpdateBehaviorIfStatic updateBehavior)
280{
281 m_pTransformationData->m_localPosition = vPosition;
282
283 if (IsStatic() && updateBehavior == UpdateBehaviorIfStatic::UpdateImmediately)
284 {
285 UpdateGlobalTransformAndBoundsRecursive();
286 }
287}
288
289PL_ALWAYS_INLINE const plSimdVec4f& plGameObject::GetLocalPositionSimd() const
290{
291 return m_pTransformationData->m_localPosition;
292}
293
294
295PL_ALWAYS_INLINE void plGameObject::SetLocalRotation(const plSimdQuat& qRotation, UpdateBehaviorIfStatic updateBehavior)
296{
297 m_pTransformationData->m_localRotation = qRotation;
298
299 if (IsStatic() && updateBehavior == UpdateBehaviorIfStatic::UpdateImmediately)
300 {
301 UpdateGlobalTransformAndBoundsRecursive();
302 }
303}
304
305PL_ALWAYS_INLINE const plSimdQuat& plGameObject::GetLocalRotationSimd() const
306{
307 return m_pTransformationData->m_localRotation;
308}
309
310
311PL_ALWAYS_INLINE void plGameObject::SetLocalScaling(const plSimdVec4f& vScaling, UpdateBehaviorIfStatic updateBehavior)
312{
313 plSimdFloat uniformScale = m_pTransformationData->m_localScaling.w();
314 m_pTransformationData->m_localScaling = vScaling;
315 m_pTransformationData->m_localScaling.SetW(uniformScale);
316
317 if (IsStatic() && updateBehavior == UpdateBehaviorIfStatic::UpdateImmediately)
318 {
319 UpdateGlobalTransformAndBoundsRecursive();
320 }
321}
322
323PL_ALWAYS_INLINE const plSimdVec4f& plGameObject::GetLocalScalingSimd() const
324{
325 return m_pTransformationData->m_localScaling;
326}
327
328
329PL_ALWAYS_INLINE void plGameObject::SetLocalUniformScaling(const plSimdFloat& fScaling, UpdateBehaviorIfStatic updateBehavior)
330{
331 m_pTransformationData->m_localScaling.SetW(fScaling);
332
333 if (IsStatic() && updateBehavior == UpdateBehaviorIfStatic::UpdateImmediately)
334 {
335 UpdateGlobalTransformAndBoundsRecursive();
336 }
337}
338
339PL_ALWAYS_INLINE plSimdFloat plGameObject::GetLocalUniformScalingSimd() const
340{
341 return m_pTransformationData->m_localScaling.w();
342}
343
344PL_ALWAYS_INLINE plSimdTransform plGameObject::GetLocalTransformSimd() const
345{
346 const plSimdVec4f vScale = m_pTransformationData->m_localScaling * m_pTransformationData->m_localScaling.w();
347 return plSimdTransform(m_pTransformationData->m_localPosition, m_pTransformationData->m_localRotation, vScale);
348}
349
350
351PL_ALWAYS_INLINE void plGameObject::SetGlobalPosition(const plSimdVec4f& vPosition)
352{
353 UpdateLastGlobalTransform();
354
355 m_pTransformationData->m_globalTransform.m_Position = vPosition;
356
357 m_pTransformationData->UpdateLocalTransform();
358
359 if (IsStatic())
360 {
361 UpdateGlobalTransformAndBoundsRecursive();
362 }
363}
364
365PL_ALWAYS_INLINE const plSimdVec4f& plGameObject::GetGlobalPositionSimd() const
366{
367 return m_pTransformationData->m_globalTransform.m_Position;
368}
369
370
371PL_ALWAYS_INLINE void plGameObject::SetGlobalRotation(const plSimdQuat& qRotation)
372{
373 UpdateLastGlobalTransform();
374
375 m_pTransformationData->m_globalTransform.m_Rotation = qRotation;
376
377 m_pTransformationData->UpdateLocalTransform();
378
379 if (IsStatic())
380 {
381 UpdateGlobalTransformAndBoundsRecursive();
382 }
383}
384
385PL_ALWAYS_INLINE const plSimdQuat& plGameObject::GetGlobalRotationSimd() const
386{
387 return m_pTransformationData->m_globalTransform.m_Rotation;
388}
389
390
391PL_ALWAYS_INLINE void plGameObject::SetGlobalScaling(const plSimdVec4f& vScaling)
392{
393 UpdateLastGlobalTransform();
394
395 m_pTransformationData->m_globalTransform.m_Scale = vScaling;
396
397 m_pTransformationData->UpdateLocalTransform();
398
399 if (IsStatic())
400 {
401 UpdateGlobalTransformAndBoundsRecursive();
402 }
403}
404
405PL_ALWAYS_INLINE const plSimdVec4f& plGameObject::GetGlobalScalingSimd() const
406{
407 return m_pTransformationData->m_globalTransform.m_Scale;
408}
409
410
411PL_ALWAYS_INLINE void plGameObject::SetGlobalTransform(const plSimdTransform& transform)
412{
413 UpdateLastGlobalTransform();
414
415 m_pTransformationData->m_globalTransform = transform;
416
417 // plTransformTemplate<Type>::SetLocalTransform will produce NaNs in w components
418 // of pos and scale if scale.w is not set to 1 here. This only affects builds that
419 // use PL_SIMD_IMPLEMENTATION_FPU, e.g. arm atm.
420 m_pTransformationData->m_globalTransform.m_Scale.SetW(1.0f);
421 m_pTransformationData->UpdateLocalTransform();
422
423 if (IsStatic())
424 {
425 UpdateGlobalTransformAndBoundsRecursive();
426 }
427}
428
429PL_ALWAYS_INLINE const plSimdTransform& plGameObject::GetGlobalTransformSimd() const
430{
431 return m_pTransformationData->m_globalTransform;
432}
433
434PL_ALWAYS_INLINE const plSimdTransform& plGameObject::GetLastGlobalTransformSimd() const
435{
436#if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
437 return m_pTransformationData->m_lastGlobalTransform;
438#else
439 return m_pTransformationData->m_globalTransform;
440#endif
441}
442
447
448PL_ALWAYS_INLINE void plGameObject::DisableStaticTransformChangesNotifications()
449{
451}
452
453PL_ALWAYS_INLINE plBoundingBoxSphere plGameObject::GetLocalBounds() const
454{
455 return plSimdConversion::ToBBoxSphere(m_pTransformationData->m_localBounds);
456}
457
458PL_ALWAYS_INLINE plBoundingBoxSphere plGameObject::GetGlobalBounds() const
459{
460 return plSimdConversion::ToBBoxSphere(m_pTransformationData->m_globalBounds);
461}
462
463PL_ALWAYS_INLINE const plSimdBBoxSphere& plGameObject::GetLocalBoundsSimd() const
464{
465 return m_pTransformationData->m_localBounds;
466}
467
468PL_ALWAYS_INLINE const plSimdBBoxSphere& plGameObject::GetGlobalBoundsSimd() const
469{
470 return m_pTransformationData->m_globalBounds;
471}
472
474{
475 return m_pTransformationData->m_hSpatialData;
476}
477
482
483PL_ALWAYS_INLINE void plGameObject::DisableComponentChangesNotifications()
484{
486}
487
488template <typename T>
489PL_ALWAYS_INLINE bool plGameObject::TryGetComponentOfBaseType(T*& out_pComponent)
490{
491 return TryGetComponentOfBaseType(plGetStaticRTTI<T>(), (plComponent*&)out_pComponent);
492}
493
494template <typename T>
495PL_ALWAYS_INLINE bool plGameObject::TryGetComponentOfBaseType(const T*& out_pComponent) const
496{
497 return TryGetComponentOfBaseType(plGetStaticRTTI<T>(), (const plComponent*&)out_pComponent);
498}
499
500template <typename T>
502{
503 out_components.Clear();
504
505 for (plUInt32 i = 0; i < m_Components.GetCount(); ++i)
506 {
507 plComponent* pComponent = m_Components[i];
508 if (pComponent->IsInstanceOf<T>())
509 {
510 out_components.PushBack(static_cast<T*>(pComponent));
511 }
512 }
513}
514
515template <typename T>
517{
518 out_components.Clear();
519
520 for (plUInt32 i = 0; i < m_Components.GetCount(); ++i)
521 {
522 plComponent* pComponent = m_Components[i];
523 if (pComponent->IsInstanceOf<T>())
524 {
525 out_components.PushBack(static_cast<const T*>(pComponent));
526 }
527 }
528}
529
531{
532 return m_Components;
533}
534
536{
537 return plMakeArrayPtr(const_cast<const plComponent* const*>(m_Components.GetData()), m_Components.GetCount());
538}
539
540PL_ALWAYS_INLINE plUInt16 plGameObject::GetComponentVersion() const
541{
542 return m_Components.GetUserData<ComponentUserData>().m_uiVersion;
543}
544
545PL_ALWAYS_INLINE bool plGameObject::SendMessage(plMessage& ref_msg)
546{
547 return SendMessageInternal(ref_msg, false);
548}
549
550PL_ALWAYS_INLINE bool plGameObject::SendMessage(plMessage& ref_msg) const
551{
552 return SendMessageInternal(ref_msg, false);
553}
554
555PL_ALWAYS_INLINE bool plGameObject::SendMessageRecursive(plMessage& ref_msg)
556{
557 return SendMessageRecursiveInternal(ref_msg, false);
558}
559
560PL_ALWAYS_INLINE bool plGameObject::SendMessageRecursive(plMessage& ref_msg) const
561{
562 return SendMessageRecursiveInternal(ref_msg, false);
563}
564
565PL_ALWAYS_INLINE const plTagSet& plGameObject::GetTags() const
566{
567 return m_Tags;
568}
569
570PL_ALWAYS_INLINE plUInt32 plGameObject::GetStableRandomSeed() const
571{
572 return m_pTransformationData->m_uiStableRandomSeed;
573}
574
575PL_ALWAYS_INLINE void plGameObject::SetStableRandomSeed(plUInt32 uiSeed)
576{
577 m_pTransformationData->m_uiStableRandomSeed = uiSeed;
578}
579
581
582PL_ALWAYS_INLINE void plGameObject::TransformationData::UpdateGlobalTransformWithoutParent(plUInt32 uiUpdateCounter)
583{
584 UpdateLastGlobalTransform(uiUpdateCounter);
585
586 m_globalTransform.m_Position = m_localPosition;
587 m_globalTransform.m_Rotation = m_localRotation;
588 m_globalTransform.m_Scale = m_localScaling * m_localScaling.w();
589}
590
591PL_ALWAYS_INLINE void plGameObject::TransformationData::UpdateGlobalTransformWithParent(plUInt32 uiUpdateCounter)
592{
593 UpdateLastGlobalTransform(uiUpdateCounter);
594
595 const plSimdVec4f vScale = m_localScaling * m_localScaling.w();
596 const plSimdTransform localTransform(m_localPosition, m_localRotation, vScale);
597 m_globalTransform = plSimdTransform::MakeGlobalTransform(m_pParentData->m_globalTransform, localTransform);
598}
599
600PL_FORCE_INLINE void plGameObject::TransformationData::UpdateGlobalBounds()
601{
602 m_globalBounds = m_localBounds;
603 m_globalBounds.Transform(m_globalTransform);
604}
605
606PL_ALWAYS_INLINE void plGameObject::TransformationData::UpdateLastGlobalTransform(plUInt32 uiUpdateCounter)
607{
608#if PL_ENABLED(PL_GAMEOBJECT_VELOCITY)
609 if (m_uiLastGlobalTransformUpdateCounter != uiUpdateCounter)
610 {
611 m_lastGlobalTransform = m_globalTransform;
612 m_uiLastGlobalTransformUpdateCounter = uiUpdateCounter;
613 }
614#endif
615}
void PushBack(const T &value)
Pushes value at the end of the array.
Definition ArrayBase_inl.h:333
void Clear()
Clears the array.
Definition ArrayBase_inl.h:184
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
PL_ALWAYS_INLINE plUInt32 GetCount() const
Returns the number of elements in the array.
Definition ArrayPtr.h:142
Base class of all component types.
Definition Component.h:25
Definition DynamicArray.h:81
Iterates over all children of one object.
Definition GameObject.h:56
void operator++()
Shorthand for 'Next'.
Definition GameObject_inl.h:28
bool IsValid() const
Checks whether this iterator points to a valid object.
Definition GameObject_inl.h:23
This class represents an object inside the world.
Definition GameObject.h:32
plUInt16 GetComponentVersion() const
Returns the current version of components attached to this object. This version is increased whenever...
Definition GameObject_inl.h:540
void EnableComponentChangesNotifications()
Enables or disabled notification message 'plMsgComponentsChanged' when components are added or remove...
Definition GameObject_inl.h:478
void EnableParentChangesNotifications()
Enables or disabled notification message 'plMsgParentChanged' when the parent changes....
Definition GameObject_inl.h:141
bool TryGetComponentOfBaseType(T *&out_pComponent)
Tries to find a component of the given base type in the objects components list and returns the first...
bool SendMessage(plMessage &ref_msg)
Sends a message to all components of this object.
Definition GameObject_inl.h:545
plGameObjectHandle GetHandle() const
Returns a handle to this object.
Definition GameObject_inl.h:64
plArrayPtr< plComponent *const > GetComponents()
Returns a list of all components attached to this object.
Definition GameObject_inl.h:530
UpdateBehaviorIfStatic
Defines update behavior for global transforms when changing the local transform on a static game obje...
Definition GameObject.h:230
@ UpdateImmediately
Updates the hierarchy underneath the object immediately.
plUInt32 GetStableRandomSeed() const
Returns a random value that is chosen once during object creation and remains stable even throughout ...
Definition GameObject_inl.h:570
void EnableStaticTransformChangesNotifications()
Enables or disabled notification message 'plMsgTransformChanged' when this object is static and its t...
Definition GameObject_inl.h:443
bool IsDynamic() const
Returns whether this object is dynamic.
Definition GameObject_inl.h:69
void SetStableRandomSeed(plUInt32 uiSeed)
Overwrites the object's random seed value.
Definition GameObject_inl.h:575
void EnableChildChangesNotifications()
Enables or disabled notification message 'plMsgChildrenChanged' when children are added or removed....
Definition GameObject_inl.h:131
plSpatialDataHandle GetSpatialData() const
Returns a handle to the internal spatial data.
Definition GameObject_inl.h:473
bool GetActiveFlag() const
Checks whether the 'active flag' is set on this game object. Note that this does not mean that the ga...
Definition GameObject_inl.h:79
plTransform GetLastGlobalTransform() const
Last frame's global transform (only valid if PL_GAMEOBJECT_VELOCITY is set, otherwise the same as Get...
Definition GameObject_inl.h:269
bool IsActive() const
Checks whether this game object is in an active state.
Definition GameObject_inl.h:84
void SetGlobalKey(plStringView sGlobalKey)
Sets the global key to identify this object. Global keys must be unique within a world.
Definition GameObject_inl.h:99
void TryGetComponentsOfBaseType(plDynamicArray< T * > &out_components)
Tries to find components of the given base type in the objects components list and returns all matche...
Definition GameObject_inl.h:501
void SetLocalPosition(plVec3 vPosition)
Changes the position of the object local to its parent.
Definition GameObject_inl.h:173
const plTagSet & GetTags() const
Returns the tag set associated with this object.
Definition GameObject_inl.h:565
void SetName(plStringView sName)
Sets the name to identify this object. Does not have to be a unique name.
Definition GameObject_inl.h:89
void AddChildren(const plArrayPtr< const plGameObjectHandle > &children, plGameObject::TransformPreservation preserve=TransformPreservation::PreserveGlobal)
Adds the given objects as child objects.
Definition GameObject_inl.h:151
void DetachChild(const plGameObjectHandle &hChild, plGameObject::TransformPreservation preserve=TransformPreservation::PreserveGlobal)
Detaches the given child object from this object and makes it a top-level object.
Definition GameObject.cpp:439
void AddChild(const plGameObjectHandle &hChild, plGameObject::TransformPreservation preserve=TransformPreservation::PreserveGlobal)
Adds the given object as a child object.
Definition GameObject.cpp:428
bool SendMessageRecursive(plMessage &ref_msg)
Sends a message to all components of this object and then recursively to all children.
Definition GameObject_inl.h:555
plUInt32 GetChildCount() const
Returns the number of children.
Definition GameObject_inl.h:167
bool IsStatic() const
Returns whether this object is static.
Definition GameObject_inl.h:74
void DetachChildren(const plArrayPtr< const plGameObjectHandle > &children, plGameObject::TransformPreservation preserve=TransformPreservation::PreserveGlobal)
Detaches the given child objects from this object and makes them top-level objects.
Definition GameObject_inl.h:159
TransformPreservation
Defines during re-parenting what transform is going to be preserved.
Definition GameObject.h:165
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
void Assign(const char(&string)[N])
Assigning a new string from a string constant is a slow operation, but the hash computation can happe...
PL_ALWAYS_INLINE plStringView GetView() const
Returns a string view to this string's data.
Definition HashedString.h:128
Base class for all message types. Each message type has it's own id which is used to dispatch message...
Definition Message.h:22
bool IsInstanceOf(const plRTTI *pType) const
Returns whether the type of this instance is of the given type or derived from it.
Definition DynamicRTTI.cpp:6
Definition SimdBBoxSphere.h:6
Definition SimdFloat.h:7
Definition SimdQuat.h:6
Definition SimdTransform.h:6
static plSimdTransform MakeGlobalTransform(const plSimdTransform &globalTransformParent, const plSimdTransform &localTransformChild)
Creates a transform that is the global transform, that is reached by applying the child's local trans...
Definition SimdTransform_inl.h:49
A 4-component SIMD vector class.
Definition SimdVec4f.h:8
T * GetData()
Returns a pointer to the array data, or nullptr if the array is empty.
Definition SmallArray_inl.h:444
plUInt32 GetCount() const
Returns the number of active elements in the array.
Definition SmallArray_inl.h:210
Definition Declarations.h:353
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A dynamic collection of tags featuring fast lookups.
Definition TagSet.h:23
A class to use together with plHashedString for quick comparisons with temporary strings that need no...
Definition HashedString.h:151
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
PL_ALWAYS_INLINE void Remove(const plBitflags< T > &rhs)
Removes the given flag.
Definition Bitflags.h:157
PL_ALWAYS_INLINE bool IsSet(Enum flag) const
Checks if certain flags are set within the bitfield.
Definition Bitflags.h:127
PL_ALWAYS_INLINE void Add(const plBitflags< T > &rhs)
Sets the given flag.
Definition Bitflags.h:151
A handle to a game object.
Definition Declarations.h:76
@ ParentChangesNotifications
The object should send a notification message when the parent is changes.
Definition Declarations.h:189
@ ActiveState
The object/component and all its parents have the active flag.
Definition Declarations.h:179
@ Dynamic
Usually detected automatically. A dynamic object will not cache render data across frames.
Definition Declarations.h:175
@ StaticTransformChangesNotifications
The object should send a notification message if it is static and its transform changes.
Definition Declarations.h:188
@ ChildChangesNotifications
The object should send a notification message when children are added or removed.
Definition Declarations.h:186
@ ComponentChangesNotifications
The object should send a notification message when components are added or removed.
Definition Declarations.h:187
@ ActiveFlag
The object/component has the 'active flag' set.
Definition Declarations.h:178