Documentation ¶
Index ¶
- Constants
- func Align4(value uintptr) uint32
- func Assert(v bool)
- func ClosestHeightPointTriangle(h *float32, p, a, b, c Vector3f) bool
- func CompareApproximatelyQ(q1, q2 Quaternionf, epsilon float32) bool
- func CompareApproximatelyV(inV0, inV1 Vector3f, inMaxDist float32) bool
- func DecodePolyId(salt *uint32, it *uint32, typ *uint32, ip *uint32, ref NavMeshPolyRef)
- func DecodePolyIdPoly(ref NavMeshPolyRef) uint32
- func DecodePolyIdSalt(ref NavMeshPolyRef) uint32
- func DecodePolyIdTile(ref NavMeshPolyRef) uint32
- func DecodePolyIdType(ref NavMeshPolyRef) uint32
- func Distance(a, b Vector3f) float32
- func Dot2D(a, b Vector3f) float32
- func DotQuaternionf(l, r Quaternionf) float32
- func DotVector3f(l, r Vector3f) float32
- func FindFurthestIntersectionIndices(a []NavMeshPolyRef, b []NavMeshPolyRef, na, nb int32, ia, ib *int32) bool
- func FloatAbs(d float32) float32
- func FloatClamp(v, min, max float32) float32
- func FloatMax(l, r float32) float32
- func FloatMin(l, r float32) float32
- func FloorfToInt(f float32) int32
- func GetCostModifier(navmesh *NavMesh, filter *QueryFilter, ref NavMeshPolyRef) float32
- func GetNavMeshNodeIndex(start, end *NavMeshNode) int32
- func GetPolyIndex(tile *NavMeshTile, poly *NavMeshPoly) uint32
- func GetSlabCoord(va Vector3f, side int32) float32
- func GetTileIndex(begin, end *NavMeshTile) int32
- func HashRef(a NavMeshPolyRef) uint32
- func InsertInterval(ints []SegInterval, nints int32, maxInts int32, tmin int16, tmax int16, ...) int32
- func IntersectAABBAABB(a, b MinMaxAABB) bool
- func IntersectSegmentPoly2D(tmin, tmax *float32, segMin, segMax *int32, p0, p1 Vector3f, verts []Vector3f, ...) bool
- func IntersectionAABBAABB(a, b MinMaxAABB, outBoxIntersect *MinMaxAABB) bool
- func InvalidateNavMeshHit(hit *NavMeshHit)
- func InverseTransformAABB(aabb AABB, position Vector3f, rotation Quaternionf, result *AABB)
- func IsPowerOfTwo(mask int32) bool
- func IsSameTile(ref1, ref2 NavMeshPolyRef) bool
- func LerpFloat32(from, to, t float32) float32
- func Magnitude(inV Vector3f) float32
- func MakeDetailEdgeSlabs(slabs []Vector2f, pts []Vector3f, npts int32, side int32)
- func NavMeshStatusDetail(status NavMeshStatus, detail NavMeshStatus) bool
- func NavMeshStatusFailed(status NavMeshStatus) bool
- func NavMeshStatusInProgress(status NavMeshStatus) bool
- func NavMeshStatusSucceed(status NavMeshStatus) bool
- func NeighbourLocation(x *int32, y *int32, side int32)
- func NexSurfaceId() int32
- func NextIndex(index, modulus int32) int32
- func NextPowerOfTwo(v uint32) uint32
- func OppositeTile(side int32) int32
- func OverlapBounds(amin, amax, bmin, bmax Vector3f) bool
- func OverlapDetailSlabs(aslabs []Vector2f, acount int32, bslabs []Vector2f, bcount int32, px float32, ...) bool
- func OverlapPolyPoly2D(polya []Vector3f, npolya int32, polyb []Vector3f, npolyb int32) bool
- func OverlapQuantBounds(amin []uint16, amax []uint16, bmin []uint16, bmax []uint16) bool
- func OverlapRange(amin, amax, bmin, bmax, eps float32) bool
- func OverlapSlabs(amin Vector2f, amax Vector2f, bmin Vector2f, bmax Vector2f, px float32, ...) bool
- func Perp2D(u, v Vector3f) float32
- func PointInPolygon2D(pt Vector3f, verts []Vector3f, nverts int32) bool
- func ProjectPointToPoly2DLocal(pos Vector3f, poly *NavMeshPoly, tile *NavMeshTile, projectedPos *Vector3f) bool
- func ProjectPoly(rmin, rmax *float32, axis Vector3f, poly []Vector3f, npoly int32)
- func ProjectToPolyDetail(tile *NavMeshTile, poly *NavMeshPoly, pos Vector3f, height *float32) bool
- func ProjectToPolyDetailEdge(tile *NavMeshTile, poly *NavMeshPoly, pos Vector3f) float32
- func QuaternionToMatrix3(q Quaternionf, m *Matrix3x3f)
- func QuaternionToMatrix4(q Quaternionf, m *Matrix4x4f)
- func ReplacePathStart(path *[]NavMeshPolyRef, start []NavMeshPolyRef, nstart int32) bool
- func ReplacePathStartReverse(path *[]NavMeshPolyRef, start []NavMeshPolyRef, nstart int32) bool
- func Sqr(x float32) float32
- func SqrDistance(a, b Vector3f) float32
- func SqrDistance2D(a, b Vector3f) float32
- func SqrDistancePointPolyEdge(pt Vector3f, verts []Vector3f, nverts int32, ed, et []float32) bool
- func SqrDistancePointSegment(t *float32, pt Vector3f, s1 Vector3f, s2 Vector3f) float32
- func SqrDistancePointSegment2D(t *float32, pt, s1, s2 Vector3f) float32
- func SqrMagnitude(inV Vector3f) float32
- func SqrMagnitudeQ(inV Quaternionf) float32
- func SqrMagnitudeV(inV Vector3f) float32
- func Sqrt(v float32) float32
- func TestPointInCylinder(point Vector3f, center Vector3f, halfHeight float32, radius float32) bool
- func TileToWorldBatch(worldPositions []Vector3f, tile *NavMeshTile, npositions int, ...)
- func TransformAABB(aabb AABB, position Vector3f, rotation Quaternionf, result *AABB)
- func TransformAABBSlow(aabb MinMaxAABB, transform Matrix4x4f, result *MinMaxAABB)
- func TriangleAreaXZ(pa, pb, pc Vector3f) float32
- type AABB
- type AutoOffMeshLinkData
- type EdgePointSample
- type EdgePointSamples
- type HeightMeshBVNode
- type HeightMeshData
- type LinkFreeList
- type Matrix3x3f
- type Matrix4x4f
- func (this *Matrix4x4f) Get(row, col int) float32
- func (this *Matrix4x4f) MultiplyPoint3(v Vector3f) Vector3f
- func (this *Matrix4x4f) MultiplyVector3(v Vector3f) Vector3f
- func (this *Matrix4x4f) Set(row, col int, data float32)
- func (this *Matrix4x4f) SetTR(pos Vector3f, q Quaternionf)
- func (this *Matrix4x4f) SetTRInverse(pos Vector3f, q Quaternionf)
- func (this *Matrix4x4f) Translate(inTrans Vector3f)
- type MinMaxAABB
- type NavMesh
- func (this *NavMesh) AddOffMeshConnection(params *OffMeshConnectionParams, connectRadius float32, connectHeight float32) NavMeshPolyRef
- func (this *NavMesh) AddTile(data []byte, dataSize int32, flags NavMeshTileFlags, surfaceID int32, ...) NavMeshStatus
- func (this *NavMesh) BumpTimeStamp()
- func (this *NavMesh) ClosestPointOnPolyInTileLocal(tile *NavMeshTile, poly *NavMeshPoly, pos Vector3f, closest *Vector3f)
- func (this *NavMesh) ConnectExtLinks(tile *NavMeshTile, target *NavMeshTile, side int32, portalHeight float32)
- func (this *NavMesh) ConnectIntLinks(tile *NavMeshTile)
- func (this *NavMesh) ConnectOffMeshConnection(index uint32, connectRadius float32, connectHeight float32)
- func (this *NavMesh) ConnectOffMeshConnectionsToTile(tile *NavMeshTile)
- func (this *NavMesh) CreateSurface(reserveTileCount int, settings NavMeshBuildSettings, pos Vector3f, ...) int32
- func (this *NavMesh) FindConnectingPolys(fromPoints []Vector3f, fromPointCount int32, tile *NavMeshTile, side int32, ...) int32
- func (this *NavMesh) FindNearestPoly(typeID int32, center Vector3f, extents Vector3f, nearestPt *Vector3f) NavMeshPolyRef
- func (this *NavMesh) FindPolygonsOverlappingSegment(typeID int32, pa Vector3f, pb Vector3f, height float32, polys []NavMeshPolyRef, ...)
- func (this *NavMesh) GetAgentTypeIdForPolyRef(ref NavMeshPolyRef) int32
- func (this *NavMesh) GetFirstLink(ref NavMeshPolyRef) *NavMeshLink
- func (this *NavMesh) GetFirstOffMeshConnection() *OffMeshConnection
- func (this *NavMesh) GetLink(i uint32) *NavMeshLink
- func (this *NavMesh) GetMaxTiles() uint32
- func (this *NavMesh) GetNearestOffMeshConnectionEndPoints(prevRef NavMeshPolyRef, offMeshPolyRef NavMeshPolyRef, nextRef NavMeshPolyRef, ...) NavMeshStatus
- func (this *NavMesh) GetNextLink(link *NavMeshLink) *NavMeshLink
- func (this *NavMesh) GetNextOffMeshConnection(data *OffMeshConnection) *OffMeshConnection
- func (this *NavMesh) GetOffMeshConnection(ref NavMeshPolyRef) *OffMeshConnection
- func (this *NavMesh) GetOffMeshConnectionEndPoints(prevRef NavMeshPolyRef, offMeshPolyRef NavMeshPolyRef, startPos *Vector3f, ...) NavMeshStatus
- func (this *NavMesh) GetOffMeshConnectionUnsafe(ref NavMeshPolyRef) *OffMeshConnection
- func (this *NavMesh) GetOffMeshConnectionUserID(ref NavMeshPolyRef, userID *int32) NavMeshStatus
- func (this *NavMesh) GetPolyArea(ref NavMeshPolyRef) byte
- func (this *NavMesh) GetPolyEdgeDetailPoints(tile *NavMeshTile, p int32, edge int32, points []Vector3f, pointCount *int32, ...) NavMeshStatus
- func (this *NavMesh) GetPolyFlags(ref NavMeshPolyRef) uint32
- func (this *NavMesh) GetPolyFlagsAndArea(ref NavMeshPolyRef, flags *uint32, area *byte)
- func (this *NavMesh) GetPolyGeometry(ref NavMeshPolyRef, verts []Vector3f, neighbours []NavMeshPolyRef, ...) int32
- func (this *NavMesh) GetPolyRefBase(tile *NavMeshTile) NavMeshPolyRef
- func (this *NavMesh) GetSurfaceSettings(surfaceID int32) *NavMeshBuildSettings
- func (this *NavMesh) GetSurfaceTransform(surfaceID int32, pos *Vector3f, rot *Quaternionf) NavMeshStatus
- func (this *NavMesh) GetTile(i int32) *NavMeshTile
- func (this *NavMesh) GetTileAndPolyByRef(ref NavMeshPolyRef, tile **NavMeshTile, poly **NavMeshPoly) NavMeshStatus
- func (this *NavMesh) GetTileAndPolyByRefUnsafe(ref NavMeshPolyRef, tile **NavMeshTile, poly **NavMeshPoly)
- func (this *NavMesh) GetTileByRef(ref NavMeshTileRef) *NavMeshTile
- func (this *NavMesh) GetTileRef(tile *NavMeshTile) NavMeshTileRef
- func (this *NavMesh) GetTimeStamp() uint32
- func (this *NavMesh) IsValidPolyRef(ref NavMeshPolyRef) bool
- func (this *NavMesh) QueryPolygons(typeID int32, cen Vector3f, ext Vector3f, callback NavMeshProcessCallback)
- func (this *NavMesh) QueryPolygonsInTile(tile *NavMeshTile, center Vector3f, extents Vector3f, ...)
- func (this *NavMesh) RemoveLinkBetween(from NavMeshPolyRef, to NavMeshPolyRef)
- func (this *NavMesh) RemoveOffMeshConnection(ref NavMeshPolyRef) NavMeshStatus
- func (this *NavMesh) RemoveSurface(surfaceID int32)
- func (this *NavMesh) RemoveTile(ref NavMeshTileRef, surfaceID int32, data *[]byte, dataSize *int32) NavMeshStatus
- func (this *NavMesh) SetOffMeshConnectionCostModifier(ref NavMeshPolyRef, costOverride float32) NavMeshStatus
- func (this *NavMesh) SetOffMeshConnectionFlags(ref NavMeshPolyRef, flags uint32) NavMeshStatus
- func (this *NavMesh) SetOffMeshConnectionUserID(ref NavMeshPolyRef, userID int32) NavMeshStatus
- func (this *NavMesh) SetSurfaceSettings(surfaceID int32, settings NavMeshBuildSettings)
- func (this *NavMesh) UnconnectLinks(tile *NavMeshTile)
- func (this *NavMesh) UnconnectOffMeshConnection(index uint32)
- func (this *NavMesh) UnconnectOffMeshConnectionsToTile(ref NavMeshTileRef)
- type NavMeshBVNode
- type NavMeshBuildSettings
- type NavMeshData
- func (this *NavMeshData) AddOffMeshLink(source, target Vector3f, area, linkDirection byte)
- func (this *NavMeshData) GetAgentTypeId() int32
- func (this *NavMeshData) GetFilterAreaCosts() []float32
- func (this *NavMeshData) GetNavMeshBuildSettings() NavMeshBuildSettings
- func (this *NavMeshData) GetNavMeshTiles() []NavMeshTileData
- func (this *NavMeshData) GetOffMeshLinks() []AutoOffMeshLinkData
- func (this *NavMeshData) GetPosition() Vector3f
- func (this *NavMeshData) GetRotation() Quaternionf
- type NavMeshDataHeader
- type NavMeshHit
- type NavMeshLink
- type NavMeshLinkDirectionFlags
- type NavMeshManager
- func (this *NavMeshManager) CalculatePath(source, target Vector3f, maxIter int32) ([]Vector3f, bool)
- func (this *NavMeshManager) CalculatePathCorners(corners []Vector3f, maxCorners int32, path *NavMeshPath) int32
- func (this *NavMeshManager) CalculatePolygonPath(path *NavMeshPath, sourcePosition, targetPosition Vector3f, maxIter int32) int32
- func (this *NavMeshManager) Clone() *NavMeshManager
- func (this *NavMeshManager) DistanceToEdge(hit *NavMeshHit, sourcePosition Vector3f) bool
- func (this *NavMeshManager) FindNearestPoly(center Vector3f, nearestRef *NavMeshPolyRef, nearestPt *Vector3f)
- func (this *NavMeshManager) FindRandomPointInCircle(center Vector3f, radius float32) (Vector3f, error)
- func (this *NavMeshManager) GetFilter() *QueryFilter
- func (this *NavMeshManager) GetNavMesh() *NavMesh
- func (this *NavMeshManager) GetNavMeshQuery() *NavMeshQuery
- func (this *NavMeshManager) LoadData(nvData *NavMeshData) error
- func (this *NavMeshManager) MapPosition(mappedPolyRef *NavMeshPolyRef, mappedPosition *Vector3f, ...) bool
- func (this *NavMeshManager) MoveAlongSurface(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, ...) NavMeshStatus
- func (this *NavMeshManager) Raycast(hit *NavMeshHit, sourcePosition, targetPosition Vector3f) bool
- func (this *NavMeshManager) SamplePosition(hit *NavMeshHit, sourcePosition Vector3f, maxDistance float32) bool
- func (this *NavMeshManager) WalkableBetween(source, target Vector3f) bool
- type NavMeshNode
- type NavMeshNodeFlags
- type NavMeshNodeIndex
- type NavMeshNodePool
- func (this *NavMeshNodePool) Clear()
- func (this *NavMeshNodePool) FindNavMeshNode(id NavMeshPolyRef) *NavMeshNode
- func (this *NavMeshNodePool) GetFirst(bucket int32) NavMeshNodeIndex
- func (this *NavMeshNodePool) GetHashSize() int32
- func (this *NavMeshNodePool) GetNext(i int32) NavMeshNodeIndex
- func (this *NavMeshNodePool) GetNode(id NavMeshPolyRef) *NavMeshNode
- func (this *NavMeshNodePool) GetNodeAtIdx(idx uint32) *NavMeshNode
- func (this *NavMeshNodePool) GetNodeIdx(node *NavMeshNode) uint32
- type NavMeshNodeQueue
- func (this *NavMeshNodeQueue) BubbleUp(i int32, node *NavMeshNode)
- func (this *NavMeshNodeQueue) Clear()
- func (this *NavMeshNodeQueue) Modify(node *NavMeshNode)
- func (this *NavMeshNodeQueue) Pop() *NavMeshNode
- func (this *NavMeshNodeQueue) Push(node *NavMeshNode)
- func (this *NavMeshNodeQueue) TrickleDown(i int32, node *NavMeshNode)
- type NavMeshPath
- func (this *NavMeshPath) GetPolygonCapacity() int32
- func (this *NavMeshPath) GetPolygonCount() int32
- func (this *NavMeshPath) GetPolygonData() []NavMeshPolyRef
- func (this *NavMeshPath) GetPolygonPath() []NavMeshPolyRef
- func (this *NavMeshPath) GetSourcePosition() Vector3f
- func (this *NavMeshPath) GetStatus() NavMeshPathStatus
- func (this *NavMeshPath) GetTargetPosition() Vector3f
- func (this *NavMeshPath) IsComplete() bool
- func (this *NavMeshPath) IsInvalid() bool
- func (this *NavMeshPath) IsPartial() bool
- func (this *NavMeshPath) ReservePolygons(size int32)
- func (this *NavMeshPath) SetPolygonCount(polygonCount int32)
- func (this *NavMeshPath) SetSourcePosition(sourcePosition Vector3f)
- func (this *NavMeshPath) SetStatus(status NavMeshPathStatus)
- func (this *NavMeshPath) SetTargetPosition(targetPosition Vector3f)
- func (this *NavMeshPath) SetTimeStamp(timeStamp uint32)
- type NavMeshPathStatus
- type NavMeshPoly
- type NavMeshPolyDetail
- type NavMeshPolyDetailIndex
- type NavMeshPolyRef
- type NavMeshPolyTypes
- type NavMeshProcessCallback
- type NavMeshQuery
- func (this *NavMeshQuery) ClosestPointOnPoly(ref NavMeshPolyRef, pos Vector3f, closest *Vector3f) NavMeshStatus
- func (this *NavMeshQuery) ClosestPointOnPolyBoundary(ref NavMeshPolyRef, pos Vector3f, closest *Vector3f) NavMeshStatus
- func (this *NavMeshQuery) ClosestPointOnPolyInTileLocal(tile *NavMeshTile, poly *NavMeshPoly, ref NavMeshPolyRef, pos Vector3f, ...) bool
- func (this *NavMeshQuery) FinalizeSlicedFindPath(pathCount *int32) NavMeshStatus
- func (this *NavMeshQuery) FinalizeSlicedFindPathPartial(pathCount *int32, existing []NavMeshPolyRef, existingSize int32) NavMeshStatus
- func (this *NavMeshQuery) FindDistanceToWall(startRef NavMeshPolyRef, centerPos Vector3f, filter *QueryFilter, ...) NavMeshStatus
- func (this *NavMeshQuery) FindLocalNeighbourhood(startRef NavMeshPolyRef, centerPos Vector3f, radius float32, ...) NavMeshStatus
- func (this *NavMeshQuery) FindNearestPoly(center Vector3f, extents Vector3f, filter *QueryFilter, ...)
- func (this *NavMeshQuery) FindStraightPath(startPos Vector3f, endPos Vector3f, path []NavMeshPolyRef, pathSize int32, ...) NavMeshStatus
- func (this *NavMeshQuery) GetAttachedNavMesh() *NavMesh
- func (this *NavMeshQuery) GetPath(path []NavMeshPolyRef, pathCount *int32, maxPath int32) NavMeshStatus
- func (this *NavMeshQuery) GetPolyHeightLocal(ref NavMeshPolyRef, pos Vector3f, height *float32) NavMeshStatus
- func (this *NavMeshQuery) GetPolyWallSegments(ref NavMeshPolyRef, filter *QueryFilter, segmentVerts []Vector3f, ...) NavMeshStatus
- func (this *NavMeshQuery) GetPortalPoints(from NavMeshPolyRef, to NavMeshPolyRef, left *Vector3f, right *Vector3f) NavMeshStatus
- func (this *NavMeshQuery) GetUpAxis(ref NavMeshPolyRef, up *Vector3f) NavMeshStatus
- func (this *NavMeshQuery) InitPools(nav *NavMesh, maxNodes int32) NavMeshStatus
- func (this *NavMeshQuery) InitSlicedFindPath(startRef NavMeshPolyRef, endRef NavMeshPolyRef, startPos Vector3f, ...) NavMeshStatus
- func (this *NavMeshQuery) InitSlicedFindPath2(startRef NavMeshPolyRef, endRef NavMeshPolyRef, startPos Vector3f, ...) NavMeshStatus
- func (this *NavMeshQuery) IsInClosedList(ref NavMeshPolyRef) bool
- func (this *NavMeshQuery) MoveAlongSurface(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, ...) NavMeshStatus
- func (this *NavMeshQuery) MoveAlongSurface2(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, ...) NavMeshStatus
- func (this *NavMeshQuery) ProjectToPoly(projPos *Vector3f, ref NavMeshPolyRef, pos Vector3f) NavMeshStatus
- func (this *NavMeshQuery) QueryPolygons(center Vector3f, extents Vector3f, filter *QueryFilter, polys []NavMeshPolyRef, ...)
- func (this *NavMeshQuery) Raycast(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, ...) NavMeshStatus
- func (this *NavMeshQuery) RetracePortals(startIndex int32, endIndex int32, path []NavMeshPolyRef, n int32, ...) int32
- func (this *NavMeshQuery) UpdateNeighbourLink(link *NavMeshLink, parentRef NavMeshPolyRef, bestRef NavMeshPolyRef, ...)
- func (this *NavMeshQuery) UpdateSlicedFindPath(maxIter int32, doneIters *int32) NavMeshStatus
- type NavMeshQueryData
- type NavMeshRaycastResult
- type NavMeshStatus
- type NavMeshStraightPathFlags
- type NavMeshTile
- type NavMeshTileData
- type NavMeshTileFlags
- type NavMeshTileRef
- type NearestQuery
- type NearestQuery1
- type OffMeshConnection
- type OffMeshConnectionParams
- type OffMeshFreeList
- type OffMeshLinkEndPoint
- type OverlapQuery
- type PathCorridor
- func (this *PathCorridor) ClearPath()
- func (this *PathCorridor) FindCorners(cornerVerts []Vector3f, cornerFlags []uint8, cornerPolys []NavMeshPolyRef, ...) NavMeshStatus
- func (this *PathCorridor) GetCurrentPos() Vector3f
- func (this *PathCorridor) GetLastPoly() NavMeshPolyRef
- func (this *PathCorridor) GetPath() []NavMeshPolyRef
- func (this *PathCorridor) GetPathCount() int32
- func (this *PathCorridor) Invalidate()
- func (this *PathCorridor) MoveOverOffmeshConnection(offMeshConRef NavMeshPolyRef, currentPos Vector3f, startPos Vector3f, ...) bool
- func (this *PathCorridor) MovePosition(newPos Vector3f, navquery *NavMeshQuery, filter *QueryFilter) bool
- func (this *PathCorridor) OptimizePathTopology(navquery *NavMeshQuery, filter *QueryFilter) bool
- func (this *PathCorridor) OptimizePathVisibility(next Vector3f, navquery *NavMeshQuery, filter *QueryFilter)
- func (this *PathCorridor) Reset(ref NavMeshPolyRef, pos Vector3f)
- func (this *PathCorridor) SetCorridor(target Vector3f, navquery *NavMeshQuery, path []NavMeshPolyRef, npath int32, ...)
- func (this *PathCorridor) SetPathInterrupted(inbool bool)
- func (this *PathCorridor) SetPathPartial(inbool bool)
- func (this *PathCorridor) SetPathValid(inbool bool)
- func (this *PathCorridor) SetStateFlag(setFlag bool, stateFlag PathCorridorState)
- func (this *PathCorridor) SetToEnd()
- func (this *PathCorridor) UpdateTargetPosition(ref NavMeshPolyRef, target Vector3f) bool
- type PathCorridorState
- type PolygonQuery
- type PortalArea
- type Quaternionf
- type QueryFilter
- func (this *QueryFilter) GetAreaCost(i int32) float32
- func (this *QueryFilter) GetIncludeFlags() uint32
- func (this *QueryFilter) GetTypeID() int32
- func (this *QueryFilter) PassFilter(flags uint32) bool
- func (this *QueryFilter) Set(typeID int32, includeFlags uint32, costs []float32)
- func (this *QueryFilter) SetAreaCost(i int32, cost float32)
- func (this *QueryFilter) SetAreaCosts(areaCosts []float32)
- func (this *QueryFilter) SetIncludeFlags(flags uint32)
- func (this *QueryFilter) SetTypeID(typeID int32)
- type SegInterval
- type SurfaceData
- type TileFreeList
- type TileLoc
- type Vector2f
- type Vector3f
- func ClosestPtPointTriangle(p Vector3f, a Vector3f, b Vector3f, c Vector3f) Vector3f
- func Cross(lhs, rhs Vector3f) Vector3f
- func LerpVector3f(from, to Vector3f, t float32) Vector3f
- func MaxVector3f(l, r Vector3f) Vector3f
- func MinVector3f(l, r Vector3f) Vector3f
- func NewVector3f(x, y, z float32) Vector3f
- func Normalize(inV Vector3f) Vector3f
- func NormalizeSafe(inV, defaultV Vector3f) Vector3f
- func RandomPointInConvexPoly(pts []Vector3f, npts int) Vector3f
- func RotateExtents(extents Vector3f, rotation Matrix3x3f) Vector3f
- func RotateVectorByQuat(lhs Quaternionf, rhs Vector3f) Vector3f
- func SegmentSegmentCPA(p0 Vector3f, p1 Vector3f, q0 Vector3f, q1 Vector3f) Vector3f
- func TileToWorld(tile *NavMeshTile, position Vector3f) Vector3f
- func TileToWorldSafe(tile *NavMeshTile, p Vector3f) Vector3f
- func TileToWorldVector(tile *NavMeshTile, direction Vector3f) Vector3f
- func WorldToTile(tile *NavMeshTile, position Vector3f) Vector3f
- func WorldToTileSafe(tile *NavMeshTile, p Vector3f) Vector3f
- func (this Vector3f) Add(data Vector3f) Vector3f
- func (this Vector3f) Div(v float32) Vector3f
- func (this *Vector3f) GetData(i int) float32
- func (this Vector3f) Mulf(data float32) Vector3f
- func (this Vector3f) Mulv(data Vector3f) Vector3f
- func (this Vector3f) Neg() Vector3f
- func (this *Vector3f) Set(x, y, z float32)
- func (this *Vector3f) SetData(i int, data float32)
- func (this *Vector3f) SetZero()
- func (this Vector3f) Sub(data Vector3f) Vector3f
Constants ¶
const FLT_EPSILON float32 = 1.192092896e-07
const (
H_SCALE float32 = 0.999 // Search heuristic scale.
)
const MAX_INTERVAL = 16
Variables ¶
This section is empty.
Functions ¶
func CompareApproximatelyQ ¶
func CompareApproximatelyQ(q1, q2 Quaternionf, epsilon float32) bool
func CompareApproximatelyV ¶
func DecodePolyId ¶
func DecodePolyId(salt *uint32, it *uint32, typ *uint32, ip *uint32, ref NavMeshPolyRef)
Decodes a poly id.
func DotQuaternionf ¶
func DotQuaternionf(l, r Quaternionf) float32
func DotVector3f ¶
func FindFurthestIntersectionIndices ¶
func FindFurthestIntersectionIndices(a []NavMeshPolyRef, b []NavMeshPolyRef, na, nb int32, ia, ib *int32) bool
func FloatClamp ¶
func FloorfToInt ¶
func GetCostModifier ¶
func GetCostModifier(navmesh *NavMesh, filter *QueryFilter, ref NavMeshPolyRef) float32
func GetNavMeshNodeIndex ¶
func GetNavMeshNodeIndex(start, end *NavMeshNode) int32
func GetPolyIndex ¶
func GetPolyIndex(tile *NavMeshTile, poly *NavMeshPoly) uint32
func GetSlabCoord ¶
func GetTileIndex ¶
func GetTileIndex(begin, end *NavMeshTile) int32
func HashRef ¶
func HashRef(a NavMeshPolyRef) uint32
func InsertInterval ¶
func InsertInterval(ints []SegInterval, nints int32, maxInts int32, tmin int16, tmax int16, ref NavMeshPolyRef) int32
func IntersectAABBAABB ¶
func IntersectAABBAABB(a, b MinMaxAABB) bool
func IntersectSegmentPoly2D ¶
func IntersectionAABBAABB ¶
func IntersectionAABBAABB(a, b MinMaxAABB, outBoxIntersect *MinMaxAABB) bool
func InvalidateNavMeshHit ¶
func InvalidateNavMeshHit(hit *NavMeshHit)
func InverseTransformAABB ¶
func InverseTransformAABB(aabb AABB, position Vector3f, rotation Quaternionf, result *AABB)
func IsPowerOfTwo ¶
func IsSameTile ¶
func IsSameTile(ref1, ref2 NavMeshPolyRef) bool
func LerpFloat32 ¶
func MakeDetailEdgeSlabs ¶
func NavMeshStatusDetail ¶
func NavMeshStatusDetail(status NavMeshStatus, detail NavMeshStatus) bool
Returns true if specific detail is set.
func NavMeshStatusFailed ¶
func NavMeshStatusFailed(status NavMeshStatus) bool
Returns true of status is failure.
func NavMeshStatusInProgress ¶
func NavMeshStatusInProgress(status NavMeshStatus) bool
Returns true of status is in progress.
func NavMeshStatusSucceed ¶
func NavMeshStatusSucceed(status NavMeshStatus) bool
Returns true of status is success.
func NeighbourLocation ¶
func NexSurfaceId ¶
func NexSurfaceId() int32
func NextPowerOfTwo ¶
func OppositeTile ¶
func OverlapBounds ¶
func OverlapDetailSlabs ¶
func OverlapPolyPoly2D ¶
func OverlapQuantBounds ¶
func OverlapRange ¶
func OverlapSlabs ¶
func ProjectPointToPoly2DLocal ¶
func ProjectPointToPoly2DLocal(pos Vector3f, poly *NavMeshPoly, tile *NavMeshTile, projectedPos *Vector3f) bool
func ProjectPoly ¶
func ProjectToPolyDetail ¶
func ProjectToPolyDetail(tile *NavMeshTile, poly *NavMeshPoly, pos Vector3f, height *float32) bool
Project point height to detail triangle and accept immediately if the projected point is inside triangle
func ProjectToPolyDetailEdge ¶
func ProjectToPolyDetailEdge(tile *NavMeshTile, poly *NavMeshPoly, pos Vector3f) float32
In the plane of projection find the height of the closest point on the edge of the detail triangles
func QuaternionToMatrix3 ¶
func QuaternionToMatrix3(q Quaternionf, m *Matrix3x3f)
func QuaternionToMatrix4 ¶
func QuaternionToMatrix4(q Quaternionf, m *Matrix4x4f)
func ReplacePathStart ¶
func ReplacePathStart(path *[]NavMeshPolyRef, start []NavMeshPolyRef, nstart int32) bool
func ReplacePathStartReverse ¶
func ReplacePathStartReverse(path *[]NavMeshPolyRef, start []NavMeshPolyRef, nstart int32) bool
func SqrDistance ¶
func SqrDistance2D ¶
func SqrDistancePointSegment ¶
func SqrMagnitude ¶
func SqrMagnitudeQ ¶
func SqrMagnitudeQ(inV Quaternionf) float32
func SqrMagnitudeV ¶
func TestPointInCylinder ¶
func TileToWorldBatch ¶
func TileToWorldBatch(worldPositions []Vector3f, tile *NavMeshTile, npositions int, positions []Vector3f)
func TransformAABB ¶
func TransformAABB(aabb AABB, position Vector3f, rotation Quaternionf, result *AABB)
func TransformAABBSlow ¶
func TransformAABBSlow(aabb MinMaxAABB, transform Matrix4x4f, result *MinMaxAABB)
func TriangleAreaXZ ¶
calculate xz plan area of the triangle https://www.mathopenref.com/coordtrianglearea.html
Types ¶
type AABB ¶
type AABB struct {
// contains filtered or unexported fields
}
func NewAABBFromMinMax ¶
func NewAABBFromMinMax(data MinMaxAABB) AABB
func (*AABB) SetCenterAndExtent ¶
type AutoOffMeshLinkData ¶
type AutoOffMeshLinkData struct {
// contains filtered or unexported fields
}
type EdgePointSample ¶
type EdgePointSample struct {
// contains filtered or unexported fields
}
type EdgePointSamples ¶
type EdgePointSamples []EdgePointSample
func (EdgePointSamples) Len ¶
func (this EdgePointSamples) Len() int
func (EdgePointSamples) Less ¶
func (this EdgePointSamples) Less(i, j int) bool
func (EdgePointSamples) Swap ¶
func (this EdgePointSamples) Swap(i, j int)
type HeightMeshBVNode ¶
type HeightMeshBVNode struct {
// contains filtered or unexported fields
}
type HeightMeshData ¶
type HeightMeshData struct {
// contains filtered or unexported fields
}
type LinkFreeList ¶
type LinkFreeList struct {
// contains filtered or unexported fields
}
func (*LinkFreeList) Alloc ¶
func (this *LinkFreeList) Alloc() uint32
func (*LinkFreeList) Capacity ¶
func (this *LinkFreeList) Capacity() uint32
func (*LinkFreeList) Get ¶
func (this *LinkFreeList) Get(i uint32) *NavMeshLink
func (*LinkFreeList) Grow ¶
func (this *LinkFreeList) Grow(s uint32)
func (*LinkFreeList) Init ¶
func (this *LinkFreeList) Init()
func (*LinkFreeList) Release ¶
func (this *LinkFreeList) Release(id uint32)
type Matrix3x3f ¶
type Matrix3x3f struct {
// contains filtered or unexported fields
}
func (*Matrix3x3f) Get ¶
func (this *Matrix3x3f) Get(row, column int) float32
func (*Matrix3x3f) MultiplyPoint3 ¶
func (this *Matrix3x3f) MultiplyPoint3(v Vector3f) Vector3f
func (*Matrix3x3f) MultiplyVector3 ¶
func (this *Matrix3x3f) MultiplyVector3(v Vector3f) Vector3f
type Matrix4x4f ¶
type Matrix4x4f struct {
// contains filtered or unexported fields
}
func (*Matrix4x4f) Get ¶
func (this *Matrix4x4f) Get(row, col int) float32
func (*Matrix4x4f) MultiplyPoint3 ¶
func (this *Matrix4x4f) MultiplyPoint3(v Vector3f) Vector3f
func (*Matrix4x4f) MultiplyVector3 ¶
func (this *Matrix4x4f) MultiplyVector3(v Vector3f) Vector3f
func (*Matrix4x4f) Set ¶
func (this *Matrix4x4f) Set(row, col int, data float32)
func (*Matrix4x4f) SetTR ¶
func (this *Matrix4x4f) SetTR(pos Vector3f, q Quaternionf)
func (*Matrix4x4f) SetTRInverse ¶
func (this *Matrix4x4f) SetTRInverse(pos Vector3f, q Quaternionf)
func (*Matrix4x4f) Translate ¶
func (this *Matrix4x4f) Translate(inTrans Vector3f)
type MinMaxAABB ¶
type MinMaxAABB struct {
// contains filtered or unexported fields
}
func GetWorldTileBounds ¶
func GetWorldTileBounds(tile NavMeshTile) MinMaxAABB
func NewMinMaxAABB ¶
func NewMinMaxAABB(min, max Vector3f) MinMaxAABB
func NewMinMaxAABBFromAABB ¶
func NewMinMaxAABBFromAABB(inAABB AABB) MinMaxAABB
func (*MinMaxAABB) CalculateVertices ¶
func (this *MinMaxAABB) CalculateVertices(outVertices []Vector3f)
func (*MinMaxAABB) Encapsulate ¶
func (this *MinMaxAABB) Encapsulate(other MinMaxAABB)
func (*MinMaxAABB) EncapsulateV ¶
func (this *MinMaxAABB) EncapsulateV(inPoint Vector3f)
func (*MinMaxAABB) Init ¶
func (this *MinMaxAABB) Init()
type NavMesh ¶
type NavMesh struct {
// contains filtered or unexported fields
}
func NewNavMesh ¶
func NewNavMesh() *NavMesh
func (*NavMesh) AddOffMeshConnection ¶
func (this *NavMesh) AddOffMeshConnection(params *OffMeshConnectionParams, connectRadius float32, connectHeight float32) NavMeshPolyRef
func (*NavMesh) AddTile ¶
func (this *NavMesh) AddTile(data []byte, dataSize int32, flags NavMeshTileFlags, surfaceID int32, result *NavMeshTileRef) NavMeshStatus
Adds new tile into the navmesh. The add will fail if the data is in wrong format, there is not enough tiles left, or if there is a tile already at the location. Params:
data - (in) Data of the new tile mesh. dataSize - (in) Data size of the new tile mesh. flags - (in) Tile flags, see NavMeshTileFlags. surfaceID - (in) surface identifier for the tile. result - (out,optional) tile ref if the tile was successfully added.
func (*NavMesh) BumpTimeStamp ¶
func (this *NavMesh) BumpTimeStamp()
func (*NavMesh) ClosestPointOnPolyInTileLocal ¶
func (this *NavMesh) ClosestPointOnPolyInTileLocal(tile *NavMeshTile, poly *NavMeshPoly, pos Vector3f, closest *Vector3f)
Returns closest point on polygon.
func (*NavMesh) ConnectExtLinks ¶
func (this *NavMesh) ConnectExtLinks(tile *NavMeshTile, target *NavMeshTile, side int32, portalHeight float32)
Builds external polygon links for a tile.
func (*NavMesh) ConnectIntLinks ¶
func (this *NavMesh) ConnectIntLinks(tile *NavMeshTile)
Builds internal polygons links for a tile.
func (*NavMesh) ConnectOffMeshConnection ¶
func (*NavMesh) ConnectOffMeshConnectionsToTile ¶
func (this *NavMesh) ConnectOffMeshConnectionsToTile(tile *NavMeshTile)
func (*NavMesh) CreateSurface ¶
func (this *NavMesh) CreateSurface(reserveTileCount int, settings NavMeshBuildSettings, pos Vector3f, rot Quaternionf) int32
Creates a surface - set of tiles sharing some data Reserves room for tiles belonging for a given surface. Params:
tileCount - (in) number of tiles to reserve memory for. settings - (in) settings for tiles belonging to this surface.
func (*NavMesh) FindConnectingPolys ¶
func (this *NavMesh) FindConnectingPolys(fromPoints []Vector3f, fromPointCount int32, tile *NavMeshTile, side int32, con []NavMeshPolyRef, conarea []PortalArea, maxcon int32, portalHeight float32) int32
Returns all polygons in neighbour tile based on portal defined by the segment.
func (*NavMesh) FindNearestPoly ¶
func (this *NavMesh) FindNearestPoly(typeID int32, center Vector3f, extents Vector3f, nearestPt *Vector3f) NavMeshPolyRef
Find nearest polygon within a tile.
func (*NavMesh) FindPolygonsOverlappingSegment ¶
func (*NavMesh) GetAgentTypeIdForPolyRef ¶
func (this *NavMesh) GetAgentTypeIdForPolyRef(ref NavMeshPolyRef) int32
Returns the agentTypeId that is allowed to use the polygon.
func (*NavMesh) GetFirstLink ¶
func (this *NavMesh) GetFirstLink(ref NavMeshPolyRef) *NavMeshLink
func (*NavMesh) GetFirstOffMeshConnection ¶
func (this *NavMesh) GetFirstOffMeshConnection() *OffMeshConnection
func (*NavMesh) GetLink ¶
func (this *NavMesh) GetLink(i uint32) *NavMeshLink
func (*NavMesh) GetMaxTiles ¶
Returns the number of tiles currently allocated. Use together with GetTile to access all tiles.
func (*NavMesh) GetNearestOffMeshConnectionEndPoints ¶
func (this *NavMesh) GetNearestOffMeshConnectionEndPoints(prevRef NavMeshPolyRef, offMeshPolyRef NavMeshPolyRef, nextRef NavMeshPolyRef, currentPos Vector3f, startPos *Vector3f, endPos *Vector3f) NavMeshStatus
func (*NavMesh) GetNextLink ¶
func (this *NavMesh) GetNextLink(link *NavMeshLink) *NavMeshLink
func (*NavMesh) GetNextOffMeshConnection ¶
func (this *NavMesh) GetNextOffMeshConnection(data *OffMeshConnection) *OffMeshConnection
func (*NavMesh) GetOffMeshConnection ¶
func (this *NavMesh) GetOffMeshConnection(ref NavMeshPolyRef) *OffMeshConnection
func (*NavMesh) GetOffMeshConnectionEndPoints ¶
func (this *NavMesh) GetOffMeshConnectionEndPoints(prevRef NavMeshPolyRef, offMeshPolyRef NavMeshPolyRef, startPos *Vector3f, endPos *Vector3f) NavMeshStatus
Returns start and end location of an off-mesh link polygon. As seen when approached from prevRef. Returns start and end location of an off-mesh link polygon. Params:
prevRef - (in) ref to the polygon before the link (used to select direction). polyRef - (in) ref to the off-mesh link polygon. startPos[3] - (out) start point of the link. endPos[3] - (out) end point of the link.
Returns: true if link is found.
func (*NavMesh) GetOffMeshConnectionUnsafe ¶
func (this *NavMesh) GetOffMeshConnectionUnsafe(ref NavMeshPolyRef) *OffMeshConnection
func (*NavMesh) GetOffMeshConnectionUserID ¶
func (this *NavMesh) GetOffMeshConnectionUserID(ref NavMeshPolyRef, userID *int32) NavMeshStatus
func (*NavMesh) GetPolyArea ¶
func (this *NavMesh) GetPolyArea(ref NavMeshPolyRef) byte
func (*NavMesh) GetPolyEdgeDetailPoints ¶
func (this *NavMesh) GetPolyEdgeDetailPoints(tile *NavMeshTile, p int32, edge int32, points []Vector3f, pointCount *int32, maxPoints int32) NavMeshStatus
Returns polygon edge points based on detail mesh. If 'maxPoints' is less than the number of points on the edge, the edge is simplified. Params:
tile - (in) pointer to tile where the polygon lies. poly - (in) polygon index edge - (in) edge index points - (out) array to store the edge points (maxPoints*3). pointCount - (out) number of points stored. maxPoints - (in) max number of points that can fit into points, must be >= 2.
func (*NavMesh) GetPolyFlags ¶
func (this *NavMesh) GetPolyFlags(ref NavMeshPolyRef) uint32
func (*NavMesh) GetPolyFlagsAndArea ¶
func (this *NavMesh) GetPolyFlagsAndArea(ref NavMeshPolyRef, flags *uint32, area *byte)
func (*NavMesh) GetPolyGeometry ¶
func (this *NavMesh) GetPolyGeometry(ref NavMeshPolyRef, verts []Vector3f, neighbours []NavMeshPolyRef, maxNeisPerEdge int32) int32
Returns vertices and neighbours of polygon pointed to by the polygon reference. Note: this function returns 0 if ref is invalid Params:
ref - (in) reference to a polygon. verts - (out, optional) pointer to polygon vertices, must have a capacity of at least kNavMeshVertsPerPoly. neighbours - (out, optional) pointer to the polygon neighbours, must have a capacity of at least kNavMeshVertsPerPoly*maxNeisPerEdge. maxNeisPerEdge - (int) maximum number of neighbours stored in 'neighbours' per edge.
func (*NavMesh) GetPolyRefBase ¶
func (this *NavMesh) GetPolyRefBase(tile *NavMeshTile) NavMeshPolyRef
Returns base poly id for specified tile, polygon refs can be deducted from this.
func (*NavMesh) GetSurfaceSettings ¶
func (this *NavMesh) GetSurfaceSettings(surfaceID int32) *NavMeshBuildSettings
func (*NavMesh) GetSurfaceTransform ¶
func (this *NavMesh) GetSurfaceTransform(surfaceID int32, pos *Vector3f, rot *Quaternionf) NavMeshStatus
func (*NavMesh) GetTile ¶
func (this *NavMesh) GetTile(i int32) *NavMeshTile
Returns a pointer to tile in the tile free list. If the tile 'header' pointer is 0, the tile is invalid. Params:
i - (in) Index to the tile to retrieve, max index is GetMaxTiles()-1.
Returns: Pointer to specified tile.
func (*NavMesh) GetTileAndPolyByRef ¶
func (this *NavMesh) GetTileAndPolyByRef(ref NavMeshPolyRef, tile **NavMeshTile, poly **NavMeshPoly) NavMeshStatus
Returns pointer to tile and polygon pointed by the polygon reference. Params:
ref - (in) reference to a polygon. tile - (out) pointer to the tile containing the polygon. poly - (out) pointer to the polygon.
func (*NavMesh) GetTileAndPolyByRefUnsafe ¶
func (this *NavMesh) GetTileAndPolyByRefUnsafe(ref NavMeshPolyRef, tile **NavMeshTile, poly **NavMeshPoly)
Returns pointer to tile and polygon pointed by the polygon reference. Note: this function does not check if 'ref' s valid, and is thus faster. Use only with valid refs! Params:
ref - (in) reference to a polygon. tile - (out) pointer to the tile containing the polygon. poly - (out) pointer to the polygon.
func (*NavMesh) GetTileByRef ¶
func (this *NavMesh) GetTileByRef(ref NavMeshTileRef) *NavMeshTile
Returns tile based on references.
func (*NavMesh) GetTileRef ¶
func (this *NavMesh) GetTileRef(tile *NavMeshTile) NavMeshTileRef
Returns tile references of a tile based on tile pointer.
func (*NavMesh) GetTimeStamp ¶
func (*NavMesh) IsValidPolyRef ¶
func (this *NavMesh) IsValidPolyRef(ref NavMeshPolyRef) bool
Returns true if polygon reference points to valid data.
func (*NavMesh) QueryPolygons ¶
func (this *NavMesh) QueryPolygons(typeID int32, cen Vector3f, ext Vector3f, callback NavMeshProcessCallback)
Returns polygons which overlap the query box. Params:
typeID - (in) query surfaces with this id. -1 means query all surfaces. center[3] - (in) the center of the search box. extents[3] - (in) the extents of the search box. callback - (in/out) pointer to callback interface to batch-process the results, see NavMeshProcessCallback.
func (*NavMesh) QueryPolygonsInTile ¶
func (this *NavMesh) QueryPolygonsInTile(tile *NavMeshTile, center Vector3f, extents Vector3f, callback NavMeshProcessCallback)
Queries polygons within a tile.
func (*NavMesh) RemoveLinkBetween ¶
func (this *NavMesh) RemoveLinkBetween(from NavMeshPolyRef, to NavMeshPolyRef)
func (*NavMesh) RemoveOffMeshConnection ¶
func (this *NavMesh) RemoveOffMeshConnection(ref NavMeshPolyRef) NavMeshStatus
func (*NavMesh) RemoveTile ¶
func (this *NavMesh) RemoveTile(ref NavMeshTileRef, surfaceID int32, data *[]byte, dataSize *int32) NavMeshStatus
Removes specified tile. Params:
ref - (in) Reference to the tile to remove. surfaceID - (in) surface identifier for the tile data - (out) Data associated with deleted tile. dataSize - (out) Size of the data associated with deleted tile.
func (*NavMesh) SetOffMeshConnectionCostModifier ¶
func (this *NavMesh) SetOffMeshConnectionCostModifier(ref NavMeshPolyRef, costOverride float32) NavMeshStatus
polyRef - polyRef of the offmeshlink polygon costOverride - use this as cost OffMeshLink cost modifier instead of what is specified by areas.
func (*NavMesh) SetOffMeshConnectionFlags ¶
func (this *NavMesh) SetOffMeshConnectionFlags(ref NavMeshPolyRef, flags uint32) NavMeshStatus
func (*NavMesh) SetOffMeshConnectionUserID ¶
func (this *NavMesh) SetOffMeshConnectionUserID(ref NavMeshPolyRef, userID int32) NavMeshStatus
func (*NavMesh) SetSurfaceSettings ¶
func (this *NavMesh) SetSurfaceSettings(surfaceID int32, settings NavMeshBuildSettings)
func (*NavMesh) UnconnectLinks ¶
func (this *NavMesh) UnconnectLinks(tile *NavMeshTile)
Removes all internal and external links from a tile.
func (*NavMesh) UnconnectOffMeshConnection ¶
func (*NavMesh) UnconnectOffMeshConnectionsToTile ¶
func (this *NavMesh) UnconnectOffMeshConnectionsToTile(ref NavMeshTileRef)
type NavMeshBVNode ¶
type NavMeshBVNode struct {
// contains filtered or unexported fields
}
type NavMeshBuildSettings ¶
type NavMeshBuildSettings struct {
// contains filtered or unexported fields
}
type NavMeshData ¶
type NavMeshData struct {
// contains filtered or unexported fields
}
func NewDataFromFormat ¶
func NewDataFromFormat(data *format.NavMeshData) *NavMeshData
func (*NavMeshData) AddOffMeshLink ¶
func (this *NavMeshData) AddOffMeshLink(source, target Vector3f, area, linkDirection byte)
func (*NavMeshData) GetAgentTypeId ¶
func (this *NavMeshData) GetAgentTypeId() int32
func (*NavMeshData) GetFilterAreaCosts ¶
func (this *NavMeshData) GetFilterAreaCosts() []float32
func (*NavMeshData) GetNavMeshBuildSettings ¶
func (this *NavMeshData) GetNavMeshBuildSettings() NavMeshBuildSettings
func (*NavMeshData) GetNavMeshTiles ¶
func (this *NavMeshData) GetNavMeshTiles() []NavMeshTileData
func (*NavMeshData) GetOffMeshLinks ¶
func (this *NavMeshData) GetOffMeshLinks() []AutoOffMeshLinkData
func (*NavMeshData) GetPosition ¶
func (this *NavMeshData) GetPosition() Vector3f
func (*NavMeshData) GetRotation ¶
func (this *NavMeshData) GetRotation() Quaternionf
type NavMeshDataHeader ¶
type NavMeshDataHeader struct {
// contains filtered or unexported fields
}
type NavMeshHit ¶
type NavMeshHit struct {
// contains filtered or unexported fields
}
func (*NavMeshHit) GetDistance ¶
func (this *NavMeshHit) GetDistance() float32
func (*NavMeshHit) GetMask ¶
func (this *NavMeshHit) GetMask() uint32
func (*NavMeshHit) GetNormal ¶
func (this *NavMeshHit) GetNormal() Vector3f
func (*NavMeshHit) GetPosition ¶
func (this *NavMeshHit) GetPosition() Vector3f
func (*NavMeshHit) Hit ¶
func (this *NavMeshHit) Hit() bool
type NavMeshLink ¶
type NavMeshLink struct {
// contains filtered or unexported fields
}
Structure describing a link to another polygon.
type NavMeshLinkDirectionFlags ¶
type NavMeshLinkDirectionFlags int32
type NavMeshManager ¶
type NavMeshManager struct {
// contains filtered or unexported fields
}
func NewManagerFromData ¶
func NewManagerFromData(nvData *format.NavMeshData) (*NavMeshManager, error)
func NewNavMeshManager ¶
func NewNavMeshManager() *NavMeshManager
func (*NavMeshManager) CalculatePath ¶
func (this *NavMeshManager) CalculatePath(source, target Vector3f, maxIter int32) ([]Vector3f, bool)
func (*NavMeshManager) CalculatePathCorners ¶
func (this *NavMeshManager) CalculatePathCorners(corners []Vector3f, maxCorners int32, path *NavMeshPath) int32
func (*NavMeshManager) CalculatePolygonPath ¶
func (this *NavMeshManager) CalculatePolygonPath(path *NavMeshPath, sourcePosition, targetPosition Vector3f, maxIter int32) int32
func (*NavMeshManager) Clone ¶
func (this *NavMeshManager) Clone() *NavMeshManager
func (*NavMeshManager) DistanceToEdge ¶
func (this *NavMeshManager) DistanceToEdge(hit *NavMeshHit, sourcePosition Vector3f) bool
func (*NavMeshManager) FindNearestPoly ¶
func (this *NavMeshManager) FindNearestPoly(center Vector3f, nearestRef *NavMeshPolyRef, nearestPt *Vector3f)
func (*NavMeshManager) FindRandomPointInCircle ¶
func (this *NavMeshManager) FindRandomPointInCircle(center Vector3f, radius float32) (Vector3f, error)
func (*NavMeshManager) GetFilter ¶
func (this *NavMeshManager) GetFilter() *QueryFilter
func (*NavMeshManager) GetNavMesh ¶
func (this *NavMeshManager) GetNavMesh() *NavMesh
func (*NavMeshManager) GetNavMeshQuery ¶
func (this *NavMeshManager) GetNavMeshQuery() *NavMeshQuery
func (*NavMeshManager) LoadData ¶
func (this *NavMeshManager) LoadData(nvData *NavMeshData) error
func (*NavMeshManager) MapPosition ¶
func (this *NavMeshManager) MapPosition(mappedPolyRef *NavMeshPolyRef, mappedPosition *Vector3f, position, extents Vector3f) bool
func (*NavMeshManager) MoveAlongSurface ¶
func (this *NavMeshManager) MoveAlongSurface(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, resultPos *Vector3f, visited []NavMeshPolyRef, visitedCount *int32, maxVisitedSize int32) NavMeshStatus
func (*NavMeshManager) Raycast ¶
func (this *NavMeshManager) Raycast(hit *NavMeshHit, sourcePosition, targetPosition Vector3f) bool
func (*NavMeshManager) SamplePosition ¶
func (this *NavMeshManager) SamplePosition(hit *NavMeshHit, sourcePosition Vector3f, maxDistance float32) bool
func (*NavMeshManager) WalkableBetween ¶
func (this *NavMeshManager) WalkableBetween(source, target Vector3f) bool
TODO not fully tested
type NavMeshNode ¶
type NavMeshNode struct {
// contains filtered or unexported fields
}
type NavMeshNodeFlags ¶
type NavMeshNodeFlags uint8
type NavMeshNodeIndex ¶
type NavMeshNodeIndex uint16
type NavMeshNodePool ¶
type NavMeshNodePool struct {
// contains filtered or unexported fields
}
func NewNavMeshNodePool ¶
func NewNavMeshNodePool(maxNavMeshNodes, hashSize int32) *NavMeshNodePool
////////////////////////////////////////////////////////////////////////////////////////
func (*NavMeshNodePool) Clear ¶
func (this *NavMeshNodePool) Clear()
func (*NavMeshNodePool) FindNavMeshNode ¶
func (this *NavMeshNodePool) FindNavMeshNode(id NavMeshPolyRef) *NavMeshNode
func (*NavMeshNodePool) GetFirst ¶
func (this *NavMeshNodePool) GetFirst(bucket int32) NavMeshNodeIndex
func (*NavMeshNodePool) GetHashSize ¶
func (this *NavMeshNodePool) GetHashSize() int32
func (*NavMeshNodePool) GetNext ¶
func (this *NavMeshNodePool) GetNext(i int32) NavMeshNodeIndex
func (*NavMeshNodePool) GetNode ¶
func (this *NavMeshNodePool) GetNode(id NavMeshPolyRef) *NavMeshNode
func (*NavMeshNodePool) GetNodeAtIdx ¶
func (this *NavMeshNodePool) GetNodeAtIdx(idx uint32) *NavMeshNode
func (*NavMeshNodePool) GetNodeIdx ¶
func (this *NavMeshNodePool) GetNodeIdx(node *NavMeshNode) uint32
type NavMeshNodeQueue ¶
type NavMeshNodeQueue struct {
// contains filtered or unexported fields
}
func NewNavMeshNodeQueue ¶
func NewNavMeshNodeQueue(n int32) *NavMeshNodeQueue
////////////////////////////////////////////////////////////////////////////////////////
func (*NavMeshNodeQueue) BubbleUp ¶
func (this *NavMeshNodeQueue) BubbleUp(i int32, node *NavMeshNode)
func (*NavMeshNodeQueue) Clear ¶
func (this *NavMeshNodeQueue) Clear()
func (*NavMeshNodeQueue) Modify ¶
func (this *NavMeshNodeQueue) Modify(node *NavMeshNode)
func (*NavMeshNodeQueue) Pop ¶
func (this *NavMeshNodeQueue) Pop() *NavMeshNode
func (*NavMeshNodeQueue) Push ¶
func (this *NavMeshNodeQueue) Push(node *NavMeshNode)
func (*NavMeshNodeQueue) TrickleDown ¶
func (this *NavMeshNodeQueue) TrickleDown(i int32, node *NavMeshNode)
type NavMeshPath ¶
type NavMeshPath struct {
// contains filtered or unexported fields
}
func NewNavMeshPath ¶
func NewNavMeshPath() *NavMeshPath
func (*NavMeshPath) GetPolygonCapacity ¶
func (this *NavMeshPath) GetPolygonCapacity() int32
func (*NavMeshPath) GetPolygonCount ¶
func (this *NavMeshPath) GetPolygonCount() int32
func (*NavMeshPath) GetPolygonData ¶
func (this *NavMeshPath) GetPolygonData() []NavMeshPolyRef
func (*NavMeshPath) GetPolygonPath ¶
func (this *NavMeshPath) GetPolygonPath() []NavMeshPolyRef
func (*NavMeshPath) GetSourcePosition ¶
func (this *NavMeshPath) GetSourcePosition() Vector3f
func (*NavMeshPath) GetStatus ¶
func (this *NavMeshPath) GetStatus() NavMeshPathStatus
func (*NavMeshPath) GetTargetPosition ¶
func (this *NavMeshPath) GetTargetPosition() Vector3f
func (*NavMeshPath) IsComplete ¶
func (this *NavMeshPath) IsComplete() bool
func (*NavMeshPath) IsInvalid ¶
func (this *NavMeshPath) IsInvalid() bool
func (*NavMeshPath) IsPartial ¶
func (this *NavMeshPath) IsPartial() bool
func (*NavMeshPath) ReservePolygons ¶
func (this *NavMeshPath) ReservePolygons(size int32)
func (*NavMeshPath) SetPolygonCount ¶
func (this *NavMeshPath) SetPolygonCount(polygonCount int32)
func (*NavMeshPath) SetSourcePosition ¶
func (this *NavMeshPath) SetSourcePosition(sourcePosition Vector3f)
func (*NavMeshPath) SetStatus ¶
func (this *NavMeshPath) SetStatus(status NavMeshPathStatus)
func (*NavMeshPath) SetTargetPosition ¶
func (this *NavMeshPath) SetTargetPosition(targetPosition Vector3f)
func (*NavMeshPath) SetTimeStamp ¶
func (this *NavMeshPath) SetTimeStamp(timeStamp uint32)
type NavMeshPathStatus ¶
type NavMeshPathStatus int32
type NavMeshPoly ¶
type NavMeshPoly struct {
// contains filtered or unexported fields
}
Structure describing the navigation polygon data.
type NavMeshPolyDetail ¶
type NavMeshPolyDetail struct {
// contains filtered or unexported fields
}
Structure describing polygon detail triangles.
type NavMeshPolyDetailIndex ¶
type NavMeshPolyDetailIndex uint16
The type for the detail mesh vertices index.
type NavMeshPolyRef ¶
type NavMeshPolyRef uint64
Reference to navigation polygon.
func EncodeBasePolyId ¶
func EncodeBasePolyId(typ uint32, ip uint32) NavMeshPolyRef
func EncodeLinkId ¶
func EncodeLinkId(salt uint32, ip uint32) NavMeshPolyRef
func EncodePolyId ¶
func EncodePolyId(salt uint32, it uint32, typ uint32, ip uint32) NavMeshPolyRef
Encodes a poly id.
type NavMeshProcessCallback ¶
type NavMeshProcessCallback interface {
}type NavMeshQuery ¶
type NavMeshQuery struct {
// contains filtered or unexported fields
}
func NewNavMeshQuery ¶
func NewNavMeshQuery(navmesh *NavMesh, maxNodes int32) *NavMeshQuery
func (*NavMeshQuery) ClosestPointOnPoly ¶
func (this *NavMeshQuery) ClosestPointOnPoly(ref NavMeshPolyRef, pos Vector3f, closest *Vector3f) NavMeshStatus
Returns closest point on navigation polygon. Uses detail polygons to find the closest point to the navigation polygon surface. Params:
ref - (in) ref to the polygon. pos[3] - (in) the point to check. closest[3] - (out) closest point.
Returns: true if closest point found.
func (*NavMeshQuery) ClosestPointOnPolyBoundary ¶
func (this *NavMeshQuery) ClosestPointOnPolyBoundary(ref NavMeshPolyRef, pos Vector3f, closest *Vector3f) NavMeshStatus
Returns closest point on navigation polygon boundary. Uses the navigation polygon boundary to snap the point to poly boundary if it is outside the polygon. Much faster than ClosestPointToPoly. Does not affect height. Params:
ref - (in) ref to the polygon. pos[3] - (in) the point to check. closest[3] - (out) closest point.
Returns: true if closest point found.
func (*NavMeshQuery) ClosestPointOnPolyInTileLocal ¶
func (this *NavMeshQuery) ClosestPointOnPolyInTileLocal(tile *NavMeshTile, poly *NavMeshPoly, ref NavMeshPolyRef, pos Vector3f, closest *Vector3f) bool
Local space input/output Calculate the closest point on a polygon Returns true unless the 2D projected point is outside the polygon
func (*NavMeshQuery) FinalizeSlicedFindPath ¶
func (this *NavMeshQuery) FinalizeSlicedFindPath(pathCount *int32) NavMeshStatus
Finalizes sliced path find query and returns found path.
pathCount - (out) Number of polygons in search result.
func (*NavMeshQuery) FinalizeSlicedFindPathPartial ¶
func (this *NavMeshQuery) FinalizeSlicedFindPathPartial(pathCount *int32, existing []NavMeshPolyRef, existingSize int32) NavMeshStatus
Finalizes partial sliced path find query and returns path to the furthest polygon on the existing path that was visited during the search.
existing - (out) Array of polygons in the existing path. existingSize - (out) Number of polygons in existing path array. pathCount - (out) Number of polygons in search result.
func (*NavMeshQuery) FindDistanceToWall ¶
func (this *NavMeshQuery) FindDistanceToWall(startRef NavMeshPolyRef, centerPos Vector3f, filter *QueryFilter, hitDist *float32, hitPos *Vector3f, hitNormal *Vector3f, hitFlags *uint32) NavMeshStatus
/ Finds the distance from the specified position to the nearest polygon wall. / @param[in] startRef The reference id of the polygon containing @p centerPos. / @param[in] centerPos The center of the search circle. [(x, y, z)] / @param[in] filter The polygon filter to apply to the query. / @param[out] hitDist The distance to the nearest wall from @p centerPos. / @param[out] hitPos The nearest position on the wall that was hit. [(x, y, z)] / @param[out] hitNormal The normalized ray formed from the wall point to the / source point. [(x, y, z)] / @returns The status flags for the query.
func (*NavMeshQuery) FindLocalNeighbourhood ¶
func (this *NavMeshQuery) FindLocalNeighbourhood(startRef NavMeshPolyRef, centerPos Vector3f, radius float32, filter *QueryFilter, resultRef []NavMeshPolyRef, resultParent []NavMeshPolyRef, resultCount *int32, maxResult int32) NavMeshStatus
Finds non-overlapping local neighbourhood around center location. Note: The algorithm is optimized for small query radius and small number of polygons. Params:
startRef - (in) ref to the polygon where the search starts. centerPos[3] - (in) center if the query circle. radius - (in) radius of the query circle. filter - (in) path polygon filter. resultRef - (out) refs to the polygons touched by the circle. resultParent - (out, opt) parent of each result polygon. resultCount - (out) number of results. maxResult - (int) maximum capacity of search results.
func (*NavMeshQuery) FindNearestPoly ¶
func (this *NavMeshQuery) FindNearestPoly(center Vector3f, extents Vector3f, filter *QueryFilter, nearestRef *NavMeshPolyRef, nearestPt *Vector3f)
Finds the nearest navigation polygon around the center location. Params:
center[3] - (in) The center of the search box. extents[3] - (in) The extents of the search box. filter - (in) path polygon filter. nearestRef - (out) Reference to the nearest polygon. nearestPt[3] - (out, opt) The nearest point on found polygon, null if not needed.
func (*NavMeshQuery) FindStraightPath ¶
func (this *NavMeshQuery) FindStraightPath(startPos Vector3f, endPos Vector3f, path []NavMeshPolyRef, pathSize int32, straightPath []Vector3f, straightPathFlags []byte, straightPathRefs []NavMeshPolyRef, straightPathCount *int32, maxStraightPath int32) NavMeshStatus
Finds a straight path from start to end locations within the corridor described by the path polygons. Start and end locations will be clamped on the corridor. The returned polygon references are point to polygon which was entered when a path point was added. For the end point, zero will be returned. This allows to match for example off-mesh link points to their representative polygons. Params:
startPos[3] - (in) Path start location. endPo[3] - (in) Path end location. path - (in) Array of connected polygons describing the corridor. pathSize - (in) Number of polygons in path array. straightPath - (out) Points describing the straight path. straightPathFlags - (out, opt) Flags describing each point type, see NavMeshStraightPathFlags. straightPathRefs - (out, opt) References to polygons at point locations. straightPathCount - (out) Number of points in the path. maxStraightPath - (in) The max number of points the straight path array can hold. Must be at least 1
func (*NavMeshQuery) GetAttachedNavMesh ¶
func (this *NavMeshQuery) GetAttachedNavMesh() *NavMesh
func (*NavMeshQuery) GetPath ¶
func (this *NavMeshQuery) GetPath(path []NavMeshPolyRef, pathCount *int32, maxPath int32) NavMeshStatus
Returns found path, must call finalizeSlicedFindPath() or finalizeSlicedFindPathPartial() before calling this function.
path - (out) array holding the search result. pathCount - (out) Number of polygons in search result array. maxPath - (in) The max number of polygons the path array can hold.
func (*NavMeshQuery) GetPolyHeightLocal ¶
func (this *NavMeshQuery) GetPolyHeightLocal(ref NavMeshPolyRef, pos Vector3f, height *float32) NavMeshStatus
Returns height of the polygon at specified location. Params:
ref - (in) ref to the polygon. pos[3] - (in) the point where to locate the height. height - (out) height at the location.
Returns: true if over polygon.
func (*NavMeshQuery) GetPolyWallSegments ¶
func (this *NavMeshQuery) GetPolyWallSegments(ref NavMeshPolyRef, filter *QueryFilter, segmentVerts []Vector3f, segmentRefs []NavMeshPolyRef, segmentCount *int32, maxSegments int32) NavMeshStatus
Returns wall segments of specified polygon. If 'segmentRefs' is specified, both the wall and portal segments are returned. Wall segments will have null (0) polyref, and portal segments store the polygon they lead to. Params:
ref - (in) ref to the polygon. filter - (in) path polygon filter. segmentVerts[2*maxSegments] - (out) wall segments (2 endpoints per segment). segmentRefs[maxSegments] - (out,opt) reference to a neighbour. segmentCount - (out) number of wall segments. maxSegments - (in) max number of segments that can be stored in 'segments'.
func (*NavMeshQuery) GetPortalPoints ¶
func (this *NavMeshQuery) GetPortalPoints(from NavMeshPolyRef, to NavMeshPolyRef, left *Vector3f, right *Vector3f) NavMeshStatus
Returns portal points between two polygons.
func (*NavMeshQuery) GetUpAxis ¶
func (this *NavMeshQuery) GetUpAxis(ref NavMeshPolyRef, up *Vector3f) NavMeshStatus
func (*NavMeshQuery) InitPools ¶
func (this *NavMeshQuery) InitPools(nav *NavMesh, maxNodes int32) NavMeshStatus
Initializes the nav mesh query. Params:
nav - (in) pointer to navigation mesh data. maxNodes - (in) Maximum number of search nodes to use (max 65536).
func (*NavMeshQuery) InitSlicedFindPath ¶
func (this *NavMeshQuery) InitSlicedFindPath(startRef NavMeshPolyRef, endRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, agentType int32, areaMask int32, costs [kAreaCount]float32) NavMeshStatus
func (*NavMeshQuery) InitSlicedFindPath2 ¶
func (this *NavMeshQuery) InitSlicedFindPath2(startRef NavMeshPolyRef, endRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, filter *QueryFilter) NavMeshStatus
Initializes sliced path find query. Note 1: calling any other NavMeshQuery method before calling FindPathEnd() may results in corrupted data! Note 2: The pointer to filter is store, and used in subsequent calls to UpdateSlicedFindPath(). Params:
startRef - (in) ref to path start polygon. endRef - (in) ref to path end polygon. startPos[3] - (in) Path start location. endPos[3] - (in) Path end location. filter - (in) path polygon filter.
func (*NavMeshQuery) IsInClosedList ¶
func (this *NavMeshQuery) IsInClosedList(ref NavMeshPolyRef) bool
Returns true if poly reference ins in closed list.
func (*NavMeshQuery) MoveAlongSurface ¶
func (this *NavMeshQuery) MoveAlongSurface(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, filter *QueryFilter, resultPos *Vector3f, visited []NavMeshPolyRef, visitedCount *int32, maxVisitedSize int32) NavMeshStatus
Moves from startPos to endPos constrained to the navmesh. If the endPos is reachable, the resultPos will be endPos, or else the resultPos will be the nearest point in navmesh. Note: The resulting point is not projected to the ground, use GetPolyHeight() to get height. Note: The algorithm is optimized for small delta movement and small number of polygons. Params:
startRef - (in) ref to the polygon where startPos lies. startPos[3] - (in) start position of the mover. endPos[3] - (in) desired end position of the mover. filter - (in) path polygon filter. resultPos[3] - (out) new position of the mover. visited - (out) array of visited polygons. visitedCount - (out) Number of entries in the visited array. maxVisitedSize - (in) max number of polygons in the visited array.
func (*NavMeshQuery) MoveAlongSurface2 ¶
func (this *NavMeshQuery) MoveAlongSurface2(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, filter *QueryFilter, resultPos *Vector3f, visited []NavMeshPolyRef, visitedCount *int32, maxVisitedSize int32, nodePool *NavMeshNodePool) NavMeshStatus
func (*NavMeshQuery) ProjectToPoly ¶
func (this *NavMeshQuery) ProjectToPoly(projPos *Vector3f, ref NavMeshPolyRef, pos Vector3f) NavMeshStatus
Project point to polygon along the local up-axis
func (*NavMeshQuery) QueryPolygons ¶
func (this *NavMeshQuery) QueryPolygons(center Vector3f, extents Vector3f, filter *QueryFilter, polys []NavMeshPolyRef, polyCount *int32, maxPolys int32)
Returns polygons which overlap the query box. Params:
center[3] - (in) the center of the search box. extents[3] - (in) the extents of the search box. filter - (in) path polygon filter. polys - (out) array holding the search result. polyCount - (out) Number of polygons in search result array. maxPolys - (in) The max number of polygons the polys array can hold.
func (*NavMeshQuery) Raycast ¶
func (this *NavMeshQuery) Raycast(startRef NavMeshPolyRef, startPos Vector3f, endPos Vector3f, filter *QueryFilter, result *NavMeshRaycastResult, path []NavMeshPolyRef, pathCount *int32, maxPath int32) NavMeshStatus
Casts 'walkability' ray along the navmesh surface from startPos towards the endPos. Params:
startRef - (in) ref to the polygon where the start lies. startPos[3] - (in) start position of the query. endPos[3] - (in) end position of the query. filter - (in) path polygon filter. result - (out) raycast result data. path - (out,opt) visited path polygons. pathCount - (out,opt) Number of polygons visited. maxPath - (in) max number of polygons in the path array.
func (*NavMeshQuery) RetracePortals ¶
func (this *NavMeshQuery) RetracePortals(startIndex int32, endIndex int32, path []NavMeshPolyRef, n int32, termPos Vector3f, straightPath []Vector3f, straightPathFlags []byte, straightPathRefs []NavMeshPolyRef, maxStraightPath int32) int32
Retrace portals between corners register if type of polygon changes
func (*NavMeshQuery) UpdateNeighbourLink ¶
func (this *NavMeshQuery) UpdateNeighbourLink(link *NavMeshLink, parentRef NavMeshPolyRef, bestRef NavMeshPolyRef, bestNode *NavMeshNode)
func (*NavMeshQuery) UpdateSlicedFindPath ¶
func (this *NavMeshQuery) UpdateSlicedFindPath(maxIter int32, doneIters *int32) NavMeshStatus
Updates sliced path find query. Params:
maxIter - (in) Max number of iterations to update. doneIters - (out,opt) Number of iterations done during the update.
Returns: Path query state.
type NavMeshQueryData ¶
type NavMeshQueryData struct {
// contains filtered or unexported fields
}
type NavMeshRaycastResult ¶
type NavMeshRaycastResult struct {
// contains filtered or unexported fields
}
type NavMeshStatus ¶
type NavMeshStatus uint32
type NavMeshStraightPathFlags ¶
type NavMeshStraightPathFlags int32
Flags returned by FindStraightPath().
type NavMeshTile ¶
type NavMeshTile struct {
// contains filtered or unexported fields
}
func NewNavMeshTile ¶
func NewNavMeshTile() *NavMeshTile
type NavMeshTileData ¶
type NavMeshTileData struct {
// contains filtered or unexported fields
}
func (NavMeshTileData) GetData ¶
func (this NavMeshTileData) GetData() []byte
type NearestQuery ¶
type NearestQuery struct {
// contains filtered or unexported fields
}
func NewNearestQuery ¶
func NewNearestQuery(navmesh *NavMesh, center Vector3f) NearestQuery
func (*NearestQuery) ProcessPolygons ¶
func (this *NearestQuery) ProcessPolygons(tile *NavMeshTile, polyRefs []NavMeshPolyRef, polys []*NavMeshPoly, itemCount int)
type NearestQuery1 ¶
type NearestQuery1 struct {
// contains filtered or unexported fields
}
func NewNearestQuery1 ¶
func NewNearestQuery1(navMeshQuery *NavMeshQuery, filter *QueryFilter, center Vector3f) *NearestQuery1
func (*NearestQuery1) ProcessPolygons ¶
func (this *NearestQuery1) ProcessPolygons(tile *NavMeshTile, polyRefs []NavMeshPolyRef, polys []*NavMeshPoly, itemCount int)
type OffMeshConnection ¶
type OffMeshConnection struct {
// contains filtered or unexported fields
}
func NewOffMeshConnection ¶
func NewOffMeshConnection() *OffMeshConnection
type OffMeshConnectionParams ¶
type OffMeshConnectionParams struct {
// contains filtered or unexported fields
}
type OffMeshFreeList ¶
type OffMeshFreeList struct {
// contains filtered or unexported fields
}
func (*OffMeshFreeList) Alloc ¶
func (this *OffMeshFreeList) Alloc() uint32
func (*OffMeshFreeList) Capacity ¶
func (this *OffMeshFreeList) Capacity() uint32
func (*OffMeshFreeList) Get ¶
func (this *OffMeshFreeList) Get(i uint32) *OffMeshConnection
func (*OffMeshFreeList) Grow ¶
func (this *OffMeshFreeList) Grow(s uint32)
func (*OffMeshFreeList) Init ¶
func (this *OffMeshFreeList) Init()
func (*OffMeshFreeList) Release ¶
func (this *OffMeshFreeList) Release(id uint32)
type OffMeshLinkEndPoint ¶
type OffMeshLinkEndPoint struct {
// contains filtered or unexported fields
}
type OverlapQuery ¶
type OverlapQuery struct {
// contains filtered or unexported fields
}
func NewOverlapQuery ¶
func NewOverlapQuery( navmesh *NavMesh, start Vector3f, end Vector3f, height float32, polys []NavMeshPolyRef, overlapMinMax []float32, maxPolys int) OverlapQuery
func (*OverlapQuery) ProcessPolygons ¶
func (this *OverlapQuery) ProcessPolygons(tile *NavMeshTile, polyRefs []NavMeshPolyRef, polys []*NavMeshPoly, itemCount int)
type PathCorridor ¶
type PathCorridor struct {
// contains filtered or unexported fields
}
func NewPathCorridor ¶
func NewPathCorridor() *PathCorridor
func (*PathCorridor) ClearPath ¶
func (this *PathCorridor) ClearPath()
func (*PathCorridor) FindCorners ¶
func (this *PathCorridor) FindCorners(cornerVerts []Vector3f, cornerFlags []uint8, cornerPolys []NavMeshPolyRef, cornerCount *int32, maxCorners int32, navquery *NavMeshQuery) NavMeshStatus
func (*PathCorridor) GetCurrentPos ¶
func (this *PathCorridor) GetCurrentPos() Vector3f
func (*PathCorridor) GetLastPoly ¶
func (this *PathCorridor) GetLastPoly() NavMeshPolyRef
func (*PathCorridor) GetPath ¶
func (this *PathCorridor) GetPath() []NavMeshPolyRef
func (*PathCorridor) GetPathCount ¶
func (this *PathCorridor) GetPathCount() int32
func (*PathCorridor) Invalidate ¶
func (this *PathCorridor) Invalidate()
func (*PathCorridor) MoveOverOffmeshConnection ¶
func (this *PathCorridor) MoveOverOffmeshConnection(offMeshConRef NavMeshPolyRef, currentPos Vector3f, startPos Vector3f, endPos Vector3f, navquery *NavMeshQuery) bool
func (*PathCorridor) MovePosition ¶
func (this *PathCorridor) MovePosition(newPos Vector3f, navquery *NavMeshQuery, filter *QueryFilter) bool
func (*PathCorridor) OptimizePathTopology ¶
func (this *PathCorridor) OptimizePathTopology(navquery *NavMeshQuery, filter *QueryFilter) bool
func (*PathCorridor) OptimizePathVisibility ¶
func (this *PathCorridor) OptimizePathVisibility(next Vector3f, navquery *NavMeshQuery, filter *QueryFilter)
func (*PathCorridor) Reset ¶
func (this *PathCorridor) Reset(ref NavMeshPolyRef, pos Vector3f)
func (*PathCorridor) SetCorridor ¶
func (this *PathCorridor) SetCorridor(target Vector3f, navquery *NavMeshQuery, path []NavMeshPolyRef, npath int32, partialPath bool)
func (*PathCorridor) SetPathInterrupted ¶
func (this *PathCorridor) SetPathInterrupted(inbool bool)
func (*PathCorridor) SetPathPartial ¶
func (this *PathCorridor) SetPathPartial(inbool bool)
func (*PathCorridor) SetPathValid ¶
func (this *PathCorridor) SetPathValid(inbool bool)
func (*PathCorridor) SetStateFlag ¶
func (this *PathCorridor) SetStateFlag(setFlag bool, stateFlag PathCorridorState)
func (*PathCorridor) SetToEnd ¶
func (this *PathCorridor) SetToEnd()
func (*PathCorridor) UpdateTargetPosition ¶
func (this *PathCorridor) UpdateTargetPosition(ref NavMeshPolyRef, target Vector3f) bool
type PathCorridorState ¶
type PathCorridorState uint8
type PolygonQuery ¶
type PolygonQuery struct {
// contains filtered or unexported fields
}
func NewPolygonQuery ¶
func NewPolygonQuery(query *NavMeshQuery, filter *QueryFilter, polys []NavMeshPolyRef, maxPolys int32) *PolygonQuery
func (*PolygonQuery) ProcessPolygons ¶
func (this *PolygonQuery) ProcessPolygons(title *NavMeshTile, polyRefs []NavMeshPolyRef, polys []*NavMeshPoly, itemCount int)
type PortalArea ¶
type PortalArea struct {
// contains filtered or unexported fields
}
type Quaternionf ¶
type Quaternionf struct {
// contains filtered or unexported fields
}
func InverseQuaternion ¶
func InverseQuaternion(q Quaternionf) Quaternionf
func (*Quaternionf) Add ¶
func (this *Quaternionf) Add(that Quaternionf) Quaternionf
func (*Quaternionf) Sub ¶
func (this *Quaternionf) Sub(that Quaternionf) Quaternionf
type QueryFilter ¶
type QueryFilter struct {
// contains filtered or unexported fields
}
func NewQueryFilter ¶
func NewQueryFilter() *QueryFilter
func (*QueryFilter) GetAreaCost ¶
func (this *QueryFilter) GetAreaCost(i int32) float32
Getters and setters for the default implementation data.
func (*QueryFilter) GetIncludeFlags ¶
func (this *QueryFilter) GetIncludeFlags() uint32
func (*QueryFilter) GetTypeID ¶
func (this *QueryFilter) GetTypeID() int32
func (*QueryFilter) PassFilter ¶
func (this *QueryFilter) PassFilter(flags uint32) bool
func (*QueryFilter) Set ¶
func (this *QueryFilter) Set(typeID int32, includeFlags uint32, costs []float32)
func (*QueryFilter) SetAreaCost ¶
func (this *QueryFilter) SetAreaCost(i int32, cost float32)
func (*QueryFilter) SetAreaCosts ¶
func (this *QueryFilter) SetAreaCosts(areaCosts []float32)
func (*QueryFilter) SetIncludeFlags ¶
func (this *QueryFilter) SetIncludeFlags(flags uint32)
func (*QueryFilter) SetTypeID ¶
func (this *QueryFilter) SetTypeID(typeID int32)
type SegInterval ¶
type SegInterval struct {
// contains filtered or unexported fields
}
type SurfaceData ¶
type SurfaceData struct {
// contains filtered or unexported fields
}
func NewSurfaceData ¶
func NewSurfaceData() *SurfaceData
type TileFreeList ¶
type TileFreeList struct {
// contains filtered or unexported fields
}
func (*TileFreeList) Alloc ¶
func (this *TileFreeList) Alloc() uint32
func (*TileFreeList) Capacity ¶
func (this *TileFreeList) Capacity() uint32
func (*TileFreeList) Get ¶
func (this *TileFreeList) Get(i uint32) *NavMeshTile
func (*TileFreeList) Grow ¶
func (this *TileFreeList) Grow(s uint32)
func (*TileFreeList) Init ¶
func (this *TileFreeList) Init()
func (*TileFreeList) Release ¶
func (this *TileFreeList) Release(id uint32)
type Vector3f ¶
type Vector3f struct {
// contains filtered or unexported fields
}
func ClosestPtPointTriangle ¶
It's assumed the triangle (a,b,c) is not degenerate - otherwise division by zero might occur
func LerpVector3f ¶
func MaxVector3f ¶
func MinVector3f ¶
func NewVector3f ¶
func NormalizeSafe ¶
func RandomPointInConvexPoly ¶
Returns a random point in a convex polygon. Adapted from Graphics Gems article.
func RotateExtents ¶
func RotateExtents(extents Vector3f, rotation Matrix3x3f) Vector3f
func RotateVectorByQuat ¶
func RotateVectorByQuat(lhs Quaternionf, rhs Vector3f) Vector3f
func SegmentSegmentCPA ¶
returns the Closest Point of Approach (CPA) on segment p for two line segments (p,q). note: returns segment midpoint in the degenerate case.
func TileToWorld ¶
func TileToWorld(tile *NavMeshTile, position Vector3f) Vector3f
func TileToWorldSafe ¶
func TileToWorldSafe(tile *NavMeshTile, p Vector3f) Vector3f
func TileToWorldVector ¶
func TileToWorldVector(tile *NavMeshTile, direction Vector3f) Vector3f
func WorldToTile ¶
func WorldToTile(tile *NavMeshTile, position Vector3f) Vector3f
func WorldToTileSafe ¶
func WorldToTileSafe(tile *NavMeshTile, p Vector3f) Vector3f