MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / random_dir

Method random_dir

ogsr_engine/xrCore/_vector3d.h:408–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406 return *this;
407 }
408 IC SelfRef random_dir(CRandom& R = ::Random)
409 {
410 // z = R.randF(-1,1);
411 z = _cos(R.randF(PI));
412 T a = R.randF(PI_MUL_2);
413 T r = _sqrt(1 - z * z);
414 T sa = _sin(a);
415 T ca = _cos(a);
416 x = r * ca;
417 y = r * sa;
418 return *this;
419 };
420 IC SelfRef random_dir(const Self& ConeAxis, float ConeAngle, CRandom& R = ::Random)
421 {
422 Self rnd;

Callers 15

switchGravityMethod · 0.80
ObjectHitMethod · 0.80
DestroyMethod · 0.80
FireBulletMethod · 0.80
releaseMethod · 0.80
raiseMethod · 0.80
ThrowOutArtefactMethod · 0.80
ExplodeMethod · 0.80
NotificatePartMethod · 0.80
UpdateBloodDropsMethod · 0.80
ExplosionHitMethod · 0.80

Calls 5

_cosFunction · 0.85
_sqrtFunction · 0.85
_sinFunction · 0.85
normalizeFunction · 0.85
randFMethod · 0.80

Tested by

no test coverage detected