Panda3D
|
00001 // Filename: config_char.cxx 00002 // Created by: drose (28Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 00016 #include "config_char.h" 00017 #include "character.h" 00018 #include "characterJoint.h" 00019 #include "characterJointBundle.h" 00020 #include "characterJointEffect.h" 00021 #include "characterSlider.h" 00022 #include "characterVertexSlider.h" 00023 #include "jointVertexTransform.h" 00024 #include "dconfig.h" 00025 00026 Configure(config_char); 00027 NotifyCategoryDef(char, ""); 00028 00029 ConfigureFn(config_char) { 00030 init_libchar(); 00031 } 00032 00033 ConfigVariableBool even_animation 00034 ("even-animation", false, 00035 PRC_DESC("When this is true, characters' vertices will be recomputed " 00036 "every frame, whether they need it or not. This will tend to " 00037 "balance out the frame rate so that it is more uniformly slow. " 00038 "The default is to compute vertices only when they need to be " 00039 "computed, which can lead to an uneven frame rate.")); 00040 00041 00042 //////////////////////////////////////////////////////////////////// 00043 // Function: init_libchar 00044 // Description: Initializes the library. This must be called at 00045 // least once before any of the functions or classes in 00046 // this library can be used. Normally it will be 00047 // called by the static initializers and need not be 00048 // called explicitly, but special cases exist. 00049 //////////////////////////////////////////////////////////////////// 00050 void 00051 init_libchar() { 00052 static bool initialized = false; 00053 if (initialized) { 00054 return; 00055 } 00056 initialized = true; 00057 00058 Character::init_type(); 00059 CharacterJoint::init_type(); 00060 CharacterJointBundle::init_type(); 00061 CharacterJointEffect::init_type(); 00062 CharacterSlider::init_type(); 00063 CharacterVertexSlider::init_type(); 00064 JointVertexTransform::init_type(); 00065 00066 //Registration of writeable object's creation 00067 //functions with BamReader's factory 00068 Character::register_with_read_factory(); 00069 CharacterJoint::register_with_read_factory(); 00070 CharacterJointBundle::register_with_read_factory(); 00071 CharacterJointEffect::register_with_read_factory(); 00072 CharacterSlider::register_with_read_factory(); 00073 CharacterVertexSlider::register_with_read_factory(); 00074 JointVertexTransform::register_with_read_factory(); 00075 } 00076