Merge branch 'master' into x3d_pugi_migration_artenuvielle
commit
791cb195be
|
@ -259,7 +259,7 @@ namespace Discreet3DS {
|
||||||
// Specifies the file name of a texture
|
// Specifies the file name of a texture
|
||||||
CHUNK_MAPFILE = 0xA300,
|
CHUNK_MAPFILE = 0xA300,
|
||||||
|
|
||||||
// Specifies whether a materail requires two-sided rendering
|
// Specifies whether a material requires two-sided rendering
|
||||||
CHUNK_MAT_TWO_SIDE = 0xA081,
|
CHUNK_MAT_TWO_SIDE = 0xA081,
|
||||||
// ********************************************************************
|
// ********************************************************************
|
||||||
|
|
||||||
|
|
|
@ -101,9 +101,11 @@ private:
|
||||||
std::vector<OpcPackageRelationship*> mRelations;
|
std::vector<OpcPackageRelationship*> mRelations;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ASSIMP_BUILD_NO_3MF_EXPORTER
|
|
||||||
#endif // ASSIMP_BUILD_NO_EXPORT
|
|
||||||
|
|
||||||
} // Namespace D3MF
|
} // Namespace D3MF
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
||||||
|
#endif // ASSIMP_BUILD_NO_3MF_EXPORTER
|
||||||
|
#endif // ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -690,7 +690,7 @@ void AMFImporter::Postprocess_BuildConstellation(AMFConstellation &pConstellatio
|
||||||
if (ne->Type == AMFNodeElementBase::ENET_Metadata) continue;
|
if (ne->Type == AMFNodeElementBase::ENET_Metadata) continue;
|
||||||
if (ne->Type != AMFNodeElementBase::ENET_Instance) throw DeadlyImportError("Only <instance> nodes can be in <constellation>.");
|
if (ne->Type != AMFNodeElementBase::ENET_Instance) throw DeadlyImportError("Only <instance> nodes can be in <constellation>.");
|
||||||
|
|
||||||
// create alias for conveniance
|
// create alias for convenience
|
||||||
AMFInstance &als = *((AMFInstance *)ne);
|
AMFInstance &als = *((AMFInstance *)ne);
|
||||||
// find referenced object
|
// find referenced object
|
||||||
if (!Find_ConvertedNode(als.ObjectID, nodeArray, &found_node)) Throw_ID_NotFound(als.ObjectID);
|
if (!Find_ConvertedNode(als.ObjectID, nodeArray, &found_node)) Throw_ID_NotFound(als.ObjectID);
|
||||||
|
|
|
@ -681,7 +681,7 @@ void ASEImporter::BuildNodes(std::vector<BaseNode *> &nodes) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Are there ane orphaned nodes?
|
// Are there any orphaned nodes?
|
||||||
if (!aiList.empty()) {
|
if (!aiList.empty()) {
|
||||||
std::vector<aiNode *> apcNodes;
|
std::vector<aiNode *> apcNodes;
|
||||||
apcNodes.reserve(aiList.size() + pcScene->mRootNode->mNumChildren);
|
apcNodes.reserve(aiList.size() + pcScene->mRootNode->mNumChildren);
|
||||||
|
|
|
@ -48,11 +48,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
#include <assimp/defs.h>
|
#include <assimp/defs.h>
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
// nothing really needed here - reserved for future use like properties
|
// nothing really needed here - reserved for future use like properties
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
void ASSIMP_API ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/);
|
void ASSIMP_API ExportSceneAssbin(const char* pFile, IOSystem* pIOSystem, const aiScene* pScene, const ExportProperties* /*pProperties*/);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif // AI_ASSBINEXPORTER_H_INC
|
#endif // AI_ASSBINEXPORTER_H_INC
|
||||||
|
|
|
@ -43,13 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssbinFileWriter.h"
|
#include "AssbinFileWriter.h"
|
||||||
|
|
||||||
#include "Common/assbin_chunks.h"
|
#include "Common/assbin_chunks.h"
|
||||||
#include "PostProcessing/ProcessHelper.h"
|
#include "PostProcessing/ProcessHelper.h"
|
||||||
|
|
||||||
#include <assimp/Exceptional.h>
|
#include <assimp/Exceptional.h>
|
||||||
#include <assimp/version.h>
|
#include <assimp/version.h>
|
||||||
#include <assimp/Exporter.hpp>
|
|
||||||
#include <assimp/IOStream.hpp>
|
#include <assimp/IOStream.hpp>
|
||||||
|
|
||||||
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
#ifdef ASSIMP_BUILD_NO_OWN_ZLIB
|
||||||
|
@ -58,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "../contrib/zlib/zlib.h"
|
#include "../contrib/zlib/zlib.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <time.h>
|
#include <ctime>
|
||||||
|
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
|
@ -277,7 +275,7 @@ public:
|
||||||
// empty
|
// empty
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~AssbinChunkWriter() {
|
~AssbinChunkWriter() override {
|
||||||
if (container) {
|
if (container) {
|
||||||
container->Write(&magic, sizeof(uint32_t), 1);
|
container->Write(&magic, sizeof(uint32_t), 1);
|
||||||
container->Write(&cursor, sizeof(uint32_t), 1);
|
container->Write(&cursor, sizeof(uint32_t), 1);
|
||||||
|
@ -288,26 +286,27 @@ public:
|
||||||
|
|
||||||
void *GetBufferPointer() { return buffer; }
|
void *GetBufferPointer() { return buffer; }
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t Read(void * /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) override {
|
||||||
virtual size_t Read(void * /*pvBuffer*/, size_t /*pSize*/, size_t /*pCount*/) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
virtual aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) {
|
|
||||||
|
aiReturn Seek(size_t /*pOffset*/, aiOrigin /*pOrigin*/) override {
|
||||||
return aiReturn_FAILURE;
|
return aiReturn_FAILURE;
|
||||||
}
|
}
|
||||||
virtual size_t Tell() const {
|
|
||||||
|
size_t Tell() const override {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
virtual void Flush() {
|
|
||||||
|
void Flush() override {
|
||||||
// not implemented
|
// not implemented
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual size_t FileSize() const {
|
size_t FileSize() const override {
|
||||||
return cursor;
|
return cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) override {
|
||||||
virtual size_t Write(const void *pvBuffer, size_t pSize, size_t pCount) {
|
|
||||||
pSize *= pCount;
|
pSize *= pCount;
|
||||||
if (cursor + pSize > cur_size) {
|
if (cursor + pSize > cur_size) {
|
||||||
Grow(cursor + pSize);
|
Grow(cursor + pSize);
|
||||||
|
|
|
@ -406,7 +406,7 @@ void AssbinImporter::ReadBinaryMesh(IOStream *stream, aiMesh *mesh) {
|
||||||
f.mIndices = new unsigned int[f.mNumIndices];
|
f.mIndices = new unsigned int[f.mNumIndices];
|
||||||
|
|
||||||
for (unsigned int a = 0; a < f.mNumIndices; ++a) {
|
for (unsigned int a = 0; a < f.mNumIndices; ++a) {
|
||||||
// Check if unsigned short ( 16 bit ) are big enought for the indices
|
// Check if unsigned short ( 16 bit ) are big enough for the indices
|
||||||
if (fitsIntoUI16(mesh->mNumVertices)) {
|
if (fitsIntoUI16(mesh->mNumVertices)) {
|
||||||
f.mIndices[a] = Read<uint16_t>(stream);
|
f.mIndices[a] = Read<uint16_t>(stream);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -168,7 +168,7 @@ static void WriteNode(const aiNode *node, IOStream *io, unsigned int depth) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
// Some chuncks of text will need to be encoded for XML
|
// Some chunks of text will need to be encoded for XML
|
||||||
// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377
|
// http://stackoverflow.com/questions/5665231/most-efficient-way-to-escape-xml-html-in-c-string#5665377
|
||||||
static std::string encodeXML(const std::string &data) {
|
static std::string encodeXML(const std::string &data) {
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
|
|
|
@ -178,7 +178,7 @@ void BVHLoader::ReadHierarchy(aiScene *pScene) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Reads a node and recursively its childs and returns the created node;
|
// Reads a node and recursively its children and returns the created node;
|
||||||
aiNode *BVHLoader::ReadNode() {
|
aiNode *BVHLoader::ReadNode() {
|
||||||
// first token is name
|
// first token is name
|
||||||
std::string nodeName = GetNextToken();
|
std::string nodeName = GetNextToken();
|
||||||
|
|
|
@ -112,7 +112,7 @@ protected:
|
||||||
/** Reads the hierarchy */
|
/** Reads the hierarchy */
|
||||||
void ReadHierarchy(aiScene *pScene);
|
void ReadHierarchy(aiScene *pScene);
|
||||||
|
|
||||||
/** Reads a node and recursively its childs and returns the created node. */
|
/** Reads a node and recursively its children and returns the created node. */
|
||||||
aiNode *ReadNode();
|
aiNode *ReadNode();
|
||||||
|
|
||||||
/** Reads an end node and returns the created node. */
|
/** Reads an end node and returns the created node. */
|
||||||
|
|
|
@ -476,7 +476,7 @@ public:
|
||||||
* in BlenderScene.cpp and is machine-generated.
|
* in BlenderScene.cpp and is machine-generated.
|
||||||
* Converters are used to quickly handle objects whose
|
* Converters are used to quickly handle objects whose
|
||||||
* exact data type is a runtime-property and not yet
|
* exact data type is a runtime-property and not yet
|
||||||
* known at compile time (consier Object::data).*/
|
* known at compile time (consider Object::data).*/
|
||||||
void RegisterConverters();
|
void RegisterConverters();
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
|
|
@ -586,7 +586,7 @@ void COBImporter::ReadUnit_Ascii(Scene &out, LineSplitter &splitter, const Chunk
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// parent chunks preceede their childs, so we should have the
|
// parent chunks preceede their children, so we should have the
|
||||||
// corresponding chunk already.
|
// corresponding chunk already.
|
||||||
for (std::shared_ptr<Node> &nd : out.nodes) {
|
for (std::shared_ptr<Node> &nd : out.nodes) {
|
||||||
if (nd->id == nfo.parent_id) {
|
if (nd->id == nfo.parent_id) {
|
||||||
|
@ -668,7 +668,7 @@ void COBImporter::ReadCame_Ascii(Scene &out, LineSplitter &splitter, const Chunk
|
||||||
|
|
||||||
ReadBasicNodeInfo_Ascii(msh, ++splitter, nfo);
|
ReadBasicNodeInfo_Ascii(msh, ++splitter, nfo);
|
||||||
|
|
||||||
// skip the next line, we don't know this differenciation between a
|
// skip the next line, we don't know this differentiation between a
|
||||||
// standard camera and a panoramic camera.
|
// standard camera and a panoramic camera.
|
||||||
++splitter;
|
++splitter;
|
||||||
}
|
}
|
||||||
|
@ -1169,7 +1169,7 @@ void COBImporter::ReadUnit_Binary(COB::Scene &out, StreamReaderLE &reader, const
|
||||||
|
|
||||||
const chunk_guard cn(nfo, reader);
|
const chunk_guard cn(nfo, reader);
|
||||||
|
|
||||||
// parent chunks preceede their childs, so we should have the
|
// parent chunks preceede their children, so we should have the
|
||||||
// corresponding chunk already.
|
// corresponding chunk already.
|
||||||
for (std::shared_ptr<Node> &nd : out.nodes) {
|
for (std::shared_ptr<Node> &nd : out.nodes) {
|
||||||
if (nd->id == nfo.parent_id) {
|
if (nd->id == nfo.parent_id) {
|
||||||
|
|
|
@ -1595,7 +1595,7 @@ void FBXConverter::ConvertCluster(std::vector<aiBone *> &local_mesh_bones, const
|
||||||
bone_map.insert(std::pair<const std::string, aiBone *>(deformer_name, bone));
|
bone_map.insert(std::pair<const std::string, aiBone *>(deformer_name, bone));
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSIMP_LOG_DEBUG("bone research: Indicies size: ", out_indices.size());
|
ASSIMP_LOG_DEBUG("bone research: Indices size: ", out_indices.size());
|
||||||
|
|
||||||
// lookup must be populated in case something goes wrong
|
// lookup must be populated in case something goes wrong
|
||||||
// this also allocates bones to mesh instance outside
|
// this also allocates bones to mesh instance outside
|
||||||
|
|
|
@ -693,7 +693,7 @@ private:
|
||||||
typedef std::vector<int64_t> KeyTimeList;
|
typedef std::vector<int64_t> KeyTimeList;
|
||||||
typedef std::vector<float> KeyValueList;
|
typedef std::vector<float> KeyValueList;
|
||||||
|
|
||||||
/** Represents a FBX animation curve (i.e. a 1-dimensional set of keyframes and values therefor) */
|
/** Represents a FBX animation curve (i.e. a 1-dimensional set of keyframes and values therefore) */
|
||||||
class AnimationCurve : public Object {
|
class AnimationCurve : public Object {
|
||||||
public:
|
public:
|
||||||
AnimationCurve(uint64_t id, const Element& element, const std::string& name, const Document& doc);
|
AnimationCurve(uint64_t id, const Element& element, const std::string& name, const Document& doc);
|
||||||
|
|
|
@ -1709,7 +1709,7 @@ void FBXExporter::WriteObjects ()
|
||||||
//p.AddP70string("UVSet", ""); // TODO: how should this work?
|
//p.AddP70string("UVSet", ""); // TODO: how should this work?
|
||||||
p.AddP70bool("UseMaterial", 1);
|
p.AddP70bool("UseMaterial", 1);
|
||||||
tnode.AddChild(p);
|
tnode.AddChild(p);
|
||||||
// can't easily detrmine which texture path will be correct,
|
// can't easily determine which texture path will be correct,
|
||||||
// so just store what we have in every field.
|
// so just store what we have in every field.
|
||||||
// these being incorrect is a common problem with FBX anyway.
|
// these being incorrect is a common problem with FBX anyway.
|
||||||
tnode.AddChild("FileName", texture_path);
|
tnode.AddChild("FileName", texture_path);
|
||||||
|
@ -1915,7 +1915,7 @@ void FBXExporter::WriteObjects ()
|
||||||
// mark all parent nodes as skeleton as well,
|
// mark all parent nodes as skeleton as well,
|
||||||
// up until we find the root node,
|
// up until we find the root node,
|
||||||
// or else the node containing the mesh,
|
// or else the node containing the mesh,
|
||||||
// or else the parent of a node containig the mesh.
|
// or else the parent of a node containing the mesh.
|
||||||
for (
|
for (
|
||||||
const aiNode* parent = n->mParent;
|
const aiNode* parent = n->mParent;
|
||||||
parent && parent != mScene->mRootNode;
|
parent && parent != mScene->mRootNode;
|
||||||
|
|
|
@ -132,7 +132,7 @@ void IRRImporter::SetupProperties(const Importer *pImp) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a mesh tha consists of a single squad (a side of a skybox)
|
// Build a mesh that consists of a single squad (a side of a skybox)
|
||||||
aiMesh *IRRImporter::BuildSingleQuadMesh(const SkyboxVertex &v1,
|
aiMesh *IRRImporter::BuildSingleQuadMesh(const SkyboxVertex &v1,
|
||||||
const SkyboxVertex &v2,
|
const SkyboxVertex &v2,
|
||||||
const SkyboxVertex &v3,
|
const SkyboxVertex &v3,
|
||||||
|
|
|
@ -76,7 +76,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* Currently supports static meshes, vertex colors, materials, textures
|
* Currently supports static meshes, vertex colors, materials, textures
|
||||||
*
|
*
|
||||||
* For animation, it would require the following conversions:
|
* For animation, it would require the following conversions:
|
||||||
* - aiNode (bones) -> m3d_t.bone (with parent id, position vector and oriantation quaternion)
|
* - aiNode (bones) -> m3d_t.bone (with parent id, position vector and orientation quaternion)
|
||||||
* - aiMesh.aiBone -> m3d_t.skin (per vertex, with bone id, weight pairs)
|
* - aiMesh.aiBone -> m3d_t.skin (per vertex, with bone id, weight pairs)
|
||||||
* - aiAnimation -> m3d_action (frame with timestamp and list of bone id, position, orientation
|
* - aiAnimation -> m3d_action (frame with timestamp and list of bone id, position, orientation
|
||||||
* triplets, instead of per bone timestamp + lists)
|
* triplets, instead of per bone timestamp + lists)
|
||||||
|
|
|
@ -296,7 +296,7 @@ void M3DImporter::importMaterials(const M3DWrapper &m3d) {
|
||||||
}
|
}
|
||||||
// texture map properties
|
// texture map properties
|
||||||
if (m->prop[j].type >= 128 && aiTxProps[k].pKey &&
|
if (m->prop[j].type >= 128 && aiTxProps[k].pKey &&
|
||||||
// extra check, should never happen, do we have the refered texture?
|
// extra check, should never happen, do we have the referred texture?
|
||||||
m->prop[j].value.textureid < m3d->numtexture &&
|
m->prop[j].value.textureid < m3d->numtexture &&
|
||||||
m3d->texture[m->prop[j].value.textureid].name) {
|
m3d->texture[m->prop[j].value.textureid].name) {
|
||||||
name.Set(std::string(std::string(m3d->texture[m->prop[j].value.textureid].name) + ".png"));
|
name.Set(std::string(std::string(m3d->texture[m->prop[j].value.textureid].name) + ".png"));
|
||||||
|
@ -474,7 +474,7 @@ void M3DImporter::importMeshes(const M3DWrapper &m3d) {
|
||||||
mScene->mMeshes = new aiMesh *[mScene->mNumMeshes];
|
mScene->mMeshes = new aiMesh *[mScene->mNumMeshes];
|
||||||
std::copy(meshes->begin(), meshes->end(), mScene->mMeshes);
|
std::copy(meshes->begin(), meshes->end(), mScene->mMeshes);
|
||||||
|
|
||||||
// create mesh indeces in root node
|
// create mesh indices in root node
|
||||||
mScene->mRootNode->mNumMeshes = static_cast<unsigned int>(meshes->size());
|
mScene->mRootNode->mNumMeshes = static_cast<unsigned int>(meshes->size());
|
||||||
mScene->mRootNode->mMeshes = new unsigned int[meshes->size()];
|
mScene->mRootNode->mMeshes = new unsigned int[meshes->size()];
|
||||||
for (i = 0; i < meshes->size(); i++) {
|
for (i = 0; i < meshes->size(); i++) {
|
||||||
|
@ -688,7 +688,7 @@ void M3DImporter::calculateOffsetMatrix(aiNode *pNode, aiMatrix4x4 *m) {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// because M3D has a global mesh, global vertex ids and stores materialid on the face, we need
|
// because M3D has a global mesh, global vertex ids and stores materialid on the face, we need
|
||||||
// temporary lists to collect data for an aiMesh, which requires local arrays and local indeces
|
// temporary lists to collect data for an aiMesh, which requires local arrays and local indices
|
||||||
// this function fills up an aiMesh with those temporary lists
|
// this function fills up an aiMesh with those temporary lists
|
||||||
void M3DImporter::populateMesh(const M3DWrapper &m3d, aiMesh *pMesh, std::vector<aiFace> *faces, std::vector<aiVector3D> *vertices,
|
void M3DImporter::populateMesh(const M3DWrapper &m3d, aiMesh *pMesh, std::vector<aiFace> *faces, std::vector<aiVector3D> *vertices,
|
||||||
std::vector<aiVector3D> *normals, std::vector<aiVector3D> *texcoords, std::vector<aiColor4D> *colors,
|
std::vector<aiVector3D> *normals, std::vector<aiVector3D> *texcoords, std::vector<aiColor4D> *colors,
|
||||||
|
|
|
@ -59,7 +59,7 @@ extern "C" {
|
||||||
#ifndef M3D_DOUBLE
|
#ifndef M3D_DOUBLE
|
||||||
typedef float M3D_FLOAT;
|
typedef float M3D_FLOAT;
|
||||||
#ifndef M3D_EPSILON
|
#ifndef M3D_EPSILON
|
||||||
/* carefully choosen for IEEE 754 don't change */
|
/* carefully chosen for IEEE 754 don't change */
|
||||||
#define M3D_EPSILON ((M3D_FLOAT)1e-7)
|
#define M3D_EPSILON ((M3D_FLOAT)1e-7)
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
@ -121,7 +121,7 @@ typedef uint16_t M3D_INDEX;
|
||||||
* TMAP texture map chunk (optional)
|
* TMAP texture map chunk (optional)
|
||||||
* VRTS vertex data chunk (optional if it's a material library)
|
* VRTS vertex data chunk (optional if it's a material library)
|
||||||
* BONE bind-pose skeleton, bone hierarchy chunk (optional)
|
* BONE bind-pose skeleton, bone hierarchy chunk (optional)
|
||||||
* n x m3db_t contains propably more, but at least one bone
|
* n x m3db_t contains probably more, but at least one bone
|
||||||
* n x m3ds_t skin group records
|
* n x m3ds_t skin group records
|
||||||
* MTRL* material chunk(s), can be more (optional)
|
* MTRL* material chunk(s), can be more (optional)
|
||||||
* n x m3dp_t each material contains propapbly more, but at least one property
|
* n x m3dp_t each material contains propapbly more, but at least one property
|
||||||
|
@ -1109,7 +1109,7 @@ void _m3d_inv(M3D_FLOAT *m) {
|
||||||
r[15] = det * (m[0] * (m[5] * m[10] - m[6] * m[9]) + m[1] * (m[6] * m[8] - m[4] * m[10]) + m[2] * (m[4] * m[9] - m[5] * m[8]));
|
r[15] = det * (m[0] * (m[5] * m[10] - m[6] * m[9]) + m[1] * (m[6] * m[8] - m[4] * m[10]) + m[2] * (m[4] * m[9] - m[5] * m[8]));
|
||||||
memcpy(m, &r, sizeof(r));
|
memcpy(m, &r, sizeof(r));
|
||||||
}
|
}
|
||||||
/* compose a coloumn major 4 x 4 matrix from vec3 position and vec4 orientation/rotation quaternion */
|
/* compose a column major 4 x 4 matrix from vec3 position and vec4 orientation/rotation quaternion */
|
||||||
void _m3d_mat(M3D_FLOAT *r, m3dv_t *p, m3dv_t *q) {
|
void _m3d_mat(M3D_FLOAT *r, m3dv_t *p, m3dv_t *q) {
|
||||||
if (q->x == (M3D_FLOAT)0.0 && q->y == (M3D_FLOAT)0.0 && q->z >= (M3D_FLOAT)0.7071065 && q->z <= (M3D_FLOAT)0.7071075 &&
|
if (q->x == (M3D_FLOAT)0.0 && q->y == (M3D_FLOAT)0.0 && q->z >= (M3D_FLOAT)0.7071065 && q->z <= (M3D_FLOAT)0.7071075 &&
|
||||||
q->w == (M3D_FLOAT)0.0) {
|
q->w == (M3D_FLOAT)0.0) {
|
||||||
|
@ -4033,7 +4033,7 @@ unsigned char *m3d_save(m3d_t *model, int quality, int flags, unsigned int *size
|
||||||
out[len] = 0;
|
out[len] = 0;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
/* stricly only use LF (newline) in binary */
|
/* strictly only use LF (newline) in binary */
|
||||||
sd = _m3d_safestr(model->desc, 3);
|
sd = _m3d_safestr(model->desc, 3);
|
||||||
if (!sd) goto memerr;
|
if (!sd) goto memerr;
|
||||||
/* header */
|
/* header */
|
||||||
|
@ -4608,7 +4608,7 @@ unsigned char *m3d_save(m3d_t *model, int quality, int flags, unsigned int *size
|
||||||
h = (m3dhdr_t *)z;
|
h = (m3dhdr_t *)z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* add file header at the begining */
|
/* add file header at the beginning */
|
||||||
len += 8;
|
len += 8;
|
||||||
out = (unsigned char *)M3D_MALLOC(len);
|
out = (unsigned char *)M3D_MALLOC(len);
|
||||||
if (!out) goto memerr;
|
if (!out) goto memerr;
|
||||||
|
|
|
@ -271,7 +271,7 @@ inline void LatLngNormalToVec3(uint16_t p_iNormal, ai_real* p_afOut)
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------
|
// -------------------------------------------------------------------------------
|
||||||
/** @brief Pack a Q3 normal into 16bit latitute/longitude representation
|
/** @brief Pack a Q3 normal into 16bit latitude/longitude representation
|
||||||
* @param p_vIn Input vector
|
* @param p_vIn Input vector
|
||||||
* @param p_iOut Output normal
|
* @param p_iOut Output normal
|
||||||
*
|
*
|
||||||
|
|
|
@ -59,7 +59,7 @@ using namespace Assimp;
|
||||||
using namespace Assimp::MD5;
|
using namespace Assimp::MD5;
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Parse the segment structure fo a MD5 file
|
// Parse the segment structure for an MD5 file
|
||||||
MD5Parser::MD5Parser(char *_buffer, unsigned int _fileSize) {
|
MD5Parser::MD5Parser(char *_buffer, unsigned int _fileSize) {
|
||||||
ai_assert(nullptr != _buffer);
|
ai_assert(nullptr != _buffer);
|
||||||
ai_assert(0 != _fileSize);
|
ai_assert(0 != _fileSize);
|
||||||
|
|
|
@ -387,7 +387,7 @@ void MDLImporter::CreateTexture_3DGS_MDL5(const unsigned char *szData,
|
||||||
// this should not occur - at least the docs say it shouldn't.
|
// this should not occur - at least the docs say it shouldn't.
|
||||||
// however, one can easily try out what MED does if you have
|
// however, one can easily try out what MED does if you have
|
||||||
// a model with a DDS texture and export it to MDL5 ...
|
// a model with a DDS texture and export it to MDL5 ...
|
||||||
// yeah, it embedds the DDS file.
|
// yeah, it embeds the DDS file.
|
||||||
if (6 == iType) {
|
if (6 == iType) {
|
||||||
// this is a compressed texture in DDS format
|
// this is a compressed texture in DDS format
|
||||||
*piSkip = pcNew->mWidth;
|
*piSkip = pcNew->mWidth;
|
||||||
|
@ -524,7 +524,7 @@ void MDLImporter::ParseSkinLump_3DGS_MDL7(
|
||||||
}
|
}
|
||||||
|
|
||||||
// sometimes there are MDL7 files which have a monochrome
|
// sometimes there are MDL7 files which have a monochrome
|
||||||
// texture instead of material colors ... posssible they have
|
// texture instead of material colors ... possible they have
|
||||||
// been converted to MDL7 from other formats, such as MDL5
|
// been converted to MDL7 from other formats, such as MDL5
|
||||||
aiColor4D clrTexture;
|
aiColor4D clrTexture;
|
||||||
if (pcNew)
|
if (pcNew)
|
||||||
|
|
|
@ -195,7 +195,7 @@ namespace pmd
|
||||||
public:
|
public:
|
||||||
uint16_t ik_bone_index;
|
uint16_t ik_bone_index;
|
||||||
uint16_t target_bone_index;
|
uint16_t target_bone_index;
|
||||||
uint16_t interations;
|
uint16_t iterations;
|
||||||
float angle_limit;
|
float angle_limit;
|
||||||
std::vector<uint16_t> ik_child_bone_index;
|
std::vector<uint16_t> ik_child_bone_index;
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ namespace pmd
|
||||||
stream->read((char *) &target_bone_index, sizeof(uint16_t));
|
stream->read((char *) &target_bone_index, sizeof(uint16_t));
|
||||||
uint8_t ik_chain_length;
|
uint8_t ik_chain_length;
|
||||||
stream->read((char*) &ik_chain_length, sizeof(uint8_t));
|
stream->read((char*) &ik_chain_length, sizeof(uint8_t));
|
||||||
stream->read((char *) &interations, sizeof(uint16_t));
|
stream->read((char *) &iterations, sizeof(uint16_t));
|
||||||
stream->read((char *) &angle_limit, sizeof(float));
|
stream->read((char *) &angle_limit, sizeof(float));
|
||||||
ik_child_bone_index.resize(ik_chain_length);
|
ik_child_bone_index.resize(ik_chain_length);
|
||||||
for (int i = 0; i < ik_chain_length; i++)
|
for (int i = 0; i < ik_chain_length; i++)
|
||||||
|
|
|
@ -358,7 +358,7 @@ namespace vmd
|
||||||
light_frames[i].Write(stream);
|
light_frames[i].Write(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// self shadow datas
|
// self shadow data
|
||||||
const int self_shadow_num = 0;
|
const int self_shadow_num = 0;
|
||||||
stream->write(reinterpret_cast<const char*>(&self_shadow_num), sizeof(int));
|
stream->write(reinterpret_cast<const char*>(&self_shadow_num), sizeof(int));
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ void OFFImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOS
|
||||||
sz = fast_atoreal_move<ai_real>(sz, *vec[dim]);
|
sz = fast_atoreal_move<ai_real>(sz, *vec[dim]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if has homogenous coordinate, divide others by this one
|
// if has homogeneous coordinate, divide others by this one
|
||||||
if (hasHomogenous) {
|
if (hasHomogenous) {
|
||||||
SkipSpaces(&sz);
|
SkipSpaces(&sz);
|
||||||
ai_real w = 1.;
|
ai_real w = 1.;
|
||||||
|
|
|
@ -233,7 +233,7 @@ struct Mesh {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
//! \struct Model
|
//! \struct Model
|
||||||
//! \brief Data structure to store all obj-specific model datas
|
//! \brief Data structure to store all obj-specific model data
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
struct Model {
|
struct Model {
|
||||||
using GroupMap = std::map<std::string, std::vector<unsigned int> *>;
|
using GroupMap = std::map<std::string, std::vector<unsigned int> *>;
|
||||||
|
|
|
@ -555,7 +555,7 @@ public:
|
||||||
should be 0 after this reset. */
|
should be 0 after this reset. */
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
/// Covert to Assimp mesh.
|
/// Convert to Assimp mesh.
|
||||||
aiMesh *ConvertToAssimpMesh(Mesh *parent);
|
aiMesh *ConvertToAssimpMesh(Mesh *parent);
|
||||||
|
|
||||||
/// Vertex data.
|
/// Vertex data.
|
||||||
|
|
|
@ -351,8 +351,8 @@ void OpenGEXImporter::handleNodes(DDLNode *node, aiScene *pScene) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DDLNode::DllNodeList childs = node->getChildNodeList();
|
DDLNode::DllNodeList children = node->getChildNodeList();
|
||||||
for (DDLNode::DllNodeList::iterator it = childs.begin(); it != childs.end(); ++it) {
|
for (DDLNode::DllNodeList::iterator it = children.begin(); it != children.end(); ++it) {
|
||||||
Grammar::TokenType tokenType(Grammar::matchTokenType((*it)->getType().c_str()));
|
Grammar::TokenType tokenType(Grammar::matchTokenType((*it)->getType().c_str()));
|
||||||
switch (tokenType) {
|
switch (tokenType) {
|
||||||
case Grammar::MetricToken:
|
case Grammar::MetricToken:
|
||||||
|
|
|
@ -95,7 +95,7 @@ struct sQ3BSPVertex {
|
||||||
vec3f vPosition; ///< Position of vertex
|
vec3f vPosition; ///< Position of vertex
|
||||||
vec2f vTexCoord; ///< (u,v) Texturecoordinate of detailtexture
|
vec2f vTexCoord; ///< (u,v) Texturecoordinate of detailtexture
|
||||||
vec2f vLightmap; ///< (u,v) Texturecoordinate of lightmap
|
vec2f vLightmap; ///< (u,v) Texturecoordinate of lightmap
|
||||||
vec3f vNormal; ///< vertex normale
|
vec3f vNormal; ///< vertex normal
|
||||||
unsigned char bColor[ 4 ]; ///< Color in RGBA
|
unsigned char bColor[ 4 ]; ///< Color in RGBA
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -868,7 +868,7 @@ void SMDImporter::ParseNodeInfo(const char* szCurrent, const char** szCurrentOut
|
||||||
|
|
||||||
bool bQuota = true;
|
bool bQuota = true;
|
||||||
if ('\"' != *szCurrent) {
|
if ('\"' != *szCurrent) {
|
||||||
LogWarning("Bone name is expcted to be enclosed in "
|
LogWarning("Bone name is expected to be enclosed in "
|
||||||
"double quotation marks. ");
|
"double quotation marks. ");
|
||||||
bQuota = false;
|
bQuota = false;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -219,7 +219,7 @@ aiNode* XFileImporter::CreateNodes( aiScene* pScene, aiNode* pParent, const XFil
|
||||||
// convert meshes from the source node
|
// convert meshes from the source node
|
||||||
CreateMeshes( pScene, node, pNode->mMeshes);
|
CreateMeshes( pScene, node, pNode->mMeshes);
|
||||||
|
|
||||||
// handle childs
|
// handle children
|
||||||
if( !pNode->mChildren.empty() ) {
|
if( !pNode->mChildren.empty() ) {
|
||||||
node->mNumChildren = (unsigned int)pNode->mChildren.size();
|
node->mNumChildren = (unsigned int)pNode->mChildren.size();
|
||||||
node->mChildren = new aiNode* [node->mNumChildren];
|
node->mChildren = new aiNode* [node->mNumChildren];
|
||||||
|
|
|
@ -279,7 +279,7 @@ void X3DExporter::Export_Mesh(const size_t pIdxMesh, const size_t pTabLevel) {
|
||||||
const char *NodeName_Shape = "Shape";
|
const char *NodeName_Shape = "Shape";
|
||||||
|
|
||||||
list<SAttribute> attr_list;
|
list<SAttribute> attr_list;
|
||||||
aiMesh &mesh = *mScene->mMeshes[pIdxMesh]; // create alias for conveniance.
|
aiMesh &mesh = *mScene->mMeshes[pIdxMesh]; // create alias for convenience.
|
||||||
|
|
||||||
// Check if mesh already defined early.
|
// Check if mesh already defined early.
|
||||||
if (mDEF_Map_Mesh.find(pIdxMesh) != mDEF_Map_Mesh.end()) {
|
if (mDEF_Map_Mesh.find(pIdxMesh) != mDEF_Map_Mesh.end()) {
|
||||||
|
@ -375,7 +375,7 @@ void X3DExporter::Export_Material(const size_t pIdxMaterial, const size_t pTabLe
|
||||||
const char *NodeName_A = "Appearance";
|
const char *NodeName_A = "Appearance";
|
||||||
|
|
||||||
list<SAttribute> attr_list;
|
list<SAttribute> attr_list;
|
||||||
aiMaterial &material = *mScene->mMaterials[pIdxMaterial]; // create alias for conveniance.
|
aiMaterial &material = *mScene->mMaterials[pIdxMaterial]; // create alias for convenience.
|
||||||
|
|
||||||
// Check if material already defined early.
|
// Check if material already defined early.
|
||||||
if (mDEF_Map_Material.find(pIdxMaterial) != mDEF_Map_Material.end()) {
|
if (mDEF_Map_Material.find(pIdxMaterial) != mDEF_Map_Material.end()) {
|
||||||
|
@ -586,7 +586,7 @@ bool X3DExporter::CheckAndExport_Light(const aiNode &pNode, const size_t pTabLev
|
||||||
if (!found) return false;
|
if (!found) return false;
|
||||||
|
|
||||||
// Light source is found.
|
// Light source is found.
|
||||||
const aiLight &light = *mScene->mLights[idx_light]; // Alias for conveniance.
|
const aiLight &light = *mScene->mLights[idx_light]; // Alias for convenience.
|
||||||
|
|
||||||
aiMatrix4x4 trafo_mat = Matrix_GlobalToCurrent(pNode).Inverse();
|
aiMatrix4x4 trafo_mat = Matrix_GlobalToCurrent(pNode).Inverse();
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* KHR_materials_sheen full
|
* KHR_materials_sheen full
|
||||||
* KHR_materials_clearcoat full
|
* KHR_materials_clearcoat full
|
||||||
* KHR_materials_transmission full
|
* KHR_materials_transmission full
|
||||||
|
* KHR_materials_volume full
|
||||||
|
* KHR_materials_ior full
|
||||||
*/
|
*/
|
||||||
#ifndef GLTF2ASSET_H_INC
|
#ifndef GLTF2ASSET_H_INC
|
||||||
#define GLTF2ASSET_H_INC
|
#define GLTF2ASSET_H_INC
|
||||||
|
@ -713,6 +715,7 @@ const vec3 defaultEmissiveFactor = { 0, 0, 0 };
|
||||||
const vec4 defaultDiffuseFactor = { 1, 1, 1, 1 };
|
const vec4 defaultDiffuseFactor = { 1, 1, 1, 1 };
|
||||||
const vec3 defaultSpecularFactor = { 1, 1, 1 };
|
const vec3 defaultSpecularFactor = { 1, 1, 1 };
|
||||||
const vec3 defaultSheenFactor = { 0, 0, 0 };
|
const vec3 defaultSheenFactor = { 0, 0, 0 };
|
||||||
|
const vec3 defaultAttenuationColor = { 1, 1, 1 };
|
||||||
|
|
||||||
struct TextureInfo {
|
struct TextureInfo {
|
||||||
Ref<Texture> texture;
|
Ref<Texture> texture;
|
||||||
|
@ -777,6 +780,23 @@ struct MaterialTransmission {
|
||||||
float transmissionFactor = 0.f;
|
float transmissionFactor = 0.f;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct MaterialVolume {
|
||||||
|
float thicknessFactor = 0.f;
|
||||||
|
TextureInfo thicknessTexture;
|
||||||
|
float attenuationDistance = 0.f;
|
||||||
|
vec3 attenuationColor;
|
||||||
|
|
||||||
|
MaterialVolume() { SetDefaults(); }
|
||||||
|
void SetDefaults();
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MaterialIOR {
|
||||||
|
float ior = 0.f;
|
||||||
|
|
||||||
|
MaterialIOR() { SetDefaults(); }
|
||||||
|
void SetDefaults();
|
||||||
|
};
|
||||||
|
|
||||||
//! The material appearance of a primitive.
|
//! The material appearance of a primitive.
|
||||||
struct Material : public Object {
|
struct Material : public Object {
|
||||||
//PBR metallic roughness properties
|
//PBR metallic roughness properties
|
||||||
|
@ -803,6 +823,12 @@ struct Material : public Object {
|
||||||
//extension: KHR_materials_transmission
|
//extension: KHR_materials_transmission
|
||||||
Nullable<MaterialTransmission> materialTransmission;
|
Nullable<MaterialTransmission> materialTransmission;
|
||||||
|
|
||||||
|
//extension: KHR_materials_volume
|
||||||
|
Nullable<MaterialVolume> materialVolume;
|
||||||
|
|
||||||
|
//extension: KHR_materials_ior
|
||||||
|
Nullable<MaterialIOR> materialIOR;
|
||||||
|
|
||||||
//extension: KHR_materials_unlit
|
//extension: KHR_materials_unlit
|
||||||
bool unlit;
|
bool unlit;
|
||||||
|
|
||||||
|
@ -1091,6 +1117,8 @@ public:
|
||||||
bool KHR_materials_sheen;
|
bool KHR_materials_sheen;
|
||||||
bool KHR_materials_clearcoat;
|
bool KHR_materials_clearcoat;
|
||||||
bool KHR_materials_transmission;
|
bool KHR_materials_transmission;
|
||||||
|
bool KHR_materials_volume;
|
||||||
|
bool KHR_materials_ior;
|
||||||
bool KHR_draco_mesh_compression;
|
bool KHR_draco_mesh_compression;
|
||||||
bool FB_ngon_encoding;
|
bool FB_ngon_encoding;
|
||||||
bool KHR_texture_basisu;
|
bool KHR_texture_basisu;
|
||||||
|
|
|
@ -1215,6 +1215,29 @@ inline void Material::Read(Value &material, Asset &r) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (r.extensionsUsed.KHR_materials_volume) {
|
||||||
|
if (Value *curMaterialVolume = FindObject(*extensions, "KHR_materials_volume")) {
|
||||||
|
MaterialVolume volume;
|
||||||
|
|
||||||
|
ReadMember(*curMaterialVolume, "thicknessFactor", volume.thicknessFactor);
|
||||||
|
ReadTextureProperty(r, *curMaterialVolume, "thicknessTexture", volume.thicknessTexture);
|
||||||
|
ReadMember(*curMaterialVolume, "attenuationDistance", volume.attenuationDistance);
|
||||||
|
ReadMember(*curMaterialVolume, "attenuationColor", volume.attenuationColor);
|
||||||
|
|
||||||
|
this->materialVolume = Nullable<MaterialVolume>(volume);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (r.extensionsUsed.KHR_materials_ior) {
|
||||||
|
if (Value *curMaterialIOR = FindObject(*extensions, "KHR_materials_ior")) {
|
||||||
|
MaterialIOR ior;
|
||||||
|
|
||||||
|
ReadMember(*curMaterialIOR, "ior", ior.ior);
|
||||||
|
|
||||||
|
this->materialIOR = Nullable<MaterialIOR>(ior);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unlit = nullptr != FindObject(*extensions, "KHR_materials_unlit");
|
unlit = nullptr != FindObject(*extensions, "KHR_materials_unlit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1260,6 +1283,18 @@ inline void MaterialSheen::SetDefaults() {
|
||||||
sheenRoughnessFactor = 0.f;
|
sheenRoughnessFactor = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void MaterialVolume::SetDefaults() {
|
||||||
|
//KHR_materials_volume properties
|
||||||
|
thicknessFactor = 0.f;
|
||||||
|
attenuationDistance = INFINITY;
|
||||||
|
SetVector(attenuationColor, defaultAttenuationColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void MaterialIOR::SetDefaults() {
|
||||||
|
//KHR_materials_ior properties
|
||||||
|
ior = 1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
template <int N>
|
template <int N>
|
||||||
|
@ -1931,6 +1966,8 @@ inline void Asset::ReadExtensionsUsed(Document &doc) {
|
||||||
CHECK_EXT(KHR_materials_sheen);
|
CHECK_EXT(KHR_materials_sheen);
|
||||||
CHECK_EXT(KHR_materials_clearcoat);
|
CHECK_EXT(KHR_materials_clearcoat);
|
||||||
CHECK_EXT(KHR_materials_transmission);
|
CHECK_EXT(KHR_materials_transmission);
|
||||||
|
CHECK_EXT(KHR_materials_volume);
|
||||||
|
CHECK_EXT(KHR_materials_ior);
|
||||||
CHECK_EXT(KHR_draco_mesh_compression);
|
CHECK_EXT(KHR_draco_mesh_compression);
|
||||||
CHECK_EXT(KHR_texture_basisu);
|
CHECK_EXT(KHR_texture_basisu);
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
* KHR_materials_sheen: full
|
* KHR_materials_sheen: full
|
||||||
* KHR_materials_clearcoat: full
|
* KHR_materials_clearcoat: full
|
||||||
* KHR_materials_transmission: full
|
* KHR_materials_transmission: full
|
||||||
|
* KHR_materials_volume: full
|
||||||
|
* KHR_materials_ior: full
|
||||||
*/
|
*/
|
||||||
#ifndef GLTF2ASSETWRITER_H_INC
|
#ifndef GLTF2ASSETWRITER_H_INC
|
||||||
#define GLTF2ASSETWRITER_H_INC
|
#define GLTF2ASSETWRITER_H_INC
|
||||||
|
|
|
@ -474,6 +474,42 @@ namespace glTF2 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m.materialVolume.isPresent) {
|
||||||
|
Value materialVolume(rapidjson::Type::kObjectType);
|
||||||
|
|
||||||
|
MaterialVolume &volume = m.materialVolume.value;
|
||||||
|
|
||||||
|
if (volume.thicknessFactor != 0.f) {
|
||||||
|
WriteFloat(materialVolume, volume.thicknessFactor, "thicknessFactor", w.mAl);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteTex(materialVolume, volume.thicknessTexture, "thicknessTexture", w.mAl);
|
||||||
|
|
||||||
|
if (volume.attenuationDistance != INFINITY) {
|
||||||
|
WriteFloat(materialVolume, volume.attenuationDistance, "attenuationDistance", w.mAl);
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteVec(materialVolume, volume.attenuationColor, "attenuationColor", defaultAttenuationColor, w.mAl);
|
||||||
|
|
||||||
|
if (!materialVolume.ObjectEmpty()) {
|
||||||
|
exts.AddMember("KHR_materials_volume", materialVolume, w.mAl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m.materialIOR.isPresent) {
|
||||||
|
Value materialIOR(rapidjson::Type::kObjectType);
|
||||||
|
|
||||||
|
MaterialIOR &ior = m.materialIOR.value;
|
||||||
|
|
||||||
|
if (ior.ior != 1.5f) {
|
||||||
|
WriteFloat(materialIOR, ior.ior, "ior", w.mAl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!materialIOR.ObjectEmpty()) {
|
||||||
|
exts.AddMember("KHR_materials_ior", materialIOR, w.mAl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!exts.ObjectEmpty()) {
|
if (!exts.ObjectEmpty()) {
|
||||||
obj.AddMember("extensions", exts, w.mAl);
|
obj.AddMember("extensions", exts, w.mAl);
|
||||||
}
|
}
|
||||||
|
@ -890,6 +926,14 @@ namespace glTF2 {
|
||||||
exts.PushBack(StringRef("KHR_materials_transmission"), mAl);
|
exts.PushBack(StringRef("KHR_materials_transmission"), mAl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->mAsset.extensionsUsed.KHR_materials_volume) {
|
||||||
|
exts.PushBack(StringRef("KHR_materials_volume"), mAl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->mAsset.extensionsUsed.KHR_materials_ior) {
|
||||||
|
exts.PushBack(StringRef("KHR_materials_ior"), mAl);
|
||||||
|
}
|
||||||
|
|
||||||
if (this->mAsset.extensionsUsed.FB_ngon_encoding) {
|
if (this->mAsset.extensionsUsed.FB_ngon_encoding) {
|
||||||
exts.PushBack(StringRef("FB_ngon_encoding"), mAl);
|
exts.PushBack(StringRef("FB_ngon_encoding"), mAl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -704,6 +704,22 @@ bool glTF2Exporter::GetMatTransmission(const aiMaterial &mat, glTF2::MaterialTra
|
||||||
return result || transmission.transmissionTexture.texture;
|
return result || transmission.transmissionTexture.texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool glTF2Exporter::GetMatVolume(const aiMaterial &mat, glTF2::MaterialVolume &volume) {
|
||||||
|
bool result = mat.Get(AI_MATKEY_VOLUME_THICKNESS_FACTOR, volume.thicknessFactor) != aiReturn_SUCCESS;
|
||||||
|
|
||||||
|
GetMatTex(mat, volume.thicknessTexture, AI_MATKEY_VOLUME_THICKNESS_TEXTURE);
|
||||||
|
|
||||||
|
result = result || mat.Get(AI_MATKEY_VOLUME_ATTENUATION_DISTANCE, volume.attenuationDistance);
|
||||||
|
result = result || GetMatColor(mat, volume.attenuationColor, AI_MATKEY_VOLUME_ATTENUATION_COLOR) != aiReturn_SUCCESS;
|
||||||
|
|
||||||
|
// Valid if any of these properties are available
|
||||||
|
return result || volume.thicknessTexture.texture;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool glTF2Exporter::GetMatIOR(const aiMaterial &mat, glTF2::MaterialIOR &ior) {
|
||||||
|
return mat.Get(AI_MATKEY_REFRACTI, ior.ior) == aiReturn_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
void glTF2Exporter::ExportMaterials() {
|
void glTF2Exporter::ExportMaterials() {
|
||||||
aiString aiName;
|
aiString aiName;
|
||||||
for (unsigned int i = 0; i < mScene->mNumMaterials; ++i) {
|
for (unsigned int i = 0; i < mScene->mNumMaterials; ++i) {
|
||||||
|
@ -824,6 +840,18 @@ void glTF2Exporter::ExportMaterials() {
|
||||||
mAsset->extensionsUsed.KHR_materials_transmission = true;
|
mAsset->extensionsUsed.KHR_materials_transmission = true;
|
||||||
m->materialTransmission = Nullable<MaterialTransmission>(transmission);
|
m->materialTransmission = Nullable<MaterialTransmission>(transmission);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MaterialVolume volume;
|
||||||
|
if (GetMatVolume(mat, volume)) {
|
||||||
|
mAsset->extensionsUsed.KHR_materials_volume = true;
|
||||||
|
m->materialVolume = Nullable<MaterialVolume>(volume);
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialIOR ior;
|
||||||
|
if (GetMatIOR(mat, ior)) {
|
||||||
|
mAsset->extensionsUsed.KHR_materials_ior = true;
|
||||||
|
m->materialIOR = Nullable<MaterialIOR>(ior);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,6 +77,8 @@ struct PbrSpecularGlossiness;
|
||||||
struct MaterialSheen;
|
struct MaterialSheen;
|
||||||
struct MaterialClearcoat;
|
struct MaterialClearcoat;
|
||||||
struct MaterialTransmission;
|
struct MaterialTransmission;
|
||||||
|
struct MaterialVolume;
|
||||||
|
struct MaterialIOR;
|
||||||
|
|
||||||
// Vec/matrix types, as raw float arrays
|
// Vec/matrix types, as raw float arrays
|
||||||
typedef float(vec2)[2];
|
typedef float(vec2)[2];
|
||||||
|
@ -114,6 +116,8 @@ protected:
|
||||||
bool GetMatSheen(const aiMaterial &mat, glTF2::MaterialSheen &sheen);
|
bool GetMatSheen(const aiMaterial &mat, glTF2::MaterialSheen &sheen);
|
||||||
bool GetMatClearcoat(const aiMaterial &mat, glTF2::MaterialClearcoat &clearcoat);
|
bool GetMatClearcoat(const aiMaterial &mat, glTF2::MaterialClearcoat &clearcoat);
|
||||||
bool GetMatTransmission(const aiMaterial &mat, glTF2::MaterialTransmission &transmission);
|
bool GetMatTransmission(const aiMaterial &mat, glTF2::MaterialTransmission &transmission);
|
||||||
|
bool GetMatVolume(const aiMaterial &mat, glTF2::MaterialVolume &volume);
|
||||||
|
bool GetMatIOR(const aiMaterial &mat, glTF2::MaterialIOR &ior);
|
||||||
void ExportMetadata();
|
void ExportMetadata();
|
||||||
void ExportMaterials();
|
void ExportMaterials();
|
||||||
void ExportMeshes();
|
void ExportMeshes();
|
||||||
|
|
|
@ -312,7 +312,7 @@ static aiMaterial *ImportMaterial(std::vector<int> &embeddedTexIdxs, Asset &r, M
|
||||||
if (mat.materialSheen.isPresent) {
|
if (mat.materialSheen.isPresent) {
|
||||||
MaterialSheen &sheen = mat.materialSheen.value;
|
MaterialSheen &sheen = mat.materialSheen.value;
|
||||||
// Default value {0,0,0} disables Sheen
|
// Default value {0,0,0} disables Sheen
|
||||||
if (sheen.sheenColorFactor != defaultSheenFactor) {
|
if (std::memcmp(sheen.sheenColorFactor, defaultSheenFactor, sizeof(glTFCommon::vec3)) != 0) {
|
||||||
SetMaterialColorProperty(r, sheen.sheenColorFactor, aimat, AI_MATKEY_SHEEN_COLOR_FACTOR);
|
SetMaterialColorProperty(r, sheen.sheenColorFactor, aimat, AI_MATKEY_SHEEN_COLOR_FACTOR);
|
||||||
aimat->AddProperty(&sheen.sheenRoughnessFactor, 1, AI_MATKEY_SHEEN_ROUGHNESS_FACTOR);
|
aimat->AddProperty(&sheen.sheenRoughnessFactor, 1, AI_MATKEY_SHEEN_ROUGHNESS_FACTOR);
|
||||||
SetMaterialTextureProperty(embeddedTexIdxs, r, sheen.sheenColorTexture, aimat, AI_MATKEY_SHEEN_COLOR_TEXTURE);
|
SetMaterialTextureProperty(embeddedTexIdxs, r, sheen.sheenColorTexture, aimat, AI_MATKEY_SHEEN_COLOR_TEXTURE);
|
||||||
|
@ -341,6 +341,23 @@ static aiMaterial *ImportMaterial(std::vector<int> &embeddedTexIdxs, Asset &r, M
|
||||||
SetMaterialTextureProperty(embeddedTexIdxs, r, transmission.transmissionTexture, aimat, AI_MATKEY_TRANSMISSION_TEXTURE);
|
SetMaterialTextureProperty(embeddedTexIdxs, r, transmission.transmissionTexture, aimat, AI_MATKEY_TRANSMISSION_TEXTURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// KHR_materials_volume
|
||||||
|
if (mat.materialVolume.isPresent) {
|
||||||
|
MaterialVolume &volume = mat.materialVolume.value;
|
||||||
|
|
||||||
|
aimat->AddProperty(&volume.thicknessFactor, 1, AI_MATKEY_VOLUME_THICKNESS_FACTOR);
|
||||||
|
SetMaterialTextureProperty(embeddedTexIdxs, r, volume.thicknessTexture, aimat, AI_MATKEY_VOLUME_THICKNESS_TEXTURE);
|
||||||
|
aimat->AddProperty(&volume.attenuationDistance, 1, AI_MATKEY_VOLUME_ATTENUATION_DISTANCE);
|
||||||
|
SetMaterialColorProperty(r, volume.attenuationColor, aimat, AI_MATKEY_VOLUME_ATTENUATION_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
|
// KHR_materials_ior
|
||||||
|
if (mat.materialIOR.isPresent) {
|
||||||
|
MaterialIOR &ior = mat.materialIOR.value;
|
||||||
|
|
||||||
|
aimat->AddProperty(&ior.ior, 1, AI_MATKEY_REFRACTI);
|
||||||
|
}
|
||||||
|
|
||||||
return aimat;
|
return aimat;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
delete aimat;
|
delete aimat;
|
||||||
|
|
|
@ -207,7 +207,7 @@ void BaseImporter::GetExtensionList(std::set<std::string> &extensions) {
|
||||||
if (!r) {
|
if (!r) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// We need to make sure that we didn't accidentially identify the end of another token as our token,
|
// We need to make sure that we didn't accidentally identify the end of another token as our token,
|
||||||
// e.g. in a previous version the "gltf " present in some gltf files was detected as "f "
|
// e.g. in a previous version the "gltf " present in some gltf files was detected as "f "
|
||||||
if (noAlphaBeforeTokens && (r != buffer && isalpha(static_cast<unsigned char>(r[-1])))) {
|
if (noAlphaBeforeTokens && (r != buffer && isalpha(static_cast<unsigned char>(r[-1])))) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -52,7 +52,7 @@ using namespace Assimp;
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
SGSpatialSort::SGSpatialSort()
|
SGSpatialSort::SGSpatialSort()
|
||||||
{
|
{
|
||||||
// define the reference plane. We choose some arbitrary vector away from all basic axises
|
// define the reference plane. We choose some arbitrary vector away from all basic axes
|
||||||
// in the hope that no model spreads all its vertices along this plane.
|
// in the hope that no model spreads all its vertices along this plane.
|
||||||
mPlaneNormal.Set( 0.8523f, 0.34321f, 0.5736f);
|
mPlaneNormal.Set( 0.8523f, 0.34321f, 0.5736f);
|
||||||
mPlaneNormal.Normalize();
|
mPlaneNormal.Normalize();
|
||||||
|
@ -121,7 +121,7 @@ void SGSpatialSort::FindPositions( const aiVector3D& pPosition,
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
// Mow start iterating from there until the first position lays outside of the distance range.
|
// Mow start iterating from there until the first position lays outside of the distance range.
|
||||||
// Add all positions inside the distance range within the given radius to the result aray
|
// Add all positions inside the distance range within the given radius to the result array
|
||||||
|
|
||||||
float squareEpsilon = pRadius * pRadius;
|
float squareEpsilon = pRadius * pRadius;
|
||||||
std::vector<Entry>::const_iterator it = mPositions.begin() + index;
|
std::vector<Entry>::const_iterator it = mPositions.begin() + index;
|
||||||
|
|
|
@ -55,7 +55,7 @@ const aiVector3D PlaneInit(0.8523f, 0.34321f, 0.5736f);
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructs a spatially sorted representation from the given position array.
|
// Constructs a spatially sorted representation from the given position array.
|
||||||
// define the reference plane. We choose some arbitrary vector away from all basic axises
|
// define the reference plane. We choose some arbitrary vector away from all basic axes
|
||||||
// in the hope that no model spreads all its vertices along this plane.
|
// in the hope that no model spreads all its vertices along this plane.
|
||||||
SpatialSort::SpatialSort(const aiVector3D *pPositions, unsigned int pNumPositions, unsigned int pElementOffset) :
|
SpatialSort::SpatialSort(const aiVector3D *pPositions, unsigned int pNumPositions, unsigned int pElementOffset) :
|
||||||
mPlaneNormal(PlaneInit) {
|
mPlaneNormal(PlaneInit) {
|
||||||
|
@ -148,7 +148,7 @@ void SpatialSort::FindPositions(const aiVector3D &pPosition,
|
||||||
index++;
|
index++;
|
||||||
|
|
||||||
// Mow start iterating from there until the first position lays outside of the distance range.
|
// Mow start iterating from there until the first position lays outside of the distance range.
|
||||||
// Add all positions inside the distance range within the given radius to the result aray
|
// Add all positions inside the distance range within the given radius to the result array
|
||||||
std::vector<Entry>::const_iterator it = mPositions.begin() + index;
|
std::vector<Entry>::const_iterator it = mPositions.begin() + index;
|
||||||
const ai_real pSquared = pRadius * pRadius;
|
const ai_real pSquared = pRadius * pRadius;
|
||||||
while (it->mDistance < maxDist) {
|
while (it->mDistance < maxDist) {
|
||||||
|
|
|
@ -614,7 +614,7 @@ void PbrtExporter::WriteMaterial(int m) {
|
||||||
eta != 1);
|
eta != 1);
|
||||||
|
|
||||||
mOutput << "# - Constants: diffuse " << constantDiffuse << " specular " << constantSpecular <<
|
mOutput << "# - Constants: diffuse " << constantDiffuse << " specular " << constantSpecular <<
|
||||||
" transprency " << constantTransparency << " opacity " << constantOpacity <<
|
" transparency " << constantTransparency << " opacity " << constantOpacity <<
|
||||||
" shininess " << constantShininess << " shininess strength " << constantShininessStrength <<
|
" shininess " << constantShininess << " shininess strength " << constantShininessStrength <<
|
||||||
" eta " << constantEta << "\n";
|
" eta " << constantEta << "\n";
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ bool RemoveVCProcess::IsActive(unsigned int pFlags) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Small helper function to delete all elements in a T** aray using delete
|
// Small helper function to delete all elements in a T** array using delete
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void ArrayDelete(T **&in, unsigned int &num) {
|
inline void ArrayDelete(T **&in, unsigned int &num) {
|
||||||
for (unsigned int i = 0; i < num; ++i)
|
for (unsigned int i = 0; i < num; ++i)
|
||||||
|
|
|
@ -118,7 +118,7 @@ void ScaleProcess::Execute( aiScene* pScene ) {
|
||||||
{
|
{
|
||||||
aiMesh *mesh = pScene->mMeshes[meshID];
|
aiMesh *mesh = pScene->mMeshes[meshID];
|
||||||
|
|
||||||
// Reconstruct mesh vertexes to the new unit system
|
// Reconstruct mesh vertices to the new unit system
|
||||||
for( unsigned int vertexID = 0; vertexID < mesh->mNumVertices; vertexID++)
|
for( unsigned int vertexID = 0; vertexID < mesh->mNumVertices; vertexID++)
|
||||||
{
|
{
|
||||||
aiVector3D& vertex = mesh->mVertices[vertexID];
|
aiVector3D& vertex = mesh->mVertices[vertexID];
|
||||||
|
|
|
@ -129,7 +129,7 @@ void SplitLargeMeshesProcess_Triangle::UpdateNode(aiNode* pcNode,
|
||||||
pcNode->mMeshes[b] = aiEntries[b];
|
pcNode->mMeshes[b] = aiEntries[b];
|
||||||
}
|
}
|
||||||
|
|
||||||
// recusively update all other nodes
|
// recursively update all other nodes
|
||||||
for (unsigned int i = 0; i < pcNode->mNumChildren;++i) {
|
for (unsigned int i = 0; i < pcNode->mNumChildren;++i) {
|
||||||
UpdateNode ( pcNode->mChildren[i], avList );
|
UpdateNode ( pcNode->mChildren[i], avList );
|
||||||
}
|
}
|
||||||
|
|
|
@ -539,7 +539,7 @@ void TextureTransformStep::Execute( aiScene* pScene)
|
||||||
m5.a3 += trl.x; m5.b3 += trl.y;
|
m5.a3 += trl.x; m5.b3 += trl.y;
|
||||||
matrix = m2 * m4 * matrix * m3 * m5;
|
matrix = m2 * m4 * matrix * m3 * m5;
|
||||||
|
|
||||||
for (src = dest; src != end; ++src) { /* manual homogenious divide */
|
for (src = dest; src != end; ++src) { /* manual homogeneous divide */
|
||||||
src->z = 1.f;
|
src->z = 1.f;
|
||||||
*src = matrix * *src;
|
*src = matrix * *src;
|
||||||
src->x /= src->z;
|
src->x /= src->z;
|
||||||
|
|
|
@ -1,139 +0,0 @@
|
||||||
// Copyright (C) 2002-2005 Nikolaus Gebhardt
|
|
||||||
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
|
|
||||||
// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
|
|
||||||
|
|
||||||
#ifndef __FAST_A_TO_F_H_INCLUDED__
|
|
||||||
#define __FAST_A_TO_F_H_INCLUDED__
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
namespace irr
|
|
||||||
{
|
|
||||||
namespace core
|
|
||||||
{
|
|
||||||
|
|
||||||
const float fast_atof_table[] = {
|
|
||||||
0.f,
|
|
||||||
0.1f,
|
|
||||||
0.01f,
|
|
||||||
0.001f,
|
|
||||||
0.0001f,
|
|
||||||
0.00001f,
|
|
||||||
0.000001f,
|
|
||||||
0.0000001f,
|
|
||||||
0.00000001f,
|
|
||||||
0.000000001f,
|
|
||||||
0.0000000001f,
|
|
||||||
0.00000000001f,
|
|
||||||
0.000000000001f,
|
|
||||||
0.0000000000001f,
|
|
||||||
0.00000000000001f,
|
|
||||||
0.000000000000001f
|
|
||||||
};
|
|
||||||
|
|
||||||
//! Provides a fast function for converting a string into a float,
|
|
||||||
//! about 6 times faster than atof in win32.
|
|
||||||
// If you find any bugs, please send them to me, niko (at) irrlicht3d.org.
|
|
||||||
inline char* fast_atof_move(char* c, float& out)
|
|
||||||
{
|
|
||||||
bool inv = false;
|
|
||||||
char *t;
|
|
||||||
float f;
|
|
||||||
|
|
||||||
if (*c=='-')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
inv = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
f = (float)strtol(c, &t, 10);
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == '.')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
|
|
||||||
float pl = (float)strtol(c, &t, 10);
|
|
||||||
pl *= fast_atof_table[t-c];
|
|
||||||
|
|
||||||
f += pl;
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == 'e')
|
|
||||||
{
|
|
||||||
++c;
|
|
||||||
float exp = (float)strtol(c, &t, 10);
|
|
||||||
f *= (float)pow(10.0f, exp);
|
|
||||||
c = t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inv)
|
|
||||||
f *= -1.0f;
|
|
||||||
|
|
||||||
out = f;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Provides a fast function for converting a string into a float,
|
|
||||||
//! about 6 times faster than atof in win32.
|
|
||||||
// If you find any bugs, please send them to me, niko (at) irrlicht3d.org.
|
|
||||||
inline const char* fast_atof_move_const(const char* c, float& out)
|
|
||||||
{
|
|
||||||
bool inv = false;
|
|
||||||
char *t;
|
|
||||||
float f;
|
|
||||||
|
|
||||||
if (*c=='-')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
inv = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
f = (float)strtol(c, &t, 10);
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == '.')
|
|
||||||
{
|
|
||||||
c++;
|
|
||||||
|
|
||||||
float pl = (float)strtol(c, &t, 10);
|
|
||||||
pl *= fast_atof_table[t-c];
|
|
||||||
|
|
||||||
f += pl;
|
|
||||||
|
|
||||||
c = t;
|
|
||||||
|
|
||||||
if (*c == 'e')
|
|
||||||
{
|
|
||||||
++c;
|
|
||||||
f32 exp = (f32)strtol(c, &t, 10);
|
|
||||||
f *= (f32)powf(10.0f, exp);
|
|
||||||
c = t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inv)
|
|
||||||
f *= -1.0f;
|
|
||||||
|
|
||||||
out = f;
|
|
||||||
return c;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline float fast_atof(const char* c)
|
|
||||||
{
|
|
||||||
float ret;
|
|
||||||
fast_atof_move_const(c, ret);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // end namespace core
|
|
||||||
}// end namespace irr
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
10
doc/dox.h
10
doc/dox.h
|
@ -85,7 +85,7 @@ as long as you retain the license information and take own responsibility for wh
|
||||||
the LICENSE file.
|
the LICENSE file.
|
||||||
|
|
||||||
You can find test models for almost all formats in the <assimp_root>/test/models directory. Beware, they're *free*,
|
You can find test models for almost all formats in the <assimp_root>/test/models directory. Beware, they're *free*,
|
||||||
but not all of them are *open-source*. If there's an accompagning '<file>\source.txt' file don't forget to read it.
|
but not all of them are *open-source*. If there's an accompanying '<file>\source.txt' file don't forget to read it.
|
||||||
|
|
||||||
@section main_install Installation
|
@section main_install Installation
|
||||||
|
|
||||||
|
@ -687,7 +687,7 @@ There are two cases:
|
||||||
format such as DDS or PNG. The term "compressed" does not mean that the texture data must
|
format such as DDS or PNG. The term "compressed" does not mean that the texture data must
|
||||||
actually be compressed, however the texture was found in the model file as if it was stored in a
|
actually be compressed, however the texture was found in the model file as if it was stored in a
|
||||||
separate file on the harddisk. Appropriate decoders (such as libjpeg, libpng, D3DX, DevIL) are
|
separate file on the harddisk. Appropriate decoders (such as libjpeg, libpng, D3DX, DevIL) are
|
||||||
required to load theses textures. aiTexture::mWidth specifies the size of the texture data in
|
required to load these textures. aiTexture::mWidth specifies the size of the texture data in
|
||||||
bytes, aiTexture::pcData is a pointer to the raw image data and aiTexture::achFormatHint is
|
bytes, aiTexture::pcData is a pointer to the raw image data and aiTexture::achFormatHint is
|
||||||
either zeroed or contains the most common file extension of the embedded texture's format. This
|
either zeroed or contains the most common file extension of the embedded texture's format. This
|
||||||
value is only set if assimp is able to determine the file format.
|
value is only set if assimp is able to determine the file format.
|
||||||
|
@ -1181,7 +1181,7 @@ You can get assigned shader sources by using the following material keys:
|
||||||
<li>AI_MATKEY_SHADER_VERTEX</li> Assigned vertex shader code stored as a string.
|
<li>AI_MATKEY_SHADER_VERTEX</li> Assigned vertex shader code stored as a string.
|
||||||
<li>AI_MATKEY_SHADER_FRAGMENT</li> Assigned fragment shader code stored as a string.
|
<li>AI_MATKEY_SHADER_FRAGMENT</li> Assigned fragment shader code stored as a string.
|
||||||
<li>AI_MATKEY_SHADER_GEO</li> Assigned geometry shader code stored as a string.
|
<li>AI_MATKEY_SHADER_GEO</li> Assigned geometry shader code stored as a string.
|
||||||
<li>AI_MATKEY_SHADER_TESSELATION</li> Assigned tesselation shader code stored as a string.
|
<li>AI_MATKEY_SHADER_TESSELATION</li> Assigned tessellation shader code stored as a string.
|
||||||
<li>AI_MATKEY_SHADER_PRIMITIVE</li> Assigned primitive shader code stored as a string.
|
<li>AI_MATKEY_SHADER_PRIMITIVE</li> Assigned primitive shader code stored as a string.
|
||||||
<li>AI_MATKEY_SHADER_COMPUTE</li> Assigned compute shader code stored as a string.
|
<li>AI_MATKEY_SHADER_COMPUTE</li> Assigned compute shader code stored as a string.
|
||||||
|
|
||||||
|
@ -1359,7 +1359,7 @@ When filing bugs on the Blender loader, always give the Blender version (or, eve
|
||||||
This section contains implementation notes on the IFC-STEP importer.
|
This section contains implementation notes on the IFC-STEP importer.
|
||||||
@subsection ifc_overview Overview
|
@subsection ifc_overview Overview
|
||||||
|
|
||||||
The library provides a partial implementation of the IFC2x3 industry standard for automatized exchange of CAE/architectural
|
The library provides a partial implementation of the IFC2x3 industry standard for automated exchange of CAE/architectural
|
||||||
data sets. See http://en.wikipedia.org/wiki/Industry_Foundation_Classes for more information on the format. We aim
|
data sets. See http://en.wikipedia.org/wiki/Industry_Foundation_Classes for more information on the format. We aim
|
||||||
at getting as much 3D data out of the files as possible.
|
at getting as much 3D data out of the files as possible.
|
||||||
|
|
||||||
|
@ -1503,7 +1503,7 @@ like Windows and Linux ( 32 bit and 64 bit ).
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Provide some _free_ test models in <tt><root>/test/models/<FormatName>/</tt> and credit their authors.
|
Provide some _free_ test models in <tt><root>/test/models/<FormatName>/</tt> and credit their authors.
|
||||||
Test files for a file format shouldn't be too large (<i>~500 KiB in total</i>), and not too repetive. Try to cover all format features with test data.
|
Test files for a file format shouldn't be too large (<i>~500 KiB in total</i>), and not too repetitive. Try to cover all format features with test data.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Done! Please, share your loader that everyone can profit from it!
|
Done! Please, share your loader that everyone can profit from it!
|
||||||
|
|
|
@ -40,7 +40,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file Helper class tp perform various byte oder swappings
|
/** @file Helper class tp perform various byte order swappings
|
||||||
(e.g. little to big endian) */
|
(e.g. little to big endian) */
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef AI_BYTESWAPPER_H_INC
|
#ifndef AI_BYTESWAPPER_H_INC
|
||||||
|
|
|
@ -56,7 +56,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
/// @brief Logger class, which will exten the class by log-functions.
|
/// @brief Logger class, which will extend the class by log-functions.
|
||||||
/// @tparam TDeriving
|
/// @tparam TDeriving
|
||||||
template<class TDeriving>
|
template<class TDeriving>
|
||||||
class LogFunctions {
|
class LogFunctions {
|
||||||
|
|
|
@ -41,7 +41,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @file MemoryIOWrapper.h
|
/** @file MemoryIOWrapper.h
|
||||||
* Handy IOStream/IOSystem implemetation to read directly from a memory buffer */
|
* Handy IOStream/IOSystem implementation to read directly from a memory buffer */
|
||||||
#pragma once
|
#pragma once
|
||||||
#ifndef AI_MEMORYIOSTREAM_H_INC
|
#ifndef AI_MEMORYIOSTREAM_H_INC
|
||||||
#define AI_MEMORYIOSTREAM_H_INC
|
#define AI_MEMORYIOSTREAM_H_INC
|
||||||
|
|
|
@ -207,7 +207,7 @@ public:
|
||||||
|
|
||||||
// ---------------------------------------------------------------------
|
// ---------------------------------------------------------------------
|
||||||
/** Set current file pointer (Get it from #GetPtr). This is if you
|
/** Set current file pointer (Get it from #GetPtr). This is if you
|
||||||
* prefer to do pointer arithmetics on your own or want to copy
|
* prefer to do pointer arithmetic on your own or want to copy
|
||||||
* large chunks of data at once.
|
* large chunks of data at once.
|
||||||
* @param p The new pointer, which is validated against the size
|
* @param p The new pointer, which is validated against the size
|
||||||
* limit and buffer boundaries. */
|
* limit and buffer boundaries. */
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace Assimp {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
/** Intermediate description a vertex with all possible components. Defines a full set of
|
/** Intermediate description a vertex with all possible components. Defines a full set of
|
||||||
* operators, so you may use such a 'Vertex' in basic arithmetics. All operators are applied
|
* operators, so you may use such a 'Vertex' in basic arithmetic. All operators are applied
|
||||||
* to *all* vertex components equally. This is useful for stuff like interpolation
|
* to *all* vertex components equally. This is useful for stuff like interpolation
|
||||||
* or subdivision, but won't work if special handling is required for some vertex components. */
|
* or subdivision, but won't work if special handling is required for some vertex components. */
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
@ -222,7 +222,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** This time binary arithmetics of v0 with a floating-point number */
|
/** This time binary arithmetic of v0 with a floating-point number */
|
||||||
template <template <typename, typename, typename> class op> static Vertex BinaryOp(const Vertex& v0, ai_real f) {
|
template <template <typename, typename, typename> class op> static Vertex BinaryOp(const Vertex& v0, ai_real f) {
|
||||||
// this is a heavy task for the compiler to optimize ... *pray*
|
// this is a heavy task for the compiler to optimize ... *pray*
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** This time binary arithmetics of v0 with a floating-point number */
|
/** This time binary arithmetic of v0 with a floating-point number */
|
||||||
template <template <typename, typename, typename> class op> static Vertex BinaryOp(ai_real f, const Vertex& v0) {
|
template <template <typename, typename, typename> class op> static Vertex BinaryOp(ai_real f, const Vertex& v0) {
|
||||||
// this is a heavy task for the compiler to optimize ... *pray*
|
// this is a heavy task for the compiler to optimize ... *pray*
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ ASSIMP_API void aiReleaseExportFormatDescription(const C_STRUCT aiExportFormatDe
|
||||||
* export them again. Since the scene returned by the various importer functions
|
* export them again. Since the scene returned by the various importer functions
|
||||||
* is const, a modifiable copy is needed.
|
* is const, a modifiable copy is needed.
|
||||||
* @param pIn Valid scene to be copied
|
* @param pIn Valid scene to be copied
|
||||||
* @param pOut Receives a modifyable copy of the scene. Use aiFreeScene() to
|
* @param pOut Receives a modifiable copy of the scene. Use aiFreeScene() to
|
||||||
* delete it again.
|
* delete it again.
|
||||||
*/
|
*/
|
||||||
ASSIMP_API void aiCopyScene(const C_STRUCT aiScene *pIn,
|
ASSIMP_API void aiCopyScene(const C_STRUCT aiScene *pIn,
|
||||||
|
|
|
@ -1028,6 +1028,19 @@ extern "C" {
|
||||||
// Multiplied by AI_MATKEY_TRANSMISSION_FACTOR
|
// Multiplied by AI_MATKEY_TRANSMISSION_FACTOR
|
||||||
#define AI_MATKEY_TRANSMISSION_TEXTURE aiTextureType_TRANSMISSION, 0
|
#define AI_MATKEY_TRANSMISSION_TEXTURE aiTextureType_TRANSMISSION, 0
|
||||||
|
|
||||||
|
// Volume
|
||||||
|
// ------------
|
||||||
|
// https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_volume
|
||||||
|
// The thickness of the volume beneath the surface. If the value is 0 the material is thin-walled. Otherwise the material is a volume boundary.
|
||||||
|
#define AI_MATKEY_VOLUME_THICKNESS_FACTOR "$mat.volume.thicknessFactor", 0, 0
|
||||||
|
// Texture that defines the thickness.
|
||||||
|
// Multiplied by AI_MATKEY_THICKNESS_FACTOR
|
||||||
|
#define AI_MATKEY_VOLUME_THICKNESS_TEXTURE aiTextureType_TRANSMISSION, 1
|
||||||
|
// Density of the medium given as the average distance that light travels in the medium before interacting with a particle.
|
||||||
|
#define AI_MATKEY_VOLUME_ATTENUATION_DISTANCE "$mat.volume.attenuationDistance", 0, 0
|
||||||
|
// The color that white light turns into due to absorption when reaching the attenuation distance.
|
||||||
|
#define AI_MATKEY_VOLUME_ATTENUATION_COLOR "$mat.volume.attenuationColor", 0, 0
|
||||||
|
|
||||||
// Emissive
|
// Emissive
|
||||||
// --------
|
// --------
|
||||||
#define AI_MATKEY_USE_EMISSIVE_MAP "$mat.useEmissiveMap", 0, 0
|
#define AI_MATKEY_USE_EMISSIVE_MAP "$mat.useEmissiveMap", 0, 0
|
||||||
|
|
|
@ -440,7 +440,7 @@ enum aiPostProcessSteps
|
||||||
*
|
*
|
||||||
* @note UV transformations are usually implemented in real-time apps by
|
* @note UV transformations are usually implemented in real-time apps by
|
||||||
* transforming texture coordinates at vertex shader stage with a 3x3
|
* transforming texture coordinates at vertex shader stage with a 3x3
|
||||||
* (homogenous) transformation matrix.
|
* (homogeneous) transformation matrix.
|
||||||
*/
|
*/
|
||||||
aiProcess_TransformUVCoords = 0x80000,
|
aiProcess_TransformUVCoords = 0x80000,
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
NSMutableArray* modelMeshes;
|
NSMutableArray* modelMeshes;
|
||||||
BOOL builtBuffers;
|
BOOL builtBuffers;
|
||||||
|
|
||||||
NSMutableDictionary* textureDictionary; // Array of Dicionaries that map image filenames to textureIds
|
NSMutableDictionary* textureDictionary; // Array of Dictionaries that map image filenames to textureIds
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (retain) IBOutlet NSView* _view;
|
@property (retain) IBOutlet NSView* _view;
|
||||||
|
|
|
@ -361,7 +361,7 @@ int main(int argc, char **argv)
|
||||||
C_STRUCT aiLogStream stream;
|
C_STRUCT aiLogStream stream;
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
print_error("No input model file specifed.");
|
print_error("No input model file specified.");
|
||||||
print_run_command(COMMAND_USAGE);
|
print_run_command(COMMAND_USAGE);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/,
|
||||||
LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||||
if (!argv) {
|
if (!argv) {
|
||||||
MessageBox(nullptr,
|
MessageBox(nullptr,
|
||||||
TEXT("An error occured while reading command line arguments."),
|
TEXT("An error occurred while reading command line arguments."),
|
||||||
TEXT("Error!"),
|
TEXT("Error!"),
|
||||||
MB_ICONERROR | MB_OK);
|
MB_ICONERROR | MB_OK);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
@ -667,7 +667,7 @@ BOOL CreateGLWindow(const char* title, int width, int height, int bits, bool ful
|
||||||
dwStyle=WS_OVERLAPPEDWINDOW; // Windows style
|
dwStyle=WS_OVERLAPPEDWINDOW; // Windows style
|
||||||
}
|
}
|
||||||
|
|
||||||
AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle); // Adjust Window To True Requestes Size
|
AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle); // Adjust Window To True Requested Size
|
||||||
|
|
||||||
if (nullptr == (g_hWnd=CreateWindowEx(dwExStyle, // Extended Style For The Window
|
if (nullptr == (g_hWnd=CreateWindowEx(dwExStyle, // Extended Style For The Window
|
||||||
TEXT("OpenGL"), // Class Name
|
TEXT("OpenGL"), // Class Name
|
||||||
|
|
|
@ -391,7 +391,7 @@ public:
|
||||||
// Unapply the transformation using the offset matrix.
|
// Unapply the transformation using the offset matrix.
|
||||||
aiMatrix4x4 unapplied_transform = scene_mesh_bone->mOffsetMatrix * transform;
|
aiMatrix4x4 unapplied_transform = scene_mesh_bone->mOffsetMatrix * transform;
|
||||||
|
|
||||||
// Ensure that we have, approximatively, the identity matrix.
|
// Ensure that we have, approximately, the identity matrix.
|
||||||
expect_equal_matrices(identity_matrix, unapplied_transform, TOLERANCE);
|
expect_equal_matrices(identity_matrix, unapplied_transform, TOLERANCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,6 +45,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
class TestProgressHandler : public ProgressHandler {
|
class TestProgressHandler : public ProgressHandler {
|
||||||
public:
|
public:
|
||||||
TestProgressHandler() :
|
TestProgressHandler() :
|
||||||
|
@ -101,3 +103,5 @@ TEST_F(ExporterTest, ExporterIdTest) {
|
||||||
const aiExportFormatDesc *desc = exporter.GetExportFormatDescription(exportFormatCount);
|
const aiExportFormatDesc *desc = exporter.GetExportFormatDescription(exportFormatCount);
|
||||||
EXPECT_EQ(nullptr, desc) << "More exporters than claimed";
|
EXPECT_EQ(nullptr, desc) << "More exporters than claimed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -233,6 +233,8 @@ unsigned int GetMeshUseCount(const aiNode *rootNode) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
TEST_F(utColladaImportExport, exportRootNodeMeshTest) {
|
TEST_F(utColladaImportExport, exportRootNodeMeshTest) {
|
||||||
Assimp::Importer importer;
|
Assimp::Importer importer;
|
||||||
Assimp::Exporter exporter;
|
Assimp::Exporter exporter;
|
||||||
|
@ -342,6 +344,8 @@ TEST_F(utColladaImportExport, exporterUniqueIdsTest) {
|
||||||
ImportAsNames(outFileNamed, scene);
|
ImportAsNames(outFileNamed, scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
class utColladaZaeImportExport : public AbstractImportExportBase {
|
class utColladaZaeImportExport : public AbstractImportExportBase {
|
||||||
public:
|
public:
|
||||||
virtual bool importerTest() final {
|
virtual bool importerTest() final {
|
||||||
|
|
|
@ -132,6 +132,6 @@ TEST_F(TriangulateProcessTest, testTriangulation) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we should have no valid normal vectors now necause we aren't a pure polygon mesh
|
// we should have no valid normal vectors now because we aren't a pure polygon mesh
|
||||||
EXPECT_TRUE(pcMesh->mNormals == NULL);
|
EXPECT_TRUE(pcMesh->mNormals == NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -313,7 +313,7 @@ int Assimp_Info (const char* const* params, unsigned int num) {
|
||||||
|
|
||||||
// Verbose and silent at the same time are not allowed
|
// Verbose and silent at the same time are not allowed
|
||||||
if ( verbose && silent ) {
|
if ( verbose && silent ) {
|
||||||
printf("assimp info: Invalid arguments, verbose and silent at the same time are forbitten. ");
|
printf("assimp info: Invalid arguments, verbose and silent at the same time are forbidden. ");
|
||||||
return AssimpCmdInfoError::InvalidCombinaisonOfArguments;
|
return AssimpCmdInfoError::InvalidCombinaisonOfArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,8 @@ const char *AICMD_MSG_DUMP_HELP =
|
||||||
FILE *out = nullptr;
|
FILE *out = nullptr;
|
||||||
bool shortened = false;
|
bool shortened = false;
|
||||||
|
|
||||||
|
#ifndef ASSIMP_BUILD_NO_EXPORT
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------------
|
||||||
int Assimp_Dump(const char *const *params, unsigned int num) {
|
int Assimp_Dump(const char *const *params, unsigned int num) {
|
||||||
const char *fail = "assimp dump: Invalid number of arguments. "
|
const char *fail = "assimp dump: Invalid number of arguments. "
|
||||||
|
@ -162,3 +164,9 @@ int Assimp_Dump(const char *const *params, unsigned int num) {
|
||||||
printf("assimp dump: Wrote output dump %s\n", cur_out.c_str());
|
printf("assimp dump: Wrote output dump %s\n", cur_out.c_str());
|
||||||
return AssimpCmdError::Success;
|
return AssimpCmdError::Success;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
int Assimp_Dump(const char *const *, unsigned int ) {
|
||||||
|
printf("assimp dump: Export disabled.\n");
|
||||||
|
return AssimpCmdError::UnrecognizedCommand;
|
||||||
|
}
|
||||||
|
#endif
|
|
@ -90,7 +90,7 @@ D3DXVECTOR4 g_aclNormalColors[14] =
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
// Recursivly count the number of nodes in an asset's node graph
|
// Recursively count the number of nodes in an asset's node graph
|
||||||
// Used by LoadAsset()
|
// Used by LoadAsset()
|
||||||
//-------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------
|
||||||
void GetNodeCount(aiNode* pcNode, unsigned int* piCnt)
|
void GetNodeCount(aiNode* pcNode, unsigned int* piCnt)
|
||||||
|
@ -1535,7 +1535,7 @@ int CDisplay::RenderStereoView(const aiMatrix4x4& m)
|
||||||
// (move back to the original position)
|
// (move back to the original position)
|
||||||
g_sCamera.vPos -= g_sCamera.vRight * 0.03f;
|
g_sCamera.vPos -= g_sCamera.vRight * 0.03f;
|
||||||
|
|
||||||
// reenable all channels
|
// re-enable all channels
|
||||||
g_piDevice->SetRenderState(D3DRS_COLORWRITEENABLE,
|
g_piDevice->SetRenderState(D3DRS_COLORWRITEENABLE,
|
||||||
D3DCOLORWRITEENABLE_RED |
|
D3DCOLORWRITEENABLE_RED |
|
||||||
D3DCOLORWRITEENABLE_GREEN |
|
D3DCOLORWRITEENABLE_GREEN |
|
||||||
|
|
|
@ -1483,7 +1483,7 @@ int CMaterialManager::EndMaterial (AssetHelper::MeshHelper* pcMesh)
|
||||||
pcMesh->piEffect->EndPass();
|
pcMesh->piEffect->EndPass();
|
||||||
pcMesh->piEffect->End();
|
pcMesh->piEffect->End();
|
||||||
|
|
||||||
// reenable culling if necessary
|
// re-enable culling if necessary
|
||||||
if (pcMesh->twosided && g_sOptions.bCulling) {
|
if (pcMesh->twosided && g_sOptions.bCulling) {
|
||||||
g_piDevice->SetRenderState(D3DRS_CULLMODE,D3DCULL_CCW);
|
g_piDevice->SetRenderState(D3DRS_CULLMODE,D3DCULL_CCW);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,7 +116,7 @@ void MakeFileAssociations() {
|
||||||
RegSetValueEx(hRegistry,"",0,REG_SZ,(const BYTE*)szTemp,(DWORD)strlen(szTemp)+1);
|
RegSetValueEx(hRegistry,"",0,REG_SZ,(const BYTE*)szTemp,(DWORD)strlen(szTemp)+1);
|
||||||
RegCloseKey(hRegistry);
|
RegCloseKey(hRegistry);
|
||||||
|
|
||||||
CLogDisplay::Instance().AddEntry("[OK] File assocations have been registered",
|
CLogDisplay::Instance().AddEntry("[OK] File associations have been registered",
|
||||||
D3DCOLOR_ARGB(0xFF,0,0xFF,0));
|
D3DCOLOR_ARGB(0xFF,0,0xFF,0));
|
||||||
|
|
||||||
CLogDisplay::Instance().AddEntry(tmp.data,D3DCOLOR_ARGB(0xFF,0,0xFF,0));
|
CLogDisplay::Instance().AddEntry(tmp.data,D3DCOLOR_ARGB(0xFF,0,0xFF,0));
|
||||||
|
@ -1508,7 +1508,7 @@ INT_PTR CALLBACK MessageProc(HWND hwndDlg,UINT uMsg, WPARAM wParam,LPARAM lParam
|
||||||
sRect.right -= sRect.left;
|
sRect.right -= sRect.left;
|
||||||
sRect.bottom -= sRect.top;
|
sRect.bottom -= sRect.top;
|
||||||
|
|
||||||
// if the mouse klick was inside the viewer panel
|
// if the mouse click was inside the viewer panel
|
||||||
// give the focus to it
|
// give the focus to it
|
||||||
if (xPos > 0 && xPos < sRect.right && yPos > 0 && yPos < sRect.bottom)
|
if (xPos > 0 && xPos < sRect.right && yPos > 0 && yPos < sRect.bottom)
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,7 +125,7 @@ public:
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
/** Calculates the node transformations for the scene. Call this to get
|
/** Calculates the node transformations for the scene. Call this to get
|
||||||
* uptodate results before calling one of the getters.
|
* up-to-date results before calling one of the getters.
|
||||||
* @param pTime Current time. Can be an arbitrary range.
|
* @param pTime Current time. Can be an arbitrary range.
|
||||||
*/
|
*/
|
||||||
void Calculate(double pTime);
|
void Calculate(double pTime);
|
||||||
|
|
|
@ -489,7 +489,7 @@ int CreateAssetData() {
|
||||||
nidx = 3;
|
nidx = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CLogWindow::Instance().WriteLine("Unknown primitiv type");
|
CLogWindow::Instance().WriteLine("Unknown primitive type");
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue