Represents a bilateral contact point between a RigidBody and a NumericalPath.

Bilateral means that force can be applied to push or pull in the direction of the normal for the contact (in contrast to a contact force which can only push and never pull). The normal vector is determined by the NumericalPath. The normal vector specifies the direction along which the PathJoint operates: forces are calculated (by the engine2D physics engine) to keep the distance in the normal direction at zero between the two attachment points of the PathJoint.

A PathJoint is immutable: it cannot be changed after it is constructed.

A single PathJoint by itself will give a 'sliding track' type of connection. The attachment points must have zero distance between them as measured in the direction of the normal for the PathJoint, but in the direction orthogonal to the normal the attachment points are free to move.

Note that some slippage of a PathJoint can occur over time, especially when there is very fast rotation.

Hierarchy (view full)

Implements

Constructors

Properties

attach_body_: Vector

attachment point in body coords of this.body_

path that joint is attached to

ppt_: PathPoint

last position along the path

ID: number = 1

Counter used for naming SimObjects.

Methods

  • Adds RigidBodyCollisions for this Connector to an array of collisions.

    Parameters

    • collisions: RigidBodyCollision[]

      the array of collisions to which to add the RigidBodyCollision for this Connector.

    • time: number

      simulation time when this collision is detected

    • _accuracy: number

      distance accuracy: how close we must be to the point of collision in order to be able to handle it.

    Returns void

  • Aligns the RigidBodys connected by this Connector. See the documentation for the particular Connector for how the alignment is done.

    Returns void

  • Aligns two attachment points on the body to be on the path.

    Parameters

    • b2: Vector

      the second attachment point on the RigidBody in body coordinates

    Returns void

  • Name of this SimObject, either the language-independent name for scripting purposes or the localized name for display to user.

    The language-independent name should be the same as the English version but capitalized and with spaces and dashes replaced by underscore, see Util.toName, nameEquals.

    The name should give an idea of the role of the SimObject in the simulation. This allows us to to treat an object in a special way depending on its name. For example, we might use the name to decide what type of DisplayObject to create to represent the SimObject.

    Parameters

    • Optional opt_localized: boolean

      true means return the localized version of the name; default is false which means return the language independent name.

    Returns string

    name of this SimObject

  • Returns the distance between attachment points of the bodies in the direction of the normal vector. This is equal to the dot product of the normal vector and the vector between the two attachment points.

    Returns number

    normal distance between attachment points of the bodies

  • Returns the PathPoint corresponding to the most recent position of this PathJoint's attachment point on the NumericalPath.

    Returns PathPoint

    the PathPoint corresponding to the most recent position of this PathJoint's attachment point on the NumericalPath.

  • Returns true if the given SimObject is similar to this SimObject for display purposes. SimObjects are similar when they are the same type and nearly the same size and location. Mainly used when showing forces - to avoid adding too many objects to the display. See SimList.getSimilar.

    Parameters

    • obj: SimObject

      the SimObject to compare to

    • Optional _opt_tolerance: number

      the amount the object components can differ by

    Returns boolean

    true if this SimObject is similar to obj for display purposes

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

Generated using TypeDoc