OpenMoHAA
0.82.1
Loading...
Searching...
No Matches
lodthing.h
1
/*
2
===========================================================================
3
Copyright (C) 2015 the OpenMoHAA team
4
5
This file is part of OpenMoHAA source code.
6
7
OpenMoHAA source code is free software; you can redistribute it
8
and/or modify it under the terms of the GNU General Public License as
9
published by the Free Software Foundation; either version 2 of the License,
10
or (at your option) any later version.
11
12
OpenMoHAA source code is distributed in the hope that it will be
13
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with OpenMoHAA source code; if not, write to the Free Software
19
Foundation, 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
27
class
LODMaster
:
public
Listener
28
{
29
public
:
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
41
inline
void
LODMaster::Archive(
Archiver
& arc)
42
{
43
Listener::Archive(arc);
44
45
arc.ArchiveSafePointer(&m_current);
46
}
47
48
class
LODSlave :
public
Animate
49
{
50
public
:
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
66
inline
void
LODSlave::Archive(
Archiver
& arc)
67
{
68
Animate::Archive(arc);
69
70
arc.ArchiveVector(&m_baseorigin);
71
arc.ArchiveFloat(&m_scale);
72
}
73
74
extern
LODMaster
LODModel;
Archiver
Definition
archive.h:86
Event
Definition
listener.h:246
LODMaster
Definition
lodthing.h:28
SafePtr
Definition
safeptr.h:160
Vector
Definition
vector.h:61
code
fgame
lodthing.h
Generated by
1.13.2