Add some description comments in the collision shapes
This commit is contained in:
parent
25b6b015b8
commit
88504bbb44
|
@ -30,7 +30,6 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
BoxShape::BoxShape(const Vector3& extent, decimal margin)
|
BoxShape::BoxShape(const Vector3& extent, decimal margin)
|
||||||
|
|
|
@ -40,7 +40,14 @@ namespace reactphysics3d {
|
||||||
* This class represents a 3D box shape. Those axis are unit length.
|
* This class represents a 3D box shape. Those axis are unit length.
|
||||||
* The three extents are half-widths of the box along the three
|
* The three extents are half-widths of the box along the three
|
||||||
* axis x, y, z local axis. The "transform" of the corresponding
|
* 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 {
|
class BoxShape : public CollisionShape {
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,13 @@ namespace reactphysics3d {
|
||||||
* by its height and by the radius of its base. The center of the
|
* 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
|
* cone is at the half of the height. The "transform" of the
|
||||||
* corresponding rigid body gives an orientation and a position
|
* 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 {
|
class ConeShape : public CollisionShape {
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,13 @@ namespace reactphysics3d {
|
||||||
* and centered at the origin. The cylinder is defined by its height
|
* and centered at the origin. The cylinder is defined by its height
|
||||||
* and the radius of its base. The "transform" of the corresponding
|
* and the radius of its base. The "transform" of the corresponding
|
||||||
* rigid body gives an orientation and a position to the cylinder.
|
* 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 {
|
class CylinderShape : public CollisionShape {
|
||||||
|
|
||||||
|
@ -111,7 +118,7 @@ inline decimal CylinderShape::getRadius() const {
|
||||||
|
|
||||||
// Return the height
|
// Return the height
|
||||||
inline decimal CylinderShape::getHeight() const {
|
inline decimal CylinderShape::getHeight() const {
|
||||||
return mHalfHeight * decimal(2.0);
|
return mHalfHeight + mHalfHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the number of bytes used by the collision shape
|
// Return the number of bytes used by the collision shape
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace reactphysics3d;
|
using namespace reactphysics3d;
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
SphereShape::SphereShape(decimal radius) : CollisionShape(SPHERE, radius), mRadius(radius) {
|
SphereShape::SphereShape(decimal radius) : CollisionShape(SPHERE, radius), mRadius(radius) {
|
||||||
|
|
|
@ -36,7 +36,10 @@ namespace reactphysics3d {
|
||||||
// Class SphereShape
|
// Class SphereShape
|
||||||
/**
|
/**
|
||||||
* This class represents a sphere collision shape that is centered
|
* 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 {
|
class SphereShape : public CollisionShape {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user