Compare commits
17
Commits
main
...
openmw-0.45.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e29e3248fc | ||
|
|
1f3813a230 | ||
|
|
80651fefed | ||
|
|
a66b6549b7 | ||
|
|
c22ce5a71f | ||
|
|
f154307750 | ||
|
|
d19ee56966 | ||
|
|
e9a6f8a4bb | ||
|
|
938bdfe728 | ||
|
|
442e9898e2 | ||
|
|
97f410bc50 | ||
|
|
03437b712b | ||
|
|
bcae99b6f5 | ||
|
|
d551221557 | ||
|
|
d7558d0c76 | ||
|
|
de381d0d49 | ||
|
|
a93fa8fcc7 |
+2
-1
@@ -54,7 +54,7 @@ endif()
|
||||
message(STATUS "Configuring OpenMW...")
|
||||
|
||||
set(OPENMW_VERSION_MAJOR 0)
|
||||
set(OPENMW_VERSION_MINOR 44)
|
||||
set(OPENMW_VERSION_MINOR 45)
|
||||
set(OPENMW_VERSION_RELEASE 0)
|
||||
|
||||
set(OPENMW_VERSION_COMMITHASH "")
|
||||
@@ -204,6 +204,7 @@ include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS})
|
||||
set(USED_OSG_PLUGINS
|
||||
osgdb_bmp
|
||||
osgdb_dds
|
||||
osgdb_freetype
|
||||
osgdb_jpeg
|
||||
osgdb_osg
|
||||
osgdb_png
|
||||
|
||||
@@ -7,7 +7,7 @@ OpenMW is an open-source game engine that supports playing Morrowind by Bethesda
|
||||
|
||||
OpenMW also comes with OpenMW-CS, a replacement for Bethesda's Construction Set.
|
||||
|
||||
* Version: 0.44.0
|
||||
* Version: 0.45.0
|
||||
* License: GPLv3 (see [LICENSE](https://github.com/OpenMW/openmw/blob/master/LICENSE) for more information)
|
||||
* Website: https://www.openmw.org
|
||||
* IRC: #openmw on irc.freenode.net
|
||||
|
||||
@@ -113,17 +113,22 @@ namespace CSMWorld
|
||||
const std::string ActorAdapter::ActorData::getPart(ESM::PartReferenceType index) const
|
||||
{
|
||||
auto it = mParts.find(index);
|
||||
if (it == mParts.end() && mRaceData && mRaceData->handlesPart(index))
|
||||
if (it == mParts.end())
|
||||
{
|
||||
if (mFemale)
|
||||
if (mRaceData && mRaceData->handlesPart(index))
|
||||
{
|
||||
// Note: we should use male parts for females as fallback
|
||||
const std::string femalePart = mRaceData->getFemalePart(index);
|
||||
if (!femalePart.empty())
|
||||
return femalePart;
|
||||
if (mFemale)
|
||||
{
|
||||
// Note: we should use male parts for females as fallback
|
||||
const std::string femalePart = mRaceData->getFemalePart(index);
|
||||
if (!femalePart.empty())
|
||||
return femalePart;
|
||||
}
|
||||
|
||||
return mRaceData->getMalePart(index);
|
||||
}
|
||||
|
||||
return mRaceData->getMalePart(index);
|
||||
return "";
|
||||
}
|
||||
|
||||
const std::string& partName = it->second.first;
|
||||
@@ -514,6 +519,10 @@ namespace CSMWorld
|
||||
RaceDataPtr raceData = getRaceData(npc.mRace);
|
||||
data->reset_data(id, "", false, !npc.isMale(), raceData);
|
||||
|
||||
// Add head and hair
|
||||
data->setPart(ESM::PRT_Head, npc.mHead, 0);
|
||||
data->setPart(ESM::PRT_Hair, npc.mHair, 0);
|
||||
|
||||
// Add inventory items
|
||||
for (auto& item : npc.mInventory.mList)
|
||||
{
|
||||
@@ -521,10 +530,6 @@ namespace CSMWorld
|
||||
std::string itemId = item.mItem.toString();
|
||||
addNpcItem(itemId, data);
|
||||
}
|
||||
|
||||
// Add head and hair
|
||||
data->setPart(ESM::PRT_Head, npc.mHead, 0);
|
||||
data->setPart(ESM::PRT_Hair, npc.mHair, 0);
|
||||
}
|
||||
|
||||
void ActorAdapter::addNpcItem(const std::string& itemId, ActorDataPtr data)
|
||||
@@ -558,6 +563,10 @@ namespace CSMWorld
|
||||
partId = part.mMale;
|
||||
|
||||
data->setPart(partType, partId, priority);
|
||||
|
||||
// An another vanilla quirk: hide hairs if an item replaces Head part
|
||||
if (partType == ESM::PRT_Head)
|
||||
data->setPart(ESM::PRT_Hair, "", priority);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ void CSVWidget::ColorEditor::setColor(const int colorInt)
|
||||
void CSVWidget::ColorEditor::showPicker()
|
||||
{
|
||||
mColorPicker->showPicker(calculatePopupPosition(), mColor);
|
||||
emit pickingFinished();
|
||||
}
|
||||
|
||||
void CSVWidget::ColorEditor::pickerColorChanged(const QColor &color)
|
||||
|
||||
@@ -39,7 +39,8 @@ void CSVWidget::ColorPickerPopup::showPicker(const QPoint &position, const QColo
|
||||
|
||||
// Calling getColor() creates a blocking dialog that will continue execution once the user chooses OK or Cancel
|
||||
QColor color = mColorPicker->getColor(initialColor);
|
||||
mColorPicker->setCurrentColor(color);
|
||||
if (color.isValid())
|
||||
mColorPicker->setCurrentColor(color);
|
||||
}
|
||||
|
||||
void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace MWBase
|
||||
|
||||
virtual bool castRay (float x1, float y1, float z1, float x2, float y2, float z2) = 0;
|
||||
|
||||
virtual void setActorCollisionMode(const MWWorld::Ptr& ptr, bool enabled) = 0;
|
||||
virtual void setActorCollisionMode(const MWWorld::Ptr& ptr, bool internal, bool external) = 0;
|
||||
virtual bool isActorCollisionEnabled(const MWWorld::Ptr& ptr) = 0;
|
||||
|
||||
virtual bool toggleCollisionMode() = 0;
|
||||
|
||||
@@ -935,8 +935,12 @@ namespace MWClass
|
||||
|
||||
const float normalizedEncumbrance = getNormalizedEncumbrance(ptr);
|
||||
|
||||
bool sneaking = MWBase::Environment::get().getMechanicsManager()->isSneaking(ptr) && stats.getStance(MWMechanics::CreatureStats::Stance_Sneak);
|
||||
bool running = MWBase::Environment::get().getMechanicsManager()->isRunning(ptr) && stats.getStance(MWMechanics::CreatureStats::Stance_Run);
|
||||
bool swimming = world->isSwimming(ptr);
|
||||
bool inair = !world->isOnGround(ptr) && !swimming && !world->isFlying(ptr);
|
||||
bool sneaking = stats.getStance(MWMechanics::CreatureStats::Stance_Sneak);
|
||||
sneaking = sneaking && (inair || MWBase::Environment::get().getMechanicsManager()->isSneaking(ptr));
|
||||
bool running = stats.getStance(MWMechanics::CreatureStats::Stance_Run);
|
||||
running = running && (inair || MWBase::Environment::get().getMechanicsManager()->isRunning(ptr));
|
||||
|
||||
float walkSpeed = gmst.fMinWalkSpeed->mValue.getFloat() + 0.01f*npcdata->mNpcStats.getAttribute(ESM::Attribute::Speed).getModified()*
|
||||
(gmst.fMaxWalkSpeed->mValue.getFloat() - gmst.fMinWalkSpeed->mValue.getFloat());
|
||||
@@ -961,7 +965,7 @@ namespace MWClass
|
||||
flySpeed = std::max(0.0f, flySpeed);
|
||||
moveSpeed = flySpeed;
|
||||
}
|
||||
else if (world->isSwimming(ptr))
|
||||
else if (swimming)
|
||||
{
|
||||
float swimSpeed = walkSpeed;
|
||||
if(running)
|
||||
@@ -971,7 +975,7 @@ namespace MWClass
|
||||
gmst.fSwimRunAthleticsMult->mValue.getFloat();
|
||||
moveSpeed = swimSpeed;
|
||||
}
|
||||
else if (running)
|
||||
else if (running && !sneaking)
|
||||
moveSpeed = runSpeed;
|
||||
else
|
||||
moveSpeed = walkSpeed;
|
||||
|
||||
@@ -554,7 +554,7 @@ namespace
|
||||
mQuestMode = true;
|
||||
|
||||
setVisible (LeftTopicIndex, false);
|
||||
setVisible (CenterTopicIndex, true);
|
||||
setVisible (CenterTopicIndex, false);
|
||||
setVisible (RightTopicIndex, false);
|
||||
setVisible (TopicsList, false);
|
||||
setVisible (QuestsList, true);
|
||||
|
||||
@@ -1453,7 +1453,7 @@ namespace MWMechanics
|
||||
if (!inRange)
|
||||
{
|
||||
iter->first.getRefData().getBaseNode()->setNodeMask(0);
|
||||
world->setActorCollisionMode(iter->first, false);
|
||||
world->setActorCollisionMode(iter->first, false, false);
|
||||
continue;
|
||||
}
|
||||
else if (!isPlayer)
|
||||
@@ -1470,7 +1470,7 @@ namespace MWMechanics
|
||||
continue;
|
||||
}
|
||||
|
||||
world->setActorCollisionMode(iter->first, true);
|
||||
world->setActorCollisionMode(iter->first, true, !iter->first.getClass().getCreatureStats(iter->first).isDeathAnimationFinished());
|
||||
ctrl->update(duration);
|
||||
|
||||
// Fade away actors on large distance (>90% of actor's processing distance)
|
||||
|
||||
@@ -22,7 +22,7 @@ bool isWithinMaxRange(const osg::Vec3f& pos1, const osg::Vec3f& pos2)
|
||||
// Maximum travel distance for vanilla compatibility.
|
||||
// Was likely meant to prevent NPCs walking into non-loaded exterior cells, but for some reason is used in interior cells as well.
|
||||
// We can make this configurable at some point, but the default *must* be the below value. Anything else will break shoddily-written content (*cough* MW *cough*) in bizarre ways.
|
||||
bool aiDistance = MWBase::Environment::get().getMechanicsManager()->getActorsProcessingRange();
|
||||
float aiDistance = MWBase::Environment::get().getMechanicsManager()->getActorsProcessingRange();
|
||||
return (pos1 - pos2).length2() <= aiDistance*aiDistance;
|
||||
}
|
||||
|
||||
|
||||
@@ -352,15 +352,14 @@ void CharacterController::refreshHitRecoilAnims(CharacterState& idle)
|
||||
idle = CharState_None;
|
||||
}
|
||||
|
||||
void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState jump, CharacterState& idle, CharacterState& movement, bool force)
|
||||
void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState jump, CharacterState& idle, bool force)
|
||||
{
|
||||
if (!force && jump == mJumpState && idle == CharState_None && movement == CharState_None)
|
||||
if (!force && jump == mJumpState && idle == CharState_None)
|
||||
return;
|
||||
|
||||
if (jump != JumpState_None && !(mPtr == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->isFirstPerson())) // FIXME
|
||||
if (jump == JumpState_InAir)
|
||||
{
|
||||
idle = CharState_None;
|
||||
movement = CharState_None;
|
||||
}
|
||||
|
||||
std::string jumpAnimName;
|
||||
@@ -391,6 +390,7 @@ void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState
|
||||
if (!force && jump == mJumpState)
|
||||
return;
|
||||
|
||||
bool startAtLoop = (jump == mJumpState);
|
||||
mJumpState = jump;
|
||||
|
||||
if (!mCurrentJump.empty())
|
||||
@@ -404,7 +404,7 @@ void CharacterController::refreshJumpAnims(const WeaponInfo* weap, JumpingState
|
||||
if (mAnimation->hasAnimation(jumpAnimName))
|
||||
{
|
||||
mAnimation->play(jumpAnimName, Priority_Jump, jumpmask, false,
|
||||
1.0f, "start", "stop", 0.f, ~0ul);
|
||||
1.0f, startAtLoop ? "loop start" : "start", "stop", 0.f, ~0ul);
|
||||
mCurrentJump = jumpAnimName;
|
||||
}
|
||||
}
|
||||
@@ -446,11 +446,10 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
||||
|
||||
if(!mAnimation->hasAnimation(movementAnimName))
|
||||
{
|
||||
movemask = MWRender::Animation::BlendMask_LowerBody;
|
||||
movementAnimName = movestate->groupname;
|
||||
|
||||
if (swimpos == std::string::npos)
|
||||
{
|
||||
movemask = MWRender::Animation::BlendMask_LowerBody;
|
||||
// Since we apply movement only for lower body, do not reset idle animations.
|
||||
// For upper body there will be idle animation.
|
||||
if (idle == CharState_None)
|
||||
@@ -462,7 +461,11 @@ void CharacterController::refreshMovementAnims(const WeaponInfo* weap, Character
|
||||
}
|
||||
else if (idle == CharState_None)
|
||||
{
|
||||
idle = CharState_IdleSwim;
|
||||
// In the 1st-person mode use ground idle animations as fallback
|
||||
if (mPtr == getPlayer() && MWBase::Environment::get().getWorld()->isFirstPerson())
|
||||
idle = CharState_Idle;
|
||||
else
|
||||
idle = CharState_IdleSwim;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -642,7 +645,7 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
||||
if (!mPtr.getClass().hasInventoryStore(mPtr))
|
||||
weap = sWeaponTypeListEnd;
|
||||
|
||||
refreshJumpAnims(weap, jump, idle, movement, force);
|
||||
refreshJumpAnims(weap, jump, idle, force);
|
||||
refreshMovementAnims(weap, movement, idle, force);
|
||||
|
||||
// idle handled last as it can depend on the other states
|
||||
@@ -1247,6 +1250,7 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
|
||||
|
||||
std::string upSoundId;
|
||||
std::string downSoundId;
|
||||
bool weaponChanged = false;
|
||||
if (mPtr.getClass().hasInventoryStore(mPtr))
|
||||
{
|
||||
MWWorld::InventoryStore &inv = cls.getInventoryStore(mPtr);
|
||||
@@ -1264,7 +1268,13 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
|
||||
if(weapon == inv.end() && !mWeapon.isEmpty() && weaptype == WeapType_HandToHand && mWeaponType != WeapType_Spell)
|
||||
downSoundId = mWeapon.getClass().getDownSoundId(mWeapon);
|
||||
|
||||
mWeapon = weapon != inv.end() ? *weapon : MWWorld::Ptr();
|
||||
MWWorld::Ptr newWeapon = weapon != inv.end() ? *weapon : MWWorld::Ptr();
|
||||
|
||||
if (mWeapon != newWeapon)
|
||||
{
|
||||
mWeapon = newWeapon;
|
||||
weaponChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Use blending only with 3d-person movement animations for bipedal actors
|
||||
@@ -1299,9 +1309,8 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
|
||||
&& mUpperBodyState != UpperCharState_UnEquipingWeap
|
||||
&& !isStillWeapon)
|
||||
{
|
||||
// We can not play un-equip animation when we switch to HtH
|
||||
// because we already un-equipped weapon
|
||||
if (weaptype != WeapType_HandToHand || mWeaponType == WeapType_Spell)
|
||||
// We can not play un-equip animation if weapon changed since last update
|
||||
if (!weaponChanged)
|
||||
{
|
||||
// Note: we do not disable unequipping animation automatically to avoid body desync
|
||||
getWeaponGroup(mWeaponType, weapgroup);
|
||||
@@ -1618,8 +1627,12 @@ bool CharacterController::updateWeaponState(CharacterState& idle)
|
||||
idle = CharState_None;
|
||||
|
||||
// In other cases we should not break swim and sneak animations
|
||||
if (resetIdle && mIdleState != CharState_IdleSneak && mIdleState != CharState_IdleSwim)
|
||||
if (resetIdle &&
|
||||
idle != CharState_IdleSneak && idle != CharState_IdleSwim &&
|
||||
mIdleState != CharState_IdleSneak && mIdleState != CharState_IdleSwim)
|
||||
{
|
||||
idle = CharState_None;
|
||||
}
|
||||
|
||||
animPlaying = mAnimation->getInfo(mCurrentWeapon, &complete);
|
||||
if(mUpperBodyState == UpperCharState_MinAttackToMaxAttack && !isKnockedDown())
|
||||
@@ -1993,6 +2006,7 @@ void CharacterController::update(float duration, bool animationOnly)
|
||||
vec.z() = 0.0f;
|
||||
|
||||
bool inJump = true;
|
||||
bool playLandingSound = false;
|
||||
if(!onground && !flying && !inwater)
|
||||
{
|
||||
// In the air (either getting up —ascending part of jump— or falling).
|
||||
@@ -2080,32 +2094,20 @@ void CharacterController::update(float duration, bool animationOnly)
|
||||
}
|
||||
}
|
||||
|
||||
// Play landing sound for NPCs
|
||||
if (mPtr.getClass().isNpc())
|
||||
{
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
std::string sound = "DefaultLand";
|
||||
osg::Vec3f pos(mPtr.getRefData().getPosition().asVec3());
|
||||
if (world->isUnderwater(mPtr.getCell(), pos) || world->isWalkingOnWater(mPtr))
|
||||
sound = "DefaultLandWater";
|
||||
|
||||
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
|
||||
}
|
||||
playLandingSound = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mPtr.getClass().isNpc() && mJumpState == JumpState_InAir && !flying)
|
||||
playLandingSound = true;
|
||||
|
||||
jumpstate = mAnimation->isPlaying(mCurrentJump) ? JumpState_Landing : JumpState_None;
|
||||
|
||||
vec.z() = 0.0f;
|
||||
|
||||
inJump = false;
|
||||
|
||||
// Do not play turning animation for player if rotation speed is very slow.
|
||||
// Actual threshold should take framerate in account.
|
||||
float rotationThreshold = 0;
|
||||
if (isPlayer)
|
||||
rotationThreshold = 0.015 * 60 * duration;
|
||||
|
||||
if(std::abs(vec.x()/2.0f) > std::abs(vec.y()))
|
||||
{
|
||||
if(vec.x() > 0.0f)
|
||||
@@ -2130,10 +2132,16 @@ void CharacterController::update(float duration, bool animationOnly)
|
||||
}
|
||||
else if(rot.z() != 0.0f)
|
||||
{
|
||||
// Do not play turning animation for player if rotation speed is very slow.
|
||||
// Actual threshold should take framerate in account.
|
||||
float rotationThreshold = 0.f;
|
||||
if (isPlayer)
|
||||
rotationThreshold = 0.015 * 60 * duration;
|
||||
|
||||
// It seems only bipedal actors use turning animations.
|
||||
// Also do not use turning animations in the first-person view and when sneaking.
|
||||
bool isFirstPlayer = isPlayer && MWBase::Environment::get().getWorld()->isFirstPerson();
|
||||
if (!sneak && !isFirstPlayer && mPtr.getClass().isBipedal(mPtr))
|
||||
if (!sneak && jumpstate == JumpState_None && !isFirstPlayer && mPtr.getClass().isBipedal(mPtr))
|
||||
{
|
||||
if(rot.z() > rotationThreshold)
|
||||
movestate = inwater ? CharState_SwimTurnRight : CharState_TurnRight;
|
||||
@@ -2143,13 +2151,27 @@ void CharacterController::update(float duration, bool animationOnly)
|
||||
}
|
||||
}
|
||||
|
||||
if (playLandingSound)
|
||||
{
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
std::string sound;
|
||||
osg::Vec3f pos(mPtr.getRefData().getPosition().asVec3());
|
||||
if (world->isUnderwater(mPtr.getCell(), pos) || world->isWalkingOnWater(mPtr))
|
||||
sound = "DefaultLandWater";
|
||||
else if (onground)
|
||||
sound = "DefaultLand";
|
||||
|
||||
if (!sound.empty())
|
||||
sndMgr->playSound3D(mPtr, sound, 1.f, 1.f, MWSound::Type::Foot, MWSound::PlayMode::NoPlayerLocal);
|
||||
}
|
||||
|
||||
// Player can not use smooth turning as NPCs, so we play turning animation a bit to avoid jittering
|
||||
if (isPlayer)
|
||||
{
|
||||
float threshold = mCurrentMovement.find("swim") == std::string::npos ? 0.4f : 0.8f;
|
||||
float complete;
|
||||
bool animPlaying = mAnimation->getInfo(mCurrentMovement, &complete);
|
||||
if (movestate == CharState_None && isTurning())
|
||||
if (movestate == CharState_None && jumpstate == JumpState_None && isTurning())
|
||||
{
|
||||
if (animPlaying && complete < threshold)
|
||||
movestate = mMovementState;
|
||||
|
||||
@@ -31,10 +31,8 @@ enum Priority {
|
||||
Priority_WeaponLowerBody,
|
||||
Priority_SneakIdleLowerBody,
|
||||
Priority_SwimIdle,
|
||||
Priority_Movement,
|
||||
// Note: in vanilla movement anims have higher priority than jump ones.
|
||||
// It causes issues with landing animations during movement.
|
||||
Priority_Jump,
|
||||
Priority_Movement,
|
||||
Priority_Hit,
|
||||
Priority_Weapon,
|
||||
Priority_Block,
|
||||
@@ -214,7 +212,7 @@ class CharacterController : public MWRender::Animation::TextKeyListener
|
||||
|
||||
void refreshCurrentAnims(CharacterState idle, CharacterState movement, JumpingState jump, bool force=false);
|
||||
void refreshHitRecoilAnims(CharacterState& idle);
|
||||
void refreshJumpAnims(const WeaponInfo* weap, JumpingState jump, CharacterState& idle, CharacterState& movement, bool force=false);
|
||||
void refreshJumpAnims(const WeaponInfo* weap, JumpingState jump, CharacterState& idle, bool force=false);
|
||||
void refreshMovementAnims(const WeaponInfo* weap, CharacterState movement, CharacterState& idle, bool force=false);
|
||||
void refreshIdleAnims(const WeaponInfo* weap, CharacterState idle, bool force=false);
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace MWMechanics
|
||||
|
||||
float rating = rateEffects(enchantment->mEffects, actor, enemy);
|
||||
|
||||
rating *= 2; // prefer rechargable magic items over spells
|
||||
rating *= 1.25f; // prefer rechargable magic items over spells
|
||||
return rating;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,9 @@ namespace MWMechanics
|
||||
value = ref->mBase->mData.mCombat;
|
||||
}
|
||||
|
||||
rating *= getHitChance(actor, enemy, value) / 100.f;
|
||||
// Take hit chance in account, but do not allow rating become negative.
|
||||
float chance = getHitChance(actor, enemy, value) / 100.f;
|
||||
rating *= std::min(1.f, std::max(0.01f, chance));
|
||||
|
||||
if (weapon->mData.mType < ESM::Weapon::Arrow)
|
||||
rating *= weapon->mData.mSpeed;
|
||||
|
||||
@@ -1366,33 +1366,6 @@ namespace MWPhysics
|
||||
return false;
|
||||
}
|
||||
|
||||
void PhysicsSystem::setActorCollisionMode(const MWWorld::Ptr& ptr, bool enabled)
|
||||
{
|
||||
ActorMap::iterator found = mActors.find(ptr);
|
||||
if (found != mActors.end())
|
||||
{
|
||||
bool cmode = found->second->getCollisionMode();
|
||||
if (cmode == enabled)
|
||||
return;
|
||||
|
||||
cmode = enabled;
|
||||
found->second->enableCollisionMode(cmode);
|
||||
found->second->enableCollisionBody(cmode);
|
||||
}
|
||||
}
|
||||
|
||||
bool PhysicsSystem::isActorCollisionEnabled(const MWWorld::Ptr& ptr)
|
||||
{
|
||||
ActorMap::iterator found = mActors.find(ptr);
|
||||
if (found != mActors.end())
|
||||
{
|
||||
bool cmode = found->second->getCollisionMode();
|
||||
return cmode;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void PhysicsSystem::queueObjectMovement(const MWWorld::Ptr &ptr, const osg::Vec3f &movement)
|
||||
{
|
||||
PtrVelocityList::iterator iter = mMovementQueue.begin();
|
||||
|
||||
@@ -86,8 +86,6 @@ namespace MWPhysics
|
||||
void removeHeightField (int x, int y);
|
||||
|
||||
bool toggleCollisionMode();
|
||||
bool isActorCollisionEnabled(const MWWorld::Ptr& ptr);
|
||||
void setActorCollisionMode(const MWWorld::Ptr& ptr, bool enabled);
|
||||
|
||||
void stepSimulation(float dt);
|
||||
void debugDraw();
|
||||
|
||||
@@ -739,7 +739,7 @@ void WeatherManager::update(float duration, bool paused, const TimeStamp& time,
|
||||
}
|
||||
else
|
||||
{
|
||||
theta = static_cast<float>(osg::PI) + static_cast<float>(osg::PI) * (adjustedHour - adjustedNightStart) / nightDuration;
|
||||
theta = static_cast<float>(osg::PI) - static_cast<float>(osg::PI) * (adjustedHour - adjustedNightStart) / nightDuration;
|
||||
}
|
||||
|
||||
osg::Vec3f final(
|
||||
|
||||
@@ -1583,14 +1583,20 @@ namespace MWWorld
|
||||
}
|
||||
}
|
||||
|
||||
void World::setActorCollisionMode(const MWWorld::Ptr& ptr, bool enabled)
|
||||
void World::setActorCollisionMode(const MWWorld::Ptr& ptr, bool internal, bool external)
|
||||
{
|
||||
mPhysics->setActorCollisionMode(ptr, enabled);
|
||||
MWPhysics::Actor *physicActor = mPhysics->getActor(ptr);
|
||||
if (physicActor && physicActor->getCollisionMode() != internal)
|
||||
{
|
||||
physicActor->enableCollisionMode(internal);
|
||||
physicActor->enableCollisionBody(external);
|
||||
}
|
||||
}
|
||||
|
||||
bool World::isActorCollisionEnabled(const MWWorld::Ptr& ptr)
|
||||
{
|
||||
return mPhysics->isActorCollisionEnabled(ptr);
|
||||
MWPhysics::Actor *physicActor = mPhysics->getActor(ptr);
|
||||
return physicActor && physicActor->getCollisionMode();
|
||||
}
|
||||
|
||||
bool World::toggleCollisionMode()
|
||||
|
||||
@@ -407,7 +407,7 @@ namespace MWWorld
|
||||
|
||||
bool castRay (float x1, float y1, float z1, float x2, float y2, float z2) override;
|
||||
|
||||
void setActorCollisionMode(const Ptr& ptr, bool enabled) override;
|
||||
void setActorCollisionMode(const Ptr& ptr, bool internal, bool external) override;
|
||||
bool isActorCollisionEnabled(const Ptr& ptr) override;
|
||||
|
||||
bool toggleCollisionMode() override;
|
||||
|
||||
@@ -48,6 +48,7 @@ namespace AiSequence
|
||||
{
|
||||
esm.getHNT (mData, "DATA");
|
||||
mTargetId = esm.getHNString("TARG");
|
||||
mTargetActorId = -1;
|
||||
esm.getHNOT (mTargetActorId, "TAID");
|
||||
esm.getHNT (mRemainingDuration, "DURA");
|
||||
mCellId = esm.getHNOString ("CELL");
|
||||
@@ -67,6 +68,7 @@ namespace AiSequence
|
||||
{
|
||||
esm.getHNT (mData, "DATA");
|
||||
mTargetId = esm.getHNString("TARG");
|
||||
mTargetActorId = -1;
|
||||
esm.getHNOT (mTargetActorId, "TAID");
|
||||
esm.getHNT (mRemainingDuration, "DURA");
|
||||
mCellId = esm.getHNOString ("CELL");
|
||||
|
||||
@@ -43,7 +43,7 @@ Copyright 2017 Bret Curtis <psi29a@gmail.com>
|
||||
<category>RolePlaying</category>
|
||||
</categories>
|
||||
<releases>
|
||||
<release version="0.43.0" date="2017-12-05"/>
|
||||
<release version="0.45.0" date="2018-10-30"/>
|
||||
</releases>
|
||||
<url type="homepage">https://openmw.org</url>
|
||||
<url type="bugtracker">https://bugs.openmw.org/</url>
|
||||
|
||||
Reference in New Issue
Block a user