Panda3D
 All Classes Functions Variables Enumerations
geomVertexAnimationSpec.h
1 // Filename: geomVertexAnimationSpec.h
2 // Created by: drose (29Mar05)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef GEOMVERTEXANIMATIONSPEC_H
16 #define GEOMVERTEXANIMATIONSPEC_H
17 
18 #include "pandabase.h"
19 #include "geomEnums.h"
20 
21 class BamWriter;
22 class BamReader;
23 class Datagram;
24 class DatagramIterator;
25 
26 ////////////////////////////////////////////////////////////////////
27 // Class : GeomVertexAnimationSpec
28 // Description : This object describes how the vertex animation, if
29 // any, represented in a GeomVertexData is encoded.
30 //
31 // Vertex animation includes soft-skinned skeleton
32 // animation and morphs (blend shapes), and might be
33 // performed on the CPU by Panda, or passed down to the
34 // graphics backed to be performed on the hardware
35 // (depending on the hardware's advertised
36 // capabilities).
37 //
38 // Changing this setting doesn't by itself change the
39 // way the animation is actually performed; this just
40 // specifies how the vertices are set up to be animated.
41 ////////////////////////////////////////////////////////////////////
42 class EXPCL_PANDA_GOBJ GeomVertexAnimationSpec : public GeomEnums {
43 PUBLISHED:
44  INLINE GeomVertexAnimationSpec();
45  INLINE GeomVertexAnimationSpec(const GeomVertexAnimationSpec &other);
46  INLINE void operator = (const GeomVertexAnimationSpec &other);
47 
48  INLINE AnimationType get_animation_type() const;
49 
50  INLINE int get_num_transforms() const;
51  INLINE bool get_indexed_transforms() const;
52 
53  INLINE void set_none();
54  INLINE void set_panda();
55  INLINE void set_hardware(int num_transforms, bool indexed_transforms);
56 
57  void output(ostream &out) const;
58 
59 public:
60  INLINE bool operator < (const GeomVertexAnimationSpec &other) const;
61  INLINE bool operator == (const GeomVertexAnimationSpec &other) const;
62  INLINE bool operator != (const GeomVertexAnimationSpec &other) const;
63  INLINE int compare_to(const GeomVertexAnimationSpec &other) const;
64 
65 public:
66  void write_datagram(BamWriter *manager, Datagram &dg);
67  void fillin(DatagramIterator &scan, BamReader *manager);
68 
69 private:
70  AnimationType _animation_type;
71 
72  int _num_transforms;
73  bool _indexed_transforms;
74 };
75 
76 INLINE ostream &
77 operator << (ostream &out, const GeomVertexAnimationSpec &animation);
78 
79 #include "geomVertexAnimationSpec.I"
80 
81 #endif
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
This object describes how the vertex animation, if any, represented in a GeomVertexData is encoded...
This class exists just to provide scoping for the various enumerated types used by Geom...
Definition: geomEnums.h:27
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
An STL function object class, this is intended to be used on any ordered collection of class objects ...
Definition: stl_compares.h:79
A class to retrieve the individual data elements previously stored in a Datagram. ...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43