Nuclide
Software Development Kit for id Tech
NSMoverEntity.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
18typedef enum
19{
25
27typedef enum
28{
32
33
34#define AREAPORTAL_CLOSED 0
35#define AREAPORTAL_OPEN 1
36
42class
44{
45public:
46 void NSMoverEntity(void);
47
49 nonvirtual vector GetDirectionalPosition(vector, float);
51 nonvirtual vector GetDirectionalRotation(vector, float);
52
54 nonvirtual void SetMoverState(moverState_t);
56 nonvirtual moverState_t GetMoverState(void);
57
59 nonvirtual void SetMoverType(moverType_t);
61 nonvirtual moverType_t GetMoverType(void);
62
64 nonvirtual void SetMoverPosition1(vector);
66 nonvirtual vector GetMoverPosition1(void);
67
69 nonvirtual void SetMoverPosition2(vector);
71 nonvirtual vector GetMoverPosition2(void);
72
74 nonvirtual void SetMoverRotation1(vector);
76 nonvirtual vector GetMoverRotation1(void);
77
79 nonvirtual void SetMoverRotation2(vector);
81 nonvirtual vector GetMoverRotation2(void);
82
84 nonvirtual void MoveToPosition(vector, float);
86 nonvirtual void RotateToPosition(vector, float);
88 nonvirtual void MoveAndRotateToPosition(vector, vector, float);
89
91 nonvirtual void MoveToReverse(float);
93 nonvirtual void RotateToReverse(float);
95 nonvirtual bool IsMoving(void);
96
98 virtual void MoverStartsMoving(void);
100 virtual void MoverFinishesMoving(void);
101
102 /* overrides */
103#ifdef SERVER
104 virtual void Save(float);
105 virtual void Restore(string, string);
106 virtual void SpawnKey(string, string);
107#endif
108
109private:
110 vector m_vecPos1;
111 vector m_vecPos2;
112 vector m_vecPos3;
113 vector m_vecPos4;
114 moverState_t m_moverState;
115 moverType_t m_moverType;
116 int m_iPortalState;
117 vector m_vecMoveDir; /* movedir override from Source */
118 bool m_bUseMoveDir;
119
120 nonvirtual void _PortalOpen(void);
121 nonvirtual void _PortalClose(void);
122 nonvirtual void _ArrivedAtRotPosition1(void);
123 nonvirtual void _ArrivedAtRotPosition2(void);
124 nonvirtual void _BeginMoving(void);
125};
moverState_t
The state the NSMoverEntity is in.
Definition: NSMoverEntity.h:19
@ MOVER_POS2
At the final destination.
Definition: NSMoverEntity.h:21
@ MOVER_2TO1
on its way back to the starting position.
Definition: NSMoverEntity.h:23
@ MOVER_POS1
At the initial starting position.
Definition: NSMoverEntity.h:20
@ MOVER_1TO2
On its way to the final destination.
Definition: NSMoverEntity.h:22
moverType_t
The movement type of the NSMoverEntity.
Definition: NSMoverEntity.h:28
@ MOVERTYPE_ACCELERATED
Moved in an accelerated fashion.
Definition: NSMoverEntity.h:30
@ MOVERTYPE_LINEAR
Moves in a linear fashion.
Definition: NSMoverEntity.h:29
NSMoverEntity is responsible for handling movement functions of mainly brush-based entities that move...
Definition: NSMoverEntity.h:44
This entity represents an NSRenderableEntity with interactive surface properties.
Definition: NSSurfacePropEntity.h:49
vector(vector) normalize