Ejemplo n.º 1
0
    public void UpdateMatrix()
    {
        if (!_isMatrixDirty)
        {
            return;
        }

        //do NOT set _isMatrixDirty to false here because it is used in the redraw loop and will be set false then

        _matrix.SetScaleThenRotate(_x, _y, _scaleX, _scaleY, _rotation * -RXMath.DTOR);

        if (_container != null)
        {
            _concatenatedMatrix.ConcatAndCopyValues(_matrix, _container.concatenatedMatrix);
        }
        else
        {
            _concatenatedMatrix.CopyValues(_matrix);
        }

        if (_needsSpecialMatrices)
        {
            if (_stage != null)
            {
                _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
                _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix, _stage.screenConcatenatedMatrix);
                _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
            }
        }
    }
Ejemplo n.º 2
0
    public void UpdateMatrix()
    {
        if (!_isMatrixDirty)
        {
            return;
        }

        _isMatrixDirty = false;

        _matrix.SetScaleThenRotate(_x, _y, _scaleX, _scaleY, _rotation * -RXMath.DTOR);

        if (_container != null)
        {
            _concatenatedMatrix.ConcatAndCopyValues(_matrix, _container.concatenatedMatrix);
        }
        else
        {
            _concatenatedMatrix.CopyValues(_matrix);
        }

        if (_needsSpecialMatrices)
        {
            _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
            _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix, _stage.screenConcatenatedMatrix);
            _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
        }
    }
Ejemplo n.º 3
0
    protected void CreateSpecialMatrices()
    {
        _needsSpecialMatrices = true;         //after now the matrices will be updated on redraw

        _inverseConcatenatedMatrix       = new FMatrix();
        _screenConcatenatedMatrix        = new FMatrix();
        _screenInverseConcatenatedMatrix = new FMatrix();

        _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
        _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix, _stage.screenConcatenatedMatrix);
        _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
    }
Ejemplo n.º 4
0
    public void UpdateMatrix()
    {
        if (!_isMatrixDirty)
        {
            return;
        }

        //do NOT set _isMatrixDirty to false here because it is used in the redraw loop and will be set false then

        if (!_didSetMatrix)
        {
            _matrix.SetScaleThenRotate(_x, _y, _scaleX, _scaleY, _rotation * -0.01745329f);          //0.01745329 is RXMath.DTOR
        }

        if (_container != null)
        {
            _concatenatedMatrix.ConcatAndCopyValues(_matrix, _container.concatenatedMatrix);
        }
        else
        {
            _concatenatedMatrix.CopyValues(_matrix);
        }

        if (_needsSpecialMatrices)
        {
            _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);

            if (_isOnStage)
            {
                _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix, _stage.screenConcatenatedMatrix);
            }
            else
            {
                _screenConcatenatedMatrix.CopyValues(_concatenatedMatrix);                         //if it's not on the stage, just use its normal matrix
            }

            _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
        }
    }
Ejemplo n.º 5
0
    protected void CreateSpecialMatrices()
    {
        _needsSpecialMatrices = true;         //after now the matrices will be updated on redraw

        _inverseConcatenatedMatrix       = new FMatrix();
        _screenConcatenatedMatrix        = new FMatrix();
        _screenInverseConcatenatedMatrix = new FMatrix();

        if (_isOnStage)
        {
            _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
            _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix, _stage.screenConcatenatedMatrix);
            _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
        }
        else
        {
            Debug.LogWarning("Futile: Warning! You're probably trying to use GlobalToLocal/LocalToLocal with an object that isn't currently part of the display list");
        }
    }
Ejemplo n.º 6
0
    virtual protected void UpdateDepthMatrixAlpha(bool shouldForceDirty, bool shouldUpdateDepth)
    {
        if (shouldUpdateDepth)
        {
            _depth = _stage.nextNodeDepth++;
        }

        if (_isMatrixDirty || shouldForceDirty)
        {
            _isMatrixDirty = false;

            _matrix.SetScaleThenRotate(_x, _y, _scaleX, _scaleY, _rotation * -RXMath.DTOR);

            if (_container != null)
            {
                _concatenatedMatrix.ConcatAndCopyValues(_matrix, _container.concatenatedMatrix);
            }
            else
            {
                _concatenatedMatrix.CopyValues(_matrix);
            }

            if (_needsInverseConcatenatedMatrix)
            {
                _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
            }
        }

        if (_isAlphaDirty || shouldForceDirty)
        {
            _isAlphaDirty = false;

            if (_container != null)
            {
                _concatenatedAlpha = _container.concatenatedAlpha * _alpha * _visibleAlpha;
            }
            else
            {
                _concatenatedAlpha = _alpha * _visibleAlpha;
            }
        }
    }
Ejemplo n.º 7
0
    protected void CreateSpecialMatrices()
    {
        _needsSpecialMatrices = true; //after now the matrices will be updated on redraw

        _inverseConcatenatedMatrix = new FMatrix();
        _screenConcatenatedMatrix = new FMatrix();
        _screenInverseConcatenatedMatrix = new FMatrix();

        if(_isOnStage)
        {
            _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
            _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix,_stage.screenConcatenatedMatrix);
            _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
        }
        else
        {
            Debug.LogWarning("Futile: Warning! You're probably trying to use GlobalToLocal/LocalToLocal with an object that isn't currently part of the display list");
        }
    }
Ejemplo n.º 8
0
    protected void CreateSpecialMatrices()
    {
        _needsSpecialMatrices = true; //after now the matrices will be updated on redraw

        _inverseConcatenatedMatrix = new FMatrix();
        _screenConcatenatedMatrix = new FMatrix();
        _screenInverseConcatenatedMatrix = new FMatrix();

        _inverseConcatenatedMatrix.InvertAndCopyValues(_concatenatedMatrix);
        _screenConcatenatedMatrix.ConcatAndCopyValues(_concatenatedMatrix, _stage.screenConcatenatedMatrix);
        _screenInverseConcatenatedMatrix.InvertAndCopyValues(_screenConcatenatedMatrix);
    }