[Urgent] PDK Camera Range Finding Issue (AddPickRequest, GetPickResult)

Arryh
Posts: 7
Joined: Wed Nov 08, 2017 3:07 pm

[Urgent] PDK Camera Range Finding Issue (AddPickRequest, GetPickResult)

Postby Arryh » Tue Nov 14, 2017 4:04 pm

Hello everyone,

Given a set of screen coordinates (x,y) and I need to compute the distance from the camera object to the first texture/ground element encountered.

I am currently using the two functions AddPickRequest & GetPickResult, but they fail to deliver. The documentation is really light on the camera functions and not helping

I use the following code to access the functions.
virtual void OnPreCameraUpdate(IWindowV400* pWindow, ICameraSystemV400* pCamera) override {
ID = pCamera->AddPickRequest(Xpixel, Ypixel);
}

virtual void OnPostCameraUpdate(IWindowV400* pWindow, ICameraSystemV400* pCamera) override {
[...]
pCamera->GetPickResult(ID, wasHit, fDistanceToHit);
ScreenCoord xyz = ScreenCoord((float)Xpixel, (float)Ypixel, fDistanceToHit);
pCamera->GetWorldCoord(xyz, lla);
}
-> The function GetPickResult ALWAYS register a "false" for "wasHit" regardless of the pixel values
-> Are those function bound to test picks on the VC only?

Questions:
* How does those 2 functions are supposed to work precisely?
* Was does the function mean when "wasHit" register "true" ?
* Is there an other way of doing what I'm trying to do?


Thanks for the help

Arryh
Posts: 7
Joined: Wed Nov 08, 2017 3:07 pm

Re: [Urgent] PDK Camera Range Finding Issue (AddPickRequest, GetPickResult)

Postby Arryh » Thu Nov 16, 2017 7:43 am

Does anyone have a thought on this?


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 1 guest