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

@ -89,10 +89,10 @@ bool afxEA_AnimClip::ea_start()
do_runtime_substitutions();
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);
else
anim_lifetime = full_lifetime;
anim_lifetime = mFull_lifetime;
anim_tag = 0;
lock_tag = 0;
@ -127,8 +127,8 @@ bool afxEA_AnimClip::ea_update(F32 dt)
if (go_for_it)
{
F32 rate = clip_data->rate/prop_time_factor;
F32 pos = mFmod(life_elapsed, anim_lifetime)/anim_lifetime;
F32 rate = clip_data->rate/mProp_time_factor;
F32 pos = mFmod(mLife_elapsed, anim_lifetime)/anim_lifetime;
pos = mFmod(pos + clip_data->pos_offset, 1.0);
if (clip_data->rate < 0)
pos = 1.0f - pos;
@ -164,7 +164,7 @@ void afxEA_AnimClip::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxAnimClipData* orig_db = clip_data;
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
afxAreaDamageData* orig_db = damage_data;
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);
dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z);
Con::executef(choreographer->getDataBlock(), "onInflictedAreaDamage",
choreographer->getIdString(),
Con::executef(mChoreographer->getDataBlock(), "onInflictedAreaDamage",
mChoreographer->getIdString(),
damaged->getIdString(),
Con::getFloatArg(damage),
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);
Con::executef(shape, "damage",
choreographer->getIdString(),
mChoreographer->getIdString(),
posArg,
Con::getFloatArg(damage),
flavor);

View file

@ -125,8 +125,8 @@ bool afxEA_AudioBank::ea_update(F32 dt)
if (sound_handle)
{
sound_handle->setTransform(updated_xfm);
sound_handle->setVolume(updated_scale.x*fade_value);
sound_handle->setTransform(mUpdated_xfm);
sound_handle->setVolume(mUpdated_scale.x*mFade_value);
}
return true;
@ -143,7 +143,7 @@ void afxEA_AudioBank::ea_finish(bool was_stopped)
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);
///bb->setSequenceRateFactor(datablock->rate_factor/prop_time_factor);
bb->setSortPriority(datablock->sort_priority);
bb->setSortPriority(mDatablock->sort_priority);
}
if (bb)
{
bb->live_color = updated_color;
if (do_fades)
bb->live_color = mUpdated_color;
if (mDo_fades)
{
bb->setFadeAmount(fade_value);
bb->setFadeAmount(mFade_value);
}
bb->setTransform(updated_xfm);
bb->setScale(updated_scale);
bb->setTransform(mUpdated_xfm);
bb->setScale(mUpdated_scale);
}
return true;
@ -162,7 +162,7 @@ void afxEA_Billboard::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxBillboardData* orig_db = bb_data;
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();
afxConstraintID obj_id = cons_mgr->getConstraintId(puppet_data->cam_def);
cam_cons = cons_mgr->getConstraint(obj_id);
afxConstraintID obj_id = mCons_mgr->getConstraintId(puppet_data->cam_def);
cam_cons = mCons_mgr->getConstraint(obj_id);
SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0;
if (obj && obj->isClientObject())
@ -105,9 +105,9 @@ bool afxEA_CameraPuppet::ea_update(F32 dt)
{
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;
@ -153,7 +153,7 @@ void afxEA_CameraPuppet::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxCameraPuppetData* orig_db = puppet_data;
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 (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.");
return false;
@ -106,7 +106,7 @@ bool afxEA_CameraShake::ea_start()
if (dist < shake_data->camShakeRadius)
{
camera_shake = new CameraShake;
camera_shake->setDuration(full_lifetime);
camera_shake->setDuration(mFull_lifetime);
camera_shake->setFrequency(shake_data->camShakeFreq);
F32 falloff = dist/shake_data->camShakeRadius;
@ -161,7 +161,7 @@ void afxEA_CameraShake::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxCameraShakeData* orig_db = shake_data;
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();
set_shape((pos_constraint) ? dynamic_cast<ShapeBase*>(pos_constraint->getSceneObject()) : 0);
if (choreographer && trigger_mask != 0)
if (mChoreographer && trigger_mask != 0)
{
if (triggered)
{
choreographer->setTriggerMask(trigger_mask | choreographer->getTriggerMask());
mChoreographer->setTriggerMask(trigger_mask | mChoreographer->getTriggerMask());
triggered = false;
}
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
afxCollisionEventData* orig_db = script_data;
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)
{
if (obj0 != shape || !choreographer || !choreographer->getDataBlock())
if (obj0 != shape || !mChoreographer || !mChoreographer->getDataBlock())
return;
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);
// CALL SCRIPT afxChoreographerData::method(%spell, %obj0, %obj1, %velocity)
Con::executef(choreographer->getDataBlock(), script_data->method_name,
choreographer->getIdString(),
Con::executef(mChoreographer->getDataBlock(), script_data->method_name,
mChoreographer->getIdString(),
(obj0) ? obj0->getIdString() : "",
(obj1) ? obj1->getIdString() : "",
arg_buf,

View file

@ -98,7 +98,7 @@ void afxEA_ConsoleMessage::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxConsoleMessageData* orig_db = message_data;
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)
{
dot_delta_ms = full_lifetime/(damage_data->repeats - 1);
dot_delta_ms = mFull_lifetime /(damage_data->repeats - 1);
next_dot_time = dot_delta_ms;
}
@ -122,15 +122,15 @@ bool afxEA_Damage::ea_update(F32 dt)
if (aim_cons && aim_cons->getSceneObject())
impacted_obj_id = aim_cons->getSceneObject()->getId();
if (choreographer)
choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
if (mChoreographer)
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,
damage_data->impulse);
repeat_cnt++;
}
else if (repeat_cnt < damage_data->repeats)
{
if (next_dot_time <= life_elapsed)
if (next_dot_time <= mLife_elapsed)
{
// CONSTRAINT REMAPPING <<
afxConstraint* aim_cons = getAimConstraint();
@ -138,8 +138,8 @@ bool afxEA_Damage::ea_update(F32 dt)
impacted_obj_id = aim_cons->getSceneObject()->getId();
// CONSTRAINT REMAPPING >>
if (choreographer)
choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
if (mChoreographer)
mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
repeat_cnt, 0, 0, impact_pos, 0);
next_dot_time += dot_delta_ms;
repeat_cnt++;
@ -153,10 +153,10 @@ void afxEA_Damage::ea_finish(bool was_stopped)
{
if (started && (repeat_cnt < damage_data->repeats))
{
if (next_dot_time <= life_elapsed)
if (next_dot_time <= mLife_elapsed)
{
if (choreographer)
choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
if (mChoreographer)
mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount,
repeat_cnt, 0, 0, impact_pos, 0);
}
}
@ -172,7 +172,7 @@ void afxEA_Damage::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxDamageData* orig_db = damage_data;
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()
{
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)
@ -106,21 +106,21 @@ bool afxEA_Debris::ea_update(F32 dt)
{
if (exploded && debris)
{
if (in_scope)
if (mIn_scope)
{
updated_xfm = debris->getRenderTransform();
updated_xfm.getColumn(3, &updated_pos);
mUpdated_xfm = debris->getRenderTransform();
mUpdated_xfm.getColumn(3, &mUpdated_pos);
}
}
if (!exploded && debris)
{
if (in_scope)
if (mIn_scope)
{
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())
{
delete debris;
@ -165,7 +165,7 @@ void afxEA_Debris::do_runtime_substitutions()
// clone the datablock and perform substitutions
DebrisData* orig_db = debris_data;
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();
explosion = new Explosion();
explosion->setSubstitutionData(choreographer, group_index);
explosion->setSubstitutionData(mChoreographer, mGroup_index);
explosion->setDataBlock(explosion_data);
return true;
@ -91,10 +91,10 @@ bool afxEA_Explosion::ea_update(F32 dt)
{
if (!exploded && explosion)
{
if (in_scope)
if (mIn_scope)
{
Point3F norm(0,0,1); updated_xfm.mulV(norm);
explosion->setInitialState(updated_pos, norm);
Point3F norm(0,0,1); mUpdated_xfm.mulV(norm);
explosion->setInitialState(mUpdated_pos, norm);
if (!explosion->registerObject())
{
delete explosion;
@ -117,7 +117,7 @@ void afxEA_Explosion::ea_finish(bool was_stopped)
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
afxFootSwitchData* orig_db = footfall_data;
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)
{
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();
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)
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)
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)
gui_control->setFadeAmount(fade_value);
if (mDo_fades)
gui_control->setFadeAmount(mFade_value);
return true;
}
@ -182,7 +182,7 @@ void afxEA_GuiController::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxGuiControllerData* orig_db = controller_data;
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:
{
LinearColorF temp_clr = text_clr;
if (do_fades)
temp_clr.alpha = fade_value;
afxGuiTextHud::addTextItem(updated_pos, text_data->text_str, temp_clr);
if (mDo_fades)
temp_clr.alpha = mFade_value;
afxGuiTextHud::addTextItem(mUpdated_pos, text_data->text_str, temp_clr);
}
break;
case SHAPE_NAME:
@ -127,9 +127,9 @@ bool afxEA_GuiText::ea_update(F32 dt)
if (name && name[0] != '\0')
{
LinearColorF temp_clr = text_clr;
if (do_fades)
temp_clr.alpha = fade_value;
afxGuiTextHud::addTextItem(updated_pos, name, temp_clr, cons_obj);
if (mDo_fades)
temp_clr.alpha = mFade_value;
afxGuiTextHud::addTextItem(mUpdated_pos, name, temp_clr, cons_obj);
}
}
break;
@ -146,7 +146,7 @@ void afxEA_GuiText::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxGuiTextData* orig_db = text_data;
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)
{
start_time = elapsed;
start_time = mElapsed;
shooting = true;
}
else
{
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();
next_shot += shot_gap;
shot_count++;
@ -141,7 +141,7 @@ void afxEA_MachineGun::launch_projectile()
if (bullet_data->getSubstitutionCount() > 0)
{
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);
@ -151,10 +151,10 @@ void afxEA_MachineGun::launch_projectile()
afxConstraint* pos_cons = getPosConstraint();
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 *= muzzle_vel;
projectile->init(updated_pos, dir_vec, src_obj);
projectile->init(mUpdated_pos, dir_vec, src_obj);
if (!projectile->registerObject())
{
delete projectile;
@ -162,7 +162,7 @@ void afxEA_MachineGun::launch_projectile()
Con::errorf("afxEA_MachineGun::launch_projectile() -- projectile failed to register.");
}
if (projectile)
projectile->setDataField(StringTable->insert("afxOwner"), 0, choreographer->getIdString());
projectile->setDataField(StringTable->insert("afxOwner"), 0, mChoreographer->getIdString());
}
void afxEA_MachineGun::do_runtime_substitutions()
@ -173,7 +173,7 @@ void afxEA_MachineGun::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxMachineGunData* orig_db = gun_data;
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);
model->setSequenceRateFactor(datablock->rate_factor/prop_time_factor);
model->setSortPriority(datablock->sort_priority);
model->setSequenceRateFactor(mDatablock->rate_factor/ mProp_time_factor);
model->setSortPriority(mDatablock->sort_priority);
}
if (model)
{
if (do_fades)
if (mDo_fades)
{
model->setFadeAmount(fade_value);
model->setFadeAmount(mFade_value);
}
model->setTransform(updated_xfm);
model->setScale(updated_scale);
model->setTransform(mUpdated_xfm);
model->setScale(mUpdated_scale);
}
return true;
@ -141,10 +141,10 @@ void afxEA_Model::ea_finish(bool was_stopped)
if (!model)
return;
if (in_scope && ew_timing.residue_lifetime > 0)
if (mIn_scope && mEW_timing.residue_lifetime > 0)
{
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;
}
else
@ -203,7 +203,7 @@ void afxEA_Model::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxModelData* orig_db = model_data;
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 (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,
choreographer->getChoreographerId(),
datablock->effect_name);
mChoreographer->getChoreographerId(),
mDatablock->effect_name);
}
else
{
@ -116,7 +116,7 @@ bool afxEA_Mooring::ea_update(F32 dt)
if (obj)
{
obj->setTransform(updated_xfm);
obj->setTransform(mUpdated_xfm);
}
return true;
@ -142,7 +142,7 @@ void afxEA_Mooring::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxMooringData* orig_db = mooring_data;
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();
pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer);
pe->setAFXOwner(mChoreographer);
emitter = pe;
}
else if (dynamic_cast<afxParticleEmitterConeData*>(emitter_data))
{
afxParticleEmitterCone* pe = new afxParticleEmitterCone();
pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer);
pe->setAFXOwner(mChoreographer);
emitter = pe;
}
else if (dynamic_cast<afxParticleEmitterPathData*>(emitter_data))
{
afxParticleEmitterPath* pe = new afxParticleEmitterPath();
pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer);
pe->setAFXOwner(mChoreographer);
emitter = pe;
}
else if (dynamic_cast<afxParticleEmitterDiscData*>(emitter_data))
{
afxParticleEmitterDisc* pe = new afxParticleEmitterDisc();
pe->onNewDataBlock(afx_emitter_db, false);
pe->setAFXOwner(choreographer);
pe->setAFXOwner(mChoreographer);
emitter = pe;
}
}
@ -120,7 +120,7 @@ bool afxEA_ParticleEmitter::ea_start()
// here we find or create any required particle-pools
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)
{
afxParticlePoolData* pool_data = emitter_data->pool_datablock;
@ -129,7 +129,7 @@ bool afxEA_ParticleEmitter::ea_start()
// clone the datablock and perform substitutions
afxParticlePoolData* orig_db = pool_data;
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();
@ -143,8 +143,8 @@ bool afxEA_ParticleEmitter::ea_start()
}
if (pool)
{
pool->setChoreographer(choreographer);
choreographer->registerParticlePool(pool);
pool->setChoreographer(mChoreographer);
mChoreographer->registerParticlePool(pool);
}
}
if (pool)
@ -160,12 +160,12 @@ bool afxEA_ParticleEmitter::ea_start()
return false;
}
if (datablock->forced_bbox.isValidBox())
if (mDatablock->forced_bbox.isValidBox())
{
do_bbox_update = true;
}
emitter->setSortPriority(datablock->sort_priority);
emitter->setSortPriority(mDatablock->sort_priority);
deleteNotify(emitter);
return true;
@ -173,26 +173,26 @@ bool afxEA_ParticleEmitter::ea_start()
bool afxEA_ParticleEmitter::ea_update(F32 dt)
{
if (emitter && in_scope)
if (emitter && mIn_scope)
{
if (do_bbox_update)
{
Box3F bbox = emitter->getObjBox();
bbox.minExtents = updated_pos + datablock->forced_bbox.minExtents;
bbox.maxExtents = updated_pos + datablock->forced_bbox.maxExtents;
bbox.minExtents = mUpdated_pos + mDatablock->forced_bbox.minExtents;
bbox.maxExtents = mUpdated_pos + mDatablock->forced_bbox.maxExtents;
emitter->setForcedObjBox(bbox);
emitter->setTransform(emitter->getTransform());
if (!datablock->update_forced_bbox)
if (!mDatablock->update_forced_bbox)
do_bbox_update = false;
}
if (do_fades)
emitter->setFadeAmount(fade_value);
if (mDo_fades)
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;
@ -209,7 +209,7 @@ void afxEA_ParticleEmitter::ea_finish(bool was_stopped)
// note - fully faded particles are not always
// invisible, so they are still kept alive and
// deleted via deleteWhenEmpty().
if (ew_timing.fade_out_time > 0.0f)
if (mEW_timing.fade_out_time > 0.0f)
emitter->setFadeAmount(0.0f);
if (dynamic_cast<afxParticleEmitter*>(emitter))
((afxParticleEmitter*)emitter)->setAFXOwner(0);
@ -240,32 +240,32 @@ void afxEA_ParticleEmitter::do_runtime_substitutions()
{
afxParticleEmitterVectorData* orig_db = (afxParticleEmitterVectorData*)emitter_data;
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))
{
afxParticleEmitterConeData* orig_db = (afxParticleEmitterConeData*)emitter_data;
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))
{
afxParticleEmitterPathData* orig_db = (afxParticleEmitterPathData*)emitter_data;
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))
{
afxParticleEmitterDiscData* orig_db = (afxParticleEmitterDiscData*)emitter_data;
emitter_data = new afxParticleEmitterDiscData(*orig_db, true);
orig_db->performSubstitutions(emitter_data, choreographer, group_index);
orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index);
}
}
else
{
ParticleEmitterData* orig_db = emitter_data;
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)
@ -277,7 +277,7 @@ void afxEA_ParticleEmitter::do_runtime_substitutions()
// clone the datablock and perform substitutions
ParticleData* orig_db = emitter_data->particleDataBlocks[i];
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)
{
if (fade_value >= 1.0f)
if (mFade_value >= 1.0f)
{
//
// Choreographer Triggers:
@ -145,7 +145,7 @@ bool afxEA_PhraseEffect::ea_update(F32 dt)
// They must be set explicitly by calls to afxChoreographer
// 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:
@ -191,7 +191,7 @@ bool afxEA_PhraseEffect::ea_update(F32 dt)
{
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++)
{
(*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
afxPhraseEffectData* orig_db = phrase_fx_data;
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);
bool will_stop = phrase_fx_data->phrase_type == afxPhraseEffectData::PHRASE_CONTINUOUS;
afxPhrase* phrase = new afxPhrase(choreographer->isServerObject(), will_stop);
phrase->init(phrase_fx_data->fx_list, datablock->ewd_timing.lifetime, choreographer, time_factor, phrase_fx_data->n_loops, group_index);
afxPhrase* phrase = new afxPhrase(mChoreographer->isServerObject(), will_stop);
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);
if (phrase->isEmpty())
{
@ -272,10 +272,10 @@ void afxEA_PhraseEffect::trigger_new_phrase()
if (phrase_fx_data->on_trig_cmd != ST_NULLSTRING)
{
char obj_str[32];
dStrcpy(obj_str, Con::getIntArg(choreographer->getId()), 32);
dStrcpy(obj_str, Con::getIntArg(mChoreographer->getId()), 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* b = buffer;
@ -331,9 +331,9 @@ void afxEA_PhraseEffect::update_active_phrases(F32 dt)
for (S32 i = 0; i < active_phrases->size(); i++)
{
afxPhrase* phrase = (*active_phrases)[i];
if (phrase->expired(life_elapsed))
phrase->recycle(life_elapsed);
phrase->update(dt, life_elapsed);
if (phrase->expired(mLife_elapsed))
phrase->recycle(mLife_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);
}
if (do_fades)
physical_zone->setFadeAmount(fade_value);
physical_zone->setTransform(updated_xfm);
if (mDo_fades)
physical_zone->setFadeAmount(mFade_value);
physical_zone->setTransform(mUpdated_xfm);
}
return true;
@ -172,7 +172,7 @@ void afxEA_PhysicalZone::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxPhysicalZoneData* orig_db = zone_data;
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
afxPlayerMovementData* orig_db = movement_data;
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();
afxConstraintID obj_id = cons_mgr->getConstraintId(mover_data->obj_def);
obj_cons = cons_mgr->getConstraint(obj_id);
afxConstraintID obj_id = mCons_mgr->getConstraintId(mover_data->obj_def);
obj_cons = mCons_mgr->getConstraint(obj_id);
Player* player = dynamic_cast<Player*>((obj_cons) ? obj_cons->getSceneObject() : 0);
if (player)
@ -94,9 +94,9 @@ bool afxEA_PlayerPuppet::ea_update(F32 dt)
{
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;
@ -138,7 +138,7 @@ void afxEA_PlayerPuppet::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxPlayerPuppetData* orig_db = mover_data;
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);
#endif
light->setLiveColor(updated_color);
light->setLiveColor(mUpdated_color);
if (do_fades)
light->setFadeAmount(fade_value*updated_scale.x);
if (mDo_fades)
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.
//light->setScale(updated_scale);
@ -254,7 +254,7 @@ void afxEA_T3DPointLight::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxT3DPointLightData* orig_db = light_data;
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()
{
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)
@ -117,8 +117,8 @@ bool afxEA_Projectile::ea_start()
}
else
{
if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING)
projectile = new afxProjectile(afx_projectile_data->networking, choreographer->getChoreographerId(), datablock->effect_name);
if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING)
projectile = new afxProjectile(afx_projectile_data->networking, mChoreographer->getChoreographerId(), mDatablock->effect_name);
else
projectile = new afxProjectile(afx_projectile_data->networking, 0, ST_NULLSTRING);
projectile->ignoreSourceTimeout = afx_projectile_data->ignore_src_timeout;
@ -127,8 +127,8 @@ bool afxEA_Projectile::ea_start()
projectile->dynamicCollisionMask = afx_projectile_data->dynamicCollisionMask;
projectile->staticCollisionMask = afx_projectile_data->staticCollisionMask;
}
afxConstraintID launch_pos_id = cons_mgr->getConstraintId(afx_projectile_data->launch_pos_def);
launch_cons = cons_mgr->getConstraint(launch_pos_id);
afxConstraintID launch_pos_id = mCons_mgr->getConstraintId(afx_projectile_data->launch_pos_def);
launch_cons = mCons_mgr->getConstraint(launch_pos_id);
launch_dir_bias = afx_projectile_data->launch_dir_bias;
}
@ -141,7 +141,7 @@ bool afxEA_Projectile::ea_update(F32 dt)
{
if (!launched && projectile)
{
if (in_scope)
if (mIn_scope)
{
afxConstraint* pos_cons = getPosConstraint();
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:
dir_vec.set(0,0,1);
updated_xfm.mulV(dir_vec);
mUpdated_xfm.mulV(dir_vec);
break;
case afxProjectileData::LaunchDirField:
dir_vec.set(0,0,1);
break;
case afxProjectileData::TowardPos2Constraint:
default:
dir_vec = updated_aim - updated_pos;
dir_vec = mUpdated_aim - mUpdated_pos;
break;
}
}
else
dir_vec = updated_aim - updated_pos;
dir_vec = mUpdated_aim - mUpdated_pos;
dir_vec.normalizeSafe();
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);
}
else
projectile->init(updated_pos, dir_vec, src_obj);
projectile->init(mUpdated_pos, dir_vec, src_obj);
if (!projectile->registerObject())
{
@ -197,7 +197,7 @@ bool afxEA_Projectile::ea_update(F32 dt)
deleteNotify(projectile);
if (projectile)
projectile->setDataField(StringTable->insert("afxOwner"), 0, choreographer->getIdString());
projectile->setDataField(StringTable->insert("afxOwner"), 0, mChoreographer->getIdString());
}
launched = true;
@ -205,10 +205,10 @@ bool afxEA_Projectile::ea_update(F32 dt)
if (launched && projectile)
{
if (in_scope)
if (mIn_scope)
{
updated_xfm = projectile->getRenderTransform();
updated_xfm.getColumn(3, &updated_pos);
mUpdated_xfm = projectile->getRenderTransform();
mUpdated_xfm.getColumn(3, &mUpdated_pos);
}
}
@ -247,7 +247,7 @@ void afxEA_Projectile::do_runtime_substitutions()
afxProjectileData* orig_db = (afxProjectileData*)projectile_data;
afx_projectile_data = new afxProjectileData(*orig_db, true);
projectile_data = afx_projectile_data;
orig_db->performSubstitutions(projectile_data, choreographer, group_index);
orig_db->performSubstitutions(projectile_data, mChoreographer, mGroup_index);
}
else
{
@ -255,7 +255,7 @@ void afxEA_Projectile::do_runtime_substitutions()
ProjectileData* orig_db = projectile_data;
afx_projectile_data = 0;
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)
{
if (!ran_script && choreographer != NULL)
if (!ran_script && mChoreographer != NULL)
{
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);
ran_script = true;
}
@ -115,7 +115,7 @@ void afxEA_ScriptEvent::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxScriptEventData* orig_db = script_data;
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)
{
sound_handle = SFX->createSource(sound_prof, &updated_xfm, 0);
sound_handle = SFX->createSource(sound_prof, &mUpdated_xfm, 0);
if (sound_handle)
sound_handle->play();
}
if (sound_handle)
{
sound_handle->setTransform(updated_xfm);
sound_handle->setVolume((in_scope) ? updated_scale.x*fade_value : 0.0f);
sound_handle->setTransform(mUpdated_xfm);
sound_handle->setVolume((mIn_scope) ? mUpdated_scale.x*mFade_value : 0.0f);
deleteNotify(sound_handle);
}
@ -134,7 +134,7 @@ void afxEA_Sound::ea_finish(bool was_stopped)
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();
}

View file

@ -207,12 +207,12 @@ bool afxEA_T3DSpotLight::ea_update(F32 dt)
light->setConstraintObject(cons_obj);
#endif
light->setLiveColor(updated_color);
light->setLiveColor(mUpdated_color);
if (do_fades)
light->setFadeAmount(fade_value);
if (mDo_fades)
light->setFadeAmount(mFade_value);
light->updateTransform(updated_xfm);
light->updateTransform(mUpdated_xfm);
// scale should not be updated this way. It messes up the culling.
//light->setScale(updated_scale);
@ -258,7 +258,7 @@ void afxEA_T3DSpotLight::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxT3DSpotLightData* orig_db = light_data;
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();
// fades are handled using startFade() calls.
do_fades = false;
mDo_fades = false;
return true;
}
@ -108,8 +108,8 @@ bool afxEA_StaticShape::ea_update(F32 dt)
{
// create and register effect
static_shape = new afxStaticShape();
if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING)
static_shape->init(choreographer->getChoreographerId(), datablock->effect_name);
if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING)
static_shape->init(mChoreographer->getChoreographerId(), mDatablock->effect_name);
static_shape->onNewDataBlock(shape_data, false);
if (!static_shape->registerObject())
@ -122,26 +122,26 @@ bool afxEA_StaticShape::ea_update(F32 dt)
deleteNotify(static_shape);
registerForCleanup(static_shape);
if (ew_timing.fade_in_time > 0.0f)
static_shape->startFade(ew_timing.fade_in_time, 0, false);
if (mEW_timing.fade_in_time > 0.0f)
static_shape->startFade(mEW_timing.fade_in_time, 0, false);
}
if (static_shape)
{
if (!fade_out_started && elapsed > fade_out_start)
if (!fade_out_started && mElapsed > mFade_out_start)
{
if (!do_spawn)
{
if (ew_timing.fade_out_time > 0.0f)
static_shape->startFade(ew_timing.fade_out_time, 0, true);
if (mEW_timing.fade_out_time > 0.0f)
static_shape->startFade(mEW_timing.fade_out_time, 0, true);
}
fade_out_started = true;
}
if (in_scope)
if (mIn_scope)
{
static_shape->setTransform(updated_xfm);
static_shape->setScale(updated_scale);
static_shape->setTransform(mUpdated_xfm);
static_shape->setScale(mUpdated_scale);
}
}
@ -155,7 +155,7 @@ void afxEA_StaticShape::ea_finish(bool was_stopped)
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);
}
else
@ -204,13 +204,13 @@ void afxEA_StaticShape::do_runtime_substitutions()
{
afxStaticShapeData* orig_db = (afxStaticShapeData*)shape_data;
shape_data = new afxStaticShapeData(*orig_db, true);
orig_db->performSubstitutions(shape_data, choreographer, group_index);
orig_db->performSubstitutions(shape_data, mChoreographer, mGroup_index);
}
else
{
StaticShapeData* orig_db = shape_data;
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()
{
if (terrain_altitude >= zode_data->altitude_max)
if (mTerrain_altitude >= zode_data->altitude_max)
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()
{
if (interior_altitude >= zode_data->altitude_max)
if (mInterior_altitude >= zode_data->altitude_max)
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()
@ -170,13 +170,13 @@ bool afxEA_Zodiac::ea_start()
bool afxEA_Zodiac::ea_update(F32 dt)
{
if (!in_scope)
if (!mIn_scope)
return true;
//~~~~~~~~~~~~~~~~~~~~//
// Zodiac Color
zode_color = updated_color;
zode_color = mUpdated_color;
if (live_color_factor > 0.0)
{
@ -190,15 +190,15 @@ bool afxEA_Zodiac::ea_update(F32 dt)
//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
if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE)
zode_color *= fade_value*live_fade_factor;
zode_color *= mFade_value * mLive_fade_factor;
else
zode_color.alpha *= fade_value*live_fade_factor;
zode_color.alpha *= mFade_value * mLive_fade_factor;
}
if (zode_color.alpha < 0.01f)
@ -208,22 +208,22 @@ bool afxEA_Zodiac::ea_update(F32 dt)
// Zodiac
// 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
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 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 *= live_scale_factor;
zode_radius *= mLive_scale_factor;
if (zode_radius < 0.001f)
return true; // too small
@ -238,7 +238,7 @@ bool afxEA_Zodiac::ea_update(F32 dt)
//~~~~~~~~~~~~~~~~~~~~//
// Zodiac Position
zode_pos = updated_pos;
zode_pos = mUpdated_pos;
//~~~~~~~~~~~~~~~~~~~~//
// Zodiac Rotation
@ -249,7 +249,7 @@ bool afxEA_Zodiac::ea_update(F32 dt)
if (orient_constraint)
{
VectorF shape_vec;
updated_xfm.getColumn(1, &shape_vec);
mUpdated_xfm.getColumn(1, &shape_vec);
shape_vec.z = 0.0f;
shape_vec.normalize();
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);
//~~~~~~~~~~~~~~~~~~~~//
// post zodiac
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();
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 (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();
if (alt_bias > 0.0f)
@ -310,17 +310,17 @@ bool afxEA_Zodiac::ea_update(F32 dt)
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;
zode_color.alpha *= fade_value;
zode_color.alpha *= mFade_value;
}
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();
if (alt_bias > 0.0f)
@ -332,20 +332,20 @@ void afxEA_Zodiac::ea_finish(bool was_stopped)
if (zode_data->altitude_fades)
zode_color.alpha *= alt_bias;
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);
}
}
else
{
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);
}
}
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();
if (alt_bias > 0.0f)
@ -361,7 +361,7 @@ void afxEA_Zodiac::ea_finish(bool was_stopped)
if (became_residue)
temp_zode = new afxZodiacData(*zode_data, 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);
}
@ -372,7 +372,7 @@ void afxEA_Zodiac::ea_finish(bool was_stopped)
if (became_residue)
temp_zode = new afxZodiacData(*zode_data, 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);
}
}
@ -387,7 +387,7 @@ void afxEA_Zodiac::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxZodiacData* orig_db = zode_data;
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)
{
//LinearColorF zode_color = zode_data->color;
LinearColorF zode_color = updated_color;
LinearColorF zode_color = mUpdated_color;
if (live_color_factor > 0.0)
zode_color.interpolate(zode_color, live_color, live_color_factor);
if (do_fades)
if (mDo_fades)
{
if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE)
zode_color *= fade_value*live_fade_factor;
zode_color *= mFade_value *mLive_fade_factor;
else
zode_color.alpha *= fade_value*live_fade_factor;
zode_color.alpha *= mFade_value * mLive_fade_factor;
}
// 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 + life_elapsed*zode_data->growth_rate;
F32 zode_radius = zode_data->radius_xy + mLife_elapsed *zode_data->growth_rate;
// 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 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 *= live_scale_factor;
zode_radius *= mLive_scale_factor;
if (zode_data->respect_ori_cons && !zode_data->use_full_xfm)
{
VectorF shape_vec;
updated_xfm.getColumn(1, &shape_vec);
mUpdated_xfm.getColumn(1, &shape_vec);
shape_vec.normalize();
F32 ang;
@ -246,7 +246,7 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt)
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);
aa_rot.angle = mDegToRad(zode_angle);
@ -258,13 +258,13 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt)
pzode->setRadius(zode_radius);
if (zode_data->use_full_xfm)
{
updated_xfm.mul(spin_xfm);
pzode->setTransform(updated_xfm);
mUpdated_xfm.mul(spin_xfm);
pzode->setTransform(mUpdated_xfm);
}
else
pzode->setTransform(spin_xfm);
pzode->setPosition(updated_pos);
pzode->setScale(updated_scale);
pzode->setPosition(mUpdated_pos);
pzode->setScale(mUpdated_scale);
}
return true;
@ -307,7 +307,7 @@ void afxEA_ZodiacPlane::do_runtime_substitutions()
// clone the datablock and perform substitutions
afxZodiacPlaneData* orig_db = zode_data;
zode_data = new afxZodiacPlaneData(*orig_db, true);
orig_db->performSubstitutions(zode_data, choreographer, group_index);
orig_db->performSubstitutions(zode_data, mChoreographer, mGroup_index);
}
}