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