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 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 00031 00032 #ifndef _OGREBULLETCOLLISIONS_RagDoll_H 00033 #define _OGREBULLETCOLLISIONS_RagDoll_H 00034 00035 00036 #include "OgreBulletDynamicsPreRequisites.h" 00037 00038 00039 namespace OgreBulletDynamics 00040 { 00041 // ------------------------------------------------------------------------- 00042 // basic CollisionWorld 00043 class RagDoll 00044 { 00045 public: 00046 RagDoll (btDynamicsWorld* ownerWorld, 00047 const btVector3& positionOffset); 00048 00049 virtual ~RagDoll (); 00050 00051 // Make ragdoll active. 00052 void ragdollEnable(bool doEnable); 00053 // is ragdoll active. 00054 bool isRagdollEnabled(); 00055 00056 // Make constraint between body part active. 00057 void constraintEnable(bool value); 00058 // are constraint between body part active ? 00059 bool isConstraintEnabled(); 00060 00061 // Make it collidable or not. 00062 void collisionEnable(bool value); 00063 // if shapes can collide 00064 bool isCollisionEnabled(); 00065 00066 // Make it fixed in a pose or not. 00067 void rigidityEnable(bool value); 00068 // is it fixed on a pose? 00069 bool isRigidityEnable(); 00070 00071 00072 protected: 00073 btDynamicsWorld* m_ownerWorld; 00074 00075 std::vector<btCollisionShape* > m_shapes; 00076 std::vector<btRigidBody* > m_bodies; 00077 std::vector<btTypedConstraint* > m_joints; 00078 00079 btRigidBody* localCreateRigidBody (btScalar mass, 00080 const btTransform& startTransform, 00081 btCollisionShape* shape); 00082 00083 }; 00084 } 00085 #endif //_OGREBULLETCOLLISIONS_CollisionWorld_H 00086
1.7.1