imesh/animnode/ragdoll2.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2009-10 Christian Van Brussel, Communications and Remote 00003 Sensing Laboratory of the School of Engineering at the 00004 Universite catholique de Louvain, Belgium 00005 http://www.tele.ucl.ac.be 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Library General Public 00009 License as published by the Free Software Foundation; either 00010 version 2 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Library General Public License for more details. 00016 00017 You should have received a copy of the GNU Library General Public 00018 License along with this library; if not, write to the Free 00019 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00020 */ 00021 #ifndef __CS_IMESH_ANIMNODE_RAGDOLL_H__ 00022 #define __CS_IMESH_ANIMNODE_RAGDOLL_H__ 00023 00028 #include "csutil/scf_interface.h" 00029 00030 #include "ivaria/physics.h" 00031 #include "imesh/bodymesh.h" 00032 00036 namespace CS { 00037 namespace Mesh { 00038 00039 struct iAnimatedMesh; 00040 00041 } // namespace Mesh 00042 } // namespace CS 00043 00044 namespace CS{ 00045 namespace Physics{ 00046 00047 struct iPhysicalSystem; 00048 struct iRigidBody; 00049 struct iJoint; 00050 00051 } 00052 } 00053 00054 namespace CS { 00055 namespace Animation { 00056 00060 enum RagdollState 00061 { 00062 STATE_INACTIVE = 0, 00063 STATE_DYNAMIC, 00065 STATE_KINEMATIC 00068 }; 00069 00070 struct iSkeletonRagdollNodeFactory2; 00071 00076 struct iSkeletonRagdollNodeManager2 00077 : public virtual CS::Animation::iSkeletonAnimNodeManager<CS::Animation::iSkeletonRagdollNodeFactory2> 00078 { 00079 SCF_ISKELETONANIMNODEMANAGER_INTERFACE (CS::Animation::iSkeletonRagdollNodeManager2, 1, 0, 0); 00080 }; 00081 00083 // * The physical state of a body chain. 00084 // */ 00085 //enum RagdollState 00086 //{ 00087 // STATE_INACTIVE = 0, /*!< The chain is physically inactive. */ 00088 // STATE_DYNAMIC, /*!< The chain is dynamic, ie the motion of 00089 // the chain is controlled by the dynamic simulation. */ 00090 // STATE_KINEMATIC /*!< The chain is kinematic, ie the motion 00091 // of the chain is controlled by the animation system, 00092 // but its bones do interact with the dynamic simulation. */ 00093 //}; 00094 00098 struct iSkeletonRagdollNodeFactory2 : public virtual iSkeletonAnimNodeFactory 00099 { 00100 SCF_INTERFACE(CS::Animation::iSkeletonRagdollNodeFactory2, 1, 0, 0); 00101 00105 virtual void SetBodySkeleton (CS::Animation::iBodySkeleton* skeleton) = 0; 00106 00110 virtual CS::Animation::iBodySkeleton* GetBodySkeleton () const = 0; 00111 00117 virtual void AddBodyChain (iBodyChain* chain, RagdollState state = STATE_INACTIVE) = 0; 00118 00122 virtual void RemoveBodyChain (iBodyChain* chain) = 0; 00123 00136 virtual void SetChildNode (iSkeletonAnimNodeFactory* node) = 0; 00137 00141 virtual iSkeletonAnimNodeFactory* GetChildNode () const = 0; 00142 }; 00143 00149 struct iSkeletonRagdollNode2 : public virtual iSkeletonAnimNode 00150 { 00151 SCF_INTERFACE(CS::Animation::iSkeletonRagdollNode2, 1, 0, 0); 00152 00156 virtual void SetPhysicalSystem (CS::Physics::iPhysicalSystem* system) = 0; 00157 00161 virtual CS::Physics::iPhysicalSystem* GetPhysicalSystem () const = 0; 00162 00168 virtual void SetPhysicalSector (CS::Physics::iPhysicalSector* sector) = 0; 00169 00173 virtual CS::Physics::iPhysicalSector* GetPhysicalSector () const = 0; 00174 00178 virtual void SetBodyChainState (iBodyChain* chain, RagdollState state) = 0; 00179 00183 virtual RagdollState GetBodyChainState (iBodyChain* chain) const = 0; 00184 00188 virtual CS::Physics::iRigidBody* GetBoneRigidBody (BoneID bone) = 0; 00189 00193 virtual CS::Physics::iJoint* GetBoneJoint (const BoneID bone) = 0; 00194 00198 virtual uint GetBoneCount (RagdollState state) const = 0; 00199 00203 virtual BoneID GetBone (RagdollState state, uint index) const = 0; 00204 00215 virtual void ResetChainTransform (iBodyChain* chain) = 0; 00216 00222 virtual BoneID GetRigidBodyBone (CS::Physics::iRigidBody* body) const = 0; 00223 }; 00224 00225 } // namespace Animation 00226 } // namespace CS 00227 00230 #endif //__CS_IMESH_ANIMNODE_RAGDOLL_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
