Example #1
0
    public override void DriveJoint(Vector3 input, JointDriveState driveState)
    {
        if (!this.enabled)
        {
            input = Vector3.zero;
        }
        targetAngle = input;

        joint.targetRotation = (Quaternion.Euler(input));
    }
Example #2
0
    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;
    }
Example #3
0
 public virtual void DriveJoint(Vector3 angle, JointDriveState driveState)
 {
     Debug.LogError("Warning Shoudl not be called");
 }