/*---------------------------------------------------------------------------* Project: NintendoWare File: SmTouchPanelCamera.h Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo and/or its licensed developers and are protected by national and international copyright laws. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. The content herein is highly confidential and should be handled accordingly. $Revision: $ *---------------------------------------------------------------------------*/ #ifndef SM_TOUCHPANEL_CAMERA_H_ #define SM_TOUCHPANEL_CAMERA_H_ #include #include #include "../include/SmMessage.h" #include "../include/SmCamera.h" #include "../include/SmButton.h" #include "../include/SmRectCollision.h" //------------------------------------------------------------------------------ // タッチパネルカメラクラス class SmTouchPanelCamera : public SmMessage { enum { SM_TOUCH_PANEL_CAMERA_SLIDER = 0 }; public: // コンストラクタ SmTouchPanelCamera( SmCamera* smcamera ); // デストラクタ ~SmTouchPanelCamera(){} // メッセージ受信 virtual bool ReceveMessage( SmMessageType type, void* object, uint targetId ); // 描画 virtual void Render(); // 有効/無効 virtual void SetEnable( bool enable ) { SmMessage::SetEnable( enable ); // m_Camera の状態を引き継ぐ if ( GetEnable() ) { // カメラ視点 m_SmCamera->GetPosition( &m_CameraPos ); // カメラ注視点 m_SmCamera->GetTarget( &m_CameraTarget ); // カメラ向き m_CameraToward.x = m_CameraTarget.x - m_CameraPos.x; m_CameraToward.y = m_CameraTarget.y - m_CameraPos.y; m_CameraToward.z = m_CameraTarget.z - m_CameraPos.z; m_CameraToward.Normalize(); // 左右首振り値も初期化 m_DegX = m_DegY = 0.f; } } private: void calcCamera(); void updateCamera(); private: SmCamera* m_SmCamera; nw::math::VEC3 m_CameraPos; nw::math::VEC3 m_CameraTarget; nw::math::VEC3 m_CameraToward; // 向き SmRectCollision m_Collision; bool m_IsGrab; s32 m_TouchPanelPosLastX; s32 m_TouchPanelPosLastY; s32 m_TouchPanelPosX; s32 m_TouchPanelPosY; f32 m_DegX; f32 m_DegY; }; #endif // SM_TOUCHPANEL_CAMERA_H_