Create a cylinder around a model

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Menyueru
Posts: 17
Joined: Sun Jun 09, 2013 11:28 pm

Create a cylinder around a model

Post by Menyueru »

Probably someone has asked this before but I've haven't found anyways to do this, basically i have a model i want to load, how is the best way to create the cylinder that will be around him to handle the collisions, I thought, i could get the model height, and width and get it from there but i don't know how to do that neither, could u guys help me with that?

Thanks in advance.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Create a cylinder around a model

Post by Norbo »

One option would be to choose a particular point as the base of cylinder, somewhere around the feet. Then, iterate through all vertices in the model, subtracting them from your chosen base. The height of the model is then the highest Y offset, and the radius is the greatest horizontal offset length.
Menyueru
Posts: 17
Joined: Sun Jun 09, 2013 11:28 pm

Re: Create a cylinder around a model

Post by Menyueru »

Thanks norbo it worked :D you're the best!!!

Also, how can i know I'm colliding with a support??
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Create a cylinder around a model

Post by Norbo »

Assuming you're using the CharacterController, check the CharacterController.SupportFinder.HasSupport property.
Menyueru
Posts: 17
Joined: Sun Jun 09, 2013 11:28 pm

Re: Create a cylinder around a model

Post by Menyueru »

I'm not using the characther controller because i've had some problems porting it to what i need so i'm doing my own simpler one, but just checked what you did to do that i'll probably take the basic concept but thanks Norbo great job loving all your work so far :D
Post Reply