Panda3D
config_collada.cxx
1 // Filename: config_collada.cxx
2 // Created by: Xidram (21Dec10)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "config_collada.h"
16 
17 #include "dconfig.h"
18 #include "loaderFileTypeDae.h"
19 #include "loaderFileTypeRegistry.h"
20 
21 ConfigureDef(config_collada);
22 NotifyCategoryDef(collada, "");
23 
24 ConfigVariableBool collada_flatten
25 ("collada-flatten", false,
26  PRC_DESC("This is normally true to flatten out useless nodes after loading "
27  "a collada file. Set it false if you want to see the complete "
28  "and true hierarchy as specified in the file (although the "
29  "extra nodes may have a small impact on render performance)."));
30 
31 ConfigVariableDouble collada_flatten_radius
32 ("collada-flatten-radius", 0.0,
33  PRC_DESC("This specifies the minimum cull radius in the egg file. Nodes "
34  "whose bounding volume is smaller than this radius will be "
35  "flattened tighter than nodes larger than this radius, to "
36  "reduce the node count even further. The idea is that small "
37  "objects will not need to have their individual components "
38  "culled separately, but large environments should. This allows "
39  "the user to specify what should be considered \"small\". Set "
40  "it to 0.0 to disable this feature."));
41 
42 ConfigVariableBool collada_unify
43 ("collada-unify", true,
44  PRC_DESC("When this is true, then in addition to flattening the scene graph "
45  "nodes, the collada loader will also combine as many Geoms as "
46  "possible within "
47  "a given node into a single Geom. This has theoretical performance "
48  "benefits, especially on higher-end graphics cards, but it also "
49  "slightly slows down collada loading."));
50 
51 ConfigVariableBool collada_combine_geoms
52 ("collada-combine-geoms", false,
53  PRC_DESC("Set this true to combine sibling GeomNodes into a single GeomNode, "
54  "when possible."));
55 
56 ConfigVariableBool collada_accept_errors
57 ("collada-accept-errors", true,
58  PRC_DESC("When this is true, certain kinds of recoverable errors (not syntax "
59  "errors) in a collada file will be allowed and ignored when a "
60  "collada file is loaded. When it is false, only perfectly pristine "
61  "collada files may be loaded."));
62 
63 ConfigureFn(config_collada) {
64  init_libcollada();
65 }
66 
67 ////////////////////////////////////////////////////////////////////
68 // Function: init_libcollada
69 // Description: Initializes the library. This must be called at
70 // least once before any of the functions or classes in
71 // this library can be used. Normally it will be
72 // called by the static initializers and need not be
73 // called explicitly, but special cases exist.
74 ////////////////////////////////////////////////////////////////////
75 void
76 init_libcollada() {
77  static bool initialized = false;
78  if (initialized) {
79  return;
80  }
81  initialized = true;
82 
84 
86 }
87 
This is a convenience class to specialize ConfigVariable as a boolean type.
static LoaderFileTypeRegistry * get_global_ptr()
Returns a pointer to the global LoaderFileTypeRegistry object.
This defines the Loader interface to read Dae files.
void register_type(LoaderFileType *type)
Defines a new LoaderFileType in the universe.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This class maintains the set of all known LoaderFileTypes in the universe.