15 #include "fltTransformPut.h"
16 #include "fltRecordReader.h"
17 #include "fltRecordWriter.h"
30 _from_origin.set(0.0, 0.0, 0.0);
31 _from_align.set(1.0, 0.0, 0.0);
32 _from_track.set(1.0, 0.0, 0.0);
33 _to_origin.set(0.0, 0.0, 0.0);
34 _to_align.set(1.0, 0.0, 0.0);
35 _to_track.set(1.0, 0.0, 0.0);
50 _from_origin = from_origin;
51 _from_align = from_align;
52 _from_track = from_track;
53 _to_origin = to_origin;
66 get_from_origin()
const {
76 get_from_align()
const {
86 get_from_track()
const {
96 get_to_origin()
const {
106 get_to_align()
const {
116 get_to_track()
const {
125 void FltTransformPut::
128 look_at(r1, _from_align - _from_origin, _from_track - _from_origin, CS_zup_right);
129 look_at(r2, _to_align - _to_origin, _to_track - _to_origin, CS_zup_right);
146 bool FltTransformPut::
148 if (!FltTransformRecord::extract_record(reader)) {
152 nassertr(reader.
get_opcode() == FO_put,
false);
157 _from_origin[0] = iterator.get_be_float64();
158 _from_origin[1] = iterator.get_be_float64();
159 _from_origin[2] = iterator.get_be_float64();
160 _from_align[0] = iterator.get_be_float64();
161 _from_align[1] = iterator.get_be_float64();
162 _from_align[2] = iterator.get_be_float64();
163 _from_track[0] = iterator.get_be_float64();
164 _from_track[1] = iterator.get_be_float64();
165 _from_track[2] = iterator.get_be_float64();
166 _to_origin[0] = iterator.get_be_float64();
167 _to_origin[1] = iterator.get_be_float64();
168 _to_origin[2] = iterator.get_be_float64();
169 _to_align[0] = iterator.get_be_float64();
170 _to_align[1] = iterator.get_be_float64();
171 _to_align[2] = iterator.get_be_float64();
172 _to_track[0] = iterator.get_be_float64();
173 _to_track[1] = iterator.get_be_float64();
174 _to_track[2] = iterator.get_be_float64();
190 bool FltTransformPut::
192 if (!FltTransformRecord::build_record(writer)) {
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This is a 4-by-4 transform matrix.
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
static LMatrix4d translate_mat(const LVecBase3d &trans)
Returns a matrix that applies the indicated translation.
void pad_bytes(size_t size)
Adds the indicated number of zero bytes to the datagram.
void add_be_float64(PN_float64 value)
Adds a 64-bit big-endian floating-point number to the datagram.
void skip_bytes(size_t size)
Skips over the indicated number of bytes in the datagram.
void check_remaining_size(const DatagramIterator &di, const string &name=string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...