Exemplo n.º 1
0
void Valve::Update()
{
	mTurnSound->Pause();
	if(!mDone) {
		auto & player = Game::Instance()->GetLevel()->GetPlayer();
		if(player->mNearestPickedNode == mObject) {
			player->GetHUD()->SetAction(player->mKeyUse, player->mLocalization.GetString("turnObject"));
			if(player->IsUseButtonDown()) {
				mTurnSound->Play();
				mAngle += 5;
				OnTurn();
				if(mAngle >= 360 * mTurnCount) {
					mDone = true;
					OnTurnDone();
				}
				mObject->SetRotation(Quaternion(mTurnAxis, mAngle));
			}
		}
		mValue = mAngle / (float)(360 * mTurnCount);
	}
}
Exemplo n.º 2
0
void Construction::Turn( Real Force , Real Angle) 
{
	Activate();
	OnTurn( Force, Angle );
	
}