TrinityCore
MoveSplineFlag.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRINITYSERVER_MOVESPLINEFLAG_H
19#define TRINITYSERVER_MOVESPLINEFLAG_H
20
21#include "Define.h"
22#include <string>
23
24namespace Movement
25{
26#pragma pack(push, 1)
27
29 {
30 public:
31 enum eFlags
32 {
33 None = 0x00000000,
34 Unknown_0x1 = 0x00000001, // NOT VERIFIED
35 Unknown_0x2 = 0x00000002, // NOT VERIFIED
36 Unknown_0x4 = 0x00000004, // NOT VERIFIED
37 Unknown_0x8 = 0x00000008, // NOT VERIFIED - does someting related to falling/fixed orientation
38 FallingSlow = 0x00000010,
39 Done = 0x00000020,
40 Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag
41 No_Spline = 0x00000080,
42 Unknown_0x100 = 0x00000100, // NOT VERIFIED
43 Flying = 0x00000200, // Smooth movement(Catmullrom interpolation mode), flying animation
44 OrientationFixed = 0x00000400, // Model orientation fixed
45 Catmullrom = 0x00000800, // Used Catmullrom interpolation mode
46 Cyclic = 0x00001000, // Movement by cycled spline
47 Enter_Cycle = 0x00002000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done
48 Frozen = 0x00004000, // Will never arrive
49 TransportEnter = 0x00008000,
50 TransportExit = 0x00010000,
51 Unknown_0x20000 = 0x00020000, // NOT VERIFIED
52 Unknown_0x40000 = 0x00040000, // NOT VERIFIED
53 Backward = 0x00080000,
54 SmoothGroundPath = 0x00100000,
55 CanSwim = 0x00200000,
56 UncompressedPath = 0x00400000,
57 Unknown_0x800000 = 0x00800000, // NOT VERIFIED
58 Unknown_0x1000000 = 0x01000000, // NOT VERIFIED
59 Animation = 0x02000000, // Plays animation after some time passed
60 Parabolic = 0x04000000, // Affects elevation computation, can't be combined with Falling flag
61 FadeObject = 0x08000000,
62 Steering = 0x10000000,
63 UnlimitedSpeed = 0x20000000,
64 Unknown_0x40000000 = 0x40000000, // NOT VERIFIED
65 Unknown_0x80000000 = 0x80000000, // NOT VERIFIED
66
67 // Masks
68 // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably
70 // Unused, not suported flags
73 };
74
75 inline uint32& raw() { return (uint32&)*this; }
76 inline uint32 const& raw() const { return (uint32 const&)*this; }
77
78 MoveSplineFlag() { raw() = 0; }
80
81 // Constant interface
82
83 bool isSmooth() const { return (raw() & Catmullrom) != 0; }
84 bool isLinear() const { return !isSmooth(); }
85
86 bool hasAllFlags(uint32 f) const { return (raw() & f) == f; }
87 bool hasFlag(uint32 f) const { return (raw() & f) != 0; }
88 uint32 operator & (uint32 f) const { return (raw() & f); }
89 uint32 operator | (uint32 f) const { return (raw() | f); }
90 std::string ToString() const;
91
92 // Not constant interface
93
94 void operator &= (uint32 f) { raw() &= f; }
95 void operator |= (uint32 f) { raw() |= f; }
96
99 void EnableFlying() { raw() = (raw() & ~(Falling)) | Flying; }
100 void EnableFalling() { raw() = (raw() & ~(Parabolic | Animation | Flying)) | Falling; }
101 void EnableCatmullRom() { raw() = (raw() & ~SmoothGroundPath) | Catmullrom; }
102 void EnableTransportEnter() { raw() = (raw() & ~TransportExit) | TransportEnter; }
103 void EnableTransportExit() { raw() = (raw() & ~TransportEnter) | TransportExit; }
104
105 bool unknown0x1 : 1;
106 bool unknown0x2 : 1;
107 bool unknown0x4 : 1;
108 bool unknown0x8 : 1;
109 bool fallingSlow : 1;
110 bool done : 1;
111 bool falling : 1;
112 bool no_spline : 1;
113 bool unknown0x100 : 1;
114 bool flying : 1;
116 bool catmullrom : 1;
117 bool cyclic : 1;
118 bool enter_cycle : 1;
119 bool frozen : 1;
124 bool backward : 1;
126 bool canSwim : 1;
130 bool animation : 1;
131 bool parabolic : 1;
132 bool fadeObject : 1;
133 bool steering : 1;
137 };
138#pragma pack(pop)
139}
140
141#endif // TRINITYSERVER_MOVESPLINEFLAG_H
uint32_t uint32
Definition: Define.h:142
std::string ToString() const
bool hasAllFlags(uint32 f) const
uint32 operator&(uint32 f) const
uint32 const & raw() const
void operator&=(uint32 f)
bool hasFlag(uint32 f) const
void operator|=(uint32 f)
uint32 operator|(uint32 f) const