Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
YasiuMathBPLibrary.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Grzegorz Krug.
3 * All Rights Reserved.
4 */
5
7
8#pragma once
9
10#include "CoreMinimal.h"
11#include "Templates/Tuple.h"
12#include "Kismet/BlueprintFunctionLibrary.h"
13
14#include "YasiuMathBPLibrary.generated.h"
15
16
20UCLASS(BlueprintType)
21class UYasiuMathFunctionLibrary : public UBlueprintFunctionLibrary {
22 GENERATED_BODY()
23
24public:
33 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Trigonometry")
34 void SpreadPointsOnTangentByXY( TArray<FVector2D>& out, const double X, const double Y, const double spreadDistance );
35
44 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Trigonometry")
45 void SpreadPointsOnTangentByAngleRadius( TArray<FVector2D>& out, double angle, double radius, double spreadDistance );
46
47
60 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Trigonometry")
61 double FindMinimalRadiusForIntersectingTangentsOnArc( double alfa, double beta, double symmetricWidth );
62
79 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Trigonometry")
80 FVector2D FindMinimalRadiusForIntersectingTangentsOnArcAsymmetric( double alfa, double beta, double widthA, double widthB );
81
87 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Convex")
88 void ConvexHull2D( TArray<int>& result, const TArray<FVector2D>& polygonPoints );
89
93 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Angle")
94 double ClipAngleToCycle( double angle, double period );
95
105 UFUNCTION(BlueprintCallable, Category = "Math|Yasiu|Angle")
106 FVector RotateBoundingBox( const FVector& BoxSize, const FQuat& Rotation );
107};
BP Function library having all implementations ready for use in BP Editor.
Definition YasiuMathBPLibrary.h:21
FVector RotateBoundingBox(const FVector &BoxSize, const FQuat &Rotation)
Rotate Box and calculate new bounding box along same axes to fix old box inside.213123.
double FindMinimalRadiusForIntersectingTangentsOnArc(double alfa, double beta, double symmetricWidth)
Find radius of circle for both tangent lines that intersect. Tangents on circle are defined by angle ...
void ConvexHull2D(TArray< int > &result, const TArray< FVector2D > &polygonPoints)
Find points that create convex hull in 2D Space.
FVector2D FindMinimalRadiusForIntersectingTangentsOnArcAsymmetric(double alfa, double beta, double widthA, double widthB)
Find radius of circle for both tangent line that intersect. Asymmetry comes from 2 different widths....
void SpreadPointsOnTangentByXY(TArray< FVector2D > &out, const double X, const double Y, const double spreadDistance)
Spread points on tangent line to arc located by XY offset from arc center point 0,...
double ClipAngleToCycle(double angle, double period)
Normalize angle to its period, to be in range <0, period>.
void SpreadPointsOnTangentByAngleRadius(TArray< FVector2D > &out, double angle, double radius, double spreadDistance)
Spread points on tangent line to arc located by angle and radius of given arc. Points are moved away ...