Skip to content

physics.CreateDampenedSpringConstraint

Jérôme Leclercq edited this page Dec 8, 2020 · 1 revision

API: physics.CreateDampenedSpringConstraint

Description:

Creates a spring constraint between two entities.

Prototype:

physics.CreateDampenedSpringConstraint(first: Entity, second: Entity, firstAnchor: vec2, secondAnchor: vec2, restLength: number, stiffness: number, damping: number) -> constraint: DampedSpringConstraint

Parameters:

  1. first: First entity of the constraint.
  2. second: Second entity of the constraint.
  3. firstAnchor: First entity position offset to attach the constraint to.
  4. secondAnchor: Second entity position offset to attach the constraint to.
  5. restLength: The distance the springs want to be.
  6. stiffness: Spring constant (see Young's modulus).
  7. damping: How soft to make the damping of the spring.

Returns:

  1. constraint: The newly created constraint.

Clone this wiki locally