3#include <GameEngine/GameEngineDLL.h>
5#include <Core/Prefabs/PrefabResource.h>
6#include <Core/World/World.h>
7#include <Foundation/Types/RangeView.h>
13 using StorageType = plUInt16;
28 StorageType SpawnAtStart : 1;
29 StorageType SpawnContinuously : 1;
30 StorageType AttachAsChild : 1;
31 StorageType SpawnInFlight : 1;
70 bool CanTriggerManualSpawn()
const;
86 void SetPrefabFile(
const char* szFile);
87 const char* GetPrefabFile()
const;
90 void SetSpawnAtStart(
bool b);
91 bool GetSpawnAtStart()
const;
94 void SetSpawnContinuously(
bool b);
95 bool GetSpawnContinuously()
const;
98 void SetAttachAsChild(
bool b);
99 bool GetAttachAsChild()
const;
115 void SetParameter(
const char* szKey,
const plVariant& value);
116 void RemoveParameter(
const char* szKey);
117 bool GetParameter(
const char* szKey,
plVariant& out_value)
const;
125 virtual void DoSpawn(
const plTransform& tLocalSpawn);
126 bool SpawnOnce(
const plVec3& vLocalOffset);
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
See plArrayMapBase for details.
Definition ArrayMap.h:149
Base class of all component types.
Definition Component.h:25
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void OnDeactivated()
This method is called when the component gets deactivated.
Definition Component.cpp:142
virtual void OnSimulationStarted()
This method is called once for active components, at the start of the next world update,...
Definition Component.cpp:144
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Definition ComponentManager.h:88
This class uses delegates to define a range of values that can be enumerated using a forward iterator...
Definition RangeView.h:24
Spawns instances of prefabs dynamically at runtime.
Definition SpawnComponent.h:47
plArrayMap< plHashedString, plVariant > m_Parameters
Key/value pairs of parameters to pass to the prefab instantiation.
Definition SpawnComponent.h:120
plTime m_DelayRange
For scheduled spawns (continuous / at start) this is an additional random range on top of the minimum...
Definition SpawnComponent.h:109
plAngle m_MaxDeviation
The spawned object's orientation may deviate by this amount around the X axis. 180° is completely ran...
Definition SpawnComponent.h:112
plTime m_MinDelay
The minimum delay between spawning objects. This is also enforced for manually spawning things.
Definition SpawnComponent.h:106
plVariant is a class that can store different types of variables, which is useful in situations where...
Definition Variant.h:44
static plVec3Template< float > MakeZero()
Definition Vec3.h:38
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
For internal use by components to trigger some known behavior. Usually components will post this mess...
Definition TriggerMessage.h:26
Definition SpawnComponent.h:27
Definition SpawnComponent.h:12
Enum
Definition SpawnComponent.h:16
@ AttachAsChild
All objects spawned will be attached as children to this node.
Definition SpawnComponent.h:20
@ SpawnInFlight
[internal] A spawn trigger message has been posted.
Definition SpawnComponent.h:21
@ SpawnContinuously
Every time a scheduled spawn was done, a new one is scheduled.
Definition SpawnComponent.h:19
@ SpawnAtStart
The component will schedule a spawn once at creation time.
Definition SpawnComponent.h:18
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12