UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Axis.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "HAL/Platform.h"
6
7// Generic axis enum (mirrored for property use in Object.h)
8namespace EAxis
9{
10 enum Type
11 {
16 };
17}
18
19
20// Extended axis enum for more specialized usage
21namespace EAxisList
22{
23 enum Type
24 {
25 None = 0,
26 X = 1 << 0,
27 Y = 1 << 1,
28 Z = 1 << 2,
29
30 Screen = 1 << 3,
31 XY = X | Y,
32 XZ = X | Z,
33 YZ = Y | Z,
34 XYZ = X | Y | Z,
36
37 //alias over Axis YZ since it isn't used when the z-rotation widget is being used
39
40 // alias over Screen since it isn't used when the 2d translate rotate widget is being used
42
43 Left = 1 << 4,
44 Up = 1 << 5,
45 Forward = 1 << 6,
46
47 LU = Left | Up,
51 };
52}
53
54namespace EAxis
55{
56 // Converts the given AxisList value to the corresponding Axis value. Assumes a single axis within the provided AxisList.
58 {
60 switch (InAxisList)
61 {
62 case EAxisList::X:
64 return EAxis::X;
65
66 case EAxisList::Y:
67 case EAxisList::Left:
68 return EAxis::Y;
69
70 case EAxisList::Z:
71 case EAxisList::Up:
72 return EAxis::Z;
73
74 case EAxisList::None:
75 default:
76 return EAxis::None;
77 }
79 }
80}
81
82namespace EAxisList
83{
84 // Converts the given Axis to the corresponding AxisList value
86 {
88 {
89 switch (InAxis)
90 {
91 case EAxis::X:
92 return EAxisList::X;
93 case EAxis::Y:
94 return EAxisList::Y;
95 case EAxis::Z:
96 return EAxisList::Z;
97 case EAxis::None:
98 default:
99 return EAxisList::None;
100 }
101 }
102
104 {
105 switch (InAxis)
106 {
107 case EAxis::X:
108 return EAxisList::Forward;
109 case EAxis::Y:
110 return EAxisList::Left;
111 case EAxis::Z:
112 return EAxisList::Up;
113 case EAxis::None:
114 default:
115 return EAxisList::None;
116 }
117 }
118
119 return EAxisList::None;
120 }
121}
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define PRAGMA_DISABLE_SWITCH_UNHANDLED_ENUM_CASE_WARNINGS
Definition MSVCPlatformCompilerPreSetup.h:105
#define PRAGMA_RESTORE_SWITCH_UNHANDLED_ENUM_CASE_WARNINGS
Definition MSVCPlatformCompilerPreSetup.h:111
Definition Axis.h:22
EAxisList::Type FromAxis(const EAxis::Type InAxis, const EAxisList::Type InAxisCoordinateSystem=EAxisList::XYZ)
Definition Axis.h:85
Type
Definition Axis.h:24
@ Screen
Definition Axis.h:30
@ X
Definition Axis.h:26
@ XYZ
Definition Axis.h:34
@ ZRotation
Definition Axis.h:38
@ Y
Definition Axis.h:27
@ LU
Definition Axis.h:47
@ None
Definition Axis.h:25
@ XZ
Definition Axis.h:32
@ Z
Definition Axis.h:28
@ All
Definition Axis.h:35
@ LeftUpForward
Definition Axis.h:50
@ Left
Definition Axis.h:43
@ YZ
Definition Axis.h:33
@ Forward
Definition Axis.h:45
@ Rotate2D
Definition Axis.h:41
@ XY
Definition Axis.h:31
@ LF
Definition Axis.h:48
@ Up
Definition Axis.h:44
Definition Axis.h:9
EAxis::Type FromAxisList(const EAxisList::Type InAxisList)
Definition Axis.h:57
Type
Definition Axis.h:11
@ Z
Definition Axis.h:15
@ Y
Definition Axis.h:14
@ X
Definition Axis.h:13
@ None
Definition Axis.h:12
Definition ObjectMacros.h:944