15 enum PlayParticleFlags
23 enum StopParticleFlags
53 enum ParticlePropertiesFlags
65 class ParticleProperties
83 void ~ParticleProperties()
92 proto
Class GetOwner();
93 proto
vector GetLocalPos();
94 proto
vector GetLocalOri();
95 proto
int GetPPFlags();
96 proto
bool IsPlayOnCreation();
97 proto
bool IsForceWorldRotation();
98 proto
bool IsKeepParentOnEnd();
128 m_ParticleEffect =
this;
137 override protected void ParticleInit() {}
151 void DisableAutoDestroy()
160 proto native
int GetParticleAutoDestroyFlags();
180 int flags = ParticlePropertiesFlags.NONE;
184 flags = flags | ParticlePropertiesFlags.PLAY_ON_CREATION;
187 if (forceWorldRotation)
189 flags = flags | ParticlePropertiesFlags.FORCE_WORLD_ROT;
192 return CreateParticleEx(
id, pos, flags, parent, ori, owner);
207 string particlePath =
ParticleList.GetParticleFullPath(
id);
208 if (particlePath ==
"")
210 ErrorEx(
string.Format(
"Could not create ParticleSource as particle id %1 is invalid.",
id));
217 pos = parent.GetPosition();
220 p.SetParticle(particlePath);
221 ParticleProperties props =
new ParticleProperties(localPos, flags, parent, ori, owner);
222 p.ApplyProperties(props);
236 override static Particle CreateOnObject(
239 vector local_pos =
"0 0 0",
240 vector local_ori =
"0 0 0",
241 bool force_world_rotation =
false )
243 return CreateParticle(
particle_id, local_pos,
false, parent_obj, local_ori, force_world_rotation);
251 return CreateOnObject(
particle_id, parent_obj, local_pos, local_ori);
264 return CreateParticle(
particle_id, global_pos,
false,
null, global_ori, force_world_rotation);
272 return CreateInWorld(
particle_id, global_pos, global_ori );
295 return CreateParticle(
particle_id, local_pos,
true, parent_obj, local_ori, force_world_rotation);
303 return PlayOnObject(
particle_id, parent_obj, local_pos, local_ori);
314 return CreateParticle(
particle_id, global_pos,
true);
339 private proto
bool PlayParticleNative(
int flags);
346 override bool PlayParticleEx(
int particle_id = -1,
int flags = 0)
355 return PlayParticleNative(flags);
365 private proto
bool StopParticleNative(
int flags);
372 override bool StopParticle(
int flags = 0)
374 return StopParticleNative(flags);
381 private proto native
bool ResetParticleNative();
387 override bool ResetParticle()
389 return ResetParticleNative();
396 private proto native
bool RestartParticleNative();
402 override bool RestartParticle()
404 return RestartParticleNative();
411 private proto
bool IsParticlePlayingNative();
417 override bool IsParticlePlaying()
419 return IsParticlePlayingNative();
436 private proto native
bool SetParticleNative(
string path);
444 private bool SetParticle(
string path)
446 return SetParticleNative(
path);
454 bool SetParticleByID(
int id)
456 return SetParticle(
ParticleList.GetParticleFullPath(
id));
484 private proto
bool GetParticleNative(out
string path, EGetParticleMode mode);
492 bool GetParticle(out
string path, EGetParticleMode mode)
494 return GetParticleNative(
path, mode);
501 override int GetParticleID()
504 if (GetParticle(
path, EGetParticleMode.FILE))
516 int GetParticleIDLegacy()
519 if (GetParticle(
path, EGetParticleMode.NO_EXT))
540 private proto native
bool ApplyPropertiesNative(ParticleProperties properties);
547 bool ApplyProperties(ParticleProperties properties)
549 return ApplyPropertiesNative(properties);
566 override Object GetDirectParticleEffect()
575 override Object GetParticleParent()
584 private proto
bool HasActiveParticleNative();
590 override bool HasActiveParticle()
592 return HasActiveParticleNative();
600 private proto
int GetParticleCountNative();
607 override int GetParticleCount()
609 return GetParticleCountNative();
616 private proto
bool IsRepeatNative();
622 override bool IsRepeat()
624 return IsRepeatNative();
631 private proto
float GetMaxLifetimeNative();
637 override float GetMaxLifetime()
639 return GetMaxLifetimeNative();
646 proto native
Class GetOwner();
652 proto native
void SetOwner(
Class owner);
657 proto native
void Orphan();
678 proto native
int GetIndex();
694 proto
int GetCountID();
700 proto native
static int GetStaticCount();
706 proto native
static int GetStaticActiveCount();
722 override protected void OnParticleParented(
IEntity parent)
726 super.OnParticleParented(parent);
732 override protected void OnParticleUnParented(
IEntity parent)
738 if (!m_WiggleProcessing && IsWiggling())
740 float randomAngle = m_MaxOriWiggle;
741 float randomInterval = m_MaxOriInterval;
742 m_DefaultPos = m_DefaultWorldPos;
743 m_DefaultOri = m_DefaultWorldOri;
746 SetWiggle(randomAngle, randomInterval);
749 super.OnParticleUnParented(parent);
755 override protected void OnParticleStop()
760 delete m_RandomizeOri;
763 super.OnParticleStop();
783 override void AddAsChild(
Object parent,
vector local_pos =
"0 0 0",
vector local_ori =
"0 0 0",
bool force_rotation_to_world =
false)
785 int flags = ParticlePropertiesFlags.NONE;
787 if (force_rotation_to_world)
788 flags = ParticlePropertiesFlags.FORCE_WORLD_ROT;
790 ParticleProperties props =
new ParticleProperties(local_pos, flags, parent, local_ori);
791 ApplyProperties(props);
808 override void SetParticleParam(
int parameter_id,
float value )
819 override void SetParameter(
int emitter,
int parameter,
float value)
830 override void GetParameter(
int emitter,
int parameter, out
float value)
841 override float GetParameterEx(
int emitter,
int parameter)
853 override void ScaleParticleParamFromOriginal(
int parameter_id,
float coef )
856 for (
int i = 0; i < emitors; ++i)
869 override void ScaleParticleParam(
int parameter_id,
float coef )
872 for (
int i = 0; i < emitors; ++i)
886 override void IncrementParticleParamFromOriginal(
int parameter_id,
float value )
889 for (
int i = 0; i < emitors; ++i)
903 override void IncrementParticleParam(
int parameter_id,
float value )
906 for (
int i = 0; i < emitors; ++i)
929 override void SetWiggle(
float random_angle,
float random_interval)
931 if (random_angle != 0 || random_interval != 0)
935 m_MaxOriWiggle = random_angle;
936 m_MaxOriInterval = random_interval;
948 m_DefaultOri = GetLocalYawPitchRoll();
949 m_DefaultWorldPos = GetWorldPosition();
950 m_DefaultWorldOri = GetYawPitchRoll();
951 m_ForceOrientationRelativeToWorld = IsHierarchyPositionOnly();
954 super.SetWiggle(random_angle, random_interval);
960 override void StopWiggle()
962 bool wiggling = IsWiggling();
969 int flags = ParticlePropertiesFlags.NONE;
971 if (m_ForceOrientationRelativeToWorld)
972 flags = ParticlePropertiesFlags.FORCE_WORLD_ROT;
974 ParticleProperties prop =
new ParticleProperties(m_DefaultPos, flags, GetParticleParent(), m_DefaultOri, GetOwner());
975 ApplyProperties(prop);
982 override private void RandomizeOrientation()
987 m_WiggleProcessing =
true;
989 if ( !m_RandomizeOri.IsRunning() )
990 m_RandomizeOri.Run(
Math.RandomFloat(0, m_MaxOriInterval) ,
this,
"RandomizeOrientation",
null,
false);
992 int flags = ParticlePropertiesFlags.NONE;
994 if (m_ForceOrientationRelativeToWorld)
995 flags = ParticlePropertiesFlags.FORCE_WORLD_ROT;
997 ParticleProperties prop =
new ParticleProperties(m_DefaultPos, flags, GetParticleParent(), m_DefaultOri + RandWiggleVector(), GetOwner());
998 ApplyProperties(prop);
1000 m_WiggleProcessing =
false;
1013 override private void UpdateState() {
ErrorEx(
"Should not be in use on ParticleSource."); }
1016 override private void DestroyParticleEffect() {
ErrorEx(
"Should not be in use on ParticleSource."); }
1019 override private void CreateParticleEffect() {
ErrorEx(
"Should not be in use on ParticleSource."); }
1022 override protected void EOnFrame(
IEntity other,
float timeSlice) {
ErrorEx(
"Should not be in use on ParticleSource."); }
1025 override private void OnCheckAutoDelete() {
ErrorEx(
"Should not be in use on ParticleSource."); }
1028 override private void OnToDelete() {
ErrorEx(
"Should not be in use on ParticleSource."); }