~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/dae/daeReader.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-07-29 04:34:38 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080729043438-no1h9h0dpsrlzp1y
* Non-maintainer upload.
* No longer try to detect (using /proc/cpuinfo when available) how many
  CPUs are available, fixing the FTBFS (due to -j0) on various platforms
  (Closes: #477353). The right way to do it is to support parallel=n in
  DEB_BUILD_OPTIONS (see Debian Policy §4.9.1), and adequate support has
  been implemented.
* Add patch to fix FTBFS due to the build system now refusing to handle
  whitespaces (Policy CMP0004 say the logs), thanks to Andreas Putzo who
  provided it (Closes: #482239):
   - debian/patches/fix-cmp0004-build-failure.dpatch
* Remove myself from Uploaders, as requested a while ago, done by Luk in
  his 2.2.0-2.1 NMU, which was never acknowledged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
                  rootNode(NULL),
24
24
                  m_numlights(0),
25
25
                  currentEffect(NULL),
 
26
                  currentInstance_effect(NULL),
26
27
                  geometryMap(),
27
28
                  materialMap(),
28
 
                  m_AuthoringTool(UNKNOWN)
 
29
                  m_AuthoringTool(UNKNOWN),
 
30
                  m_AssetUnitName("meter"),
 
31
                  m_AssetUnitMeter(1.0),
 
32
                  m_AssetUp_axis(UPAXISTYPE_Y_UP)
29
33
{
30
34
}
31
35
 
40
44
 
41
45
    daeInt count, result;
42
46
 
43
 
 
44
 
    std::string fURI;
45
 
    if ( fileURI[1] == ':' )
46
 
    {
47
 
        fURI = "/" + fileURI;
48
 
    }
49
 
    else
50
 
    {
51
 
        fURI = fileURI;
52
 
    }
53
 
    daeInt res = dae->load( fURI.c_str() );
 
47
    daeInt res = dae->load( fileURI.c_str() );
54
48
    
55
49
    if( res != DAE_OK && res != DAE_ERR_COLLECTION_ALREADY_EXISTS) 
56
50
    {
57
51
        osg::notify( osg::WARN ) << "Load failed in COLLADA DOM" << std::endl;
58
52
        return false;
59
53
    }
60
 
    osg::notify( osg::INFO ) << "URI loaded: " << fURI << std::endl;
 
54
    osg::notify( osg::INFO ) << "URI loaded: " << fileURI << std::endl;
61
55
 
62
 
    domCOLLADA* document = dae->getDom( fURI.c_str() );
 
56
    domCOLLADA* document = dae->getDom( fileURI.c_str() );
63
57
 
64
58
    if ( !document->getScene() || !document->getScene()->getInstance_visual_scene() ) 
65
59
    {
81
75
                    m_AuthoringTool = GOOGLE_SKETCHUP;
82
76
            }
83
77
        }
 
78
        if (document->getAsset()->getUnit())
 
79
        {
 
80
            if (NULL != document->getAsset()->getUnit()->getName())
 
81
                m_AssetUnitName = std::string(document->getAsset()->getUnit()->getName());
 
82
            if (0 != document->getAsset()->getUnit()->getMeter())
 
83
                m_AssetUnitMeter = document->getAsset()->getUnit()->getMeter();
 
84
        }
 
85
        if (document->getAsset()->getUp_axis())
 
86
            m_AssetUp_axis = document->getAsset()->getUp_axis()->getValue();
84
87
    }
85
88
 
86
89
    if (dae->getDatabase()) {
190
193
 
191
194
    // <rotate>
192
195
    osg::Quat osgRot;
193
 
    for (int i=0; i<node->getRotate_array().getCount(); i++) 
 
196
    for (unsigned int i=0; i<node->getRotate_array().getCount(); i++) 
194
197
    {
195
198
        daeSmartRef<domRotate> rot = node->getRotate_array().get(i);
196
199
        if (rot->getValue().getCount() != 4 ) {
208
211
 
209
212
    // <scale>
210
213
    osg::Vec3 osgScale = osg::Vec3(1.0, 1.0, 1.0);
211
 
    for (int i=0; i<node->getScale_array().getCount(); i++) 
 
214
    for (unsigned int i=0; i<node->getScale_array().getCount(); i++) 
212
215
    {
213
216
        daeSmartRef<domScale> scale = node->getScale_array().get(i);
214
217
 
226
229
 
227
230
    // <translate>
228
231
    osg::Vec3 osgTrans = osg::Vec3(0.0, 0.0, 0.0);
229
 
    for (int i=0; i<node->getTranslate_array().getCount(); i++) 
 
232
    for (unsigned int i=0; i<node->getTranslate_array().getCount(); i++) 
230
233
    {
231
234
        daeSmartRef<domTranslate> trans = node->getTranslate_array().get(i);
232
235