OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
mover.h
1/*
2===========================================================================
3Copyright (C) 2025 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23// mover.h: DESCRIPTION:
24// Base class for any object that needs to move to specific locations over a
25// period of time. This class is kept separate from most entities to keep
26// class size down for objects that don't need such behavior.
27//
28
29#pragma once
30
31#include "g_local.h"
32#include "entity.h"
33#include "trigger.h"
34
35class Mover : public Trigger
36{
37private:
38 Vector finaldest;
39 Vector angledest;
40 Event *endevent;
41 int moveflags;
42
43public:
44 CLASS_PROTOTYPE(Mover);
45
46 Mover();
47 virtual ~Mover();
48 void MoveDone(Event *ev);
49 void MoveTo(Vector tdest, Vector angdest, float tspeed, Event& event);
50 void LinearInterpolate(Vector tdest, Vector angdest, float time, Event& event);
51 void Stop();
52 void Archive(Archiver& arc) override;
53};
54
55inline void Mover::Archive(Archiver& arc)
56{
57 Trigger::Archive(arc);
58
59 arc.ArchiveVector(&finaldest);
60 arc.ArchiveVector(&angledest);
61 arc.ArchiveEventPointer(&endevent);
62 arc.ArchiveInteger(&moveflags);
63}
Definition archive.h:86
Definition listener.h:246
Definition vector.h:61