PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNBitmap3D.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLSCENE_SCENENODE_BITMAP3D_H__ 00024 #define __PLSCENE_SCENENODE_BITMAP3D_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLScene/Scene/SceneNodes/SNBitmap.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLScene { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * 3D bitmap scene node 00046 * 00047 * @note 00048 * - It's NOT recommended to use this scene node for example to create dense vegetation on a terrain! 00049 * - The axis aligned bounding box is centered around zero and each axis has a length of 1 00050 * - The bitmap is drawn on the x/y plane and 'looks' into the positive z axis 00051 */ 00052 class SNBitmap3D : public SNBitmap { 00053 00054 00055 //[-------------------------------------------------------] 00056 //[ RTTI interface ] 00057 //[-------------------------------------------------------] 00058 pl_class(PLS_RTTI_EXPORT, SNBitmap3D, "PLScene", PLScene::SNBitmap, "3D bitmap scene node") 00059 // Attributes 00060 pl_attribute(PositionOffset, PLMath::Vector3, PLMath::Vector3::Zero, ReadWrite, GetSet, "Position offset (scene node space)", "") 00061 // Constructors 00062 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00063 pl_class_end 00064 00065 00066 //[-------------------------------------------------------] 00067 //[ Public RTTI get/set functions ] 00068 //[-------------------------------------------------------] 00069 public: 00070 PLS_API const PLMath::Vector3 &GetPositionOffset() const; 00071 PLS_API void SetPositionOffset(const PLMath::Vector3 &vValue); 00072 00073 00074 //[-------------------------------------------------------] 00075 //[ Public functions ] 00076 //[-------------------------------------------------------] 00077 public: 00078 /** 00079 * @brief 00080 * Default constructor 00081 */ 00082 PLS_API SNBitmap3D(); 00083 00084 /** 00085 * @brief 00086 * Destructor 00087 */ 00088 PLS_API virtual ~SNBitmap3D(); 00089 00090 00091 //[-------------------------------------------------------] 00092 //[ Private functions ] 00093 //[-------------------------------------------------------] 00094 private: 00095 /** 00096 * @brief 00097 * Draws the bitmap shape 00098 * 00099 * @param[in] cRenderer 00100 * The used renderer 00101 * @param[in] cVisNode 00102 * Used visibility node 00103 */ 00104 void DrawShape(PLRenderer::Renderer &cRenderer, const VisNode &cVisNode); 00105 00106 00107 //[-------------------------------------------------------] 00108 //[ Private data ] 00109 //[-------------------------------------------------------] 00110 private: 00111 PLMath::Vector3 m_vPositionOffset; /**< Position offset (scene node space) */ 00112 00113 00114 //[-------------------------------------------------------] 00115 //[ Public virtual SceneNode functions ] 00116 //[-------------------------------------------------------] 00117 public: 00118 PLS_API virtual void DrawSolid(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode = nullptr) override; 00119 PLS_API virtual void DrawTransparent(PLRenderer::Renderer &cRenderer, const VisNode *pVisNode = nullptr) override; 00120 00121 00122 //[-------------------------------------------------------] 00123 //[ Private virtual SceneNode functions ] 00124 //[-------------------------------------------------------] 00125 private: 00126 virtual void UpdateAABoundingBox() override; 00127 00128 00129 }; 00130 00131 00132 //[-------------------------------------------------------] 00133 //[ Namespace ] 00134 //[-------------------------------------------------------] 00135 } // PLScene 00136 00137 00138 #endif // __PLSCENE_SCENENODE_BITMAP3D_H__
|