CJ AddLinearRow

From Newton Wiki
Revision as of 08:02, 10 June 2019 by Unknown user (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NewtonUserJointAddLinearRow is used for to drive relative distance, speed and acceleration between a point on each body to zero. To understand this, read the following with reference to the image further down.

  1. You decide upon two points, fixed on each body respectively. It is the relative quantites between these two points that will be driven to zero.
  2. Each time the constraint is calculated, you pass the global position of these two points as pivot0 and pivot1.
  3. Also, you provide a dir vector which defines the direction in which the quantities are reduced to zero. Therefore you drive to zero one axis at a time.

To understand what Newton does imagine the following:

  1. Draw vectors through both points in the same direction as the dir vector
  2. Through each pivot point draw a line perpendicular to the dir vectors, that meets the the other body's dir vector
  3. The distance between these two lines is what Newton drives to 0
  4. An equivalent process is also done for velocity and acceleration

NewtonUserJointAddLinearRow01.jpg

By continuously driving the variables to zero the joint effectively maintains rigidity along the dir vector. The examples in the next few sections should hopefully give you a better understanding of how this works in practice.

Links