44 write(std::ostream &out,
int indent_level)
const {
45 indent(out, indent_level) << get_type() <<
":\n";
54 do_compute_projection_mat(Lens::CData *lens_cdata) {
55 lens_cdata->_projection_mat = do_get_lens_mat_inv(lens_cdata) * _user_mat * do_get_film_mat(lens_cdata);
57 if (_ml_flags & MF_has_left_eye) {
58 lens_cdata->_projection_mat_left = do_get_lens_mat_inv(lens_cdata) * _left_eye_mat * do_get_film_mat(lens_cdata);
60 lens_cdata->_projection_mat_left = lens_cdata->_projection_mat;
63 if (_ml_flags & MF_has_right_eye) {
64 lens_cdata->_projection_mat_right = do_get_lens_mat_inv(lens_cdata) * _right_eye_mat * do_get_film_mat(lens_cdata);
66 lens_cdata->_projection_mat_right = lens_cdata->_projection_mat;
69 do_adjust_comp_flags(lens_cdata, CF_projection_mat_inv,
91 _user_mat.write_datagram(dg);
93 if (_ml_flags & MF_has_left_eye) {
94 _left_eye_mat.write_datagram(dg);
96 if (_ml_flags & MF_has_right_eye) {
97 _left_eye_mat.write_datagram(dg);
114 lens->fillin(scan, manager);
125 Lens::fillin(scan, manager);
130 _user_mat.read_datagram(scan);
131 if (_ml_flags & MF_has_left_eye) {
132 _left_eye_mat.read_datagram(scan);
134 if (_ml_flags & MF_has_right_eye) {
135 _right_eye_mat.read_datagram(scan);
uint8_t get_uint8()
Extracts an unsigned 8-bit integer.
A base class for any number of different kinds of lenses, linear and otherwise.
A completely generic linear lens.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type Lens.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PT(Lens) MatrixLens
Allocates a new Lens just like this one.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
const LMatrix4 & get_projection_mat(StereoChannel channel=SC_mono) const
Returns the complete transformation matrix from a 3-d point in space to a point on the film,...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
void add_uint8(uint8_t value)
Adds an unsigned 8-bit integer to the datagram.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool is_linear() const
Returns true if the lens represents a linear projection (e.g.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.