Merge pull request #1726 from assimp/issue_1722
closes https://github.com/assimp/assimp/issues/1722: use a const refe…pull/1730/head
commit
b43923a759
|
@ -84,7 +84,8 @@ namespace Assimp {
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
inline std::size_t Copy(uint8_t* data, T& field) {
|
||||
inline
|
||||
std::size_t Copy(uint8_t* data, const T &field) {
|
||||
#ifdef AI_BUILD_BIG_ENDIAN
|
||||
T field_swapped=AI_BE(field);
|
||||
std::memcpy(data, &field_swapped, sizeof(field)); return sizeof(field);
|
||||
|
|
|
@ -52,7 +52,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/material.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// Material specific token (case insensitive compare)
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
# File produced by Open Asset Import Library (http://www.assimp.sf.net)
|
||||
# (assimp v4.1.1712791017)
|
||||
|
||||
newmtl DefaultMaterial
|
||||
Kd 0.6000000238418579 0.6000000238418579 0.6000000238418579
|
||||
Ka 0 0 0
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
|
||||
newmtl Skin
|
||||
Kd 0.8274509906768799 0.792156994342804 0.7725489735603333
|
||||
Ka 0.2000000029802322 0.2000000029802322 0.2000000029802322
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
map_Kd .\wal67ar_small.jpg
|
||||
|
||||
newmtl Brusttex
|
||||
Kd 0.800000011920929 0.800000011920929 0.800000011920929
|
||||
Ka 0.2000000029802322 0.2000000029802322 0.2000000029802322
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
map_Kd .\wal69ar_small.jpg
|
||||
|
||||
newmtl HLeibTex
|
||||
Kd 0.6901959776878357 0.6392160058021545 0.6156859993934631
|
||||
Ka 0.2000000029802322 0.2000000029802322 0.2000000029802322
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
map_Kd .\SpiderTex.jpg
|
||||
|
||||
newmtl BeinTex
|
||||
Kd 0.800000011920929 0.800000011920929 0.800000011920929
|
||||
Ka 0.2000000029802322 0.2000000029802322 0.2000000029802322
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
map_Kd .\drkwood2.jpg
|
||||
|
||||
newmtl Augentex
|
||||
Kd 0.800000011920929 0.800000011920929 0.800000011920929
|
||||
Ka 0.2000000029802322 0.2000000029802322 0.2000000029802322
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
map_Kd .\engineflare1.jpg
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,13 +0,0 @@
|
|||
# File produced by Open Asset Import Library (http://www.assimp.sf.net)
|
||||
# (assimp v4.1.1712791017)
|
||||
|
||||
newmtl DefaultMaterial
|
||||
Kd 0.6000000238418579 0.6000000238418579 0.6000000238418579
|
||||
Ka 0 0 0
|
||||
Ks 0 0 0
|
||||
Ke 0 0 0
|
||||
Tf 1 1 1
|
||||
d 1
|
||||
Ni 1
|
||||
illum 1
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# File produced by Open Asset Import Library (http://www.assimp.sf.net)
|
||||
# (assimp v4.1.1712791017)
|
||||
|
||||
mtllib test.mtl
|
||||
|
||||
# 8 vertex positions and colors
|
||||
v 0 0 0 124 110 120
|
||||
v 1 1 0 78 10 50
|
||||
v 1 0 0 24 200 25
|
||||
v 0 1 0 4 0 44
|
||||
v 0 1 1 224 0 10
|
||||
v 0 0 1 24 0 121
|
||||
v 1 1 1 23 0 200
|
||||
v 1 0 1 124 10 56
|
||||
|
||||
# 0 UV coordinates
|
||||
|
||||
# 6 vertex normals
|
||||
vn 0 0 -1
|
||||
vn -1 0 0
|
||||
vn 0 1 0
|
||||
vn 1 0 0
|
||||
vn 0 -1 0
|
||||
vn 0 0 1
|
||||
|
||||
# Mesh 'cube' with 11 faces
|
||||
g cube
|
||||
usemtl DefaultMaterial
|
||||
f 1//1 2//1 3//1
|
||||
f 1//1 4//1 2//1
|
||||
f 1//2 5//2 4//2
|
||||
f 1//2 6//2 5//2
|
||||
f 4//3 7//3 2//3
|
||||
f 4//3 5//3 7//3
|
||||
f 3//4 2//4 7//4
|
||||
f 3//4 7//4 8//4
|
||||
f 1//5 3//5 8//5
|
||||
f 1//5 8//5 6//5
|
||||
f 6//6 8//6 7//6
|
||||
|
Binary file not shown.
|
@ -1,184 +0,0 @@
|
|||
{
|
||||
"asset": {
|
||||
"version": "2.0",
|
||||
"generator": "Open Asset Import Library (assimp v4.1.1712791017)"
|
||||
},
|
||||
"accessors": [
|
||||
{
|
||||
"bufferView": 0,
|
||||
"byteOffset": 0,
|
||||
"componentType": 5126,
|
||||
"count": 24,
|
||||
"type": "VEC3",
|
||||
"max": [
|
||||
0.5,
|
||||
0.5,
|
||||
0.5
|
||||
],
|
||||
"min": [
|
||||
-0.5,
|
||||
-0.5,
|
||||
-0.5
|
||||
]
|
||||
},
|
||||
{
|
||||
"bufferView": 1,
|
||||
"byteOffset": 0,
|
||||
"componentType": 5126,
|
||||
"count": 24,
|
||||
"type": "VEC3",
|
||||
"max": [
|
||||
1.0,
|
||||
1.0,
|
||||
1.0
|
||||
],
|
||||
"min": [
|
||||
-1.0,
|
||||
-1.0,
|
||||
-1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"bufferView": 2,
|
||||
"byteOffset": 0,
|
||||
"componentType": 5126,
|
||||
"count": 24,
|
||||
"type": "VEC2",
|
||||
"max": [
|
||||
6.0,
|
||||
1.0
|
||||
],
|
||||
"min": [
|
||||
0.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"bufferView": 3,
|
||||
"byteOffset": 0,
|
||||
"componentType": 5123,
|
||||
"count": 36,
|
||||
"type": "SCALAR",
|
||||
"max": [
|
||||
23.0
|
||||
],
|
||||
"min": [
|
||||
0.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"buffers": [
|
||||
{
|
||||
"byteLength": 840,
|
||||
"uri": "C:/Users/admin/Downloads/assimp/test/models/glTF2/BoxTextured-glTF/BoxTextured_out.bin"
|
||||
}
|
||||
],
|
||||
"bufferViews": [
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteOffset": 0,
|
||||
"byteLength": 288,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteOffset": 288,
|
||||
"byteLength": 288,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteOffset": 576,
|
||||
"byteLength": 192,
|
||||
"target": 34962
|
||||
},
|
||||
{
|
||||
"buffer": 0,
|
||||
"byteOffset": 768,
|
||||
"byteLength": 72,
|
||||
"target": 34963
|
||||
}
|
||||
],
|
||||
"images": [
|
||||
{
|
||||
"uri": "CesiumLogoFlat.png"
|
||||
}
|
||||
],
|
||||
"materials": [
|
||||
{
|
||||
"name": "Texture",
|
||||
"pbrMetallicRoughness": {
|
||||
"baseColorTexture": {
|
||||
"index": 0
|
||||
},
|
||||
"metallicFactor": 0.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"meshes": [
|
||||
{
|
||||
"name": "Mesh",
|
||||
"primitives": [
|
||||
{
|
||||
"mode": 4,
|
||||
"material": 0,
|
||||
"indices": 3,
|
||||
"attributes": {
|
||||
"POSITION": 0,
|
||||
"NORMAL": 1,
|
||||
"TEXCOORD_0": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"nodes": [
|
||||
{
|
||||
"matrix": [
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
-1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0
|
||||
],
|
||||
"children": [
|
||||
1
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "nodes_1",
|
||||
"mesh": 0
|
||||
}
|
||||
],
|
||||
"samplers": [
|
||||
{
|
||||
"magFilter": 9729,
|
||||
"minFilter": 9986
|
||||
}
|
||||
],
|
||||
"scenes": [
|
||||
{
|
||||
"nodes": [
|
||||
0
|
||||
]
|
||||
}
|
||||
],
|
||||
"textures": [
|
||||
{
|
||||
"source": 0,
|
||||
"sampler": 0
|
||||
}
|
||||
],
|
||||
"scene": 0
|
||||
}
|
Loading…
Reference in New Issue