Revision 13041, 1.7 kB
(checked in by robert, 5 years ago)

Ran script to remove trailing spaces and tabs


Property svn:eolstyle set to
native

Property svn:keywords set to
Author Date Id Revision

Line  

1  

2  

3  

4  

5  

6  

7  

8  

9  

10  

11  

12  

13  #include <osg/MatrixTransform> 

14  

15  using namespace osg; 

16  

17  MatrixTransform::MatrixTransform(): 

18  _inverseDirty(false) 

19  { 

20  } 

21  

22  MatrixTransform::MatrixTransform(const MatrixTransform& transform,const CopyOp& copyop): 

23  Transform(transform,copyop), 

24  _matrix(transform._matrix), 

25  _inverse(transform._inverse), 

26  _inverseDirty(transform._inverseDirty) 

27  { 

28  } 

29  

30  MatrixTransform::MatrixTransform(const Matrix& mat ) 

31  { 

32  _referenceFrame = RELATIVE_RF; 

33  

34  _matrix = mat; 

35  _inverseDirty = true; 

36  } 

37  

38  

39  MatrixTransform::~MatrixTransform() 

40  { 

41  } 

42  

43  bool MatrixTransform::computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor*) const 

44  { 

45  if (_referenceFrame==RELATIVE_RF) 

46  { 

47  matrix.preMult(_matrix); 

48  } 

49  else 

50  { 

51  matrix = _matrix; 

52  } 

53  return true; 

54  } 

55  

56  bool MatrixTransform::computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor*) const 

57  { 

58  const Matrix& inverse = getInverseMatrix(); 

59  

60  if (_referenceFrame==RELATIVE_RF) 

61  { 

62  matrix.postMult(inverse); 

63  } 

64  else 

65  { 

66  matrix = inverse; 

67  } 

68  return true; 

69  } 
