Yasiu Math 1
Collection of mathematic functions that help create game mechanics and procedural tools
Loading...
Searching...
No Matches
YasiuMath::AngleUtils Namespace Reference

Collection of functions working with angles and rotation. More...

Functions

template<typename T>
static T NormalizeAngleToPeriod (T angle, T period=360.f)
 Normalize angle by removing full periods from value, result is in range <0, period>.
FVector YASIUMATH_API RotateBoundingBox (const FVector &Box, const FQuat &Rotation)
 Rotate Box and calculate new bounding box along same axes to fit old box inside.

Detailed Description

Collection of functions working with angles and rotation.

Function Documentation

◆ NormalizeAngleToPeriod()

template<typename T>
T YasiuMath::AngleUtils::NormalizeAngleToPeriod ( T angle,
T period = 360.f )
static

Normalize angle by removing full periods from value, result is in range <0, period>.

Angle normalization removes any excessive amount of periods from its value.

Warning
Does not support negative periods

◆ RotateBoundingBox()

FVector YASIUMATH_API YasiuMath::AngleUtils::RotateBoundingBox ( const FVector & Box,
const FQuat & Rotation )

Rotate Box and calculate new bounding box along same axes to fit old box inside.

Helps find suboptimal bounding box for rotated meshes

Note
Function can take both Dimensions and Box Extent.
Parameters
BoxDimension of Bounding box
RotationRotation to calculate
Returns
Returns size in same units as passed Box