AcresCoreMath.h#
Core/Source/AcresCoreMath.h Generated
Vector, quaternion and 3 x 3 matrix helpers for ACRES Core (header-only, double precision).
The Core works in a right-handed frame: world ENU metres about the ACRE tile centre (x east, y north, z up, the enu_m of places.json) and body FLU (x forward, y left, z up). The game works in Unreal's left-handed world (X east, Y south, Z up, centimetres) with a body X forward, Y right; the two are mirror images across the east-up plane, so the same physics holds with y negated (AcresCore::FromUnreal, ToUnreal).
QuatFromAxes#
Quaternion of the rotation whose body axes (x forward, y left, z up) are the given orthonormal world vectors.
WrapPi#
Wraps an angle to (-pi, pi].
FVec3#
A 3-vector.
FVec3::Dot#
Dot product.
FVec3::Cross#
Cross product (right-handed).
FVec3::Normalized#
Unit vector (zero stays zero).
FQuat#
A rotation quaternion, W + X i + Y j + Z k (unit length).
FQuat::operator*#
Hamilton product (apply B first, then this).
FQuat::Rotate#
Rotates a vector from the body frame to the world frame.
FQuat::Unrotate#
Rotates a vector from the world frame to the body frame.
FQuat::Forward#
Body axes in the world frame.
FQuat::FromAxisAngle#
Rotation by Angle (rad) about a unit Axis.
FQuat::FromYawPitchRoll#
ZYX Euler angles (yaw about z, then pitch about the new y, then roll about the new x), rad, as ROS's tf2 setRPY. Positive pitch here is nose-down (right-handed about y-left); the Core reports PitchUpRad for the nose-up convention of the vehicle model.
FQuat::ToYawPitchRoll#
ZYX Euler angles of this rotation, rad (inverse of FromYawPitchRoll).
FMat3#
A 3 x 3 matrix, row-major.
FMat3::FromQuat#
Rotation matrix of a unit quaternion (columns are the body axes in the world).