Character Controller FindSupport failing

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Smtih
Posts: 6
Joined: Tue May 08, 2012 4:16 am

Character Controller FindSupport failing

Post by Smtih »

I'm trying to integrate BEPU physics into a game I've been working on, however I can't get the character controller to work.
I have a simple character controller and it seems that the FindSupport function never returns true, thus my character never has traction.
at the moment I just have my character and a staticmesh terrain.

Anyone got suggestions of what I can try to get this up and running?

Extra Info:
The problem stems from the count of collisionPairCollector.CollisionInformation.Pairs always being 0.
Also I notice that if i start the player in the air, it doesn't fall. Maybe this will help debug the issue too.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Character Controller FindSupport failing

Post by Norbo »

If the support gets itself stuck between the body and the ray, the ray might miss it. Other than that, I can't remember any common failures that would explain that when using the SimpleCharacterController.

However, I would recommend switching to either the SphereCharacterController or CharacterController. They are significantly better.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Character Controller FindSupport failing

Post by Norbo »

Extra Info:
The problem stems from the count of collisionPairCollector.CollisionInformation.Pairs always being 0.
Also I notice that if i start the player in the air, it doesn't fall. Maybe this will help debug the issue too.
Is the character added to the space, and are its constituent parts added to the space properly? In the 1.1 version of the demos, an extra call is required to get the SimpleCharacterController to work if I remember right, or you can set IsUpdating to false in the constructor (like the development version). If that is not set to false, the parts don't get auto-added properly.
Smtih
Posts: 6
Joined: Tue May 08, 2012 4:16 am

Re: Character Controller FindSupport failing

Post by Smtih »

IsUpdating bit did the trick!
Smtih
Posts: 6
Joined: Tue May 08, 2012 4:16 am

Re: Character Controller FindSupport failing

Post by Smtih »

So my character now moves and I've switched to the new character controller, however if the player starts in the air, he doesn't fall?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Character Controller FindSupport failing

Post by Norbo »

Is there gravity? It's been a while since I've fiddled with v1.1, but I don't think you had to do anything special in it to get CharacterControllers to work, and v1.2 (the development version) works as expected. The CharacterStressTestDemo shows a bunch of characters created and directly added to the Space.
Smtih
Posts: 6
Joined: Tue May 08, 2012 4:16 am

Re: Character Controller FindSupport failing

Post by Smtih »

So I worked out how to add gravity, I've moved to the development version of BEPU and using the full fledged character controller.
Despite the tutorials working flawlessly when Implementing into my engine I can't get traction on my player.

Problem seems to be in find support. Despite colliding with the static mesh fine under gravity, I never get into the part in the update support method that gives me traction.
The contact normal is always (0, -1, 0)
I'm not sure what I could be doing wrong?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Character Controller FindSupport failing

Post by Norbo »

That contact normal sounds reasonable assuming it fell onto a flat plane. Is the character controller object itself properly added to the space? I could take a look at the configuration if you have a concise postable configuration.
Smtih
Posts: 6
Joined: Tue May 08, 2012 4:16 am

Re: Character Controller FindSupport failing

Post by Smtih »

ok, seems it was a problem as I was aligning my models to the bounding volumes using a local offset. I'll just change how I do that.
Post Reply