Changeset 10914

Show
Ignore:
Timestamp:
01/05/10 12:10:21 (5 years ago)
Author:
robert
Message:

Fixed indentation

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/3ds/ReaderWriter3DS.cpp

    r10853 r10914  
    115115 
    116116/// Possible options: 
    117 ///             - noMatrixTransforms: set the plugin to apply matrices into the mesh vertices ("old behaviour") instead of restoring them ("new behaviour"). You may use this option to avoid a few rounding errors. 
    118 ///             - checkForEspilonIdentityMatrices: if noMatrixTransforms is \b not set, then consider "almost identity" matrices to be identity ones (in case of rounding errors). 
    119 ///             - restoreMatrixTransformsNoMeshes: makes an exception to the behaviour when 'noMatrixTransforms' is \b not set for mesh instances. When a mesh instance has a transform on it, the reader creates a MatrixTransform above the Geode. If you don't want the hierarchy to be modified, then you can use this option to merge the transform into vertices. 
     117///        - noMatrixTransforms: set the plugin to apply matrices into the mesh vertices ("old behaviour") instead of restoring them ("new behaviour"). You may use this option to avoid a few rounding errors. 
     118///        - checkForEspilonIdentityMatrices: if noMatrixTransforms is \b not set, then consider "almost identity" matrices to be identity ones (in case of rounding errors). 
     119///        - restoreMatrixTransformsNoMeshes: makes an exception to the behaviour when 'noMatrixTransforms' is \b not set for mesh instances. When a mesh instance has a transform on it, the reader creates a MatrixTransform above the Geode. If you don't want the hierarchy to be modified, then you can use this option to merge the transform into vertices. 
    120120class ReaderWriter3DS : public osgDB::ReaderWriter 
    121121{ 
     
    409409    Lib3dsMeshInstanceNode * object = (node->type == LIB3DS_NODE_MESH_INSTANCE) ? reinterpret_cast<Lib3dsMeshInstanceNode *>(node) : NULL; 
    410410    Lib3dsMesh * mesh = lib3ds_file_mesh_for_node(f,node); 
    411     assert(!(mesh && !object));         // Node must be a LIB3DS_NODE_MESH_INSTANCE if a mesh exists 
     411    assert(!(mesh && !object));        // Node must be a LIB3DS_NODE_MESH_INSTANCE if a mesh exists 
    412412 
    413413    // Retreive LOCAL transform 
     
    433433            // There can be a transform directly on a mesh instance (= as if a osg::MatrixTransform and a osg::Geode were merged together) in object->pos/rot/scl 
    434434            if (!pivoted) { 
    435                                 meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)); 
     435                meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)); 
    436436            } else { 
    437437                meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)) * osg::Matrix::translate(-pivot); 
     
    439439        } 
    440440        else { 
    441                         if (pivoted) { 
    442                                 meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)) * osg::Matrix::translate(-pivot) * copyLib3dsMatrixToOsgMatrix(node->matrix); 
    443                         } else { 
    444                                 meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)) * copyLib3dsMatrixToOsgMatrix(node->matrix); 
    445                         } 
    446                         osgNodeMatrix = osg::Matrix::identity();                // Not sure it's useful, but it's harmless ;) 
     441            if (pivoted) { 
     442                meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)) * osg::Matrix::translate(-pivot) * copyLib3dsMatrixToOsgMatrix(node->matrix); 
     443            } else { 
     444                meshMat = osg::Matrix::inverse(copyLib3dsMatrixToOsgMatrix(mesh->matrix)) * copyLib3dsMatrixToOsgMatrix(node->matrix); 
     445            } 
     446            osgNodeMatrix = osg::Matrix::identity();        // Not sure it's useful, but it's harmless ;) 
    447447        } 
    448448    } 
     
    476476        } 
    477477    } else { 
    478         assert(node->childs == NULL);           // Else we must have a group to put childs into 
     478        assert(node->childs == NULL);        // Else we must have a group to put childs into 
    479479    } 
    480480 
     
    11271127        return false; 
    11281128    w.writeMaterials(); 
    1129     return true;        //w.good(); 
     1129    return true;    //w.good(); 
    11301130} 
    11311131#endif    // ENABLE_3DS_WRITER