afxEffectWrapper membervar cleanup

This commit is contained in:
Azaezel 2018-03-29 17:46:57 -05:00
parent 0df2cf1b9d
commit b6076c55dd
36 changed files with 531 additions and 533 deletions

View file

@ -40,7 +40,7 @@ void afxEffectVector::filter_client_server()
for (S32 i = 0; i < fx_v->size(); i++) for (S32 i = 0; i < fx_v->size(); i++)
{ {
if ((*fx_v)[i]->datablock->runsHere(on_server)) if ((*fx_v)[i]->mDatablock->runsHere(on_server))
fx_v2->push_back((*fx_v)[i]); fx_v2->push_back((*fx_v)[i]);
else else
{ {
@ -68,15 +68,15 @@ void afxEffectVector::calc_fx_dur_and_afterlife()
if (ew) if (ew)
{ {
F32 ew_dur; F32 ew_dur;
if (ew->ew_timing.lifetime < 0) if (ew->mEW_timing.lifetime < 0)
{ {
if (phrase_dur > ew->ew_timing.delay) if (phrase_dur > ew->mEW_timing.delay)
ew_dur = phrase_dur + ew->afterStopTime(); ew_dur = phrase_dur + ew->afterStopTime();
else else
ew_dur = ew->ew_timing.delay + ew->afterStopTime(); ew_dur = ew->mEW_timing.delay + ew->afterStopTime();
} }
else else
ew_dur = ew->ew_timing.delay + ew->ew_timing.lifetime + ew->ew_timing.fade_out_time; ew_dur = ew->mEW_timing.delay + ew->mEW_timing.lifetime + ew->mEW_timing.fade_out_time;
if (ew_dur > total_fx_dur) if (ew_dur > total_fx_dur)
total_fx_dur = ew_dur; total_fx_dur = ew_dur;

View file

@ -681,55 +681,55 @@ ConsoleDocClass( afxEffectWrapper,
afxEffectWrapper::afxEffectWrapper() afxEffectWrapper::afxEffectWrapper()
{ {
choreographer = 0; mChoreographer = 0;
datablock = 0; mDatablock = 0;
cons_mgr = 0; mCons_mgr = 0;
cond_alive = true; mCond_alive = true;
elapsed = 0; mElapsed = 0;
life_end = 0; mLife_end = 0;
life_elapsed = 0; mLife_elapsed = 0;
stopped = false; mStopped = false;
n_updates = 0; mNum_updates = 0;
fade_value = 1.0f; mFade_value = 1.0f;
last_fade_value = 0.0f; mLast_fade_value = 0.0f;
fade_in_end = 0.0; mFade_in_end = 0.0;
fade_out_start = 0.0f; mFade_out_start = 0.0f;
in_scope = true; mIn_scope = true;
is_aborted = false; mIs_aborted = false;
do_fade_inout = false; mDo_fade_inout = false;
do_fades = false; mDo_fades = false;
full_lifetime = 0; mFull_lifetime = 0;
time_factor = 1.0f; mTime_factor = 1.0f;
prop_time_factor = 1.0f; mProp_time_factor = 1.0f;
live_scale_factor = 1.0f; mLive_scale_factor = 1.0f;
live_fade_factor = 1.0f; mLive_fade_factor = 1.0f;
terrain_altitude = -1.0f; mTerrain_altitude = -1.0f;
interior_altitude = -1.0f; mInterior_altitude = -1.0f;
group_index = 0; mGroup_index = 0;
dMemset(xfm_modifiers, 0, sizeof(xfm_modifiers)); dMemset(mXfm_modifiers, 0, sizeof(mXfm_modifiers));
} }
afxEffectWrapper::~afxEffectWrapper() afxEffectWrapper::~afxEffectWrapper()
{ {
for (S32 i = 0; i < MAX_XFM_MODIFIERS; i++) for (S32 i = 0; i < MAX_XFM_MODIFIERS; i++)
if (xfm_modifiers[i]) if (mXfm_modifiers[i])
delete xfm_modifiers[i]; delete mXfm_modifiers[i];
if (datablock && datablock->effect_name != ST_NULLSTRING) if (mDatablock && mDatablock->effect_name != ST_NULLSTRING)
{ {
choreographer->removeNamedEffect(this); mChoreographer->removeNamedEffect(this);
if (datablock->use_as_cons_obj && !effect_cons_id.undefined()) if (mDatablock->use_as_cons_obj && !mEffect_cons_id.undefined())
cons_mgr->setReferenceEffect(effect_cons_id, 0); mCons_mgr->setReferenceEffect(mEffect_cons_id, 0);
} }
if (datablock && datablock->isTempClone()) if (mDatablock && mDatablock->isTempClone())
delete datablock; delete mDatablock;
datablock = 0; mDatablock = 0;
} }
#undef myOffset #undef myOffset
@ -737,9 +737,9 @@ afxEffectWrapper::~afxEffectWrapper()
void afxEffectWrapper::initPersistFields() void afxEffectWrapper::initPersistFields()
{ {
addField("liveScaleFactor", TypeF32, myOffset(live_scale_factor), addField("liveScaleFactor", TypeF32, myOffset(mLive_scale_factor),
"..."); "...");
addField("liveFadeFactor", TypeF32, myOffset(live_fade_factor), addField("liveFadeFactor", TypeF32, myOffset(mLive_fade_factor),
"..."); "...");
Parent::initPersistFields(); Parent::initPersistFields();
@ -754,37 +754,37 @@ void afxEffectWrapper::ew_init(afxChoreographer* choreographer,
AssertFatal(datablock != NULL, "Datablock is missing."); AssertFatal(datablock != NULL, "Datablock is missing.");
AssertFatal(cons_mgr != NULL, "Constraint manager is missing."); AssertFatal(cons_mgr != NULL, "Constraint manager is missing.");
this->choreographer = choreographer; mChoreographer = choreographer;
this->datablock = datablock; mDatablock = datablock;
this->cons_mgr = cons_mgr; mCons_mgr = cons_mgr;
ea_set_datablock(datablock->effect_data); ea_set_datablock(datablock->effect_data);
ew_timing = datablock->ewd_timing; mEW_timing = datablock->ewd_timing;
if (ew_timing.life_bias != 1.0f) if (mEW_timing.life_bias != 1.0f)
{ {
if (ew_timing.lifetime > 0) if (mEW_timing.lifetime > 0)
ew_timing.lifetime *= ew_timing.life_bias; mEW_timing.lifetime *= mEW_timing.life_bias;
ew_timing.fade_in_time *= ew_timing.life_bias; mEW_timing.fade_in_time *= mEW_timing.life_bias;
ew_timing.fade_out_time *= ew_timing.life_bias; mEW_timing.fade_out_time *= mEW_timing.life_bias;
} }
pos_cons_id = cons_mgr->getConstraintId(datablock->pos_cons_def); mPos_cons_id = cons_mgr->getConstraintId(datablock->pos_cons_def);
orient_cons_id = cons_mgr->getConstraintId(datablock->orient_cons_def); mOrient_cons_id = cons_mgr->getConstraintId(datablock->orient_cons_def);
aim_cons_id = cons_mgr->getConstraintId(datablock->aim_cons_def); mAim_cons_id = cons_mgr->getConstraintId(datablock->aim_cons_def);
life_cons_id = cons_mgr->getConstraintId(datablock->life_cons_def); mLife_cons_id = cons_mgr->getConstraintId(datablock->life_cons_def);
this->time_factor = (datablock->ignore_time_factor) ? 1.0f : time_factor; mTime_factor = (datablock->ignore_time_factor) ? 1.0f : time_factor;
if (datablock->propagate_time_factor) if (datablock->propagate_time_factor)
prop_time_factor = time_factor; mProp_time_factor = time_factor;
if (datablock->runsHere(choreographer->isServerObject())) if (datablock->runsHere(choreographer->isServerObject()))
{ {
for (int i = 0; i < MAX_XFM_MODIFIERS && datablock->xfm_modifiers[i] != 0; i++) for (int i = 0; i < MAX_XFM_MODIFIERS && datablock->xfm_modifiers[i] != 0; i++)
{ {
xfm_modifiers[i] = datablock->xfm_modifiers[i]->create(this, choreographer->isServerObject()); mXfm_modifiers[i] = datablock->xfm_modifiers[i]->create(this, choreographer->isServerObject());
AssertFatal(xfm_modifiers[i] != 0, avar("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName())); AssertFatal(mXfm_modifiers[i] != 0, avar("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName()));
if (xfm_modifiers[i] == 0) if (mXfm_modifiers[i] == 0)
Con::errorf("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName()); Con::errorf("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName());
} }
} }
@ -795,9 +795,9 @@ void afxEffectWrapper::ew_init(afxChoreographer* choreographer,
choreographer->addNamedEffect(this); choreographer->addNamedEffect(this);
if (datablock->use_as_cons_obj) if (datablock->use_as_cons_obj)
{ {
effect_cons_id = cons_mgr->setReferenceEffect(datablock->effect_name, this); mEffect_cons_id = cons_mgr->setReferenceEffect(datablock->effect_name, this);
if (effect_cons_id.undefined() && datablock->isTempClone() && datablock->runsHere(choreographer->isServerObject())) if (mEffect_cons_id.undefined() && datablock->isTempClone() && datablock->runsHere(choreographer->isServerObject()))
effect_cons_id = cons_mgr->createReferenceEffect(datablock->effect_name, this); mEffect_cons_id = cons_mgr->createReferenceEffect(datablock->effect_name, this);
} }
} }
} }
@ -805,37 +805,37 @@ void afxEffectWrapper::ew_init(afxChoreographer* choreographer,
void afxEffectWrapper::prestart() void afxEffectWrapper::prestart()
{ {
// modify timing values by time_factor // modify timing values by time_factor
if (ew_timing.lifetime > 0) if (mEW_timing.lifetime > 0)
ew_timing.lifetime *= time_factor; mEW_timing.lifetime *= mTime_factor;
ew_timing.delay *= time_factor; mEW_timing.delay *= mTime_factor;
ew_timing.fade_in_time *= time_factor; mEW_timing.fade_in_time *= mTime_factor;
ew_timing.fade_out_time *= time_factor; mEW_timing.fade_out_time *= mTime_factor;
if (ew_timing.lifetime < 0) if (mEW_timing.lifetime < 0)
{ {
full_lifetime = INFINITE_LIFETIME; mFull_lifetime = INFINITE_LIFETIME;
life_end = INFINITE_LIFETIME; mLife_end = INFINITE_LIFETIME;
} }
else else
{ {
full_lifetime = ew_timing.lifetime + ew_timing.fade_out_time; mFull_lifetime = mEW_timing.lifetime + mEW_timing.fade_out_time;
life_end = ew_timing.delay + ew_timing.lifetime; mLife_end = mEW_timing.delay + mEW_timing.lifetime;
} }
if ((ew_timing.fade_in_time + ew_timing.fade_out_time) > 0.0f) if ((mEW_timing.fade_in_time + mEW_timing.fade_out_time) > 0.0f)
{ {
fade_in_end = ew_timing.delay + ew_timing.fade_in_time; mFade_in_end = mEW_timing.delay + mEW_timing.fade_in_time;
if (full_lifetime == INFINITE_LIFETIME) if (mFull_lifetime == INFINITE_LIFETIME)
fade_out_start = INFINITE_LIFETIME; mFade_out_start = INFINITE_LIFETIME;
else else
fade_out_start = ew_timing.delay + ew_timing.lifetime; mFade_out_start = mEW_timing.delay + mEW_timing.lifetime;
do_fade_inout = true; mDo_fade_inout = true;
} }
if (!do_fade_inout && datablock->vis_keys != NULL && datablock->vis_keys->numKeys() > 0) if (!mDo_fade_inout && mDatablock->vis_keys != NULL && mDatablock->vis_keys->numKeys() > 0)
{ {
//do_fades = true; //do_fades = true;
fade_out_start = ew_timing.delay + ew_timing.lifetime; mFade_out_start = mEW_timing.delay + mEW_timing.lifetime;
} }
} }
@ -843,22 +843,22 @@ bool afxEffectWrapper::start(F32 timestamp)
{ {
if (!ea_is_enabled()) if (!ea_is_enabled())
{ {
Con::warnf("afxEffectWrapper::start() -- effect type of %s is currently disabled.", datablock->getName()); Con::warnf("afxEffectWrapper::start() -- effect type of %s is currently disabled.", mDatablock->getName());
return false; return false;
} }
afxConstraint* life_constraint = getLifeConstraint(); afxConstraint* life_constraint = getLifeConstraint();
if (life_constraint) if (life_constraint)
cond_alive = life_constraint->getLivingState(); mCond_alive = life_constraint->getLivingState();
elapsed = timestamp; mElapsed = timestamp;
for (S32 i = 0; i < MAX_XFM_MODIFIERS; i++) for (S32 i = 0; i < MAX_XFM_MODIFIERS; i++)
{ {
if (!xfm_modifiers[i]) if (!mXfm_modifiers[i])
break; break;
else else
xfm_modifiers[i]->start(timestamp); mXfm_modifiers[i]->start(timestamp);
} }
if (!ea_start()) if (!ea_start())
@ -874,109 +874,109 @@ bool afxEffectWrapper::start(F32 timestamp)
bool afxEffectWrapper::test_life_conds() bool afxEffectWrapper::test_life_conds()
{ {
afxConstraint* life_constraint = getLifeConstraint(); afxConstraint* life_constraint = getLifeConstraint();
if (!life_constraint || datablock->life_conds == 0) if (!life_constraint || mDatablock->life_conds == 0)
return true; return true;
S32 now_state = life_constraint->getDamageState(); S32 now_state = life_constraint->getDamageState();
if ((datablock->life_conds & DEAD) != 0 && now_state == ShapeBase::Disabled) if ((mDatablock->life_conds & DEAD) != 0 && now_state == ShapeBase::Disabled)
return true; return true;
if ((datablock->life_conds & ALIVE) != 0 && now_state == ShapeBase::Enabled) if ((mDatablock->life_conds & ALIVE) != 0 && now_state == ShapeBase::Enabled)
return true; return true;
if ((datablock->life_conds & DYING) != 0) if ((mDatablock->life_conds & DYING) != 0)
return (cond_alive && now_state == ShapeBase::Disabled); return (mCond_alive && now_state == ShapeBase::Disabled);
return false; return false;
} }
bool afxEffectWrapper::update(F32 dt) bool afxEffectWrapper::update(F32 dt)
{ {
elapsed += dt; mElapsed += dt;
// life_elapsed won't exceed full_lifetime // life_elapsed won't exceed full_lifetime
life_elapsed = getMin(elapsed - ew_timing.delay, full_lifetime); mLife_elapsed = getMin(mElapsed - mEW_timing.delay, mFull_lifetime);
// update() returns early if elapsed is outside of active timing range // update() returns early if elapsed is outside of active timing range
// (delay <= elapsed <= delay+lifetime) // (delay <= elapsed <= delay+lifetime)
// note: execution is always allowed beyond this point at least once, // note: execution is always allowed beyond this point at least once,
// even if elapsed exceeds the lifetime. // even if elapsed exceeds the lifetime.
if (elapsed < ew_timing.delay) if (mElapsed < mEW_timing.delay)
{ {
setScopeStatus(false); setScopeStatus(false);
return false; return false;
} }
if (!datablock->requiresStop(ew_timing) && ew_timing.lifetime < 0) if (!mDatablock->requiresStop(mEW_timing) && mEW_timing.lifetime < 0)
{ {
F32 afterlife = elapsed - ew_timing.delay; F32 afterlife = mElapsed - mEW_timing.delay;
if (afterlife > 1.0f || ((afterlife > 0.0f) && (n_updates > 0))) if (afterlife > 1.0f || ((afterlife > 0.0f) && (mNum_updates > 0)))
{ {
setScopeStatus(ew_timing.residue_lifetime > 0.0f); setScopeStatus(mEW_timing.residue_lifetime > 0.0f);
return false; return false;
} }
} }
else else
{ {
F32 afterlife = elapsed - (full_lifetime + ew_timing.delay); F32 afterlife = mElapsed - (mFull_lifetime + mEW_timing.delay);
if (afterlife > 1.0f || ((afterlife > 0.0f) && (n_updates > 0))) if (afterlife > 1.0f || ((afterlife > 0.0f) && (mNum_updates > 0)))
{ {
setScopeStatus(ew_timing.residue_lifetime > 0.0f); setScopeStatus(mEW_timing.residue_lifetime > 0.0f);
return false; return false;
} }
} }
// first time here, test if required conditions for effect are met // first time here, test if required conditions for effect are met
if (n_updates == 0) if (mNum_updates == 0)
{ {
if (!test_life_conds()) if (!test_life_conds())
{ {
elapsed = full_lifetime + ew_timing.delay; mElapsed = mFull_lifetime + mEW_timing.delay;
setScopeStatus(false); setScopeStatus(false);
n_updates++; mNum_updates++;
return false; return false;
} }
} }
setScopeStatus(true); setScopeStatus(true);
n_updates++; mNum_updates++;
// calculate current fade value if enabled // calculate current fade value if enabled
if (do_fade_inout) if (mDo_fade_inout)
{ {
if (ew_timing.fade_in_time > 0 && elapsed <= fade_in_end) if (mEW_timing.fade_in_time > 0 && mElapsed <= mFade_in_end)
{ {
F32 t = mClampF((elapsed-ew_timing.delay)/ew_timing.fade_in_time, 0.0f, 1.0f); F32 t = mClampF((mElapsed - mEW_timing.delay)/ mEW_timing.fade_in_time, 0.0f, 1.0f);
fade_value = afxEase::t(t, ew_timing.fadein_ease.x,ew_timing.fadein_ease.y); mFade_value = afxEase::t(t, mEW_timing.fadein_ease.x, mEW_timing.fadein_ease.y);
do_fades = true; mDo_fades = true;
} }
else if (elapsed > fade_out_start) else if (mElapsed > mFade_out_start)
{ {
if (ew_timing.fade_out_time == 0) if (mEW_timing.fade_out_time == 0)
fade_value = 0.0f; mFade_value = 0.0f;
else else
{ {
F32 t = mClampF(1.0f-(elapsed-fade_out_start)/ew_timing.fade_out_time, 0.0f, 1.0f); F32 t = mClampF(1.0f-(mElapsed - mFade_out_start)/ mEW_timing.fade_out_time, 0.0f, 1.0f);
fade_value = afxEase::t(t, ew_timing.fadeout_ease.x,ew_timing.fadeout_ease.y); mFade_value = afxEase::t(t, mEW_timing.fadeout_ease.x, mEW_timing.fadeout_ease.y);
} }
do_fades = true; mDo_fades = true;
} }
else else
{ {
fade_value = 1.0f; mFade_value = 1.0f;
do_fades = false; mDo_fades = false;
} }
} }
else else
{ {
fade_value = 1.0; mFade_value = 1.0;
do_fades = false; mDo_fades = false;
} }
if (datablock->vis_keys && datablock->vis_keys->numKeys() > 0) if (mDatablock->vis_keys && mDatablock->vis_keys->numKeys() > 0)
{ {
F32 vis = datablock->vis_keys->evaluate(elapsed-ew_timing.delay); F32 vis = mDatablock->vis_keys->evaluate(mElapsed - mEW_timing.delay);
fade_value *= mClampF(vis, 0.0f, 1.0f); mFade_value *= mClampF(vis, 0.0f, 1.0f);
do_fades = (fade_value < 1.0f); mDo_fades = (mFade_value < 1.0f);
} }
// DEAL WITH CONSTRAINTS // DEAL WITH CONSTRAINTS
@ -990,17 +990,17 @@ bool afxEffectWrapper::update(F32 dt)
afxConstraint* pos_constraint = getPosConstraint(); afxConstraint* pos_constraint = getPosConstraint();
if (pos_constraint) if (pos_constraint)
{ {
bool valid = pos_constraint->getPosition(CONS_POS, datablock->pos_cons_def.mHistory_time); bool valid = pos_constraint->getPosition(CONS_POS, mDatablock->pos_cons_def.mHistory_time);
if (!valid) if (!valid)
getUnconstrainedPosition(CONS_POS); getUnconstrainedPosition(CONS_POS);
setScopeStatus(valid); setScopeStatus(valid);
if (valid && datablock->borrow_altitudes) if (valid && mDatablock->borrow_altitudes)
{ {
F32 terr_alt, inter_alt; F32 terr_alt, inter_alt;
if (pos_constraint->getAltitudes(terr_alt, inter_alt)) if (pos_constraint->getAltitudes(terr_alt, inter_alt))
{ {
terrain_altitude = terr_alt; mTerrain_altitude = terr_alt;
interior_altitude = inter_alt; mInterior_altitude = inter_alt;
} }
} }
} }
@ -1013,7 +1013,7 @@ bool afxEffectWrapper::update(F32 dt)
afxConstraint* orient_constraint = getOrientConstraint(); afxConstraint* orient_constraint = getOrientConstraint();
if (orient_constraint) if (orient_constraint)
{ {
orient_constraint->getTransform(CONS_XFM, datablock->pos_cons_def.mHistory_time); orient_constraint->getTransform(CONS_XFM, mDatablock->pos_cons_def.mHistory_time);
} }
else else
{ {
@ -1022,11 +1022,11 @@ bool afxEffectWrapper::update(F32 dt)
afxConstraint* aim_constraint = getAimConstraint(); afxConstraint* aim_constraint = getAimConstraint();
if (aim_constraint) if (aim_constraint)
aim_constraint->getPosition(CONS_AIM, datablock->pos_cons_def.mHistory_time); aim_constraint->getPosition(CONS_AIM, mDatablock->pos_cons_def.mHistory_time);
else else
CONS_AIM.zero(); CONS_AIM.zero();
CONS_SCALE.set(datablock->scale_factor, datablock->scale_factor, datablock->scale_factor); CONS_SCALE.set(mDatablock->scale_factor, mDatablock->scale_factor, mDatablock->scale_factor);
/* /*
if (datablock->isPositional() && CONS_POS.isZero() && in_scope) if (datablock->isPositional() && CONS_POS.isZero() && in_scope)
@ -1035,44 +1035,44 @@ bool afxEffectWrapper::update(F32 dt)
getBaseColor(CONS_COLOR); getBaseColor(CONS_COLOR);
params.vis = fade_value; params.vis = mFade_value;
// apply modifiers // apply modifiers
for (int i = 0; i < MAX_XFM_MODIFIERS; i++) for (int i = 0; i < MAX_XFM_MODIFIERS; i++)
{ {
if (!xfm_modifiers[i]) if (!mXfm_modifiers[i])
break; break;
else else
xfm_modifiers[i]->updateParams(dt, life_elapsed, params); mXfm_modifiers[i]->updateParams(dt, mLife_elapsed, params);
} }
// final pos/orient is determined // final pos/orient is determined
updated_xfm = CONS_XFM; mUpdated_xfm = CONS_XFM;
updated_pos = CONS_POS; mUpdated_pos = CONS_POS;
updated_aim = CONS_AIM; mUpdated_aim = CONS_AIM;
updated_xfm.setPosition(updated_pos); mUpdated_xfm.setPosition(mUpdated_pos);
updated_scale = CONS_SCALE; mUpdated_scale = CONS_SCALE;
updated_color = CONS_COLOR; mUpdated_color = CONS_COLOR;
if (params.vis > 1.0f) if (params.vis > 1.0f)
fade_value = 1.0f; mFade_value = 1.0f;
else else
fade_value = params.vis; mFade_value = params.vis;
if (last_fade_value != fade_value) if (mLast_fade_value != mFade_value)
{ {
do_fades = true; mDo_fades = true;
last_fade_value = fade_value; mLast_fade_value = mFade_value;
} }
else else
{ {
do_fades = (fade_value < 1.0f); mDo_fades = (mFade_value < 1.0f);
} }
if (!ea_update(dt)) if (!ea_update(dt))
{ {
is_aborted = true; mIs_aborted = true;
Con::errorf("afxEffectWrapper::update() -- effect %s ended unexpectedly.", datablock->getName()); Con::errorf("afxEffectWrapper::update() -- effect %s ended unexpectedly.", mDatablock->getName());
} }
return true; return true;
@ -1080,44 +1080,44 @@ bool afxEffectWrapper::update(F32 dt)
void afxEffectWrapper::stop() void afxEffectWrapper::stop()
{ {
if (!datablock->requiresStop(ew_timing)) if (!mDatablock->requiresStop(mEW_timing))
return; return;
stopped = true; mStopped = true;
// this resets full_lifetime so it starts to shrink or fade // this resets full_lifetime so it starts to shrink or fade
if (full_lifetime == INFINITE_LIFETIME) if (mFull_lifetime == INFINITE_LIFETIME)
{ {
full_lifetime = (elapsed - ew_timing.delay) + afterStopTime(); mFull_lifetime = (mElapsed - mEW_timing.delay) + afterStopTime();
life_end = elapsed; mLife_end = mElapsed;
if (ew_timing.fade_out_time > 0) if (mEW_timing.fade_out_time > 0)
fade_out_start = elapsed; mFade_out_start = mElapsed;
} }
} }
void afxEffectWrapper::cleanup(bool was_stopped) void afxEffectWrapper::cleanup(bool was_stopped)
{ {
ea_finish(was_stopped); ea_finish(was_stopped);
if (!effect_cons_id.undefined()) if (!mEffect_cons_id.undefined())
{ {
cons_mgr->setReferenceEffect(effect_cons_id, 0); mCons_mgr->setReferenceEffect(mEffect_cons_id, 0);
effect_cons_id = afxConstraintID(); mEffect_cons_id = afxConstraintID();
} }
} }
void afxEffectWrapper::setScopeStatus(bool in_scope) void afxEffectWrapper::setScopeStatus(bool in_scope)
{ {
if (this->in_scope != in_scope) if (mIn_scope != in_scope)
{ {
this->in_scope = in_scope; mIn_scope = in_scope;
ea_set_scope_status(in_scope); ea_set_scope_status(in_scope);
} }
} }
bool afxEffectWrapper::isDone() bool afxEffectWrapper::isDone()
{ {
if (!datablock->is_looping) if (!mDatablock->is_looping)
return (elapsed >= (life_end + ew_timing.fade_out_time)); return (mElapsed >= (mLife_end + mEW_timing.fade_out_time));
return false; return false;
} }
@ -1136,7 +1136,7 @@ afxEffectWrapper* afxEffectWrapper::ew_create(afxChoreographer* choreograph
if (adapter) if (adapter)
{ {
adapter->group_index = (datablock->group_index != -1) ? datablock->group_index : group_index; adapter->mGroup_index = (datablock->group_index != -1) ? datablock->group_index : group_index;
adapter->ew_init(choreographer, datablock, cons_mgr, time_factor); adapter->ew_init(choreographer, datablock, cons_mgr, time_factor);
} }

View file

@ -255,59 +255,59 @@ private:
bool test_life_conds(); bool test_life_conds();
protected: protected:
afxEffectWrapperData* datablock; afxEffectWrapperData* mDatablock;
afxEffectTimingData ew_timing; afxEffectTimingData mEW_timing;
F32 fade_in_end; F32 mFade_in_end;
F32 fade_out_start; F32 mFade_out_start;
F32 full_lifetime; F32 mFull_lifetime;
F32 time_factor; F32 mTime_factor;
F32 prop_time_factor; F32 mProp_time_factor;
afxChoreographer* choreographer; afxChoreographer* mChoreographer;
afxConstraintMgr* cons_mgr; afxConstraintMgr* mCons_mgr;
afxConstraintID pos_cons_id; afxConstraintID mPos_cons_id;
afxConstraintID orient_cons_id; afxConstraintID mOrient_cons_id;
afxConstraintID aim_cons_id; afxConstraintID mAim_cons_id;
afxConstraintID life_cons_id; afxConstraintID mLife_cons_id;
afxConstraintID effect_cons_id; afxConstraintID mEffect_cons_id;
F32 elapsed; F32 mElapsed;
F32 life_elapsed; F32 mLife_elapsed;
F32 life_end; F32 mLife_end;
bool stopped; bool mStopped;
bool cond_alive; bool mCond_alive;
U32 n_updates; U32 mNum_updates;
MatrixF updated_xfm; MatrixF mUpdated_xfm;
Point3F updated_pos; Point3F mUpdated_pos;
Point3F updated_aim; Point3F mUpdated_aim;
Point3F updated_scale; Point3F mUpdated_scale;
LinearColorF updated_color; LinearColorF mUpdated_color;
F32 fade_value; F32 mFade_value;
F32 last_fade_value; F32 mLast_fade_value;
bool do_fade_inout; bool mDo_fade_inout;
bool do_fades; bool mDo_fades;
bool in_scope; bool mIn_scope;
bool is_aborted; bool mIs_aborted;
U8 effect_flags; U8 mEffect_flags;
afxXM_Base* xfm_modifiers[MAX_XFM_MODIFIERS]; afxXM_Base* mXfm_modifiers[MAX_XFM_MODIFIERS];
F32 live_scale_factor; F32 mLive_scale_factor;
F32 live_fade_factor; F32 mLive_fade_factor;
F32 terrain_altitude; F32 mTerrain_altitude;
F32 interior_altitude; F32 mInterior_altitude;
S32 group_index; S32 mGroup_index;
public: public:
/*C*/ afxEffectWrapper(); /*C*/ afxEffectWrapper();
@ -316,18 +316,18 @@ public:
void ew_init(afxChoreographer*, afxEffectWrapperData*, afxConstraintMgr*, void ew_init(afxChoreographer*, afxEffectWrapperData*, afxConstraintMgr*,
F32 time_factor); F32 time_factor);
F32 getFullLifetime() { return ew_timing.lifetime + ew_timing.fade_out_time; } F32 getFullLifetime() { return mEW_timing.lifetime + mEW_timing.fade_out_time; }
F32 getTimeFactor() { return time_factor; } F32 getTimeFactor() { return mTime_factor; }
afxConstraint* getPosConstraint() { return cons_mgr->getConstraint(pos_cons_id); } afxConstraint* getPosConstraint() { return mCons_mgr->getConstraint(mPos_cons_id); }
afxConstraint* getOrientConstraint() { return cons_mgr->getConstraint(orient_cons_id); } afxConstraint* getOrientConstraint() { return mCons_mgr->getConstraint(mOrient_cons_id); }
afxConstraint* getAimConstraint() { return cons_mgr->getConstraint(aim_cons_id); } afxConstraint* getAimConstraint() { return mCons_mgr->getConstraint(mAim_cons_id); }
afxConstraint* getLifeConstraint() { return cons_mgr->getConstraint(life_cons_id); } afxConstraint* getLifeConstraint() { return mCons_mgr->getConstraint(mLife_cons_id); }
afxChoreographer* getChoreographer() { return choreographer; } afxChoreographer* getChoreographer() { return mChoreographer; }
virtual bool isDone(); virtual bool isDone();
virtual bool deleteWhenStopped() { return false; } virtual bool deleteWhenStopped() { return false; }
F32 afterStopTime() { return ew_timing.fade_out_time; } F32 afterStopTime() { return mEW_timing.fade_out_time; }
bool isAborted() const { return is_aborted; } bool isAborted() const { return mIs_aborted; }
void prestart(); void prestart();
bool start(F32 timestamp); bool start(F32 timestamp);
@ -345,11 +345,11 @@ public:
virtual SceneObject* ea_get_scene_object() const { return 0; } virtual SceneObject* ea_get_scene_object() const { return 0; }
U32 ea_get_triggers() const { return 0; } U32 ea_get_triggers() const { return 0; }
void getUpdatedPosition(Point3F& pos) { pos = updated_pos;} void getUpdatedPosition(Point3F& pos) { pos = mUpdated_pos;}
void getUpdatedTransform(MatrixF& xfm) { xfm = updated_xfm; } void getUpdatedTransform(MatrixF& xfm) { xfm = mUpdated_xfm; }
void getUpdatedScale(Point3F& scale) { scale = updated_scale; } void getUpdatedScale(Point3F& scale) { scale = mUpdated_scale; }
void getUpdatedColor(LinearColorF& color) { color = updated_color; } void getUpdatedColor(LinearColorF& color) { color = mUpdated_color; }
virtual void getUpdatedBoxCenter(Point3F& pos) { pos = updated_pos;} virtual void getUpdatedBoxCenter(Point3F& pos) { pos = mUpdated_pos;}
virtual void getUnconstrainedPosition(Point3F& pos) { pos.zero();} virtual void getUnconstrainedPosition(Point3F& pos) { pos.zero();}
virtual void getUnconstrainedTransform(MatrixF& xfm) { xfm.identity(); } virtual void getUnconstrainedTransform(MatrixF& xfm) { xfm.identity(); }
@ -358,9 +358,9 @@ public:
SceneObject* getSceneObject() const { return ea_get_scene_object(); } SceneObject* getSceneObject() const { return ea_get_scene_object(); }
U32 getTriggers() const { return ea_get_triggers(); } U32 getTriggers() const { return ea_get_triggers(); }
F32 getMass() { return datablock->mass; } F32 getMass() { return mDatablock->mass; }
Point3F getDirection() { return datablock->direction; } Point3F getDirection() { return mDatablock->direction; }
F32 getSpeed() { return datablock->speed; } F32 getSpeed() { return mDatablock->speed; }
virtual TSShape* getTSShape() { return 0; } virtual TSShape* getTSShape() { return 0; }
virtual TSShapeInstance* getTSShapeInstance() { return 0; } virtual TSShapeInstance* getTSShapeInstance() { return 0; }
@ -369,14 +369,14 @@ public:
virtual void resetAnimation(U32 tag) { } virtual void resetAnimation(U32 tag) { }
virtual F32 getAnimClipDuration(const char* clip) { return 0.0f; } virtual F32 getAnimClipDuration(const char* clip) { return 0.0f; }
void setTerrainAltitude(F32 alt) { terrain_altitude = alt; } void setTerrainAltitude(F32 alt) { mTerrain_altitude = alt; }
void setInteriorAltitude(F32 alt) { interior_altitude = alt; } void setInteriorAltitude(F32 alt) { mInterior_altitude = alt; }
void getAltitudes(F32& terr_alt, F32& inter_alt) const { terr_alt = terrain_altitude; inter_alt = interior_altitude; } void getAltitudes(F32& terr_alt, F32& inter_alt) const { terr_alt = mTerrain_altitude; inter_alt = mInterior_altitude; }
void setGroupIndex(S32 idx) { group_index = idx; } void setGroupIndex(S32 idx) { mGroup_index = idx; }
S32 getGroupIndex() const { return group_index; } S32 getGroupIndex() const { return mGroup_index; }
bool inScope() const { return in_scope; } bool inScope() const { return mIn_scope; }
public: public:
static void initPersistFields(); static void initPersistFields();

View file

@ -89,10 +89,10 @@ bool afxEA_AnimClip::ea_start()
do_runtime_substitutions(); do_runtime_substitutions();
afxConstraint* pos_constraint = getPosConstraint(); afxConstraint* pos_constraint = getPosConstraint();
if (full_lifetime == INFINITE_LIFETIME && pos_constraint != 0) if (mFull_lifetime == INFINITE_LIFETIME && pos_constraint != 0)
anim_lifetime = pos_constraint->getAnimClipDuration(clip_data->clip_name); anim_lifetime = pos_constraint->getAnimClipDuration(clip_data->clip_name);
else else
anim_lifetime = full_lifetime; anim_lifetime = mFull_lifetime;
anim_tag = 0; anim_tag = 0;
lock_tag = 0; lock_tag = 0;
@ -127,8 +127,8 @@ bool afxEA_AnimClip::ea_update(F32 dt)
if (go_for_it) if (go_for_it)
{ {
F32 rate = clip_data->rate/prop_time_factor; F32 rate = clip_data->rate/mProp_time_factor;
F32 pos = mFmod(life_elapsed, anim_lifetime)/anim_lifetime; F32 pos = mFmod(mLife_elapsed, anim_lifetime)/anim_lifetime;
pos = mFmod(pos + clip_data->pos_offset, 1.0); pos = mFmod(pos + clip_data->pos_offset, 1.0);
if (clip_data->rate < 0) if (clip_data->rate < 0)
pos = 1.0f - pos; pos = 1.0f - pos;
@ -164,7 +164,7 @@ void afxEA_AnimClip::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxAnimClipData* orig_db = clip_data; afxAnimClipData* orig_db = clip_data;
clip_data = new afxAnimClipData(*orig_db, true); clip_data = new afxAnimClipData(*orig_db, true);
orig_db->performSubstitutions(clip_data, choreographer, group_index); orig_db->performSubstitutions(clip_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -133,7 +133,7 @@ void afxEA_AreaDamage::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxAreaDamageData* orig_db = damage_data; afxAreaDamageData* orig_db = damage_data;
damage_data = new afxAreaDamageData(*orig_db, true); damage_data = new afxAreaDamageData(*orig_db, true);
orig_db->performSubstitutions(damage_data, choreographer, group_index); orig_db->performSubstitutions(damage_data, mChoreographer, mGroup_index);
} }
} }
@ -204,8 +204,8 @@ void afxEA_AreaDamage::notify_damage_source(ShapeBase* damaged, F32 damage, cons
char *posArg = Con::getArgBuffer(64); char *posArg = Con::getArgBuffer(64);
dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z); dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z);
Con::executef(choreographer->getDataBlock(), "onInflictedAreaDamage", Con::executef(mChoreographer->getDataBlock(), "onInflictedAreaDamage",
choreographer->getIdString(), mChoreographer->getIdString(),
damaged->getIdString(), damaged->getIdString(),
Con::getFloatArg(damage), Con::getFloatArg(damage),
flavor, flavor,
@ -221,7 +221,7 @@ void afxEA_AreaDamage::apply_damage(ShapeBase* shape, F32 damage, const char* fl
dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z); dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z);
Con::executef(shape, "damage", Con::executef(shape, "damage",
choreographer->getIdString(), mChoreographer->getIdString(),
posArg, posArg,
Con::getFloatArg(damage), Con::getFloatArg(damage),
flavor); flavor);

View file

@ -125,8 +125,8 @@ bool afxEA_AudioBank::ea_update(F32 dt)
if (sound_handle) if (sound_handle)
{ {
sound_handle->setTransform(updated_xfm); sound_handle->setTransform(mUpdated_xfm);
sound_handle->setVolume(updated_scale.x*fade_value); sound_handle->setVolume(mUpdated_scale.x*mFade_value);
} }
return true; return true;
@ -143,7 +143,7 @@ void afxEA_AudioBank::ea_finish(bool was_stopped)
void afxEA_AudioBank::do_runtime_substitutions() void afxEA_AudioBank::do_runtime_substitutions()
{ {
sound_bank = sound_bank->cloneAndPerformSubstitutions(choreographer, group_index); sound_bank = sound_bank->cloneAndPerformSubstitutions(mChoreographer, mGroup_index);
} }
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

View file

@ -108,18 +108,18 @@ bool afxEA_Billboard::ea_update(F32 dt)
deleteNotify(bb); deleteNotify(bb);
///bb->setSequenceRateFactor(datablock->rate_factor/prop_time_factor); ///bb->setSequenceRateFactor(datablock->rate_factor/prop_time_factor);
bb->setSortPriority(datablock->sort_priority); bb->setSortPriority(mDatablock->sort_priority);
} }
if (bb) if (bb)
{ {
bb->live_color = updated_color; bb->live_color = mUpdated_color;
if (do_fades) if (mDo_fades)
{ {
bb->setFadeAmount(fade_value); bb->setFadeAmount(mFade_value);
} }
bb->setTransform(updated_xfm); bb->setTransform(mUpdated_xfm);
bb->setScale(updated_scale); bb->setScale(mUpdated_scale);
} }
return true; return true;
@ -162,7 +162,7 @@ void afxEA_Billboard::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxBillboardData* orig_db = bb_data; afxBillboardData* orig_db = bb_data;
bb_data = new afxBillboardData(*orig_db, true); bb_data = new afxBillboardData(*orig_db, true);
orig_db->performSubstitutions(bb_data, choreographer, group_index); orig_db->performSubstitutions(bb_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -83,8 +83,8 @@ bool afxEA_CameraPuppet::ea_start()
do_runtime_substitutions(); do_runtime_substitutions();
afxConstraintID obj_id = cons_mgr->getConstraintId(puppet_data->cam_def); afxConstraintID obj_id = mCons_mgr->getConstraintId(puppet_data->cam_def);
cam_cons = cons_mgr->getConstraint(obj_id); cam_cons = mCons_mgr->getConstraint(obj_id);
SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0; SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0;
if (obj && obj->isClientObject()) if (obj && obj->isClientObject())
@ -105,9 +105,9 @@ bool afxEA_CameraPuppet::ea_update(F32 dt)
{ {
SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0; SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0;
if (obj && in_scope) if (obj && mIn_scope)
{ {
obj->setTransform(updated_xfm); obj->setTransform(mUpdated_xfm);
} }
return true; return true;
@ -153,7 +153,7 @@ void afxEA_CameraPuppet::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxCameraPuppetData* orig_db = puppet_data; afxCameraPuppetData* orig_db = puppet_data;
puppet_data = new afxCameraPuppetData(*orig_db, true); puppet_data = new afxCameraPuppetData(*orig_db, true);
orig_db->performSubstitutions(puppet_data, choreographer, group_index); orig_db->performSubstitutions(puppet_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -91,7 +91,7 @@ bool afxEA_CameraShake::ea_start()
if (aim_constraint && pos_constraint) if (aim_constraint && pos_constraint)
{ {
if (full_lifetime <= 0 || full_lifetime == INFINITE_LIFETIME) if (mFull_lifetime <= 0 || mFull_lifetime == INFINITE_LIFETIME)
{ {
Con::errorf("afxEA_CameraShake::ea_start() -- effect requires a finite lifetime."); Con::errorf("afxEA_CameraShake::ea_start() -- effect requires a finite lifetime.");
return false; return false;
@ -106,7 +106,7 @@ bool afxEA_CameraShake::ea_start()
if (dist < shake_data->camShakeRadius) if (dist < shake_data->camShakeRadius)
{ {
camera_shake = new CameraShake; camera_shake = new CameraShake;
camera_shake->setDuration(full_lifetime); camera_shake->setDuration(mFull_lifetime);
camera_shake->setFrequency(shake_data->camShakeFreq); camera_shake->setFrequency(shake_data->camShakeFreq);
F32 falloff = dist/shake_data->camShakeRadius; F32 falloff = dist/shake_data->camShakeRadius;
@ -161,7 +161,7 @@ void afxEA_CameraShake::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxCameraShakeData* orig_db = shake_data; afxCameraShakeData* orig_db = shake_data;
shake_data = new afxCameraShakeData(*orig_db, true); shake_data = new afxCameraShakeData(*orig_db, true);
orig_db->performSubstitutions(shake_data, choreographer, group_index); orig_db->performSubstitutions(shake_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -107,16 +107,16 @@ bool afxEA_CollisionEvent::ea_update(F32 dt)
afxConstraint* pos_constraint = getPosConstraint(); afxConstraint* pos_constraint = getPosConstraint();
set_shape((pos_constraint) ? dynamic_cast<ShapeBase*>(pos_constraint->getSceneObject()) : 0); set_shape((pos_constraint) ? dynamic_cast<ShapeBase*>(pos_constraint->getSceneObject()) : 0);
if (choreographer && trigger_mask != 0) if (mChoreographer && trigger_mask != 0)
{ {
if (triggered) if (triggered)
{ {
choreographer->setTriggerMask(trigger_mask | choreographer->getTriggerMask()); mChoreographer->setTriggerMask(trigger_mask | mChoreographer->getTriggerMask());
triggered = false; triggered = false;
} }
else else
{ {
choreographer->setTriggerMask(~trigger_mask & choreographer->getTriggerMask()); mChoreographer->setTriggerMask(~trigger_mask & mChoreographer->getTriggerMask());
} }
} }
@ -136,7 +136,7 @@ void afxEA_CollisionEvent::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxCollisionEventData* orig_db = script_data; afxCollisionEventData* orig_db = script_data;
script_data = new afxCollisionEventData(*orig_db, true); script_data = new afxCollisionEventData(*orig_db, true);
orig_db->performSubstitutions(script_data, choreographer, group_index); orig_db->performSubstitutions(script_data, mChoreographer, mGroup_index);
} }
} }
@ -162,7 +162,7 @@ void afxEA_CollisionEvent::set_shape(ShapeBase* new_shape)
void afxEA_CollisionEvent::collisionNotify(SceneObject* obj0, SceneObject* obj1, const VectorF& vel) void afxEA_CollisionEvent::collisionNotify(SceneObject* obj0, SceneObject* obj1, const VectorF& vel)
{ {
if (obj0 != shape || !choreographer || !choreographer->getDataBlock()) if (obj0 != shape || !mChoreographer || !mChoreographer->getDataBlock())
return; return;
if (script_data->method_name != ST_NULLSTRING) if (script_data->method_name != ST_NULLSTRING)
@ -171,8 +171,8 @@ void afxEA_CollisionEvent::collisionNotify(SceneObject* obj0, SceneObject* obj1,
dSprintf(arg_buf, 256, "%g %g %g", vel.x, vel.y, vel.z); dSprintf(arg_buf, 256, "%g %g %g", vel.x, vel.y, vel.z);
// CALL SCRIPT afxChoreographerData::method(%spell, %obj0, %obj1, %velocity) // CALL SCRIPT afxChoreographerData::method(%spell, %obj0, %obj1, %velocity)
Con::executef(choreographer->getDataBlock(), script_data->method_name, Con::executef(mChoreographer->getDataBlock(), script_data->method_name,
choreographer->getIdString(), mChoreographer->getIdString(),
(obj0) ? obj0->getIdString() : "", (obj0) ? obj0->getIdString() : "",
(obj1) ? obj1->getIdString() : "", (obj1) ? obj1->getIdString() : "",
arg_buf, arg_buf,

View file

@ -98,7 +98,7 @@ void afxEA_ConsoleMessage::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxConsoleMessageData* orig_db = message_data; afxConsoleMessageData* orig_db = message_data;
message_data = new afxConsoleMessageData(*orig_db, true); message_data = new afxConsoleMessageData(*orig_db, true);
orig_db->performSubstitutions(message_data, choreographer, group_index); orig_db->performSubstitutions(message_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -101,7 +101,7 @@ bool afxEA_Damage::ea_start()
if (damage_data->repeats > 1) if (damage_data->repeats > 1)
{ {
dot_delta_ms = full_lifetime/(damage_data->repeats - 1); dot_delta_ms = mFull_lifetime /(damage_data->repeats - 1);
next_dot_time = dot_delta_ms; next_dot_time = dot_delta_ms;
} }
@ -122,15 +122,15 @@ bool afxEA_Damage::ea_update(F32 dt)
if (aim_cons && aim_cons->getSceneObject()) if (aim_cons && aim_cons->getSceneObject())
impacted_obj_id = aim_cons->getSceneObject()->getId(); impacted_obj_id = aim_cons->getSceneObject()->getId();
if (choreographer) if (mChoreographer)
choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
repeat_cnt, damage_data->ad_amount, damage_data->radius, impact_pos, repeat_cnt, damage_data->ad_amount, damage_data->radius, impact_pos,
damage_data->impulse); damage_data->impulse);
repeat_cnt++; repeat_cnt++;
} }
else if (repeat_cnt < damage_data->repeats) else if (repeat_cnt < damage_data->repeats)
{ {
if (next_dot_time <= life_elapsed) if (next_dot_time <= mLife_elapsed)
{ {
// CONSTRAINT REMAPPING << // CONSTRAINT REMAPPING <<
afxConstraint* aim_cons = getAimConstraint(); afxConstraint* aim_cons = getAimConstraint();
@ -138,8 +138,8 @@ bool afxEA_Damage::ea_update(F32 dt)
impacted_obj_id = aim_cons->getSceneObject()->getId(); impacted_obj_id = aim_cons->getSceneObject()->getId();
// CONSTRAINT REMAPPING >> // CONSTRAINT REMAPPING >>
if (choreographer) if (mChoreographer)
choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
repeat_cnt, 0, 0, impact_pos, 0); repeat_cnt, 0, 0, impact_pos, 0);
next_dot_time += dot_delta_ms; next_dot_time += dot_delta_ms;
repeat_cnt++; repeat_cnt++;
@ -153,10 +153,10 @@ void afxEA_Damage::ea_finish(bool was_stopped)
{ {
if (started && (repeat_cnt < damage_data->repeats)) if (started && (repeat_cnt < damage_data->repeats))
{ {
if (next_dot_time <= life_elapsed) if (next_dot_time <= mLife_elapsed)
{ {
if (choreographer) if (mChoreographer)
choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
repeat_cnt, 0, 0, impact_pos, 0); repeat_cnt, 0, 0, impact_pos, 0);
} }
} }
@ -172,7 +172,7 @@ void afxEA_Damage::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxDamageData* orig_db = damage_data; afxDamageData* orig_db = damage_data;
damage_data = new afxDamageData(*orig_db, true); damage_data = new afxDamageData(*orig_db, true);
orig_db->performSubstitutions(damage_data, choreographer, group_index); orig_db->performSubstitutions(damage_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -78,7 +78,7 @@ afxEA_Debris::~afxEA_Debris()
bool afxEA_Debris::isDone() bool afxEA_Debris::isDone()
{ {
return (datablock->use_as_cons_obj) ? debris_done : exploded; return (mDatablock->use_as_cons_obj) ? debris_done : exploded;
} }
void afxEA_Debris::ea_set_datablock(SimDataBlock* db) void afxEA_Debris::ea_set_datablock(SimDataBlock* db)
@ -106,21 +106,21 @@ bool afxEA_Debris::ea_update(F32 dt)
{ {
if (exploded && debris) if (exploded && debris)
{ {
if (in_scope) if (mIn_scope)
{ {
updated_xfm = debris->getRenderTransform(); mUpdated_xfm = debris->getRenderTransform();
updated_xfm.getColumn(3, &updated_pos); mUpdated_xfm.getColumn(3, &mUpdated_pos);
} }
} }
if (!exploded && debris) if (!exploded && debris)
{ {
if (in_scope) if (mIn_scope)
{ {
Point3F dir_vec(0,1,0); Point3F dir_vec(0,1,0);
updated_xfm.mulV(dir_vec); mUpdated_xfm.mulV(dir_vec);
debris->init(updated_pos, dir_vec); debris->init(mUpdated_pos, dir_vec);
if (!debris->registerObject()) if (!debris->registerObject())
{ {
delete debris; delete debris;
@ -165,7 +165,7 @@ void afxEA_Debris::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
DebrisData* orig_db = debris_data; DebrisData* orig_db = debris_data;
debris_data = new DebrisData(*orig_db, true); debris_data = new DebrisData(*orig_db, true);
orig_db->performSubstitutions(debris_data, choreographer, group_index); orig_db->performSubstitutions(debris_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -81,7 +81,7 @@ bool afxEA_Explosion::ea_start()
do_runtime_substitutions(); do_runtime_substitutions();
explosion = new Explosion(); explosion = new Explosion();
explosion->setSubstitutionData(choreographer, group_index); explosion->setSubstitutionData(mChoreographer, mGroup_index);
explosion->setDataBlock(explosion_data); explosion->setDataBlock(explosion_data);
return true; return true;
@ -91,10 +91,10 @@ bool afxEA_Explosion::ea_update(F32 dt)
{ {
if (!exploded && explosion) if (!exploded && explosion)
{ {
if (in_scope) if (mIn_scope)
{ {
Point3F norm(0,0,1); updated_xfm.mulV(norm); Point3F norm(0,0,1); mUpdated_xfm.mulV(norm);
explosion->setInitialState(updated_pos, norm); explosion->setInitialState(mUpdated_pos, norm);
if (!explosion->registerObject()) if (!explosion->registerObject())
{ {
delete explosion; delete explosion;
@ -117,7 +117,7 @@ void afxEA_Explosion::ea_finish(bool was_stopped)
void afxEA_Explosion::do_runtime_substitutions() void afxEA_Explosion::do_runtime_substitutions()
{ {
explosion_data = explosion_data->cloneAndPerformSubstitutions(choreographer, group_index); explosion_data = explosion_data->cloneAndPerformSubstitutions(mChoreographer, mGroup_index);
} }
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

View file

@ -145,7 +145,7 @@ void afxEA_FootSwitch::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxFootSwitchData* orig_db = footfall_data; afxFootSwitchData* orig_db = footfall_data;
footfall_data = new afxFootSwitchData(*orig_db, true); footfall_data = new afxFootSwitchData(*orig_db, true);
orig_db->performSubstitutions(footfall_data, choreographer, group_index); orig_db->performSubstitutions(footfall_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -146,7 +146,7 @@ bool afxEA_GuiController::ea_update(F32 dt)
if (ts_ctrl && !controller_data->preserve_pos) if (ts_ctrl && !controller_data->preserve_pos)
{ {
Point3F screen_pos; Point3F screen_pos;
if (ts_ctrl->project(updated_pos, &screen_pos)) if (ts_ctrl->project(mUpdated_pos, &screen_pos))
{ {
const Point2I ext = gui_control->getExtent(); const Point2I ext = gui_control->getExtent();
Point2I newpos(screen_pos.x - ext.x/2, screen_pos.y - ext.y/2); Point2I newpos(screen_pos.x - ext.x/2, screen_pos.y - ext.y/2);
@ -155,12 +155,12 @@ bool afxEA_GuiController::ea_update(F32 dt)
} }
if (progress_base) if (progress_base)
progress_base->setProgress((ew_timing.lifetime > 0.0) ? life_elapsed/ew_timing.lifetime : 0.0f); progress_base->setProgress((mEW_timing.lifetime > 0.0) ? mLife_elapsed / mEW_timing.lifetime : 0.0f);
else if (progress_ctrl) else if (progress_ctrl)
progress_ctrl->setScriptValue((ew_timing.lifetime > 0.0) ? avar("%g", life_elapsed/ew_timing.lifetime) : 0); progress_ctrl->setScriptValue((mEW_timing.lifetime > 0.0) ? avar("%g", mLife_elapsed / mEW_timing.lifetime) : 0);
if (do_fades) if (mDo_fades)
gui_control->setFadeAmount(fade_value); gui_control->setFadeAmount(mFade_value);
return true; return true;
} }
@ -182,7 +182,7 @@ void afxEA_GuiController::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxGuiControllerData* orig_db = controller_data; afxGuiControllerData* orig_db = controller_data;
controller_data = new afxGuiControllerData(*orig_db, true); controller_data = new afxGuiControllerData(*orig_db, true);
orig_db->performSubstitutions(controller_data, choreographer, group_index); orig_db->performSubstitutions(controller_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -105,9 +105,9 @@ bool afxEA_GuiText::ea_update(F32 dt)
case USER_TEXT: case USER_TEXT:
{ {
LinearColorF temp_clr = text_clr; LinearColorF temp_clr = text_clr;
if (do_fades) if (mDo_fades)
temp_clr.alpha = fade_value; temp_clr.alpha = mFade_value;
afxGuiTextHud::addTextItem(updated_pos, text_data->text_str, temp_clr); afxGuiTextHud::addTextItem(mUpdated_pos, text_data->text_str, temp_clr);
} }
break; break;
case SHAPE_NAME: case SHAPE_NAME:
@ -127,9 +127,9 @@ bool afxEA_GuiText::ea_update(F32 dt)
if (name && name[0] != '\0') if (name && name[0] != '\0')
{ {
LinearColorF temp_clr = text_clr; LinearColorF temp_clr = text_clr;
if (do_fades) if (mDo_fades)
temp_clr.alpha = fade_value; temp_clr.alpha = mFade_value;
afxGuiTextHud::addTextItem(updated_pos, name, temp_clr, cons_obj); afxGuiTextHud::addTextItem(mUpdated_pos, name, temp_clr, cons_obj);
} }
} }
break; break;
@ -146,7 +146,7 @@ void afxEA_GuiText::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxGuiTextData* orig_db = text_data; afxGuiTextData* orig_db = text_data;
text_data = new afxGuiTextData(*orig_db, true); text_data = new afxGuiTextData(*orig_db, true);
orig_db->performSubstitutions(text_data, choreographer, group_index); orig_db->performSubstitutions(text_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -110,15 +110,15 @@ bool afxEA_MachineGun::ea_update(F32 dt)
{ {
if (!shooting) if (!shooting)
{ {
start_time = elapsed; start_time = mElapsed;
shooting = true; shooting = true;
} }
else else
{ {
F32 next_shot = start_time + (shot_count+1)*shot_gap; F32 next_shot = start_time + (shot_count+1)*shot_gap;
while (next_shot < elapsed) while (next_shot < mElapsed)
{ {
if (in_scope) if (mIn_scope)
launch_projectile(); launch_projectile();
next_shot += shot_gap; next_shot += shot_gap;
shot_count++; shot_count++;
@ -141,7 +141,7 @@ void afxEA_MachineGun::launch_projectile()
if (bullet_data->getSubstitutionCount() > 0) if (bullet_data->getSubstitutionCount() > 0)
{ {
next_bullet = new ProjectileData(*bullet_data, true); next_bullet = new ProjectileData(*bullet_data, true);
bullet_data->performSubstitutions(next_bullet, choreographer, group_index); bullet_data->performSubstitutions(next_bullet, mChoreographer, mGroup_index);
} }
projectile->onNewDataBlock(next_bullet, false); projectile->onNewDataBlock(next_bullet, false);
@ -151,10 +151,10 @@ void afxEA_MachineGun::launch_projectile()
afxConstraint* pos_cons = getPosConstraint(); afxConstraint* pos_cons = getPosConstraint();
ShapeBase* src_obj = (pos_cons) ? (dynamic_cast<ShapeBase*>(pos_cons->getSceneObject())) : 0; ShapeBase* src_obj = (pos_cons) ? (dynamic_cast<ShapeBase*>(pos_cons->getSceneObject())) : 0;
Point3F dir_vec = updated_aim - updated_pos; Point3F dir_vec = mUpdated_aim - mUpdated_pos;
dir_vec.normalizeSafe(); dir_vec.normalizeSafe();
dir_vec *= muzzle_vel; dir_vec *= muzzle_vel;
projectile->init(updated_pos, dir_vec, src_obj); projectile->init(mUpdated_pos, dir_vec, src_obj);
if (!projectile->registerObject()) if (!projectile->registerObject())
{ {
delete projectile; delete projectile;
@ -162,7 +162,7 @@ void afxEA_MachineGun::launch_projectile()
Con::errorf("afxEA_MachineGun::launch_projectile() -- projectile failed to register."); Con::errorf("afxEA_MachineGun::launch_projectile() -- projectile failed to register.");
} }
if (projectile) if (projectile)
projectile->setDataField(StringTable->insert("afxOwner"), 0, choreographer->getIdString()); projectile->setDataField(StringTable->insert("afxOwner"), 0, mChoreographer->getIdString());
} }
void afxEA_MachineGun::do_runtime_substitutions() void afxEA_MachineGun::do_runtime_substitutions()
@ -173,7 +173,7 @@ void afxEA_MachineGun::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxMachineGunData* orig_db = gun_data; afxMachineGunData* orig_db = gun_data;
gun_data = new afxMachineGunData(*orig_db, true); gun_data = new afxMachineGunData(*orig_db, true);
orig_db->performSubstitutions(gun_data, choreographer, group_index); orig_db->performSubstitutions(gun_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -119,18 +119,18 @@ bool afxEA_Model::ea_update(F32 dt)
} }
deleteNotify(model); deleteNotify(model);
model->setSequenceRateFactor(datablock->rate_factor/prop_time_factor); model->setSequenceRateFactor(mDatablock->rate_factor/ mProp_time_factor);
model->setSortPriority(datablock->sort_priority); model->setSortPriority(mDatablock->sort_priority);
} }
if (model) if (model)
{ {
if (do_fades) if (mDo_fades)
{ {
model->setFadeAmount(fade_value); model->setFadeAmount(mFade_value);
} }
model->setTransform(updated_xfm); model->setTransform(mUpdated_xfm);
model->setScale(updated_scale); model->setScale(mUpdated_scale);
} }
return true; return true;
@ -141,10 +141,10 @@ void afxEA_Model::ea_finish(bool was_stopped)
if (!model) if (!model)
return; return;
if (in_scope && ew_timing.residue_lifetime > 0) if (mIn_scope && mEW_timing.residue_lifetime > 0)
{ {
clearNotify(model); clearNotify(model);
afxResidueMgr::add(ew_timing.residue_lifetime, ew_timing.residue_fadetime, model); afxResidueMgr::add(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, model);
model = 0; model = 0;
} }
else else
@ -203,7 +203,7 @@ void afxEA_Model::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxModelData* orig_db = model_data; afxModelData* orig_db = model_data;
model_data = new afxModelData(*orig_db, true); model_data = new afxModelData(*orig_db, true);
orig_db->performSubstitutions(model_data, choreographer, group_index); orig_db->performSubstitutions(model_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -92,11 +92,11 @@ bool afxEA_Mooring::ea_update(F32 dt)
{ {
if (!obj) if (!obj)
{ {
if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING) if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING)
{ {
obj = new afxMooring(mooring_data->networking, obj = new afxMooring(mooring_data->networking,
choreographer->getChoreographerId(), mChoreographer->getChoreographerId(),
datablock->effect_name); mDatablock->effect_name);
} }
else else
{ {
@ -116,7 +116,7 @@ bool afxEA_Mooring::ea_update(F32 dt)
if (obj) if (obj)
{ {
obj->setTransform(updated_xfm); obj->setTransform(mUpdated_xfm);
} }
return true; return true;
@ -142,7 +142,7 @@ void afxEA_Mooring::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxMooringData* orig_db = mooring_data; afxMooringData* orig_db = mooring_data;
mooring_data = new afxMooringData(*orig_db, true); mooring_data = new afxMooringData(*orig_db, true);
orig_db->performSubstitutions(mooring_data, choreographer, group_index); orig_db->performSubstitutions(mooring_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -84,28 +84,28 @@ bool afxEA_ParticleEmitter::ea_start()
{ {
afxParticleEmitterVector* pe = new afxParticleEmitterVector(); afxParticleEmitterVector* pe = new afxParticleEmitterVector();
pe->onNewDataBlock(afx_emitter_db, false); pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer); pe->setAFXOwner(mChoreographer);
emitter = pe; emitter = pe;
} }
else if (dynamic_cast<afxParticleEmitterConeData*>(emitter_data)) else if (dynamic_cast<afxParticleEmitterConeData*>(emitter_data))
{ {
afxParticleEmitterCone* pe = new afxParticleEmitterCone(); afxParticleEmitterCone* pe = new afxParticleEmitterCone();
pe->onNewDataBlock(afx_emitter_db, false); pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer); pe->setAFXOwner(mChoreographer);
emitter = pe; emitter = pe;
} }
else if (dynamic_cast<afxParticleEmitterPathData*>(emitter_data)) else if (dynamic_cast<afxParticleEmitterPathData*>(emitter_data))
{ {
afxParticleEmitterPath* pe = new afxParticleEmitterPath(); afxParticleEmitterPath* pe = new afxParticleEmitterPath();
pe->onNewDataBlock(afx_emitter_db, false); pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer); pe->setAFXOwner(mChoreographer);
emitter = pe; emitter = pe;
} }
else if (dynamic_cast<afxParticleEmitterDiscData*>(emitter_data)) else if (dynamic_cast<afxParticleEmitterDiscData*>(emitter_data))
{ {
afxParticleEmitterDisc* pe = new afxParticleEmitterDisc(); afxParticleEmitterDisc* pe = new afxParticleEmitterDisc();
pe->onNewDataBlock(afx_emitter_db, false); pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer); pe->setAFXOwner(mChoreographer);
emitter = pe; emitter = pe;
} }
} }
@ -120,7 +120,7 @@ bool afxEA_ParticleEmitter::ea_start()
// here we find or create any required particle-pools // here we find or create any required particle-pools
if (emitter_data->pool_datablock) if (emitter_data->pool_datablock)
{ {
afxParticlePool* pool = choreographer->findParticlePool(emitter_data->pool_datablock, emitter_data->pool_index); afxParticlePool* pool = mChoreographer->findParticlePool(emitter_data->pool_datablock, emitter_data->pool_index);
if (!pool) if (!pool)
{ {
afxParticlePoolData* pool_data = emitter_data->pool_datablock; afxParticlePoolData* pool_data = emitter_data->pool_datablock;
@ -129,7 +129,7 @@ bool afxEA_ParticleEmitter::ea_start()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxParticlePoolData* orig_db = pool_data; afxParticlePoolData* orig_db = pool_data;
pool_data = new afxParticlePoolData(*orig_db, true); pool_data = new afxParticlePoolData(*orig_db, true);
orig_db->performSubstitutions(pool_data, choreographer, group_index); orig_db->performSubstitutions(pool_data, mChoreographer, mGroup_index);
} }
pool = new afxParticlePool(); pool = new afxParticlePool();
@ -143,8 +143,8 @@ bool afxEA_ParticleEmitter::ea_start()
} }
if (pool) if (pool)
{ {
pool->setChoreographer(choreographer); pool->setChoreographer(mChoreographer);
choreographer->registerParticlePool(pool); mChoreographer->registerParticlePool(pool);
} }
} }
if (pool) if (pool)
@ -160,12 +160,12 @@ bool afxEA_ParticleEmitter::ea_start()
return false; return false;
} }
if (datablock->forced_bbox.isValidBox()) if (mDatablock->forced_bbox.isValidBox())
{ {
do_bbox_update = true; do_bbox_update = true;
} }
emitter->setSortPriority(datablock->sort_priority); emitter->setSortPriority(mDatablock->sort_priority);
deleteNotify(emitter); deleteNotify(emitter);
return true; return true;
@ -173,26 +173,26 @@ bool afxEA_ParticleEmitter::ea_start()
bool afxEA_ParticleEmitter::ea_update(F32 dt) bool afxEA_ParticleEmitter::ea_update(F32 dt)
{ {
if (emitter && in_scope) if (emitter && mIn_scope)
{ {
if (do_bbox_update) if (do_bbox_update)
{ {
Box3F bbox = emitter->getObjBox(); Box3F bbox = emitter->getObjBox();
bbox.minExtents = updated_pos + datablock->forced_bbox.minExtents; bbox.minExtents = mUpdated_pos + mDatablock->forced_bbox.minExtents;
bbox.maxExtents = updated_pos + datablock->forced_bbox.maxExtents; bbox.maxExtents = mUpdated_pos + mDatablock->forced_bbox.maxExtents;
emitter->setForcedObjBox(bbox); emitter->setForcedObjBox(bbox);
emitter->setTransform(emitter->getTransform()); emitter->setTransform(emitter->getTransform());
if (!datablock->update_forced_bbox) if (!mDatablock->update_forced_bbox)
do_bbox_update = false; do_bbox_update = false;
} }
if (do_fades) if (mDo_fades)
emitter->setFadeAmount(fade_value); emitter->setFadeAmount(mFade_value);
emitter->emitParticlesExt(updated_xfm, updated_pos, Point3F(0.0,0.0,0.0), (U32)(dt*1000)); emitter->emitParticlesExt(mUpdated_xfm, mUpdated_pos, Point3F(0.0,0.0,0.0), (U32)(dt*1000));
} }
return true; return true;
@ -209,7 +209,7 @@ void afxEA_ParticleEmitter::ea_finish(bool was_stopped)
// note - fully faded particles are not always // note - fully faded particles are not always
// invisible, so they are still kept alive and // invisible, so they are still kept alive and
// deleted via deleteWhenEmpty(). // deleted via deleteWhenEmpty().
if (ew_timing.fade_out_time > 0.0f) if (mEW_timing.fade_out_time > 0.0f)
emitter->setFadeAmount(0.0f); emitter->setFadeAmount(0.0f);
if (dynamic_cast<afxParticleEmitter*>(emitter)) if (dynamic_cast<afxParticleEmitter*>(emitter))
((afxParticleEmitter*)emitter)->setAFXOwner(0); ((afxParticleEmitter*)emitter)->setAFXOwner(0);
@ -240,32 +240,32 @@ void afxEA_ParticleEmitter::do_runtime_substitutions()
{ {
afxParticleEmitterVectorData* orig_db = (afxParticleEmitterVectorData*)emitter_data; afxParticleEmitterVectorData* orig_db = (afxParticleEmitterVectorData*)emitter_data;
emitter_data = new afxParticleEmitterVectorData(*orig_db, true); emitter_data = new afxParticleEmitterVectorData(*orig_db, true);
orig_db->performSubstitutions(emitter_data, choreographer, group_index); orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index);
} }
else if (dynamic_cast<afxParticleEmitterConeData*>(emitter_data)) else if (dynamic_cast<afxParticleEmitterConeData*>(emitter_data))
{ {
afxParticleEmitterConeData* orig_db = (afxParticleEmitterConeData*)emitter_data; afxParticleEmitterConeData* orig_db = (afxParticleEmitterConeData*)emitter_data;
emitter_data = new afxParticleEmitterConeData(*orig_db, true); emitter_data = new afxParticleEmitterConeData(*orig_db, true);
orig_db->performSubstitutions(emitter_data, choreographer, group_index); orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index);
} }
else if (dynamic_cast<afxParticleEmitterPathData*>(emitter_data)) else if (dynamic_cast<afxParticleEmitterPathData*>(emitter_data))
{ {
afxParticleEmitterPathData* orig_db = (afxParticleEmitterPathData*)emitter_data; afxParticleEmitterPathData* orig_db = (afxParticleEmitterPathData*)emitter_data;
emitter_data = new afxParticleEmitterPathData(*orig_db, true); emitter_data = new afxParticleEmitterPathData(*orig_db, true);
orig_db->performSubstitutions(emitter_data, choreographer, group_index); orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index);
} }
else if (dynamic_cast<afxParticleEmitterDiscData*>(emitter_data)) else if (dynamic_cast<afxParticleEmitterDiscData*>(emitter_data))
{ {
afxParticleEmitterDiscData* orig_db = (afxParticleEmitterDiscData*)emitter_data; afxParticleEmitterDiscData* orig_db = (afxParticleEmitterDiscData*)emitter_data;
emitter_data = new afxParticleEmitterDiscData(*orig_db, true); emitter_data = new afxParticleEmitterDiscData(*orig_db, true);
orig_db->performSubstitutions(emitter_data, choreographer, group_index); orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index);
} }
} }
else else
{ {
ParticleEmitterData* orig_db = emitter_data; ParticleEmitterData* orig_db = emitter_data;
emitter_data = new ParticleEmitterData(*orig_db, true); emitter_data = new ParticleEmitterData(*orig_db, true);
orig_db->performSubstitutions(emitter_data, choreographer, group_index); orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index);
} }
if (clone_particles) if (clone_particles)
@ -277,7 +277,7 @@ void afxEA_ParticleEmitter::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
ParticleData* orig_db = emitter_data->particleDataBlocks[i]; ParticleData* orig_db = emitter_data->particleDataBlocks[i];
emitter_data->particleDataBlocks[i] = new ParticleData(*orig_db, true); emitter_data->particleDataBlocks[i] = new ParticleData(*orig_db, true);
orig_db->performSubstitutions(emitter_data->particleDataBlocks[i], choreographer, group_index); orig_db->performSubstitutions(emitter_data->particleDataBlocks[i], mChoreographer, mGroup_index);
} }
} }
} }

View file

@ -137,7 +137,7 @@ void afxEA_PhraseEffect::grab_player_triggers(U32& trigger_mask)
bool afxEA_PhraseEffect::ea_update(F32 dt) bool afxEA_PhraseEffect::ea_update(F32 dt)
{ {
if (fade_value >= 1.0f) if (mFade_value >= 1.0f)
{ {
// //
// Choreographer Triggers: // Choreographer Triggers:
@ -145,7 +145,7 @@ bool afxEA_PhraseEffect::ea_update(F32 dt)
// They must be set explicitly by calls to afxChoreographer // They must be set explicitly by calls to afxChoreographer
// console-methods, setTriggerBit(), or clearTriggerBit(). // console-methods, setTriggerBit(), or clearTriggerBit().
// //
U32 trigger_mask = (phrase_fx_data->no_choreographer_trigs) ? 0 : choreographer->getTriggerMask(); U32 trigger_mask = (phrase_fx_data->no_choreographer_trigs) ? 0 : mChoreographer->getTriggerMask();
// //
// Constraint Triggers: // Constraint Triggers:
@ -191,7 +191,7 @@ bool afxEA_PhraseEffect::ea_update(F32 dt)
{ {
for (S32 i = 0; i < active_phrases->size(); i++) for (S32 i = 0; i < active_phrases->size(); i++)
{ {
(*active_phrases)[i]->stop(life_elapsed); (*active_phrases)[i]->stop(mLife_elapsed);
} }
} }
} }
@ -240,7 +240,7 @@ void afxEA_PhraseEffect::ea_finish(bool was_stopped)
{ {
for (S32 i = 0; i < active_phrases->size(); i++) for (S32 i = 0; i < active_phrases->size(); i++)
{ {
(*active_phrases)[i]->stop(life_elapsed); (*active_phrases)[i]->stop(mLife_elapsed);
} }
} }
@ -252,7 +252,7 @@ void afxEA_PhraseEffect::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxPhraseEffectData* orig_db = phrase_fx_data; afxPhraseEffectData* orig_db = phrase_fx_data;
phrase_fx_data = new afxPhraseEffectData(*orig_db, true); phrase_fx_data = new afxPhraseEffectData(*orig_db, true);
orig_db->performSubstitutions(phrase_fx_data, choreographer, group_index); orig_db->performSubstitutions(phrase_fx_data, mChoreographer, mGroup_index);
} }
} }
@ -260,8 +260,8 @@ void afxEA_PhraseEffect::trigger_new_phrase()
{ {
//afxPhrase* phrase = new afxPhrase(choreographer->isServerObject(), /*willStop=*/false); //afxPhrase* phrase = new afxPhrase(choreographer->isServerObject(), /*willStop=*/false);
bool will_stop = phrase_fx_data->phrase_type == afxPhraseEffectData::PHRASE_CONTINUOUS; bool will_stop = phrase_fx_data->phrase_type == afxPhraseEffectData::PHRASE_CONTINUOUS;
afxPhrase* phrase = new afxPhrase(choreographer->isServerObject(), will_stop); afxPhrase* phrase = new afxPhrase(mChoreographer->isServerObject(), will_stop);
phrase->init(phrase_fx_data->fx_list, datablock->ewd_timing.lifetime, choreographer, time_factor, phrase_fx_data->n_loops, group_index); phrase->init(phrase_fx_data->fx_list, mDatablock->ewd_timing.lifetime, mChoreographer, mTime_factor, phrase_fx_data->n_loops, mGroup_index);
phrase->start(0, 0); phrase->start(0, 0);
if (phrase->isEmpty()) if (phrase->isEmpty())
{ {
@ -272,10 +272,10 @@ void afxEA_PhraseEffect::trigger_new_phrase()
if (phrase_fx_data->on_trig_cmd != ST_NULLSTRING) if (phrase_fx_data->on_trig_cmd != ST_NULLSTRING)
{ {
char obj_str[32]; char obj_str[32];
dStrcpy(obj_str, Con::getIntArg(choreographer->getId()), 32); dStrcpy(obj_str, Con::getIntArg(mChoreographer->getId()), 32);
char index_str[32]; char index_str[32];
dStrcpy(index_str, Con::getIntArg(group_index), 32); dStrcpy(index_str, Con::getIntArg(mGroup_index), 32);
char buffer[1024]; char buffer[1024];
char* b = buffer; char* b = buffer;
@ -331,9 +331,9 @@ void afxEA_PhraseEffect::update_active_phrases(F32 dt)
for (S32 i = 0; i < active_phrases->size(); i++) for (S32 i = 0; i < active_phrases->size(); i++)
{ {
afxPhrase* phrase = (*active_phrases)[i]; afxPhrase* phrase = (*active_phrases)[i];
if (phrase->expired(life_elapsed)) if (phrase->expired(mLife_elapsed))
phrase->recycle(life_elapsed); phrase->recycle(mLife_elapsed);
phrase->update(dt, life_elapsed); phrase->update(dt, mLife_elapsed);
} }
} }

View file

@ -127,9 +127,9 @@ bool afxEA_PhysicalZone::ea_update(F32 dt)
set_cons_object((pos_constraint) ? pos_constraint->getSceneObject() : 0); set_cons_object((pos_constraint) ? pos_constraint->getSceneObject() : 0);
} }
if (do_fades) if (mDo_fades)
physical_zone->setFadeAmount(fade_value); physical_zone->setFadeAmount(mFade_value);
physical_zone->setTransform(updated_xfm); physical_zone->setTransform(mUpdated_xfm);
} }
return true; return true;
@ -172,7 +172,7 @@ void afxEA_PhysicalZone::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxPhysicalZoneData* orig_db = zone_data; afxPhysicalZoneData* orig_db = zone_data;
zone_data = new afxPhysicalZoneData(*orig_db, true); zone_data = new afxPhysicalZoneData(*orig_db, true);
orig_db->performSubstitutions(zone_data, choreographer, group_index); orig_db->performSubstitutions(zone_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -136,7 +136,7 @@ void afxEA_PlayerMovement::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxPlayerMovementData* orig_db = movement_data; afxPlayerMovementData* orig_db = movement_data;
movement_data = new afxPlayerMovementData(*orig_db, true); movement_data = new afxPlayerMovementData(*orig_db, true);
orig_db->performSubstitutions(movement_data, choreographer, group_index); orig_db->performSubstitutions(movement_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -80,8 +80,8 @@ bool afxEA_PlayerPuppet::ea_start()
do_runtime_substitutions(); do_runtime_substitutions();
afxConstraintID obj_id = cons_mgr->getConstraintId(mover_data->obj_def); afxConstraintID obj_id = mCons_mgr->getConstraintId(mover_data->obj_def);
obj_cons = cons_mgr->getConstraint(obj_id); obj_cons = mCons_mgr->getConstraint(obj_id);
Player* player = dynamic_cast<Player*>((obj_cons) ? obj_cons->getSceneObject() : 0); Player* player = dynamic_cast<Player*>((obj_cons) ? obj_cons->getSceneObject() : 0);
if (player) if (player)
@ -94,9 +94,9 @@ bool afxEA_PlayerPuppet::ea_update(F32 dt)
{ {
SceneObject* obj = (obj_cons) ? obj_cons->getSceneObject() : 0; SceneObject* obj = (obj_cons) ? obj_cons->getSceneObject() : 0;
if (obj && in_scope) if (obj && mIn_scope)
{ {
obj->setTransform(updated_xfm); obj->setTransform(mUpdated_xfm);
} }
return true; return true;
@ -138,7 +138,7 @@ void afxEA_PlayerPuppet::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxPlayerPuppetData* orig_db = mover_data; afxPlayerPuppetData* orig_db = mover_data;
mover_data = new afxPlayerPuppetData(*orig_db, true); mover_data = new afxPlayerPuppetData(*orig_db, true);
orig_db->performSubstitutions(mover_data, choreographer, group_index); orig_db->performSubstitutions(mover_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -203,12 +203,12 @@ bool afxEA_T3DPointLight::ea_update(F32 dt)
light->setConstraintObject(cons_obj); light->setConstraintObject(cons_obj);
#endif #endif
light->setLiveColor(updated_color); light->setLiveColor(mUpdated_color);
if (do_fades) if (mDo_fades)
light->setFadeAmount(fade_value*updated_scale.x); light->setFadeAmount(mFade_value*mUpdated_scale.x);
light->updateTransform(updated_xfm); light->updateTransform(mUpdated_xfm);
// scale should not be updated this way. It messes up the culling. // scale should not be updated this way. It messes up the culling.
//light->setScale(updated_scale); //light->setScale(updated_scale);
@ -254,7 +254,7 @@ void afxEA_T3DPointLight::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxT3DPointLightData* orig_db = light_data; afxT3DPointLightData* orig_db = light_data;
light_data = new afxT3DPointLightData(*orig_db, true); light_data = new afxT3DPointLightData(*orig_db, true);
orig_db->performSubstitutions(light_data, choreographer, group_index); orig_db->performSubstitutions(light_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -92,7 +92,7 @@ afxEA_Projectile::~afxEA_Projectile()
bool afxEA_Projectile::isDone() bool afxEA_Projectile::isDone()
{ {
return (datablock->use_as_cons_obj || datablock->use_ghost_as_cons_obj) ? projectile_done : impacted; return (mDatablock->use_as_cons_obj || mDatablock->use_ghost_as_cons_obj) ? projectile_done : impacted;
} }
void afxEA_Projectile::ea_set_datablock(SimDataBlock* db) void afxEA_Projectile::ea_set_datablock(SimDataBlock* db)
@ -117,8 +117,8 @@ bool afxEA_Projectile::ea_start()
} }
else else
{ {
if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING) if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING)
projectile = new afxProjectile(afx_projectile_data->networking, choreographer->getChoreographerId(), datablock->effect_name); projectile = new afxProjectile(afx_projectile_data->networking, mChoreographer->getChoreographerId(), mDatablock->effect_name);
else else
projectile = new afxProjectile(afx_projectile_data->networking, 0, ST_NULLSTRING); projectile = new afxProjectile(afx_projectile_data->networking, 0, ST_NULLSTRING);
projectile->ignoreSourceTimeout = afx_projectile_data->ignore_src_timeout; projectile->ignoreSourceTimeout = afx_projectile_data->ignore_src_timeout;
@ -127,8 +127,8 @@ bool afxEA_Projectile::ea_start()
projectile->dynamicCollisionMask = afx_projectile_data->dynamicCollisionMask; projectile->dynamicCollisionMask = afx_projectile_data->dynamicCollisionMask;
projectile->staticCollisionMask = afx_projectile_data->staticCollisionMask; projectile->staticCollisionMask = afx_projectile_data->staticCollisionMask;
} }
afxConstraintID launch_pos_id = cons_mgr->getConstraintId(afx_projectile_data->launch_pos_def); afxConstraintID launch_pos_id = mCons_mgr->getConstraintId(afx_projectile_data->launch_pos_def);
launch_cons = cons_mgr->getConstraint(launch_pos_id); launch_cons = mCons_mgr->getConstraint(launch_pos_id);
launch_dir_bias = afx_projectile_data->launch_dir_bias; launch_dir_bias = afx_projectile_data->launch_dir_bias;
} }
@ -141,7 +141,7 @@ bool afxEA_Projectile::ea_update(F32 dt)
{ {
if (!launched && projectile) if (!launched && projectile)
{ {
if (in_scope) if (mIn_scope)
{ {
afxConstraint* pos_cons = getPosConstraint(); afxConstraint* pos_cons = getPosConstraint();
ShapeBase* src_obj = (pos_cons) ? (dynamic_cast<ShapeBase*>(pos_cons->getSceneObject())) : 0; ShapeBase* src_obj = (pos_cons) ? (dynamic_cast<ShapeBase*>(pos_cons->getSceneObject())) : 0;
@ -155,19 +155,19 @@ bool afxEA_Projectile::ea_update(F32 dt)
{ {
case afxProjectileData::OrientConstraint: case afxProjectileData::OrientConstraint:
dir_vec.set(0,0,1); dir_vec.set(0,0,1);
updated_xfm.mulV(dir_vec); mUpdated_xfm.mulV(dir_vec);
break; break;
case afxProjectileData::LaunchDirField: case afxProjectileData::LaunchDirField:
dir_vec.set(0,0,1); dir_vec.set(0,0,1);
break; break;
case afxProjectileData::TowardPos2Constraint: case afxProjectileData::TowardPos2Constraint:
default: default:
dir_vec = updated_aim - updated_pos; dir_vec = mUpdated_aim - mUpdated_pos;
break; break;
} }
} }
else else
dir_vec = updated_aim - updated_pos; dir_vec = mUpdated_aim - mUpdated_pos;
dir_vec.normalizeSafe(); dir_vec.normalizeSafe();
if (!launch_dir_bias.isZero()) if (!launch_dir_bias.isZero())
@ -184,7 +184,7 @@ bool afxEA_Projectile::ea_update(F32 dt)
projectile->init(launch_pos, dir_vec, (launch_obj) ? launch_obj : src_obj); projectile->init(launch_pos, dir_vec, (launch_obj) ? launch_obj : src_obj);
} }
else else
projectile->init(updated_pos, dir_vec, src_obj); projectile->init(mUpdated_pos, dir_vec, src_obj);
if (!projectile->registerObject()) if (!projectile->registerObject())
{ {
@ -197,7 +197,7 @@ bool afxEA_Projectile::ea_update(F32 dt)
deleteNotify(projectile); deleteNotify(projectile);
if (projectile) if (projectile)
projectile->setDataField(StringTable->insert("afxOwner"), 0, choreographer->getIdString()); projectile->setDataField(StringTable->insert("afxOwner"), 0, mChoreographer->getIdString());
} }
launched = true; launched = true;
@ -205,10 +205,10 @@ bool afxEA_Projectile::ea_update(F32 dt)
if (launched && projectile) if (launched && projectile)
{ {
if (in_scope) if (mIn_scope)
{ {
updated_xfm = projectile->getRenderTransform(); mUpdated_xfm = projectile->getRenderTransform();
updated_xfm.getColumn(3, &updated_pos); mUpdated_xfm.getColumn(3, &mUpdated_pos);
} }
} }
@ -247,7 +247,7 @@ void afxEA_Projectile::do_runtime_substitutions()
afxProjectileData* orig_db = (afxProjectileData*)projectile_data; afxProjectileData* orig_db = (afxProjectileData*)projectile_data;
afx_projectile_data = new afxProjectileData(*orig_db, true); afx_projectile_data = new afxProjectileData(*orig_db, true);
projectile_data = afx_projectile_data; projectile_data = afx_projectile_data;
orig_db->performSubstitutions(projectile_data, choreographer, group_index); orig_db->performSubstitutions(projectile_data, mChoreographer, mGroup_index);
} }
else else
{ {
@ -255,7 +255,7 @@ void afxEA_Projectile::do_runtime_substitutions()
ProjectileData* orig_db = projectile_data; ProjectileData* orig_db = projectile_data;
afx_projectile_data = 0; afx_projectile_data = 0;
projectile_data = new ProjectileData(*orig_db, true); projectile_data = new ProjectileData(*orig_db, true);
orig_db->performSubstitutions(projectile_data, choreographer, group_index); orig_db->performSubstitutions(projectile_data, mChoreographer, mGroup_index);
} }
} }
} }

View file

@ -91,10 +91,10 @@ bool afxEA_ScriptEvent::ea_start()
bool afxEA_ScriptEvent::ea_update(F32 dt) bool afxEA_ScriptEvent::ea_update(F32 dt)
{ {
if (!ran_script && choreographer != NULL) if (!ran_script && mChoreographer != NULL)
{ {
afxConstraint* pos_constraint = getPosConstraint(); afxConstraint* pos_constraint = getPosConstraint();
choreographer->executeScriptEvent(script_data->method_name, pos_constraint, updated_xfm, mChoreographer->executeScriptEvent(script_data->method_name, pos_constraint, mUpdated_xfm,
script_data->script_data); script_data->script_data);
ran_script = true; ran_script = true;
} }
@ -115,7 +115,7 @@ void afxEA_ScriptEvent::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxScriptEventData* orig_db = script_data; afxScriptEventData* orig_db = script_data;
script_data = new afxScriptEventData(*orig_db, true); script_data = new afxScriptEventData(*orig_db, true);
orig_db->performSubstitutions(script_data, choreographer, group_index); orig_db->performSubstitutions(script_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -108,15 +108,15 @@ bool afxEA_Sound::ea_update(F32 dt)
{ {
if (!sound_handle) if (!sound_handle)
{ {
sound_handle = SFX->createSource(sound_prof, &updated_xfm, 0); sound_handle = SFX->createSource(sound_prof, &mUpdated_xfm, 0);
if (sound_handle) if (sound_handle)
sound_handle->play(); sound_handle->play();
} }
if (sound_handle) if (sound_handle)
{ {
sound_handle->setTransform(updated_xfm); sound_handle->setTransform(mUpdated_xfm);
sound_handle->setVolume((in_scope) ? updated_scale.x*fade_value : 0.0f); sound_handle->setVolume((mIn_scope) ? mUpdated_scale.x*mFade_value : 0.0f);
deleteNotify(sound_handle); deleteNotify(sound_handle);
} }
@ -134,7 +134,7 @@ void afxEA_Sound::ea_finish(bool was_stopped)
void afxEA_Sound::do_runtime_substitutions() void afxEA_Sound::do_runtime_substitutions()
{ {
sound_prof = sound_prof->cloneAndPerformSubstitutions(choreographer, group_index); sound_prof = sound_prof->cloneAndPerformSubstitutions(mChoreographer, mGroup_index);
sound_desc = sound_prof->getDescription(); sound_desc = sound_prof->getDescription();
} }

View file

@ -207,12 +207,12 @@ bool afxEA_T3DSpotLight::ea_update(F32 dt)
light->setConstraintObject(cons_obj); light->setConstraintObject(cons_obj);
#endif #endif
light->setLiveColor(updated_color); light->setLiveColor(mUpdated_color);
if (do_fades) if (mDo_fades)
light->setFadeAmount(fade_value); light->setFadeAmount(mFade_value);
light->updateTransform(updated_xfm); light->updateTransform(mUpdated_xfm);
// scale should not be updated this way. It messes up the culling. // scale should not be updated this way. It messes up the culling.
//light->setScale(updated_scale); //light->setScale(updated_scale);
@ -258,7 +258,7 @@ void afxEA_T3DSpotLight::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxT3DSpotLightData* orig_db = light_data; afxT3DSpotLightData* orig_db = light_data;
light_data = new afxT3DSpotLightData(*orig_db, true); light_data = new afxT3DSpotLightData(*orig_db, true);
orig_db->performSubstitutions(light_data, choreographer, group_index); orig_db->performSubstitutions(light_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -97,7 +97,7 @@ bool afxEA_StaticShape::ea_start()
do_runtime_substitutions(); do_runtime_substitutions();
// fades are handled using startFade() calls. // fades are handled using startFade() calls.
do_fades = false; mDo_fades = false;
return true; return true;
} }
@ -108,8 +108,8 @@ bool afxEA_StaticShape::ea_update(F32 dt)
{ {
// create and register effect // create and register effect
static_shape = new afxStaticShape(); static_shape = new afxStaticShape();
if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING) if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING)
static_shape->init(choreographer->getChoreographerId(), datablock->effect_name); static_shape->init(mChoreographer->getChoreographerId(), mDatablock->effect_name);
static_shape->onNewDataBlock(shape_data, false); static_shape->onNewDataBlock(shape_data, false);
if (!static_shape->registerObject()) if (!static_shape->registerObject())
@ -122,26 +122,26 @@ bool afxEA_StaticShape::ea_update(F32 dt)
deleteNotify(static_shape); deleteNotify(static_shape);
registerForCleanup(static_shape); registerForCleanup(static_shape);
if (ew_timing.fade_in_time > 0.0f) if (mEW_timing.fade_in_time > 0.0f)
static_shape->startFade(ew_timing.fade_in_time, 0, false); static_shape->startFade(mEW_timing.fade_in_time, 0, false);
} }
if (static_shape) if (static_shape)
{ {
if (!fade_out_started && elapsed > fade_out_start) if (!fade_out_started && mElapsed > mFade_out_start)
{ {
if (!do_spawn) if (!do_spawn)
{ {
if (ew_timing.fade_out_time > 0.0f) if (mEW_timing.fade_out_time > 0.0f)
static_shape->startFade(ew_timing.fade_out_time, 0, true); static_shape->startFade(mEW_timing.fade_out_time, 0, true);
} }
fade_out_started = true; fade_out_started = true;
} }
if (in_scope) if (mIn_scope)
{ {
static_shape->setTransform(updated_xfm); static_shape->setTransform(mUpdated_xfm);
static_shape->setScale(updated_scale); static_shape->setScale(mUpdated_scale);
} }
} }
@ -155,7 +155,7 @@ void afxEA_StaticShape::ea_finish(bool was_stopped)
if (do_spawn) if (do_spawn)
{ {
Con::executef(shape_data, "onSpawn", static_shape->getIdString(), datablock->effect_name); Con::executef(shape_data, "onSpawn", static_shape->getIdString(), mDatablock->effect_name);
clearNotify(static_shape); clearNotify(static_shape);
} }
else else
@ -204,13 +204,13 @@ void afxEA_StaticShape::do_runtime_substitutions()
{ {
afxStaticShapeData* orig_db = (afxStaticShapeData*)shape_data; afxStaticShapeData* orig_db = (afxStaticShapeData*)shape_data;
shape_data = new afxStaticShapeData(*orig_db, true); shape_data = new afxStaticShapeData(*orig_db, true);
orig_db->performSubstitutions(shape_data, choreographer, group_index); orig_db->performSubstitutions(shape_data, mChoreographer, mGroup_index);
} }
else else
{ {
StaticShapeData* orig_db = shape_data; StaticShapeData* orig_db = shape_data;
shape_data = new StaticShapeData(*orig_db, true); shape_data = new StaticShapeData(*orig_db, true);
orig_db->performSubstitutions(shape_data, choreographer, group_index); orig_db->performSubstitutions(shape_data, mChoreographer, mGroup_index);
} }
} }
} }

View file

@ -108,16 +108,16 @@ F32 afxEA_Zodiac::calc_facing_angle()
inline F32 afxEA_Zodiac::calc_terrain_alt_bias() inline F32 afxEA_Zodiac::calc_terrain_alt_bias()
{ {
if (terrain_altitude >= zode_data->altitude_max) if (mTerrain_altitude >= zode_data->altitude_max)
return 0.0f; return 0.0f;
return 1.0f - (terrain_altitude - zode_data->altitude_falloff)/altitude_falloff_range; return 1.0f - (mTerrain_altitude - zode_data->altitude_falloff)/altitude_falloff_range;
} }
inline F32 afxEA_Zodiac::calc_interior_alt_bias() inline F32 afxEA_Zodiac::calc_interior_alt_bias()
{ {
if (interior_altitude >= zode_data->altitude_max) if (mInterior_altitude >= zode_data->altitude_max)
return 0.0f; return 0.0f;
return 1.0f - (interior_altitude - zode_data->altitude_falloff)/altitude_falloff_range; return 1.0f - (mInterior_altitude - zode_data->altitude_falloff)/altitude_falloff_range;
} }
afxEA_Zodiac::afxEA_Zodiac() afxEA_Zodiac::afxEA_Zodiac()
@ -170,13 +170,13 @@ bool afxEA_Zodiac::ea_start()
bool afxEA_Zodiac::ea_update(F32 dt) bool afxEA_Zodiac::ea_update(F32 dt)
{ {
if (!in_scope) if (!mIn_scope)
return true; return true;
//~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//
// Zodiac Color // Zodiac Color
zode_color = updated_color; zode_color = mUpdated_color;
if (live_color_factor > 0.0) if (live_color_factor > 0.0)
{ {
@ -190,15 +190,15 @@ bool afxEA_Zodiac::ea_update(F32 dt)
//Con::printf("LIVE-COLOR-FACTOR is ZERO"); //Con::printf("LIVE-COLOR-FACTOR is ZERO");
} }
if (do_fades) if (mDo_fades)
{ {
if (fade_value < 0.01f) if (mFade_value < 0.01f)
return true; // too transparent return true; // too transparent
if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE) if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE)
zode_color *= fade_value*live_fade_factor; zode_color *= mFade_value * mLive_fade_factor;
else else
zode_color.alpha *= fade_value*live_fade_factor; zode_color.alpha *= mFade_value * mLive_fade_factor;
} }
if (zode_color.alpha < 0.01f) if (zode_color.alpha < 0.01f)
@ -208,22 +208,22 @@ bool afxEA_Zodiac::ea_update(F32 dt)
// Zodiac // Zodiac
// scale and grow zode // scale and grow zode
zode_radius = zode_data->radius_xy*updated_scale.x + life_elapsed*zode_data->growth_rate; zode_radius = zode_data->radius_xy*mUpdated_scale.x + mLife_elapsed *zode_data->growth_rate;
// zode is growing // zode is growing
if (life_elapsed < zode_data->grow_in_time) if (mLife_elapsed < zode_data->grow_in_time)
{ {
F32 t = life_elapsed/zode_data->grow_in_time; F32 t = mLife_elapsed /zode_data->grow_in_time;
zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.2f, 0.8f); zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.2f, 0.8f);
} }
// zode is shrinking // zode is shrinking
else if (full_lifetime - life_elapsed < zode_data->shrink_out_time) else if (mFull_lifetime - mLife_elapsed < zode_data->shrink_out_time)
{ {
F32 t = (full_lifetime - life_elapsed)/zode_data->shrink_out_time; F32 t = (mFull_lifetime - mLife_elapsed)/zode_data->shrink_out_time;
zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.0f, 0.9f); zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.0f, 0.9f);
} }
zode_radius *= live_scale_factor; zode_radius *= mLive_scale_factor;
if (zode_radius < 0.001f) if (zode_radius < 0.001f)
return true; // too small return true; // too small
@ -238,7 +238,7 @@ bool afxEA_Zodiac::ea_update(F32 dt)
//~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//
// Zodiac Position // Zodiac Position
zode_pos = updated_pos; zode_pos = mUpdated_pos;
//~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//
// Zodiac Rotation // Zodiac Rotation
@ -249,7 +249,7 @@ bool afxEA_Zodiac::ea_update(F32 dt)
if (orient_constraint) if (orient_constraint)
{ {
VectorF shape_vec; VectorF shape_vec;
updated_xfm.getColumn(1, &shape_vec); mUpdated_xfm.getColumn(1, &shape_vec);
shape_vec.z = 0.0f; shape_vec.z = 0.0f;
shape_vec.normalize(); shape_vec.normalize();
F32 pitch, yaw; F32 pitch, yaw;
@ -258,14 +258,14 @@ bool afxEA_Zodiac::ea_update(F32 dt)
} }
} }
zode_angle = zode_data->calcRotationAngle(life_elapsed, datablock->rate_factor/prop_time_factor); zode_angle = zode_data->calcRotationAngle(mLife_elapsed, mDatablock->rate_factor/ mProp_time_factor);
zode_angle = mFmod(zode_angle + zode_angle_offset, 360.0f); zode_angle = mFmod(zode_angle + zode_angle_offset, 360.0f);
//~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//
// post zodiac // post zodiac
if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_TERRAIN) != 0) if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_TERRAIN) != 0)
{ {
if (do_altitude_bias && terrain_altitude > zode_data->altitude_falloff) if (do_altitude_bias && mTerrain_altitude > zode_data->altitude_falloff)
{ {
F32 alt_bias = calc_terrain_alt_bias(); F32 alt_bias = calc_terrain_alt_bias();
if (alt_bias > 0.0f) if (alt_bias > 0.0f)
@ -287,7 +287,7 @@ bool afxEA_Zodiac::ea_update(F32 dt)
if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_INTERIORS) != 0) if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_INTERIORS) != 0)
{ {
if (do_altitude_bias && interior_altitude > zode_data->altitude_falloff) if (do_altitude_bias && mInterior_altitude > zode_data->altitude_falloff)
{ {
F32 alt_bias = calc_interior_alt_bias(); F32 alt_bias = calc_interior_alt_bias();
if (alt_bias > 0.0f) if (alt_bias > 0.0f)
@ -310,17 +310,17 @@ bool afxEA_Zodiac::ea_update(F32 dt)
void afxEA_Zodiac::ea_finish(bool was_stopped) void afxEA_Zodiac::ea_finish(bool was_stopped)
{ {
if (in_scope && ew_timing.residue_lifetime > 0) if (mIn_scope && mEW_timing.residue_lifetime > 0)
{ {
if (do_fades) if (mDo_fades)
{ {
if (fade_value < 0.01f) if (mFade_value < 0.01f)
return; return;
zode_color.alpha *= fade_value; zode_color.alpha *= mFade_value;
} }
if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_TERRAIN) != 0) if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_TERRAIN) != 0)
{ {
if (do_altitude_bias && terrain_altitude > zode_data->altitude_falloff) if (do_altitude_bias && mTerrain_altitude > zode_data->altitude_falloff)
{ {
F32 alt_bias = calc_terrain_alt_bias(); F32 alt_bias = calc_terrain_alt_bias();
if (alt_bias > 0.0f) if (alt_bias > 0.0f)
@ -332,20 +332,20 @@ void afxEA_Zodiac::ea_finish(bool was_stopped)
if (zode_data->altitude_fades) if (zode_data->altitude_fades)
zode_color.alpha *= alt_bias; zode_color.alpha *= alt_bias;
became_residue = true; became_residue = true;
afxResidueMgr::add_terrain_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, zode_data, zode_pos, alt_rad, afxResidueMgr::add_terrain_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, zode_data, zode_pos, alt_rad,
alt_clr, zode_angle); alt_clr, zode_angle);
} }
} }
else else
{ {
became_residue = true; became_residue = true;
afxResidueMgr::add_terrain_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, zode_data, zode_pos, zode_radius, afxResidueMgr::add_terrain_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, zode_data, zode_pos, zode_radius,
zode_color, zode_angle); zode_color, zode_angle);
} }
} }
if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_INTERIORS) != 0) if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_INTERIORS) != 0)
{ {
if (do_altitude_bias && interior_altitude > zode_data->altitude_falloff) if (do_altitude_bias && mInterior_altitude > zode_data->altitude_falloff)
{ {
F32 alt_bias = calc_interior_alt_bias(); F32 alt_bias = calc_interior_alt_bias();
if (alt_bias > 0.0f) if (alt_bias > 0.0f)
@ -361,7 +361,7 @@ void afxEA_Zodiac::ea_finish(bool was_stopped)
if (became_residue) if (became_residue)
temp_zode = new afxZodiacData(*zode_data, true); temp_zode = new afxZodiacData(*zode_data, true);
became_residue = true; became_residue = true;
afxResidueMgr::add_interior_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, temp_zode, zode_pos, alt_rad, afxResidueMgr::add_interior_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, temp_zode, zode_pos, alt_rad,
zode_vrange, alt_clr, zode_angle); zode_vrange, alt_clr, zode_angle);
} }
@ -372,7 +372,7 @@ void afxEA_Zodiac::ea_finish(bool was_stopped)
if (became_residue) if (became_residue)
temp_zode = new afxZodiacData(*zode_data, true); temp_zode = new afxZodiacData(*zode_data, true);
became_residue = true; became_residue = true;
afxResidueMgr::add_interior_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, temp_zode, zode_pos, zode_radius, afxResidueMgr::add_interior_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, temp_zode, zode_pos, zode_radius,
zode_vrange, zode_color, zode_angle); zode_vrange, zode_color, zode_angle);
} }
} }
@ -387,7 +387,7 @@ void afxEA_Zodiac::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxZodiacData* orig_db = zode_data; afxZodiacData* orig_db = zode_data;
zode_data = new afxZodiacData(*orig_db, true); zode_data = new afxZodiacData(*orig_db, true);
orig_db->performSubstitutions(zode_data, choreographer, group_index); orig_db->performSubstitutions(zode_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -174,42 +174,42 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt)
if (pzode) if (pzode)
{ {
//LinearColorF zode_color = zode_data->color; //LinearColorF zode_color = zode_data->color;
LinearColorF zode_color = updated_color; LinearColorF zode_color = mUpdated_color;
if (live_color_factor > 0.0) if (live_color_factor > 0.0)
zode_color.interpolate(zode_color, live_color, live_color_factor); zode_color.interpolate(zode_color, live_color, live_color_factor);
if (do_fades) if (mDo_fades)
{ {
if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE) if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE)
zode_color *= fade_value*live_fade_factor; zode_color *= mFade_value *mLive_fade_factor;
else else
zode_color.alpha *= fade_value*live_fade_factor; zode_color.alpha *= mFade_value * mLive_fade_factor;
} }
// scale and grow zode // scale and grow zode
//F32 zode_radius = zode_data->radius_xy*updated_scale.x + life_elapsed*zode_data->growth_rate; //F32 zode_radius = zode_data->radius_xy*updated_scale.x + life_elapsed*zode_data->growth_rate;
F32 zode_radius = zode_data->radius_xy + life_elapsed*zode_data->growth_rate; F32 zode_radius = zode_data->radius_xy + mLife_elapsed *zode_data->growth_rate;
// zode is growing // zode is growing
if (life_elapsed < zode_data->grow_in_time) if (mLife_elapsed < zode_data->grow_in_time)
{ {
F32 t = life_elapsed/zode_data->grow_in_time; F32 t = mLife_elapsed /zode_data->grow_in_time;
zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.2f, 0.8f); zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.2f, 0.8f);
} }
// zode is shrinking // zode is shrinking
else if (full_lifetime - life_elapsed < zode_data->shrink_out_time) else if (mFull_lifetime - mLife_elapsed < zode_data->shrink_out_time)
{ {
F32 t = (full_lifetime - life_elapsed)/zode_data->shrink_out_time; F32 t = (mFull_lifetime - mLife_elapsed)/zode_data->shrink_out_time;
zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.0f, 0.9f); zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.0f, 0.9f);
} }
zode_radius *= live_scale_factor; zode_radius *= mLive_scale_factor;
if (zode_data->respect_ori_cons && !zode_data->use_full_xfm) if (zode_data->respect_ori_cons && !zode_data->use_full_xfm)
{ {
VectorF shape_vec; VectorF shape_vec;
updated_xfm.getColumn(1, &shape_vec); mUpdated_xfm.getColumn(1, &shape_vec);
shape_vec.normalize(); shape_vec.normalize();
F32 ang; F32 ang;
@ -246,7 +246,7 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt)
zode_angle_offset = mRadToDeg(ang); zode_angle_offset = mRadToDeg(ang);
} }
F32 zode_angle = zode_data->calcRotationAngle(life_elapsed, datablock->rate_factor/prop_time_factor); F32 zode_angle = zode_data->calcRotationAngle(mLife_elapsed, mDatablock->rate_factor/ mProp_time_factor);
zode_angle = mFmod(zode_angle + zode_angle_offset, 360.0f); zode_angle = mFmod(zode_angle + zode_angle_offset, 360.0f);
aa_rot.angle = mDegToRad(zode_angle); aa_rot.angle = mDegToRad(zode_angle);
@ -258,13 +258,13 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt)
pzode->setRadius(zode_radius); pzode->setRadius(zode_radius);
if (zode_data->use_full_xfm) if (zode_data->use_full_xfm)
{ {
updated_xfm.mul(spin_xfm); mUpdated_xfm.mul(spin_xfm);
pzode->setTransform(updated_xfm); pzode->setTransform(mUpdated_xfm);
} }
else else
pzode->setTransform(spin_xfm); pzode->setTransform(spin_xfm);
pzode->setPosition(updated_pos); pzode->setPosition(mUpdated_pos);
pzode->setScale(updated_scale); pzode->setScale(mUpdated_scale);
} }
return true; return true;
@ -307,7 +307,7 @@ void afxEA_ZodiacPlane::do_runtime_substitutions()
// clone the datablock and perform substitutions // clone the datablock and perform substitutions
afxZodiacPlaneData* orig_db = zode_data; afxZodiacPlaneData* orig_db = zode_data;
zode_data = new afxZodiacPlaneData(*orig_db, true); zode_data = new afxZodiacPlaneData(*orig_db, true);
orig_db->performSubstitutions(zode_data, choreographer, group_index); orig_db->performSubstitutions(zode_data, mChoreographer, mGroup_index);
} }
} }

View file

@ -95,7 +95,7 @@ bool afxEA_Force::ea_start()
do_runtime_substitutions(); do_runtime_substitutions();
force_set_mgr = choreographer->getForceSetMgr(); force_set_mgr = mChoreographer->getForceSetMgr();
return true; return true;
} }
@ -109,7 +109,7 @@ bool afxEA_Force::ea_update(F32 dt)
{ {
delete force; delete force;
force = 0; force = 0;
Con::errorf(ConsoleLogEntry::General, "Force effect failed to instantiate. (%s)", datablock->getName()); Con::errorf(ConsoleLogEntry::General, "Force effect failed to instantiate. (%s)", mDatablock->getName());
return false; return false;
} }
force->onNewDataBlock(force_data, false); force->onNewDataBlock(force_data, false);
@ -123,8 +123,8 @@ bool afxEA_Force::ea_update(F32 dt)
if (force) // && in_scope) if (force) // && in_scope)
{ {
if (do_fades) if (mDo_fades)
force->setFadeAmount(fade_value); force->setFadeAmount(mFade_value);
force->update(dt); force->update(dt);
} }
@ -145,7 +145,7 @@ void afxEA_Force::ea_finish(bool was_stopped)
void afxEA_Force::do_runtime_substitutions() void afxEA_Force::do_runtime_substitutions()
{ {
force_data = force_data->cloneAndPerformSubstitutions(choreographer, group_index); force_data = force_data->cloneAndPerformSubstitutions(mChoreographer, mGroup_index);
} }
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//

View file

@ -60,13 +60,13 @@ class afxXM_AltitudeConform : public afxXM_WeightedBase
{ {
typedef afxXM_WeightedBase Parent; typedef afxXM_WeightedBase Parent;
afxXM_AltitudeConformData* db; afxXM_AltitudeConformData* mConformData;
SceneContainer* container; SceneContainer* mContainer;
bool do_freeze; bool mDo_freeze;
bool is_frozen; bool mIs_frozen;
F32 terrain_alt; F32 mTerrain_alt;
F32 interior_alt; F32 mInterior_alt;
Point3F conformed_pos; Point3F mConformed_pos;
public: public:
/*C*/ afxXM_AltitudeConform(afxXM_AltitudeConformData*, afxEffectWrapper*, bool on_server); /*C*/ afxXM_AltitudeConform(afxXM_AltitudeConformData*, afxEffectWrapper*, bool on_server);
@ -157,24 +157,24 @@ afxXM_Base* afxXM_AltitudeConformData::create(afxEffectWrapper* fx, bool on_serv
afxXM_AltitudeConform::afxXM_AltitudeConform(afxXM_AltitudeConformData* db, afxEffectWrapper* fxw, bool on_server) afxXM_AltitudeConform::afxXM_AltitudeConform(afxXM_AltitudeConformData* db, afxEffectWrapper* fxw, bool on_server)
: afxXM_WeightedBase(db, fxw) : afxXM_WeightedBase(db, fxw)
{ {
this->db = db; mConformData = db;
container = (on_server) ? &gServerContainer : &gClientContainer; mContainer = (on_server) ? &gServerContainer : &gClientContainer;
do_freeze = db->do_freeze; mDo_freeze = db->do_freeze;
is_frozen = false; mIs_frozen = false;
terrain_alt = -1.0f; mTerrain_alt = -1.0f;
interior_alt = -1.0f; mInterior_alt = -1.0f;
conformed_pos.zero(); mConformed_pos.zero();
} }
void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& params) void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& params)
{ {
if (is_frozen) if (mIs_frozen)
{ {
if (terrain_alt >= 0.0f) if (mTerrain_alt >= 0.0f)
fx_wrapper->setTerrainAltitude(terrain_alt); fx_wrapper->setTerrainAltitude(mTerrain_alt);
if (interior_alt >= 0.0f) if (mInterior_alt >= 0.0f)
fx_wrapper->setInteriorAltitude(interior_alt); fx_wrapper->setInteriorAltitude(mInterior_alt);
params.pos = conformed_pos; params.pos = mConformed_pos;
return; return;
} }
@ -185,53 +185,51 @@ void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& para
// find primary ground // find primary ground
Point3F above_pos(params.pos); above_pos.z += 0.1f; Point3F above_pos(params.pos); above_pos.z += 0.1f;
Point3F below_pos(params.pos); below_pos.z -= 10000; Point3F below_pos(params.pos); below_pos.z -= 10000;
hit1 = container->castRay(above_pos, below_pos, db->interior_types | db->terrain_types, &rInfo1); hit1 = mContainer->castRay(above_pos, below_pos, mConformData->interior_types | mConformData->terrain_types, &rInfo1);
// find secondary ground // find secondary ground
if (hit1 && rInfo1.object) if (hit1 && rInfo1.object)
{ {
hit1_is_interior = ((rInfo1.object->getTypeMask() & db->interior_types) != 0); hit1_is_interior = ((rInfo1.object->getTypeMask() & mConformData->interior_types) != 0);
U32 mask = (hit1_is_interior) ? db->terrain_types : db->interior_types; U32 mask = (hit1_is_interior) ? mConformData->terrain_types : mConformData->interior_types;
Point3F above_pos(params.pos); above_pos.z += 0.1f; hit2 = mContainer->castRay(above_pos, below_pos, mask, &rInfo2);
Point3F below_pos(params.pos); below_pos.z -= 10000;
hit2 = container->castRay(above_pos, below_pos, mask, &rInfo2);
} }
if (hit1) if (hit1)
{ {
F32 wt_factor = calc_weight_factor(elapsed); F32 wt_factor = calc_weight_factor(elapsed);
F32 incoming_z = params.pos.z; F32 incoming_z = params.pos.z;
F32 ground1_z = rInfo1.point.z + db->height; F32 ground1_z = rInfo1.point.z + mConformData->height;
F32 pos_z = ground1_z + (1.0f - wt_factor)*(incoming_z - ground1_z); F32 pos_z = ground1_z + (1.0f - wt_factor)*(incoming_z - ground1_z);
if (hit1_is_interior) if (hit1_is_interior)
{ {
interior_alt = incoming_z - pos_z; mInterior_alt = incoming_z - pos_z;
fx_wrapper->setInteriorAltitude(interior_alt); fx_wrapper->setInteriorAltitude(mInterior_alt);
if (db->do_interiors) if (mConformData->do_interiors)
params.pos.z = pos_z; params.pos.z = pos_z;
} }
else else
{ {
terrain_alt = incoming_z - pos_z; mTerrain_alt = incoming_z - pos_z;
fx_wrapper->setTerrainAltitude(terrain_alt); fx_wrapper->setTerrainAltitude(mTerrain_alt);
if (db->do_terrain) if (mConformData->do_terrain)
params.pos.z = pos_z; params.pos.z = pos_z;
} }
if (hit2) if (hit2)
{ {
F32 ground2_z = rInfo2.point.z + db->height; F32 ground2_z = rInfo2.point.z + mConformData->height;
F32 z2 = ground2_z + (1.0f - wt_factor)*(incoming_z - ground2_z); F32 z2 = ground2_z + (1.0f - wt_factor)*(incoming_z - ground2_z);
if (hit1_is_interior) if (hit1_is_interior)
{ {
terrain_alt = incoming_z - z2; mTerrain_alt = incoming_z - z2;
fx_wrapper->setTerrainAltitude(terrain_alt); fx_wrapper->setTerrainAltitude(mTerrain_alt);
} }
else else
{ {
interior_alt = incoming_z - z2; mInterior_alt = incoming_z - z2;
fx_wrapper->setInteriorAltitude(interior_alt); fx_wrapper->setInteriorAltitude(mInterior_alt);
} }
} }
@ -241,19 +239,19 @@ void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& para
RayInfo rInfo0; RayInfo rInfo0;
Point3F lookup_from_pos(params.pos); lookup_from_pos.z -= 0.1f; Point3F lookup_from_pos(params.pos); lookup_from_pos.z -= 0.1f;
Point3F lookup_to_pos(params.pos); lookup_to_pos.z += 10000; Point3F lookup_to_pos(params.pos); lookup_to_pos.z += 10000;
if (container->castRay(lookup_from_pos, lookup_to_pos, TerrainObjectType, &rInfo0)) if (mContainer->castRay(lookup_from_pos, lookup_to_pos, TerrainObjectType, &rInfo0))
{ {
F32 ground2_z = rInfo0.point.z + db->height; F32 ground2_z = rInfo0.point.z + mConformData->height;
F32 z2 = ground2_z + (1.0f - wt_factor)*(incoming_z - ground2_z); F32 z2 = ground2_z + (1.0f - wt_factor)*(incoming_z - ground2_z);
terrain_alt = z2 - incoming_z; mTerrain_alt = z2 - incoming_z;
fx_wrapper->setTerrainAltitude(terrain_alt); fx_wrapper->setTerrainAltitude(mTerrain_alt);
} }
} }
if (do_freeze) if (mDo_freeze)
{ {
conformed_pos = params.pos; mConformed_pos = params.pos;
is_frozen = true; mIs_frozen = true;
} }
} }
} }

View file

@ -63,11 +63,11 @@ class afxXM_MountedImageNode : public afxXM_Base
{ {
typedef afxXM_Base Parent; typedef afxXM_Base Parent;
StringTableEntry node_name; StringTableEntry mNode_name;
U32 image_slot; U32 mImage_slot;
S32 node_ID; S32 mNode_ID;
ShapeBase* shape; ShapeBase* mShape;
afxConstraint* cons; afxConstraint* mCons;
afxConstraint* find_constraint(); afxConstraint* find_constraint();
@ -163,11 +163,11 @@ afxXM_Base* afxXM_MountedImageNodeData::create(afxEffectWrapper* fx, bool on_ser
afxXM_MountedImageNode::afxXM_MountedImageNode(afxXM_MountedImageNodeData* db, afxEffectWrapper* fxw) afxXM_MountedImageNode::afxXM_MountedImageNode(afxXM_MountedImageNodeData* db, afxEffectWrapper* fxw)
: afxXM_Base(db, fxw) : afxXM_Base(db, fxw)
{ {
image_slot = db->image_slot; mImage_slot = db->image_slot;
node_name = db->node_name; mNode_name = db->node_name;
cons = 0; mCons = 0;
node_ID = -1; mNode_ID = -1;
shape = 0; mShape = 0;
} }
// find the first constraint with a shape by checking pos // find the first constraint with a shape by checking pos
@ -189,41 +189,41 @@ void afxXM_MountedImageNode::start(F32 timestamp)
{ {
// constraint won't change over the modifier's // constraint won't change over the modifier's
// lifetime so we find it here in start(). // lifetime so we find it here in start().
cons = find_constraint(); mCons = find_constraint();
if (!cons) if (!mCons)
Con::errorf(ConsoleLogEntry::General, Con::errorf(ConsoleLogEntry::General,
"afxXM_MountedImageNode: failed to find a ShapeBase derived constraint source."); "afxXM_MountedImageNode: failed to find a ShapeBase derived constraint source.");
} }
void afxXM_MountedImageNode::updateParams(F32 dt, F32 elapsed, afxXM_Params& params) void afxXM_MountedImageNode::updateParams(F32 dt, F32 elapsed, afxXM_Params& params)
{ {
if (!cons) if (!mCons)
return; return;
// validate shape // validate shape
// The shape must be validated in case it gets deleted // The shape must be validated in case it gets deleted
// of goes out scope. // of goes out scope.
SceneObject* scene_object = cons->getSceneObject(); SceneObject* scene_object = mCons->getSceneObject();
if (scene_object != (SceneObject*)shape) if (scene_object != (SceneObject*)mShape)
{ {
shape = dynamic_cast<ShapeBase*>(scene_object); mShape = dynamic_cast<ShapeBase*>(scene_object);
if (shape && node_name != ST_NULLSTRING) if (mShape && mNode_name != ST_NULLSTRING)
{ {
node_ID = shape->getNodeIndex(image_slot, node_name); mNode_ID = mShape->getNodeIndex(mImage_slot, mNode_name);
if (node_ID < 0) if (mNode_ID < 0)
{ {
Con::errorf(ConsoleLogEntry::General, Con::errorf(ConsoleLogEntry::General,
"afxXM_MountedImageNode: failed to find nodeName, \"%s\".", "afxXM_MountedImageNode: failed to find nodeName, \"%s\".",
node_name); mNode_name);
} }
} }
else else
node_ID = -1; mNode_ID = -1;
} }
if (shape) if (mShape)
{ {
shape->getImageTransform(image_slot, node_ID, &params.ori); mShape->getImageTransform(mImage_slot, mNode_ID, &params.ori);
params.pos = params.ori.getPosition(); params.pos = params.ori.getPosition();
} }
} }