public override void DriveJoint(Vector3 input, JointDriveState driveState) { if (!this.enabled) { input = Vector3.zero; } targetAngle = input; joint.targetRotation = (Quaternion.Euler(input)); }
public override void DriveJoint(float input, JointDriveState driveState) { JointMotor motor = joint.motor; if (driveState == JointDriveState.Position) { motorSpeed = k * ((input - joint.angle) - joint.velocity); } else if (driveState == JointDriveState.Velocity) { motorSpeed = input; } targetAngle = input; motor.targetVelocity = motorSpeed; joint.motor = motor; }
public virtual void DriveJoint(Vector3 angle, JointDriveState driveState) { Debug.LogError("Warning Shoudl not be called"); }