Changeset 118
- Timestamp:
- Jul 5, 2005, 9:27:04 PM (19 years ago)
- Location:
- Swollen
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Swollen/swollen/state.cpp
r116 r118 30 30 s << _timestep << " "; 31 31 32 for( unsigned int i = 0; i < 16; i++ )33 s << *(_matrix.ptr()+i) << " ";32 s << _position.x() << " " << _position.y() << " " << _position.z() << " "; 33 s << _orientation.x() << " " << _orientation.y() << " " << _orientation.z() << " " << _orientation.w() << " "; 34 34 35 35 s << _culling << " "; … … 44 44 s >> _timestep; 45 45 46 for( unsigned int i = 0; i < 16; i++ )47 s >> *(_matrix.ptr()+i);46 s >> _position.x() >> _position.y() >> _position.z(); 47 s >> _orientation.x() >> _orientation.y() >> _orientation.z() >> _orientation.w(); 48 48 49 49 s >> _culling; 50 50 s >> _wireframe; 51 } 52 53 54 void State::setMatrix(osg::Matrix m) 55 { 56 m.get(_orientation); 57 _position = m.getTrans(); 58 59 } 60 61 osg::Matrix State::getMatrix() 62 { 63 osg::Matrix m; 64 m.set(_orientation); 65 m.setTrans(_position); 66 return m; 51 67 } 52 68 -
Swollen/swollen/state.h
r116 r118 57 57 virtual void setCulling(bool value){ _culling = value; } 58 58 virtual void setWireframe(bool value){ _wireframe = value; } 59 virtual void setMatrix(osg::Matrix value) { _matrix = value; }59 virtual void setMatrix(osg::Matrix value); 60 60 61 61 virtual double getTime(){ return _time; } … … 63 63 //virtual osg::Vec3 getPosition(){ return _position; } 64 64 //virtual osg::Quat getOrientation(){ return _orientation; } 65 virtual osg::Matrix getMatrix() { return _matrix; }65 virtual osg::Matrix getMatrix(); 66 66 virtual bool getCulling(){ return _culling; } 67 67 virtual bool getWireframe(){ return _wireframe; } … … 77 77 double _time; 78 78 unsigned int _timestep; 79 //osg::Vec3d _position;80 //osg::Quat _orientation;81 osg::Matrix _matrix;79 osg::Vec3d _position; 80 osg::Quat _orientation; 81 //osg::Matrix _matrix; 82 82 bool _culling; 83 83 bool _wireframe; … … 96 96 virtual bool write(std::string filename); 97 97 //virtual void read(std::string filename); 98 99 98 //virtual ~StateList(); 100 99
Note: See TracChangeset
for help on using the changeset viewer.