Jump to content

Recommended Posts

Posted

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?

Posted

Is it only slow the first time you call it before recalculating your blocks? Also, you should be using a small range for the pick distance.

Let's build cool stuff and have fun. :)

Posted

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

Posted

Only thing is, I don't know which entity it's going to be. I'd have to do up to 9 pick checks for each chunk around the player. So updating the surface is probably better for what I'm doing

Posted

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).

Check out my game Rogue Snowboarding- 

https://haydenmango.itch.io/roguesnowboarding

Posted

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.

Let's build cool stuff and have fun. :)

Posted

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

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...