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
45class
47{
48public:
49 void NSMoverEntity(void);
50
52 nonvirtual vector GetDirectionalPosition(vector, float);
54 nonvirtual vector GetDirectionalRotation(vector, float);
55
57 nonvirtual void SetMoverState(moverState_t);
59 nonvirtual moverState_t GetMoverState(void);
60
62 nonvirtual void SetMoverType(moverType_t);
64 nonvirtual moverType_t GetMoverType(void);
65
67 nonvirtual void SetMoverPosition1(vector);
69 nonvirtual vector GetMoverPosition1(void);
70
72 nonvirtual void SetMoverPosition2(vector);
74 nonvirtual vector GetMoverPosition2(void);
75
77 nonvirtual void SetMoverRotation1(vector);
79 nonvirtual vector GetMoverRotation1(void);
80
82 nonvirtual void SetMoverRotation2(vector);
84 nonvirtual vector GetMoverRotation2(void);
85
87 nonvirtual void MoveToPosition(vector, float);
89 nonvirtual void RotateToPosition(vector, float);
91 nonvirtual void MoveAndRotateToPosition(vector, vector, float);
92
94 nonvirtual void MoveToReverse(float);
96 nonvirtual void RotateToReverse(float);
98 nonvirtual bool IsMoving(void);
99
101 virtual void MoverStartsMoving(void);
103 virtual void MoverFinishesMoving(void);
104
105 /* overrides */
106#ifdef SERVER
107 virtual void Save(float);
108 virtual void Restore(string, string);
109 virtual void SpawnKey(string, string);
110#endif
111
112private:
113 vector m_vecPos1;
114 vector m_vecPos2;
115 vector m_vecPos3;
116 vector m_vecPos4;
117 moverState_t m_moverState;
118 moverType_t m_moverType;
119 int m_iPortalState;
120 vector m_vecMoveDir; /* movedir override from Source */
121 bool m_bUseMoveDir;
122
123 nonvirtual void _PortalOpen(void);
124 nonvirtual void _PortalClose(void);
125 nonvirtual void _ArrivedAtRotPosition1(void);
126 nonvirtual void _ArrivedAtRotPosition2(void);
127 nonvirtual void _BeginMoving(void);
128};
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:47
This entity represents an NSRenderableEntity with interactive surface properties.
Definition: NSSurfacePropEntity.h:52