public void Initialise(Body body, ReferenceFrame frame, Vector3?vel, Vector3?angVel) { this.body = body; this.frame = frame; doVel = vel != null; doAngVel = angVel != null; if (doVel) { targetVel = (Vector3)vel; } if (doAngVel) { targetAngVel = (Vector3)angVel; } if (body != null) { vel = body.Velocity; angVel = body.AngularVelocity; } else { vel = Vector3.Zero; angVel = Vector3.Zero; } velRate = Vector3.Zero; angVelRate = Vector3.Zero; body?.AddConstraint(this); }
public void Initialise(Body body, Vector3 pointOnBody, Vector3 worldPosition) { Body = body; this.pointOnBody = pointOnBody; this.worldPosition = worldPosition; body?.AddConstraint(this); }
/// <summary> /// Initialise /// </summary> /// <param name="body"></param> /// <param name="pointOnBody"></param> /// <param name="worldPosition"></param> public void Initialise(Body body, Vector3 pointOnBody, Vector3 worldPosition) { this.body = body; this.pointOnBody = pointOnBody; this.worldPosition = worldPosition; if (body != null) { body.AddConstraint(this); } }
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; } body0?.AddConstraint(this); body1?.AddConstraint(this); }
public void Initialise(Body body, ReferenceFrame frame, Vector3? vel, Vector3? angVel) { this.body = body; this.frame = frame; this.doVel = (vel != null); this.doAngVel = (angVel != null); if (doVel) targetVel = (Vector3)vel; if (doAngVel) targetAngVel = (Vector3)angVel; if (body != null) { vel = body.Velocity; angVel = body.AngularVelocity; } else { vel = Vector3.Zero; angVel = Vector3.Zero; } velRate = Vector3.Zero; angVelRate = Vector3.Zero; if (body != null) body.AddConstraint(this); }
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); }