MotorJointDef

data class MotorJointDef(val bodyA: Body, val bodyB: Body, val linearOffset: Vec2 = Vec2.Zero, val angularOffset: Float = 0.0f, val maxForce: Float = 1.0f, val maxTorque: Float = 1.0f, val correctionFactor: Float = 0.3f, val collideConnected: Boolean = false)

Motor joint definition.

A motor joint lets you control the motion of a body by specifying target position and rotation offsets. You can set the maximum motor force and torque that will be applied to reach the target. If the body is blocked, it will stop and the contact forces will be proportional to the maximum motor force and torque.

Parameters

bodyA

The first attached body

bodyB

The second attached body

Constructors

Link copied to clipboard
constructor(bodyA: Body, bodyB: Body, linearOffset: Vec2 = Vec2.Zero, angularOffset: Float = 0.0f, maxForce: Float = 1.0f, maxTorque: Float = 1.0f, correctionFactor: Float = 0.3f, collideConnected: Boolean = false)

Properties

Link copied to clipboard

The bodyB angle minus bodyA angle in radians

Link copied to clipboard
val bodyA: Body
Link copied to clipboard
val bodyB: Body
Link copied to clipboard

Set this flag to true if the attached bodies should collide

Link copied to clipboard

Position correction factor in the range 0,1

Link copied to clipboard

Position of bodyB minus the position of bodyA, in bodyA's frame

Link copied to clipboard

The maximum motor force in newtons

Link copied to clipboard

The maximum motor torque in newton-meters