BenVlodgi

Encompasses Point | Volume code exposed to BP

Aug 29th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. // .h
  2. #include "Runtime/Engine/Classes/GameFramework/Volume.h"
  3.  
  4. UFUNCTION(BlueprintCallable, Category = Volume, CallInEditor, meta = (WorldContext = WorldContextObject))
  5. static void EncompassesPoint(AVolume* Volume, FVector Point, float SphereRadius, float& DistanceToPoint, bool& bEncompassesPoint);
  6.  
  7.  
  8.  
  9. // .cpp
  10. void UDaakorunFunctionLibrary::EncompassesPoint(AVolume* Volume, FVector Point, float SphereRadius, float& DistanceToPoint, bool& bEncompassesPoint)
  11. {
  12.     if (IsValid(Volume))
  13.     {
  14.         bEncompassesPoint = Volume->EncompassesPoint(Point, SphereRadius, &DistanceToPoint);
  15.     }
  16.     else
  17.     {
  18.         DistanceToPoint = 0.0f;
  19.         bEncompassesPoint = false;
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment