Unreal Engine/C++
[Unreal Engine 4 C++] C++에서 구현한 정적 함수와 일반 함수의 블루프린트에서 사용시 차이점
한돌이
2022. 9. 26. 14:19
UFUNCTION(BlueprintCallable, Category = "PRMovementSystem|DistanceMatching")
bool PredictStopLocation(FVector& OutStopLocation, const FVector& CurrentLocation, const FVector& Velocity, const FVector& Acceleration, float Friction, float BrakingDeceleration, const float TimeStep, const int MaxSimulationIterations = 100);
위의 함수는 MovementSystem이라는 ActorComponent에 구현된 static을 사용하지 않은 일반 함수입니다. 일반 함수를 구현하여 블루프린트에서 사용할 경우 다음과 같이 MovementSystem노드에서 해당 함수의 노드를 끌어서 사용하게됩니다.
UFUNCTION(BlueprintCallable, Category = "PRMovementSystem|DistanceMatching")
static bool PredictStopLocation(FVector& OutStopLocation, const FVector& CurrentLocation, const FVector& Velocity, const FVector& Acceleration, float Friction, float BrakingDeceleration, const float TimeStep, const int MaxSimulationIterations = 100);
이제 함수에 static을 사용하여 정적 함수로 구현하고 블루프린트에서 사용할 경우 다음과 같이 MovementSystem노드에서 해당 함수의 노드를 끌어서 사용하지 않아도 됩니다.