forked from mirror/openmw-tes3mp
Correct projectile rotation
This commit is contained in:
parent
d0a299caab
commit
4373fea21e
1 changed files with 15 additions and 13 deletions
|
@ -386,7 +386,6 @@ namespace MWWorld
|
||||||
static float fTargetSpellMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
static float fTargetSpellMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
||||||
.find("fTargetSpellMaxSpeed")->getFloat();
|
.find("fTargetSpellMaxSpeed")->getFloat();
|
||||||
float speed = fTargetSpellMaxSpeed * it->mSpeed;
|
float speed = fTargetSpellMaxSpeed * it->mSpeed;
|
||||||
|
|
||||||
osg::Vec3f direction = orient * osg::Vec3f(0,1,0);
|
osg::Vec3f direction = orient * osg::Vec3f(0,1,0);
|
||||||
direction.normalize();
|
direction.normalize();
|
||||||
osg::Vec3f pos(it->mNode->getPosition());
|
osg::Vec3f pos(it->mNode->getPosition());
|
||||||
|
@ -467,8 +466,9 @@ namespace MWWorld
|
||||||
|
|
||||||
osg::Quat orient;
|
osg::Quat orient;
|
||||||
|
|
||||||
|
if (it->mThrown)
|
||||||
orient.set(
|
orient.set(
|
||||||
osg::Matrixd::rotate(it->mThrown ? -1 * it->mEffectAnimationTime->getTime() * 10.0 : 0.0,osg::Vec3f(0,0,1)) *
|
osg::Matrixd::rotate(it->mEffectAnimationTime->getTime() * -10.0,osg::Vec3f(0,0,1)) *
|
||||||
osg::Matrixd::rotate(osg::PI / 2.0,osg::Vec3f(0,1,0)) *
|
osg::Matrixd::rotate(osg::PI / 2.0,osg::Vec3f(0,1,0)) *
|
||||||
osg::Matrixd::rotate(-1 * osg::PI / 2.0,osg::Vec3f(1,0,0)) *
|
osg::Matrixd::rotate(-1 * osg::PI / 2.0,osg::Vec3f(1,0,0)) *
|
||||||
osg::Matrixd::inverse(
|
osg::Matrixd::inverse(
|
||||||
|
@ -478,6 +478,8 @@ namespace MWWorld
|
||||||
osg::Vec3f(0,0,1))
|
osg::Vec3f(0,0,1))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
else
|
||||||
|
orient.makeRotate(osg::Vec3f(0,1,0), it->mVelocity);
|
||||||
|
|
||||||
it->mNode->setAttitude(orient);
|
it->mNode->setAttitude(orient);
|
||||||
it->mNode->setPosition(newPos);
|
it->mNode->setPosition(newPos);
|
||||||
|
|
Loading…
Reference in a new issue