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