Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/pgraph/config_pgraph.cxx

Go to the documentation of this file.
00001 // Filename: config_pgraph.cxx
00002 // Created by:  drose (21Feb02)
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 #include "config_pgraph.h"
00020 
00021 #include "alphaTestAttrib.h"
00022 #include "ambientLight.h"
00023 #include "billboardEffect.h"
00024 #include "camera.h"
00025 #include "clipPlaneAttrib.h"
00026 #include "colorAttrib.h"
00027 #include "colorBlendAttrib.h"
00028 #include "colorScaleAttrib.h"
00029 #include "colorWriteAttrib.h"
00030 #include "compassEffect.h"
00031 #include "cullFaceAttrib.h"
00032 #include "cullBin.h"
00033 #include "cullBinAttrib.h"
00034 #include "cullBinBackToFront.h"
00035 #include "cullBinFixed.h"
00036 #include "cullBinFrontToBack.h"
00037 #include "cullBinUnsorted.h"
00038 #include "cullTraverser.h"
00039 #include "cullableObject.h"
00040 #include "decalEffect.h"
00041 #include "depthOffsetAttrib.h"
00042 #include "depthTestAttrib.h"
00043 #include "depthWriteAttrib.h"
00044 #include "directionalLight.h"
00045 #include "fog.h"
00046 #include "fogAttrib.h"
00047 #include "geomNode.h"
00048 #include "lensNode.h"
00049 #include "light.h"
00050 #include "lightAttrib.h"
00051 #include "lightLensNode.h"
00052 #include "lightNode.h"
00053 #include "loaderFileType.h"
00054 #include "loaderFileTypeBam.h"
00055 #include "loaderFileTypeRegistry.h"
00056 #include "lodNode.h"
00057 #include "materialAttrib.h"
00058 #include "modelNode.h"
00059 #include "modelRoot.h"
00060 #include "nodePath.h"
00061 #include "nodePathComponent.h"
00062 #include "pandaNode.h"
00063 #include "planeNode.h"
00064 #include "pointLight.h"
00065 #include "renderAttrib.h"
00066 #include "renderEffect.h"
00067 #include "renderEffects.h"
00068 #include "renderModeAttrib.h"
00069 #include "renderState.h"
00070 #include "selectiveChildNode.h"
00071 #include "sequenceNode.h"
00072 #include "showBoundsEffect.h"
00073 #include "spotlight.h"
00074 #include "switchNode.h"
00075 #include "texMatrixAttrib.h"
00076 #include "textureApplyAttrib.h"
00077 #include "textureAttrib.h"
00078 #include "transformState.h"
00079 #include "transparencyAttrib.h"
00080 #include "nodePathLerps.h"
00081 #include "get_config_path.h"
00082 
00083 #include "dconfig.h"
00084 
00085 ConfigureDef(config_pgraph);
00086 NotifyCategoryDef(pgraph, "");
00087 NotifyCategoryDef(loader, "");
00088 
00089 ConfigureFn(config_pgraph) {
00090   init_libpgraph();
00091 }
00092 
00093 // Set this true to cause culling to be performed by rendering the
00094 // object in red wireframe, rather than actually culling it.  This
00095 // helps make culling errors obvious.
00096 const bool fake_view_frustum_cull = config_pgraph.GetBool("fake-view-frustum-cull", false);
00097 
00098 // Set this true to make ambiguous path warning messages generate an
00099 // assertion failure instead of just a warning (which can then be
00100 // trapped with assert-abort).
00101 const bool unambiguous_graph = config_pgraph.GetBool("unambiguous-graph", false);
00102 
00103 // Set this true to double-check the componentwise transform compose
00104 // (or invert) operation against the equivalent matrix-based
00105 // operation.  This has no effect if NDEBUG is defined.
00106 const bool paranoid_compose = config_pgraph.GetBool("paranoid-compose", false);
00107 
00108 // Set this true to perform componentwise compose and invert
00109 // operations at all.  If this is false, the compositions are computed
00110 // by matrix.
00111 const bool compose_componentwise = config_pgraph.GetBool("compose-componentwise", true);
00112 
00113 // Set this true to load transforms from bam files as componentwise
00114 // transforms always, even if they were stored as matrix transforms.
00115 // This works around old versions of the egg loader that only stored
00116 // matrix transforms.
00117 const bool bams_componentwise = config_pgraph.GetBool("bams-componentwise", false);
00118 
00119 // Set this false to disable TransparencyAttrib::M_dual altogether
00120 // (and use M_alpha in its place).
00121 const bool m_dual = config_pgraph.GetBool("m-dual", true);
00122 // Set this false to disable just the opaque part of M_dual.
00123 const bool m_dual_opaque = config_pgraph.GetBool("m-dual-opaque", true);
00124 // Set this false to disable just the transparent part of M_dual.
00125 const bool m_dual_transparent = config_pgraph.GetBool("m-dual-transparent", true);
00126 // Set this true to flash any objects that use M_dual, for debugging.
00127 const bool m_dual_flash = config_pgraph.GetBool("m-dual-flash", false);
00128 
00129 // Set this true to support actual asynchronous loads via the
00130 // request_load()/fetch_load() interface to Loader.  Set it false to
00131 // map these to blocking, synchronous loads instead.  Currently, the
00132 // rest of Panda isn't quite ready for asynchronous loads, so leave
00133 // this false for now.
00134 const bool asynchronous_loads = config_pgraph.GetBool("asynchronous-loads", false);
00135 
00136 Config::ConfigTable::Symbol *load_file_type = (Config::ConfigTable::Symbol *)NULL;
00137 
00138 const DSearchPath &
00139 get_bam_path() {
00140   static DSearchPath *bam_path = NULL;
00141   return get_config_path("bam-path", bam_path);
00142 }
00143 
00144 ////////////////////////////////////////////////////////////////////
00145 //     Function: init_libpgraph
00146 //  Description: Initializes the library.  This must be called at
00147 //               least once before any of the functions or classes in
00148 //               this library can be used.  Normally it will be
00149 //               called by the static initializers and need not be
00150 //               called explicitly, but special cases exist.
00151 ////////////////////////////////////////////////////////////////////
00152 void
00153 init_libpgraph() {
00154   static bool initialized = false;
00155   if (initialized) {
00156     return;
00157   }
00158   initialized = true;
00159 
00160   load_file_type = new Config::ConfigTable::Symbol;
00161   config_pgraph.GetAll("load-file-type", *load_file_type);
00162 
00163   AlphaTestAttrib::init_type();
00164   AmbientLight::init_type();
00165   BillboardEffect::init_type();
00166   Camera::init_type();
00167   ClipPlaneAttrib::init_type();
00168   ColorAttrib::init_type();
00169   ColorBlendAttrib::init_type();
00170   ColorScaleAttrib::init_type();
00171   ColorWriteAttrib::init_type();
00172   CompassEffect::init_type();
00173   CullFaceAttrib::init_type();
00174   CullBin::init_type();
00175   CullBinAttrib::init_type();
00176   CullBinBackToFront::init_type();
00177   CullBinFixed::init_type();
00178   CullBinFrontToBack::init_type();
00179   CullBinUnsorted::init_type();
00180   CullTraverser::init_type();
00181   CullableObject::init_type();
00182   DecalEffect::init_type();
00183   DepthOffsetAttrib::init_type();
00184   DepthTestAttrib::init_type();
00185   DepthWriteAttrib::init_type();
00186   DirectionalLight::init_type();
00187   Fog::init_type();
00188   FogAttrib::init_type();
00189   GeomNode::init_type();
00190   LensNode::init_type();
00191   Light::init_type();
00192   LightAttrib::init_type();
00193   LightLensNode::init_type();
00194   LightNode::init_type();
00195   LODNode::init_type();
00196   LoaderFileType::init_type();
00197   LoaderFileTypeBam::init_type();
00198   MaterialAttrib::init_type();
00199   ModelNode::init_type();
00200   ModelRoot::init_type();
00201   NodePath::init_type();
00202   NodePathComponent::init_type();
00203   PandaNode::init_type();
00204   PlaneNode::init_type();
00205   PointLight::init_type();
00206   RenderAttrib::init_type();
00207   RenderEffect::init_type();
00208   RenderEffects::init_type();
00209   RenderModeAttrib::init_type();
00210   RenderState::init_type();
00211   SelectiveChildNode::init_type();
00212   SequenceNode::init_type();
00213   ShowBoundsEffect::init_type();
00214   Spotlight::init_type();
00215   SwitchNode::init_type();
00216   TexMatrixAttrib::init_type();
00217   TextureApplyAttrib::init_type();
00218   TextureAttrib::init_type();
00219   TransformState::init_type();
00220   TransparencyAttrib::init_type();
00221   PosLerpFunctor::init_type();
00222   HprLerpFunctor::init_type();
00223   ScaleLerpFunctor::init_type();
00224   PosHprLerpFunctor::init_type();
00225   HprScaleLerpFunctor::init_type();
00226   PosHprScaleLerpFunctor::init_type();
00227   ColorLerpFunctor::init_type();
00228   ColorScaleLerpFunctor::init_type();
00229   EventStoreTransform::init_type();
00230 
00231   AlphaTestAttrib::register_with_read_factory();
00232   AmbientLight::register_with_read_factory();
00233   BillboardEffect::register_with_read_factory();
00234   Camera::register_with_read_factory();
00235   ClipPlaneAttrib::register_with_read_factory();
00236   CompassEffect::register_with_read_factory();
00237   ColorAttrib::register_with_read_factory();
00238   ColorBlendAttrib::register_with_read_factory();
00239   ColorScaleAttrib::register_with_read_factory();
00240   ColorWriteAttrib::register_with_read_factory();
00241   CullBinAttrib::register_with_read_factory();
00242   CullFaceAttrib::register_with_read_factory();
00243   DecalEffect::register_with_read_factory();
00244   DepthOffsetAttrib::register_with_read_factory();
00245   DepthTestAttrib::register_with_read_factory();
00246   DepthWriteAttrib::register_with_read_factory();
00247   DirectionalLight::register_with_read_factory();
00248   Fog::register_with_read_factory();
00249   FogAttrib::register_with_read_factory();
00250   GeomNode::register_with_read_factory();
00251   LensNode::register_with_read_factory();
00252   LightAttrib::register_with_read_factory();
00253   LODNode::register_with_read_factory();
00254   MaterialAttrib::register_with_read_factory();  
00255   ModelNode::register_with_read_factory();
00256   ModelRoot::register_with_read_factory();
00257   PandaNode::register_with_read_factory();
00258   PlaneNode::register_with_read_factory();
00259   PointLight::register_with_read_factory();
00260   RenderEffects::register_with_read_factory();
00261   RenderModeAttrib::register_with_read_factory();
00262   RenderState::register_with_read_factory();
00263   SequenceNode::register_with_read_factory();
00264   ShowBoundsEffect::register_with_read_factory();
00265   Spotlight::register_with_read_factory();
00266   SwitchNode::register_with_read_factory();
00267   TexMatrixAttrib::register_with_read_factory();
00268   TextureApplyAttrib::register_with_read_factory();
00269   TextureAttrib::register_with_read_factory();
00270   TransformState::register_with_read_factory();
00271   TransparencyAttrib::register_with_read_factory();
00272 
00273   LoaderFileTypeRegistry *reg = LoaderFileTypeRegistry::get_ptr();
00274   reg->register_type(new LoaderFileTypeBam);
00275 }

Generated on Fri May 2 00:41:21 2003 for Panda by doxygen1.3