yoshinoToylogic / bulletsharp

Automatically exported from code.google.com/p/bulletsharp
MIT License
0 stars 0 forks source link

KinematicCharacterController #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
private void SetupController(Matrix startTransform)
{
    _ghost = new PairCachingGhostObject();
        _ghost.WorldTransform = startTransform;
        _ghost.CollisionShape = new CapsuleShape(8f, 32f);
        _ghost.CollisionFlags = CollisionFlags.CharacterObject;

    HashedOverlappingPairCache m_ghostPairCallback = new HashedOverlappingPairCache();

    _world.DWorld.Broadphase.OverlappingPairCache.SetInternalGhostPairCallback(m_ghostPairCallback);

    _controller = new KinematicCharacterController(_ghost, new CapsuleShape(8f, 32f), 0.5f);
}

I'm sure I'm doing something fundamentally wrong, I'm just not sure how to fix, 
the only thing i could find to use as an overlapping pair cache with any kind 
of constructor was the sorted and hashed pair cache.

When I run the code though the Broadphase.OverlappingPairCache is null and 
readonly.

Any chance of a KinematicCharacterController example, don't mind what framework 
it's for, as long as it managed code using bulletsharp.

Thanks in advance for any help.

Original issue reported on code.google.com by men...@hotmail.co.uk on 21 Oct 2010 at 8:56

GoogleCodeExporter commented 8 years ago

Original comment by andres.traks on 21 Oct 2010 at 10:15