#include <pDomain.h>
Public Member Functions | |
PDBlob (const pVec &ctr0, const float stdev0) | |
~PDBlob () | |
bool | Within (const pVec &pos) const |
pVec | Generate () const |
pDomain * | copy () const |
Public Attributes | |
pVec | ctr |
float | stdev |
float | Scale1 |
float | Scale2 |
Definition at line 530 of file pDomain.h.
PDBlob::PDBlob | ( | const pVec & | ctr0, | |
const float | stdev0 | |||
) | [inline] |
Definition at line 537 of file pDomain.h.
References ctr, fsqr(), P_ONEOVERSQRT2PI, Scale1, Scale2, and stdev.
Referenced by copy().
00538 { 00539 ctr = ctr0; 00540 stdev = stdev0; 00541 float oneOverSigma = 1.0f/(stdev+0.000000000001f); 00542 Scale1 = -0.5f*fsqr(oneOverSigma); 00543 Scale2 = P_ONEOVERSQRT2PI * oneOverSigma; 00544 }
bool PDBlob::Within | ( | const pVec & | pos | ) | const [inline, virtual] |
Implements pDomain.
Definition at line 550 of file pDomain.h.
References ctr, expf(), pVec::length2(), pRandf, Scale1, Scale2, and x.
00551 { 00552 pVec x = pos - ctr; 00553 // return exp(-0.5 * xSq * Sqr(oneOverSigma)) * P_ONEOVERSQRT2PI * oneOverSigma; 00554 float Gx = expf(x.length2() * Scale1) * Scale2; 00555 return (pRandf() < Gx); 00556 }
pVec PDBlob::Generate | ( | ) | const [inline, virtual] |
pDomain* PDBlob::copy | ( | ) | const [inline, virtual] |
float PDBlob::stdev |
float PDBlob::Scale1 |
float PDBlob::Scale2 |