mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 01:15:33 +00:00
Rotate thrown projectiles around the bb center
This commit is contained in:
parent
38bda3bd71
commit
d0a299caab
1 changed files with 7 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
#include <iostream>
|
||||
|
||||
#include <osg/PositionAttitudeTransform>
|
||||
#include <osg/ComputeBoundsVisitor>
|
||||
|
||||
#include <components/esm/esmwriter.hpp>
|
||||
#include <components/esm/projectilestate.hpp>
|
||||
|
@ -202,6 +203,12 @@ namespace MWWorld
|
|||
|
||||
osg::ref_ptr<osg::Node> projectile = mResourceSystem->getSceneManager()->getInstance(model, attachTo);
|
||||
|
||||
osg::ref_ptr<osg::ComputeBoundsVisitor> boundVisitor = new osg::ComputeBoundsVisitor();
|
||||
projectile->accept(*boundVisitor.get());
|
||||
osg::BoundingBox bb = boundVisitor->getBoundingBox();
|
||||
|
||||
state.mNode->setPivotPoint(bb.center());
|
||||
|
||||
if (state.mIdMagic.size() > 1)
|
||||
for (size_t iter = 1; iter != state.mIdMagic.size(); ++iter)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue