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
    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.º 4
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.º 5
0
 public void SetMatrix(FMatrix matrix)
 {
     _matrix.CopyValues(matrix);
     _didSetMatrix  = true;
     _isMatrixDirty = true;
 }