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

The culprit was - surprise, surprise - d39d4f2619
coverity_scan^2
scrawl 8 years ago
parent 03aa270551
commit 91939c4687

@ -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)));

Loading…
Cancel
Save