Ark Server API (ASA) - Wiki
|
#include <TransformCalculus2D.h>
Public Types | |
using | FReal = T |
using | Vector2Type = UE::Math::TVector2<T> |
Public Member Functions | |
TQuat2 () | |
TQuat2 (T RotRadians) | |
template<typename VType > | |
TQuat2 (const UE::Math::TVector2< VType > &InRot) | |
template<typename ArgType > | |
UE::Math::TVector2< ArgType > | TransformPoint (const UE::Math::TVector2< ArgType > &Point) const |
template<typename ArgType > | |
UE::Math::TVector2< ArgType > | TransformVector (const UE::Math::TVector2< ArgType > &Vector) const |
TQuat2 | Concatenate (const TQuat2 &RHS) const |
TQuat2 | Inverse () const |
bool | operator== (const TQuat2 &Other) const |
bool | operator!= (const TQuat2 &Other) const |
const Vector2Type & | GetVector () const |
Private Attributes | |
Vector2Type | Rot |
Represents a 2D rotation as a complex number (analagous to quaternions). Rot(theta) == cos(theta) + i * sin(theta) General transformation follows complex number algebra from there. Does not use "spinor" notation using theta/2 as we don't need that decomposition for our purposes. This makes the implementation for straightforward and efficient for 2D.
Definition at line 294 of file TransformCalculus2D.h.
Definition at line 299 of file TransformCalculus2D.h.
Definition at line 300 of file TransformCalculus2D.h.
Ctor. initialize to an identity rotation.
Definition at line 303 of file TransformCalculus2D.h.
Ctor. initialize from a rotation in radians.
Definition at line 305 of file TransformCalculus2D.h.
Ctor. initialize from an FVector2D, representing a complex number.
Definition at line 308 of file TransformCalculus2D.h.
Transform 2 rotations defined by complex numbers: In imaginary land: (A + Bi) * (C + Di) == (AC - BD) + (AD + BC)i
Looking at this as a matrix, A == cos(theta), B == sin(theta), C == cos(sigma), D == sin(sigma):
[ A B] * [ C D] == [ AC-BD AD+BC] [-B A] [-D C] [-(AD+BC) AC-BD]
If you look at how the vector multiply works out: [X(AC-BD)+Y(-BC-AD) X(AD+BC)+Y(-BD+AC)] you can see it follows the same form of the imaginary form. Indeed, check out how the matrix nicely works out to [ A B] for a visual proof of the results. [-B A]
Definition at line 350 of file TransformCalculus2D.h.
Access to the underlying FVector2D that stores the complex number.
Definition at line 377 of file TransformCalculus2D.h.
Invert the rotation defined by complex numbers: In imaginary land, an inverse is a complex conjugate, which is equivalent to reflecting about the X axis: Conj(A + Bi) == A - Bi
Definition at line 359 of file TransformCalculus2D.h.
Inequality.
Definition at line 371 of file TransformCalculus2D.h.
Equality.
Definition at line 365 of file TransformCalculus2D.h.
|
inline |
Transform a 2D point by the 2D complex number representing the rotation: In imaginary land: (x + yi) * (u + vi) == (xu - yv) + (xv + yu)i
Looking at this as a matrix, x == cos(A), y == sin(A)
[x y] * [ cosA sinA] == [x y] * [ u v] == [xu-yv xv+yu] [-sinA cosA] [-v u]
Looking at the above results, we see the equivalence with matrix multiplication.
Definition at line 322 of file TransformCalculus2D.h.
|
inline |
Vector rotation is equivalent to rotating a point.
Definition at line 332 of file TransformCalculus2D.h.
|
private |
Underlying storage of the rotation (X = cos(theta), Y = sin(theta).
Definition at line 381 of file TransformCalculus2D.h.