14#ifndef DEPTHOFFSETATTRIB_H
15#define DEPTHOFFSETATTRIB_H
50class EXPCL_PANDA_PGRAPH DepthOffsetAttrib :
public RenderAttrib {
52 INLINE DepthOffsetAttrib(
int offset, PN_stdfloat min_value, PN_stdfloat max_value);
55 static CPT(RenderAttrib)
make(
int offset = 1);
56 static CPT(RenderAttrib)
make(
int offset, PN_stdfloat min_value, PN_stdfloat max_value);
69 virtual void output(std::ostream &out)
const;
72 virtual int compare_to_impl(
const RenderAttrib *other)
const;
73 virtual size_t get_hash_impl()
const;
74 virtual CPT(RenderAttrib) compose_impl(
const RenderAttrib *other)
const;
75 virtual CPT(RenderAttrib) invert_compose_impl(
const RenderAttrib *other)
const;
79 PN_stdfloat _min_value;
80 PN_stdfloat _max_value;
83 static int get_class_slot() {
86 virtual int get_slot()
const {
87 return get_class_slot();
89 MAKE_PROPERTY(class_slot, get_class_slot);
92 static void register_with_read_factory();
96 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
97 void fillin(DatagramIterator &scan, BamReader *manager);
100 static TypeHandle get_class_type() {
103 static void init_type() {
104 RenderAttrib::init_type();
106 RenderAttrib::get_class_type());
108 new DepthOffsetAttrib(0, 0, 1));
110 virtual TypeHandle get_type()
const {
111 return get_class_type();
113 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
116 static TypeHandle _type_handle;
117 static int _attrib_slot;
get_offset
Returns the depth offset represented by this attrib.
static ConstPointerTo< RenderAttrib > make_default()
Returns a RenderAttrib that corresponds to whatever the standard default properties for render attrib...
get_min_value
Returns the value for the minimum (closest) depth value to be stored in the buffer,...
get_max_value
Returns the value for the maximum (farthest) depth value to be stored in the buffer,...
static ConstPointerTo< RenderAttrib > make(int offset=1)
Constructs a new DepthOffsetAttrib object that indicates the relative amount of bias to write to the ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
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 ...
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.