-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use offmesh connections? #35
Comments
Hey
Unfortunately I'm not sure all the code required for off mesh connections
to work had been ported from original c++. This wasn't a feature I needed
at that time so I haven't been focusing on that as much as building and
using basic nav mesh features.
As you can see, we're close but not there yet, the off mesh connections
test is disabled at the moment
https://github.com/arl/go-detour/blob/12dd802a0d65ef1a0157fc6753688533f3abaf36/detour/offmeshcons_test.go#L13
I hope to have enough time soon to get back to it.
…On Mon, Jun 28, 2021, 12:04 royluo03 ***@***.***> wrote:
Hi,
I've tested building NavMesh from a obj file which is exported from
UE4.25. It works very well.
But I didn't pass the test for offmesh connections.
My test septs are:
1. add an off mesh connection to input geometry.
2. build nav mesh
3. find path
My test codes for adding off mesh as below:
func (ig *InputGeom) AddOffMeshConnection(spos [3]float32, epos
[3]float32, rad float32, bidir uint8, area uint8, flags uint16) {
if ig.offMeshConCount >= 256 {
return
}
ig.OffMeshConnectionVerts()[ig.offMeshConCount*3*2] = spos[0]
ig.OffMeshConnectionVerts()[ig.offMeshConCount*3*2 + 1] = spos[1]
ig.OffMeshConnectionVerts()[ig.offMeshConCount*3*2 + 2] = spos[2]
ig.OffMeshConnectionVerts()[ig.offMeshConCount*3*2 + 3] = epos[0]
ig.OffMeshConnectionVerts()[ig.offMeshConCount*3*2 + 4] = epos[1]
ig.OffMeshConnectionVerts()[ig.offMeshConCount*3*2 + 5] = epos[2]
//fmt.Printf("OffMeshConnectionVerts: %v\n",soloMesh.geom.OffMeshConnectionVerts())
ig.OffMeshConnectionRads()[ig.offMeshConCount] = rad
ig.OffMeshConnectionDirs()[ig.offMeshConCount] = bidir
ig.OffMeshConnectionAreas()[ig.offMeshConCount] = area
ig.OffMeshConnectionFlags()[ig.offMeshConCount] = flags
ig.OffMeshConnectionId()[ig.offMeshConCount] = uint32(1000 + ig.offMeshConCount)
//m_offMeshConRads[m_offMeshConCount] = rad;
//m_offMeshConDirs[m_offMeshConCount] = bidir;
//m_offMeshConAreas[m_offMeshConCount] = area;
//m_offMeshConFlags[m_offMeshConCount] = flags;
//m_offMeshConId[m_offMeshConCount] = 1000 + m_offMeshConCount;
ig.offMeshConCount ++
}
please correct me.
Thanks
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#35>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUL2WWL2X5LXHFMD7Z6YLTVBCJNANCNFSM47NUHHAA>
.
|
Hi Thanks! |
Thanks @royluo03 that'd be awesome. |
code.zip My friend got something from original c++ code and did some adjustment in go code than we pass the off mesh test. attached 3 adjusted codes please check it. |
Hi. Thanks for the code.
It would be much simpler to review if you opened a pull request. Can you?
…On Fri, Jul 2, 2021, 09:30 royluo03 ***@***.***> wrote:
code.zip <https://github.com/arl/go-detour/files/6752840/code.zip>
Hi,
My friend got something from original c++ code and did some adjustment in
go code than we pass the off mesh test.
attached 3 adjusted codes please check it.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#35 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADUL2RYOTA4567GTNKZU2LTVVTIZANCNFSM47NUHHAA>
.
|
Haven't use it before. I'm gonna try :) |
Hi,
I've tested building NavMesh from a obj file which is exported from UE4.25. It works very well.
But I didn't pass the test for offmesh connections.
My test septs are:
My test codes for adding off mesh as below:
func (ig *InputGeom) AddOffMeshConnection(spos [3]float32, epos [3]float32, rad float32, bidir uint8, area uint8, flags uint16) {
}
please correct me.
Thanks
The text was updated successfully, but these errors were encountered: