本文整理汇总了C++中idVec3::LengthFast方法的典型用法代码示例。如果您正苦于以下问题:C++ idVec3::LengthFast方法的具体用法?C++ idVec3::LengthFast怎么用?C++ idVec3::LengthFast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idVec3
的用法示例。
在下文中一共展示了idVec3::LengthFast方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Collide
/*
================
rvClientMoveable::Collide
================
*/
bool rvClientMoveable::Collide ( const trace_t &collision, const idVec3 &velocity ) {
if (mPlayBounceSoundOnce && mHasBounced)
{
return false;
}
if ( bounceSoundShader && gameLocal.time > bounceSoundTime ) {
float speed;
speed = velocity.LengthFast ( );
if ( speed > BOUNCE_SOUND_MIN_VELOCITY ) {
StartSoundShader ( bounceSoundShader, SND_CHANNEL_BODY, 0 );
bounceSoundTime = BOUNCE_SOUND_DELAY;
mHasBounced = true;
}
}
return false;
}
示例2: Collide
/*
================
rvClientMoveable::Collide
================
*/
bool rvClientMoveable::Collide ( const trace_t &collision, const idVec3 &velocity ) {
if ( firstBounce ) {
// first bounce, play effect
const char* bounceEffectName = "fx_firstbounce";
if ( effectSet != 0 ) {
bounceEffectName = va( "fx_firstbounce_%i", effectSet );
}
const idVec3& origin = physicsObj.GetOrigin();
idMat3 axis = ( idVec3( 0.0f, 0.0f, 1.0f ) ).ToMat3();
gameLocal.PlayEffect( *spawnArgs, colorWhite.ToVec3(), bounceEffectName, NULL, origin, axis );
firstBounce = false;
}
if ( bounceSoundShader && gameLocal.time > bounceSoundTime ) {
float speed;
speed = velocity.LengthFast ( );
if ( speed > BOUNCE_SOUND_MIN_VELOCITY ) {
StartSoundShader ( bounceSoundShader, SND_ANY, 0 );
bounceSoundTime = BOUNCE_SOUND_DELAY;
}
}
return false;
}
示例3: Collide
/*
================
idExplodingBarrel::Collide
================
*/
impactEffect_t idExplodingBarrel::Collide( const trace_t &collision, const idVec3 &velocity ) {
if ( !IsStable() && (velocity.LengthFast() * UnstableLevel > 1000.0f) ) {
PostEventSec( &EV_Explode, NULL, 0.04f );
}
return idMoveable::Collide( collision, velocity );
}