本文整理汇总了C++中aCvar_c::getStr方法的典型用法代码示例。如果您正苦于以下问题:C++ aCvar_c::getStr方法的具体用法?C++ aCvar_c::getStr怎么用?C++ aCvar_c::getStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aCvar_c
的用法示例。
在下文中一共展示了aCvar_c::getStr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CG_RunTestEmitter
void CG_RunTestEmitter()
{
if ( cg_testEmitter.getStr()[0] == 0 || cg_testEmitter.getStr()[0] == '0' )
{
CG_FreeTestEmitter();
return;
}
class particleDeclAPI_i* pDecl = g_declMgr->registerParticleDecl( cg_testEmitter.getStr() );
if ( pDecl == 0 )
{
CG_FreeTestEmitter();
return;
}
if ( cg_testEmitterInstance == 0 )
{
cg_testEmitterInstance = new emitterD3_c;
rf->addCustomRenderObject( cg_testEmitterInstance );
cg_testEmitterInstance->setOrigin( cg.refdefViewOrigin + cg.refdefViewAxis.getForward()*cg_testEmitter_cameraDistance.getFloat() );
}
else
{
if ( cg_testEmitter_attachToCamera.getInt() )
{
cg_testEmitterInstance->setOrigin( cg.refdefViewOrigin + cg.refdefViewAxis.getForward()*cg_testEmitter_cameraDistance.getFloat() );
}
}
cg_testEmitterInstance->setParticleDecl( pDecl );
}
示例2: CG_RunViewModel
//.........这里部分代码省略.........
}
//g_core->Print("Player velocity: %f %f %f\n",cg.snap->ps.velocity.x,cg.snap->ps.velocity.y,cg.snap->ps.velocity.z);
// calculate viewmodel bobbing offset based on player velocity
viewModelMovement.setConfig( viewModelMovementConfig );
viewModelMovement.calcViewModelOffset( cg.snap->ps.isOnGround(), cg.snap->ps.velocity, cg.refdefViewAngles, cg.frametime * 0.001f );
const vec3_c& currentMovement = viewModelMovement.getCurrentMovement();
localOfs += currentMovement;
if ( cg_printViewModelBobbingOffset.getInt() )
{
g_core->Print( "Viewmodel bobbing movement: %f %f %f\n", currentMovement.x, currentMovement.y, currentMovement.z );
}
if ( cg_printCurViewModelName.getInt() )
{
g_core->Print( "Current viewmodel name: %s\n", viewModel->getName() );
}
if ( cg_printCurViewModelAnimationCount.getInt() )
{
g_core->Print( "Current viewmodel animation count: %i\n", viewModel->getNumAnims() );
}
if ( cg_printCurViewModelBoneNames.getInt() )
{
g_core->Print( "Current viewmodel %s bonenames:\n", viewModel->getName() );
viewModel->printBoneNames();
}
CG_AllocViewModelEntity();
vec3_c origin = cg.refdefViewOrigin;
vec3_c angles = cg.refdefViewAngles;
// apply extra gun offset
localOfs.x += cg_gunX.getFloat();
localOfs.y += cg_gunY.getFloat();
localOfs.z += cg_gunZ.getFloat();
// apply extra gun rotation
localRot.x += cg_gunRotX.getFloat();
localRot.y += cg_gunRotY.getFloat();
localRot.z += cg_gunRotZ.getFloat();
if ( localRot.isNull() == false )
{
matrix_c m;
m.fromAngles( angles );
m.rotateX( localRot.x );
m.rotateY( localRot.y );
m.rotateZ( localRot.z );
angles = m.getAngles();
}
// add local offset to hand origin
origin.vectorMA( origin, cg.refdefViewAxis[0], localOfs.x );
origin.vectorMA( origin, cg.refdefViewAxis[1], localOfs.y );
origin.vectorMA( origin, cg.refdefViewAxis[2], localOfs.z );
// always update viewmodel position
cg_viewModelEntity->setOrigin( origin );
cg_viewModelEntity->setAngles( angles );
cg_viewModelEntity->setFirstPersonOnly( true );
// set viewmodel model
//rModelAPI_i *viewModel = rf->registerModel("models/testweapons/xrealMachinegun/machinegun_view.md5mesh");
cg_viewModelEntity->setModel( viewModel );
int viewModelAnimFlags;
if ( stricmp( cg_forceViewModelAnimationFlags.getStr(), "none" ) )
{
viewModelAnimFlags = cg_forceViewModelAnimationFlags.getInt();
}
else
{
viewModelAnimFlags = cg.snap->ps.viewModelAnimFlags;
}
if ( stricmp( cg_forceViewModelAnimationIndex.getStr(), "none" ) )
{
int index = cg_forceViewModelAnimationIndex.getInt();
cg_viewModelEntity->setDeclModelAnimLocalIndex( index, viewModelAnimFlags );
}
else if ( stricmp( cg_forceViewModelAnimationName.getStr(), "none" ) )
{
const char* animName = cg_forceViewModelAnimationName.getStr();
cg_viewModelEntity->setAnim( animName, viewModelAnimFlags );
}
else
{
const char* animName = CG_ConfigString( CS_ANIMATIONS + cg.snap->ps.viewModelAnim );
if ( cg_printViewModelAnimName.getInt() )
{
g_core->Print( "ViewModelAnim: %s, flags %i\n", animName, viewModelAnimFlags );
}
if ( cg_viewModelEntity->hasAnim( animName ) )
{
cg_viewModelEntity->setAnim( animName, viewModelAnimFlags );
}
else
{
g_core->RedWarning( "ViewModel has no animation %s\n", animName );
}
}
}