OpenMoHAA ..
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#pragma once
26
27#include "animate.h"
28
29class LODMaster : public Listener
30{
31public:
32 CLASS_PROTOTYPE(LODMaster);
33
34 SafePtr<Entity> m_current;
35
36 void Init(void);
37 void Spawn(Event *ev);
38 void PassEvent(Event *ev);
39
40 void Archive(Archiver& arc) override;
41};
42
43inline void LODMaster::Archive(Archiver& arc)
44{
45 Listener::Archive(arc);
46
47 arc.ArchiveSafePointer(&m_current);
48}
49
50class LODSlave : public Animate
51{
52public:
53 CLASS_PROTOTYPE(LODSlave);
54
55 Vector m_baseorigin;
56 float m_scale;
57
58 LODSlave();
59
60 void UpdateCvars(qboolean quiet, qboolean updateFrame);
61 void ThinkEvent(Event *ev);
62 void SetModelEvent(Event *ev);
63 void Delete(Event *ev);
64
65 void Archive(Archiver& arc) override;
66};
67
68inline void LODSlave::Archive(Archiver& arc)
69{
70 Animate::Archive(arc);
71
72 arc.ArchiveVector(&m_baseorigin);
73 arc.ArchiveFloat(&m_scale);
74}
75
76extern LODMaster LODModel;
Definition archive.h:86
Definition lodthing.h:30