-
Notifications
You must be signed in to change notification settings - Fork 17
/
nav_mesh_carving.go
43 lines (38 loc) · 1.07 KB
/
nav_mesh_carving.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
package unityai
type CarveResult struct {
carvedData []byte
carvedDataSize uint32
status CarveResultStatus // CarveResultStatus
}
type ObstacleCarveInfo struct {
shape NavMeshCarveShape // Current shape
bounds MinMaxAABB // Current bounds, cached from shape to allow matching add/remove.
obstacle *NavMeshObstacle
versionStamp int32
}
type CarveResultContainer []CarveResult
func (c *CarveResultContainer) resize_initialized(size int) {
if cap(*c) >= size {
*c = (*c)[:size]
} else {
*c = append(*c, make([]CarveResult, size-len(*c))...)
}
}
type NavMeshCarving struct {
m_NavMeshManager *NavMeshManager
m_TileCarveData []CarveData
m_ObstacleInfo []ObstacleCarveInfo
m_ObstacleFreelist []int32
m_DirtyBounds []MinMaxAABB
m_CarveResults CarveResultContainer
}
func NewNavMeshCarving(manager *NavMeshManager) *NavMeshCarving {
return &NavMeshCarving{
m_NavMeshManager: manager,
m_TileCarveData: nil,
m_ObstacleInfo: nil,
m_ObstacleFreelist: nil,
m_DirtyBounds: nil,
m_CarveResults: nil,
}
}