-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add: Return random position in a desired direction +- an angle #757
Add: Return random position in a desired direction +- an angle #757
Conversation
Now you can also search for a random position in a desired direction with a define amplitude.
Sure. Is "amplitude" the right word for this? Can't really think of anything. "Spread"? |
addons/common/fnc_randPos.sqf
Outdated
|
||
if (_doResize) then { | ||
_position resize 2; | ||
}; | ||
|
||
_position | ||
_position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline should stay.
addons/common/fnc_randPos.sqf
Outdated
_position - <MARKER, OBJECT, LOCATION, GROUP, TASK or POSITION> | ||
_radius - random Radius <NUMBER> | ||
_direction - randomization direction (optional, default: 0) <NUMBER> | ||
_spreading - spreading around direction (optional, default: 360) <NUMBER> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Angle" is the term for this - the angle of the circular arc in which the random position will end up. See : Arc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sound better, I am agree. So header like this is okay ? :
_angle - the angle of the circular arc in which the random position will end up. (optional, default: 360) <NUMBER>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Hello,
Now you can also search for a random position in a desired direction with a define amplitude.
Does it fit CBA ?
When merged this pull request will:
params
has been updated with optional parameter (default value search for a random position in the circle)_direction - 0.5*_amplitude + random _amplitude
give the possibility to search in a direction with +-_amplitude
Quick code to test the behavior with an exemple of the result: