Documentation ¶
Index ¶
- type Cgo_ObsNavMesh
- func (mesh *Cgo_ObsNavMesh) ObsAddAabbBox(tag string, minPos, maxPos *protomsg.Vector3)
- func (mesh *Cgo_ObsNavMesh) ObsAddCylinder(tag string, spos *protomsg.Vector3, radius float32, height float32)
- func (mesh *Cgo_ObsNavMesh) ObsAddObbBox(tag string, centPos, halfPos *protomsg.Vector3, rotaY float32)
- func (mesh *Cgo_ObsNavMesh) ObsRemoveAllTO()
- func (mesh *Cgo_ObsNavMesh) ObsRemoveTOByTag(tag string)
- func (mesh *Cgo_ObsNavMesh) ObsUpdateTO()
- type Cgo_ObsPathFinder
- func (finder *Cgo_ObsPathFinder) CalcNavNear(spos *protomsg.Vector3, count *int32) *C.float
- func (finder *Cgo_ObsPathFinder) CalcRaycast(spos *protomsg.Vector3, epos *protomsg.Vector3, count *int32) *C.float
- func (finder *Cgo_ObsPathFinder) FindNavPath(spos *protomsg.Vector3, epos *protomsg.Vector3, count *int32) *C.float
- func (finder *Cgo_ObsPathFinder) FreeObsPath()
- type FinderObs
- func (this *FinderObs) CheckWall(srcPos, dstPos protomsg.Vector3) (path []protomsg.Vector3, bHaveWall bool)
- func (this *FinderObs) CreateObstacleCylinder(doorName string, centPos protomsg.Vector3, radius, height int32)
- func (this *FinderObs) CreateObstacleOBBBox(doorName string, centPos, halfPos protomsg.Vector3, YawDegree int32)
- func (this *FinderObs) Destroy()
- func (this *FinderObs) FindPath(stpos, edpos protomsg.Vector3) (path []protomsg.Vector3, result bool)
- func (this *FinderObs) GetNear(srcPos *protomsg.Vector3) (pos *protomsg.Vector3, result bool)
- func (this *FinderObs) MeshCheckRushPath(srcPos, stpos protomsg.Vector3) protomsg.Vector3
- func (this *FinderObs) RaycastEx(srcPos, dstPos protomsg.Vector3) (*protomsg.Vector3, bool)
- func (this *FinderObs) RemoveAllObstacle()
- func (this *FinderObs) RemoveObstacle(doorName string)
- func (this *FinderObs) UpdateObstacle()
- type IPathFinder
- type NavMeshMgr
- type NavmeshParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cgo_ObsNavMesh ¶
type Cgo_ObsNavMesh C.ObsNavMesh
func (*Cgo_ObsNavMesh) ObsAddAabbBox ¶
func (mesh *Cgo_ObsNavMesh) ObsAddAabbBox(tag string, minPos, maxPos *protomsg.Vector3)
func (*Cgo_ObsNavMesh) ObsAddCylinder ¶
func (mesh *Cgo_ObsNavMesh) ObsAddCylinder(tag string, spos *protomsg.Vector3, radius float32, height float32)
AddCyinderTO 增加动态阻挡
func (*Cgo_ObsNavMesh) ObsAddObbBox ¶
func (mesh *Cgo_ObsNavMesh) ObsAddObbBox(tag string, centPos, halfPos *protomsg.Vector3, rotaY float32)
AddObbBox 增加OBB动态阻挡Box
func (*Cgo_ObsNavMesh) ObsRemoveAllTO ¶
func (mesh *Cgo_ObsNavMesh) ObsRemoveAllTO()
func (*Cgo_ObsNavMesh) ObsRemoveTOByTag ¶
func (mesh *Cgo_ObsNavMesh) ObsRemoveTOByTag(tag string)
RemoveTOByTag 删除动态阻挡
type Cgo_ObsPathFinder ¶
type Cgo_ObsPathFinder C.ObsPathFinder
func (*Cgo_ObsPathFinder) CalcNavNear ¶
获取导航附近的点
func (*Cgo_ObsPathFinder) CalcRaycast ¶
func (finder *Cgo_ObsPathFinder) CalcRaycast(spos *protomsg.Vector3, epos *protomsg.Vector3, count *int32) *C.float
CalcRaycast 射线检测
func (*Cgo_ObsPathFinder) FindNavPath ¶
func (finder *Cgo_ObsPathFinder) FindNavPath(spos *protomsg.Vector3, epos *protomsg.Vector3, count *int32) *C.float
查找路径
func (*Cgo_ObsPathFinder) FreeObsPath ¶
func (finder *Cgo_ObsPathFinder) FreeObsPath()
type FinderObs ¶
type FinderObs struct { Iskey bool //是否有Key,有Key的不能修改墙信息 NavMesh *Cgo_ObsNavMesh // 寻路用对象,每个地图实例一个,释放的时候,需要delete Finder *Cgo_ObsPathFinder }
func (*FinderObs) CheckWall ¶
func (this *FinderObs) CheckWall(srcPos, dstPos protomsg.Vector3) (path []protomsg.Vector3, bHaveWall bool)
CheckWall 按照100单位步长检查墙 墙的定义点位高程超过500单位
func (*FinderObs) CreateObstacleCylinder ¶
func (this *FinderObs) CreateObstacleCylinder(doorName string, centPos protomsg.Vector3, radius, height int32)
增加圆柱体阻挡
func (*FinderObs) CreateObstacleOBBBox ¶
func (this *FinderObs) CreateObstacleOBBBox(doorName string, centPos, halfPos protomsg.Vector3, YawDegree int32)
动态阻挡相关 增加可旋转的Box阻挡
func (*FinderObs) FindPath ¶
func (this *FinderObs) FindPath(stpos, edpos protomsg.Vector3) (path []protomsg.Vector3, result bool)
FindPath 提供外部寻路算法
参数:
params 起点终点 findtype 切换寻路类型
返回值:
path 路点,注意第一个点就是输入的起始点 result 是否寻路成功
func (*FinderObs) GetNear ¶
GetNear 获取某个点附近的合法位置 参数:
params 检查点 *protomsg.Vector3 类型
返回值:
pos 路点,注意第一个点就是输入的起始点 result 是否能成功
func (*FinderObs) MeshCheckRushPath ¶
type IPathFinder ¶
type IPathFinder interface { // FindPath 提供外部寻路算法 // // 参数: // params 起点终点 // findtype 切换寻路类型 // // 返回值: // path 路点,注意第一个点就是输入的起始点 // result 是否寻路成功 FindPath(stpos, edpos protomsg.Vector3) (path []protomsg.Vector3, result bool) // GetNear 获取某个点附近的合法位置 // 参数: // params 检查点 *linmath.Vector3 类型 // 返回值: // pos 路点,注意第一个点就是输入的起始点 // result 是否能成功 GetNear(srcPos *protomsg.Vector3) (pos *protomsg.Vector3, result bool) // CheckWall 按照100单位步长检查墙 // 墙的定义点位高程超过500单位 CheckWall(srcPos, dstPos protomsg.Vector3) (path []protomsg.Vector3, bHaveWall bool) // Raycast 射线检测,是否撞到墙了 // 参数: // srcPos 起点 // dstPos 终点 // 返回值: // pos 如果撞到墙了将会返回墙体位置,否则为空 // result 是否碰到墙了,true 碰到墙 false 没有撞到墙 RaycastEx(srcPos, dstPos protomsg.Vector3) (*protomsg.Vector3, bool) //动态阻挡相关 // 增加可旋转的Box阻挡 CreateObstacleOBBBox(doorName string, centPos, halfPos protomsg.Vector3, YawDegree int32) // 增加圆柱体阻挡 CreateObstacleCylinder(doorName string, centPos protomsg.Vector3, radius, height int32) // 清理掉某个门 RemoveObstacle(doorName string) // 清理全部的门 RemoveAllObstacle() // 更新阻挡信息 UpdateObstacle() MeshCheckRushPath(srcPos, stpos protomsg.Vector3) protomsg.Vector3 Destroy() }
type NavMeshMgr ¶
type NavMeshMgr struct {
// contains filtered or unexported fields
}
func GetMeshMgr ¶
func GetMeshMgr() *NavMeshMgr
func (*NavMeshMgr) GetFinder ¶
func (this *NavMeshMgr) GetFinder(filename, key string) (result *FinderObs)
静态地图 获取寻路对象
func (*NavMeshMgr) GetNavMesh ¶
func (this *NavMeshMgr) GetNavMesh(filename, key string) (result *Cgo_ObsNavMesh)
那种有墙体的地图,需要通过这个生成出来后,然后添加墙体,等别人使用
type NavmeshParams ¶
type NavmeshParams struct {}
func PackageFindParams ¶
func PackageFindParams(srcPos, dstPos protomsg.Vector3) NavmeshParams
Click to show internal directories.
Click to hide internal directories.