Whitespace tweak.
This commit is contained in:
parent
e5078a50b7
commit
387f5df782
110
src/FBX2glTF.h
110
src/FBX2glTF.h
|
@ -12,7 +12,7 @@
|
||||||
#include <climits>
|
#include <climits>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if defined ( _WIN32 )
|
#if defined(_WIN32)
|
||||||
// Tell Windows not to define min() and max() macros
|
// Tell Windows not to define min() and max() macros
|
||||||
#define NOMINMAX
|
#define NOMINMAX
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
@ -20,10 +20,10 @@
|
||||||
|
|
||||||
#define FBX2GLTF_VERSION std::string("0.9.6")
|
#define FBX2GLTF_VERSION std::string("0.9.6")
|
||||||
|
|
||||||
#include <fmt/printf.h>
|
|
||||||
#include <fbxsdk.h>
|
#include <fbxsdk.h>
|
||||||
|
#include <fmt/printf.h>
|
||||||
|
|
||||||
#if defined ( _WIN32 )
|
#if defined(_WIN32)
|
||||||
// this is defined in fbxmath.h
|
// this is defined in fbxmath.h
|
||||||
#undef isnan
|
#undef isnan
|
||||||
#endif
|
#endif
|
||||||
|
@ -31,10 +31,10 @@
|
||||||
#include "mathfu.hpp"
|
#include "mathfu.hpp"
|
||||||
|
|
||||||
// give all modules access to our tweaked JSON
|
// give all modules access to our tweaked JSON
|
||||||
#include <json.hpp>
|
|
||||||
#include <fifo_map.hpp>
|
#include <fifo_map.hpp>
|
||||||
|
#include <json.hpp>
|
||||||
|
|
||||||
template<class K, class V, class ignore, class A>
|
template <class K, class V, class ignore, class A>
|
||||||
using workaround_fifo_map = nlohmann::fifo_map<K, V, nlohmann::fifo_map_compare<K>, A>;
|
using workaround_fifo_map = nlohmann::fifo_map<K, V, nlohmann::fifo_map_compare<K>, A>;
|
||||||
|
|
||||||
using json = nlohmann::basic_json<workaround_fifo_map>;
|
using json = nlohmann::basic_json<workaround_fifo_map>;
|
||||||
|
@ -51,66 +51,66 @@ inline uint32_t to_uint32(size_t n) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The variuos situations in which the user may wish for us to (re-)compute normals for our vertices.
|
* The variuos situations in which the user may wish for us to (re-)compute normals for our
|
||||||
*/
|
* vertices.
|
||||||
|
*/
|
||||||
enum class ComputeNormalsOption {
|
enum class ComputeNormalsOption {
|
||||||
NEVER, // do not ever compute any normals (results in broken glTF for some sources)
|
NEVER, // do not ever compute any normals (results in broken glTF for some sources)
|
||||||
BROKEN, // replace zero-length normals in any mesh that has a normal layer
|
BROKEN, // replace zero-length normals in any mesh that has a normal layer
|
||||||
MISSING, // if a mesh lacks normals, compute them all
|
MISSING, // if a mesh lacks normals, compute them all
|
||||||
ALWAYS // compute a new normal for every vertex, obliterating whatever may have been there before
|
ALWAYS // compute a new normal for every vertex, obliterating whatever may have been there before
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class UseLongIndicesOptions {
|
enum class UseLongIndicesOptions {
|
||||||
NEVER, // only ever use 16-bit indices
|
NEVER, // only ever use 16-bit indices
|
||||||
AUTO, // use shorts or longs depending on vertex count
|
AUTO, // use shorts or longs depending on vertex count
|
||||||
ALWAYS, // only ever use 32-bit indices
|
ALWAYS, // only ever use 32-bit indices
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User-supplied options that dictate the nature of the glTF being generated.
|
* User-supplied options that dictate the nature of the glTF being generated.
|
||||||
*/
|
*/
|
||||||
struct GltfOptions
|
struct GltfOptions {
|
||||||
{
|
/**
|
||||||
/**
|
* If negative, disabled. Otherwise, a bitfield of RawVertexAttributes that
|
||||||
* If negative, disabled. Otherwise, a bitfield of RawVertexAttributes that
|
* specify the largest set of attributes that'll ever be kept for a vertex.
|
||||||
* specify the largest set of attributes that'll ever be kept for a vertex.
|
* The special bit RAW_VERTEX_ATTRIBUTE_AUTO triggers smart mode, where the
|
||||||
* The special bit RAW_VERTEX_ATTRIBUTE_AUTO triggers smart mode, where the
|
* attributes to keep are inferred from which textures are supplied.
|
||||||
* attributes to keep are inferred from which textures are supplied.
|
*/
|
||||||
*/
|
int keepAttribs{-1};
|
||||||
int keepAttribs { -1 };
|
/** Whether to output a .glb file, the binary format of glTF. */
|
||||||
/** Whether to output a .glb file, the binary format of glTF. */
|
bool outputBinary{false};
|
||||||
bool outputBinary { false };
|
/** If non-binary, whether to inline all resources, for a single (large) .glTF file. */
|
||||||
/** If non-binary, whether to inline all resources, for a single (large) .glTF file. */
|
bool embedResources{false};
|
||||||
bool embedResources { false };
|
|
||||||
|
|
||||||
/** Whether and how to use KHR_draco_mesh_compression to minimize static geometry size. */
|
/** Whether and how to use KHR_draco_mesh_compression to minimize static geometry size. */
|
||||||
struct {
|
struct {
|
||||||
bool enabled = false;
|
bool enabled = false;
|
||||||
int compressionLevel = 7;
|
int compressionLevel = 7;
|
||||||
int quantBitsPosition = 14;
|
int quantBitsPosition = 14;
|
||||||
int quantBitsTexCoord = 10;
|
int quantBitsTexCoord = 10;
|
||||||
int quantBitsNormal = 10;
|
int quantBitsNormal = 10;
|
||||||
int quantBitsColor = 8;
|
int quantBitsColor = 8;
|
||||||
int quantBitsGeneric = 8;
|
int quantBitsGeneric = 8;
|
||||||
} draco;
|
} draco;
|
||||||
|
|
||||||
/** Whether to include FBX User Properties as 'extras' metadata in glTF nodes. */
|
/** Whether to include FBX User Properties as 'extras' metadata in glTF nodes. */
|
||||||
bool enableUserProperties { false };
|
bool enableUserProperties{false};
|
||||||
|
|
||||||
/** Whether to use KHR_materials_unlit to extend materials definitions. */
|
/** Whether to use KHR_materials_unlit to extend materials definitions. */
|
||||||
bool useKHRMatUnlit { false };
|
bool useKHRMatUnlit{false};
|
||||||
/** Whether to populate the pbrMetallicRoughness substruct in materials. */
|
/** Whether to populate the pbrMetallicRoughness substruct in materials. */
|
||||||
bool usePBRMetRough { false };
|
bool usePBRMetRough{false};
|
||||||
|
|
||||||
/** Whether to include lights through the KHR_punctual_lights extension. */
|
/** Whether to include lights through the KHR_punctual_lights extension. */
|
||||||
bool useKHRLightsPunctual { true };
|
bool useKHRLightsPunctual{true};
|
||||||
|
|
||||||
/** Whether to include blend shape normals, if present according to the SDK. */
|
/** Whether to include blend shape normals, if present according to the SDK. */
|
||||||
bool useBlendShapeNormals { false };
|
bool useBlendShapeNormals{false};
|
||||||
/** Whether to include blend shape tangents, if present according to the SDK. */
|
/** Whether to include blend shape tangents, if present according to the SDK. */
|
||||||
bool useBlendShapeTangents { false };
|
bool useBlendShapeTangents{false};
|
||||||
/** When to compute vertex normals from geometry. */
|
/** When to compute vertex normals from geometry. */
|
||||||
ComputeNormalsOption computeNormals = ComputeNormalsOption::BROKEN;
|
ComputeNormalsOption computeNormals = ComputeNormalsOption::BROKEN;
|
||||||
/** When to use 32-bit indices. */
|
/** When to use 32-bit indices. */
|
||||||
UseLongIndicesOptions useLongIndices = UseLongIndicesOptions::AUTO;
|
UseLongIndicesOptions useLongIndices = UseLongIndicesOptions::AUTO;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue