OpenMoHAA 0.82.1
Loading...
Searching...
No Matches
lodthing.h
1/*
2===========================================================================
3Copyright (C) 2015 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// lodthing.cpp : Level of detail manager
24
25#include "animate.h"
26
27class LODMaster : public Listener
28{
29public:
30 CLASS_PROTOTYPE(LODMaster);
31
32 SafePtr<Entity> m_current;
33
34 void Init(void);
35 void Spawn(Event *ev);
36 void PassEvent(Event *ev);
37
38 void Archive(Archiver& arc) override;
39};
40
41inline void LODMaster::Archive(Archiver& arc)
42{
43 Listener::Archive(arc);
44
45 arc.ArchiveSafePointer(&m_current);
46}
47
48class LODSlave : public Animate
49{
50public:
51 CLASS_PROTOTYPE(LODSlave);
52
53 Vector m_baseorigin;
54 float m_scale;
55
56 LODSlave();
57
58 void UpdateCvars(qboolean quiet, qboolean updateFrame);
59 void ThinkEvent(Event *ev);
60 void SetModelEvent(Event *ev);
61 void Delete(Event *ev);
62
63 void Archive(Archiver& arc) override;
64};
65
66inline void LODSlave::Archive(Archiver& arc)
67{
68 Animate::Archive(arc);
69
70 arc.ArchiveVector(&m_baseorigin);
71 arc.ArchiveFloat(&m_scale);
72}
73
74extern LODMaster LODModel;
Definition archive.h:86
Definition listener.h:246
Definition lodthing.h:28
Definition safeptr.h:160
Definition vector.h:61