예제 #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;
}
예제 #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);
}
예제 #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);
}