Jump to content

Camera pick not working


MexSource
 Share

Recommended Posts

Hey,

 

I think the camera pick is no longer working properly, other people also have this issue.

 

This is the code i tried it with:

 

if (wd->KeyHit(Key::E)){
 Vec2 mousepos = wd->GetMousePosition();
 if (cam->Pick(mousepos.x, mousepos.y, pickinfo, 0)){
  if (pickinfo.entity->GetKeyValue("tag") == "dbutton"){
    //pickinfo.entity->SetKeyValue("tag", "");
    System::Print("Entity picked, distance: " + String(pickinfo.distance));
    pickinfo.entity->Hide();
  }
 }
}

 

My problems are:

  • The pick is only working if I'm so close to the object, that I'm touching it.
  • And the pickdistance is everytime -1

Hope you can fix that.

 

Btw: I tried picking csg boxes and models (Yes, I attached a empty lua script to these boxes).

 

 

 

If you need more info here is the full thread in which some people and me discussed this.

C++ :3

Link to comment
Share on other sites

The example game is working correctly, as well as the code example here:

http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/camerapick-r199

 

If you can demonstrate a problem please provide a complete working example I can run. Otherwise it's impossible to try to recreate your situation.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...