public FrontWheelRotationConstraint(RotationDiff parent, IRotator handle, IRotator rear, IRotator destination, bool offHandleConstraint = false) { this.parent = parent; this.handle = new RotationDiff(handle); this.rear = new RotationDiff(rear); this.destination = destination; this.offHandleConstraint = offHandleConstraint; defaultRotation = destination.Rotation; }
void Awake() { bicycleRotator = new TransformRotator(transform); bicycle = new RotationDiff(bicycleRotator); handleRotator = new TransformRotator(handle); frontWheelRotator = new TransformRotator(frontWheel); rearWheelRotator = new TransformRotator(rearWheel); rightPedalCrankArmJointRotator = new TransformRotator(rightPedalCrankArmJoint); leftPedalCrankArmJointRotator = new TransformRotator(leftPedalCrankArmJoint); rightPedalJointRotator = new TransformRotator(rightPedalJoint); leftPedalJointRotator = new TransformRotator(leftPedalJoint); pedalJointConstraint = new PedalJointRotationConstraint(rightPedalCrankArmJointRotator, leftPedalCrankArmJointRotator); rearWheelConstraint = new RearWheelRotationConstraint(rightPedalCrankArmJointRotator, rearWheelRotator); frontWheelConstraint = new FrontWheelRotationConstraint(bicycle, handleRotator, rearWheelRotator, frontWheelRotator, offHandleConstraint); pedalHorizontalConstraint = new PedalHorizontalConstraint(bicycleRotator, leftPedalJointRotator, rightPedalJointRotator); }
public PedalJointRotationConstraint(IRotator pedal, IRotator destination) { this.pedal = new RotationDiff(pedal); this.destination = destination; defaultRotation = destination.Rotation; }
public RearWheelRotationConstraint(IRotator pedalJoint, IRotator destination) { this.pedalJoint = new RotationDiff(pedalJoint); this.destination = destination; defaultRotation = destination.Rotation; }