search

Class myphysicslab.lab.engine2D.PathEndPoint

Provided By
Extends
All Implemented Interfaces

Generates a collision when the attachment point on a RigidBody moves past a certain point on a path so that the RigidBody cannot move past that point. The RigidBody would typically be connected to the path with a myphysicslab.lab.engine2D.PathJoint, and so can move along the path.

Implementation Notes

Note that the current position of the body determines where on the path we detect the body is, and this is stored in a PathPoint. We do a global search over the entire path here for the closest point on the path to the attachment point, see myphysicslab.lab.model.NumericalPath#findNearestGlobal, whereas later on we do a local search starting at the current PathPoint position, see myphysicslab.lab.model.NumericalPath#findNearestLocal.

NOTE: Does not deal with case where the body crosses the 'stitch' point in a closed loop path.

new PathEndPoint( name, path, body, attach_body, limit, upperLimit )

Parameters
namestring

the name of this SimObject

pathmyphysicslab.lab.model.NumericalPath

the path to connect

bodymyphysicslab.lab.engine2D.RigidBody

the RigidBody to connect

attach_bodymyphysicslab.lab.util.Vector

the attachment point on the RigidBody in body coordinates

limitnumber

the limiting value of the path position, p, when the body moves beyond this then a collision is created.

upperLimitboolean

true means this is an is an upper limit; false indicates this is a lower limit

Instance Methods