| 848 | } |
| 849 | |
| 850 | void GuiShapeEdPreview::exportToCollada( const String& path ) |
| 851 | { |
| 852 | #ifdef TORQUE_COLLADA |
| 853 | if ( mModel ) |
| 854 | { |
| 855 | MatrixF orientation( true ); |
| 856 | orientation.setPosition( mModel->getShape()->bounds.getCenter() ); |
| 857 | orientation.inverse(); |
| 858 | |
| 859 | OptimizedPolyList polyList; |
| 860 | polyList.setBaseTransform( orientation ); |
| 861 | |
| 862 | mModel->buildPolyList( &polyList, mCurrentDL ); |
| 863 | for ( S32 i = 0; i < mMounts.size(); i++ ) |
| 864 | { |
| 865 | MountedShape* mount = mMounts[i]; |
| 866 | |
| 867 | MatrixF mat( true ); |
| 868 | if ( mount->mNode != -1 ) |
| 869 | { |
| 870 | mat = mModel->mNodeTransforms[ mount->mNode ]; |
| 871 | mat *= mount->mTransform; |
| 872 | } |
| 873 | |
| 874 | polyList.setTransform( &mat, Point3F::One ); |
| 875 | mount->mShape->buildPolyList( &polyList, 0 ); |
| 876 | } |
| 877 | |
| 878 | // Use a ColladaUtils function to do the actual export to a Collada file |
| 879 | ColladaUtils::exportToCollada( path, polyList ); |
| 880 | } |
| 881 | #endif |
| 882 | } |
| 883 | |
| 884 | //----------------------------------------------------------------------------- |
| 885 | // Camera control and Node editing |
no test coverage detected