//============================================================================== // Brief : 更新処理 // Return : void : なし // Arg : void : なし //============================================================================== void CSceneRanking::Update( void ) { // デバッグ表示 PrintDebug( _T( "ランキング\n" ) ); // カメラの更新 D3DXMATRIX mtxView; // ビュー行列 D3DXMATRIX mtxOrtho; // 正射影行列 for( int cntCamera = 0; cntCamera < MAX_CAMERA; ++cntCamera ) { m_ppCamera[ cntCamera ]->Update(); } mtxView = m_ppCamera[ 0 ]->GetView(); mtxOrtho = m_ppCamera[ 0 ]->GetOrtho(); // 描画用変換行列の更新 m_pArgument->m_pRenderMatrix2D->SetProjection( &mtxOrtho ); m_pArgument->m_pRenderMatrix3D->SetView( &mtxView ); // シーン遷移 if( m_pArgument->m_pFade->GetState() == CObjectFade::STATE_OUT_END ) { SetSceneNext( CManagerScene::SCENE_TITLE ); EndScene(); } if( m_pArgument->m_pInput->IsTrigger( CManagerInput::KEY_DECISION ) ) { if( m_pArgument->m_pFade->GetState() != CObjectFade::STATE_OUT_WHILE ) { m_pArgument->m_pFade->FadeOut( 20 ); } } }
//============================================================================== // Brief : ポーズ更新処理(フェード用) //============================================================================== void SceneGame::pauseFadeUpdate(void) { // 接続切れ確認 if(wiiLostCheck() == false) return; // シーン遷移 if( pArgument_->pFade_->GetState() == Fade::STATE_OUT_END ) { if(chooseObject == stringStop) SetSceneNext( ManagerSceneMain::TYPE_TITLE ); else SetSceneNext( ManagerSceneMain::TYPE_GAME ); SetIsEnd( true ); } }
//============================================================================== // Brief : 更新処理 // Return : void : なし // Arg : void : なし //============================================================================== void SceneSplash::Update( void ) { // テスト PrintDebug( _T( "スプラッシュ\n" ) ); // ポイントスプライト管理クラスの更新 pPoint_->Update(); // 焦点距離の更新 D3DXVECTOR3 positionLookAt; // 注視点 pCamera_[ GraphicMain::CAMERA_GENERAL ].GetPositionLookAt( &positionLookAt ); pArgument_->pEffectParameter_->SetForcus( pCamera_[ GraphicMain::CAMERA_GENERAL ].GetViewZ( positionLookAt ) ); // 影用カメラ近の更新 D3DXVECTOR3 vectorLight; // ライトベクトル positionLookAt.y = 0.0f; pLight_->GetVector( &vectorLight ); vectorLight *= -500.0f; pCameraShadowNear_->SetPositionCamera( positionLookAt + vectorLight ); pCameraShadowNear_->SetPositionLookAt( positionLookAt ); // 影用カメラ遠の更新 pLight_->GetVector( &vectorLight ); vectorLight *= -5000.0f; pCameraShadowFar_->SetPositionCamera( positionLookAt + vectorLight ); pCameraShadowFar_->SetPositionLookAt( positionLookAt ); // 影用カメラ点の更新 const LightPoint* pLightPoint = nullptr; // 点光源 for( int counterLightPoint = 0; counterLightPoint < GraphicMain::MAXIMUM_LIGHT_POINT_SHADOW; ++counterLightPoint ) { pLightPoint = pArgument_->pEffectParameter_->GetLightPointLightness( counterLightPoint ); if( pLightPoint != nullptr ) { D3DXVECTOR3 positionLightPointCamera; // 点光源の視点座標 D3DXVECTOR3 positionLightPointLookAt; // 点光源の注視点座標 pLightPoint->GetPosition( &positionLightPointCamera ); positionLightPointLookAt = positionLightPointCamera; positionLightPointLookAt.y -= 1000.0f; ppCameraShadowPoint_[ counterLightPoint ]->SetPositionCamera( positionLightPointCamera ); ppCameraShadowPoint_[ counterLightPoint ]->SetPositionLookAt( positionLightPointLookAt ); } } // モデルの回転 pObjectModel_[ 0 ].AddRotationY( 0.01f ); pObjectBoard_->AddRotationZ( 0.1f ); #if 0 // ライトの回転 static float rotL = 0.0f; D3DXVECTOR3 vecDir; vecDir.x = cosf( rotL ); vecDir.y = -0.5f; vecDir.z = sinf( rotL ); pLight_[ GraphicMain::LIGHT_DIRECTIONAL_GENERAL ].SetVector( vecDir ); rotL += 0.01f; if( rotL > 2.0f * D3DX_PI ) { rotL -= 2.0f * D3DX_PI; } #endif // ライトの回転角度を決定 float angleLight; // ライトの回転角度 angleLight = D3DX_PI * timerLight_ / 120.0f; ++timerLight_; // 赤ポイントライトの移動 D3DXVECTOR3 positionPointR; // ポイントライトの座標 ppPointLight_[ 0 ]->GetPosition( &positionPointR ); positionPointR.x = 30.0f * cosf( angleLight ); positionPointR.z = 30.0f * sinf( angleLight ); ppPointLight_[ 0 ]->SetPosition( positionPointR ); // 青ポイントライトの移動 D3DXVECTOR3 positionPointB; // ポイントライトの座標 ppPointLight_[ 1 ]->GetPosition( &positionPointB ); positionPointB.x = 30.0f * cosf( angleLight + D3DX_PI ); positionPointB.z = 30.0f * sinf( angleLight + D3DX_PI ); if( timerLight_ % 240 < 120 ) { Utility::SplineVector3( D3DXVECTOR3( -50.0f, 20.0f, -50.0f ), D3DXVECTOR3( 150.0f, 150.0f, 0.0f ), D3DXVECTOR3( 100.0f, 70.0f, 100.0f ), D3DXVECTOR3( 0.0f, 150.0f, 150.0f ), static_cast< float >( timerLight_ % 120 ) / 120.0f, &positionPointB ); } else { Utility::SplineVector3( D3DXVECTOR3( 100.0f, 70.0f, 100.0f ), D3DXVECTOR3( 0.0f, 150.0f, 150.0f ), D3DXVECTOR3( -50.0f, 20.0f, -50.0f ), D3DXVECTOR3( 150.0f, 150.0f, 0.0f ), static_cast< float >( (timerLight_ % 240) - 120 ) / 120.0f, &positionPointB ); } ppPointLight_[ 1 ]->SetPosition( positionPointB ); // 緑ポイントライトの移動 D3DXVECTOR3 positionPointG; // ポイントライトの座標 ppPointLight_[ 2 ]->GetPosition( &positionPointG ); if( pArgument_->pVirtualController_->IsPress( VC_LEFT ) ) { positionPointG.x -= 1.0f; } else if( pArgument_->pVirtualController_->IsPress( VC_RIGHT ) ) { positionPointG.x += 1.0f; } if( pArgument_->pVirtualController_->IsPress( VC_DOWN ) ) { positionPointG.z -= 1.0f; } else if( pArgument_->pVirtualController_->IsPress( VC_UP ) ) { positionPointG.z += 1.0f; } if( pArgument_->pKeyboard_->IsPress( DIK_COMMA ) ) { positionPointG.y -= 1.0f; } else if( pArgument_->pKeyboard_->IsPress( DIK_PERIOD ) ) { positionPointG.y += 1.0f; } ppPointLight_[ 2 ]->SetPosition( positionPointG ); // エフェクトの発生 pPoint_->Add( 20, positionPointR, D3DXCOLOR( 1.0f, 0.25f, 0.25f, 1.0f ), 50.0f, D3DXVECTOR3( 0.0f, 0.0f, 0.0f ), D3DXCOLOR( 0.0f, 0.0f, 0.0f, -0.05f ), -2.0f, PointMain::STATE_ADD ); pPoint_->Add( 20, positionPointB, D3DXCOLOR( 0.25f, 0.25f, 1.0f, 1.0f ), 50.0f, D3DXVECTOR3( 0.0f, 0.0f, 0.0f ), D3DXCOLOR( 0.0f, 0.0f, 0.0f, -0.05f ), -2.0f, PointMain::STATE_ADD ); pPoint_->Add( 20, positionPointG, D3DXCOLOR( 0.25f, 1.0f, 0.25f, 1.0f ), 50.0f, D3DXVECTOR3( 0.0f, 0.0f, 0.0f ), D3DXCOLOR( 0.0f, 0.0f, 0.0f, -0.05f ), -2.0f, PointMain::STATE_ADD ); // 点光源を有効にする if( pArgument_->pKeyboard_->IsTrigger( DIK_LBRACKET ) ) { ppPointLight_[ countLight_ ]->SetIsEnable( true ); ++countLight_; if( countLight_ >= GraphicMain::LIGHT_POINT_MAX ) { countLight_ = GraphicMain::LIGHT_POINT_MAX - 1; } } if( pArgument_->pKeyboard_->IsTrigger( DIK_RBRACKET ) ) { ppPointLight_[ countLight_ ]->SetIsEnable( false ); --countLight_; if( countLight_ < 0 ) { countLight_ = 0; } } // オブジェクトの移動 if( pArgument_->pKeyboard_->IsPress( DIK_A ) ) { pObjectModel_[ 0 ].AddPositionX( -1.0f ); } else if( pArgument_->pKeyboard_->IsPress( DIK_D ) ) { pObjectModel_[ 0 ].AddPositionX( 1.0f ); } if( pArgument_->pKeyboard_->IsPress( DIK_S ) ) { pObjectModel_[ 0 ].AddPositionZ( -1.0f ); } else if( pArgument_->pKeyboard_->IsPress( DIK_W ) ) { pObjectModel_[ 0 ].AddPositionZ( 1.0f ); } // シーン遷移 if( pArgument_->pFade_->GetState() == Fade::STATE_OUT_END ) { SetSceneNext( ManagerSceneMain::TYPE_TITLE ); SetIsEnd( true ); } if( pArgument_->pKeyboard_->IsTrigger( DIK_RETURN ) ) { if( pArgument_->pFade_->GetState() != Fade::STATE_OUT_WHILE ) { pArgument_->pFade_->FadeOut( 20 ); } } }