Update code documentation and fix warnings

This commit is contained in:
Daniel Chappuis 2017-11-05 23:15:47 +01:00
parent 6e322882eb
commit e91cded831
4 changed files with 8 additions and 16 deletions

View File

@ -35,7 +35,6 @@ using namespace reactphysics3d;
// Constructor // Constructor
/** /**
* @param extent The vector with the three extents of the box (in meters) * @param extent The vector with the three extents of the box (in meters)
* @param margin The collision margin (in meters) around the collision shape
*/ */
BoxShape::BoxShape(const Vector3& extent) BoxShape::BoxShape(const Vector3& extent)
: ConvexPolyhedronShape(CollisionShapeName::BOX), mExtent(extent) { : ConvexPolyhedronShape(CollisionShapeName::BOX), mExtent(extent) {

View File

@ -41,14 +41,7 @@ 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 will give an orientation and a position to the box. This * body will give an orientation and a position to the box.
* 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 ConvexPolyhedronShape { class BoxShape : public ConvexPolyhedronShape {
@ -171,9 +164,9 @@ inline size_t BoxShape::getSizeInBytes() const {
// Return a local support point in a given direction without the objec margin // Return a local support point in a given direction without the objec margin
inline Vector3 BoxShape::getLocalSupportPointWithoutMargin(const Vector3& direction) const { inline Vector3 BoxShape::getLocalSupportPointWithoutMargin(const Vector3& direction) const {
return Vector3(direction.x < 0.0 ? -mExtent.x : mExtent.x, return Vector3(direction.x < decimal(0.0) ? -mExtent.x : mExtent.x,
direction.y < 0.0 ? -mExtent.y : mExtent.y, direction.y < decimal(0.0) ? -mExtent.y : mExtent.y,
direction.z < 0.0 ? -mExtent.z : mExtent.z); direction.z < decimal(0.0) ? -mExtent.z : mExtent.z);
} }
// Return true if a point is inside the collision shape // Return true if a point is inside the collision shape

View File

@ -103,7 +103,7 @@ class ConcaveMeshRaycastCallback : public DynamicAABBTreeRaycastCallback {
// Class ConcaveMeshShape // Class ConcaveMeshShape
/** /**
* This class represents a static concave mesh shape. Note that collision detection * This class represents a static concave mesh shape. Note that collision detection
* with a concave mesh shape can be very expensive. You should use only use * with a concave mesh shape can be very expensive. You should only use
* this shape for a static mesh. * this shape for a static mesh.
*/ */
class ConcaveMeshShape : public ConcaveShape { class ConcaveMeshShape : public ConcaveShape {

View File

@ -233,9 +233,9 @@ inline Matrix3x3 Matrix3x3::computeSkewSymmetricMatrixForCrossProduct(const Vect
// Return the matrix with absolute values // Return the matrix with absolute values
inline Matrix3x3 Matrix3x3::getAbsoluteMatrix() const { inline Matrix3x3 Matrix3x3::getAbsoluteMatrix() const {
return Matrix3x3(fabs(mRows[0][0]), fabs(mRows[0][1]), fabs(mRows[0][2]), return Matrix3x3(std::fabs(mRows[0][0]), std::fabs(mRows[0][1]), std::fabs(mRows[0][2]),
fabs(mRows[1][0]), fabs(mRows[1][1]), fabs(mRows[1][2]), std::fabs(mRows[1][0]), std::fabs(mRows[1][1]), std::fabs(mRows[1][2]),
fabs(mRows[2][0]), fabs(mRows[2][1]), fabs(mRows[2][2])); std::fabs(mRows[2][0]), std::fabs(mRows[2][1]), std::fabs(mRows[2][2]));
} }
// Overloaded operator for addition // Overloaded operator for addition