mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 03:40:14 +00:00
Merge branch 'animation_osg_ref_ptr' into 'master'
Avoid using owning raw pointer See merge request OpenMW/openmw!2322
This commit is contained in:
commit
a99c78c85f
@ -1734,7 +1734,7 @@ namespace MWRender
|
||||
mRootController = addRotateController("bip01");
|
||||
}
|
||||
|
||||
RotateController* Animation::addRotateController(const std::string &bone)
|
||||
osg::ref_ptr<RotateController> Animation::addRotateController(const std::string &bone)
|
||||
{
|
||||
auto iter = getNodeMap().find(bone);
|
||||
if (iter == getNodeMap().end())
|
||||
@ -1757,7 +1757,7 @@ namespace MWRender
|
||||
if (!foundKeyframeCtrl)
|
||||
return nullptr;
|
||||
|
||||
RotateController* controller = new RotateController(mObjectRoot.get());
|
||||
osg::ref_ptr<RotateController> controller(new RotateController(mObjectRoot.get()));
|
||||
node->addUpdateCallback(controller);
|
||||
mActiveControllers.emplace_back(node, controller);
|
||||
return controller;
|
||||
|
@ -274,7 +274,7 @@ protected:
|
||||
float mLegsYawRadians;
|
||||
float mBodyPitchRadians;
|
||||
|
||||
RotateController* addRotateController(const std::string& bone);
|
||||
osg::ref_ptr<RotateController> addRotateController(const std::string& bone);
|
||||
|
||||
bool mHasMagicEffects;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user