本文整理汇总了C++中SmartScriptTable::EndSetGetChain方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartScriptTable::EndSetGetChain方法的具体用法?C++ SmartScriptTable::EndSetGetChain怎么用?C++ SmartScriptTable::EndSetGetChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartScriptTable
的用法示例。
在下文中一共展示了SmartScriptTable::EndSetGetChain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadParamsTable
//.........这里部分代码省略.........
if(bc.MinAttractDistance <=0.05f)
bc.MinAttractDistance = 0.05f;
if(bc.MaxAttractDistance <=bc.MinAttractDistance)
bc.MaxAttractDistance =bc.MinAttractDistance +0.05f;
pTable->GetValueChain( "min_speed",bc.MinSpeed );
pTable->GetValueChain( "max_speed",bc.MaxSpeed );
pTable->GetValueChain( "factor_align",bc.factorAlignment );
pTable->GetValueChain( "factor_cohesion",bc.factorCohesion );
pTable->GetValueChain( "factor_separation",bc.factorSeparation );
pTable->GetValueChain( "factor_origin",bc.factorAttractToOrigin );
pTable->GetValueChain( "factor_keep_height",bc.factorKeepHeight );
pTable->GetValueChain( "factor_avoid_land",bc.factorAvoidLand );
pTable->GetValueChain( "factor_random_accel",bc.factorRandomAccel );
pTable->GetValueChain( "flight_time",bc.flightTime );
pTable->GetValueChain( "factor_take_off",bc.factorTakeOff );
pTable->GetValueChain( "land_deceleration_height",bc.landDecelerationHeight);
pTable->GetValueChain( "max_anim_speed",bc.MaxAnimationSpeed );
pTable->GetValueChain( "follow_player",bc.followPlayer );
pTable->GetValueChain( "no_landing",bc.noLanding );
pTable->GetValueChain( "start_on_ground",bc.bStartOnGround );
pTable->GetValueChain( "avoid_water",bc.bAvoidWater );
pTable->GetValueChain( "avoid_obstacles",bc.avoidObstacles );
pTable->GetValueChain( "max_view_distance",bc.maxVisibleDistance );
pTable->GetValueChain( "max_animation_distance",bc.animationMaxDistanceSq);
bc.animationMaxDistanceSq *= bc.animationMaxDistanceSq;
pTable->GetValueChain( "spawn_from_point", bc.bSpawnFromPoint );
pTable->GetValueChain( "pickable_alive", bc.bPickableWhenAlive );
pTable->GetValueChain( "pickable_dead", bc.bPickableWhenDead );
pTable->GetValueChain( "pickable_message", bc.pickableMessage );
pTable->GetValueChain( "spawn_radius",bc.fSpawnRadius);
//pTable->GetValueChain( "boid_radius",bc.fBoidRadius);
pTable->GetValueChain( "gravity_at_death",bc.fGravity);
pTable->GetValueChain( "boid_mass",bc.fBoidMass);
if (pTable->GetValueChain( "fov_angle",fval ))
{
fval = fval/2.0f; // Half angle used for cos of fov.
bc.cosFovAngle = cos_tpl(fval*gf_PI/180.0f);
}
pTable->GetValueChain("invulnerable", bc.bInvulnerable);
SmartScriptTable groundTable;
if (pTable->GetValueChain("ground",groundTable))
{
groundTable->BeginSetGetChain();
groundTable->GetValueChain( "factor_align",bc.factorAlignmentGround );
groundTable->GetValueChain( "factor_cohesion",bc.factorCohesionGround );
groundTable->GetValueChain( "factor_separation",bc.factorSeparationGround );
groundTable->GetValueChain( "factor_origin",bc.factorAttractToOriginGround );
groundTable->GetValueChain( "walk_speed",bc.walkSpeed);
groundTable->GetValueChain( "offset",bc.groundOffset);
groundTable->GetValueChain( "walk_to_idle_duration",bc.fWalkToIdleDuration);
groundTable->GetValueChain( "on_ground_idle_duration_min",bc.fOnGroundIdleDurationMin);
groundTable->GetValueChain( "on_ground_idle_duration_max",bc.fOnGroundIdleDurationMax);
groundTable->GetValueChain( "on_ground_walk_duration_min",bc.fOnGroundWalkDurationMin);
groundTable->GetValueChain( "on_ground_walk_duration_max",bc.fOnGroundWalkDurationMax);
groundTable->EndSetGetChain();
}
SmartScriptTable audio;
if (pTable->GetValueChain("Audio", audio))
{
bc.audio.clear();
for (int i = 1; i < audio->Count(); ++i)
{
str = "";
if (audio->GetAt(i, str))
{
TAudioControlID audioControlID = INVALID_AUDIO_CONTROL_ID;
gEnv->pAudioSystem->GetAudioTriggerID(str, audioControlID);
bc.audio.push_back(audioControlID);
}
}
}
SmartScriptTable animations;
if (pTable->GetValueChain("Animations",animations))
{
bc.animations.clear(); // related to CE-1736: clear contents from a previous call
for (int i = 1; i < 100; i++)
{
str = "";
if (animations->GetAt(i,str))
{
bc.animations.push_back(str);
}
else
break;
}
}
pTable->EndSetGetChain();
return true;
}
示例2: ReadParamsTable
//.........这里部分代码省略.........
}
pTable->GetValueChain( "behavior",bc.behavior );
pTable->GetValueChain( "boid_mass",bc.fBoidMass);
pTable->GetValueChain( "boid_size",bc.boidScale );
pTable->GetValueChain( "boid_size_random",bc.boidRandomScale );
pTable->GetValueChain( "min_height",bc.MinHeight );
pTable->GetValueChain( "max_height",bc.MaxHeight );
pTable->GetValueChain( "min_attract_distance",bc.MinAttractDistance );
pTable->GetValueChain( "max_attract_distance",bc.MaxAttractDistance );
if(bc.MinAttractDistance <=0.05f)
bc.MinAttractDistance = 0.05f;
if(bc.MaxAttractDistance <=bc.MinAttractDistance)
bc.MaxAttractDistance =bc.MinAttractDistance +0.05f;
pTable->GetValueChain( "min_speed",bc.MinSpeed );
pTable->GetValueChain( "max_speed",bc.MaxSpeed );
pTable->GetValueChain( "factor_align",bc.factorAlignment );
pTable->GetValueChain( "factor_cohesion",bc.factorCohesion );
pTable->GetValueChain( "factor_separation",bc.factorSeparation );
pTable->GetValueChain( "factor_origin",bc.factorAttractToOrigin );
pTable->GetValueChain( "factor_keep_height",bc.factorKeepHeight );
pTable->GetValueChain( "factor_avoid_land",bc.factorAvoidLand );
pTable->GetValueChain( "factor_random_accel",bc.factorRandomAccel );
pTable->GetValueChain( "flight_time",bc.flightTime );
pTable->GetValueChain( "factor_take_off",bc.factorTakeOff );
pTable->GetValueChain( "land_deceleration_height",bc.landDecelerationHeight);
pTable->GetValueChain( "max_anim_speed",bc.MaxAnimationSpeed );
pTable->GetValueChain( "follow_player",bc.followPlayer );
pTable->GetValueChain( "no_landing",bc.noLanding );
pTable->GetValueChain( "start_on_ground",bc.bStartOnGround );
pTable->GetValueChain( "avoid_water",bc.bAvoidWater );
pTable->GetValueChain( "avoid_obstacles",bc.avoidObstacles );
pTable->GetValueChain( "max_view_distance",bc.maxVisibleDistance );
pTable->GetValueChain( "max_animation_distance",bc.animationMaxDistanceSq);
bc.animationMaxDistanceSq *= bc.animationMaxDistanceSq;
pTable->GetValueChain( "spawn_from_point", bc.bSpawnFromPoint );
pTable->GetValueChain( "spawn_radius",bc.fSpawnRadius);
//pTable->GetValueChain( "boid_radius",bc.fBoidRadius);
pTable->GetValueChain( "gravity_at_death",bc.fGravity);
pTable->GetValueChain( "boid_mass",bc.fBoidMass);
if (pTable->GetValueChain( "fov_angle",fval ))
{
fval = fval/2.0f; // Half angle used for cos of fov.
bc.cosFovAngle = cry_cosf(fval*gf_PI/180.0f);
}
SmartScriptTable groundTable;
if (pTable->GetValueChain("ground",groundTable))
{
groundTable->BeginSetGetChain();
groundTable->GetValueChain( "factor_align",bc.factorAlignmentGround );
groundTable->GetValueChain( "factor_cohesion",bc.factorCohesionGround );
groundTable->GetValueChain( "factor_separation",bc.factorSeparationGround );
groundTable->GetValueChain( "factor_origin",bc.factorAttractToOriginGround );
groundTable->GetValueChain( "walk_speed",bc.walkSpeed);
groundTable->GetValueChain( "offset",bc.groundOffset);
groundTable->EndSetGetChain();
}
SmartScriptTable sounds;
if (pTable->GetValueChain("Sounds",sounds))
{
for (int i = 1; i < 100; i++)
{
str = "";
if (sounds->GetAt(i,str))
{
bc.sounds.push_back(str);
}
else
break;
}
}
SmartScriptTable animations;
if (pTable->GetValueChain("Animations",animations))
{
for (int i = 1; i < 100; i++)
{
str = "";
if (animations->GetAt(i,str))
{
bc.animations.push_back(str);
}
else
break;
}
}
pTable->EndSetGetChain();
return true;
}