23int DepthOffsetAttrib::_attrib_slot;
32 return return_new(attrib);
43make(
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);
62void DepthOffsetAttrib::
63output(std::ostream &out)
const {
80int 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;
102size_t DepthOffsetAttrib::
103get_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);
151void DepthOffsetAttrib::
152register_with_read_factory() {
183 attrib->fillin(scan, manager);
192void DepthOffsetAttrib::
194 RenderAttrib::fillin(scan, manager);
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,...
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...
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
A class to retrieve the individual data elements previously stored in a Datagram.
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
int32_t get_int32()
Extracts a signed 32-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_int32(int32_t value)
Adds a signed 32-bit integer to the datagram.
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
This is a special kind of attribute that instructs the graphics driver to apply an offset or bias to ...
get_offset
Returns the depth offset represented by this 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,...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
This is the base class for a number of render attributes (other than transform) that may be set on sc...
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.
Base class for objects that can be written to and read from Bam files.
This hash_compare class hashes a float or a double.
size_t add_hash(size_t start, const Key &key) const
Adds the indicated key into a running hash.
static size_t add_hash(size_t start, const Key &key)
Adds the indicated key into a running hash.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.