|
Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
|
BP Function library having all implementations ready for use in BP Editor. More...
#include <YasiuMathBPLibrary.h>
Public Member Functions | |
| 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,0. Points are moved away from tangent point by spreadDistance. | |
| 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 from tangent point by spreadDistance. | |
| 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 Alfa and Beta. Tangent line distance to meeting point from circle intersection is symmetricWidth. Angle is in radians. | |
| 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. 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. | |
| void | ConvexHull2D (TArray< int > &result, const TArray< FVector2D > &polygonPoints) |
| Find points that create convex hull in 2D Space. | |
| double | ClipAngleToCycle (double angle, double period) |
| Normalize angle to its period, to be in range <0, period>. | |
| FVector | RotateBoundingBox (const FVector &BoxSize, const FQuat &Rotation) |
| Rotate Box and calculate new bounding box along same axes to fix old box inside.213123. | |
BP Function library having all implementations ready for use in BP Editor.
| double UYasiuMathFunctionLibrary::ClipAngleToCycle | ( | double | angle, |
| double | period ) |
Normalize angle to its period, to be in range <0, period>.
| void UYasiuMathFunctionLibrary::ConvexHull2D | ( | TArray< int > & | result, |
| const TArray< FVector2D > & | polygonPoints ) |
Find points that create convex hull in 2D Space.
| result | Result array of input point indexes |
| polygonPoints | Array of points in 2D Space |
| 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)} \]
| alfa | Tangent point location defined by angle |
| beta | Tangent point location defined by angle |
| symmetricWidth | Width from tangent point to intersect |
| 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)} \]
| alfa | Tangent point location defined by angle |
| beta | Tangent point location defined by angle |
| widthA | Distance from intersection for point A |
| widthB | Distance from intersection for point B |
| FVector UYasiuMathFunctionLibrary::RotateBoundingBox | ( | const FVector & | BoxSize, |
| const FQuat & | Rotation ) |
Rotate Box and calculate new bounding box along same axes to fix old box inside.213123.
Helps find suboptimal bounding box for rotated meshes
| BoxSize | Dimension of Bounding box |
| Rotation | Rotation to calculate |
| 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.
| angle | Tangent location defined by angle |
| radius | Radius of arc |
| spreadDistance | Distance to spread in one direction from tangent point |
| void UYasiuMathFunctionLibrary::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,0. Points are moved away from tangent point by spreadDistance.
| X | Position X |
| Y | Position Y |
| spreadDistance | Distance to spread in one direction from tangent point |