mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
update assimp lib
This commit is contained in:
parent
03a348deb7
commit
d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -44,6 +44,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
*
|
||||
* glTF Extensions Support:
|
||||
* KHR_materials_pbrSpecularGlossiness full
|
||||
* KHR_materials_specular full
|
||||
* KHR_materials_unlit full
|
||||
* KHR_lights_punctual full
|
||||
* KHR_materials_sheen full
|
||||
|
|
@ -51,6 +52,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
* KHR_materials_transmission full
|
||||
* KHR_materials_volume full
|
||||
* KHR_materials_ior full
|
||||
* KHR_materials_emissive_strength full
|
||||
*/
|
||||
#ifndef GLTF2ASSET_H_INC
|
||||
#define GLTF2ASSET_H_INC
|
||||
|
|
@ -364,20 +366,20 @@ struct CustomExtension {
|
|||
|
||||
~CustomExtension() = default;
|
||||
|
||||
CustomExtension(const CustomExtension &other) :
|
||||
name(other.name),
|
||||
mStringValue(other.mStringValue),
|
||||
mDoubleValue(other.mDoubleValue),
|
||||
mUint64Value(other.mUint64Value),
|
||||
mInt64Value(other.mInt64Value),
|
||||
mBoolValue(other.mBoolValue),
|
||||
mValues(other.mValues) {
|
||||
// empty
|
||||
}
|
||||
CustomExtension(const CustomExtension &other) = default;
|
||||
|
||||
CustomExtension& operator=(const CustomExtension&) = default;
|
||||
};
|
||||
|
||||
//! Represents metadata in an glTF2 object
|
||||
struct Extras {
|
||||
std::vector<CustomExtension> mValues;
|
||||
|
||||
inline bool HasExtras() const {
|
||||
return !mValues.empty();
|
||||
}
|
||||
};
|
||||
|
||||
//! Base class for all glTF top-level objects
|
||||
struct Object {
|
||||
int index; //!< The index of this object within its property container
|
||||
|
|
@ -386,7 +388,7 @@ struct Object {
|
|||
std::string name; //!< The user-defined name of this object
|
||||
|
||||
CustomExtension customExtensions;
|
||||
CustomExtension extras;
|
||||
Extras extras;
|
||||
|
||||
//! Objects marked as special are not exported (used to emulate the binary body buffer)
|
||||
virtual bool IsSpecial() const { return false; }
|
||||
|
|
@ -491,7 +493,7 @@ private:
|
|||
|
||||
public:
|
||||
Buffer();
|
||||
~Buffer();
|
||||
~Buffer() override;
|
||||
|
||||
void Read(Value &obj, Asset &r);
|
||||
|
||||
|
|
@ -545,7 +547,7 @@ struct BufferView : public Object {
|
|||
BufferViewTarget target; //! The target that the WebGL buffer should be bound to.
|
||||
|
||||
void Read(Value &obj, Asset &r);
|
||||
uint8_t *GetPointer(size_t accOffset);
|
||||
uint8_t *GetPointerAndTailSize(size_t accOffset, size_t& outTailSize);
|
||||
};
|
||||
|
||||
//! A typed view into a BufferView. A BufferView contains raw binary data.
|
||||
|
|
@ -573,7 +575,7 @@ struct Accessor : public Object {
|
|||
inline size_t GetMaxByteSize();
|
||||
|
||||
template <class T>
|
||||
void ExtractData(T *&outData);
|
||||
size_t ExtractData(T *&outData, const std::vector<unsigned int> *remappingIndices = nullptr);
|
||||
|
||||
void WriteData(size_t count, const void *src_buffer, size_t src_stride);
|
||||
void WriteSparseValues(size_t count, const void *src_data, size_t src_dataStride);
|
||||
|
|
@ -627,7 +629,7 @@ struct Accessor : public Object {
|
|||
|
||||
std::vector<uint8_t> data; //!< Actual data, which may be defaulted to an array of zeros or the original data, with the sparse buffer view applied on top of it.
|
||||
|
||||
void PopulateData(size_t numBytes, uint8_t *bytes);
|
||||
void PopulateData(size_t numBytes, const uint8_t *bytes);
|
||||
void PatchData(unsigned int elementSize);
|
||||
};
|
||||
};
|
||||
|
|
@ -718,6 +720,7 @@ const vec4 defaultBaseColor = { 1, 1, 1, 1 };
|
|||
const vec3 defaultEmissiveFactor = { 0, 0, 0 };
|
||||
const vec4 defaultDiffuseFactor = { 1, 1, 1, 1 };
|
||||
const vec3 defaultSpecularFactor = { 1, 1, 1 };
|
||||
const vec3 defaultSpecularColorFactor = { 1, 1, 1 };
|
||||
const vec3 defaultSheenFactor = { 0, 0, 0 };
|
||||
const vec3 defaultAttenuationColor = { 1, 1, 1 };
|
||||
|
||||
|
|
@ -761,6 +764,16 @@ struct PbrSpecularGlossiness {
|
|||
void SetDefaults();
|
||||
};
|
||||
|
||||
struct MaterialSpecular {
|
||||
float specularFactor;
|
||||
vec3 specularColorFactor;
|
||||
TextureInfo specularTexture;
|
||||
TextureInfo specularColorTexture;
|
||||
|
||||
MaterialSpecular() { SetDefaults(); }
|
||||
void SetDefaults();
|
||||
};
|
||||
|
||||
struct MaterialSheen {
|
||||
vec3 sheenColorFactor;
|
||||
float sheenRoughnessFactor;
|
||||
|
|
@ -801,6 +814,13 @@ struct MaterialIOR {
|
|||
void SetDefaults();
|
||||
};
|
||||
|
||||
struct MaterialEmissiveStrength {
|
||||
float emissiveStrength = 0.f;
|
||||
|
||||
MaterialEmissiveStrength() { SetDefaults(); }
|
||||
void SetDefaults();
|
||||
};
|
||||
|
||||
//! The material appearance of a primitive.
|
||||
struct Material : public Object {
|
||||
//PBR metallic roughness properties
|
||||
|
|
@ -818,6 +838,9 @@ struct Material : public Object {
|
|||
//extension: KHR_materials_pbrSpecularGlossiness
|
||||
Nullable<PbrSpecularGlossiness> pbrSpecularGlossiness;
|
||||
|
||||
//extension: KHR_materials_specular
|
||||
Nullable<MaterialSpecular> materialSpecular;
|
||||
|
||||
//extension: KHR_materials_sheen
|
||||
Nullable<MaterialSheen> materialSheen;
|
||||
|
||||
|
|
@ -832,7 +855,10 @@ struct Material : public Object {
|
|||
|
||||
//extension: KHR_materials_ior
|
||||
Nullable<MaterialIOR> materialIOR;
|
||||
|
||||
|
||||
//extension: KHR_materials_emissive_strength
|
||||
Nullable<MaterialEmissiveStrength> materialEmissiveStrength;
|
||||
|
||||
//extension: KHR_materials_unlit
|
||||
bool unlit;
|
||||
|
||||
|
|
@ -1044,7 +1070,7 @@ class LazyDict : public LazyDictBase {
|
|||
Ref<T> Add(T *obj);
|
||||
|
||||
public:
|
||||
LazyDict(Asset &asset, const char *dictId, const char *extId = 0);
|
||||
LazyDict(Asset &asset, const char *dictId, const char *extId = nullptr);
|
||||
~LazyDict();
|
||||
|
||||
Ref<T> Retrieve(unsigned int i);
|
||||
|
|
@ -1075,8 +1101,7 @@ struct AssetMetadata {
|
|||
|
||||
void Read(Document &doc);
|
||||
|
||||
AssetMetadata() :
|
||||
version() {}
|
||||
AssetMetadata() = default;
|
||||
};
|
||||
|
||||
//
|
||||
|
|
@ -1098,6 +1123,7 @@ public:
|
|||
//! Keeps info about the enabled extensions
|
||||
struct Extensions {
|
||||
bool KHR_materials_pbrSpecularGlossiness;
|
||||
bool KHR_materials_specular;
|
||||
bool KHR_materials_unlit;
|
||||
bool KHR_lights_punctual;
|
||||
bool KHR_texture_transform;
|
||||
|
|
@ -1106,12 +1132,14 @@ public:
|
|||
bool KHR_materials_transmission;
|
||||
bool KHR_materials_volume;
|
||||
bool KHR_materials_ior;
|
||||
bool KHR_materials_emissive_strength;
|
||||
bool KHR_draco_mesh_compression;
|
||||
bool FB_ngon_encoding;
|
||||
bool KHR_texture_basisu;
|
||||
|
||||
Extensions() :
|
||||
KHR_materials_pbrSpecularGlossiness(false),
|
||||
KHR_materials_specular(false),
|
||||
KHR_materials_unlit(false),
|
||||
KHR_lights_punctual(false),
|
||||
KHR_texture_transform(false),
|
||||
|
|
@ -1120,6 +1148,7 @@ public:
|
|||
KHR_materials_transmission(false),
|
||||
KHR_materials_volume(false),
|
||||
KHR_materials_ior(false),
|
||||
KHR_materials_emissive_strength(false),
|
||||
KHR_draco_mesh_compression(false),
|
||||
FB_ngon_encoding(false),
|
||||
KHR_texture_basisu(false) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue