- Procedure TSteeringWheelJoint.SubmitConstraints;
- var Pivot0 : TVector3f;
- Pivot1 : TVector3f;
- LateralDir0 : TVector3f;
- LateralDir1 : TVector3f;
- FrontDir0 : TVector3f;
- FrontDir1 : TVector3f;
- UpDir0 : TVector3f;
- UpDir1 : TVector3f;
- Angle : Single;
- p0, p1 : TVector3f;
- Begin
- ... Calculation of Pivot0 (Child = Wheel), Pivot1 (Parent = Chassis) and the orthonormal coordinate system ...
- //----------------------------------------------------------------------------
- // Fix Child-Pivot (Wheel) to Parent-Pivot:
- //----------------------------------------------------------------------------
- NewtonUserJointAddLinearRow(FJoint, @Pivot0[0], @Pivot1[0], @LateralDir0[0]);
- NewtonUserJointAddLinearRow(FJoint, @Pivot0[0], @Pivot1[0], @UpDir0[0]);
- NewtonUserJointAddLinearRow(FJoint, @Pivot0[0], @Pivot1[0], @FrontDir0[0]);
- //----------------------------------------------------------------------------
- // Second point for the stability:
- //----------------------------------------------------------------------------
- p0:= addVects(Pivot0, UpDir1);
- p1:= addVects(Pivot1, UpDir1);
- NewtonUserJointAddLinearRow(FJoint, @p0[0], @p1[0], @LateralDir0[0]);
- ... calculate Angle Error ...
- //----------------------------------------------------------------------------
- // AngularRow to steer:
- //----------------------------------------------------------------------------
- NewtonUserJointAddAngularRow(FJoint, Angle, @UpDir1[0]);
- End;