9#include "COLLADAFWMatrix.h"
10#include "COLLADAFWRotate.h"
11#include "COLLADAFWScale.h"
12#include "COLLADAFWTranslate.h"
25 COLLADAFW::Node *node,
26 std::map<COLLADAFW::UniqueId, Animation> *animation_map,
33 COLLADAFW::Node *node,
34 std::map<COLLADAFW::UniqueId, Animation> *animation_map,
36 float parent_mat[4][4])
43 for (
uint i = 0;
i < node->getTransformations().getCount();
i++) {
45 COLLADAFW::Transformation *tm = node->getTransformations()[
i];
46 COLLADAFW::Transformation::TransformationType type = tm->getTransformationType();
49 case COLLADAFW::Transformation::MATRIX:
58 case COLLADAFW::Transformation::TRANSLATE:
61 case COLLADAFW::Transformation::ROTATE:
64 case COLLADAFW::Transformation::SCALE:
67 case COLLADAFW::Transformation::LOOKAT:
68 fprintf(stderr,
"|! LOOKAT transformations are not supported yet.\n");
70 case COLLADAFW::Transformation::SKEW:
71 fprintf(stderr,
"|! SKEW transformations are not supported yet.\n");
80 const COLLADAFW::UniqueId &anim_list_id = tm->getAnimationList();
84 (*animation_map)[anim_list_id] = anim;
95 COLLADAFW::Rotate *ro = (COLLADAFW::Rotate *)tm;
96 COLLADABU::Math::Vector3 &axis = ro->getRotationAxis();
97 const float angle = float(
DEG2RAD(ro->getRotationAngle()));
98 const float ax[] = {float(axis[0]), float(axis[1]), float(axis[2])};
109 COLLADAFW::Translate *tra = (COLLADAFW::Translate *)tm;
110 COLLADABU::Math::Vector3 &t = tra->getTranslation();
114 m[3][0] = float(t[0]);
115 m[3][1] = float(t[1]);
116 m[3][2] = float(t[2]);
121 COLLADABU::Math::Vector3 &s = ((COLLADAFW::Scale *)tm)->getScale();
122 float size[3] = {float(s[0]), float(s[1]), float(s[2])};
void mul_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4])
void size_to_mat4(float R[4][4], const float size[3])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
void unit_m4(float m[4][4])
void axis_angle_to_quat(float r[4], const float axis[3], float angle)
void quat_to_mat4(float m[4][4], const float q[4])
void axis_angle_to_mat4(float R[4][4], const float axis[3], float angle)
static double angle(const Eigen::Vector3d &v1, const Eigen::Vector3d &v2)
ATTR_WARN_UNUSED_RESULT const BMVert * v
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static void dae_matrix_to_mat4_(float out[4][4], const COLLADABU::Math::Matrix4 &in)
static void copy(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node)