public void updateYawAndPitch()
    {
    	// Work out the time that has elapsed since we last updated the values.
    	// (We need to do this because we can't guarantee that this method will be
    	// called at a constant frequency.)
    	long timeNow = System.currentTimeMillis();
    	long deltaTime = timeNow - this.lastAngularUpdateTime;
    	this.lastAngularUpdateTime = timeNow;
    	
    	// Work out how much the yaw and pitch should have changed in that time:
    	double overclockScale = 50.0 / (double)TimeHelper.serverTickLength;
    	double deltaYaw = this.yawScale * overclockScale * this.maxAngularVelocityDegreesPerSecond * (deltaTime / 1000.0);
    	double deltaPitch = this.pitchScale * overclockScale * this.maxAngularVelocityDegreesPerSecond * (deltaTime / 1000.0);

    	// And update them:
        mYaw += deltaYaw;
        mCameraPitch += deltaPitch;
        mCameraPitch = (mCameraPitch < -90) ? -90 : (mCameraPitch > 90 ? 90 : mCameraPitch);    // Clamp to [-90, 90]

        // And update the player:
        EntityPlayerSP player = Minecraft.getMinecraft().player;
        if (player != null)
        {
            player.rotationPitch = this.mCameraPitch;
            player.rotationYaw = this.mYaw;
        }

    }
public void updateYawAndPitch ( ) { long timeNow = System . currentTimeMillis ( ) ; long deltaTime = timeNow - this . lastAngularUpdateTime ; this . lastAngularUpdateTime = timeNow ; double overclockScale = 50.0 / ( double ) TimeHelper . serverTickLength ; double deltaYaw = this . yawScale * overclockScale * this . maxAngularVelocityDegreesPerSecond * ( deltaTime / 1000.0 ) ; double deltaPitch = this . pitchScale * overclockScale * this . maxAngularVelocityDegreesPerSecond * ( deltaTime / 1000.0 ) ; mYaw += deltaYaw ; mCameraPitch += deltaPitch ; mCameraPitch = ( mCameraPitch < - 90 ) ? - 90 : ( mCameraPitch > 90 ? 90 : mCameraPitch ) ; EntityPlayerSP player = Minecraft . getMinecraft ( ) . player ; if ( player != null ) { player . rotationPitch = this . mCameraPitch ; player . rotationYaw = this . mYaw ; } }
Called to turn the robot / move the camera.