1 | /*************************************************************************** |
---|
2 | |
---|
3 | This source file is part of OGREBULLET |
---|
4 | (Object-oriented Graphics Rendering Engine Bullet Wrapper) |
---|
5 | For the latest info, see http://www.ogre3d.org/phpBB2addons/viewforum.php?f=10 |
---|
6 | |
---|
7 | Copyright (c) 2007 tuan.kuranes@gmail.com |
---|
8 | |
---|
9 | |
---|
10 | |
---|
11 | This program is free software; you can redistribute it and/or modify it under |
---|
12 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
13 | Foundation; either version 2 of the License, or (at your option) any later |
---|
14 | version. |
---|
15 | |
---|
16 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
17 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
18 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
19 | |
---|
20 | You should have received a copy of the GNU Lesser General Public License along with |
---|
21 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
22 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
23 | http://www.gnu.org/copyleft/lesser.txt. |
---|
24 | ----------------------------------------------------------------------------- |
---|
25 | */ |
---|
26 | |
---|
27 | |
---|
28 | #ifndef _OGREBULLETCOLLISIONS_RagDoll_H |
---|
29 | #define _OGREBULLETCOLLISIONS_RagDoll_H |
---|
30 | |
---|
31 | |
---|
32 | #include "OgreBulletDynamicsPreRequisites.h" |
---|
33 | |
---|
34 | |
---|
35 | namespace OgreBulletDynamics |
---|
36 | { |
---|
37 | // ------------------------------------------------------------------------- |
---|
38 | // basic CollisionWorld |
---|
39 | class RagDoll |
---|
40 | { |
---|
41 | public: |
---|
42 | RagDoll (btDynamicsWorld* ownerWorld, |
---|
43 | const btVector3& positionOffset); |
---|
44 | |
---|
45 | virtual ~RagDoll (); |
---|
46 | |
---|
47 | // Make ragdoll active. |
---|
48 | void ragdollEnable(bool doEnable); |
---|
49 | // is ragdoll active. |
---|
50 | bool isRagdollEnabled(); |
---|
51 | |
---|
52 | // Make constraint between body part active. |
---|
53 | void constraintEnable(bool value); |
---|
54 | // are constraint between body part active ? |
---|
55 | bool isConstraintEnabled(); |
---|
56 | |
---|
57 | // Make it collidable or not. |
---|
58 | void collisionEnable(bool value); |
---|
59 | // if shapes can collide |
---|
60 | bool isCollisionEnabled(); |
---|
61 | |
---|
62 | // Make it fixed in a pose or not. |
---|
63 | void rigidityEnable(bool value); |
---|
64 | // is it fixed on a pose? |
---|
65 | bool isRigidityEnable(); |
---|
66 | |
---|
67 | |
---|
68 | protected: |
---|
69 | btDynamicsWorld* m_ownerWorld; |
---|
70 | |
---|
71 | std::vector<btCollisionShape* > m_shapes; |
---|
72 | std::vector<btRigidBody* > m_bodies; |
---|
73 | std::vector<btTypedConstraint* > m_joints; |
---|
74 | |
---|
75 | btRigidBody* localCreateRigidBody (btScalar mass, |
---|
76 | const btTransform& startTransform, |
---|
77 | btCollisionShape* shape); |
---|
78 | |
---|
79 | }; |
---|
80 | } |
---|
81 | #endif //_OGREBULLETCOLLISIONS_CollisionWorld_H |
---|
82 | |
---|