Changeset 13041 for OpenSceneGraph/trunk/src/osgSim/DOFTransform.cpp
- Timestamp:
- 03/21/12 18:36:20 (15 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgSim/DOFTransform.cpp (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgSim/DOFTransform.cpp
r12056 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 */ … … 30 30 _previousTraversalNumber(osg::UNINITIALIZED_FRAME_NUMBER), 31 31 _previousTime(0.0), 32 _limitationFlags(0), 33 _animationOn(false), 32 _limitationFlags(0), 33 _animationOn(false), 34 34 _increasingFlags(0xffff), 35 35 _multOrder(PRH) … … 60 60 _multOrder(dof._multOrder) 61 61 { 62 if (_animationOn) setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1); 62 if (_animationOn) setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+1); 63 63 } 64 64 … … 77 77 78 78 _previousTraversalNumber = nv.getTraversalNumber(); 79 _previousTime = newTime; 79 _previousTime = newTime; 80 80 } 81 81 } … … 90 90 91 91 //now the current matrix: 92 osg::Matrix current; 92 osg::Matrix current; 93 93 current.makeTranslate(getCurrentTranslate()); 94 94 … … 147 147 else 148 148 { 149 matrix = l2w; 150 } 151 149 matrix = l2w; 150 } 151 152 152 return true; 153 153 } … … 160 160 161 161 //now the current matrix: 162 osg::Matrix current; 162 osg::Matrix current; 163 163 current.makeTranslate(-getCurrentTranslate()); 164 164 … … 227 227 if (_limitationFlags & ROTATION_ROLL_LIMIT_BIT) 228 228 { 229 //if we have min == max, it is efective constrain, so don't change 229 //if we have min == max, it is efective constrain, so don't change 230 230 if(_minHPR[2] != _maxHPR[2]) 231 231 { … … 235 235 if(_currentHPR[2] < _minHPR[2]) 236 236 { 237 _currentHPR[2] = _minHPR[2]; 237 _currentHPR[2] = _minHPR[2]; 238 238 //force increasing flag to 1 239 239 _increasingFlags |= this_flag; … … 284 284 unsigned short this_flag = (unsigned short)1<<5;//heading 285 285 286 if(_currentHPR[0] < _minHPR[0]) 286 if(_currentHPR[0] < _minHPR[0]) 287 287 { 288 288 _currentHPR[0] = _minHPR[0]; 289 289 _increasingFlags |= this_flag; 290 290 } 291 else if(_currentHPR[0] > _maxHPR[0]) 291 else if(_currentHPR[0] > _maxHPR[0]) 292 292 { 293 293 _currentHPR[0] = _maxHPR[0]; … … 319 319 _increasingFlags |= this_flag; 320 320 } 321 else if(_currentTranslate[2] > _maxTranslate[2]) 321 else if(_currentTranslate[2] > _maxTranslate[2]) 322 322 { 323 323 _currentTranslate[2] = _maxTranslate[2]; … … 343 343 _increasingFlags |= this_flag; 344 344 } 345 else if(_currentTranslate[1] > _maxTranslate[1]) 345 else if(_currentTranslate[1] > _maxTranslate[1]) 346 346 { 347 347 _currentTranslate[1] = _maxTranslate[1]; … … 362 362 unsigned short this_flag = (unsigned short)1; 363 363 364 if(_currentTranslate[0] < _minTranslate[0]) 364 if(_currentTranslate[0] < _minTranslate[0]) 365 365 { 366 366 _currentTranslate[0] = _minTranslate[0]; 367 367 _increasingFlags |= this_flag; 368 368 } 369 else if(_currentTranslate[0] > _maxTranslate[0]) 369 else if(_currentTranslate[0] > _maxTranslate[0]) 370 370 { 371 371 _currentTranslate[0] = _maxTranslate[0]; … … 373 373 } 374 374 } 375 } 375 } 376 376 else 377 377 { … … 388 388 { 389 389 if(_minScale[2] != _maxScale[2]) 390 { 390 { 391 391 _currentScale[2] = scale[2]; 392 392 unsigned short this_flag = (unsigned short)1<<8; 393 393 394 if(_currentScale[2] < _minScale[2]) 394 if(_currentScale[2] < _minScale[2]) 395 395 { 396 396 _currentScale[2] = _minScale[2]; 397 397 _increasingFlags |= this_flag; 398 398 } 399 else if(_currentScale[2] > _maxScale[2]) 399 else if(_currentScale[2] > _maxScale[2]) 400 400 { 401 401 _currentScale[2] = _maxScale[2]; … … 416 416 unsigned short this_flag = (unsigned short)1<<7; 417 417 418 if(_currentScale[1] < _minScale[1]) 418 if(_currentScale[1] < _minScale[1]) 419 419 { 420 420 _currentScale[1] = _minScale[1]; 421 421 _increasingFlags |= this_flag; 422 422 } 423 else if(_currentScale[1] > _maxScale[1]) 423 else if(_currentScale[1] > _maxScale[1]) 424 424 { 425 425 _currentScale[1] = _maxScale[1]; … … 440 440 unsigned short this_flag = (unsigned short)1<<6; 441 441 442 if(_currentScale[0] < _minScale[0]) 442 if(_currentScale[0] < _minScale[0]) 443 443 { 444 444 _currentScale[0] = _minScale[0]; 445 445 _increasingFlags |= this_flag; 446 446 } 447 else if(_currentScale[0] > _maxScale[0]) 447 else if(_currentScale[0] > _maxScale[0]) 448 448 { 449 449 _currentScale[0] = _maxScale[0]; … … 463 463 { 464 464 if (_animationOn == do_animate) return; 465 465 466 466 int delta = 0; 467 467 … … 470 470 471 471 _animationOn = do_animate; 472 472 473 473 if (_animationOn) setNumChildrenRequiringUpdateTraversal(getNumChildrenRequiringUpdateTraversal()+delta); 474 474 } … … 535 535 536 536 updateCurrentScale(new_value); 537 538 } 537 538 }
