PixelLightAPI  .
JointUpVector.h
Go to the documentation of this file.
00001 /*********************************************************\
00002  *  File: JointUpVector.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_JOINTUPVECTOR_H__
00024 #define __PLPHYSICS_JOINTUPVECTOR_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 up vector joint
00047 *
00048 *  @remarks
00049 *    This function creates an up vector joint. An up vector joint is a constraint that allows a body
00050 *    to translate freely in 3d space, but it only allows the body to rotate around the pin direction
00051 *    vector. This could be use by the application to control a character with physics and collision
00052 *    Since the up vector joint is a unuary constraint, there is not need to have user callback or
00053 *    user data assigned to it. The application can simple hold to the joint handle and update the pin
00054 *    on the force callback function of the rigid body owning the joint.
00055 *
00056 *  @note
00057 *    - This joint type has no parent
00058 */
00059 class JointUpVector : public Joint {
00060 
00061 
00062     //[-------------------------------------------------------]
00063     //[ Public functions                                      ]
00064     //[-------------------------------------------------------]
00065     public:
00066         /**
00067         *  @brief
00068         *    Destructor
00069         */
00070         PLPHYSICS_API virtual ~JointUpVector();
00071 
00072         /**
00073         *  @brief
00074         *    Returns the aligning vector in world space
00075         *
00076         *  @return
00077         *    The aligning vector in world space
00078         */
00079         PLPHYSICS_API const PLMath::Vector3 &GetPinDir() const;
00080 
00081 
00082     //[-------------------------------------------------------]
00083     //[ Protected functions                                   ]
00084     //[-------------------------------------------------------]
00085     protected:
00086         /**
00087         *  @brief
00088         *    Constructor
00089         *
00090         *  @param[in] cWorld
00091         *    World this joint is in
00092         *  @param[in] cJointImpl
00093         *    Reference to the physics API specific joint implementation
00094         *  @param[in] cParentBody
00095         *    Reference to the parent rigid body
00096         *  @param[in] vPinDir
00097         *    The aligning vector in world space
00098         */
00099         PLPHYSICS_API JointUpVector(World &cWorld, JointImpl &cJointImpl, Body &cParentBody, const PLMath::Vector3 &vPinDir);
00100 
00101 
00102     //[-------------------------------------------------------]
00103     //[ Protected data                                        ]
00104     //[-------------------------------------------------------]
00105     protected:
00106         PLMath::Vector3 m_vPinDir;  /**< The aligning vector in world space */
00107 
00108 
00109 };
00110 
00111 
00112 //[-------------------------------------------------------]
00113 //[ Namespace                                             ]
00114 //[-------------------------------------------------------]
00115 } // PLPhysics
00116 
00117 
00118 #endif // __PLPHYSICS_JOINTUPVECTOR_H__


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:08:56
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported