DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ AddAsChild()

void Particle::AddAsChild ( Object parent,
vector local_pos = "0 0 0",
vector local_ori = "0 0 0",
bool force_rotation_to_world = false )
inlineprivate

Attaches this particle onto some object. If null value is provided then the particle will be detached from the current parent.

Заметки
Due to the members being filled in, AddChild/RemoveChild cannot be used with Particle when using Wiggle
Аргументы
parentObject Parent onto which this particle will be attached
local_posvector Attachment position local to the parent (optional)
local_orivector Orientation local to the parent (Pitch, Yawn, Roll in degrees) (Optional)
force_rotation_to_worldbool Force rotation to be in WS (Optional)

См. определение в файле Particle.c строка 563

564 {
565 if (ToDelete())
566 return;
567
568 if (parent)
569 {
570 // AddAsChild method is sometimes called from a timer.
571 // Due to that it is necesarry to use ToDelete() here to check if the parent object is flagged for deletion or not on client,
572 // because sometimes this code is executed before the parent's destructor from where this would normally be handled.
573 if (!parent.ToDelete())
574 {
575 SetPosition(local_pos);
576 SetOrientation(local_ori);
577 m_ParentObject = parent;
578 m_DefaultPos = local_pos;
579 m_ForceOrientationRelativeToWorld = force_rotation_to_world;
580
583
584 parent.AddChild(this, -1, false);
585 }
586 }
587 else
588 {
589 if (m_ParentObject && !m_ParentObject.ToDelete())
590 {
591 m_ParentObject.RemoveChild(this, true);
592 m_ParentObject = null;
593 }
594 }
595 }
vector m_DefaultPos
Used for Wiggle API, to restore after unparenting.
Определения Particle.c:33
Object m_ParticleEffect
The child object which contains the actual particle.
Определения Particle.c:50
bool m_ForceOrientationRelativeToWorld
Used for Wiggle API, to restore after unparenting.
Определения Particle.c:29
Object m_ParentObject
Parent Object the Particle is child of.
Определения Particle.c:48
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:438
proto native void AddChild(Widget child, bool immedUpdate=true)

Перекрестные ссылки AddChild(), m_DefaultPos, m_ForceOrientationRelativeToWorld, m_ParentObject, m_ParticleEffect и SetPosition().

Используется в EffectParticle::AddAsChild(), CreateOnObject() и RandomizeOrientation().