Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/char/computedVerticesMorph.h

Go to the documentation of this file.
00001 // Filename: computedVerticesMorph.h
00002 // Created by:  drose (03Mar99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef COMPUTEDVERTICESMORPH_H
00020 #define COMPUTEDVERTICESMORPH_H
00021 
00022 #include <pandabase.h>
00023 #include <vector_typedWritable.h>
00024 
00025 #include <luse.h>
00026 
00027 class CharacterSlider;
00028 class BamReader;
00029 class BamWriter;
00030 class Datagram;
00031 class DatagramIterator;
00032 class TypedWritable;
00033 
00034 ////////////////////////////////////////////////////////////////////
00035 //       Class : ComputedVerticesMorphValue2
00036 // Description : This is a single vertex morph offset value.  This is
00037 //               the amount by which the given vertex will be offset
00038 //               when the morph is full on.
00039 ////////////////////////////////////////////////////////////////////
00040 class EXPCL_PANDA ComputedVerticesMorphValue2 {
00041 public:
00042   typedef LVector2f VecType;
00043 
00044   INLINE ComputedVerticesMorphValue2(int index, const VecType &mvector);
00045   INLINE ComputedVerticesMorphValue2(void);
00046 
00047   ushort _index;
00048   VecType _vector;
00049 
00050 public:
00051   void write_datagram(Datagram &dest);
00052   void read_datagram(DatagramIterator &source);
00053 };
00054 
00055 ////////////////////////////////////////////////////////////////////
00056 //       Class : ComputedVerticesMorphValue3
00057 // Description : This is a single vertex morph offset value.  This is
00058 //               the amount by which the given vertex will be offset
00059 //               when the morph is full on.
00060 ////////////////////////////////////////////////////////////////////
00061 class EXPCL_PANDA ComputedVerticesMorphValue3 {
00062 public:
00063   typedef LVector3f VecType;
00064 
00065   INLINE ComputedVerticesMorphValue3(int index, const VecType &mvector);
00066   INLINE ComputedVerticesMorphValue3(void);
00067 
00068   ushort _index;
00069   VecType _vector;
00070 
00071 public:
00072   void write_datagram(Datagram &dest);
00073   void read_datagram(DatagramIterator &source);
00074 };
00075 
00076 ////////////////////////////////////////////////////////////////////
00077 //       Class : ComputedVerticesMorphValue4
00078 // Description : This is a single vertex morph offset value.  This is
00079 //               the amount by which the given vertex will be offset
00080 //               when the morph is full on.
00081 ////////////////////////////////////////////////////////////////////
00082 class EXPCL_PANDA ComputedVerticesMorphValue4 {
00083 public:
00084   typedef LVector4f VecType;
00085 
00086   INLINE ComputedVerticesMorphValue4(int index, const VecType &mvector);
00087   INLINE ComputedVerticesMorphValue4(void);
00088 
00089   ushort _index;
00090   VecType _vector;
00091 
00092 public:
00093   void write_datagram(Datagram &dest);
00094   void read_datagram(DatagramIterator &source);
00095 };
00096 
00097 ////////////////////////////////////////////////////////////////////
00098 //       Class : ComputedVerticesMorph
00099 // Description : A list of MorphValues, this represents the complete
00100 //               effect of a given morph target on a particular class
00101 //               of vertex values.
00102 ////////////////////////////////////////////////////////////////////
00103 template<class ValueType, class MorphValueType>
00104 class ComputedVerticesMorph {
00105 public:
00106   INLINE ComputedVerticesMorph();
00107   INLINE ComputedVerticesMorph(const ComputedVerticesMorph &copy);
00108 
00109   typedef MorphValueType MorphValue;
00110   typedef pvector<MorphValue> Morphs;
00111 
00112   void output(ostream &out) const;
00113 
00114   short _slider_index;
00115   Morphs _morphs;
00116 
00117 public:
00118   void write_datagram(Datagram &dest);
00119   void read_datagram(DatagramIterator &source);
00120 };
00121 
00122 template<class ValueType, class MorphValueType>
00123 inline ostream &operator << (ostream &out, const ComputedVerticesMorph<ValueType, MorphValueType> &morph) {
00124   morph.output(out);
00125   return out;
00126 }
00127 
00128 typedef ComputedVerticesMorph<Vertexf, ComputedVerticesMorphValue3> ComputedVerticesMorphVertex;
00129 typedef ComputedVerticesMorph<Normalf, ComputedVerticesMorphValue3> ComputedVerticesMorphNormal;
00130 typedef ComputedVerticesMorph<TexCoordf, ComputedVerticesMorphValue2> ComputedVerticesMorphTexCoord;
00131 typedef ComputedVerticesMorph<Colorf, ComputedVerticesMorphValue4> ComputedVerticesMorphColor;
00132 
00133 #include "computedVerticesMorph.I"
00134 
00135 #endif
00136 

Generated on Fri May 2 00:35:26 2003 for Panda by doxygen1.3