本文整理汇总了C++中Corpse::SetTranslation方法的典型用法代码示例。如果您正苦于以下问题:C++ Corpse::SetTranslation方法的具体用法?C++ Corpse::SetTranslation怎么用?C++ Corpse::SetTranslation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Corpse
的用法示例。
在下文中一共展示了Corpse::SetTranslation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Kill
void Player::Kill()
{
if( m_state == DEAD ) return;
Corpse* c = Game::SpawnBody();
c->SetTranslation( transform.GetTranslation() );
c->Rotate( float3( 0, -m_rotation * ( 180 / PI ), 0 ) );
m_timeOfDeath.reset();
m_state = DEAD;
m_enabled = false;
if( s_hudgun && m_isLocalPlayer ) s_hudgun->m_enabled = false;
if( m_flag )
{
Log::Get()->Print( "The %s flag has been returned!", ( m_team == Team::RED ) ? "red" : "blue" );
m_flag->Reset();
m_flag = nullptr;
}
char* sound[5] =
{
"assets/sound/death1.wav",
"assets/sound/death2.wav",
"assets/sound/death3.wav",
"assets/sound/death4.wav",
"assets/sound/death5.wav",
};
int randomSound = (int)Rand( 5 );
Audio::Get()->PlaySound( sound[randomSound] );
if( Network::Get()->IsServer() )
{
Network::Get()->server->SendAction( PlayerAction::DEATH, m_id );
}
}