mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Expose SphereOverlapCone to blueprints
This commit is contained in:
parent
45a35f0691
commit
267140c350
4
Source/StevesUEHelpers/Private/StevesBPL.cpp
Normal file
4
Source/StevesUEHelpers/Private/StevesBPL.cpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
|
||||||
|
#include "StevesBPL.h"
|
36
Source/StevesUEHelpers/Public/StevesBPL.h
Normal file
36
Source/StevesUEHelpers/Public/StevesBPL.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
// Fill out your copyright notice in the Description page of Project Settings.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "CoreMinimal.h"
|
||||||
|
|
||||||
|
#include "StevesMathHelpers.h"
|
||||||
|
#include "StevesBPL.generated.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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++
|
||||||
|
*/
|
||||||
|
UCLASS()
|
||||||
|
class STEVESUEHELPERS_API UStevesBPL : public UBlueprintFunctionLibrary
|
||||||
|
{
|
||||||
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
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 Distance Length of the cone
|
||||||
|
* @param SphereCentre Centre of the sphere
|
||||||
|
* @param SphereRadius Radius of the sphere
|
||||||
|
* @return True if the sphere overlaps the cone
|
||||||
|
*/
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user