From 0fe8864fd4ec65df8fb2530fd435268c66ac1764 Mon Sep 17 00:00:00 2001 From: Erin Catto Date: Sun, 28 Jul 2024 18:26:04 -0700 Subject: [PATCH] added warnings and missing function --- include/box2d/collision.h | 2 ++ src/distance_joint.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/box2d/collision.h b/include/box2d/collision.h index f3dc0b46..618d0f8d 100644 --- a/include/box2d/collision.h +++ b/include/box2d/collision.h @@ -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 @@ -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: diff --git a/src/distance_joint.c b/src/distance_joint.c index 789308ba..70ac9574 100644 --- a/src/distance_joint.c +++ b/src/distance_joint.c @@ -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);