From 3dbcda6686deb5fd31d0a1992eb36884b4b369ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Thu, 23 Nov 2017 15:14:15 +0100 Subject: [PATCH] Make use of mEffectAnimationTime for projectile rotation --- apps/openmw/mwworld/projectilemanager.cpp | 6 +----- apps/openmw/mwworld/projectilemanager.hpp | 1 - components/esm/projectilestate.cpp | 4 ---- components/esm/projectilestate.hpp | 1 - 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index 1c080aec1..d38931700 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -317,7 +317,6 @@ namespace MWWorld state.mCasterHandle = actor; state.mAttackStrength = attackStrength; state.mThrown = projectile.get()->mBase->mData.mType == ESM::Weapon::MarksmanThrown; - state.mTime = 0.0; MWWorld::ManualRef ref(MWBase::Environment::get().getWorld()->getStore(), projectile.getCellRef().getRefId()); MWWorld::Ptr ptr = ref.getPtr(); @@ -455,7 +454,6 @@ namespace MWWorld // gravity constant - must be way lower than the gravity affecting actors, since we're not // simulating aerodynamics at all it->mVelocity -= osg::Vec3f(0, 0, 627.2f * 0.1f) * duration; - it->mTime += duration; osg::Vec3f pos(it->mNode->getPosition()); osg::Vec3f newPos = pos + it->mVelocity * duration; @@ -463,7 +461,7 @@ namespace MWWorld osg::Quat orient; orient.set( - osg::Matrixd::rotate(it->mThrown ? -1 * it->mTime : 0.0,osg::Vec3f(0,0,1)) * + osg::Matrixd::rotate(it->mThrown ? -1 * it->mEffectAnimationTime->getTime() * 10.0 : 0.0,osg::Vec3f(0,0,1)) * 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::inverse( @@ -568,7 +566,6 @@ namespace MWWorld state.mAttackStrength = it->mAttackStrength; state.mThrown = it->mThrown; - state.mTime = it->mTime; state.save(writer); @@ -608,7 +605,6 @@ namespace MWWorld state.mIdArrow = esm.mId; state.mAttackStrength = esm.mAttackStrength; state.mThrown = esm.mThrown; - state.mTime = esm.mTime; std::string model; try diff --git a/apps/openmw/mwworld/projectilemanager.hpp b/apps/openmw/mwworld/projectilemanager.hpp index 1e0de4dbe..ba2fe7a74 100644 --- a/apps/openmw/mwworld/projectilemanager.hpp +++ b/apps/openmw/mwworld/projectilemanager.hpp @@ -112,7 +112,6 @@ namespace MWWorld osg::Vec3f mVelocity; float mAttackStrength; - float mTime; bool mThrown; }; diff --git a/components/esm/projectilestate.cpp b/components/esm/projectilestate.cpp index 1c8a10bcb..7b6c419f2 100644 --- a/components/esm/projectilestate.cpp +++ b/components/esm/projectilestate.cpp @@ -53,7 +53,6 @@ namespace ESM esm.writeHNT ("VEL_", mVelocity); esm.writeHNT ("STR_", mAttackStrength); esm.writeHNT ("THR_", mThrown); - esm.writeHNT ("TIM_", mTime); } void ProjectileState::load(ESMReader &esm) @@ -68,9 +67,6 @@ namespace ESM mThrown = false; esm.getHNOT (mThrown, "THR_"); - - mTime = 0.f; - esm.getHNOT (mTime, "TIM_"); } } diff --git a/components/esm/projectilestate.hpp b/components/esm/projectilestate.hpp index 625d34b6a..c89bb7683 100644 --- a/components/esm/projectilestate.hpp +++ b/components/esm/projectilestate.hpp @@ -42,7 +42,6 @@ namespace ESM std::string mBowId; Vector3 mVelocity; float mAttackStrength; - float mTime; bool mThrown; void load (ESMReader &esm);