public void Initialise(Body body0, Vector3 body0Pos, Body body1, Vector3 body1Pos, float allowedDistance, float timescale) { this.body0Pos = body0Pos; this.body1Pos = body1Pos; this.body0 = body0; this.body1 = body1; this.allowedDistance = allowedDistance; this.timescale = timescale; if (timescale < JiggleMath.Epsilon) timescale = JiggleMath.Epsilon; if (body0 != null) body0.AddConstraint(this); if (body1 != null) body1.AddConstraint(this); }
public void Initialise(Body body, Vector3 pointOnBody, Vector3 worldPosition) { this.body = body; this.pointOnBody = pointOnBody; this.worldPosition = worldPosition; if (body!=null) body.AddConstraint(this); }