Nuclide
Software Development Kit for id Technology (BETA)
nodes.h
1/*
2 * Copyright (c) 2016-2020 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
21/* parse info_node entities and convert them to FTE compatible routing data */
22#define NODE_DEBUG
23#define COST_INFINITE 99999
24
26typedef struct {
28 float m_flRadius; /* used for picking the closest waypoint. aka proximity weight. also relaxes routes inside the area. */
30 {
32 float m_flCost;
34 } *m_pNeighbour;
36} node_t;
37
38node_t *g_pNodes;
39int g_iNodes;
40
46void Nodes_Flush(void);
47void Nodes_Init(void);
48bool Nodes_Available(void);
49
50vector Nodes_PositionOfClosestNode(vector);
51
56vector Nodes_FindCoverFromEnemy(ncActor targetEnemy);
57
63vector Nodes_FindBackFromPosition(vector targetPosition, vector eulerDirection);
64
65
71vector Nodes_FindCoverFromEnemyNearNode(ncActor targetEnemy, vector nodePosition);
72
73
79vector Nodes_FindCoverFromEnemyFarNode(ncActor targetEnemy, vector nodePosition);
80
81
86vector Nodes_FindCoverFromPosition(vector targetOrigin);
87 // end of nav
This entity class represents an object with choreographed/free-form movement.
Definition: NSNavAI.h:72
vector Nodes_FindCoverFromEnemyNearNode(ncActor targetEnemy, vector nodePosition)
Returns the position of a spot that'll provide cover from the specified enemy, closest to a specified...
Definition: nodes.qc:255
vector Nodes_FindCoverFromPosition(vector targetOrigin)
Returns the position of a spot that'll provide cover from the specified enemy.
Definition: nodes.qc:297
void Nodes_Flush(void)
Definition: nodes.qc:186
vector Nodes_FindBackFromPosition(vector targetPosition, vector eulerDirection)
Returns the position of a spot that'll be behind where you're currently standing.
Definition: nodes.qc:233
bool Nodes_Available(void)
Definition: nodes.qc:113
vector Nodes_FindCoverFromEnemyFarNode(ncActor targetEnemy, vector nodePosition)
Returns the position of a spot that'll provide cover from the specified enemy, furthest from a specif...
Definition: nodes.qc:276
vector Nodes_FindCoverFromEnemy(ncActor targetEnemy)
Returns the position of a spot that'll provide cover from the specified enemy.
Definition: nodes.qc:212
void Nodes_Init(void)
Definition: nodes.qc:169
vector Nodes_PositionOfClosestNode(vector)
Definition: nodes.qc:193
Definition: nodes.h:30
int m_iFlags
Definition: nodes.h:33
int m_iNode
Definition: nodes.h:31
float m_flCost
Definition: nodes.h:32
Data holding Node entries.
Definition: nodes.h:26
int m_numNeighbours
Definition: nodes.h:35
vector m_vecOrigin
Definition: nodes.h:27
float m_flRadius
Definition: nodes.h:28