Panda3D
ambientLight.h
1 // Filename: ambientLight.h
2 // Created by: mike (09Jan97)
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 AMBIENTLIGHT_H
16 #define AMBIENTLIGHT_H
17 
18 #include "pandabase.h"
19 
20 #include "lightNode.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : AmbientLight
24 // Description : A light source that seems to illuminate all points in
25 // space at once. This kind of light need not actually
26 // be part of the scene graph, since it has no meaningful
27 // position.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDA_PGRAPHNODES AmbientLight : public LightNode {
30 PUBLISHED:
31  AmbientLight(const string &name);
32 
33 protected:
34  AmbientLight(const AmbientLight &copy);
35 
36 public:
37  virtual PandaNode *make_copy() const;
38  virtual void write(ostream &out, int indent_level) const;
39  virtual bool is_ambient_light() const;
40 
41 PUBLISHED:
42  virtual int get_class_priority() const;
43 
44 public:
45  virtual void bind(GraphicsStateGuardianBase *gsg, const NodePath &light,
46  int light_id);
47 
48 public:
49  static void register_with_read_factory();
50  virtual void write_datagram(BamWriter *manager, Datagram &dg);
51 
52 protected:
53  static TypedWritable *make_from_bam(const FactoryParams &params);
54  void fillin(DatagramIterator &scan, BamReader *manager);
55 
56 public:
57  static TypeHandle get_class_type() {
58  return _type_handle;
59  }
60  static void init_type() {
61  LightNode::init_type();
62  register_type(_type_handle, "AmbientLight",
63  LightNode::get_class_type());
64  }
65  virtual TypeHandle get_type() const {
66  return get_class_type();
67  }
68  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
69 
70 private:
71  static TypeHandle _type_handle;
72 };
73 
74 INLINE ostream &operator << (ostream &out, const AmbientLight &light) {
75  light.output(out);
76  return out;
77 }
78 
79 #include "ambientLight.I"
80 
81 #endif
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: lightNode.cxx:95
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
A derivative of Light and of PandaNode.
Definition: lightNode.h:29
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
A light source that seems to illuminate all points in space at once.
Definition: ambientLight.h:29
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 is_ambient_light() const
Returns true if this is an AmbientLight, false if it is some other kind of light. ...
Definition: light.cxx:75
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Definition: pandaNode.cxx:604
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
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
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
Definition: nodePath.h:165