Upright capsule

Sep 2, 2009 at 2:30 PM

Hi

I would just start out by saying thank you for this amazing library. I am working on a virtual reality type of program in which I use JigLibX for collision detection, gravity etc.

Current, I have modeled my player using a sphere as the head. From here, a ray is cast downwards and if it intersects at a distance less than the height of the player and upwards force is applied. This keeps the player above ground and floors while still allowing it to pass obstacles, stairs etc.

This all works very well but I would like to have some more body on the player. With the current model, the player will pass over objects less than 1.6m high which is a problem when walking along railings etc. I was thinking that I could use a capsule instead of a sphere as player body/head still combined with the ray intersection system. This would allow him to pass over low objects such as stairs but not over railings. To make this work, I must constrain the capsule to an upright (Y is up) position. How should I go about doing this? Is there a simple way to lock the rotations of the capsule?

 

Thank you

Kasper

Sep 3, 2009 at 6:42 AM

Well, noone might not answer because you are not able to read oO ... (just like me posting here :P ...)

Right after you click on discussions there is a message:

PLEASE STOP POSTING HERE. USE THE OFFICIAL WIKI: http://jiglibx.wikidot.com/

 

The first thing that came to my mind to lock the capsule was a HingeJoint, but a simple controller might be better :). You had to create a controller anyway for your character. So why don't you try to lock the capsule to Y there? Sounds simple ^^ ... ask @ http://jiglibx.wikidot.com/