1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 00:32:49 +00:00

Switch actors to capsule shapes now that the jumping bug is gone (Fixes #2116, Fixes #2909)

The culprit was - surprise, surprise - d39d4f261983249b2dc540c072eed9768a3640f1
This commit is contained in:
scrawl 2017-02-06 05:39:56 +01:00
parent 03aa270551
commit 91939c4687

View File

@ -1,6 +1,6 @@
#include "actor.hpp"
#include <BulletCollision/CollisionShapes/btCylinderShape.h>
#include <BulletCollision/CollisionShapes/btCapsuleShape.h>
#include <BulletCollision/CollisionShapes/btBoxShape.h>
#include <BulletCollision/CollisionDispatch/btCollisionWorld.h>
@ -31,8 +31,7 @@ Actor::Actor(const MWWorld::Ptr& ptr, osg::ref_ptr<const Resource::BulletShape>
// Use capsule shape only if base is square (nonuniform scaling apparently doesn't work on it)
if (std::abs(mHalfExtents.x()-mHalfExtents.y())<mHalfExtents.x()*0.05 && mHalfExtents.z() >= mHalfExtents.x())
{
// Could also be btCapsuleShapeZ, but the movement solver seems to have issues with it (jumping on slopes doesn't work)
mShape.reset(new btCylinderShapeZ(toBullet(mHalfExtents)));
mShape.reset(new btCapsuleShapeZ(mHalfExtents.x(), 2*mHalfExtents.z() - 2*mHalfExtents.x()));
}
else
mShape.reset(new btBoxShape(toBullet(mHalfExtents)));