imesh/animnode/noise.h
Go to the documentation of this file.00001 /* 00002 Copyright (C) 2011 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_NOISE_H__ 00022 #define __CS_IMESH_ANIMNODE_NOISE_H__ 00023 00028 #include "csutil/scf_interface.h" 00029 #include "imesh/animnode/skeleton2anim.h" 00030 00031 namespace CS { 00032 namespace Math { 00033 namespace Noise { 00034 namespace Module { 00035 00036 class Module; 00037 00038 } // namespace Module 00039 } // namespace Noise 00040 } // namespace Math 00041 } // namespace CS 00042 00046 namespace CS { 00047 namespace Animation { 00048 00049 struct iSkeletonNoiseNodeFactory; 00050 00055 struct iSkeletonNoiseNodeManager 00056 : public virtual CS::Animation::iSkeletonAnimNodeManager<CS::Animation::iSkeletonNoiseNodeFactory> 00057 { 00058 SCF_ISKELETONANIMNODEMANAGER_INTERFACE (CS::Animation::iSkeletonNoiseNodeManager, 1, 0, 0); 00059 }; 00060 00061 // ----------------------------- iSkeletonNoiseNode ----------------------------- 00062 00066 enum SkeletonNoiseChannel 00067 { 00068 NOISE_ROTATION, 00072 NOISE_POSITION 00076 }; 00077 00084 class SkeletonNoise : public csRefCount 00085 { 00086 public: 00087 00089 SkeletonNoise () 00090 { 00091 components[0] = nullptr; 00092 components[1] = nullptr; 00093 components[2] = nullptr; 00094 } 00095 00097 virtual inline ~SkeletonNoise () {} 00098 00104 inline void SetComponent (size_t index, CS::Math::Noise::Module::Module* module) 00105 { 00106 CS_ASSERT (index < 3); 00107 components[index] = module; 00108 } 00109 00116 inline CS::Math::Noise::Module::Module* GetComponent (size_t index) 00117 { 00118 CS_ASSERT (index < 3); 00119 return components[index]; 00120 } 00121 00122 protected: 00123 CS::Math::Noise::Module::Module* components[3]; 00124 }; 00125 00132 struct iSkeletonNoiseNodeFactory : public virtual iSkeletonAnimNodeFactory 00133 { 00134 SCF_INTERFACE(CS::Animation::iSkeletonNoiseNodeFactory, 1, 0, 0); 00135 00142 virtual size_t AddSkeletonNoise (SkeletonNoise* noise) = 0; 00143 00162 virtual void AddBoneNoise (BoneID bone, size_t noiseIndex, 00163 SkeletonNoiseChannel channel, float x, float y, 00164 csVector3 weight = csVector3 (1.0f)) = 0; 00165 00170 virtual void SetChildNode (CS::Animation::iSkeletonAnimNodeFactory* factory) = 0; 00171 00175 virtual iSkeletonAnimNodeFactory* GetChildNode () const = 0; 00176 }; 00177 00182 struct iSkeletonNoiseNode : public virtual iSkeletonAnimNode 00183 { 00184 SCF_INTERFACE(iSkeletonNoiseNode, 2, 0, 0); 00185 }; 00186 00187 } // namespace Animation 00188 } // namespace CS 00189 00192 #endif //__CS_IMESH_ANIMNODE_NOISE_H__
Generated for Crystal Space 2.1 by doxygen 1.6.1
