TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MoveSplineFlag.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */
18 
19 #ifndef TRINITYSERVER_MOVESPLINEFLAG_H
20 #define TRINITYSERVER_MOVESPLINEFLAG_H
21 
22 #include "MovementTypedefs.h"
23 
24 namespace Movement
25 {
26 #pragma pack(push, 1)
27 
29  {
30  public:
31  enum eFlags
32  {
33  None = 0x00000000,
34  // x00-x07 used as animation Ids storage in pair with Animation flag
35  Unknown0 = 0x00000008, // NOT VERIFIED - does someting related to falling/fixed orientation
36  FallingSlow = 0x00000010,
37  Done = 0x00000020,
38  Falling = 0x00000040, // Affects elevation computation, can't be combined with Parabolic flag
39  No_Spline = 0x00000080,
40  Unknown1 = 0x00000100, // NOT VERIFIED
41  Flying = 0x00000200, // Smooth movement(Catmullrom interpolation mode), flying animation
42  OrientationFixed = 0x00000400, // Model orientation fixed
43  Catmullrom = 0x00000800, // Used Catmullrom interpolation mode
44  Cyclic = 0x00001000, // Movement by cycled spline
45  Enter_Cycle = 0x00002000, // Everytimes appears with cyclic flag in monster move packet, erases first spline vertex after first cycle done
46  Frozen = 0x00004000, // Will never arrive
47  TransportEnter = 0x00008000,
48  TransportExit = 0x00010000,
49  Unknown2 = 0x00020000, // NOT VERIFIED
50  Unknown3 = 0x00040000, // NOT VERIFIED
51  OrientationInversed = 0x00080000,
52  SmoothGroundPath = 0x00100000,
53  Walkmode = 0x00200000,
54  UncompressedPath = 0x00400000,
55  Unknown4 = 0x00800000, // NOT VERIFIED
56  Unknown5 = 0x01000000, // NOT VERIFIED
57  Animation = 0x02000000, // Plays animation after some time passed
58  Parabolic = 0x04000000, // Affects elevation computation, can't be combined with Falling flag
59  Final_Point = 0x08000000,
60  Final_Target = 0x10000000,
61  Final_Angle = 0x20000000,
62  Unknown6 = 0x40000000, // NOT VERIFIED
63  Unknown7 = 0x80000000, // NOT VERIFIED
64 
65  // Masks
67  // animation ids stored here, see AnimType enum, used with Animation flag
69  // flags that shouldn't be appended into SMSG_MONSTER_MOVE\SMSG_MONSTER_MOVE_TRANSPORT packet, should be more probably
71  // Unused, not suported flags
73  };
74 
75  inline uint32& raw() { return (uint32&)*this; }
76  inline const uint32& raw() const { return (const uint32&)*this; }
77 
78  MoveSplineFlag() { raw() = 0; }
79  MoveSplineFlag(uint32 f) { raw() = f; }
80  MoveSplineFlag(const MoveSplineFlag& f) { raw() = f.raw(); }
81 
82  // Constant interface
83 
84  bool isSmooth() const { return (raw() & Catmullrom) != 0; }
85  bool isLinear() const { return !isSmooth(); }
86  bool isFacing() const { return (raw() & Mask_Final_Facing) != 0; }
87 
88  uint8 getAnimationId() const { return animId; }
89  bool hasAllFlags(uint32 f) const { return (raw() & f) == f; }
90  bool hasFlag(uint32 f) const { return (raw() & f) != 0; }
91  uint32 operator & (uint32 f) const { return (raw() & f); }
92  uint32 operator | (uint32 f) const { return (raw() | f); }
93  std::string ToString() const;
94 
95  // Not constant interface
96 
97  void operator &= (uint32 f) { raw() &= f; }
98  void operator |= (uint32 f) { raw() |= f; }
99 
102  void EnableFlying() { raw() = (raw() & ~(Falling)) | Flying; }
110 
112  bool unknown0 : 1;
113  bool fallingSlow : 1;
114  bool done : 1;
115  bool falling : 1;
116  bool no_spline : 1;
117  bool unknown1 : 1;
118  bool flying : 1;
120  bool catmullrom : 1;
121  bool cyclic : 1;
122  bool enter_cycle : 1;
123  bool frozen : 1;
124  bool transportEnter : 1;
125  bool transportExit : 1;
126  bool unknown2 : 1;
127  bool unknown3 : 1;
130  bool walkmode : 1;
132  bool unknown4 : 1;
133  bool unknown5 : 1;
134  bool animation : 1;
135  bool parabolic : 1;
136  bool final_point : 1;
137  bool final_target : 1;
138  bool final_angle : 1;
139  bool unknown6 : 1;
140  bool unknown7 : 1;
141  };
142 #pragma pack(pop)
143 }
144 
145 #endif // TRINITYSERVER_MOVESPLINEFLAG_H
uint8 getAnimationId() const
Definition: MoveSplineFlag.h:88
Definition: MoveSplineFlag.h:42
bool frozen
Definition: MoveSplineFlag.h:123
bool unknown3
Definition: MoveSplineFlag.h:127
bool cyclic
Definition: MoveSplineFlag.h:121
Definition: MoveSplineFlag.h:47
void operator|=(uint32 f)
Definition: MoveSplineFlag.h:98
bool smoothGroundPath
Definition: MoveSplineFlag.h:129
Definition: MoveSplineFlag.h:61
bool unknown5
Definition: MoveSplineFlag.h:133
bool done
Definition: MoveSplineFlag.h:114
Definition: MoveSplineFlag.h:68
Definition: MoveSplineFlag.h:66
Definition: MoveSplineFlag.h:59
Definition: MoveSplineFlag.h:38
bool parabolic
Definition: MoveSplineFlag.h:135
bool falling
Definition: MoveSplineFlag.h:115
bool orientationInversed
Definition: MoveSplineFlag.h:128
Definition: MoveSplineFlag.h:35
MoveSplineFlag(const MoveSplineFlag &f)
Definition: MoveSplineFlag.h:80
bool animation
Definition: MoveSplineFlag.h:134
bool unknown2
Definition: MoveSplineFlag.h:126
Definition: MoveSplineFlag.h:56
Definition: MoveSplineFlag.h:43
std::string ToString() const
Definition: MovementUtil.cpp:188
bool catmullrom
Definition: MoveSplineFlag.h:120
uint32 operator|(uint32 f) const
Definition: MoveSplineFlag.h:92
bool hasAllFlags(uint32 f) const
Definition: MoveSplineFlag.h:89
MoveSplineFlag()
Definition: MoveSplineFlag.h:78
Definition: MoveSplineFlag.h:37
bool final_point
Definition: MoveSplineFlag.h:136
Definition: MoveSplineFlag.h:63
bool no_spline
Definition: MoveSplineFlag.h:116
Definition: MoveSplineFlag.h:49
void EnableAnimation(uint8 anim)
Definition: MoveSplineFlag.h:100
uint32 & raw()
Definition: MoveSplineFlag.h:75
bool isLinear() const
Definition: MoveSplineFlag.h:85
bool unknown7
Definition: MoveSplineFlag.h:140
Definition: MoveSplineFlag.h:54
bool isFacing() const
Definition: MoveSplineFlag.h:86
Definition: MoveSplineFlag.h:44
Definition: Unit.h:409
bool unknown4
Definition: MoveSplineFlag.h:132
bool enter_cycle
Definition: MoveSplineFlag.h:122
void EnableFacingAngle()
Definition: MoveSplineFlag.h:106
Definition: MoveSplineFlag.h:40
Definition: MoveSplineFlag.h:48
Definition: MoveSplineFlag.h:70
uint32_t uint32
Definition: Define.h:150
uint8 animId
Definition: MoveSplineFlag.h:111
const uint32 & raw() const
Definition: MoveSplineFlag.h:76
bool flying
Definition: MoveSplineFlag.h:118
void EnableParabolic()
Definition: MoveSplineFlag.h:101
bool walkmode
Definition: MoveSplineFlag.h:130
bool unknown1
Definition: MoveSplineFlag.h:117
Definition: MoveSplineFlag.h:55
Definition: MoveSplineFlag.h:58
uint32 operator&(uint32 f) const
Definition: MoveSplineFlag.h:91
Definition: MoveSplineFlag.h:45
Definition: MoveSplineFlag.h:28
Definition: MoveSplineFlag.h:39
Definition: MoveSplineFlag.h:60
void EnableTransportExit()
Definition: MoveSplineFlag.h:109
void EnableFacingPoint()
Definition: MoveSplineFlag.h:105
Definition: MoveSplineFlag.h:62
void EnableFacingTarget()
Definition: MoveSplineFlag.h:107
bool uncompressedPath
Definition: MoveSplineFlag.h:131
Definition: MoveSplineFlag.h:51
bool fallingSlow
Definition: MoveSplineFlag.h:113
uint8_t uint8
Definition: Define.h:152
Definition: MoveSplineFlag.h:36
Definition: boss_illidan.cpp:346
bool transportEnter
Definition: MoveSplineFlag.h:124
void EnableTransportEnter()
Definition: MoveSplineFlag.h:108
bool unknown6
Definition: MoveSplineFlag.h:139
Definition: MoveSplineFlag.h:52
Definition: MoveSplineFlag.h:41
void operator&=(uint32 f)
Definition: MoveSplineFlag.h:97
bool final_target
Definition: MoveSplineFlag.h:137
bool hasFlag(uint32 f) const
Definition: MoveSplineFlag.h:90
MoveSplineFlag(uint32 f)
Definition: MoveSplineFlag.h:79
eFlags
Definition: MoveSplineFlag.h:31
Definition: MoveSplineFlag.h:46
void EnableFalling()
Definition: MoveSplineFlag.h:103
void EnableCatmullRom()
Definition: MoveSplineFlag.h:104
bool transportExit
Definition: MoveSplineFlag.h:125
Definition: MoveSplineFlag.h:50
Definition: MoveSplineFlag.h:53
Definition: MoveSplineFlag.h:72
bool isSmooth() const
Definition: MoveSplineFlag.h:84
Definition: MoveSplineFlag.h:33
bool final_angle
Definition: MoveSplineFlag.h:138
bool orientationFixed
Definition: MoveSplineFlag.h:119
bool unknown0
Definition: MoveSplineFlag.h:112
void EnableFlying()
Definition: MoveSplineFlag.h:102