PixelLightAPI  .
SNMPhysicsBodyBox.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: SNMPhysicsBodyBox.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_BODYBOX_H__
00024 #define __PLPHYSICS_SCENENODEMODIFIERS_BODYBOX_H__
00025 #pragma once
00026 
00027 
00028 //[-------------------------------------------------------]
00029 //[ Includes                                              ]
00030 //[-------------------------------------------------------]
00031 #include "PLPhysics/SceneNodeModifiers/SNMPhysicsBody.h"
00032 
00033 
00034 //[-------------------------------------------------------]
00035 //[ Forward declarations                                  ]
00036 //[-------------------------------------------------------]
00037 namespace PLRenderer {
00038     class Renderer;
00039 }
00040 namespace PLScene {
00041     class VisNode;
00042 }
00043 
00044 
00045 //[-------------------------------------------------------]
00046 //[ Namespace                                             ]
00047 //[-------------------------------------------------------]
00048 namespace PLPhysics {
00049 
00050 
00051 //[-------------------------------------------------------]
00052 //[ Classes                                               ]
00053 //[-------------------------------------------------------]
00054 /**
00055 *  @brief
00056 *    Physics box body scene node modifier
00057 */
00058 class SNMPhysicsBodyBox : public SNMPhysicsBody {
00059 
00060 
00061     //[-------------------------------------------------------]
00062     //[ RTTI interface                                        ]
00063     //[-------------------------------------------------------]
00064     pl_class(PLPHYSICS_RTTI_EXPORT, SNMPhysicsBodyBox, "PLPhysics", PLPhysics::SNMPhysicsBody, "Physics box body scene node modifier")
00065         // Attributes
00066         pl_attribute(Dimension, PLMath::Vector3,    PLMath::Vector3(0.0f, 0.0f, 0.0f),  ReadWrite,  GetSet, "Box dimension, if null, axis align bounding box in 'scene node space' is used as default", "Min='0.0 0.0 0.0'")
00067         // Constructors
00068         pl_constructor_1(ParameterConstructor,  PLScene::SceneNode&,    "Parameter constructor",    "")
00069         // Slots
00070         pl_slot_2(OnDrawDebug,  PLRenderer::Renderer&,  const PLScene::VisNode*,    "Called on scene node debug draw, the used renderer as first parameter, the current visibility node of this scene node as second parameter (can be a null pointer)",    "")
00071     pl_class_end
00072 
00073 
00074     //[-------------------------------------------------------]
00075     //[ Public RTTI get/set functions                         ]
00076     //[-------------------------------------------------------]
00077     public:
00078         PLPHYSICS_API const PLMath::Vector3 &GetDimension() const;
00079         PLPHYSICS_API void SetDimension(const PLMath::Vector3 &vValue);
00080 
00081 
00082     //[-------------------------------------------------------]
00083     //[ Public functions                                      ]
00084     //[-------------------------------------------------------]
00085     public:
00086         /**
00087         *  @brief
00088         *    Constructor
00089         *
00090         *  @param[in] cSceneNode
00091         *    Owner scene node
00092         */
00093         PLPHYSICS_API SNMPhysicsBodyBox(PLScene::SceneNode &cSceneNode);
00094 
00095         /**
00096         *  @brief
00097         *    Destructor
00098         */
00099         PLPHYSICS_API virtual ~SNMPhysicsBodyBox();
00100 
00101 
00102     //[-------------------------------------------------------]
00103     //[ Private functions                                     ]
00104     //[-------------------------------------------------------]
00105     private:
00106         /**
00107         *  @brief
00108         *    Called on scene node debug draw
00109         *
00110         *  @param[in] cRenderer
00111         *    The used renderer
00112         *  @param[in] pVisNode
00113         *    The current visibility node of this scene node, can be a null pointer
00114         */
00115         void OnDrawDebug(PLRenderer::Renderer &cRenderer, const PLScene::VisNode *pVisNode);
00116 
00117 
00118     //[-------------------------------------------------------]
00119     //[ Private data                                          ]
00120     //[-------------------------------------------------------]
00121     private:
00122         PLMath::Vector3 m_vDimension;   /**< Box dimension, if null, axis align bounding box in 'scene node space' is used as default */
00123 
00124 
00125     //[-------------------------------------------------------]
00126     //[ Private virtual PLScene::SceneNodeModifier functions  ]
00127     //[-------------------------------------------------------]
00128     private:
00129         virtual void OnActivate(bool bActivate) override;
00130 
00131 
00132     //[-------------------------------------------------------]
00133     //[ Private virtual SNMPhysicsBody functions              ]
00134     //[-------------------------------------------------------]
00135     private:
00136         virtual void CreatePhysicsBody() override;
00137 
00138 
00139 };
00140 
00141 
00142 //[-------------------------------------------------------]
00143 //[ Namespace                                             ]
00144 //[-------------------------------------------------------]
00145 } // PLPhysics
00146 
00147 
00148 #endif // __PLPHYSICS_SCENENODEMODIFIERS_BODYBOX_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