PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: JointBall.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_JOINTBALL_H__ 00024 #define __PLPHYSICS_JOINTBALL_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLMath/Vector3.h> 00032 #include "PLPhysics/Joint.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLPhysics { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Classes ] 00043 //[-------------------------------------------------------] 00044 /** 00045 * @brief 00046 * Abstract PL physics ball and socket (other name: spherical) joint 00047 * 00048 * @remarks 00049 * DOFs removed: 3 DOFs remaining: 3 00050 * 00051 * @note 00052 * - All non-zero value for 'MaxConeAngle' are clamped between 5 degree and 175 degrees 00053 */ 00054 class JointBall : public Joint { 00055 00056 00057 //[-------------------------------------------------------] 00058 //[ Public functions ] 00059 //[-------------------------------------------------------] 00060 public: 00061 /** 00062 * @brief 00063 * Destructor 00064 */ 00065 PLPHYSICS_API virtual ~JointBall(); 00066 00067 /** 00068 * @brief 00069 * Returns the origin of the ball and socket in world space 00070 * 00071 * @return 00072 * The origin of the ball and socket in world space 00073 */ 00074 PLPHYSICS_API const PLMath::Vector3 &GetPivotPoint() const; 00075 00076 /** 00077 * @brief 00078 * Returns the vector defining the cone axis in world space 00079 * 00080 * @return 00081 * The vector defining the cone axis in world space 00082 */ 00083 PLPHYSICS_API const PLMath::Vector3 &GetPinDir() const; 00084 00085 00086 //[-------------------------------------------------------] 00087 //[ Protected functions ] 00088 //[-------------------------------------------------------] 00089 protected: 00090 /** 00091 * @brief 00092 * Constructor 00093 * 00094 * @param[in] cWorld 00095 * World this joint is in 00096 * @param[in] cJointImpl 00097 * Reference to the physics API specific joint implementation 00098 * @param[in] pParentBody 00099 * Pointer to the parent rigid body, can be a null pointer 00100 * @param[in] pChildBody 00101 * Pointer to the attached rigid body, can be a null pointer 00102 * @param[in] vPivotPoint 00103 * Origin of the ball and socket in world space 00104 * @param[in] vPinDir 00105 * Vector defining the cone axis in world space 00106 */ 00107 PLPHYSICS_API JointBall(World &cWorld, JointImpl &cJointImpl, Body *pParentBody, Body *pChildBody, 00108 const PLMath::Vector3 &vPivotPoint, const PLMath::Vector3 &vPinDir); 00109 00110 00111 //[-------------------------------------------------------] 00112 //[ Protected data ] 00113 //[-------------------------------------------------------] 00114 protected: 00115 PLMath::Vector3 m_vPivotPoint; /**< Origin of the ball and socket in world space */ 00116 PLMath::Vector3 m_vPinDir; /**< Vector defining the cone axis in world space */ 00117 // [TODO] 00118 // float m_fMaxConeAngle; 00119 // float m_fMaxTwistAngle; 00120 00121 00122 }; 00123 00124 00125 //[-------------------------------------------------------] 00126 //[ Namespace ] 00127 //[-------------------------------------------------------] 00128 } // PLPhysics 00129 00130 00131 #endif // __PLPHYSICS_JOINTBALL_H__
|