MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Init

Method Init

Source/Engine/Particles/ParticleSystem.cpp:22–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void ParticleSystem::Init(ParticleEmitter* emitter, float duration, float fps)
23{
24 CHECK(IsVirtual());
25 ScopeLock lock(Locker);
26 Version++;
27 FramesPerSecond = fps;
28 DurationFrames = Math::CeilToInt(duration * fps);
29 Emitters.Resize(0);
30 Tracks.Resize(0);
31 if (emitter)
32 {
33 Emitters.Add(emitter);
34 auto& track = Tracks.AddOne();
35 track.Type = Track::Types::Emitter;
36 track.Flag = Track::Flags::None;
37 track.ChildrenCount = 0;
38 track.ParentIndex = -1;
39 track.Name = TEXT("");
40 track.Disabled = false;
41 track.AsEmitter.Index = 0;
42 track.AsEmitter.StartFrame = 0;
43 track.AsEmitter.DurationFrames = DurationFrames;
44#if !BUILD_RELEASE
45 _debugName = StringUtils::GetFileNameWithoutExtension(emitter->GetPath());
46#endif
47 }
48}
49
50BytesContainer ParticleSystem::LoadTimeline() const
51{

Callers

nothing calls this directly

Calls 6

IsVirtualFunction · 0.85
AddOneMethod · 0.80
CeilToIntFunction · 0.50
ResizeMethod · 0.45
AddMethod · 0.45
GetPathMethod · 0.45

Tested by

no test coverage detected