- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/OpenFlight/PrimaryRecords.cpp
r11961 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 88 88 /*uint8 textureWhite =*/ in.readUInt8(); 89 89 /*uint32 flags =*/ in.readUInt32(); 90 90 91 91 in.forward( 4*6 ); 92 92 /*int32 projectionType =*/ in.readInt32(); … … 223 223 if ((document.version() < VERSION_15_8) && (_flags & SWING_ANIM)) 224 224 _forwardAnim = true; 225 225 226 226 // OpenFlight 15.8 adds backwards animations 227 227 _backwardAnim = ( (document.version() >= VERSION_15_8) && … … 260 260 if (_forwardAnim) 261 261 sequence->setInterval(loopMode, 0, -1); 262 else 262 else 263 263 sequence->setInterval(loopMode, -1, 0); 264 264 … … 394 394 float length_y = yAxis.normalize(); 395 395 float length_z = zAxis.normalize(); 396 396 397 397 if ((length_x*length_y*length_z)==0.0f) 398 398 { … … 401 401 OSG_NOTICE<<" pointOnXAxis="<<pointOnXAxis<<std::endl; 402 402 OSG_NOTICE<<" pointInXYPlane="<<pointInXYPlane<<std::endl; 403 403 404 404 xAxis.set(1.0f,0.0f,0.0f); 405 405 yAxis.set(0.0f,1.0f,0.0f); … … 411 411 412 412 // create putmatrix 413 osg::Matrix inv_putmat(xAxis.x(), xAxis.y(), xAxis.z(), 0.0, 413 osg::Matrix inv_putmat(xAxis.x(), xAxis.y(), xAxis.z(), 0.0, 414 414 yAxis.x(), yAxis.y(), yAxis.z(), 0.0, 415 415 zAxis.x(), zAxis.y(), zAxis.z(), 0.0, … … 464 464 465 465 /** LevelOfDetail - To recreate the LevelOfDetail record in OSG we have to create a LOD node with one Group node under it. 466 * OSG representation Children of the LevelOfDetail record will be added to 466 * OSG representation Children of the LevelOfDetail record will be added to 467 467 */ 468 468 class LevelOfDetail : public PrimaryRecord … … 604 604 { 605 605 unsigned int nChild = _multiSwitch->getNumChildren(); 606 for (unsigned int nMask=0; nMask<_numberOfMasks; ++nMask) 606 for (unsigned int nMask=0; nMask<_numberOfMasks; ++nMask) 607 607 { 608 608 // test if this child is active in the current mask (itMask) … … 917 917 /*uint32 flags =*/ in.readUInt32(); 918 918 } 919 919 920 920 // Postpone add-to-parent until we know a bit more. 921 921 } … … 1009 1009 float32 pitch = in.readFloat32(); 1010 1010 1011 _lightSource = new osg::LightSource; 1011 _lightSource = new osg::LightSource; 1012 1012 _lightSource->setName(id); 1013 1013 … … 1037 1037 1038 1038 _lightSource->setLight(light); 1039 _lightSource->setLocalStateSetModes((flags & ENABLED) ? osg::StateAttribute::ON : osg::StateAttribute::OFF); 1039 _lightSource->setLocalStateSetModes((flags & ENABLED) ? osg::StateAttribute::ON : osg::StateAttribute::OFF); 1040 1040 1041 1041 // Global light.
