Changeset 13041 for OpenSceneGraph/trunk/include/osgAnimation/Vec3Packed
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgAnimation/Vec3Packed
r12139 r13041 1 /* -*-c++-*- 1 /* -*-c++-*- 2 2 */ 3 3 //****************************************************************************// … … 35 35 #include <osg/Math> 36 36 37 namespace osgAnimation 37 namespace osgAnimation 38 38 { 39 39 … … 46 46 Vec3Packed(): m32bits(0) {} 47 47 48 void uncompress(const osg::Vec3& scale, const osg::Vec3& min, osg::Vec3& result) const 48 void uncompress(const osg::Vec3& scale, const osg::Vec3& min, osg::Vec3& result) const 49 49 { 50 50 uint32_t pt[3]; … … 56 56 result[2] = scale[2] * pt[2] + min[2]; 57 57 } 58 59 void compress(const osg::Vec3f& src, const osg::Vec3f& min, const osg::Vec3f& scaleInv) 58 59 void compress(const osg::Vec3f& src, const osg::Vec3f& min, const osg::Vec3f& scaleInv) 60 60 { 61 61 uint32_t srci[3]; … … 74 74 osg::Vec3 mScaleInv; 75 75 76 void analyze(const std::vector<osg::Vec3>& src) 76 void analyze(const std::vector<osg::Vec3>& src) 77 77 { 78 78 //analyze the keys … … 80 80 osg::Vec3 maxp(-FLT_MAX, -FLT_MAX, -FLT_MAX); 81 81 int nb = (int)src.size(); 82 for(int i = 0; i < nb; i++) 82 for(int i = 0; i < nb; i++) 83 83 { 84 84 const osg::Vec3 &pos = src[i]; 85 for(int j = 0; j < 3; j++) 85 for(int j = 0; j < 3; j++) 86 86 { 87 87 maxp[j] = osg::maximum(pos[j],maxp[j]); … … 106 106 } 107 107 108 void compress(const std::vector<osg::Vec3>& src) 108 void compress(const std::vector<osg::Vec3>& src) 109 109 { 110 110 mVecCompressed.resize(src.size());
