Panda3D
 All Classes Functions Variables Enumerations
geomVertexAnimationSpec.h
00001 // Filename: geomVertexAnimationSpec.h
00002 // Created by:  drose (29Mar05)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef GEOMVERTEXANIMATIONSPEC_H
00016 #define GEOMVERTEXANIMATIONSPEC_H
00017 
00018 #include "pandabase.h"
00019 #include "geomEnums.h"
00020 
00021 class BamWriter;
00022 class BamReader;
00023 class Datagram;
00024 class DatagramIterator;
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : GeomVertexAnimationSpec
00028 // Description : This object describes how the vertex animation, if
00029 //               any, represented in a GeomVertexData is encoded.
00030 //
00031 //               Vertex animation includes soft-skinned skeleton
00032 //               animation and morphs (blend shapes), and might be
00033 //               performed on the CPU by Panda, or passed down to the
00034 //               graphics backed to be performed on the hardware
00035 //               (depending on the hardware's advertised
00036 //               capabilities).
00037 //
00038 //               Changing this setting doesn't by itself change the
00039 //               way the animation is actually performed; this just
00040 //               specifies how the vertices are set up to be animated.
00041 ////////////////////////////////////////////////////////////////////
00042 class EXPCL_PANDA_GOBJ GeomVertexAnimationSpec : public GeomEnums {
00043 PUBLISHED:
00044   INLINE GeomVertexAnimationSpec();
00045   INLINE GeomVertexAnimationSpec(const GeomVertexAnimationSpec &other);
00046   INLINE void operator = (const GeomVertexAnimationSpec &other);
00047 
00048   INLINE AnimationType get_animation_type() const;
00049 
00050   INLINE int get_num_transforms() const;
00051   INLINE bool get_indexed_transforms() const;
00052 
00053   INLINE void set_none();
00054   INLINE void set_panda();
00055   INLINE void set_hardware(int num_transforms, bool indexed_transforms);
00056 
00057   void output(ostream &out) const;
00058 
00059 public:
00060   INLINE bool operator < (const GeomVertexAnimationSpec &other) const;
00061   INLINE bool operator == (const GeomVertexAnimationSpec &other) const;
00062   INLINE bool operator != (const GeomVertexAnimationSpec &other) const;
00063   INLINE int compare_to(const GeomVertexAnimationSpec &other) const;
00064 
00065 public:
00066   void write_datagram(BamWriter *manager, Datagram &dg);
00067   void fillin(DatagramIterator &scan, BamReader *manager);
00068 
00069 private:  
00070   AnimationType _animation_type;
00071 
00072   int _num_transforms;
00073   bool _indexed_transforms;
00074 };
00075 
00076 INLINE ostream &
00077 operator << (ostream &out, const GeomVertexAnimationSpec &animation);
00078 
00079 #include "geomVertexAnimationSpec.I"
00080 
00081 #endif
 All Classes Functions Variables Enumerations