mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Add second body anchor point to FrictionJoint/WeldJoint constructors
--HG-- branch : box2d-update
This commit is contained in:
@@ -33,11 +33,12 @@ namespace physics
|
||||
{
|
||||
namespace box2d
|
||||
{
|
||||
WeldJoint::WeldJoint(Body * body1, Body * body2, float x, float y, bool collideConnected)
|
||||
WeldJoint::WeldJoint(Body * body1, Body * body2, float xA, float yA, float xB, float yB, bool collideConnected)
|
||||
: Joint(body1, body2), joint(NULL)
|
||||
{
|
||||
b2WeldJointDef def;
|
||||
def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(x,y)));
|
||||
def.Initialize(body1->body, body2->body, Physics::scaleDown(b2Vec2(xA,yA)));
|
||||
def.localAnchorB = Physics::scaleDown(b2Vec2(xB, yB));
|
||||
def.collideConnected = collideConnected;
|
||||
joint = (b2WeldJoint*)createJoint(&def);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user