Add some description comments in the collision shapes

This commit is contained in:
Daniel Chappuis 2013-07-10 00:22:40 +02:00
parent 25b6b015b8
commit 88504bbb44
6 changed files with 27 additions and 6 deletions

View File

@ -30,7 +30,6 @@
#include <cassert>
using namespace reactphysics3d;
using namespace std;
// Constructor
BoxShape::BoxShape(const Vector3& extent, decimal margin)

View File

@ -40,7 +40,14 @@ namespace reactphysics3d {
* This class represents a 3D box shape. Those axis are unit length.
* The three extents are half-widths of the box along the three
* axis x, y, z local axis. The "transform" of the corresponding
* rigid body gives an orientation and a position to the box.
* rigid body will give an orientation and a position to the box. This
* collision shape uses an extra margin distance around it for collision
* detection purpose. The default margin is 4cm (if your units are meters,
* which is recommended). In case, you want to simulate small objects
* (smaller than the margin distance), you might want to reduce the margin by
* specifying your own margin distance using the "margin" parameter in the
* constructor of the box shape. Otherwise, it is recommended to use the
* default margin distance by not using the "margin" parameter in the constructor.
*/
class BoxShape : public CollisionShape {

View File

@ -40,7 +40,13 @@ namespace reactphysics3d {
* by its height and by the radius of its base. The center of the
* cone is at the half of the height. The "transform" of the
* corresponding rigid body gives an orientation and a position
* to the cone.
* to the cone. This collision shape uses an extra margin distance around
* it for collision detection purpose. The default margin is 4cm (if your
* units are meters, which is recommended). In case, you want to simulate small
* objects (smaller than the margin distance), you might want to reduce the margin
* by specifying your own margin distance using the "margin" parameter in the
* constructor of the cone shape. Otherwise, it is recommended to use the
* default margin distance by not using the "margin" parameter in the constructor.
*/
class ConeShape : public CollisionShape {

View File

@ -40,6 +40,13 @@ namespace reactphysics3d {
* and centered at the origin. The cylinder is defined by its height
* and the radius of its base. The "transform" of the corresponding
* rigid body gives an orientation and a position to the cylinder.
* This collision shape uses an extra margin distance around it for collision
* detection purpose. The default margin is 4cm (if your units are meters,
* which is recommended). In case, you want to simulate small objects
* (smaller than the margin distance), you might want to reduce the margin by
* specifying your own margin distance using the "margin" parameter in the
* constructor of the cylinder shape. Otherwise, it is recommended to use the
* default margin distance by not using the "margin" parameter in the constructor.
*/
class CylinderShape : public CollisionShape {
@ -111,7 +118,7 @@ inline decimal CylinderShape::getRadius() const {
// Return the height
inline decimal CylinderShape::getHeight() const {
return mHalfHeight * decimal(2.0);
return mHalfHeight + mHalfHeight;
}
// Return the number of bytes used by the collision shape

View File

@ -29,7 +29,6 @@
#include <cassert>
using namespace reactphysics3d;
using namespace std;
// Constructor
SphereShape::SphereShape(decimal radius) : CollisionShape(SPHERE, radius), mRadius(radius) {

View File

@ -36,7 +36,10 @@ namespace reactphysics3d {
// Class SphereShape
/**
* This class represents a sphere collision shape that is centered
* at the origin and defined by its radius.
* at the origin and defined by its radius. This collision shape does not
* have an explicit object margin distance. The margin is implicitly the
* radius of the sphere. Therefore, no need to specify an object margin
* for a sphere shape.
*/
class SphereShape : public CollisionShape {