OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
movegrid.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// movegrid.h: Move grid
24//
25
26#pragma once
27
28#include "g_local.h"
29#include "../qcommon/class.h"
30#include "../fgame/archive.h"
31
32typedef struct vehicleState_s {
33 vec3_t origin;
34 vec3_t velocity;
35 int groundEntityNum;
36 qboolean walking;
37 qboolean groundPlane;
38 trace_t groundTrace;
39 int entityNum;
40 vec2_t desired_dir;
41 qboolean hit_obstacle;
42 vec3_t hit_origin;
43 vec3_t obstacle_normal;
44 qboolean useGravity;
45} vehicleState_t;
46
47typedef struct vmove_s {
48 vehicleState_t *vs;
49 float frametime;
50 float desired_speed;
51 int tracemask;
52 int numtouch;
53 int touchents[32];
54 vec3_t mins;
55 vec3_t maxs;
56} vmove_t;
57
58typedef struct gridpoint_s {
59 Vector origin;
60 Vector neworigin;
61 Vector origindelta;
62 Vector changed;
63 Vector newvel;
64 gentity_t *groundentity;
65 vmove_t vm;
66 vehicleState_t vs;
67} gridpoint_t;
68
69class cMoveGrid : public Class
70{
71public:
72 gridpoint_t *GridPoints;
73
74private:
75 vmove_t v;
76 vec3_t orientation[3];
77 int m_iXRes;
78 int m_iYRes;
79 int m_iZRes;
80
81public:
82 cMoveGrid(int x, int y, int z);
83 virtual ~cMoveGrid();
84
85 void SetOrientation(const vec3_t *v);
86 void SetMoveInfo(vmove_t *vm);
87 void CalculateBoxPoints(void);
88 gridpoint_t *GetGridPoint(int x, int y, int z);
89 void Move(void);
90 qboolean CheckStuck(void);
91 void GetMoveInfo(vmove_t *vm);
92 void Archive(Archiver &arc);
93};
Definition archive.h:86
Definition vector.h:61
Definition movegrid.h:58
Definition q_shared.h:1452
Definition movegrid.h:32
Definition movegrid.h:47