本文整理汇总了C++中idAngles::Zero方法的典型用法代码示例。如果您正苦于以下问题:C++ idAngles::Zero方法的具体用法?C++ idAngles::Zero怎么用?C++ idAngles::Zero使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idAngles
的用法示例。
在下文中一共展示了idAngles::Zero方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAngles
/*
================
idDict::GetAngles
================
*/
bool idDict::GetAngles( const char *key, const char *defaultString, idAngles &out ) const {
bool found;
const char *s;
if( !defaultString ) {
defaultString = "0 0 0";
}
found = GetString( key, defaultString, &s );
out.Zero();
sscanf( s, "%f %f %f", &out.pitch, &out.yaw, &out.roll );
return found;
}
示例2: ShakeOffsets
// RAVEN BEGIN
// jnewquist: Controller rumble
void idPlayerView::ShakeOffsets( idVec3 &shakeOffset, idAngles &shakeAngleOffset, const idBounds bounds ) const {
float shakeVolume = 0.0f;
shakeOffset.Zero();
shakeAngleOffset.Zero();
if( gameLocal.isMultiplayer ) {
return;
}
shakeVolume = CalculateShake( shakeAngleOffset );
if( gameLocal.time < shakeFinishTime ) {
float offset = ( shakeFinishTime - gameLocal.time ) * shakeScale * 0.001f;
shakeOffset[0] = idMath::ClampFloat( bounds[0][0] - 1.0f, bounds[1][0] + 1.0f, rvRandom::flrand( -offset, offset ) );
shakeOffset[1] = idMath::ClampFloat( bounds[0][1] - 1.0f, bounds[1][1] + 1.0f, rvRandom::flrand( -offset, offset ) );
shakeOffset[2] = idMath::ClampFloat( bounds[0][2] - 1.0f, bounds[1][2] + 1.0f, rvRandom::flrand( -offset, offset ) );
shakeAngleOffset[0] = idMath::ClampFloat( -70.0f, 70.0f, rvRandom::flrand( -offset, offset ) );
shakeAngleOffset[1] = idMath::ClampFloat( -70.0f, 70.0f, rvRandom::flrand( -offset, offset ) );
shakeAngleOffset[2] = idMath::ClampFloat( -70.0f, 70.0f, rvRandom::flrand( -offset, offset ) );
}
}