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

Manipulation of rotation or angles. More...

Functions

template<typename T>
T NormalizeAngleToPeriod (T angle, T period=360.f)
 Normalize angle to range <0, period>. Unit independent.
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.
void YASIUMATH_API RotateCameraWithoutRoll (FRotator &CurrentRotator, float YawChange, float PitchChange, const float PitchLimit=85)
 Adjust rotator yaw and pitch and keeps roll 0.

Detailed Description

Manipulation of rotation or angles.

Function Documentation

◆ NormalizeAngleToPeriod()

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

Normalize angle to range <0, period>. Unit independent.

Normalization removes any excess periods.

Angle can be negative. Period must be > 0

Note
Example:
Angle = -12, Period = 10
Result -> 8

◆ RotateBoundingBox()

FVector YASIUMATH_API YasiuMath::Rotation::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

◆ RotateCameraWithoutRoll()

void YASIUMATH_API YasiuMath::Rotation::RotateCameraWithoutRoll ( FRotator & CurrentRotator,
float YawChange,
float PitchChange,
const float PitchLimit = 85 )

Adjust rotator yaw and pitch and keeps roll 0.

Parameters
CurrentRotator
YawChange
PitchChange
PitchLimitLimits pitch value to <-PitchLimit, PitchLimit>