commit
a41bef0d54
|
@ -1309,7 +1309,7 @@ void ColladaExporter::WriteAnimationLibrary(size_t pIndex)
|
||||||
// Combine the above transformations
|
// Combine the above transformations
|
||||||
aiMatrix4x4 mat = TranslationM * RotationM * ScalingM;
|
aiMatrix4x4 mat = TranslationM * RotationM * ScalingM;
|
||||||
|
|
||||||
for( size_t j = 0; j < 4; ++j) {
|
for( unsigned int j = 0; j < 4; ++j) {
|
||||||
keyframes.insert(keyframes.end(), mat[j], mat[j] + 4);
|
keyframes.insert(keyframes.end(), mat[j], mat[j] + 4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "MemoryIOWrapper.h"
|
#include "MemoryIOWrapper.h"
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
#include "../contrib/utf8cpp/source/utf8.h"
|
#include "../contrib/utf8cpp/source/utf8.h"
|
||||||
|
#include "fast_atof.h"
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -714,7 +715,7 @@ public:
|
||||||
if (floatValue) {
|
if (floatValue) {
|
||||||
return floatValue->value.size() == 1 ? floatValue->value.front() : 0;
|
return floatValue->value.size() == 1 ? floatValue->value.front() : 0;
|
||||||
}
|
}
|
||||||
return atof(attr->value->toString().c_str());
|
return fast_atof(attr->value->toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual float getAttributeValueAsFloat(int idx) const /*override*/ {
|
virtual float getAttributeValueAsFloat(int idx) const /*override*/ {
|
||||||
|
@ -725,7 +726,7 @@ public:
|
||||||
if (floatValue) {
|
if (floatValue) {
|
||||||
return floatValue->value.size() == 1 ? floatValue->value.front() : 0;
|
return floatValue->value.size() == 1 ? floatValue->value.front() : 0;
|
||||||
}
|
}
|
||||||
return atof(attributes[idx].value->toString().c_str());
|
return fast_atof(attributes[idx].value->toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char* getNodeName() const /*override*/ {
|
virtual const char* getNodeName() const /*override*/ {
|
||||||
|
|
|
@ -93,7 +93,7 @@ void FindDegeneratesProcess::Execute( aiScene* pScene) {
|
||||||
|
|
||||||
static ai_real heron( ai_real a, ai_real b, ai_real c ) {
|
static ai_real heron( ai_real a, ai_real b, ai_real c ) {
|
||||||
ai_real s = (a + b + c) / 2;
|
ai_real s = (a + b + c) / 2;
|
||||||
ai_real area = pow((s * ( s - a ) * ( s - b ) * ( s - c ) ), 0.5 );
|
ai_real area = pow((s * ( s - a ) * ( s - b ) * ( s - c ) ), (ai_real)0.5 );
|
||||||
return area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ static ai_real distance3D( const aiVector3D &vA, aiVector3D &vB ) {
|
||||||
const ai_real ly = ( vB.y - vA.y );
|
const ai_real ly = ( vB.y - vA.y );
|
||||||
const ai_real lz = ( vB.z - vA.z );
|
const ai_real lz = ( vB.z - vA.z );
|
||||||
ai_real a = lx*lx + ly*ly + lz*lz;
|
ai_real a = lx*lx + ly*ly + lz*lz;
|
||||||
ai_real d = pow( a, 0.5 );
|
ai_real d = pow( a, (ai_real)0.5 );
|
||||||
|
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,7 +339,7 @@ void FindInvalidDataProcess::ProcessAnimationChannel (aiNodeAnim* anim)
|
||||||
int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh)
|
int FindInvalidDataProcess::ProcessMesh (aiMesh* pMesh)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
std::vector<bool> dirtyMask(pMesh->mNumVertices, pMesh->mNumFaces);
|
std::vector<bool> dirtyMask(pMesh->mNumVertices, pMesh->mNumFaces != 0);
|
||||||
|
|
||||||
// Ignore elements that are not referenced by vertices.
|
// Ignore elements that are not referenced by vertices.
|
||||||
// (they are, for example, caused by the FindDegenerates step)
|
// (they are, for example, caused by the FindDegenerates step)
|
||||||
|
|
|
@ -248,7 +248,7 @@ void STLImporter::LoadASCIIFile( aiNode *root ) {
|
||||||
std::vector<unsigned int> meshIndices;
|
std::vector<unsigned int> meshIndices;
|
||||||
aiMesh* pMesh = new aiMesh();
|
aiMesh* pMesh = new aiMesh();
|
||||||
pMesh->mMaterialIndex = 0;
|
pMesh->mMaterialIndex = 0;
|
||||||
meshIndices.push_back( meshes.size() );
|
meshIndices.push_back((unsigned int) meshes.size() );
|
||||||
meshes.push_back(pMesh);
|
meshes.push_back(pMesh);
|
||||||
aiNode *node = new aiNode;
|
aiNode *node = new aiNode;
|
||||||
node->mParent = root;
|
node->mParent = root;
|
||||||
|
@ -383,7 +383,7 @@ void STLImporter::LoadASCIIFile( aiNode *root ) {
|
||||||
pScene->mMeshes[ i ] = meshes[i];
|
pScene->mMeshes[ i ] = meshes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
root->mNumChildren = nodes.size();
|
root->mNumChildren = (unsigned int) nodes.size();
|
||||||
root->mChildren = new aiNode*[ root->mNumChildren ];
|
root->mChildren = new aiNode*[ root->mNumChildren ];
|
||||||
for ( size_t i=0; i<nodes.size(); ++i ) {
|
for ( size_t i=0; i<nodes.size(); ++i ) {
|
||||||
root->mChildren[ i ] = nodes[ i ];
|
root->mChildren[ i ] = nodes[ i ];
|
||||||
|
|
|
@ -212,7 +212,7 @@ unsigned int LazyDict<T>::Remove(const char* id)
|
||||||
mObjs.erase(mObjs.begin() + index);
|
mObjs.erase(mObjs.begin() + index);
|
||||||
|
|
||||||
//update index of object in mObjs;
|
//update index of object in mObjs;
|
||||||
for (size_t i = index; i < mObjs.size(); ++i) {
|
for (unsigned int i = index; i < mObjs.size(); ++i) {
|
||||||
T *obj = mObjs[i];
|
T *obj = mObjs[i];
|
||||||
|
|
||||||
obj->index = i;
|
obj->index = i;
|
||||||
|
|
|
@ -445,7 +445,7 @@ void glTF2Exporter::ExportMaterials()
|
||||||
mat->Get(AI_MATKEY_SHININESS, shininess) == AI_SUCCESS
|
mat->Get(AI_MATKEY_SHININESS, shininess) == AI_SUCCESS
|
||||||
) {
|
) {
|
||||||
// convert specular color to luminance
|
// convert specular color to luminance
|
||||||
float specularIntensity = specularColor[0] * 0.2125 + specularColor[1] * 0.7154 + specularColor[2] * 0.0721;
|
float specularIntensity = specularColor[0] * 0.2125f + specularColor[1] * 0.7154f + specularColor[2] * 0.0721f;
|
||||||
//normalize shininess (assuming max is 1000) with an inverse exponentional curve
|
//normalize shininess (assuming max is 1000) with an inverse exponentional curve
|
||||||
float normalizedShininess = std::sqrt(shininess / 1000);
|
float normalizedShininess = std::sqrt(shininess / 1000);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue