diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Filters/Particles/WorldParticleCollider.h |
Diffstat (limited to 'Runtime/Filters/Particles/WorldParticleCollider.h')
-rw-r--r-- | Runtime/Filters/Particles/WorldParticleCollider.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Runtime/Filters/Particles/WorldParticleCollider.h b/Runtime/Filters/Particles/WorldParticleCollider.h new file mode 100644 index 0000000..f6db8af --- /dev/null +++ b/Runtime/Filters/Particles/WorldParticleCollider.h @@ -0,0 +1,33 @@ +#ifndef WORLDPARTICLECOLLIDER_H +#define WORLDPARTICLECOLLIDER_H + +#include "Runtime/BaseClasses/GameObject.h" +#include "ParticleStruct.h" + + + +class WorldParticleCollider : public Unity::Component +{ +public: + REGISTER_DERIVED_CLASS (WorldParticleCollider, Unity::Component) + DECLARE_OBJECT_SERIALIZE (WorldParticleCollider) + + WorldParticleCollider (MemLabelId label, ObjectCreationMode mode); + + virtual void Reset (); + + void UpdateParticleCollider( ParticleArray& particles, PrivateParticleInfo& privateInfo, float deltaTime ); + +private: + /// The velocity at which a particle is killed after the bounced velocity is calculated + float m_MinKillVelocity; + float m_BounceFactor; + /// Seconds of energy a particle loses when colliding + float m_CollisionEnergyLoss; + /// Collides the particles with every collider whose layerMask & m_CollidesWith != 0 + BitField m_CollidesWith; + /// Should we send out a collision message for every particle that has collided? + bool m_SendCollisionMessage; +}; + +#endif |