MCPcopy Create free account
hub / github.com/defold/defold / SampleProperty

Function SampleProperty

engine/particle/src/particle.cpp:177–191  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175 }
176
177 void SampleProperty(const dmParticleDDF::SplinePoint* segments, uint32_t segments_count, LinearSegment* out_segments)
178 {
179 float dx = 1.0f / PROPERTY_SAMPLE_COUNT;
180 float x0 = 0.0f;
181 float y0 = GetY(segments, segments_count, x0);
182 for (uint32_t j = 0; j < PROPERTY_SAMPLE_COUNT; ++j)
183 {
184 float y1 = GetY(segments, segments_count, x0 + dx);
185 out_segments[j].m_X = x0;
186 out_segments[j].m_Y = y0;
187 out_segments[j].m_K = (y1 - y0) * PROPERTY_SAMPLE_COUNT;
188 x0 += dx;
189 y0 = y1;
190 }
191 }
192
193 static void InitEmitter(Emitter* emitter, dmParticleDDF::Emitter* emitter_ddf, uint32_t original_seed)
194 {

Callers 1

LoadResourcesFunction · 0.85

Calls 1

GetYFunction · 0.85

Tested by

no test coverage detected