TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MoveSplineInitArgs.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_MOVESPLINEINIT_ARGS_H
20 #define TRINITYSERVER_MOVESPLINEINIT_ARGS_H
21 
22 #include "MoveSplineFlag.h"
23 #include "ObjectGuid.h"
24 #include <G3D/Vector3.h>
25 
26 class Unit;
27 
28 namespace Movement
29 {
30  typedef std::vector<Vector3> PointsArray;
31 
32  struct FacingInfo
33  {
36  float angle;
37 
38  FacingInfo() : angle(0.0f) { }
39  };
40 
42  {
43  MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0), velocity(0.f),
46  {
47  path.reserve(path_capacity);
48  }
49 
50  PointsArray path;
54  float velocity;
56  float time_perc;
61 
63  bool Validate(Unit* unit) const;
64 
65  private:
66  bool _checkPathBounds() const;
67  };
68 }
69 
70 #endif // TRINITYSERVER_MOVESPLINEINIT_ARGS_H
bool HasVelocity
Definition: MoveSplineInitArgs.h:59
ObjectGuid target
Definition: MoveSplineInitArgs.h:35
float initialOrientation
Definition: MoveSplineInitArgs.h:58
int32 path_Idx_offset
Definition: MoveSplineInitArgs.h:53
MoveSplineFlag flags
Definition: MoveSplineInitArgs.h:52
float parabolic_amplitude
Definition: MoveSplineInitArgs.h:55
#define false
Definition: CascPort.h:18
Definition: Vector3.h:58
float time_perc
Definition: MoveSplineInitArgs.h:56
bool Validate(Unit *unit) const
============================================================================================ ...
Definition: MoveSpline.cpp:200
#define true
Definition: CascPort.h:17
Definition: MoveSplineInitArgs.h:32
bool TransformForTransport
Definition: MoveSplineInitArgs.h:60
G3D::Vector3 f
Definition: MoveSplineInitArgs.h:34
PointsArray path
Definition: MoveSplineInitArgs.h:50
FacingInfo facing
Definition: MoveSplineInitArgs.h:51
Definition: Unit.h:409
std::vector< Vector3 > PointsArray
Definition: MoveSplineInitArgs.h:30
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
float angle
Definition: MoveSplineInitArgs.h:36
MoveSplineInitArgs(size_t path_capacity=16)
Definition: MoveSplineInitArgs.h:43
float velocity
Definition: MoveSplineInitArgs.h:54
Definition: MoveSplineFlag.h:28
bool _checkPathBounds() const
Definition: MoveSpline.cpp:218
FacingInfo()
Definition: MoveSplineInitArgs.h:38
Definition: ObjectGuid.h:189
Definition: Unit.h:1305
uint32 splineId
Definition: MoveSplineInitArgs.h:57
Definition: MoveSplineInitArgs.h:41