Difference between revisions of "B2.PrismaticJoint"
Line 2: | Line 2: | ||
'''Supported platforms:''' android, ios, mac, pc<br/> | '''Supported platforms:''' android, ios, mac, pc<br/> | ||
'''Available since:''' Gideros 2011.6<br/> | '''Available since:''' Gideros 2011.6<br/> | ||
− | === Description === | + | === <translate>Description</translate> === |
<translate><br /> | <translate><br /> | ||
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction. <br /> | A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction. <br /> | ||
<br /></translate> | <br /></translate> | ||
− | === Examples === | + | === <translate>Examples</translate> === |
'''Prismatic joint'''<br/> | '''Prismatic joint'''<br/> | ||
<source lang="lua">--create empty box2d body for joint | <source lang="lua">--create empty box2d body for joint | ||
Line 21: | Line 21: | ||
{|- | {|- | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Methods === | + | === <translate>Methods</translate> === |
[[Special:MyLanguage/b2.PrismaticJoint:enableLimit|b2.PrismaticJoint:enableLimit]] ''<translate>enables or disables the joint limit</translate>''<br/> | [[Special:MyLanguage/b2.PrismaticJoint:enableLimit|b2.PrismaticJoint:enableLimit]] ''<translate>enables or disables the joint limit</translate>''<br/> | ||
[[Special:MyLanguage/b2.PrismaticJoint:enableMotor|b2.PrismaticJoint:enableMotor]] ''<translate>enables or disables the joint motor</translate>''<br/> | [[Special:MyLanguage/b2.PrismaticJoint:enableMotor|b2.PrismaticJoint:enableMotor]] ''<translate>enables or disables the joint motor</translate>''<br/> | ||
Line 35: | Line 35: | ||
[[Special:MyLanguage/b2.RevoluteJoint:getMotorForce|b2.RevoluteJoint:getMotorForce]] ''<translate>returns the current motor force given the inverse time step</translate>''<br/> | [[Special:MyLanguage/b2.RevoluteJoint:getMotorForce|b2.RevoluteJoint:getMotorForce]] ''<translate>returns the current motor force given the inverse time step</translate>''<br/> | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
− | === Events === | + | === <translate>Events</translate> === |
− | === Constants === | + | === <translate>Constants</translate> === |
|} | |} |
Revision as of 07:28, 24 August 2018
Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6
Description
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
Examples
Prismatic joint
--create empty box2d body for joint
local ground = world:createBody({})
ground:setPosition(465, 480)
--axisx, axisy values usually between 0 and 1
--0 0 moves freely
--0 1 moves on y axis
--1 0 moves on x axis
--1 1 moves on diagonal
local jointDef = b2.createPrismaticJointDef(body, ground, 350, 100, 0.3, 1)
local prismaticJoint = world:createJoint(jointDef)
Methodsb2.PrismaticJoint:enableLimit enables or disables the joint limit |
EventsConstants |