コード例 #1
0
    private static Vector3 GetPosition(SocketIOEvent e)
    {
        var aux         = e.GetField(SOCKET_DATA_FIELDS.Position);
        var newPosition = new Vector3();

        aux.GetField(ref newPosition.x, SOCKET_DATA_FIELDS.PositionX);
        aux.GetField(ref newPosition.y, SOCKET_DATA_FIELDS.PositionY);
        aux.GetField(ref newPosition.z, SOCKET_DATA_FIELDS.PositionZ);

        return(newPosition);
    }
コード例 #2
0
    private static Quaternion GetRotation(SocketIOEvent e)
    {
        var aux      = e.GetField(SOCKET_DATA_FIELDS.Rotation);
        var rotation = new Quaternion();

        aux.GetField(ref rotation.x, SOCKET_DATA_FIELDS.RotationX);
        aux.GetField(ref rotation.y, SOCKET_DATA_FIELDS.RotationY);
        aux.GetField(ref rotation.z, SOCKET_DATA_FIELDS.RotationZ);
        aux.GetField(ref rotation.w, SOCKET_DATA_FIELDS.RotationW);

        return(rotation);
    }