How to get raycast hit position??

82 views
Skip to first unread message

YoungUn Yu

unread,
Sep 22, 2020, 5:23:14 AM9/22/20
to recastnavigation
Hi 
NavMeshQuery::raycast function get hit normal vector and hit.t 
I wondering how to get hit postion. 

Thanks

Mikko Mononen

unread,
Sep 22, 2020, 1:59:09 PM9/22/20
to recastna...@googlegroups.com
The T parameter tells at which location between start and end point the hit happened. To get the hit position, you just linearly interpolate.


--mikko

Netmarble Confidential

이 메일은 지정된 수취인만을 위해 작성되었으며, 중요한 정보나 저작권을 포함하고 있을 수 있습니다. 어떠한 권한 없이, 본 문서에 포함된 정보의 전부 또는 일부를 무단으로 제3자에게 공개, 배포, 복사 또는 사용하는 것을 엄격히 금지합니다. 만약, 본 메일이 잘못 전송된 경우, 발신인 또는 당사에 알려주시고, 본 메일을 즉시 삭제하여 주시기 바랍니다.
This E-mail may contain confidential information and/or copyright material. This email is intended for the use of the addressee only. If you receive this email by mistake, please either delete it without reproducing, distributing or retaining copies thereof or notify the sender immediately.

--

---
You received this message because you are subscribed to the Google Groups "recastnavigation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to recastnavigati...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/recastnavigation/a33b1f9d-1268-4cb7-9698-4b913a837bdan%40googlegroups.com.

YoungUn Yu

unread,
Sep 22, 2020, 9:10:20 PM9/22/20
to recastnavigation
I understand. Thanks for your help

2020년 9월 23일 수요일 오전 2시 59분 9초 UTC+9에 memo...@gmail.com님이 작성:

YoungUn Yu

unread,
Sep 23, 2020, 3:08:28 AM9/23/20
to recastnavigation
Hi
I get the hit position.  dtVlerp(hitpos, startpos, endpos, t).
buf I try findpath(startpos, hitpos) occur an error. 

I want to 

if( raycast(start, end, out hitpos) )
        findpath(start, hitpos)
else
        findpath(start, end)

what is the solution??
Thanks


2020년 9월 23일 수요일 오전 10시 10분 20초 UTC+9에 YoungUn Yu님이 작성:
Reply all
Reply to author
Forward
0 new messages