Skip to content
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

Merged
merged 3 commits into from
Oct 5, 2017
Merged

Add: Return random position in a desired direction +- an angle #757

merged 3 commits into from
Oct 5, 2017

Conversation

Vdauphin
Copy link
Contributor

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:

  • Now you can also search for a random position in a desired direction with a define amplitude of angle (search in direction 100° with +- 25° angle of amplitude).
  • 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
  • Respect the Submitting Content Guidelines --> tell me if anything is wrong

Quick code to test the behavior with an exemple of the result:

for "_i" from 1 to 1000 do { 
     private _direction = 100; 
     private _amplitude = 50; 
     private _pos = (getpos player) getPos [100*sqrt random 1 , _direction - 0.5*_amplitude + random _amplitude]; 
     deleteMarker str(_i); 
     private _marker = createmarker [str(_i), _pos]; 
     systemChat str(_pos); 
     str(_i) setMarkerSize [1,1]; 
     str(_i) setMarkerType "mil_dot"; 
     str(_i) setMarkerColor "ColorBlue"; 
     str(_i) setMarkerShape "ICON"; 
};

107410_20171001005704_1

Now you can also search for a random position in a desired direction
with a define amplitude.
@commy2
Copy link
Contributor

commy2 commented Oct 1, 2017

Does it fit CBA ?

Sure.

Is "amplitude" the right word for this? Can't really think of anything. "Spread"?
These parameters should be explained in the functions header.


if (_doResize) then {
_position resize 2;
};

_position
_position
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newline should stay.

* change header wuth new param

* change private name for spreading
_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>
Copy link
Contributor

@Killswitch00 Killswitch00 Oct 1, 2017

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

Copy link
Contributor Author

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>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@commy2 commy2 added the Feature label Oct 4, 2017
@commy2 commy2 added this to the 3.5 milestone Oct 4, 2017
@Killswitch00 Killswitch00 merged commit 60b206e into CBATeam:master Oct 5, 2017
@Vdauphin Vdauphin deleted the Add-search_rand_pos_in_triangle branch October 7, 2017 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants