New way of constructing Capsule

Post and discuss features you'd like to see in the BEPUphysics library.
Post Reply
flyingbag
Posts: 2
Joined: Wed Oct 27, 2010 3:23 pm

New way of constructing Capsule

Post by flyingbag »

Hi,

I want to suggest an alternate way of constructing a Capsule. For constructing a Capsule using an existing constructor we'll need a position (Vector3), a length (float and a radius (float) as below.

Code: Select all

public Capsule(Vector3 pos, float len, float rad);
May I suggest constructing a Capsule by specifying a beginning position (Vector3), an ending position (Vector3) and a radius (float), as below.

Code: Select all

public Capsule(Vector3 beg, Vector3 end, float rad);
In this way the code also is able to provide the position and orientation of the Capsule for us. One hassle I've been with using other physics engine was I often need to ensure the orientation of a capsule is right in different coordinate system. In specifying just begin and end position with the radius, it sounds (to me) more intuitive and axis neutral.

Thanks

flyingbag
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: New way of constructing Capsule

Post by Norbo »

Sure, I'll toss that in as an extra convenience constructor, and/or maybe a helper method (to extract an acceptable orientation to align the local up vector with a start/end location in general).
Post Reply