Brutile Posted May 20, 2014 Share Posted May 20, 2014 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? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 20, 2014 Share Posted May 20, 2014 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. Quote 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 More sharing options...
Brutile Posted May 20, 2014 Author Share Posted May 20, 2014 How do I set the pick distance? Quote Link to comment Share on other sites More sharing options...
Brutile Posted May 20, 2014 Author Share Posted May 20, 2014 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 Quote Link to comment Share on other sites More sharing options...
Haydenmango Posted May 20, 2014 Share Posted May 20, 2014 I noticed you are using the Camera pick function. You can set the Pick distance when you use the entity pick instead- http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entitypick-r158 might be worth testing out to see if it goes any quicker but it sounds like you got it working pretty good. Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Brutile Posted May 20, 2014 Author Share Posted May 20, 2014 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 Quote Link to comment Share on other sites More sharing options...
Haydenmango Posted May 20, 2014 Share Posted May 20, 2014 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). Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Josh Posted May 20, 2014 Share Posted May 20, 2014 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. Quote 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 More sharing options...
Haydenmango Posted May 20, 2014 Share Posted May 20, 2014 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.' Quote Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Flexman Posted May 20, 2014 Share Posted May 20, 2014 Curious; what AABB test(s) does CameraPick do first? Quote 6600 2.4G / GTX 460 280.26 / 4GB Windows 7 Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT Tricubic Studios Ltd. ~ Combat Helo Link to comment Share on other sites More sharing options...
Josh Posted May 20, 2014 Share Posted May 20, 2014 Ray / AABB intersection. Quote 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 More sharing options...
beo6 Posted May 23, 2014 Share Posted May 23, 2014 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.