PixelLightAPI  .
SNMPhysicsBodyCapsule.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNMPhysicsBodyCapsule.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_BODYCAPSULE_H__
00024 #define __PLPHYSICS_SCENENODEMODIFIERS_BODYCAPSULE_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 capsule body scene node modifier
00046 *
00047 *  @note
00048 *    - The capsule height must equal of larger than the sum of the cap radius. If this
00049 *      is not the case the height will be clamped the 2 * radius.
00050 */
00051 class SNMPhysicsBodyCapsule : public SNMPhysicsBody {
00052 
00053 
00054     //[-------------------------------------------------------]
00055     //[ RTTI interface                                        ]
00056     //[-------------------------------------------------------]
00057     pl_class(PLPHYSICS_RTTI_EXPORT, SNMPhysicsBodyCapsule, "PLPhysics", PLPhysics::SNMPhysicsBody, "Physics capsule body scene node modifier")
00058         // Attributes
00059         pl_attribute(Radius,    float,  1.0f,   ReadWrite,  GetSet, "Capsule radius at the base",                               "Min='0.0'")
00060         pl_attribute(Height,    float,  1.0f,   ReadWrite,  GetSet, "Capsule height along the x local axis from base to top",   "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 SNMPhysicsBodyCapsule(PLScene::SceneNode &cSceneNode);
00088 
00089         /**
00090         *  @brief
00091         *    Destructor
00092         */
00093         PLPHYSICS_API virtual ~SNMPhysicsBodyCapsule();
00094 
00095 
00096     //[-------------------------------------------------------]
00097     //[ Private data                                          ]
00098     //[-------------------------------------------------------]
00099     private:
00100         float m_fRadius;    /**< Capsule radius at the base */
00101         float m_fHeight;    /**< Capsule height along the x local axis from base to top */
00102 
00103 
00104     //[-------------------------------------------------------]
00105     //[ Private virtual SNMPhysicsBody functions              ]
00106     //[-------------------------------------------------------]
00107     private:
00108         virtual void CreatePhysicsBody() override;
00109 
00110 };
00111 
00112 
00113 //[-------------------------------------------------------]
00114 //[ Namespace                                             ]
00115 //[-------------------------------------------------------]
00116 } // PLPhysics
00117 
00118 
00119 #endif // __PLPHYSICS_SCENENODEMODIFIERS_BODYCAPSULE_H__


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:02
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported