Пример #1
0
void plSpanInstance::prcWrite(pfPrcHelper* prc) {
    prc->writeSimpleTag("plSpanInstance");

    prc->writeTagNoBreak("Local2World");
    prc->directWrite(
        ST::format("[ {_0.4f}, {_0.4f}, {_0.4f}, {_0.4f} "
                   "; {_0.4f}, {_0.4f}, {_0.4f}, {_0.4f} "
                   "; {_0.4f}, {_0.4f}, {_0.4f}, {_0.4f} ]",
                   fL2W[0][0], fL2W[0][1], fL2W[0][2], fL2W[0][3],
                   fL2W[1][0], fL2W[1][1], fL2W[1][2], fL2W[1][3],
                   fL2W[2][0], fL2W[2][1], fL2W[2][2], fL2W[2][3]));
    prc->closeTagNoBreak();

    prc->writeSimpleTag("PosDeltas");
    std::vector<hsVector3> verts = getPosDeltas();
    for (size_t i=0; i<verts.size(); i++)
        verts[i].prcWrite(prc);
    prc->closeTag();

    prc->writeSimpleTag("Colors");
    std::vector<unsigned int> colors = getColors();
    for (size_t i=0; i<colors.size(); i++) {
        prc->startTag("Color");
        prc->writeParamHex("value", colors[i]);
        prc->endTag(true);
    }
    prc->closeTag();

    prc->closeTag();
}
Пример #2
0
void plSpanInstance::prcWrite(pfPrcHelper* prc) {
    prc->writeSimpleTag("plSpanInstance");

    prc->writeTagNoBreak("Local2World");
    prc->getStream()->writeStr(
        plString::Format("[ %.04f, %.04f, %.04f, %.04f "
                         "; %.04f, %.04f, %.04f, %.04f "
                         "; %.04f, %.04f, %.04f, %.04f ]",
                         fL2W[0][0], fL2W[0][1], fL2W[0][2], fL2W[0][3],
                         fL2W[1][0], fL2W[1][1], fL2W[1][2], fL2W[1][3],
                         fL2W[2][0], fL2W[2][1], fL2W[2][2], fL2W[2][3]));
    prc->closeTagNoBreak();

    prc->writeSimpleTag("PosDeltas");
    hsTArray<hsVector3> verts = getPosDeltas();
    for (size_t i=0; i<verts.getSize(); i++)
        verts[i].prcWrite(prc);
    prc->closeTag();

    prc->writeSimpleTag("Colors");
    hsTArray<unsigned int> colors = getColors();
    for (size_t i=0; i<colors.getSize(); i++) {
        prc->startTag("Color");
        prc->writeParamHex("value", colors[i]);
        prc->endTag(true);
    }
    prc->closeTag();

    prc->closeTag();
}