Ejemplo n.º 1
0
static void cxPolygonReadAttr(cxReaderAttrInfo *info)
{
    cxSpriteReadAttr(info);
    cxConstChars points = cxXMLAttr(info->reader, "cxPolygon.points");
    CX_RETURN(points == NULL);
    cxTypes type = cxEngineTypes(points);
    CX_ASSERT(cxTypesIsType(type, cxTypesArray), "must is array");
    cxArray list = type->any;
    CX_ARRAY_FOREACH(list, ele){
        cxNumber bp = cxArrayObject(ele);
        cxPolygonAppend(info->object, cxNumberToPoint(bp));
    }
Ejemplo n.º 2
0
cxVec2f cxWindowPointToViewPoint(cxAny pview,cxVec2f wPoint)
{
    cxView this = pview;
    cxView pv = this;
    cxVec3f out;
    cxMatrix4f matrix;
    kmVec3Fill(&out, wPoint.x, wPoint.y, 0);
    cxArray list = CX_ALLOC(cxArray);
    while (pv != NULL && pv->parentView != NULL) {
        cxArrayAppend(list, pv);
        pv = pv->parentView;
    }
    CX_ARRAY_REVERSE(list, ele){
        pv = cxArrayObject(ele);
        kmMat4Inverse(&matrix, &pv->normalMatrix);
        kmVec3Transform(&out, &out, &matrix);
        kmMat4Inverse(&matrix, &pv->anchorMatrix);
        kmVec3Transform(&out, &out, &matrix);
    }