| 906 | } |
| 907 | |
| 908 | void GuiShapeEdPreview::exportToCollada( const String& path ) |
| 909 | { |
| 910 | #ifdef TORQUE_COLLADA |
| 911 | if ( mModel ) |
| 912 | { |
| 913 | MatrixF orientation( true ); |
| 914 | orientation.setPosition( mModel->getShape()->mBounds.getCenter() ); |
| 915 | orientation.inverse(); |
| 916 | |
| 917 | OptimizedPolyList polyList; |
| 918 | polyList.setBaseTransform( orientation ); |
| 919 | |
| 920 | mModel->buildPolyList( &polyList, mCurrentDL ); |
| 921 | for ( S32 i = 0; i < mMounts.size(); i++ ) |
| 922 | { |
| 923 | MountedShape* mount = mMounts[i]; |
| 924 | |
| 925 | MatrixF mat( true ); |
| 926 | if ( mount->mNode != -1 ) |
| 927 | { |
| 928 | mat = mModel->mNodeTransforms[ mount->mNode ]; |
| 929 | mat *= mount->mTransform; |
| 930 | } |
| 931 | |
| 932 | polyList.setTransform( &mat, Point3F::One ); |
| 933 | mount->mShape->buildPolyList( &polyList, 0 ); |
| 934 | } |
| 935 | |
| 936 | // Use a ColladaUtils function to do the actual export to a Collada file |
| 937 | ColladaUtils::exportToCollada( path, polyList ); |
| 938 | } |
| 939 | #endif |
| 940 | } |
| 941 | |
| 942 | //----------------------------------------------------------------------------- |
| 943 | // Camera control and Node editing |
no test coverage detected