Difference between revisions of "B2.WheelJoint"
Line 3: | Line 3: | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
=== Description === | === Description === | ||
− | <br /> | + | <translate><br /> |
A wheel joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. You can use a <br /> | A wheel joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. You can use a <br /> | ||
joint limit to restrict the range of motion and a joint motor to drive the rotation or to model rotational friction. This joint <br /> | joint limit to restrict the range of motion and a joint motor to drive the rotation or to model rotational friction. This joint <br /> | ||
is designed for vehicle suspensions.<br /> | is designed for vehicle suspensions.<br /> | ||
− | <br /> | + | <br /></translate> |
=== Examples === | === Examples === | ||
'''Wheel joint'''<br/> | '''Wheel joint'''<br/> |
Revision as of 13:34, 23 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6
Description
A wheel joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. You can use a
joint limit to restrict the range of motion and a joint motor to drive the rotation or to model rotational friction. This joint
is designed for vehicle suspensions.
Examples
Wheel joint
--create empty box2d body for joint
local ground = world:createBody({})
ground:setPosition(350, 480)
--axisx, axisy values usually between 0 and 1
--0 0 moves freely
--0 1 force pulling back on y axis
--1 0 force pulling back on x axis
--1 1 force pulling back all diretions
local jointDef = b2.createWheelJointDef(body, ground, 350, 200, 1, 1)
local wheelJoint = world:createJoint(jointDef)
Methodsb2.WheelJoint:enableMotor - enables or disables the joint motor |
EventsConstants |