@@ -50,6 +50,9 @@ B2_API b2SensorEvents b2World_GetSensorEvents( b2WorldId worldId );
5050/// Get contact events for this current time step. The event data is transient. Do not store a reference to this data.
5151B2_API b2ContactEvents b2World_GetContactEvents ( b2WorldId worldId );
5252
53+ /// Get the joint events for the current time step. The event data is transient. Do not store a reference to this data.
54+ B2_API b2JointEvents b2World_GetJointEvents ( b2WorldId worldId );
55+
5356/// Overlap test for all shapes that *potentially* overlap the provided AABB
5457B2_API b2TreeStats b2World_OverlapAABB ( b2WorldId worldId , b2AABB aabb , b2QueryFilter filter , b2OverlapResultFcn * fcn ,
5558 void * context );
@@ -745,29 +748,17 @@ B2_API b2BodyId b2Joint_GetBodyB( b2JointId jointId );
745748/// Get the world that owns this joint
746749B2_API b2WorldId b2Joint_GetWorld ( b2JointId jointId );
747750
748- /// Set the local anchor on bodyA
749- B2_API void b2Joint_SetLocalAnchorA ( b2JointId jointId , b2Vec2 localAnchor );
750-
751- /// Get the local anchor on bodyA
752- B2_API b2Vec2 b2Joint_GetLocalAnchorA ( b2JointId jointId );
753-
754- /// Set the local anchor on bodyB
755- B2_API void b2Joint_SetLocalAnchorB ( b2JointId jointId , b2Vec2 localAnchor );
751+ /// Set the local frame on bodyA
752+ B2_API void b2Joint_SetLocalFrameA ( b2JointId jointId , b2Transform localFrame );
756753
757- /// Get the local anchor on bodyB
758- B2_API b2Vec2 b2Joint_GetLocalAnchorB ( b2JointId jointId );
754+ /// Get the local frame on bodyA
755+ B2_API b2Transform b2Joint_GetLocalFrameA ( b2JointId jointId );
759756
760- /// Get the joint reference angle in radians (revolute, prismatic, and weld)
761- B2_API float b2Joint_GetReferenceAngle ( b2JointId jointId );
757+ /// Set the local frame on bodyB
758+ B2_API void b2Joint_SetLocalFrameB ( b2JointId jointId , b2Transform localFrame );
762759
763- /// Set the joint reference angle in radians, must be in [-pi,pi]. (revolute, prismatic, and weld)
764- B2_API void b2Joint_SetReferenceAngle ( b2JointId jointId , float angleInRadians );
765-
766- /// Set the local axis on bodyA (prismatic and wheel)
767- B2_API void b2Joint_SetLocalAxisA ( b2JointId jointId , b2Vec2 localAxis );
768-
769- /// Get the local axis on bodyA (prismatic and wheel)
770- B2_API b2Vec2 b2Joint_GetLocalAxisA ( b2JointId jointId );
760+ /// Get the local frame on bodyB
761+ B2_API b2Transform b2Joint_GetLocalFrameB ( b2JointId jointId );
771762
772763/// Toggle collision between connected bodies
773764B2_API void b2Joint_SetCollideConnected ( b2JointId jointId , bool shouldCollide );
@@ -887,29 +878,15 @@ B2_API float b2DistanceJoint_GetMotorForce( b2JointId jointId );
887878 * @defgroup motor_joint Motor Joint
888879 * @brief Functions for the motor joint.
889880 *
890- * The motor joint is used to drive the relative transform between two bodies. It takes
891- * a relative position and rotation and applies the forces and torques needed to achieve
892- * that relative transform over time.
881+ * The motor joint is used to drive the relative transform between two bodies. The target
882+ * is set by updating the local frames using b2Joint_SetLocalFrameA or b2Joint_SetLocalFrameB.
893883 * @{
894884 */
895885
896886/// Create a motor joint
897887/// @see b2MotorJointDef for details
898888B2_API b2JointId b2CreateMotorJoint ( b2WorldId worldId , const b2MotorJointDef * def );
899889
900- /// Set the motor joint linear offset target
901- B2_API void b2MotorJoint_SetLinearOffset ( b2JointId jointId , b2Vec2 linearOffset );
902-
903- /// Get the motor joint linear offset target
904- B2_API b2Vec2 b2MotorJoint_GetLinearOffset ( b2JointId jointId );
905-
906- /// Set the motor joint angular offset target in radians. This angle will be unwound
907- /// so the motor will drive along the shortest arc.
908- B2_API void b2MotorJoint_SetAngularOffset ( b2JointId jointId , float angularOffset );
909-
910- /// Get the motor joint angular offset target in radians
911- B2_API float b2MotorJoint_GetAngularOffset ( b2JointId jointId );
912-
913890/// Set the motor joint maximum force, usually in newtons
914891B2_API void b2MotorJoint_SetMaxForce ( b2JointId jointId , float maxForce );
915892
@@ -943,12 +920,6 @@ B2_API float b2MotorJoint_GetCorrectionFactor( b2JointId jointId );
943920/// @see b2MouseJointDef for details
944921B2_API b2JointId b2CreateMouseJoint ( b2WorldId worldId , const b2MouseJointDef * def );
945922
946- /// Set the mouse joint target
947- B2_API void b2MouseJoint_SetTarget ( b2JointId jointId , b2Vec2 target );
948-
949- /// Get the mouse joint target
950- B2_API b2Vec2 b2MouseJoint_GetTarget ( b2JointId jointId );
951-
952923/// Set the mouse joint spring stiffness in Hertz
953924B2_API void b2MouseJoint_SetSpringHertz ( b2JointId jointId , float hertz );
954925
0 commit comments