PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNMBillboardCylindrical.h * 00003 * 00004 * Copyright (C) 2002-2012 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_SCENENODEMODIFIER_BILLBOARDCYLINDRICAL_H__ 00024 #define __PLSCENE_SCENENODEMODIFIER_BILLBOARDCYLINDRICAL_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLMath/Vector3.h> 00032 #include "PLScene/Scene/SceneNodeModifiers/SNMBillboard.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Forward declarations ] 00037 //[-------------------------------------------------------] 00038 namespace PLScene { 00039 class VisNode; 00040 } 00041 00042 00043 //[-------------------------------------------------------] 00044 //[ Namespace ] 00045 //[-------------------------------------------------------] 00046 namespace PLScene { 00047 00048 00049 //[-------------------------------------------------------] 00050 //[ Classes ] 00051 //[-------------------------------------------------------] 00052 /** 00053 * @brief 00054 * Cylindrical (axis aligned) billboard scene node modifier class 00055 * 00056 * @note 00057 * - The scale of the owner scene node is taken into account 00058 */ 00059 class SNMBillboardCylindrical : public SNMBillboard { 00060 00061 00062 //[-------------------------------------------------------] 00063 //[ RTTI interface ] 00064 //[-------------------------------------------------------] 00065 pl_class(PLS_RTTI_EXPORT, SNMBillboardCylindrical, "PLScene", PLScene::SNMBillboard, "Cylindrical (axis aligned) billboard scene node modifier class") 00066 // Attributes 00067 pl_attribute(UpVector, PLMath::Vector3, PLMath::Vector3::UnitY, ReadWrite, DirectValue, "Up vector", "") 00068 // Constructors 00069 pl_constructor_1(ParameterConstructor, SceneNode&, "Parameter constructor", "") 00070 // Slots 00071 pl_slot_1(OnAddedToVisibilityTree, VisNode&, "Called when the owner scene node was added to a visibility tree, visibility node which is representing the owner scene node within the visibility tree as first parameter", "") 00072 pl_class_end 00073 00074 00075 //[-------------------------------------------------------] 00076 //[ Public functions ] 00077 //[-------------------------------------------------------] 00078 public: 00079 /** 00080 * @brief 00081 * Constructor 00082 * 00083 * @param[in] cSceneNode 00084 * Owner scene node 00085 */ 00086 PLS_API SNMBillboardCylindrical(SceneNode &cSceneNode); 00087 00088 /** 00089 * @brief 00090 * Destructor 00091 */ 00092 PLS_API virtual ~SNMBillboardCylindrical(); 00093 00094 00095 //[-------------------------------------------------------] 00096 //[ Protected virtual SceneNodeModifier functions ] 00097 //[-------------------------------------------------------] 00098 protected: 00099 PLS_API virtual void OnActivate(bool bActivate) override; 00100 00101 00102 //[-------------------------------------------------------] 00103 //[ Private functions ] 00104 //[-------------------------------------------------------] 00105 private: 00106 /** 00107 * @brief 00108 * Builds a transform matrix 00109 * 00110 * @param[in] mView 00111 * View matrix 00112 * @param[in] mWorld 00113 * World matrix 00114 * @param[out] mTransform 00115 * Receives the new world transform matrix 00116 */ 00117 void BuildTransformMatrix(const PLMath::Matrix4x4 &mView, const PLMath::Matrix4x4 &mWorld, PLMath::Matrix3x4 &mTransform); 00118 00119 /** 00120 * @brief 00121 * Called when the owner scene node was added to a visibility tree 00122 * 00123 * @param[in] cVisNode 00124 * Visibility node which is representing the owner scene node within the visibility tree 00125 */ 00126 void OnAddedToVisibilityTree(VisNode &cVisNode); 00127 00128 00129 }; 00130 00131 00132 //[-------------------------------------------------------] 00133 //[ Namespace ] 00134 //[-------------------------------------------------------] 00135 } // PLScene 00136 00137 00138 #endif // __PLSCENE_SCENENODEMODIFIER_BILLBOARDCYLINDRICAL_H__
|