1 /*---------------------------------------------------------------------------* 2 Project: NintendoWare 3 File: gfx_ResCamera.h 4 5 Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. 6 7 These coded instructions, statements, and computer programs contain proprietary 8 information of Nintendo and/or its licensed developers and are protected by 9 national and international copyright laws. They may not be disclosed to third 10 parties or copied or duplicated in any form, in whole or in part, without the 11 prior written consent of Nintendo. 12 13 The content herein is highly confidential and should be handled accordingly. 14 15 $Revision: $ 16 *---------------------------------------------------------------------------*/ 17 18 #ifndef NW_GFX_RESCAMERA_H_ 19 #define NW_GFX_RESCAMERA_H_ 20 21 #include <nw/ut/ut_ResUtil.h> 22 #include <nw/ut/ut_ResDictionary.h> 23 #include <nw/gfx/res/gfx_ResLookupTable.h> 24 #include <nw/gfx/res/gfx_ResFragmentShader.h> 25 #include <nw/ut/ut_Rect.h> 26 #include <nw/gfx/res/gfx_ResRevision.h> 27 28 namespace nw { 29 namespace gfx { 30 namespace res { 31 32 // TODO: Updaterクラス構造の最適化をおこなう。 33 34 //! @details :private 35 struct ResCameraData : public ResTransformNodeData 36 { 37 nw::ut::ResS32 m_ViewType; 38 nw::ut::ResS32 m_ProjectionType; 39 nw::ut::Offset toViewUpdater; 40 nw::ut::Offset toProjectionUpdater; 41 nw::ut::ResF32 m_WScale; 42 }; 43 44 //! @details :private 45 struct ResCameraViewUpdaterData 46 { 47 nw::ut::ResTypeInfo typeInfo; 48 }; 49 50 //! @details :private 51 struct ResCameraProjectionUpdaterData 52 { 53 nw::ut::ResTypeInfo typeInfo; 54 nw::ut::ResF32 m_Near; 55 nw::ut::ResF32 m_Far; 56 }; 57 58 59 //! @details :private 60 struct ResAimTargetViewUpdaterData : public ResCameraViewUpdaterData 61 { 62 enum Flag 63 { 64 FLAG_INHERITING_TARGET_ROTATE = 0x1 << 0, 65 FLAG_INHERITING_TARGET_TRANSLATE = 0x1 << 1 66 }; 67 68 nw::ut::ResU32 m_Flags; 69 nw::ut::ResVec3 m_TargetPosition; 70 nw::ut::ResF32 m_Twist; 71 }; 72 73 //! @details :private 74 struct ResLookAtTargetViewUpdaterData : public ResCameraViewUpdaterData 75 { 76 enum Flag 77 { 78 FLAG_INHERITING_UP_ROTATE = 0x1 << 0, 79 FLAG_INHERITING_TARGET_ROTATE = 0x1 << 1, 80 FLAG_INHERITING_TARGET_TRANSLATE = 0x1 << 2 81 }; 82 83 nw::ut::ResU32 m_Flags; 84 nw::ut::ResVec3 m_TargetPosition; 85 nw::ut::ResVec3 m_UpwardVector; 86 }; 87 88 //! @details :private 89 struct ResRotateViewUpdaterData : public ResCameraViewUpdaterData 90 { 91 enum Flag 92 { 93 FLAG_INHERITING_ROTATE = 0x1 << 0 94 }; 95 96 nw::ut::ResU32 m_Flags; 97 nw::ut::ResVec3 m_ViewRotate; 98 }; 99 100 struct ResProjectionRect 101 { 102 nw::ut::ResF32 m_AspectRatio; 103 nw::ut::ResF32 m_Height; 104 nw::ut::ResVec2 m_Center; 105 106 //---------------------------------------- 107 //! @name 取得/設定 108 //@{ 109 110 //! @brief nw::ut::Rect 形式の矩形情報に変換するキャスト演算子です。 RectResProjectionRect111 operator nw::ut::Rect() const 112 { 113 f32 width = m_Height * m_AspectRatio; 114 115 return nw::ut::Rect( m_Center.x - width / 2, m_Center.y - m_Height / 2, m_Center.x + width / 2, m_Center.y + m_Height / 2 ); 116 } 117 118 //! @brief 高さを取得します。 119 //! 120 //! @return 矩形の高さを返します。 GetHeightResProjectionRect121 f32 GetHeight() const { return m_Height; } 122 123 //! @brief 幅を取得します。 124 //! 125 //! @return 矩形の幅を返します。 GetWidthResProjectionRect126 f32 GetWidth() const { return m_Height * m_AspectRatio; } 127 128 //! @brief アスペクト比を取得します。 129 //! 130 //! @return 矩形のアスペクト比を返します。 GetAspectRatioResProjectionRect131 f32 GetAspectRatio() const { return m_AspectRatio; } 132 133 //! @brief 中心座標を取得します。 134 //! 135 //! @return 矩形の中心座標を返します。 GetCenterResProjectionRect136 nw::math::VEC2 GetCenter() const { return m_Center; } 137 138 //! @brief 廃止予定となります。 139 //! SetWithYFlip() が以前と同等の挙動となります。 140 //! 141 //! @sa SetWithoutFlip 142 //! @sa SetWithYFlip NW_DEPRECATED_FUNCTIONResProjectionRect143 NW_DEPRECATED_FUNCTION(void Set( f32 l, f32 r, f32 b, f32 t )) 144 { 145 SetWithYFlip(l, r, b, t); 146 } 147 148 //! @brief 左上、右下の座標で矩形を設定します。 149 //! 150 //! @param[in] l 矩形の左座標 151 //! @param[in] r 矩形の右座標 152 //! @param[in] b 矩形の下座標 153 //! @param[in] t 矩形の上座標 SetWithoutFlipResProjectionRect154 void SetWithoutFlip( f32 l, f32 r, f32 b, f32 t ) 155 { 156 m_Height = t - b; 157 m_AspectRatio = (r - l) / m_Height; 158 m_Center = nw::math::VEC2( (r + l) / 2, (t + b) / 2 ); 159 } 160 161 //! @brief 左上、右下の座標で矩形を設定します。 162 //! この関数はバイナリから設定する場合と比較して b, t が反転しています。 163 //! バイナリと同様の設定を行うためには SetWithoutFlip() を用いてください。 164 //! 165 //! @param[in] l 矩形の左座標 166 //! @param[in] r 矩形の右座標 167 //! @param[in] b 矩形の下座標 168 //! @param[in] t 矩形の上座標 SetWithYFlipResProjectionRect169 void SetWithYFlip( f32 l, f32 r, f32 b, f32 t ) 170 { 171 m_Height = b - t; 172 m_AspectRatio = (r - l) / m_Height; 173 m_Center = nw::math::VEC2( (r + l) / 2, (b + t) / 2 ); 174 } 175 176 //! @brief 高さとアスペクト比で矩形を設定します。 177 //! 178 //! @param[in] aspect アスペクト比です。 179 //! @param[in] height 高さです。 180 //! @param[in] center 中心座標です。 SetResProjectionRect181 void Set( f32 aspect, f32 height, const nw::math::VEC2& center ) 182 { 183 m_Height = height; 184 m_AspectRatio = aspect; 185 m_Center = center; 186 } 187 188 //@} 189 }; 190 191 //! @details :private 192 struct ResFrustumProjectionUpdaterData : public ResCameraProjectionUpdaterData 193 { 194 ResProjectionRect m_Rect; 195 }; 196 197 //! @details :private 198 struct ResOrthoProjectionUpdaterData : public ResCameraProjectionUpdaterData 199 { 200 ResProjectionRect m_Rect; 201 }; 202 203 //! @details :private 204 struct ResPerspectiveProjectionUpdaterData : public ResCameraProjectionUpdaterData 205 { 206 nw::ut::ResF32 m_AspectRatio; 207 nw::ut::ResF32 m_Fovy; 208 }; 209 210 211 //-------------------------------------------------------------------------- 212 //! @brief カメラビューアップデータリソースの基底クラスです。 213 //--------------------------------------------------------------------------- 214 class ResCameraViewUpdater : public nw::ut::ResCommon< ResCameraViewUpdaterData > 215 { 216 public: 217 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResCameraViewUpdater) }; 218 NW_RES_CTOR(ResCameraViewUpdater)219 NW_RES_CTOR( ResCameraViewUpdater ) 220 221 //--------------------------------------------------------------------------- 222 //! @brief インスタンスの型情報を取得します。 223 //! 224 //! @return 型情報です。 225 //--------------------------------------------------------------------------- 226 nw::ut::ResTypeInfo GetTypeInfo() const { return ref().typeInfo; } 227 }; 228 229 //-------------------------------------------------------------------------- 230 //! @brief カメラプロジェクションアップデータリソースの基底クラスです。 231 //--------------------------------------------------------------------------- 232 class ResCameraProjectionUpdater : public nw::ut::ResCommon< ResCameraProjectionUpdaterData > 233 { 234 public: 235 236 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResCameraProjectionUpdater) }; 237 238 NW_RES_CTOR( ResCameraProjectionUpdater ) 239 240 //--------------------------------------------------------------------------- 241 //! @fn void SetNear(f32 value) 242 //! @brief ニアクリップの値を設定します。 243 //--------------------------------------------------------------------------- 244 //--------------------------------------------------------------------------- 245 //! @fn f32 GetNear() const 246 //! @brief ニアクリップの値を取得します。 247 //--------------------------------------------------------------------------- NW_RES_FIELD_PRIMITIVE_DECL(f32,Near)248 NW_RES_FIELD_PRIMITIVE_DECL( f32, Near ) // GetNear(), SetNear() 249 250 //--------------------------------------------------------------------------- 251 //! @fn void SetFar(f32 value) 252 //! @brief ファークリップの値を設定します。 253 //--------------------------------------------------------------------------- 254 //--------------------------------------------------------------------------- 255 //! @fn f32 GetFar() const 256 //! @brief ファークリップの値を取得します。 257 //--------------------------------------------------------------------------- 258 NW_RES_FIELD_PRIMITIVE_DECL( f32, Far ) // GetFar(), SetFar() 259 260 //--------------------------------------------------------------------------- 261 //! @brief インスタンスの型情報を取得します。 262 //! 263 //! @return 型情報です。 264 //--------------------------------------------------------------------------- 265 nw::ut::ResTypeInfo GetTypeInfo() const { return ref().typeInfo; } 266 }; 267 268 //-------------------------------------------------------------------------- 269 //! @brief Aim カメラ用ビューアップデータのバイナリリソースクラスです。 270 //--------------------------------------------------------------------------- 271 class ResAimTargetViewUpdater : public ResCameraViewUpdater 272 { 273 public: 274 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResAimTargetViewUpdater) }; 275 276 NW_RES_CTOR_INHERIT( ResAimTargetViewUpdater, ResCameraViewUpdater ) 277 278 //--------------------------------------------------------------------------- 279 //! @fn void SetTwist(f32 value) 280 //! @brief カメラの視線方向に対する回転角度を設定します。 281 //--------------------------------------------------------------------------- 282 //--------------------------------------------------------------------------- 283 //! @fn void SetTargetPosition(f32 x, f32 y, f32 z) 284 //! @brief 注視点の位置を設定します。 285 //--------------------------------------------------------------------------- 286 //--------------------------------------------------------------------------- 287 //! @fn void SetFlags(u32 value) 288 //! @brief フラグの値を設定します。 289 //! 設定されなかったフラグは無効になります。 290 //--------------------------------------------------------------------------- 291 //--------------------------------------------------------------------------- 292 //! @fn void EnableFlags(u32 value) 293 //! @brief 指定された Flag の値を有効にします。 294 //! 設定されなかったフラグは変更されません。 295 //--------------------------------------------------------------------------- 296 //--------------------------------------------------------------------------- 297 //! @fn void DisableFlags(u32 value) 298 //! @brief 指定された Flag の値を無効にします。 299 //! 設定されなかったフラグは変更されません。 300 //--------------------------------------------------------------------------- 301 //--------------------------------------------------------------------------- 302 //! @fn f32 GetTwist() const 303 //! @brief カメラの視線方向に対する回転角度を取得します。 304 //--------------------------------------------------------------------------- 305 //--------------------------------------------------------------------------- 306 //! @fn const nw::math::VEC3 & GetTargetPosition() const 307 //! @brief 注視点の位置を取得します。 308 //--------------------------------------------------------------------------- 309 //--------------------------------------------------------------------------- 310 //! @fn u32 GetFlags() const 311 //! @brief フラグの値を取得します。 312 //--------------------------------------------------------------------------- 313 314 NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, TargetPosition ) // VEC3& GetTargetPosition() 315 NW_RES_FIELD_PRIMITIVE_DECL( f32, Twist ) // GetTwist(), SetTwist() 316 NW_RES_FIELD_FLAGS_DECL( u32, Flags ) // GetFlags(), SetFlags(), EnableFlags(), DisableFlags() 317 }; 318 319 //-------------------------------------------------------------------------- 320 //! @brief LookAt カメラ用ビューアップデータのバイナリリソースクラスです。 321 //--------------------------------------------------------------------------- 322 class ResLookAtTargetViewUpdater : public ResCameraViewUpdater 323 { 324 public: 325 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResLookAtTargetViewUpdater) }; 326 327 NW_RES_CTOR_INHERIT( ResLookAtTargetViewUpdater, ResCameraViewUpdater ) 328 329 //--------------------------------------------------------------------------- 330 //! @fn void SetUpwardVector(f32 x, f32 y, f32 z) 331 //! @brief カメラの上方向ベクトルを設定します。 332 //--------------------------------------------------------------------------- 333 //--------------------------------------------------------------------------- 334 //! @fn void SetTargetPosition(f32 x, f32 y, f32 z) 335 //! @brief カメラの注視点の座標を設定します。 336 //--------------------------------------------------------------------------- 337 //--------------------------------------------------------------------------- 338 //! @fn void SetFlags(u32 value) 339 //! @brief フラグの値を設定します。 340 //! 設定されなかったフラグは無効になります。 341 //--------------------------------------------------------------------------- 342 //--------------------------------------------------------------------------- 343 //! @fn void EnableFlags(u32 value) 344 //! @brief 指定された Flag の値を有効にします。 345 //! 設定されなかったフラグは変更されません。 346 //--------------------------------------------------------------------------- 347 //--------------------------------------------------------------------------- 348 //! @fn void DisableFlags(u32 value) 349 //! @brief 指定された Flag の値を無効にします。 350 //! 設定されなかったフラグは変更されません。 351 //--------------------------------------------------------------------------- 352 //--------------------------------------------------------------------------- 353 //! @fn const nw::math::VEC3 & GetUpwardVector() const 354 //! @brief カメラの上方向ベクトルを取得します。 355 //--------------------------------------------------------------------------- 356 //--------------------------------------------------------------------------- 357 //! @fn const nw::math::VEC3 & GetTargetPosition() const 358 //! @brief カメラの注視点の座標を取得します。 359 //--------------------------------------------------------------------------- 360 //--------------------------------------------------------------------------- 361 //! @fn u32 GetFlags() const 362 //! @brief フラグの値を取得します。 363 //--------------------------------------------------------------------------- 364 NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, TargetPosition ) // VEC3& GetTargetPosition() 365 NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, UpwardVector ) // VEC3& GetUpwardVector() 366 NW_RES_FIELD_FLAGS_DECL( u32, Flags ) // GetFlags(), SetFlags(), EnableFlags(), DisableFlags() 367 }; 368 369 //-------------------------------------------------------------------------- 370 //! @brief Rotate カメラ用ビューアップデータのバイナリリソースクラスです。 371 //--------------------------------------------------------------------------- 372 class ResRotateViewUpdater : public ResCameraViewUpdater 373 { 374 public: 375 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResRotateViewUpdater) }; 376 377 NW_RES_CTOR_INHERIT( ResRotateViewUpdater, ResCameraViewUpdater ) 378 379 //--------------------------------------------------------------------------- 380 //! @fn void SetViewRotate(f32 x, f32 y, f32 z) 381 //! @brief カメラの回転量を設定します。 382 //--------------------------------------------------------------------------- 383 //--------------------------------------------------------------------------- 384 //! @fn void SetFlags(u32 value) 385 //! @brief フラグの値を設定します。 386 //! 設定されなかったフラグは無効になります。 387 //--------------------------------------------------------------------------- 388 //--------------------------------------------------------------------------- 389 //! @fn void EnableFlags(u32 value) 390 //! @brief 指定された Flag の値を有効にします。 391 //! 設定されなかったフラグは変更されません。 392 //--------------------------------------------------------------------------- 393 //--------------------------------------------------------------------------- 394 //! @fn void DisableFlags(u32 value) 395 //! @brief 指定された Flag の値を無効にします。 396 //! 設定されなかったフラグは変更されません。 397 //--------------------------------------------------------------------------- 398 //--------------------------------------------------------------------------- 399 //! @fn const nw::math::VEC3 & GetViewRotate() const 400 //! @brief カメラの回転量を取得します。 401 //--------------------------------------------------------------------------- 402 //--------------------------------------------------------------------------- 403 //! @fn u32 GetFlags() const 404 //! @brief フラグの値を取得します。 405 //--------------------------------------------------------------------------- 406 NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, ViewRotate ) // VEC3& GetViewRotate() 407 NW_RES_FIELD_FLAGS_DECL( u32, Flags ) // GetFlags(), SetFlags(), EnableFlags(), DisableFlags() 408 }; 409 410 //-------------------------------------------------------------------------- 411 //! @brief Frustum 用プロジェクションアップデータのバイナリリソースクラスです。 412 //--------------------------------------------------------------------------- 413 class ResFrustumProjectionUpdater : public ResCameraProjectionUpdater 414 { 415 public: 416 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResFrustumProjectionUpdater) }; 417 418 NW_RES_CTOR_INHERIT( ResFrustumProjectionUpdater, ResCameraProjectionUpdater ) 419 420 //--------------------------------------------------------------------------- 421 //! @fn void SetRect(f32 l, f32 r, f32 b, f32 t) 422 //! @brief 廃止予定となります。 423 //! SetRectWithYFlip() が以前と同等の挙動となります。 424 //! 425 //! @sa SetRectWithoutFlip 426 //! @sa SetRectWithYFlip 427 //--------------------------------------------------------------------------- 428 //--------------------------------------------------------------------------- 429 //! @fn void SetRectWithoutFlip(f32 l, f32 r, f32 b, f32 t) 430 //! @brief 透視射影の近平面の矩形情報を設定します。 431 //--------------------------------------------------------------------------- 432 //--------------------------------------------------------------------------- 433 //! @fn void SetRectWithYFlip(f32 l, f32 r, f32 b, f32 t) 434 //! @brief 透視射影の近平面の矩形情報を設定します。 435 //! この関数はバイナリから設定する場合と比較して b, t が反転しています。 436 //! バイナリと同様の設定を行うためには SetRectWithoutFlip() を用いてください。 437 //--------------------------------------------------------------------------- 438 //--------------------------------------------------------------------------- 439 //! @fn const ResProjectionRect & GetRect() const 440 //! @brief 透視射影の近平面の矩形情報を取得します。 441 //--------------------------------------------------------------------------- 442 NW_RES_FIELD_RECT_DECL( ResProjectionRect, Rect ) // ResProjectionRect& GetRect() 443 }; 444 445 //-------------------------------------------------------------------------- 446 //! @brief Ortho 用プロジェクションアップデータのバイナリリソースクラスです。 447 //--------------------------------------------------------------------------- 448 class ResOrthoProjectionUpdater : public ResCameraProjectionUpdater 449 { 450 public: 451 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResOrthoProjectionUpdater) }; 452 453 NW_RES_CTOR_INHERIT( ResOrthoProjectionUpdater, ResCameraProjectionUpdater ) 454 455 //--------------------------------------------------------------------------- 456 //! @fn void SetRect(f32 l, f32 r, f32 b, f32 t) 457 //! @brief 廃止予定となります。 458 //! SetRectWithYFlip() が以前と同等の挙動となります。 459 //! 460 //! @sa SetRectWithoutFlip 461 //! @sa SetRectWithYFlip 462 //--------------------------------------------------------------------------- 463 //--------------------------------------------------------------------------- 464 //! @fn void SetRectWithoutFlip(f32 l, f32 r, f32 b, f32 t) 465 //! @brief 透視射影の近平面の矩形情報を設定します。 466 //--------------------------------------------------------------------------- 467 //--------------------------------------------------------------------------- 468 //! @fn void SetRectWithYFlip(f32 l, f32 r, f32 b, f32 t) 469 //! @brief 透視射影の近平面の矩形情報を設定します。 470 //! この関数はバイナリから設定する場合と比較して b, t が反転しています。 471 //! バイナリと同様の設定を行うためには SetRectWithoutFlip() を用いてください。 472 //--------------------------------------------------------------------------- 473 //--------------------------------------------------------------------------- 474 //! @fn const ResProjectionRect & GetRect() const 475 //! @brief 正射影の矩形情報を取得します。 476 //--------------------------------------------------------------------------- 477 NW_RES_FIELD_RECT_DECL( ResProjectionRect, Rect ) // ResProjectionRect& GetRect() 478 }; 479 480 //-------------------------------------------------------------------------- 481 //! @brief Perspective 用プロジェクションアップデータのバイナリリソースクラスです。 482 //--------------------------------------------------------------------------- 483 class ResPerspectiveProjectionUpdater : public ResCameraProjectionUpdater 484 { 485 public: 486 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResPerspectiveProjectionUpdater) }; 487 488 NW_RES_CTOR_INHERIT( ResPerspectiveProjectionUpdater, ResCameraProjectionUpdater ) 489 490 //--------------------------------------------------------------------------- 491 //! @fn void SetFovy(f32 value) 492 //! @brief カメラの画角を設定します。 493 //--------------------------------------------------------------------------- 494 //--------------------------------------------------------------------------- 495 //! @fn void SetAspectRatio(f32 value) 496 //! @brief アスペクト比を設定します。 497 //--------------------------------------------------------------------------- 498 //--------------------------------------------------------------------------- 499 //! @fn f32 GetFovy() const 500 //! @brief カメラの画角を取得します。 501 //--------------------------------------------------------------------------- 502 //--------------------------------------------------------------------------- 503 //! @fn f32 GetAspectRatio() const 504 //! @brief アスペクト比を取得します。 505 //--------------------------------------------------------------------------- 506 NW_RES_FIELD_PRIMITIVE_DECL( f32, AspectRatio ) // GetAspectRatio(), SetAspectRatio() 507 NW_RES_FIELD_PRIMITIVE_DECL( f32, Fovy ) // GetFovy(), SetFovy() 508 }; 509 510 //-------------------------------------------------------------------------- 511 //! @brief カメラのバイナリリソースクラスです。 512 //--------------------------------------------------------------------------- 513 class ResCamera : public ResTransformNode 514 { 515 public: 516 enum { BINARY_REVISION = REVISION_RES_CAMERA }; 517 enum { TYPE_INFO = NW_GFX_RES_TYPE_INFO(ResCamera) }; 518 519 //! @brief ビューアップデータの種類です。 520 enum ViewType 521 { 522 VIEWTYPE_AIM, //!< Aim ビューアップデータです。 523 VIEWTYPE_LOOKAT, //!< LookAt ビューアップデータです。 524 VIEWTYPE_ROTATE, //!< Rotate ビューアップデータです。 525 VIEWTYPE_COUNT //!< enum の最大値です。 526 }; 527 528 //! @brief プロジェクションアップデータの種類です。 529 enum ProjType 530 { 531 PROJTYPE_PERSPECTIVE, //!< Perspective プロジェクションアップデータです。 532 PROJTYPE_FRUSTUM, //!< Frustum プロジェクションアップデータです。 533 PROJTYPE_ORTHO, //!< Ortho プロジェクションアップデータです。 534 PROJTYPE_COUNT //!< enum の最大値です。 535 }; 536 NW_RES_CTOR_INHERIT(ResCamera,ResTransformNode)537 NW_RES_CTOR_INHERIT( ResCamera, ResTransformNode ) 538 539 //--------------------------------------------------------------------------- 540 //! @fn void SetViewType(ViewType value) 541 //! @brief ビューカメラアップデータのタイプを設定します。 542 //--------------------------------------------------------------------------- 543 //--------------------------------------------------------------------------- 544 //! @fn ViewType GetViewType() const 545 //! @brief ビューカメラアップデータのタイプを取得します。 546 //--------------------------------------------------------------------------- 547 NW_RES_FIELD_PRIMITIVE_DECL( ViewType, ViewType ) // GetViewType() 548 549 //--------------------------------------------------------------------------- 550 //! @fn void SetProjectionType(ProjType value) 551 //! @brief プロジェクションカメラアップデータのタイプを設定します。 552 //--------------------------------------------------------------------------- 553 //--------------------------------------------------------------------------- 554 //! @fn ProjType GetProjectionType() const 555 //! @brief プロジェクションカメラアップデータのタイプを取得します。 556 //--------------------------------------------------------------------------- 557 NW_RES_FIELD_PRIMITIVE_DECL( ProjType, ProjectionType ) // GetProjectionType() 558 559 //--------------------------------------------------------------------------- 560 //! @fn ResCameraViewUpdater GetViewUpdater() 561 //! @brief ビュー行列のアップデータを取得します。 562 //--------------------------------------------------------------------------- 563 NW_RES_FIELD_CLASS_DECL( ResCameraViewUpdater, ViewUpdater ) // GetViewUpdater() 564 565 //--------------------------------------------------------------------------- 566 //! @fn ResCameraProjectionUpdater GetProjectionUpdater() 567 //! @brief 射影行列のアップデータを取得します。 568 //--------------------------------------------------------------------------- 569 NW_RES_FIELD_CLASS_DECL( ResCameraProjectionUpdater, ProjectionUpdater ) // GetProjectionUpdater() 570 571 //--------------------------------------------------------------------------- 572 //! @fn void SetWScale(f32 value) 573 //! @brief Wバッファのスケール因子を設定します。 574 //--------------------------------------------------------------------------- 575 //--------------------------------------------------------------------------- 576 //! @fn f32 GetWScale() const 577 //! @brief Wバッファのスケール因子を取得します。 578 //--------------------------------------------------------------------------- 579 NW_RES_FIELD_PRIMITIVE_DECL( f32, WScale ) // GetWScale() 580 581 //--------------------------------------------------------------------------- 582 //! @brief リビジョンを取得します。 583 //! 584 //! @return リソースのリビジョン情報です。 585 //--------------------------------------------------------------------------- 586 u32 GetRevision() const { return this->GetHeader().revision; } 587 }; 588 589 typedef nw::ut::ResArrayPatricia<ResCamera>::type ResCameraArray; 590 591 } // namespace res 592 } // namespace gfx 593 } // namespace nw 594 595 #endif // NW_GFX_RESCAMERA_H_ 596