-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathnav_ladder.go
66 lines (55 loc) · 3.15 KB
/
nav_ladder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
gonav - A Source Engine navigation mesh file parser written in Go.
Copyright (C) 2016 Matt Razza
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Package gonav provides functionality related to CS:GO Nav Meshes
package gonav
// NavLadderDirection represents the direction between a ladder and its connection
type NavLadderDirection int
const (
// NavLadderDirectionUp means up the ladder
NavLadderDirectionUp NavLadderDirection = iota
// NavLadderDirectionDown means down the ladder
NavLadderDirectionDown
// NavLadderDirectionMax the max value for NavLadderDirection's
NavLadderDirectionMax
)
// NavLadderConnection represents a connection between an area and a ladder
type NavLadderConnection struct {
SourceArea *NavArea // The area that is the source of this NavConnection
TargetID uint32 // The ID of the ladder target
TargetLadder *NavLadder // The ladder
Direction NavLadderDirection // The direction of this connection
}
// NavLadder represents a ladder within the world
type NavLadder struct {
ID uint32 // The ID of the ladder
Width float32 // The width of the ladder
Length float32 // The length of the ladder
Top Vector3 // The location of the center of the top of the ladder
Bottom Vector3 // The location of the center of the bottom of the ladder
Direction NavLadderDirection // The direction of the NavLadder
TopForwardAreaID uint32 // ID of the area connected to the top-forward position of the ladder
TopForwardArea *NavArea // The area connected to the top-forward position of the ladder
TopLeftAreaID uint32 // ID of the area connected to the top-left position of the ladder
TopLeftArea *NavArea // The area connected to the top-forward position of the ladder
TopRightAreaID uint32 // ID of the area connected to the top-right position of the ladder
TopRightArea *NavArea // The area connected to the top-right position of the ladder
TopBehindAreaID uint32 // ID of area connected to the top-behind position of the ladder
TopBehindArea *NavArea // The area connected to the top-behind position of the ladder
BottomAreaID uint32 // ID of the area connected to the bottom of the ladder
BottomArea *NavArea // The area connected to the bottom of the ladder
}
func (conn *NavLadderConnection) connectGraph(mesh *NavMesh) {
conn.TargetLadder = mesh.Ladders[conn.TargetID]
}