Go to the documentation of this file.
23 int DepthOffsetAttrib::_attrib_slot;
32 return return_new(attrib);
43 make(
int offset, PN_stdfloat min_value, PN_stdfloat max_value) {
44 nassertr(min_value >= 0.0f && min_value <= 1.0f,
nullptr);
45 nassertr(max_value >= 0.0f && max_value <= 1.0f,
nullptr);
47 return return_new(attrib);
62 void DepthOffsetAttrib::
63 output(std::ostream &out)
const {
80 int DepthOffsetAttrib::
84 if (_offset != ta->_offset) {
85 return _offset - ta->_offset;
87 if (_min_value != ta->_min_value) {
88 return _min_value < ta->_min_value ? -1 : 1;
90 if (_max_value != ta->_max_value) {
91 return _max_value < ta->_max_value ? -1 : 1;
102 size_t DepthOffsetAttrib::
103 get_hash_impl()
const {
126 int new_offset = ta->_offset + _offset;
129 return return_new(attrib);
142 int new_offset = ta->_offset - _offset;
145 return return_new(attrib);
151 void DepthOffsetAttrib::
152 register_with_read_factory() {
183 attrib->fillin(scan, manager);
192 void DepthOffsetAttrib::
194 RenderAttrib::fillin(scan, manager);
int32_t get_int32()
Extracts a signed 32-bit integer.
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,...
A class to retrieve the individual data elements previously stored in a Datagram.
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...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
CPT(RenderAttrib) DepthOffsetAttrib
Constructs a new DepthOffsetAttrib object that indicates the relative amount of bias to write to the ...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This hash_compare class hashes a float or a double.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
get_offset
Returns the depth offset represented by this attrib.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
void add_int32(int32_t value)
Adds a signed 32-bit integer to the datagram.
static size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
size_t add_hash(size_t start, const Key &key) const
Adds the indicated key into a running hash.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...