Panda3D
uvScrollNode.h
1 // Filename: modelNode.h
2 // Created by: drose (16Mar02)
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 UVSCROLLNODE_H
16 #define UVSCROLLNODE_H
17 
18 #include "pandabase.h"
19 
20 #include "animInterface.h"
21 #include "pandaNode.h"
22 
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : UvScrollNode
26 // Description : This node is placed at key points within the scene
27 // graph to animate uvs.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDA_PGRAPH UvScrollNode : public PandaNode {
30 PUBLISHED:
31  INLINE UvScrollNode(const string &name, PN_stdfloat u_speed, PN_stdfloat v_speed, PN_stdfloat w_speed, PN_stdfloat r_speed);
32  INLINE UvScrollNode(const string &name);
33 
34 protected:
35  INLINE UvScrollNode(const UvScrollNode &copy);
36 
37 public:
38  virtual PandaNode *make_copy() const;
39  virtual bool safe_to_flatten() const;
40  virtual bool safe_to_combine() const;
41  virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
42 
43 PUBLISHED:
44  INLINE void set_u_speed(PN_stdfloat u_speed);
45  INLINE void set_v_speed(PN_stdfloat v_speed);
46  INLINE void set_w_speed(PN_stdfloat w_speed);
47  INLINE void set_r_speed(PN_stdfloat r_speed);
48  INLINE PN_stdfloat get_u_speed() const;
49  INLINE PN_stdfloat get_v_speed() const;
50  INLINE PN_stdfloat get_w_speed() const;
51  INLINE PN_stdfloat get_r_speed() const;
52 
53 private:
54  PN_stdfloat _u_speed;
55  PN_stdfloat _v_speed;
56  PN_stdfloat _w_speed;
57  PN_stdfloat _r_speed;
58 
59  double _start_time;
60 
61 public:
62  static void register_with_read_factory();
63  virtual void write_datagram(BamWriter *manager, Datagram &dg);
64 
65 protected:
66  static TypedWritable *make_from_bam(const FactoryParams &params);
67  void fillin(DatagramIterator &scan, BamReader *manager);
68 
69 public:
70  static TypeHandle get_class_type() {
71  return _type_handle;
72  }
73  static void init_type() {
74  PandaNode::init_type();
75  register_type(_type_handle, "UvScrollNode",
76  PandaNode::get_class_type());
77  }
78  virtual TypeHandle get_type() const {
79  return get_class_type();
80  }
81  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
82 
83 private:
84  static TypeHandle _type_handle;
85 };
86 
87 #include "uvScrollNode.I"
88 
89 #endif
90 
91 
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition: pandaNode.cxx:4164
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition: pandaNode.cxx:4153
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
Definition: pandaNode.cxx:281
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
This node is placed at key points within the scene graph to animate uvs.
Definition: uvScrollNode.h:29
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Definition: pandaNode.cxx:604
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling...
Definition: cullTraverser.h:48
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...
Definition: pandaNode.cxx:237