Convert a transform from the Collada model coordinate system to the DTS coordinate system
| 50 | // Convert a transform from the Collada model coordinate system to the DTS coordinate |
| 51 | // system |
| 52 | void ColladaUtils::convertTransform(MatrixF& mat) |
| 53 | { |
| 54 | MatrixF rot(true); |
| 55 | |
| 56 | switch (ColladaUtils::getOptions().upAxis) |
| 57 | { |
| 58 | case UPAXISTYPE_X_UP: |
| 59 | // rotate 90 around Y-axis, then 90 around Z-axis |
| 60 | rot(0,0) = 0.0f; rot(1,0) = 1.0f; |
| 61 | rot(1,1) = 0.0f; rot(2,1) = 1.0f; |
| 62 | rot(0,2) = 1.0f; rot(2,2) = 0.0f; |
| 63 | |
| 64 | // pre-multiply the transform by the rotation matrix |
| 65 | mat.mulL(rot); |
| 66 | break; |
| 67 | |
| 68 | case UPAXISTYPE_Y_UP: |
| 69 | // rotate 180 around Y-axis, then 90 around X-axis |
| 70 | rot(0,0) = -1.0f; |
| 71 | rot(1,1) = 0.0f; rot(2,1) = 1.0f; |
| 72 | rot(1,2) = 1.0f; rot(2,2) = 0.0f; |
| 73 | |
| 74 | // pre-multiply the transform by the rotation matrix |
| 75 | mat.mulL(rot); |
| 76 | break; |
| 77 | |
| 78 | case UPAXISTYPE_Z_UP: |
| 79 | default: |
| 80 | // nothing to do |
| 81 | break; |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | /// Find the COMMON profile element in an effect |
| 86 | const domProfile_COMMON* ColladaUtils::findEffectCommonProfile(const domEffect* effect) |