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