/*---------------------------------------------------------------------------* Project: NintendoWare File: ut_ResPrimitive.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: 31311 $ *---------------------------------------------------------------------------*/ #ifndef NW_UT_RESPRIMITIVE_H_ #define NW_UT_RESPRIMITIVE_H_ #include #include #include #include #include namespace nw { namespace ut { //! @details :private struct ResBoundingVolumeData { nw::ut::ResTypeInfo typeInfo; }; //! @details :private struct ResOrientedBoundingBoxData : public ResBoundingVolumeData { ResVec3 m_CenterPosition; ResMtx33 m_OrientationMatrix; ResVec3 m_Size; }; //! @details :private struct ResAxisAlignedBoundingBoxData : public ResBoundingVolumeData { ResVec3 m_CenterPosition; ResVec3 m_Size; }; //-------------------------------------------------------------------------- //! @brief バウンディング情報です。 //--------------------------------------------------------------------------- class ResBoundingVolume : public nw::ut::ResCommon { public: enum { TYPE_INFO = NW_UT_RES_TYPE_INFO(ResBoundingVolume) }; NW_RES_CTOR( ResBoundingVolume ) //--------------------------------------------------------------------------- //! @brief インスタンスの型情報を取得します。 //! //! @return 型情報です。 //--------------------------------------------------------------------------- nw::ut::ResTypeInfo GetTypeInfo() const { return ref().typeInfo; } }; //-------------------------------------------------------------------------- //! @brief OBB の情報です。 //--------------------------------------------------------------------------- class ResOrientedBoundingBox : public ResBoundingVolume { public: enum { TYPE_INFO = NW_UT_RES_TYPE_INFO(ResOrientedBoundingBox) }; NW_RES_CTOR_INHERIT( ResOrientedBoundingBox, ResBoundingVolume ) //--------------------------------------------------------------------------- //! @fn const nw::math::VEC3 & GetCenterPosition() const //! @brief OBB の中心座標を取得します。 //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //! @fn void SetCenterPosition(f32 x, f32 y, f32 z) //! @brief OBB の中心座標を設定します。 //--------------------------------------------------------------------------- NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, CenterPosition ) // GetCenterPosition() //--------------------------------------------------------------------------- //! @fn void SetOrientationMatrix(const nw::math::MTX33 & value) //! @brief 姿勢行列を設定します。 //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //! @fn nw::math::MTX33 & GetOrientationMatrix() //! @brief 姿勢行列を取得します。 //--------------------------------------------------------------------------- NW_RES_FIELD_STRUCT_DECL( nw::math::MTX33, OrientationMatrix ) // GetOrientationMatrix() //--------------------------------------------------------------------------- //! @fn const nw::math::VEC3 & GetSize() const //! @brief 姿勢行列座標空間におけるサイズを取得します。 //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //! @fn void SetSize(f32 x, f32 y, f32 z) //! @brief 姿勢行列座標空間におけるサイズを設定します。 //--------------------------------------------------------------------------- NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Size ) // GetSize() }; //-------------------------------------------------------------------------- //! @brief AABB の情報です。 //--------------------------------------------------------------------------- class ResAxisAlignedBoundingBox : public ResBoundingVolume { public: enum { TYPE_INFO = NW_UT_RES_TYPE_INFO(ResAxisAlignedBoundingBox) }; NW_RES_CTOR_INHERIT( ResAxisAlignedBoundingBox, ResBoundingVolume ) //--------------------------------------------------------------------------- //! @fn const nw::math::VEC3 & GetCenterPosition() const //! @brief AABB の中心座標を取得します。 //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //! @fn void SetCenterPosition(f32 x, f32 y, f32 z) //! @brief AABB の中心座標を設定します。 //--------------------------------------------------------------------------- NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, CenterPosition ) // GetCenterPosition() //--------------------------------------------------------------------------- //! @fn const nw::math::VEC3 & GetSize() const //! @brief 軸平行座標空間におけるサイズを取得します。 //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- //! @fn void SetSize(f32 x, f32 y, f32 z) //! @brief 軸平行座標空間におけるサイズを設定します。 //--------------------------------------------------------------------------- NW_RES_FIELD_VECTOR3_DECL( nw::math::VEC3, Size ) // GetSize() }; } /* namespace ut */ } /* namespace nw */ #endif /* NW_UT_RESPRIMITIVE_H_ */