User Tools

Site Tools


en:examples:maths:return_object_in_boxed_area

Return an Object within a boxed area

TODO: Note this example is slightly out of date and needs fixing.

orxOBJECT* GetObjectInTheArea(){
 
    orxVECTOR objectPickVector;
    objectPickVector.fX = 878;
    objectPickVector.fY = 1185;
    objectPickVector.fZ = -1.0;
 
    orxOBOX objectBoxArea;
 
    orxVECTOR pivot = {0, 0, 0};
 
    orxVECTOR position;
    position.fX = 834;
    position.fY = 1150;
    position.fZ = -0.1;	
 
    orxVECTOR size;
    size.fX = 21;
    size.fY = 160;
    size.fZ = 1;	
 
    orxOBox_2DSet(&objectBoxArea, &position, &pivot, &size, 0);
 
    orxU32 objectGroupID = orxCamera_GetGroupID(pstCamera, 1);
 
    orxOBJECT *objectToFind = orxObject_BoxPick(&objectBoxArea, objectGroupID);
    return objectToFind;
 
}

en/examples/maths/return_object_in_boxed_area.txt · Last modified: 2021/10/05 02:22 (3 years ago) by sausage