示例#1
0
void cCollider::getCoordinates(sf::Sprite& thisSprite)
{
    setMinX(thisSprite.GetPosition().x);
    setMaxY(thisSprite.GetPosition().y);
    if (maxY > 763) {
        setOnGround(true);
        //rThisSprite.SetY(763);
    }
    else {
        setOnGround(false);
    }
    maxX = minX + width;
    minY = maxY - height;
}
示例#2
0
Lib_dialog::Lib_dialog(const QString lib_path) :
    QDialog(NULL),
    ui(new Ui::Lib_dialog)
{
    ui->setupUi(this);
    fx.setPath(lib_path);


    QMenuBar *menuBar = new QMenuBar(this);
    QAction *action_save= new QAction("save",this);
    QAction *action_change= new QAction("change",this);
    QAction *action_load= new QAction("load",this);

    menuBar->insertAction(NULL,action_save);
    menuBar->insertAction(NULL,action_change);
    menuBar->insertAction(NULL,action_load);



    connect(action_save,SIGNAL( triggered()) ,this,SLOT(save()));
    connect(action_load,SIGNAL( triggered()),this,SLOT(open()));
    connect(action_change,SIGNAL( triggered()),this,SLOT(changelist()));


    connect(ui->widget, SIGNAL(looking(int*,int*)), this, SLOT(looking(int*,int*)));
    connect(ui->widget, SIGNAL(setXY(int,int)), this, SLOT(setXY(int,int)));
    connect(ui->widget, SIGNAL(addPoint()), this, SLOT(addPoint()));
    connect(ui->MaxX,SIGNAL(textChanged ()),this,SLOT(setMaxX()));
    connect(ui->MinX,SIGNAL(textChanged ()),this,SLOT(setMinX()));
    connect(ui->MinY,SIGNAL(textChanged ()),this,SLOT(setMinY()));
    connect(ui->MaxY,SIGNAL(textChanged ()),this,SLOT(setMaxY()));
    connect(ui->LX,SIGNAL(textChanged ()),this,SLOT(setX()));
    connect(ui->LY,SIGNAL(textChanged ()),this,SLOT(setY()));
    connect(ui->gridX,SIGNAL(textChanged ()),this,SLOT(setgridX()));
    connect(ui->gridY,SIGNAL(textChanged ()),this,SLOT(setgridY()));
    connect(ui->widget,SIGNAL(drw ()),this,SLOT( draw ()));
    connect(ui->widget,SIGNAL(del ()),this,SLOT( del ()));
    connect(ui->widget,SIGNAL(correct ()),this,SLOT( correct ()));
    connect(ui->widget,SIGNAL(save ()),this,SLOT( save ()));
    connect(ui->widget,SIGNAL(open ()),this,SLOT( open ()));
    connect(ui->widget,SIGNAL(changegrid()),this,SLOT( changegrid()));
    connect(ui->widget,SIGNAL(change(int,int)),this,SLOT(change(int,int)));

    //-------------------------------------------------------------------------------------------
    // в lib_path я передам адрес библиотеки(папки с файлами). Сохрани его сам кудато)))        //
    //--------------------------------------------------------------------------------------------
}
示例#3
0
void Boundary::refer(const Boundary &boundary)
{
    if (boundary.minX () < minX ())
        setMinX (boundary.minX ());
    if (boundary.maxX () > maxX ())
        setMaxX (boundary.maxX ());

    if (boundary.minY () < minY ())
        setMinY (boundary.minY ());
    if (boundary.maxY () > maxY ())
        setMaxY (boundary.maxY ());

    if (boundary.minZ () < minZ ())
        setMinZ (boundary.minZ ());
    if (boundary.maxZ () > maxZ ())
        setMaxZ (boundary.maxZ ());
}
示例#4
0
void Boundary::refer(const xjPoint &point)
{
    if (point.x () < minX ())
        setMinX (point.x ());
    if (point.x () > maxX ())
        setMaxX (point.x ());

    if (point.y () < minY ())
        setMinY (point.y ());
    if (point.y () > maxY ())
        setMaxY (point.y ());

    if (point.z () < minZ ())
        setMinZ (point.z ());
    if (point.z () > maxZ ())
        setMaxZ (point.z ());
}
示例#5
0
void CAABB_f::setMin(float x, float y)
{
	setMinX(x);
	setMinY(y);
}