3#include <Core/Physics/SurfaceResource.h>
4#include <Core/World/Component.h>
5#include <Core/World/World.h>
6#include <GameComponentsPlugin/GameComponentsDLL.h>
15 using StorageType = plInt8;
34 void SetSurface(
const char* szSurface);
35 const char* GetSurface()
const;
47 float m_fImpulse = 0.0f;
50 float m_fDamage = 0.0f;
67 virtual void SerializeComponent(
plWorldWriter& inout_stream)
const override;
68 virtual void DeserializeComponent(
plWorldReader& inout_stream)
override;
71 virtual void OnSimulationStarted()
override;
88 bool m_bSpawnPrefabOnStatic;
106 void SetDeathPrefab(
const char* szPrefab);
107 const char* GetDeathPrefab()
const;
109 void SetFallbackSurfaceFile(
const char* szFile);
110 const char* GetFallbackSurfaceFile()
const;
116 void SpawnDeathPrefab();
Base class of all component types.
Definition Component.h:25
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Shoots a game object in a straight line and uses physics raycasts to detect hits.
Definition ProjectileComponent.h:60
float m_fGravityMultiplier
If 0, the projectile is not affected by gravity.
Definition ProjectileComponent.h:85
plTime m_MaxLifetime
After this time the projectile is removed, if it didn't hit anything yet.
Definition ProjectileComponent.h:97
float m_fMetersPerSecond
The speed at which the projectile flies.
Definition ProjectileComponent.h:82
plSurfaceResourceHandle m_hFallbackSurface
If the projectile hits something that has no valid surface, this surface is used instead.
Definition ProjectileComponent.h:100
plUInt8 m_uiCollisionLayer
Defines which other physics objects the projectile will collide with.
Definition ProjectileComponent.h:91
plBitflags< plPhysicsShapeType > m_ShapeTypesToHit
A broad filter to ignore certain types of colliders.
Definition ProjectileComponent.h:94
plHybridArray< plProjectileSurfaceInteraction, 12 > m_SurfaceInteractions
Specifies how the projectile interacts with different surface types.
Definition ProjectileComponent.h:103
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
A handle to a game object.
Definition Declarations.h:76
For internal use by components to trigger some known behavior. Usually components will post this mess...
Definition TriggerMessage.h:26
Defines what a projectile will do when it hits a surface.
Definition ProjectileComponent.h:14
Enum
Definition ProjectileComponent.h:18
@ PassThrough
Continues flying through the geometry (but may spawn prefabs at the intersection points)
Definition ProjectileComponent.h:23
@ Bounce
Bounces away along the reflected direction. Loses momentum.
Definition ProjectileComponent.h:21
@ Reflect
Bounces away along the reflected direction. Maintains momentum.
Definition ProjectileComponent.h:20
@ Absorb
The projectile simply stops and is deleted.
Definition ProjectileComponent.h:19
@ Attach
Stops at the hit point, does not continue further and attaches itself as a child to the hit object.
Definition ProjectileComponent.h:22
Holds the information about how a projectile interacts with a specific surface type.
Definition ProjectileComponent.h:33
plProjectileReaction::Enum m_Reaction
How the projectile itself will react when hitting the surface type.
Definition ProjectileComponent.h:41
plString m_sInteraction
Which interaction should be triggered. See plSurfaceResource.
Definition ProjectileComponent.h:44
plSurfaceResourceHandle m_hSurface
The surface type (and derived ones) for which this interaction is used.
Definition ProjectileComponent.h:38
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12