PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNMPhysicsBodyCone.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 __PLPHYSICS_SCENENODEMODIFIERS_BODYCONE_H__ 00024 #define __PLPHYSICS_SCENENODEMODIFIERS_BODYCONE_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLPhysics/SceneNodeModifiers/SNMPhysicsBody.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Namespace ] 00036 //[-------------------------------------------------------] 00037 namespace PLPhysics { 00038 00039 00040 //[-------------------------------------------------------] 00041 //[ Classes ] 00042 //[-------------------------------------------------------] 00043 /** 00044 * @brief 00045 * Physics cone body scene node modifier 00046 * 00047 * @note 00048 * - The cone height must equal of larger than the sum of the cap radius. If this is not 00049 * the case the height will be clamped the 2 * radius. 00050 */ 00051 class SNMPhysicsBodyCone : public SNMPhysicsBody { 00052 00053 00054 //[-------------------------------------------------------] 00055 //[ RTTI interface ] 00056 //[-------------------------------------------------------] 00057 pl_class(PLPHYSICS_RTTI_EXPORT, SNMPhysicsBodyCone, "PLPhysics", PLPhysics::SNMPhysicsBody, "Physics cone body scene node modifier") 00058 // Attributes 00059 pl_attribute(Radius, float, 1.0f, ReadWrite, GetSet, "Cone radius at the base", "Min='0.0'") 00060 pl_attribute(Height, float, 1.0f, ReadWrite, GetSet, "Cone height along the x local axis from base to tip", "Min='0.0'") 00061 // Constructors 00062 pl_constructor_1(ParameterConstructor, PLScene::SceneNode&, "Parameter constructor", "") 00063 pl_class_end 00064 00065 00066 //[-------------------------------------------------------] 00067 //[ Public RTTI get/set functions ] 00068 //[-------------------------------------------------------] 00069 public: 00070 PLPHYSICS_API float GetRadius() const; 00071 PLPHYSICS_API void SetRadius(float fValue); 00072 PLPHYSICS_API float GetHeight() const; 00073 PLPHYSICS_API void SetHeight(float fValue); 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 PLPHYSICS_API SNMPhysicsBodyCone(PLScene::SceneNode &cSceneNode); 00088 00089 /** 00090 * @brief 00091 * Destructor 00092 */ 00093 PLPHYSICS_API virtual ~SNMPhysicsBodyCone(); 00094 00095 00096 //[-------------------------------------------------------] 00097 //[ Private data ] 00098 //[-------------------------------------------------------] 00099 private: 00100 float m_fRadius; /**< Cone radius at the base */ 00101 float m_fHeight; /**< Cone height along the x local axis from base to tip */ 00102 00103 00104 //[-------------------------------------------------------] 00105 //[ Private virtual SNMPhysicsBody functions ] 00106 //[-------------------------------------------------------] 00107 private: 00108 virtual void CreatePhysicsBody() override; 00109 00110 00111 }; 00112 00113 00114 //[-------------------------------------------------------] 00115 //[ Namespace ] 00116 //[-------------------------------------------------------] 00117 } // PLPhysics 00118 00119 00120 #endif // __PLPHYSICS_SCENENODEMODIFIERS_BODYCONE_H__
|