当前位置: 首页 > news >正文

UEC++UNiagaraFunctionLibrary源代码

UNiagaraFunctionLibrary是Epic Games提供的用于访问Niagara粒子系统的C++和蓝图函数库。核心功能包括SpawnSystemAtLocation等常用函数,用于在指定位置生成Niagara系统组件,支持设置位置、旋转、缩放等参数。该库还提供管理粒子系统生命周期、设置网格参数(静态/骨骼网格体)、纹理覆盖以及GPU光线追踪碰撞组等功能,为Niagara特效系统提供全面的编程接口和控制能力。

// Copyright Epic Games, Inc. All Rights Reserved.#pragma once#include "CoreMinimal.h"
#include "UObject/ObjectMacros.h"
#include "Engine/EngineTypes.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "NiagaraComponentPool.h"
#include "NiagaraCommon.h"
#include "VectorVM.h"
#include "NiagaraSystem.h"
#include "Particles/ParticleSystemComponent.h"
#include "NiagaraFunctionLibrary.generated.h"class UNiagaraComponent;
class USceneComponent;
class UVolumeTexture;/**
* A C++ and Blueprint accessible library of utility functions for accessing Niagara simulations
* All positions & orientations are returned in Unreal reference frame & units, assuming the Leap device is located at the origin.
*/
UCLASS(MinimalAPI)
class UNiagaraFunctionLibrary : public UBlueprintFunctionLibrary
{GENERATED_UCLASS_BODY()public:UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara System", WorldContext = "WorldContextObject", UnsafeDuringActorConstruction = "true"))static NIAGARA_API UNiagaraComponent* SpawnSystemAtLocationWithParams(const FFXSystemSpawnParameters& SpawnParams);UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara System", UnsafeDuringActorConstruction = "true"))static NIAGARA_API UNiagaraComponent* SpawnSystemAttachedWithParams(const FFXSystemSpawnParameters& SpawnParams);/*** Spawns a Niagara System at the specified world location/rotation* @return			The spawned UNiagaraComponent*/UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara System", WorldContext = "WorldContextObject", UnsafeDuringActorConstruction = "true"))static NIAGARA_API UNiagaraComponent* SpawnSystemAtLocation(const UObject* WorldContextObject, class UNiagaraSystem* SystemTemplate, FVector Location, FRotator Rotation = FRotator::ZeroRotator, FVector Scale = FVector(1.f), bool bAutoDestroy = true, bool bAutoActivate = true, ENCPoolMethod PoolingMethod = ENCPoolMethod::None, bool bPreCullCheck = true);UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara System", UnsafeDuringActorConstruction = "true"))static NIAGARA_API UNiagaraComponent* SpawnSystemAttached(UNiagaraSystem* SystemTemplate, USceneComponent* AttachToComponent, FName AttachPointName, FVector Location, FRotator Rotation, EAttachLocation::Type LocationType, bool bAutoDestroy, bool bAutoActivate = true, ENCPoolMethod PoolingMethod = ENCPoolMethod::None, bool bPreCullCheck = true);static NIAGARA_API UNiagaraComponent* SpawnSystemAttached(UNiagaraSystem* SystemTemplate, USceneComponent* AttachToComponent, FName AttachPointName, FVector Location, FRotator Rotation, FVector Scale, EAttachLocation::Type LocationType, bool bAutoDestroy, ENCPoolMethod PoolingMethod, bool bAutoActivate = true, bool bPreCullCheck = true);/** Sets a Niagara StaticMesh parameter by name, overriding locally if necessary.*/UFUNCTION(BlueprintCallable, Category = Niagara, meta = (DisplayName = "Set Niagara Static Mesh Component"))static NIAGARA_API void OverrideSystemUserVariableStaticMeshComponent(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, UStaticMeshComponent* StaticMeshComponent);UFUNCTION(BlueprintCallable, Category = Niagara, meta = (DisplayName = "Set Niagara Static Mesh Directly"))static NIAGARA_API void OverrideSystemUserVariableStaticMesh(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, UStaticMesh* StaticMesh);/** Get the skeletal mesh data interface by name .*/static NIAGARA_API class UNiagaraDataInterfaceSkeletalMesh* GetSkeletalMeshDataInterface(UNiagaraComponent* NiagaraSystem, const FString& OverrideName);/** Sets a Niagara StaticMesh parameter by name, overriding locally if necessary.*/UFUNCTION(BlueprintCallable, Category = Niagara, meta = (DisplayName = "Set Niagara Skeletal Mesh Component"))static NIAGARA_API void OverrideSystemUserVariableSkeletalMeshComponent(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, USkeletalMeshComponent* SkeletalMeshComponent);/** Sets the SamplingRegion to use on the skeletal mesh data interface, this is destructive as it modifies the data interface. */UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetSkeletalMeshDataInterfaceSamplingRegions(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, const TArray<FName>& SamplingRegions);/** Sets the Filtered Bones to use on the skeletal mesh data interface, this is destructive as it modifies the data interface. */UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetSkeletalMeshDataInterfaceFilteredBones(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, const TArray<FName>& FilteredBones);/** Sets the Filtered Sockets to use on the skeletal mesh data interface, this is destructive as it modifies the data interface. */UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetSkeletalMeshDataInterfaceFilteredSockets(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, const TArray<FName>& FilteredSockets);/** Sets managed mode parameters for the Scene capture 2D  data interface, this is destructive as it modifies the data interface. */UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetSceneCapture2DDataInterfaceManagedMode(UNiagaraComponent* NiagaraSystem, const FName& DIName,ESceneCaptureSource ManagedCaptureSource,FIntPoint ManagedTextureSize,ETextureRenderTargetFormat ManagedTextureFormat,ECameraProjectionMode::Type ManagedProjectionType,float ManagedFOVAngle,float ManagedOrthoWidth,bool bManagedCaptureEveryFrame,bool bManagedCaptureOnMovement,const TArray<AActor*> &ShowOnlyActors);/** Overrides the Texture Object for a Niagara Texture Data Interface User Parameter.*/UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetTextureObject(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, UTexture* Texture);/** Overrides the 2D Array Texture for a Niagara 2D Array Texture Data Interface User Parameter.*/UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetTexture2DArrayObject(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, class UTexture2DArray* Texture);/** Overrides the Volume Texture for a Niagara Volume Texture Data Interface User Parameter.*/UFUNCTION(BlueprintCallable, Category = Niagara)static NIAGARA_API void SetVolumeTextureObject(UNiagaraComponent* NiagaraSystem, const FString& OverrideName, UVolumeTexture* Texture);/** Finds an array interface of the given class. */static NIAGARA_API UNiagaraDataInterface* GetDataInterface(UClass* DIClass, UNiagaraComponent* NiagaraSystem, FName OverrideName);/** Finds an array interface of the given class. */template<class TDIType>static TDIType* GetDataInterface(UNiagaraComponent* NiagaraSystem, FName OverrideName){return (TDIType*)GetDataInterface(TDIType::StaticClass(), NiagaraSystem, OverrideName);}//This is gonna be totally reworked
// 	UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara System", UnsafeDuringActorConstruction = "true"))
// 	static void SetUpdateScriptConstant(UNiagaraComponent* Component, FName EmitterName, FName ConstantName, FVector Value);UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara parameter collection", WorldContext = "WorldContextObject"))static NIAGARA_API UNiagaraParameterCollectionInstance* GetNiagaraParameterCollection(UObject* WorldContextObject, UNiagaraParameterCollection* Collection);static NIAGARA_API const TArray<FNiagaraFunctionSignature>& GetVectorVMFastPathOps(bool bIgnoreConsoleVariable = false);static NIAGARA_API bool DefineFunctionHLSL(const FNiagaraFunctionSignature& FunctionSignature, FString& HlslOutput);static NIAGARA_API bool GetVectorVMFastPathExternalFunction(const FVMExternalFunctionBindingInfo& BindingInfo, FVMExternalFunction &OutFunc);//Functions providing access to HWRT collision specific features/** Sets the Niagara GPU ray traced collision group for the give primitive component. */UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara collision ray tracing", WorldContext = "WorldContextObject"))static NIAGARA_API void SetComponentNiagaraGPURayTracedCollisionGroup(UObject* WorldContextObject, UPrimitiveComponent* Primitive, int32 CollisionGroup);/** Sets the Niagara GPU ray traced collision group for all primitive components on the given actor. */UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara collision ray tracing", WorldContext = "WorldContextObject"))static NIAGARA_API void SetActorNiagaraGPURayTracedCollisionGroup(UObject* WorldContextObject, AActor* Actor, int32 CollisionGroup);/** Returns a free collision group for use in HWRT collision group filtering. Returns -1 on failure. */UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara collision ray tracing", WorldContext = "WorldContextObject"))static NIAGARA_API int32 AcquireNiagaraGPURayTracedCollisionGroup(UObject* WorldContextObject);/** Releases a collision group back to the system for use by ohers. */UFUNCTION(BlueprintCallable, Category = Niagara, meta = (Keywords = "niagara collision ray tracing", WorldContext = "WorldContextObject"))static NIAGARA_API void ReleaseNiagaraGPURayTracedCollisionGroup(UObject* WorldContextObject, int32 CollisionGroup);
private:static NIAGARA_API void InitVectorVMFastPathOps();static NIAGARA_API TArray<FNiagaraFunctionSignature> VectorVMOps;static NIAGARA_API TArray<FString> VectorVMOpsHLSL;
};

http://www.dtcms.com/a/576807.html

相关文章:

  • 小杰-大模型(twelve)——大模型部署与应用——gradipo-实现UI界面
  • Python基础入门
  • 【React Native】粘性布局StickyScrollView
  • 无人机RTMP推流平台EasyDSS:构建新一代智能交通视频监控系统
  • 从大数据角度看时序数据库选型:Apache IoTDB的实战经验分享
  • Apache Drill 连接 MySQL 或 PostgreSQL 数据库
  • React Native App 图表绘制完整实现指南
  • 做招商加盟网站怎么样济南网站优化的周期
  • 怡梦姗网站做么动漫与游戏制作专业就业方向
  • js原生、vue导出、react导出、axios ( post请求方式)跨平台导出下载四种方式的demo
  • Springboot + vue 宿舍管理系统
  • 【Python3教程】Python3高级篇之pip标准包管理工具
  • 段权限检查(Segement Privilege Check)
  • JD京东线下HR面(准备)
  • 构建高可靠 OpenEuler 运维体系:从虚拟化部署到 Systemd 自动化核心实践
  • 让医学影像跨越“域”的鸿沟:FAMNet 的频域觉知匹配新思路
  • 麒麟Server版安装EMQX
  • 数字机器人教学项目开发:基于Python的教育技术创新实践
  • 《C语言疑难点 --- C语内存函数专题》
  • 公司网站建设文章wordpress cms主题教程
  • 第十天~ARXML IPDU Group全面解析:从基础到高级批量控制策略
  • 【029】智能停车计费系统
  • 51CTO学院个人网站开发视频经典 wordpress主题下载
  • Java大厂面试真题:Spring Boot + 微服务 + 缓存架构三轮技术拷问实录
  • 患者随访管理抖音快手微信小程序看广告流量主开源
  • 做视频资源网站有哪些内容网站浮动代码
  • c#笔记之类的继承
  • Flink 流式计算的状态之道从 Table/SQL 语义到算子状态与 TTL 精准控制
  • 嘉兴做微网站多少钱有哪些好的网站
  • ps -ef | grep redis