PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: SNMPhysicsJointHinge.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 __PLPHYSICS_SCENENODEMODIFIERS_JOINTHINGE_H__ 00024 #define __PLPHYSICS_SCENENODEMODIFIERS_JOINTHINGE_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLMath/Vector3.h> 00032 #include "PLPhysics/SceneNodeModifiers/SNMPhysicsJoint.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLPhysics { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Classes ] 00043 //[-------------------------------------------------------] 00044 /** 00045 * @brief 00046 * Physics hinge joint scene node modifier 00047 */ 00048 class SNMPhysicsJointHinge : public SNMPhysicsJoint { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ RTTI interface ] 00053 //[-------------------------------------------------------] 00054 pl_class(PLPHYSICS_RTTI_EXPORT, SNMPhysicsJointHinge, "PLPhysics", PLPhysics::SNMPhysicsJoint, "Physics hinge joint scene node modifier") 00055 // Attributes 00056 pl_attribute(PivotPoint, PLMath::Vector3, PLMath::Vector3::Zero, ReadWrite, GetSet, "Origin of the hinge in local space", "") 00057 pl_attribute(PinDir, PLMath::Vector3, PLMath::Vector3::UnitY, ReadWrite, GetSet, "The line of action of the hinge in scene container space if the 'LocalPinDirection'-flag is not set, else in local scene node space", "") 00058 // Constructors 00059 pl_constructor_1(ParameterConstructor, PLScene::SceneNode&, "Parameter constructor", "") 00060 pl_class_end 00061 00062 00063 //[-------------------------------------------------------] 00064 //[ Public RTTI get/set functions ] 00065 //[-------------------------------------------------------] 00066 public: 00067 PLPHYSICS_API const PLMath::Vector3 &GetPivotPoint() const; 00068 PLPHYSICS_API void SetPivotPoint(const PLMath::Vector3 &vValue); 00069 PLPHYSICS_API const PLMath::Vector3 &GetPinDir() const; 00070 PLPHYSICS_API void SetPinDir(const PLMath::Vector3 &vValue); 00071 00072 00073 //[-------------------------------------------------------] 00074 //[ Public functions ] 00075 //[-------------------------------------------------------] 00076 public: 00077 /** 00078 * @brief 00079 * Constructor 00080 * 00081 * @param[in] cSceneNode 00082 * Owner scene node 00083 */ 00084 PLPHYSICS_API SNMPhysicsJointHinge(PLScene::SceneNode &cSceneNode); 00085 00086 /** 00087 * @brief 00088 * Destructor 00089 */ 00090 PLPHYSICS_API virtual ~SNMPhysicsJointHinge(); 00091 00092 00093 //[-------------------------------------------------------] 00094 //[ Private data ] 00095 //[-------------------------------------------------------] 00096 private: 00097 PLMath::Vector3 m_vPivotPoint; /**< Origin of the hinge in local space */ 00098 PLMath::Vector3 m_vPinDir; /**< The line of action of the hinge in local space */ 00099 00100 00101 //[-------------------------------------------------------] 00102 //[ Private virtual SNMPhysicsJoint functions ] 00103 //[-------------------------------------------------------] 00104 private: 00105 virtual void CreatePhysicsJoint() override; 00106 00107 00108 }; 00109 00110 00111 //[-------------------------------------------------------] 00112 //[ Namespace ] 00113 //[-------------------------------------------------------] 00114 } // PLPhysics 00115 00116 00117 #endif // __PLPHYSICS_SCENENODEMODIFIERS_JOINTHINGE_H__
|