Panda3D
Loading...
Searching...
No Matches
decalEffect.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 decalEffect.h
10 * @author drose
11 * @date 2002-03-14
12 */
13
14#ifndef DECALEFFECT_H
15#define DECALEFFECT_H
16
17#include "pandabase.h"
18
19#include "renderEffect.h"
20
21class FactoryParams;
22
23/**
24 * Applied to a GeomNode to indicate that the children of this GeomNode are
25 * coplanar and should be drawn as decals (eliminating Z-fighting).
26 */
27class EXPCL_PANDA_PGRAPH DecalEffect : public RenderEffect {
28private:
29 INLINE DecalEffect();
30
31PUBLISHED:
32 static CPT(RenderEffect) make();
33
34protected:
35 virtual bool safe_to_combine() const;
36 virtual int compare_to_impl(const RenderEffect *other) const;
37
38public:
39 static void register_with_read_factory();
40 virtual void write_datagram(BamWriter *manager, Datagram &dg);
41
42protected:
43 static TypedWritable *make_from_bam(const FactoryParams &params);
44 void fillin(DatagramIterator &scan, BamReader *manager);
45
46public:
47 static TypeHandle get_class_type() {
48 return _type_handle;
49 }
50 static void init_type() {
51 RenderEffect::init_type();
52 register_type(_type_handle, "DecalEffect",
53 RenderEffect::get_class_type());
54 }
55 virtual TypeHandle get_type() const {
56 return get_class_type();
57 }
58 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
59
60private:
61 static TypeHandle _type_handle;
62};
63
64#include "decalEffect.I"
65
66#endif
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition bamReader.h:110
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
static void register_with_read_factory()
Tells the BamReader how to create objects of type DecalEffect.
static ConstPointerTo< RenderEffect > make()
Constructs a new DecalEffect object.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool safe_to_combine() const
Returns true if this kind of effect can safely be combined with sibling nodes that share the exact sa...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
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.