NW4F Eft
Loading...
Searching...
No Matches
eft_EmitterVolume.cpp File Reference

Namespaces

namespace  nw
namespace  nw::eft

Macros

#define BEGIN_EMIT_FUNCTION_DECL()
#define BEGIN_EMIT_FUNCTION(e)
#define END_EMIT_FUNCTION()
#define CALC_EMIT_ROTATION_BASIC()
#define CALC_EMIT_ROTATION()
#define CALC_EMIT_SCALE_X()
#define CALC_EMIT_SCALE_Y()
#define CALC_EMIT_SCALE_Z()
#define CALC_EMIT_SCALE_Z_PLANE()
#define CALC_EMIT_SCALE_Z_LINE()
#define CALC_EMIT_Y_AXIS_DIFFUSION()

Functions

static void nw::eft::_calcVolumeSweepParams (const SimpleEmitterData *__restrict res, f32 &rotWidth, f32 &rotStart, PtclRandom *rnd)
static void nw::eft::_calcSinCos (const SimpleEmitterData *__restrict res, PtclRandom *rnd, f32 rotWidth, f32 rotStart, f32 *sinV, f32 *cosV)
static f32 nw::eft::_calcY (const SimpleEmitterData *__restrict res, PtclRandom *rnd)
static bool nw::eft::_isLatitudeInside (const SimpleEmitterData *__restrict res, nw::math::VEC3 dir)
static void nw::eft::_rotateDirection (const SimpleEmitterData *__restrict res, nw::math::VEC3 *dir)
f32 nw::eft::_sqrtSafe (f32 v)

Variables

static const f32 nw::eft::gSameDivideSphere2 [2][3]
static const f32 nw::eft::gSameDivideSphere3 [3][3]
static const f32 nw::eft::gSameDivideSphere4 [4][3]
static const f32 nw::eft::gSameDivideSphere6 [6][3]
static const f32 nw::eft::gSameDivideSphere8 [8][3]
static const f32 nw::eft::gSameDivideSphere12 [12][3]
static const f32 nw::eft::gSameDivideSphere20 [20][3]
static const f32 nw::eft::gSameDivideSphere32 [32][3]
static const f32 * nw::eft::gSameDivideSphereTbl [8]
static const f32 nw::eft::gSameDivideSphere64_2 [2][3]
static const f32 nw::eft::gSameDivideSphere64_3 [3][3]
static const f32 nw::eft::gSameDivideSphere64_4 [4][3]
static const f32 nw::eft::gSameDivideSphere64_5 [5][3]
static const f32 nw::eft::gSameDivideSphere64_6 [6][3]
static const f32 nw::eft::gSameDivideSphere64_7 [7][3]
static const f32 nw::eft::gSameDivideSphere64_8 [8][3]
static const f32 nw::eft::gSameDivideSphere64_9 [9][3]
static const f32 nw::eft::gSameDivideSphere64_10 [10][3]
static const f32 nw::eft::gSameDivideSphere64_11 [11][3]
static const f32 nw::eft::gSameDivideSphere64_12 [12][3]
static const f32 nw::eft::gSameDivideSphere64_13 [13][3]
static const f32 nw::eft::gSameDivideSphere64_14 [14][3]
static const f32 nw::eft::gSameDivideSphere64_15 [15][3]
static const f32 nw::eft::gSameDivideSphere64_16 [16][3]
static const f32 nw::eft::gSameDivideSphere64_17 [17][3]
static const f32 nw::eft::gSameDivideSphere64_18 [18][3]
static const f32 nw::eft::gSameDivideSphere64_19 [19][3]
static const f32 nw::eft::gSameDivideSphere64_20 [20][3]
static const f32 nw::eft::gSameDivideSphere64_21 [21][3]
static const f32 nw::eft::gSameDivideSphere64_22 [22][3]
static const f32 nw::eft::gSameDivideSphere64_23 [23][3]
static const f32 nw::eft::gSameDivideSphere64_24 [24][3]
static const f32 nw::eft::gSameDivideSphere64_25 [25][3]
static const f32 nw::eft::gSameDivideSphere64_26 [26][3]
static const f32 nw::eft::gSameDivideSphere64_27 [27][3]
static const f32 nw::eft::gSameDivideSphere64_28 [28][3]
static const f32 nw::eft::gSameDivideSphere64_29 [29][3]
static const f32 nw::eft::gSameDivideSphere64_30 [30][3]
static const f32 nw::eft::gSameDivideSphere64_31 [31][3]
static const f32 nw::eft::gSameDivideSphere64_32 [32][3]
static const f32 nw::eft::gSameDivideSphere64_33 [33][3]
static const f32 nw::eft::gSameDivideSphere64_34 [34][3]
static const f32 nw::eft::gSameDivideSphere64_35 [35][3]
static const f32 nw::eft::gSameDivideSphere64_36 [36][3]
static const f32 nw::eft::gSameDivideSphere64_37 [37][3]
static const f32 nw::eft::gSameDivideSphere64_38 [38][3]
static const f32 nw::eft::gSameDivideSphere64_39 [39][3]
static const f32 nw::eft::gSameDivideSphere64_40 [40][3]
static const f32 nw::eft::gSameDivideSphere64_41 [41][3]
static const f32 nw::eft::gSameDivideSphere64_42 [42][3]
static const f32 nw::eft::gSameDivideSphere64_43 [43][3]
static const f32 nw::eft::gSameDivideSphere64_44 [44][3]
static const f32 nw::eft::gSameDivideSphere64_45 [45][3]
static const f32 nw::eft::gSameDivideSphere64_46 [46][3]
static const f32 nw::eft::gSameDivideSphere64_47 [47][3]
static const f32 nw::eft::gSameDivideSphere64_48 [48][3]
static const f32 nw::eft::gSameDivideSphere64_49 [49][3]
static const f32 nw::eft::gSameDivideSphere64_50 [50][3]
static const f32 nw::eft::gSameDivideSphere64_51 [51][3]
static const f32 nw::eft::gSameDivideSphere64_52 [52][3]
static const f32 nw::eft::gSameDivideSphere64_53 [53][3]
static const f32 nw::eft::gSameDivideSphere64_54 [54][3]
static const f32 nw::eft::gSameDivideSphere64_55 [55][3]
static const f32 nw::eft::gSameDivideSphere64_56 [56][3]
static const f32 nw::eft::gSameDivideSphere64_57 [57][3]
static const f32 nw::eft::gSameDivideSphere64_58 [58][3]
static const f32 nw::eft::gSameDivideSphere64_59 [59][3]
static const f32 nw::eft::gSameDivideSphere64_60 [60][3]
static const f32 nw::eft::gSameDivideSphere64_61 [61][3]
static const f32 nw::eft::gSameDivideSphere64_62 [62][3]
static const f32 nw::eft::gSameDivideSphere64_63 [63][3]
static const f32 nw::eft::gSameDivideSphere64_64 [64][3]
static const f32 * nw::eft::gSameDivideSphere64Tbl [63]

Macro Definition Documentation

◆ BEGIN_EMIT_FUNCTION_DECL

#define BEGIN_EMIT_FUNCTION_DECL ( )
Value:
const SimpleEmitterData* __restrict res = e->res; \
const EmitterSet* __restrict set = e->emitterSet; \
f32 emitDelta = e->emitAnimValue[EFT_ANIM_EM_RATE] * e->controller->mEmissionRatio; \
e->emitVessel += emitDelta; \
if ((s32)e->cnt == 0 && e->emitVessel < 1.0f && emitDelta != 0.0f) e->emitVessel = 1.0f; \
register s32 emitRate = (s32)nw::math::FFloor(e->emitVessel); \
if (res->emitDistEnabled) emitRate = 1; \
e->emitVessel -= (f32)emitRate; \
if (emitRate == 0) return NULL; \
PtclRandom* rnd = &e->rnd; \
register f32 figureVel = e->emitAnimValue[EFT_ANIM_ALL_DIR_VEL] * e->emitterSet->mFigureVel;

◆ BEGIN_EMIT_FUNCTION

#define BEGIN_EMIT_FUNCTION ( e)
Value:
PtclInstance* __restrict ptcl = NULL; \
PtclInstance* __restrict ptop = NULL; \
for (s32 i = 0; i < emitRate; i++) \
{ \
ptcl = mSys->AllocPtcl(e->calc->GetPtclType()); \
if ( !ptop ) ptop = ptcl; \
\
if (ptcl) \
{ \
ptcl->res = res; \
ptcl->stripe = NULL;

◆ END_EMIT_FUNCTION

#define END_EMIT_FUNCTION ( )
Value:
EmitCommon(e, ptcl); \
} \
else \
{ \
break; \
} \
} \
e->isEmitted = true; \
return ptop;

◆ CALC_EMIT_ROTATION_BASIC

#define CALC_EMIT_ROTATION_BASIC ( )
Value:
f32 rotWidth = NW_MATH_IDX_TO_RAD(res->volumeSweepParam); \
f32 rotStart = NW_MATH_IDX_TO_RAD(res->volumeSweepStart); \
if (res->volumeSweepStartRandom) \
rotStart = rnd->GetF32() * nw::math::F_PI * 2.0f;
#define NW_MATH_IDX_TO_RAD(idx)
const f32 F_PI

◆ CALC_EMIT_ROTATION

#define CALC_EMIT_ROTATION ( )
Value:
f32 rot = rnd->GetF32() * rotWidth + rotStart; \
f32 sinV; \
f32 cosV; \
nw::math::SinCosRad(&sinV, &cosV, rot);

◆ CALC_EMIT_SCALE_X

#define CALC_EMIT_SCALE_X ( )
Value:
{res->volumeRadius.x * set->mEmitterScale.x * e->emitAnimValue[EFT_ANIM_EM_FORM_SX]}

◆ CALC_EMIT_SCALE_Y

#define CALC_EMIT_SCALE_Y ( )
Value:
{res->volumeRadius.y * set->mEmitterScale.y * e->emitAnimValue[EFT_ANIM_EM_FORM_SY]}

◆ CALC_EMIT_SCALE_Z

#define CALC_EMIT_SCALE_Z ( )
Value:
{res->volumeRadius.z * set->mEmitterScale.z * e->emitAnimValue[EFT_ANIM_EM_FORM_SZ]}

◆ CALC_EMIT_SCALE_Z_PLANE

#define CALC_EMIT_SCALE_Z_PLANE ( )
Value:
{res->volumeRadius.z * set->mEmitterScale.z * e->emitAnimValue[EFT_ANIM_EM_FORM_SY]}

◆ CALC_EMIT_SCALE_Z_LINE

#define CALC_EMIT_SCALE_Z_LINE ( )
Value:
{res->volumeRadius.z * set->mEmitterScale.z * e->emitAnimValue[EFT_ANIM_EM_FORM_SX]}

◆ CALC_EMIT_Y_AXIS_DIFFUSION

#define CALC_EMIT_Y_AXIS_DIFFUSION ( )
Value:
if (res->xzDiffusionVel != 0.0f) \
{ \
nw::math::VEC3 yAxisVel; \
yAxisVel.x = ptcl->pos.x; \
yAxisVel.y = 0.0f; \
yAxisVel.z = ptcl->pos.z; \
if (yAxisVel.LengthSquare() <= FLT_MIN) /* FLT_MIN = 1.1754943508222875E-38f */ \
{ \
yAxisVel.x = /* e->rnd.GetF32Range(-1.0f, 1.0f) */ e->rnd.GetF32() * 2.0f - 1.0f; \
yAxisVel.z = /* e->rnd.GetF32Range(-1.0f, 1.0f) */ e->rnd.GetF32() * 2.0f - 1.0f; \
} \
yAxisVel.SafeNormalize(nw::math::VEC3(0.0f, 0.0f, 0.0f)); \
yAxisVel *= res->xzDiffusionVel; \
ptcl->vel += yAxisVel; \
}
self_type & SafeNormalize(const VEC3 &alt)
f32 LengthSquare() const