Skip to content

Commit

Permalink
added warnings and missing function
Browse files Browse the repository at this point in the history
  • Loading branch information
erincatto committed Jul 29, 2024
1 parent fb965a5 commit 0fe8864
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/box2d/collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ B2_API b2CastOutput b2ShapeCastSegment(const b2ShapeCastInput* input, const b2Se
B2_API b2CastOutput b2ShapeCastPolygon(const b2ShapeCastInput* input, const b2Polygon* shape);

/// A convex hull. Used to create convex polygons.
/// @warning Do not modify these values directly, instead use b2ComputeHull()
typedef struct b2Hull
{
/// The final points of the hull
Expand All @@ -267,6 +268,7 @@ typedef struct b2Hull
/// - less than 3 points
/// - more than b2_maxPolygonVertices points
/// This welds close points and removes collinear points.
/// @warning Do not modify a hull once it has been computed
B2_API b2Hull b2ComputeHull(const b2Vec2* points, int32_t count);

/// This determines if a hull is valid. Checks for:
Expand Down
6 changes: 6 additions & 0 deletions src/distance_joint.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ void b2DistanceJoint_EnableLimit(b2JointId jointId, bool enableLimit)
joint->enableLimit = enableLimit;
}

bool b2DistanceJoint_IsLimitEnabled(b2JointId jointId)
{
b2JointSim* joint = b2GetJointSimCheckType(jointId, b2_distanceJoint);
return joint->distanceJoint.enableLimit;
}

void b2DistanceJoint_SetLengthRange(b2JointId jointId, float minLength, float maxLength)
{
b2JointSim* base = b2GetJointSimCheckType(jointId, b2_distanceJoint);
Expand Down

0 comments on commit 0fe8864

Please sign in to comment.