00001 /*************************************************************************** 00002 00003 This source file is part of OGREBULLET 00004 (Object-oriented Graphics Rendering Engine Bullet Wrapper) 00005 For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10 00006 00007 Copyright (c) 2007 tuan.kuranes@gmail.com (Use it Freely, even Statically, but have to contribute any changes) 00008 00009 00010 00011 Permission is hereby granted, free of charge, to any person obtaining a copy 00012 of this software and associated documentation files (the "Software"), to deal 00013 in the Software without restriction, including without limitation the rights 00014 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00015 copies of the Software, and to permit persons to whom the Software is 00016 furnished to do so, subject to the following conditions: 00017 00018 The above copyright notice and this permission notice shall be included in 00019 all copies or substantial portions of the Software. 00020 00021 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00022 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00023 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00024 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00025 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00026 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00027 THE SOFTWARE. 00028 ----------------------------------------------------------------------------- 00029 */ 00030 #ifndef _OGREBULLETDYNAMICS_TypedConstraint_H 00031 #define _OGREBULLETDYNAMICS_TypedConstraint_H 00032 00033 #include "OgreBulletDynamicsPreRequisites.h" 00034 00035 #include "OgreBulletCollisionsObject.h" 00036 00037 00038 namespace OgreBulletDynamics 00039 { 00040 // ------------------------------------------------------------------------- 00041 // basic constraint class 00042 class TypedConstraint 00043 { 00044 public: 00045 TypedConstraint(DynamicsWorld *world); 00046 TypedConstraint(RigidBody *bodyA); 00047 TypedConstraint(RigidBody *bodyA, RigidBody *bodyB); 00048 00049 virtual ~TypedConstraint(); 00050 00051 00052 inline btTypedConstraint* getBulletTypedConstraint() const {return static_cast <btTypedConstraint*> (mConstraint);}; 00053 00054 protected: 00055 btTypedConstraint *mConstraint; 00056 00057 DynamicsWorld *mWorld; 00058 RigidBody *mBodyA; 00059 RigidBody *mBodyB; 00060 }; 00061 // basic constraint action class 00062 class ActionInterface 00063 { 00064 public: 00065 ActionInterface(DynamicsWorld *world); 00066 ActionInterface(RigidBody *bodyA); 00067 ActionInterface(RigidBody *bodyA, RigidBody *bodyB); 00068 00069 virtual ~ActionInterface(); 00070 00071 00072 inline btActionInterface* getBulletActionInterface() const {return static_cast <btActionInterface*> (mActionInterface);}; 00073 00074 protected: 00075 btActionInterface *mActionInterface; 00076 00077 DynamicsWorld *mWorld; 00078 RigidBody *mBodyA; 00079 RigidBody *mBodyB; 00080 }; 00081 } 00082 #endif //_OGREBULLETDYNAMICS_TypedConstraint_H
1.7.1