MotherShip.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        InputUpdate ();

        yawInput = 0f;
        pitchInput = 0f;
        rollInput = 0f;

        if (this.YawAndPitchInput != null) {
            this.YawAndPitchInput ();
        }

        forwardVelocity = Vector3.Dot (this.speed, this.transform.forward);
        rightVelocity = Vector3.Dot (this.speed, this.transform.right);
        upVelocity = Vector3.Dot (this.speed, this.transform.up);

        float sqrForwardVelocity = forwardVelocity * Mathf.Abs (forwardVelocity);
        float sqrRightVelocity = rightVelocity * Mathf.Abs (rightVelocity);
        float sqrUpVelocity = upVelocity * Mathf.Abs (upVelocity);

        this.speed += ((enginePow - sqrForwardVelocity * this.cForward * this.localAtm) * this.transform.forward) * Time.deltaTime;

        this.speed += (- sqrForwardVelocity * this.cForward * this.transform.forward * this.localAtm) * Time.deltaTime;
        this.speed += (- sqrRightVelocity * this.cRight * this.transform.right) * Time.deltaTime;
        this.speed += (- sqrUpVelocity * this.cUp * this.transform.up) * Time.deltaTime;

        this.rotationSpeed.x += - this.pitchSpeed * pitchInput * Time.deltaTime;
        this.rotationSpeed.y += this.yawSpeed * yawInput * Time.deltaTime;
        this.rotationSpeed.z += this.rollSpeed * rollInput * Time.deltaTime;

        this.rotationSpeed.x *= (1f - this.cPitch * Time.deltaTime);
        this.rotationSpeed.y *= (1f - this.cYaw * Time.deltaTime);
        this.rotationSpeed.z *= (1f - this.cRoll * Time.deltaTime);

        this.speed += (this.CRigidbody.mass * this.UpdatePlanets ()) * Time.deltaTime;

        if (this.pilotMode == PilotState.Orbit) {
            this.transform.position = this.transform.position + this.transform.up * (this.orbitalPlanetDist - this.DistFor (this.orbitPlanet));
        }

        this.transform.position += this.speed * Time.deltaTime;
        this.transform.RotateAround (this.transform.position, this.transform.right, this.rotationSpeed.x * Time.deltaTime);
        this.transform.RotateAround (this.transform.position, this.transform.up, this.rotationSpeed.y * Time.deltaTime);
        this.transform.RotateAround (this.transform.position, this.transform.forward, this.rotationSpeed.z * Time.deltaTime);
    }