forked from teamnwah/openmw-tes3coop
Use 3/4ths of the physic actor's height to test if swimming
This commit is contained in:
parent
dfd16c4424
commit
bdda7278c4
1 changed files with 3 additions and 2 deletions
|
@ -1336,8 +1336,9 @@ namespace MWWorld
|
||||||
float *fpos = object.getRefData().getPosition().pos;
|
float *fpos = object.getRefData().getPosition().pos;
|
||||||
Ogre::Vector3 pos(fpos[0], fpos[1], fpos[2]);
|
Ogre::Vector3 pos(fpos[0], fpos[1], fpos[2]);
|
||||||
|
|
||||||
/// \fixme should rely on object height
|
/// \fixme 3/4ths submerged?
|
||||||
pos.z += 30;
|
const OEngine::Physic::PhysicActor *actor = mPhysEngine->getCharacter(object.getRefData().getHandle());
|
||||||
|
if(actor) pos.z += actor->getHalfExtents().z * 1.5;
|
||||||
|
|
||||||
return isUnderwater(*object.getCell()->mCell, pos);
|
return isUnderwater(*object.getCell()->mCell, pos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue