josk Posted August 21, 2014 Share Posted August 21, 2014 From this code from Aggror's tutorial if (self.entity.world:Pick(point1,point2,pickinfo,0,true,Collision.Prop)) Can someone explain what true is for, read the docs but cant make sense. closest: if set to true, the closest intersection will be found, otherwise the operation will return as soon as a single intersection is found. it's the intersection bit that confuses, wouldn't the closest intersection be the single intersection? The cosde works fine its always good to know why things work. Quote Elite Cobra Squad Link to comment Share on other sites More sharing options...
Josh Posted August 21, 2014 Share Posted August 21, 2014 When the closest detection is searched for, it is a slower test. Basically, each time a collision occurs, the line is shortened and it continues to test until a closer collision is found. This is good for projectiles, but if you're just doing a simple line of sight for AI or something, then it's a lot faster to pass false in this parameter. However, this will not return any useful info in the PickInfo position and normal fields. 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...
AggrorJorn Posted August 21, 2014 Share Posted August 21, 2014 You can watch this parameter in action here: 1 Quote Link to comment Share on other sites More sharing options...
josk Posted August 21, 2014 Author Share Posted August 21, 2014 Understood, thanks. Will watch the rest of that tutorial later. Quote Elite Cobra Squad 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.