CrystalSpace

Public API Reference

imesh/animnode/lookat.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2009 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_LOOKAT_H__
00022 #define __CS_IMESH_ANIMNODE_LOOKAT_H__
00023 
00028 #include "csutil/scf_interface.h"
00029 
00030 #include "imesh/animnode/skeleton2anim.h"
00031 
00035 struct iMovable;
00036 struct iCamera;
00037 
00038 namespace CS {
00039 namespace Animation {
00040 
00041 struct iBodySkeleton;
00042 struct iSkeletonLookAtNodeFactory;
00043 struct iSkeletonLookAtListener;
00044 
00049 struct iSkeletonLookAtNodeManager
00050   : public virtual CS::Animation::iSkeletonAnimNodeManager<CS::Animation::iSkeletonLookAtNodeFactory>
00051 {
00052   SCF_ISKELETONANIMNODEMANAGER_INTERFACE (CS::Animation::iSkeletonLookAtNodeManager, 1, 0, 0);
00053 };
00054 
00071 struct iSkeletonLookAtNodeFactory : public virtual iSkeletonAnimNodeFactory
00072 {
00073   SCF_INTERFACE(CS::Animation::iSkeletonLookAtNodeFactory, 2, 0, 1);
00074 
00085   virtual void SetBodySkeleton (iBodySkeleton* skeleton) = 0;
00086 
00090   virtual void SetBone (BoneID boneID) = 0;
00091 
00098   virtual void SetMaximumSpeed (float speed) = 0;
00099 
00104   virtual void SetAlwaysRotate (bool alwaysRotate) = 0;
00105 
00113   virtual void SetListenerDelay (float delay) = 0;
00114 
00123   virtual void SetChildNode (iSkeletonAnimNodeFactory* node) = 0;
00124 
00128   virtual iSkeletonAnimNodeFactory* GetChildNode () const = 0;
00129 
00134   virtual void SetDirection (const csMatrix3& direction) = 0;
00135 
00139   virtual void GetDirection (csMatrix3& direction) const = 0;
00140 };
00141 
00146 struct iSkeletonLookAtNode : public virtual iSkeletonAnimNode
00147 {
00148   SCF_INTERFACE(CS::Animation::iSkeletonLookAtNode, 2, 0, 0);
00149 
00153   virtual bool HasTarget () = 0;
00154 
00161   virtual void SetTarget (csVector3 target) = 0;
00162 
00170   virtual void SetTarget (iMovable* target, const csVector3& offset) = 0;
00171 
00172   // TODO: remove this method once iCamera has iMovable implemented
00180   virtual void SetTarget (iCamera* target, const csVector3& offset) = 0;
00181 
00188   virtual void RemoveTarget () = 0;
00189 
00193   virtual void AddListener (iSkeletonLookAtListener* listener) = 0;
00194 
00198   virtual void RemoveListener (iSkeletonLookAtListener* listener) = 0;
00199 };
00200 
00205 struct iSkeletonLookAtListener : public virtual iBase
00206 {
00207   SCF_INTERFACE (CS::Animation::iSkeletonLookAtListener, 1, 0, 0);
00208 
00212   virtual void TargetReached () = 0;
00213 
00217   virtual void TargetLost () = 0;
00218 };
00219 
00220 } // namespace Animation
00221 } // namespace CS
00222 
00225 #endif //__CS_IMESH_ANIMNODE_LOOKAT_H__

Generated for Crystal Space 2.0 by doxygen 1.7.6.1