OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
g_phys.h
1/*
2===========================================================================
3Copyright (C) 2024 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// g_phys.h: Header for g_phys.cpp
24
25#pragma once
26
27#include "g_local.h"
28#include "vector.h"
29
30class Entity;
31
32typedef enum {
33 STEPMOVE_OK,
34 STEPMOVE_BLOCKED_BY_ENTITY,
35 STEPMOVE_BLOCKED_BY_WORLD,
36 STEPMOVE_BLOCKED_BY_WATER,
37 STEPMOVE_BLOCKED_BY_FALL,
38 STEPMOVE_BLOCKED_BY_DOOR,
39 STEPMOVE_STUCK
40} stepmoveresult_t;
41
42// movetype values
43typedef enum {
44 MOVETYPE_NONE, // never moves
45 MOVETYPE_STATIONARY, // never moves but does collide agains push objects
46 MOVETYPE_NOCLIP, // origin and angles change with no interaction
47 MOVETYPE_PUSH, // no clip to world, push on box contact
48 MOVETYPE_STOP, // no clip to world, stops on box contact
49 MOVETYPE_WALK, // gravity
50 MOVETYPE_FLY,
51 MOVETYPE_TOSS, // gravity
52 MOVETYPE_FLYMISSILE, // extra size to monsters
53 MOVETYPE_BOUNCE,
54 MOVETYPE_SLIDE,
55 MOVETYPE_GIB,
56 MOVETYPE_VEHICLE,
57 MOVETYPE_TURRET,
58 MOVETYPE_PORTABLE_TURRET
59} movetype_t;
60
61typedef struct {
62 Entity *ent;
63 Vector localorigin;
64 Vector origin;
65 Vector localangles;
66 Vector angles;
67 float deltayaw;
68} pushed_t;
69
70extern pushed_t pushed[];
71extern pushed_t *pushed_p;
72
73void G_RunEntity(Entity *ent);
74void G_Impact(Entity *e1, trace_t *trace);
75qboolean G_PushMove(Entity *pusher, Vector move, Vector amove);
76void G_CheckWater(Entity *ent);
77Entity *G_TestEntityPosition(Entity *ent, Vector vOrg);
Definition entity.h:203
Definition vector.h:61
Definition g_phys.h:61
Definition q_shared.h:1452