CrystalSpace

Public API Reference

imesh/animnode/ik.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2010 Christian Van Brussel, Institute of Information
00003       and Communication Technologies, Electronics and Applied Mathematics
00004       at Universite catholique de Louvain, Belgium
00005       http://www.uclouvain.be/en-icteam.html
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_IK_H__
00022 #define __CS_IMESH_ANIMNODE_IK_H__
00023 
00028 #include "csutil/scf_interface.h"
00029 #include "imesh/animnode/skeleton2anim.h"
00030 
00031 struct iMovable;
00032 struct iCamera;
00033 class csOrthoTransform;
00034 
00035 namespace CS {
00036 namespace Mesh {
00037 
00038 struct iAnimatedMesh;
00039 
00040 } // namespace Mesh
00041 } // namespace CS
00042 
00046 namespace CS {
00047 namespace Animation {
00048 
00049 struct iBodyChain;
00050 struct iBodySkeleton;
00051 struct iSkeletonRagdollNode;
00052 
00054 typedef unsigned int EffectorID;
00055 
00056 struct iSkeletonIKNodeFactory;
00057 
00062 struct iSkeletonIKNodeManager
00063   : public virtual CS::Animation::iSkeletonAnimNodeManager<CS::Animation::iSkeletonIKNodeFactory>
00064 {
00065   SCF_ISKELETONANIMNODEMANAGER_INTERFACE (CS::Animation::iSkeletonIKNodeManager, 1, 0, 0);
00066 };
00067 
00081 struct iSkeletonIKNodeFactory : public virtual iSkeletonAnimNodeFactory
00082 {
00083   SCF_INTERFACE(CS::Animation::iSkeletonIKNodeFactory, 2, 0, 0);
00084 
00088   virtual void SetBodySkeleton (CS::Animation::iBodySkeleton* skeleton) = 0;
00089 
00093   virtual CS::Animation::iBodySkeleton* GetBodySkeleton () const = 0;
00094 
00102   virtual void SetChildNode (CS::Animation::iSkeletonAnimNodeFactory* node) = 0;
00103 
00107   virtual CS::Animation::iSkeletonAnimNodeFactory* GetChildNode () const = 0;
00108 
00116   virtual CS::Animation::EffectorID AddEffector (CS::Animation::iBodyChain* chain,
00117                                                  BoneID bone,
00118                                                  csOrthoTransform& transform) = 0;
00119 
00123   virtual void RemoveEffector (CS::Animation::EffectorID effector) = 0;
00124 
00125   // TODO: listeners
00126 };
00127 
00138 struct iSkeletonIKNode : public virtual iSkeletonAnimNode
00139 {
00140   SCF_INTERFACE(CS::Animation::iSkeletonIKNode, 2, 0, 0);
00141 
00147   virtual void AddConstraint (CS::Animation::EffectorID effector,
00148                               csOrthoTransform& transform) = 0;
00149 
00157   virtual void AddConstraint (CS::Animation::EffectorID effector,
00158                               iMovable* target, const csOrthoTransform& offset) = 0;
00159 
00167   virtual void AddConstraint (CS::Animation::EffectorID effector,
00168                               iCamera* target, const csOrthoTransform& offset) = 0;
00169 
00174   virtual void RemoveConstraint (CS::Animation::EffectorID effector) = 0;
00175 };
00176 
00193 struct iSkeletonIKPhysicalNodeFactory : public iSkeletonIKNodeFactory
00194 {
00195   SCF_INTERFACE(CS::Animation::iSkeletonIKPhysicalNodeFactory, 1, 0, 0);
00196 
00205   virtual void SetChainAutoReset (bool reset) = 0;
00206 
00214   virtual bool GetChainAutoReset () const = 0;
00215 };
00216 
00233 struct iSkeletonIKPhysicalNode : public iSkeletonIKNode
00234 {
00235   SCF_INTERFACE(CS::Animation::iSkeletonIKPhysicalNode, 1, 0, 0);
00236 
00241   virtual void SetRagdollNode (CS::Animation::iSkeletonRagdollNode* ragdollNode) = 0;
00242 
00246   virtual CS::Animation::iSkeletonRagdollNode* GetRagdollNode () const = 0;
00247 };
00248 
00268 struct iSkeletonIKCCDNodeFactory : public iSkeletonIKNodeFactory
00269 {
00270   SCF_INTERFACE(CS::Animation::iSkeletonIKCCDNodeFactory, 1, 0, 0);
00271 
00276   virtual void SetMaximumIterations (size_t max) = 0;
00277 
00281   virtual size_t GetMaximumIterations () = 0;
00282 
00287   virtual void SetTargetDistance (float distance) = 0;
00288 
00293   virtual float GetTargetDistance () = 0;
00294 
00300   virtual void SetMotionRatio (float ratio) = 0;
00301 
00306   virtual float GetMotionRatio () = 0;
00307 
00313   virtual void SetJointInitialization (bool initialized) = 0;
00314 
00320   virtual bool GetJointInitialization () = 0;
00321 
00327   virtual void SetUpwardIterations (bool upward) = 0;
00328 
00334   virtual bool GetUpwardIterations () = 0;
00335 };
00336 
00356 struct iSkeletonIKCCDNode : public iSkeletonIKNode
00357 {
00358   SCF_INTERFACE(CS::Animation::iSkeletonIKCCDNode, 1, 0, 0);
00359 
00360 };
00361 
00362 } // namespace Animation
00363 } // namespace CS
00364 
00367 #endif //__CS_IMESH_ANIMNODE_IK_H__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1