示例#1
0
    }//

    void calculateSpeed()
    {
        speed.x = xAccelerator.move(0, m_InputData.horizontalMove, false);
        speed.y = yAccelerator.move(0, m_InputData.mouseButton, false);
        speed.z = zAccelerator.move(0, m_InputData.verticalMove, false);

        Vector3 temp = speed.x * transform.right + speed.y * transform.up + speed.z * transform.forward;

        speed = temp / boundsScale * 2;
    }
示例#2
0
    void calculateWalkSpeeds()
    {
        relativeWalkingSpeed.x = xAccelerator.move(relativeWalkingSpeed.x, m_InputData.horizontalMove, m_fall.getIsFloored());

        relativeWalkingSpeed.z = zAccelerator.move(relativeWalkingSpeed.z, m_InputData.verticalMove, m_fall.getIsFloored());

        //normalise x z movement if necessary and point them in their appropriate global direction

        Vector3 temp = (transform.right * relativeWalkingSpeed.x + transform.forward * relativeWalkingSpeed.z);

        absoluteWalkingSpeed = temp;
    }