@@ -138,7 +138,7 @@ get_shear(int, LVecBase3f &shear) {
138138}
139139
140140// //////////////////////////////////////////////////////////////////
141- // Function: AnimChannelFixed ::output
141+ // Function: AnimChannelMatrixFixed ::output
142142// Access: Public, Virtual
143143// Description:
144144// //////////////////////////////////////////////////////////////////
@@ -147,3 +147,65 @@ output(ostream &out) const {
147147 AnimChannel<ACMatrixSwitchType>::output (out);
148148 out << " : pos " << _pos << " hpr " << _hpr << " scale " << _scale;
149149}
150+
151+ // //////////////////////////////////////////////////////////////////
152+ // Function: AnimChannelMatrixFixed::register_with_read_factory
153+ // Access: Public, Static
154+ // Description: Tells the BamReader how to create objects of type
155+ // AnimChannelMatrixFixed.
156+ // //////////////////////////////////////////////////////////////////
157+ void AnimChannelMatrixFixed::
158+ register_with_read_factory () {
159+ BamReader::get_factory ()->register_factory (get_class_type (), make_from_bam);
160+ }
161+
162+ // //////////////////////////////////////////////////////////////////
163+ // Function: AnimChannelMatrixFixed::write_datagram
164+ // Access: Public, Virtual
165+ // Description: Writes the contents of this object to the datagram
166+ // for shipping out to a Bam file.
167+ // //////////////////////////////////////////////////////////////////
168+ void AnimChannelMatrixFixed::
169+ write_datagram (BamWriter *manager, Datagram &dg) {
170+ AnimChannel<ACMatrixSwitchType>::write_datagram (manager, dg);
171+
172+ _pos.write_datagram (dg);
173+ _hpr.write_datagram (dg);
174+ _scale.write_datagram (dg);
175+ }
176+
177+ // //////////////////////////////////////////////////////////////////
178+ // Function: AnimChannelMatrixFixed::make_from_bam
179+ // Access: Protected, Static
180+ // Description: This function is called by the BamReader's factory
181+ // when a new object of type AnimChannelMatrixFixed is encountered
182+ // in the Bam file. It should create the AnimChannelMatrixFixed
183+ // and extract its information from the file.
184+ // //////////////////////////////////////////////////////////////////
185+ TypedWritable *AnimChannelMatrixFixed::
186+ make_from_bam (const FactoryParams ¶ms) {
187+ AnimChannelMatrixFixed *chan = new AnimChannelMatrixFixed (" " , LVecBase3f::zero (), LVecBase3f::zero (), LVecBase3f::zero ());
188+ DatagramIterator scan;
189+ BamReader *manager;
190+
191+ parse_params (params, scan, manager);
192+ chan->fillin (scan, manager);
193+
194+ return chan;
195+ }
196+
197+ // //////////////////////////////////////////////////////////////////
198+ // Function: AnimChannelMatrixFixed::fillin
199+ // Access: Protected
200+ // Description: This internal function is called by make_from_bam to
201+ // read in all of the relevant data from the BamFile for
202+ // the new AnimChannelMatrixFixed.
203+ // //////////////////////////////////////////////////////////////////
204+ void AnimChannelMatrixFixed::
205+ fillin (DatagramIterator &scan, BamReader *manager) {
206+ AnimChannel<ACMatrixSwitchType>::fillin (scan, manager);
207+
208+ _pos.read_datagram (scan);
209+ _hpr.read_datagram (scan);
210+ _scale.read_datagram (scan);
211+ }
0 commit comments