25class EXPCL_PANDA_PGRAPH FogAttrib :
public RenderAttrib {
30 static CPT(RenderAttrib)
make(
Fog *fog);
34 INLINE
bool is_off()
const;
41 virtual void output(std::ostream &out)
const;
44 virtual int compare_to_impl(
const RenderAttrib *other)
const;
45 virtual size_t get_hash_impl()
const;
51 static int get_class_slot() {
54 virtual int get_slot()
const {
55 return get_class_slot();
57 MAKE_PROPERTY(class_slot, get_class_slot);
60 static void register_with_read_factory();
65 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
66 void fillin(DatagramIterator &scan, BamReader *manager);
69 static TypeHandle get_class_type() {
72 static void init_type() {
73 RenderAttrib::init_type();
75 RenderAttrib::get_class_type());
76 _attrib_slot =
register_slot(_type_handle, 100,
new FogAttrib);
78 virtual TypeHandle get_type()
const {
79 return get_class_type();
81 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
84 static TypeHandle _type_handle;
85 static int _attrib_slot;
get_fog
If the FogAttrib is not an 'off' FogAttrib, returns the fog that is associated.
static ConstPointerTo< RenderAttrib > make(Fog *fog)
Constructs a new FogAttrib object suitable for rendering the indicated fog onto geometry.
bool is_off() const
Returns true if the FogAttrib is an 'off' FogAttrib, indicating that it should disable fog.
static ConstPointerTo< RenderAttrib > make_off()
Constructs a new FogAttrib object suitable for rendering unfogd geometry.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
Specifies how atmospheric fog effects are applied to geometry.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
static int register_slot(TypeHandle type_handle, int sort, RenderAttrib *default_attrib)
Adds the indicated TypeHandle to the registry, if it is not there already, and returns a unique slot ...
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.