From 19fbe814b35cc7d60a30b50d7fc28bd5e8c29cdb Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Fri, 7 May 2021 17:04:55 +0100 Subject: [PATCH] Blueprint version of SphereOverlapCone should use degrees not radians --- Source/StevesUEHelpers/Public/StevesBPL.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/StevesUEHelpers/Public/StevesBPL.h b/Source/StevesUEHelpers/Public/StevesBPL.h index c33cf4a..afc548d 100644 --- a/Source/StevesUEHelpers/Public/StevesBPL.h +++ b/Source/StevesUEHelpers/Public/StevesBPL.h @@ -9,7 +9,7 @@ /** * Blueprint library exposing various things in a Blueprint-friendly way e.g. using by-value FVectors so they can - * be entered directly if required, rather than const& as in C++ + * be entered directly if required, rather than const& as in C++. Also use degrees not radians. */ UCLASS() class STEVESUEHELPERS_API UStevesBPL : public UBlueprintFunctionLibrary @@ -21,7 +21,7 @@ public: * Return whether a sphere overlaps a cone * @param ConeOrigin Origin of the cone * @param ConeDir Direction of the cone, must be normalised - * @param ConeHalfAngle Half-angle of the cone, in radians + * @param ConeHalfAngle Half-angle of the cone, in degrees * @param Distance Length of the cone * @param SphereCentre Centre of the sphere * @param SphereRadius Radius of the sphere @@ -30,7 +30,7 @@ public: UFUNCTION(BlueprintCallable, Category="StevesUEHelpers|Math") static bool SphereOverlapCone(FVector ConeOrigin, FVector ConeDir, float ConeHalfAngle, float Distance, FVector SphereCentre, float SphereRadius) { - return StevesMathHelpers::SphereOverlapCone(ConeOrigin, ConeDir, ConeHalfAngle, Distance, SphereCentre, SphereRadius); + return StevesMathHelpers::SphereOverlapCone(ConeOrigin, ConeDir, FMath::DegreesToRadians(ConeHalfAngle), Distance, SphereCentre, SphereRadius); } };