00001 // Filename: config_chan.cxx 00002 // Created by: drose (28Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 00020 #include "config_chan.h" 00021 #include "animBundle.h" 00022 #include "animBundleNode.h" 00023 #include "animChannelBase.h" 00024 #include "animChannelMatrixXfmTable.h" 00025 #include "animChannelScalarTable.h" 00026 #include "animControl.h" 00027 #include "animGroup.h" 00028 #include "movingPartBase.h" 00029 #include "movingPartMatrix.h" 00030 #include "movingPartScalar.h" 00031 #include "partBundle.h" 00032 #include "partBundleNode.h" 00033 #include "partGroup.h" 00034 00035 #include "luse.h" 00036 #include "dconfig.h" 00037 00038 Configure(config_chan); 00039 NotifyCategoryDef(chan, ""); 00040 00041 // Set this true to enable compress of animation channels when writing to 00042 // the bam file. This is an experimental lossy compression. 00043 bool compress_channels = config_chan.GetBool("compress-channels", false); 00044 00045 // The quality level is an integer number that generally ranges 00046 // between 0 and 100, where smaller numbers indicate greater 00047 // compression at the cost of quality, and larger numbers indicate 00048 // higher quality but less compression. Generally, 95 is the highest 00049 // useful value; values between 95 and 100 produce substantially 00050 // larger, but not substantially better, output files. This is akin 00051 // to the JPEG compression level. 00052 // 00053 // There are some special values above 100 which are generally only 00054 // useful for debugging (specifically, to research at what point a 00055 // particular animation artifact is being introduced): 00056 // 00057 // 101 Output numerically lossless data. The output is not run 00058 // through the FFTCompressor. This can be used to check 00059 // whether a particular artifact is due to the FFT conversion 00060 // or not. However, joint angles (HPR) are still converted to 00061 // quaternions and normalized, discarding the fourth 00062 // (redundant) component. 00063 // 00064 // 102 As above, but the fourth quaternion component is preserved. 00065 // 00066 // 103 Quaternions are not used; instead, the HPR values are written 00067 // directly. All output is now completely lossless; if some 00068 // artifacts are being introduced at this point, check your 00069 // sanity. 00070 // 00071 int compress_chan_quality = config_chan.GetInt("compress-chan-quality", 95); 00072 00073 // Set this false to disable reading of compressed animation channels, 00074 // even if the decompression code is available. The only reason you 00075 // might want to do this would be to speed load time when you don't 00076 // care about what the animation looks like. 00077 bool read_compressed_channels = config_chan.GetBool("read-compressed-channels", true); 00078 00079 ConfigureFn(config_chan) { 00080 AnimBundle::init_type(); 00081 AnimBundleNode::init_type(); 00082 AnimChannelBase::init_type(); 00083 AnimChannelMatrixXfmTable::init_type(); 00084 AnimChannelScalarTable::init_type(); 00085 AnimControl::init_type(); 00086 AnimGroup::init_type(); 00087 MovingPartBase::init_type(); 00088 MovingPartMatrix::init_type(); 00089 MovingPartScalar::init_type(); 00090 PartBundle::init_type(); 00091 PartBundleNode::init_type(); 00092 PartGroup::init_type(); 00093 00094 // This isn't defined in this package, but it *is* essential that it 00095 // be initialized. We have to do it explicitly here since template 00096 // statics don't necessarily resolve very well across dynamic 00097 // libraries. 00098 LMatrix4f::init_type(); 00099 00100 //Registration of writeable object's creation 00101 //functions with BamReader's factory 00102 PartGroup::register_with_read_factory(); 00103 PartBundle::register_with_read_factory(); 00104 MovingPartMatrix::register_with_read_factory(); 00105 MovingPartScalar::register_with_read_factory(); 00106 00107 AnimGroup::register_with_read_factory(); 00108 AnimBundle::register_with_read_factory(); 00109 AnimBundleNode::register_with_read_factory(); 00110 AnimChannelMatrixXfmTable::register_with_read_factory(); 00111 AnimChannelScalarTable::register_with_read_factory(); 00112 } 00113 00114 00115 00116