Exemplo n.º 1
0
//*********************************************************
bool CCustomMatrix::set(bool newOn, const NLMISC::CMatrix &newMat)
{
    if (newOn)
    {
        if (On)
        {
            float srcMatUnpacked[16];
            float destMatUnpacked[16];
            Matrix.get(srcMatUnpacked);
            newMat.get(destMatUnpacked);
            if (std::equal(srcMatUnpacked, srcMatUnpacked + 16, destMatUnpacked)) return false;
        }
        On = newOn;
        Matrix = newMat;
        return true;
    }

    Matrix = newMat;
    if (newOn != On)
    {
        On = newOn;
        return true;
    }

    return false;
}
Exemplo n.º 2
0
void CGPUProgramParams::set4x4f(const std::string &name, const NLMISC::CMatrix& m)
{
	// TODO: Verify this!
	float *f = getPtrFByOffset(allocOffset(name, 4, 4, Float));
	NLMISC::CMatrix mt = m;
	mt.transpose();
	mt.get(f);
}
Exemplo n.º 3
0
void CGPUProgramParams::set4x4f(uint index, const NLMISC::CMatrix& m)
{
	// TODO: Verify this!
	float *f = getPtrFByOffset(allocOffset(index, 4, 4, Float));
	NLMISC::CMatrix mt = m;
	mt.transpose();
	mt.get(f);
}