Changeset 13041 for OpenSceneGraph/trunk/src/osgAnimation/MorphGeometry.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgAnimation/MorphGeometry.cpp
r12292 r13041 1 /* -*-c++-*- 1 /* -*-c++-*- 2 2 * Copyright (C) 2008 Cedric Pinson <cedric.pinson@plopbyte.net> 3 3 * … … 40 40 } 41 41 42 MorphGeometry::MorphGeometry(const osg::Geometry& b) : 42 MorphGeometry::MorphGeometry(const osg::Geometry& b) : 43 43 osg::Geometry(b, osg::CopyOp::DEEP_COPY_ARRAYS), 44 44 _dirty(false), … … 54 54 } 55 55 56 MorphGeometry::MorphGeometry(const MorphGeometry& b, const osg::CopyOp& copyop) : 56 MorphGeometry::MorphGeometry(const MorphGeometry& b, const osg::CopyOp& copyop) : 57 57 osg::Geometry(b,copyop), 58 58 _dirty(b._dirty), … … 91 91 normal->setDataVariance(osg::Object::DYNAMIC); 92 92 } 93 94 95 if (!_positionSource.empty()) 93 94 95 if (!_positionSource.empty()) 96 96 { 97 97 bool initialized = false; 98 if (_method == NORMALIZED) 98 if (_method == NORMALIZED) 99 99 { 100 100 // base * 1 - (sum of weights) + sum of (weight * target) … … 203 203 } 204 204 205 UpdateMorph::UpdateMorph(const UpdateMorph& apc,const osg::CopyOp& copyop) : 205 UpdateMorph::UpdateMorph(const UpdateMorph& apc,const osg::CopyOp& copyop) : 206 206 osg::Object(apc, copyop), 207 207 AnimationUpdateCallback<osg::NodeCallback>(apc, copyop) … … 209 209 } 210 210 211 UpdateMorph::UpdateMorph(const std::string& name) : AnimationUpdateCallback<osg::NodeCallback>(name) 211 UpdateMorph::UpdateMorph(const std::string& name) : AnimationUpdateCallback<osg::NodeCallback>(name) 212 212 { 213 213 } … … 216 216 void UpdateMorph::operator()(osg::Node* node, osg::NodeVisitor* nv) 217 217 { 218 if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) 218 if (nv && nv->getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR) 219 219 { 220 220 osg::Geode* geode = dynamic_cast<osg::Geode*>(node); … … 225 225 { 226 226 osgAnimation::MorphGeometry* morph = dynamic_cast<osgAnimation::MorphGeometry*>(geode->getDrawable(i)); 227 if (morph) 227 if (morph) 228 228 { 229 229 // Update morph weights
