本文整理汇总了C++中SmartScriptTable::GetValueChain方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartScriptTable::GetValueChain方法的具体用法?C++ SmartScriptTable::GetValueChain怎么用?C++ SmartScriptTable::GetValueChain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartScriptTable
的用法示例。
在下文中一共展示了SmartScriptTable::GetValueChain方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadParamsTable
bool CScriptBind_Boids::ReadParamsTable(IScriptTable *pTable, struct SBoidContext &bc,SBoidsCreateContext &ctx )
{
pTable->BeginSetGetChain();
float fval;
const char *str;
ctx.models.clear();
ctx.boidsCount = 0;
pTable->GetValueChain( "count",ctx.boidsCount );
if (pTable->GetValueChain( "model",str ))
{
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model1",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model2",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model3",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model4",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "character",str ))
{
ctx.characterModel = str;
}
if (pTable->GetValueChain( "animation",str ))
{
ctx.animation = str;
}
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( "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))
{
//.........这里部分代码省略.........
示例2: ReadParamsTable
bool CScriptBind_Boids::ReadParamsTable(IScriptTable *pTable, struct SBoidContext &bc,SBoidsCreateContext &ctx )
{
pTable->BeginSetGetChain();
float fval;
const char *str;
ctx.models.clear();
ctx.boidsCount = 0;
pTable->GetValueChain( "count",ctx.boidsCount );
if (pTable->GetValueChain( "model",str ))
{
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model1",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model2",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model3",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "model4",str ))
{
if (str[0])
ctx.models.push_back(str);
}
if (pTable->GetValueChain( "character",str ))
{
ctx.characterModel = str;
}
if (pTable->GetValueChain( "animation",str ))
{
ctx.animation = str;
}
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 );
//.........这里部分代码省略.........