|
|
@ -600,27 +600,26 @@ osg::Vec3f AimDirToMovingTarget(const MWWorld::Ptr& actor, const MWWorld::Ptr& t
|
|
|
|
float duration, int weapType, float strength)
|
|
|
|
float duration, int weapType, float strength)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
float projSpeed;
|
|
|
|
float projSpeed;
|
|
|
|
|
|
|
|
const MWWorld::Store<ESM::GameSetting>& gmst = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
|
|
|
|
|
|
|
|
|
|
|
|
// get projectile speed (depending on weapon type)
|
|
|
|
// get projectile speed (depending on weapon type)
|
|
|
|
if (weapType == ESM::Weapon::MarksmanThrown)
|
|
|
|
if (weapType == ESM::Weapon::MarksmanThrown)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static float fThrownWeaponMinSpeed =
|
|
|
|
static float fThrownWeaponMinSpeed = gmst.find("fThrownWeaponMinSpeed")->getFloat();
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fThrownWeaponMinSpeed")->getFloat();
|
|
|
|
static float fThrownWeaponMaxSpeed = gmst.find("fThrownWeaponMaxSpeed")->getFloat();
|
|
|
|
static float fThrownWeaponMaxSpeed =
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fThrownWeaponMaxSpeed")->getFloat();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
projSpeed =
|
|
|
|
projSpeed = fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * strength;
|
|
|
|
fThrownWeaponMinSpeed + (fThrownWeaponMaxSpeed - fThrownWeaponMinSpeed) * strength;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (weapType != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static float fProjectileMinSpeed =
|
|
|
|
static float fProjectileMinSpeed = gmst.find("fProjectileMinSpeed")->getFloat();
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fProjectileMinSpeed")->getFloat();
|
|
|
|
static float fProjectileMaxSpeed = gmst.find("fProjectileMaxSpeed")->getFloat();
|
|
|
|
static float fProjectileMaxSpeed =
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fProjectileMaxSpeed")->getFloat();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
projSpeed =
|
|
|
|
projSpeed = fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * strength;
|
|
|
|
fProjectileMinSpeed + (fProjectileMaxSpeed - fProjectileMinSpeed) * strength;
|
|
|
|
}
|
|
|
|
|
|
|
|
else // weapType is 0 ==> it's a target spell projectile
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
projSpeed = gmst.find("fTargetSpellMaxSpeed")->getFloat();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// idea: perpendicular to dir to target speed components of target move vector and projectile vector should be the same
|
|
|
|
// idea: perpendicular to dir to target speed components of target move vector and projectile vector should be the same
|
|
|
|