Exemplo n.º 1
0
 //
 // Reset
 //
 public void Reset()
 {
     m_SelectedPart = E_SelectedPart.E_SP_NONE;
     m_Scale.x      = 1.0f;
     m_Scale.y      = 1.0f;
     m_Rot          = 0.0f;
 }
Exemplo n.º 2
0
    //
    // Test all touchables parts of gizmo when is in Rotate mode
    //
    bool IsTouchedRotate(Vector2 mouseScreenPos)
    {
        // Test all 4 lines
        for (int i = 0; i < 4; ++i)
        {
            if (TestAreaTouch(m_Pos, m_Rot - HALF_PI * i, DEFAULT_AXE_LENGTH, DEFAULT_AXE_TOUCHSIZE, mouseScreenPos))
            {
                m_SelectedPart = E_SelectedPart.E_SP_PIVOT;
                return(true);
            }
        }

        return(false);
    }
Exemplo n.º 3
0
    //
    // Test all touchables parts of gizmo when is in Scale mode
    //
    bool IsTouchedScale(Vector2 mouseScreenPos)
    {
        // Test center point
        if (TestPointTouch(m_Pos, DEFAULT_POINT_RADIUS, mouseScreenPos))
        {
            m_SelectedPart = E_SelectedPart.E_SP_PIVOT;
            return(true);
        }
        // Test X axe
        else if (TestAreaTouch(m_Pos, m_Rot, DEFAULT_AXE_LENGTH, DEFAULT_AXE_TOUCHSIZE, mouseScreenPos))
        {
            m_SelectedPart = E_SelectedPart.E_SP_AXE_X;
            return(true);
        }
        // Test Y axe
        else if (TestAreaTouch(m_Pos, m_Rot - HALF_PI, DEFAULT_AXE_LENGTH, DEFAULT_AXE_TOUCHSIZE, mouseScreenPos))
        {
            m_SelectedPart = E_SelectedPart.E_SP_AXE_Y;
            return(true);
        }

        return(false);
    }