27 _from_origin.set(0.0, 0.0, 0.0);
28 _from_align.set(1.0, 0.0, 0.0);
29 _from_track.set(1.0, 0.0, 0.0);
30 _to_origin.set(0.0, 0.0, 0.0);
31 _to_align.set(1.0, 0.0, 0.0);
32 _to_track.set(1.0, 0.0, 0.0);
40 set(
const LPoint3d &from_origin,
const LPoint3d &from_align,
41 const LPoint3d &from_track,
42 const LPoint3d &to_origin,
const LPoint3d &to_align,
43 const LPoint3d &to_track) {
44 _from_origin = from_origin;
45 _from_align = from_align;
46 _from_track = from_track;
47 _to_origin = to_origin;
57 const LPoint3d &FltTransformPut::
58 get_from_origin()
const {
65 const LPoint3d &FltTransformPut::
66 get_from_align()
const {
73 const LPoint3d &FltTransformPut::
74 get_from_track()
const {
81 const LPoint3d &FltTransformPut::
82 get_to_origin()
const {
89 const LPoint3d &FltTransformPut::
90 get_to_align()
const {
97 const LPoint3d &FltTransformPut::
98 get_to_track()
const {
105 void FltTransformPut::
108 look_at(r1, _from_align - _from_origin, _from_track - _from_origin, CS_zup_right);
109 look_at(r2, _to_align - _to_origin, _to_track - _to_origin, CS_zup_right);
112 LMatrix4d::translate_mat(-_from_origin) *
115 LMatrix4d::translate_mat(_to_origin);
123 bool FltTransformPut::
125 if (!FltTransformRecord::extract_record(reader)) {
129 nassertr(reader.
get_opcode() == FO_put,
false);
134 _from_origin[0] = iterator.get_be_float64();
135 _from_origin[1] = iterator.get_be_float64();
136 _from_origin[2] = iterator.get_be_float64();
137 _from_align[0] = iterator.get_be_float64();
138 _from_align[1] = iterator.get_be_float64();
139 _from_align[2] = iterator.get_be_float64();
140 _from_track[0] = iterator.get_be_float64();
141 _from_track[1] = iterator.get_be_float64();
142 _from_track[2] = iterator.get_be_float64();
143 _to_origin[0] = iterator.get_be_float64();
144 _to_origin[1] = iterator.get_be_float64();
145 _to_origin[2] = iterator.get_be_float64();
146 _to_align[0] = iterator.get_be_float64();
147 _to_align[1] = iterator.get_be_float64();
148 _to_align[2] = iterator.get_be_float64();
149 _to_track[0] = iterator.get_be_float64();
150 _to_track[1] = iterator.get_be_float64();
151 _to_track[2] = iterator.get_be_float64();
164 bool FltTransformPut::
166 if (!FltTransformRecord::build_record(writer)) {
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void check_remaining_size(const DatagramIterator &di, const std::string &name=std::string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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 ...