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

Method GetLayout

Source/Engine/Particles/ParticleEmitter.cpp:511–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511Array<ParticleEmitter::Attribute> ParticleEmitter::GetLayout() const
512{
513 Array<Attribute> result;
514 ScopeLock lock(Locker);
515 result.Resize(Graph.Layout.Attributes.Count());
516 for (int32 i = 0; i < result.Count(); i++)
517 {
518 auto& dst = result[i];
519 const auto& src = Graph.Layout.Attributes[i];
520 dst.Name = src.Name;
521 switch (src.ValueType)
522 {
523 case ParticleAttribute::ValueTypes::Float:
524 dst.Format = PixelFormat::R32_Float;
525 break;
526 case ParticleAttribute::ValueTypes::Float2:
527 dst.Format = PixelFormat::R32G32_Float;
528 break;
529 case ParticleAttribute::ValueTypes::Float3:
530 dst.Format = PixelFormat::R32G32B32_Float;
531 break;
532 case ParticleAttribute::ValueTypes::Float4:
533 dst.Format = PixelFormat::R32G32B32A32_Float;
534 break;
535 case ParticleAttribute::ValueTypes::Int:
536 dst.Format = PixelFormat::R32_SInt;
537 break;
538 case ParticleAttribute::ValueTypes::Uint:
539 dst.Format = PixelFormat::R32_UInt;
540 break;
541 }
542 }
543 return result;
544}
545
546#endif

Callers

nothing calls this directly

Calls 2

ResizeMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected