Panda3D
Loading...
Searching...
No Matches
config_assimp.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file config_assimp.cxx
10 * @author rdb
11 * @date 2011-03-29
12 */
13
14#include "config_assimp.h"
15
17
18#include "dconfig.h"
20
21ConfigureDef(config_assimp);
22NotifyCategoryDef(assimp, "");
23
24ConfigureFn(config_assimp) {
26}
27
28ConfigVariableBool assimp_calc_tangent_space
29("assimp-calc-tangent-space", false,
30 PRC_DESC("Calculates tangents and binormals for meshes imported via Assimp."));
31
32ConfigVariableBool assimp_join_identical_vertices
33("assimp-join-identical-vertices", true,
34 PRC_DESC("Merges duplicate vertices. Set this to false if you want each "
35 "vertex to only be in use on one triangle."));
36
37ConfigVariableBool assimp_improve_cache_locality
38("assimp-improve-cache-locality", true,
39 PRC_DESC("Improves rendering performance of the loaded meshes by reordering "
40 "triangles for better vertex cache locality. Set this to false if "
41 "you need geometry to be loaded in the exact order that it was "
42 "specified in the file, or to improve load performance."));
43
44ConfigVariableBool assimp_remove_redundant_materials
45("assimp-remove-redundant-materials", true,
46 PRC_DESC("Removes redundant/unreferenced materials from assets."));
47
48ConfigVariableBool assimp_fix_infacing_normals
49("assimp-fix-infacing-normals", false,
50 PRC_DESC("Determines which normal vectors are facing inward and inverts them "
51 "so that they are facing outward."));
52
53ConfigVariableBool assimp_optimize_meshes
54("assimp-optimize-meshes", true,
55 PRC_DESC("Reduces the number of draw calls by unifying geometry with the same "
56 "materials. Especially effective in conjunction with "
57 "assimp-optimize-graph and assimp-remove-redundant-materials."));
58
59ConfigVariableBool assimp_optimize_graph
60("assimp-optimize-graph", false,
61 PRC_DESC("Optimizes the scene geometry by flattening the scene hierarchy. "
62 "This is very efficient (combined with assimp-optimize-meshes), but "
63 "it may result the hierarchy to become lost, so it is disabled by "
64 "default."));
65
66ConfigVariableBool assimp_flip_winding_order
67("assimp-flip-winding-order", false,
68 PRC_DESC("Set this true to flip the winding order of all models loaded via "
69 "the Assimp loader. Note that you may need to clear the model-cache "
70 "after changing this."));
71
72ConfigVariableBool assimp_gen_normals
73("assimp-gen-normals", false,
74 PRC_DESC("Set this true to generate normals (if absent from file) on import. "
75 "See assimp-smooth-normal-angle for more information. "
76 "Note that you may need to clear the model-cache after "
77 "changing this."));
78
79ConfigVariableDouble assimp_smooth_normal_angle
80("assimp-smooth-normal-angle", 0.0,
81 PRC_DESC("Set this to anything other than 0.0 in degrees (so 180.0 is PI) to "
82 "specify the maximum angle that may be between two face normals at "
83 "the same vertex position that are smoothed together. Sometimes "
84 "referred to as 'crease angle'. Only has effect if "
85 "assimp-gen-normals is set to true and the file does not contain "
86 "normals. Note that you may need to clear the model-cache after "
87 "changing this."));
88
89ConfigVariableBool assimp_collapse_dummy_root_node
90("assimp-collapse-dummy-root-node", false,
91 PRC_DESC("If set to true, collapses the root node that Assimp creates, if it "
92 "appears to be a synthetic dummy root node and contains no meshes. "
93 "This variable is new as of Panda3D 1.10.13 and will become true by "
94 "default as of Panda3D 1.11.0."));
95
96/**
97 * Initializes the library. This must be called at least once before any of
98 * the functions or classes in this library can be used. Normally it will be
99 * called by the static initializers and need not be called explicitly, but
100 * special cases exist.
101 */
102void
104 static bool initialized = false;
105 if (initialized) {
106 return;
107 }
108 initialized = true;
109
110 LoaderFileTypeAssimp::init_type();
111
114}
This is a convenience class to specialize ConfigVariable as a boolean type.
This is a convenience class to specialize ConfigVariable as a floating- point type.
This defines the Loader interface that uses the Assimp library to load various model formats.
This class maintains the set of all known LoaderFileTypes in the universe.
void register_type(LoaderFileType *type)
Defines a new LoaderFileType in the universe.
static LoaderFileTypeRegistry * get_global_ptr()
Returns a pointer to the global LoaderFileTypeRegistry object.
void init_libassimp()
Initializes the library.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.