1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| class UNiagaraDataInterfaceMousePosition : public UNiagaraDataInterface { GENERATED_UCLASS_BODY()
BEGIN_SHADER_PARAMETER_STRUCT(FShaderParameters, ) SHADER_PARAMETER(FVector4f, MousePosition) END_SHADER_PARAMETER_STRUCT()
public: virtual void PostInitProperties() override;
virtual void GetFunctions(TArray<FNiagaraFunctionSignature>& OutFunctions) override; virtual void GetVMExternalFunction(const FVMExternalFunctionBindingInfo& BindingInfo, void* InstanceData, FVMExternalFunction &OutFunc) override; virtual bool CanExecuteOnTarget(ENiagaraSimTarget Target) const override { return true; } #if WITH_EDITORONLY_DATA virtual bool AppendCompileHash(FNiagaraCompileHashVisitor* InVisitor) const override; virtual bool GetFunctionHLSL(const FNiagaraDataInterfaceGPUParamInfo& ParamInfo, const FNiagaraDataInterfaceGeneratedFunction& FunctionInfo, int FunctionInstanceIndex, FString& OutHLSL) override; virtual void GetParameterDefinitionHLSL(const FNiagaraDataInterfaceGPUParamInfo& ParamInfo, FString& OutHLSL) override; #endif virtual bool UseLegacyShaderBindings() const override { return false; } virtual void BuildShaderParameters(FNiagaraShaderParametersBuilder& ShaderParametersBuilder) const override; virtual void SetShaderParameters(const FNiagaraDataInterfaceSetShaderParametersContext& Context) const override;
virtual bool InitPerInstanceData(void* PerInstanceData, FNiagaraSystemInstance* SystemInstance) override; virtual void DestroyPerInstanceData(void* PerInstanceData, FNiagaraSystemInstance* SystemInstance) override; virtual int32 PerInstanceDataSize() const override; virtual bool HasPreSimulateTick() const override { return true; } virtual bool PerInstanceTick(void* PerInstanceData, FNiagaraSystemInstance* SystemInstance, float DeltaSeconds) override; virtual void ProvidePerInstanceDataForRenderThread(void* DataForRenderThread, void* PerInstanceData, const FNiagaraSystemInstanceID& SystemInstance) override;
void GetMousePositionVM(FVectorVMExternalFunctionContext& Context); private: static const FName GetMousePositionName; };
|