Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
UYasiuMathFunctionLibrary Class Reference

#include <YasiuMathBPLibrary.h>

Inheritance diagram for UYasiuMathFunctionLibrary:

Public Member Functions

void SpreadPointsOnTangentByXY (TArray< FVector2D > &out, const double X, const double Y, const double spreadDistance)
void SpreadPointsOnTangentByAngleRadius (TArray< FVector2D > &out, double angle, double radius, double spreadDistance)
double FindMinimalRadiusForIntersectingTangentsOnArc (double alfa, double beta, double symmetricWidth)
FVector2D FindMinimalRadiusForIntersectingTangentsOnArcAsymmetric (double alfa, double beta, double widthA, double widthB)
void ConvexHull2D (TArray< int > &result, const TArray< FVector2D > &polygonPoints)
double ClipAngleToCycle (double angle, double period)
 Normalize angle to its period, to be in range <0, period>.

Detailed Description

BP Function library having all important functions exposed for BP Editor

Member Function Documentation

◆ ClipAngleToCycle()

double UYasiuMathFunctionLibrary::ClipAngleToCycle ( double angle,
double period )

Normalize angle to its period, to be in range <0, period>.

Warning
Does not support negative periods

◆ ConvexHull2D()

void UYasiuMathFunctionLibrary::ConvexHull2D ( TArray< int > & result,
const TArray< FVector2D > & polygonPoints )

Find points that create convex hull in 2D Space

Parameters
resultResult array of input point indexes
polygonPointsArray of points in 2D Space

◆ FindMinimalRadiusForIntersectingTangentsOnArc()

double UYasiuMathFunctionLibrary::FindMinimalRadiusForIntersectingTangentsOnArc ( double alfa,
double beta,
double symmetricWidth )

Find radius of circle for both tangent lines that intersect. Tangents on circle are defined by angle Alfa and Beta. Tangent line distance to meeting point from circle intersection is symmetricWidth. Angle is in radians.

\[ R=\frac{\sin(\alpha)*A-\sin(\beta)*B}{\cos(\beta)-\cos(\alpha)} \]

Parameters
alfaTangent point location defined by angle
betaTangent point location defined by angle
symmetricWidthWidth from tangent point to intersect

◆ FindMinimalRadiusForIntersectingTangentsOnArcAsymmetric()

FVector2D UYasiuMathFunctionLibrary::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. Tangents on circle are defined by angle Alfa and Beta. Tangent line distance to meeting point from circle intersection is symmetricWidth. Angle is in radians. First radius is bigger.

\[ R=\frac{\sin(\alpha)*A-\sin(\beta)*B}{\cos(\beta)-\cos(\alpha)} \]

Parameters
alfaTangent point location defined by angle
betaTangent point location defined by angle
widthADistance from intersection for point A
widthBDistance from intersection for point B
Returns

◆ SpreadPointsOnTangentByAngleRadius()

void UYasiuMathFunctionLibrary::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 from tangent point by spreadDistance

Parameters
angleTangent location defined by angle
radiusRadius of arc
spreadDistanceDistance to spread in one direction from tangent point
Returns
TArray of 2 points

◆ SpreadPointsOnTangentByXY()

void UYasiuMathFunctionLibrary::SpreadPointsOnTangentByXY ( TArray< FVector2D > & out,
const double X,
const double Y,
const double spreadDistance )
Parameters
XPosition X
YPosition Y
spreadDistanceDistance to spread in one direction from tangent point
Returns
TArray of 2 points

The documentation for this class was generated from the following file: