Discuss any questions about BEPUphysics or problems encountered.
- Posts: 11
- Joined: Mon Aug 05, 2019 12:06 pm
So, I have terrain included in my physics and also character controllers for my player avatar. Im not sure if its a bug or just me making assumptions but took me awhile to work out why characters did not stand on the terrain exactly. Turns out the capsule height must be set using the following formula.
Code: Select all
CapsuleHeight = AvatarHeight - (CapsuleRadius * 2)
Seems a bit counter intuitive. I guess the height is for the cylinder part and the rounded ends are not included
- Site Admin
- Posts: 4910
- Joined: Tue Jul 04, 2006 4:45 am
Yup, the capsule 'length' refers to the length of the internal line segment, and the 'radius' is the spherical expansion around that line segment.
(The reasoning here was that any nonnegative value for length works under this interpretation, whereas if it referred to the line+radius, there would be invalid positive values.)