Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Is there a way to make Pick() faster?


Recommended Posts

I'm working on a voxel game, and I'm using camera->Pick() to get the position to add or remove a block, but it seems to be really slow. between 5 and 10 ms on its own. I've set all objects to pick mode 0 except the chunks close to the player. Is there something I can do to speed things up, like use a different method or something?

Link to post
Share on other sites

Oh, I see what you mean about recalculating blocks. I left out surface->Update(), which it needs to calculate the pick. it is now 0 to 1 ms. I just need to update the surface in a new update cycle so the frames don't drop :P

Link to post
Share on other sites

I may be totally misunderstanding you and if I am then disregard this.

But the Entity::Pick() function works pretty much the same as the Camera::Pick(). The only difference I can see is the option for x and y coordinates for the screen(while using camera pick) and the option for Vec3 starting pos and Vec3 ending pos(while using entity pick).

Link to post
Share on other sites

I think Camera::Pick would be faster because it does AABB tests before geometry tests. Entity::Pick is used internally, and really shouldn't be used by the end user, except in special cases.

Link to post
Share on other sites

Well I learned something today! I've only been using pick::entity so far for whatever reason.

This information could be useful in the documentation because I would still be using Entity::Pick over Camera::Pick as there is no way to tell that Entity::Pick 'shouldn't be used by the end user, except in special cases.'

Link to post
Share on other sites

I am wondering. Why shouldn't entity->pick used by the user?

 

The only thing it is useful for is when i use for example the mouse to click on something.

 

But as soon as i want another entity to check for something like in a Realtime Strategy Game i need to use entity->pick.

  • Upvote 1
Link to post
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.

×
×
  • Create New...