MouseJointDef

data class MouseJointDef(val bodyA: Body, val bodyB: Body, val target: Vec2, val maxForce: Float = 1.0f, val hertz: Float = 4.0f, val dampingRatio: Float = 1.0f, val collideConnected: Boolean = false)

Mouse joint definition.

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a max force and uses a rotation heuristic to prevent excessive rotation. This is typically used for mouse interaction.

Parameters

bodyA

The first attached body (usually a static/ground body)

bodyB

The second attached body (the one being dragged)

target

The initial world target point (where the mouse is)

Constructors

Link copied to clipboard
constructor(bodyA: Body, bodyB: Body, target: Vec2, maxForce: Float = 1.0f, hertz: Float = 4.0f, dampingRatio: Float = 1.0f, collideConnected: Boolean = false)

Properties

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

The linear damping ratio (non-dimensional)

Link copied to clipboard

The linear stiffness in Hertz

Link copied to clipboard

The maximum force in newtons

Link copied to clipboard