LODCollector in Mass Framework

How does LODCollector work in Mass Framework? Mass Framework is a ECS for managing crowds and traffic in Unreal 5.0 and above.

LODCollector with MassGameplay built-in resources

  • LODCollector Trait

    • Built-in MassGameplay.
    • Trait located At UE5/Engine/Plugins/Runtime/MassGameplay/Source/MassLOD.
    • LODCollector trait shares the same Trait file with SimulationLOD.
    UCLASS(meta = (DisplayName = "LODCollector"))
    class MASSLOD_API UMassLODCollectorTrait : public UMassEntityTraitBase
    {
    	GENERATED_BODY()
    
    public:
    	virtual void BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const override;
    };
    void UMassLODCollectorTrait::BuildTemplate(FMassEntityTemplateBuildContext& BuildContext, const UWorld& World) const
    {
    	BuildContext.AddFragment<FMassViewerInfoFragment>();
    	BuildContext.AddTag<FMassCollectLODViewerInfoTag>();
    	BuildContext.RequireFragment<FTransformFragment>();
    }