the PulleyJoint, when i inspect its functionality I see these functions:
Code: Select all
<1>{
__eq = <function 1>,
__gc = <function 2>,
__index = <table 1>,
__tostring = <function 3>,
destroy = <function 4>,
getAnchors = <function 5>,
getBodies = <function 6>,
getCollideConnected = <function 7>,
getGroundAnchors = <function 8>,
getLengthA = <function 9>,
getLengthB = <function 10>,
getRatio = <function 11>,
getReactionForce = <function 12>,
getReactionTorque = <function 13>,
getType = <function 14>,
getUserData = <function 15>,
isDestroyed = <function 16>,
release = <function 17>,
setUserData = <function 18>,
type = <function 19>,
typeOf = <function 20>
}
but according to the doc there ought to be :
PulleyJoint:setConstant Set the total length of the rope.
PulleyJoint:setMaxLengths Set the maximum lengths of the rope segments.
PulleyJoint:setRatio
my autocomplete seems to think there are these setters too, but when i use them
'attempt to call method 'setMaxLengths' (a nil value)'
also in the PulleyJoint constructor doc there is this line:
Pulley joints can behave unpredictably if one side is fully extended. It is recommended that the method setMaxLengths be used to constrain the maximum lengths each side can attain.
but no way todo that I think?
edit: I found this github issue about it: https://github.com/love2d/love/issues/1823, so it seems a similar case like the MotorJoint, the box2d implementationwe have in love is at v2, the api in the wiki is another newer version.
because looking at some old api doc for box2d I see this, very similar to the function i see when inspecting the joint :
Code: Select all
Public Member Functions
b2Vec2 GetAnchor1 () const Get the anchor point on body1 in world coordinates.
b2Vec2 GetAnchor2 () const Get the anchor point on body2 in world coordinates.
b2Vec2 GetReactionForce () const Get the reaction force on body2 at the joint anchor.
float32 GetReactionTorque () const Get the reaction torque on body2.
b2Vec2 GetGroundAnchor1 () const Get the first ground anchor.
b2Vec2 GetGroundAnchor2 () const Get the second ground anchor.
float32 GetLength1 () const Get the current length of the segment attached to body1.
float32 GetLength2 () const Get the current length of the segment attached to body2.
float32 GetRatio () const Get the pulley ratio.