|
@@ -53,12 +53,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
#include <assimp/commonMetaData.h>
|
|
#include <assimp/commonMetaData.h>
|
|
#include <assimp/fast_atof.h>
|
|
#include <assimp/fast_atof.h>
|
|
#include <assimp/light.h>
|
|
#include <assimp/light.h>
|
|
-#include <stdarg.h>
|
|
|
|
#include <assimp/DefaultLogger.hpp>
|
|
#include <assimp/DefaultLogger.hpp>
|
|
#include <assimp/IOSystem.hpp>
|
|
#include <assimp/IOSystem.hpp>
|
|
-#include <sstream>
|
|
|
|
|
|
|
|
|
|
+#include <stdarg.h>
|
|
#include <memory>
|
|
#include <memory>
|
|
|
|
+#include <sstream>
|
|
|
|
|
|
using namespace Assimp;
|
|
using namespace Assimp;
|
|
using namespace Assimp::Collada;
|
|
using namespace Assimp::Collada;
|
|
@@ -306,9 +306,9 @@ void ColladaParser::ReadAssetInfo(XmlNode &node) {
|
|
} else if (name == "up_axis") {
|
|
} else if (name == "up_axis") {
|
|
std::string v;
|
|
std::string v;
|
|
XmlParser::getValueAsString(currentNode, v);
|
|
XmlParser::getValueAsString(currentNode, v);
|
|
- if (v == "X_UP" ) {
|
|
|
|
|
|
+ if (v == "X_UP") {
|
|
mUpDirection = UP_X;
|
|
mUpDirection = UP_X;
|
|
- } else if (v == "Z_UP" ) {
|
|
|
|
|
|
+ } else if (v == "Z_UP") {
|
|
mUpDirection = UP_Z;
|
|
mUpDirection = UP_Z;
|
|
} else {
|
|
} else {
|
|
mUpDirection = UP_Y;
|
|
mUpDirection = UP_Y;
|
|
@@ -567,13 +567,13 @@ void ColladaParser::ReadAnimationSampler(XmlNode &node, Collada::AnimationChanne
|
|
|
|
|
|
if (semantic == "INPUT")
|
|
if (semantic == "INPUT")
|
|
pChannel.mSourceTimes = source;
|
|
pChannel.mSourceTimes = source;
|
|
- else if (semantic == "OUTPUT" )
|
|
|
|
|
|
+ else if (semantic == "OUTPUT")
|
|
pChannel.mSourceValues = source;
|
|
pChannel.mSourceValues = source;
|
|
- else if (semantic == "IN_TANGENT" )
|
|
|
|
|
|
+ else if (semantic == "IN_TANGENT")
|
|
pChannel.mInTanValues = source;
|
|
pChannel.mInTanValues = source;
|
|
- else if ( semantic == "OUT_TANGENT" )
|
|
|
|
|
|
+ else if (semantic == "OUT_TANGENT")
|
|
pChannel.mOutTanValues = source;
|
|
pChannel.mOutTanValues = source;
|
|
- else if ( semantic == "INTERPOLATION" )
|
|
|
|
|
|
+ else if (semantic == "INTERPOLATION")
|
|
pChannel.mInterpolationValues = source;
|
|
pChannel.mInterpolationValues = source;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -588,14 +588,16 @@ void ColladaParser::ReadControllerLibrary(XmlNode &node) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- const std::string name = node.name();
|
|
|
|
- if (name != "controller") {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- std::string id = node.attribute("id").as_string();
|
|
|
|
- mControllerLibrary[id] = Controller();
|
|
|
|
- ReadController(node, mControllerLibrary[id]);
|
|
|
|
|
|
+ for (XmlNode ¤tNode : node.children()) {
|
|
|
|
+ const std::string ¤tName = currentNode.name();
|
|
|
|
+ if (currentName != "controller") {
|
|
|
|
+ continue;;
|
|
|
|
+ }
|
|
|
|
+ std::string id = node.attribute("id").as_string();
|
|
|
|
+ mControllerLibrary[id] = Controller();
|
|
|
|
+ ReadController(node, mControllerLibrary[id]);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
// ------------------------------------------------------------------------------------------------
|
|
@@ -613,8 +615,8 @@ void ColladaParser::ReadController(XmlNode &node, Collada::Controller &pControll
|
|
if (methodIndex > 0) {
|
|
if (methodIndex > 0) {
|
|
std::string method;
|
|
std::string method;
|
|
XmlParser::getValueAsString(currentNode, method);
|
|
XmlParser::getValueAsString(currentNode, method);
|
|
-
|
|
|
|
- if (method == "RELATIVE" ) {
|
|
|
|
|
|
+
|
|
|
|
+ if (method == "RELATIVE") {
|
|
pController.mMethod = Relative;
|
|
pController.mMethod = Relative;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -992,7 +994,6 @@ void ColladaParser::ReadCamera(XmlNode &node, Collada::Camera &camera) {
|
|
xmlIt.collectChildrenPreOrder(node);
|
|
xmlIt.collectChildrenPreOrder(node);
|
|
XmlNode currentNode;
|
|
XmlNode currentNode;
|
|
|
|
|
|
- std::string out;
|
|
|
|
while (xmlIt.getNext(currentNode)) {
|
|
while (xmlIt.getNext(currentNode)) {
|
|
const std::string ¤tName = currentNode.name();
|
|
const std::string ¤tName = currentNode.name();
|
|
if (currentName == "orthographic") {
|
|
if (currentName == "orthographic") {
|
|
@@ -1001,10 +1002,8 @@ void ColladaParser::ReadCamera(XmlNode &node, Collada::Camera &camera) {
|
|
XmlParser::getValueAsFloat(currentNode, camera.mHorFov);
|
|
XmlParser::getValueAsFloat(currentNode, camera.mHorFov);
|
|
} else if (currentName == "yfov" || currentName == "ymag") {
|
|
} else if (currentName == "yfov" || currentName == "ymag") {
|
|
XmlParser::getValueAsFloat(currentNode, camera.mVerFov);
|
|
XmlParser::getValueAsFloat(currentNode, camera.mVerFov);
|
|
- camera.mVerFov = (ai_real)std::atof(out.c_str());
|
|
|
|
} else if (currentName == "aspect_ratio") {
|
|
} else if (currentName == "aspect_ratio") {
|
|
XmlParser::getValueAsFloat(currentNode, camera.mAspect);
|
|
XmlParser::getValueAsFloat(currentNode, camera.mAspect);
|
|
- camera.mAspect = (ai_real)std::atof(out.c_str());
|
|
|
|
} else if (currentName == "znear") {
|
|
} else if (currentName == "znear") {
|
|
XmlParser::getValueAsFloat(currentNode, camera.mZNear);
|
|
XmlParser::getValueAsFloat(currentNode, camera.mZNear);
|
|
} else if (currentName == "zfar") {
|
|
} else if (currentName == "zfar") {
|
|
@@ -1281,7 +1280,6 @@ void ColladaParser::ReadEffectParam(XmlNode &node, Collada::EffectParam &pParam)
|
|
xmlIt.collectChildrenPreOrder(node);
|
|
xmlIt.collectChildrenPreOrder(node);
|
|
XmlNode currentNode;
|
|
XmlNode currentNode;
|
|
|
|
|
|
-
|
|
|
|
while (xmlIt.getNext(currentNode)) {
|
|
while (xmlIt.getNext(currentNode)) {
|
|
const std::string ¤tName = currentNode.name();
|
|
const std::string ¤tName = currentNode.name();
|
|
if (currentName == "surface") {
|
|
if (currentName == "surface") {
|