Panda3D
uvScrollNode.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file uvScrollNode.h
10  * @author drose
11  * @date 2002-03-16
12  */
13 
14 #ifndef UVSCROLLNODE_H
15 #define UVSCROLLNODE_H
16 
17 #include "pandabase.h"
18 
19 #include "animInterface.h"
20 #include "pandaNode.h"
21 
22 
23 /**
24  * This node is placed at key points within the scene graph to animate uvs.
25  */
26 class EXPCL_PANDA_PGRAPHNODES UvScrollNode : public PandaNode {
27 PUBLISHED:
28  INLINE explicit UvScrollNode(const std::string &name, PN_stdfloat u_speed, PN_stdfloat v_speed, PN_stdfloat w_speed, PN_stdfloat r_speed);
29  INLINE explicit UvScrollNode(const std::string &name);
30 
31 protected:
32  INLINE UvScrollNode(const UvScrollNode &copy);
33 
34 public:
35  virtual PandaNode *make_copy() const;
36  virtual bool safe_to_flatten() const;
37  virtual bool safe_to_combine() const;
38  virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
39 
40 PUBLISHED:
41  INLINE void set_u_speed(PN_stdfloat u_speed);
42  INLINE void set_v_speed(PN_stdfloat v_speed);
43  INLINE void set_w_speed(PN_stdfloat w_speed);
44  INLINE void set_r_speed(PN_stdfloat r_speed);
45  INLINE PN_stdfloat get_u_speed() const;
46  INLINE PN_stdfloat get_v_speed() const;
47  INLINE PN_stdfloat get_w_speed() const;
48  INLINE PN_stdfloat get_r_speed() const;
49 
50 PUBLISHED:
51  MAKE_PROPERTY(u_speed, get_u_speed, set_u_speed);
52  MAKE_PROPERTY(v_speed, get_v_speed, set_v_speed);
53  MAKE_PROPERTY(w_speed, get_w_speed, set_w_speed);
54  MAKE_PROPERTY(r_speed, get_r_speed, set_r_speed);
55 
56 private:
57  PN_stdfloat _u_speed;
58  PN_stdfloat _v_speed;
59  PN_stdfloat _w_speed;
60  PN_stdfloat _r_speed;
61 
62  double _start_time;
63 
64 public:
65  static void register_with_read_factory();
66  virtual void write_datagram(BamWriter *manager, Datagram &dg);
67 
68 protected:
69  static TypedWritable *make_from_bam(const FactoryParams &params);
70  void fillin(DatagramIterator &scan, BamReader *manager);
71 
72 public:
73  static TypeHandle get_class_type() {
74  return _type_handle;
75  }
76  static void init_type() {
77  PandaNode::init_type();
78  register_type(_type_handle, "UvScrollNode",
79  PandaNode::get_class_type());
80  }
81  virtual TypeHandle get_type() const {
82  return get_class_type();
83  }
84  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
85 
86 private:
87  static TypeHandle _type_handle;
88 };
89 
90 #include "uvScrollNode.I"
91 
92 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:110
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
Definition: cullTraverser.h:45
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:38
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
A basic node of the scene graph or data graph.
Definition: pandaNode.h:65
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:228
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition: pandaNode.cxx:3574
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Definition: pandaNode.cxx:481
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:3583
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:195
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
This node is placed at key points within the scene graph to animate uvs.
Definition: uvScrollNode.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.