HammeriteNavigationLinkData
Navigation. Inherits RefCounted
A way from one patch of ground to another that is not walking: a window climbed through, a ledge dropped off, a gap jumped, a ladder someone placed.
A step is not a decision. The smallest of these, Kind.STEP, exists because everything that is not coplanar has to be joined somehow, and a stair tread is not a feat of athletics. It is measured like the rest and costs nothing to take, so a flight of stairs prices like the walking it is. Ordinary doorways are not links. Two rooms that abut share a wall the compiler punches an opening in, and their floors come out coplanar and edge-coincident, so the navigation server joins the two regions itself and an agent walks across for free. What needs a link is a HEIGHT DISCONTINUITY - the ground on one side is not the ground on the other, and no amount of walking crosses it. This says what the geometry is, not who can use it. A link carries what it costs to take: how high you must haul yourself, how far you travel through the air, how much you fall, how wide and tall the way through is. Whether a guard can climb a 96-unit sill, or whether the drop beyond it would kill them, is a question about guards, and it is answered game-side by comparing an agent profile against these numbers. Hammerite measures; the game decides.
Properties
| Type | Name | Default |
|---|---|---|
int | kind | 0 |
Vector3 | start | Vector3(0, 0, 0) |
Vector3 | end | Vector3(0, 0, 0) |
Vector2i | from_room | Vector2i(0, 0) |
Vector2i | to_room | Vector2i(0, 0) |
bool | one_way | false |
String | link_name | "" |
Vector3i | portal_key | Vector3i(-1, -1, -1) |
float | climb | 0.0 |
float | reverse_climb | 0.0 |
float | low_water_depth | 0.0 |
float | span | 0.0 |
float | width | inf |
float | height | inf |
Methods
| Returns | Method |
|---|---|
float | rise() |
float | fall() |
float | climb_towards(reversed: bool) |
float | fall_towards(reversed: bool) |
bool | has_portal() |
float | length() |
String | kind_name() |
String | name_of_kind(which: int) static |
Enumerations
enum Kind
| Value | Name | Description |
|---|---|---|
0 | WINDOW | Through an aperture whose sill stands above the floor: a window, a hatch, a low wall. |
1 | DROP | Off the edge of a patch of ground onto lower ground beneath it. |
2 | JUMP | Across clear air to ground on the far side of a gap. |
3 | AUTHORED | Placed by hand, for the routes geometry cannot show: a ladder, a rope, a lift. |
4 | STEP | Up or down by less than a stride: a stair tread, a kerb. Walking, not a decision. |
Constants
NO_PORTAL
const NO_PORTAL = Vector3i(-1, -1, -1)
No opening: this link crosses open air rather than passing through an aperture. Not a valid HammeritePortal.key(), whose components are brush ids and are never negative.
Property descriptions
kind
var kind: int = 0
Which kind of discontinuity this is.
start
var start: Vector3 = Vector3(0, 0, 0)
Where the traversal begins, on the ground.
end
var end: Vector3 = Vector3(0, 0, 0)
Where it ends, on the ground.
from_room
var from_room: Vector2i = Vector2i(0, 0)
The room (HammeriteCell.key()) at start. A room, not a NavigationRegion3D: a room has one of those per set of agents that use its ground alike.
to_room
var to_room: Vector2i = Vector2i(0, 0)
The room at end.
one_way
var one_way: bool = false
Taken only from start to end, whatever an agent can climb: a chute, a hatch that opens one way. An authored link says so (HammeriteNavigationLinkBuilder.ONE_WAY_KEY).
link_name
var link_name: String = ""
The author's name for this link, or "" if it has none. A named link can be switched on and off at runtime - a window that is boarded up until the boards come off, a drawbridge. Derived links take the name of the opening they pass through (HammeritePortal.get_portal_name()), which is the SAME name the acoustics use for it, so a window is named once and both systems mean the same window.
portal_key
var portal_key: Vector3i = Vector3i(-1, -1, -1)
The opening this link passes through (HammeritePortal.key()), or NO_PORTAL when it crosses open air.
climb
var climb: float = 0.0
Height that must be surmounted going start to end: the sill of a window above the floor it is climbed from, the lip of a ledge being climbed onto. Zero when the way out is level or downhill - walking off a ledge costs no climb at all.
reverse_climb
var reverse_climb: float = 0.0
The same, in the other direction. The two differ whenever the ground is at different heights on the two sides, which is exactly when a link exists at all - so a window a guard can climb INTO a cellar may be one they cannot climb back out of.
low_water_depth
var low_water_depth: float = 0.0
How deep the water stands over the ground at the lower end - a drop into a pool - in world units. Zero on dry ground. An agent that swims there is at the surface, not on the bottom: it drops in only as far as the water and climbs out only from it (HammeriteNavigationAgentProfile.can_take()).
span
var span: float = 0.0
Horizontal distance of OPEN AIR the route crosses, in world units: the width of a jumped gap, the overhang of a ledge. Zero for a window, which crosses a wall rather than a gap - two rooms that abut share one plane, and the opening in it has no thickness. Distinct from length(), the distance between the two endpoints, which also includes the standing-back at either end. The span is what an agent has to be able to clear.
width
var width: float = inf
Narrowest horizontal dimension of the way through, in world units. INF where nothing constrains it, which is the honest answer for a drop into an open room.
height
var height: float = inf
Free height of the way through, in world units. A window 40 units tall is a route for something small whatever else is true of it.
Method descriptions
rise()
func rise() -> float
Height gained going start to end. Negative for a drop.
fall()
func fall() -> float
Height lost going start to end, and zero if the route goes up. This is the number a game compares against what a fall costs an agent.
climb_towards()
func climb_towards(reversed: bool) -> float
What must be climbed to take this link in the given direction.
fall_towards()
func fall_towards(reversed: bool) -> float
How far the route falls in the given direction, and zero if it goes up.
has_portal()
func has_portal() -> bool
Does this link pass through an authored opening?
length()
func length() -> float
Straight-line length of the traversal.
kind_name()
func kind_name() -> String
Lower-case name of kind, for messages and node names.
name_of_kind()
static func name_of_kind(which: int) -> String
Lower-case name of any Kind, so callers counting links by kind do not need one of each to ask what it is called.