TrinityCore
SplineChain.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 TRINITY_SPLINECHAIN_H
19#define TRINITY_SPLINECHAIN_H
20
21#include "MoveSplineInitArgs.h"
22#include <G3D/Vector3.h>
23
25{
26 SplineChainLink(Movement::PointsArray const& points, uint32 expectedDuration, uint32 msToNext, float velocity) : Points(points), ExpectedDuration(expectedDuration), TimeToNext(msToNext), Velocity(velocity) { }
27 template <typename iteratorType> SplineChainLink(iteratorType begin, iteratorType end, uint32 expectedDuration, uint32 msToNext, float velocity) : Points(begin, end), ExpectedDuration(expectedDuration), TimeToNext(msToNext), Velocity(velocity) { }
28 SplineChainLink(uint32 expectedDuration, uint32 msToNext, float velocity) : Points(), ExpectedDuration(expectedDuration), TimeToNext(msToNext), Velocity(velocity) { }
32 float Velocity;
33};
34
36{
37 SplineChainResumeInfo() : PointID(0), Chain(nullptr), IsWalkMode(false), SplineIndex(0), PointIndex(0), TimeToNext(0) { }
38 SplineChainResumeInfo(uint32 id, std::vector<SplineChainLink> const* chain, bool walk, uint8 splineIndex, uint8 wpIndex, uint32 msToNext) :
39 PointID(id), Chain(chain), IsWalkMode(walk), SplineIndex(splineIndex), PointIndex(wpIndex), TimeToNext(msToNext) { }
40 bool Empty() const { return Chain == nullptr; }
41 void Clear() { Chain = nullptr; }
43 std::vector<SplineChainLink> const* Chain;
48};
49
50#endif
#define TC_GAME_API
Definition: Define.h:124
uint8_t uint8
Definition: Define.h:145
uint32_t uint32
Definition: Define.h:143
std::vector< Vector3 > PointsArray
std::vector< SplineChainLink > const * Chain
Definition: SplineChain.h:43
bool Empty() const
Definition: SplineChain.h:40
SplineChainResumeInfo(uint32 id, std::vector< SplineChainLink > const *chain, bool walk, uint8 splineIndex, uint8 wpIndex, uint32 msToNext)
Definition: SplineChain.h:38