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