Utility functions for creating Joints.

Methods

  • Creates a single Joint to attach a RigidBody to a fixed point on the singleton Scrim, at the current world position of the attachment point. See Scrim.getScrim.

    Parameters

    • sim: ContactSim

      the ContactSim to which the Joint is added

    • body: RigidBody

      the RigidBody to add joints to

    • attach_body: Vector

      the point to place the Joint in body coordinates

    • normalType: CoordType

      whether the normal should be in body or world coords

    • normal: Vector

      the normal Vector that determines the direction of the Joint

    Returns Joint

    the Joint that is created

  • Creates a single Joint to attach two RigidBodys. The second body is moved to align with the first body, see Joint.align.

    Parameters

    • sim: ContactSim

      the ContactSim to which the Joint is added

    • body1: RigidBody

      the first RigidBody

    • attach1_body: Vector

      the attachment point on body1, in body coordinates

    • body2: RigidBody

      the second RigidBody

    • attach2_body: Vector

      the attachment point on body2 in body coordinates

    • normalType: CoordType

      whether the normal is in body or world coords

    • normal: Vector

      the normal Vector that determines the direction of the Joint

    Returns Joint

    the Joint that is created

  • Creates two Joints with perpendicular normals to attach a RigidBody to a fixed point on the singleton Scrim, at the current world position of the attachment point. See Scrim.getScrim.

    Parameters

    • sim: ContactSim

      the ContactSim to which the Joint is added

    • body: RigidBody

      the RigidBody to add joints to

    • attach_body: Vector

      the point on the RigidBody to place the joints, in body coordinates

    • normalType: CoordType

      whether the normal should be in body or world coords

    Returns void

  • Creates two Joints with perpendicular normals to attach two RigidBodys. The second body is moved to align with the first body, see Joint.align. The normal vectors are (0, 1) and (1, 0), in either body coordinates or world coordinates as specified by the CoordType.

    Parameters

    • sim: ContactSim

      the ContactSim to which the Joint is added

    • body1: RigidBody

      the first RigidBody

    • attach1_body: Vector

      the attachment point on body1, in body coordinates

    • body2: RigidBody

      the second RigidBody

    • attach2_body: Vector

      the attachment point on body2, in body coordinates

    • normalType: CoordType

      whether the normal should be in body or world coords

    Returns void

Generated using TypeDoc