예제 #1
0
파일: vector.cpp 프로젝트: MP2E/dlight
kexVec4 kexVec4::operator|(const kexMatrix &mtx) {
    return kexVec4(
        mtx.vectors[1].x * y + mtx.vectors[2].x * z + mtx.vectors[0].x * x + mtx.vectors[3].x,
        mtx.vectors[1].y * y + mtx.vectors[2].y * z + mtx.vectors[0].y * x + mtx.vectors[3].y,
        mtx.vectors[1].z * y + mtx.vectors[2].z * z + mtx.vectors[0].z * x + mtx.vectors[3].z,
        mtx.vectors[1].w * y + mtx.vectors[2].w * z + mtx.vectors[0].w * x + mtx.vectors[3].w);
}
예제 #2
0
파일: script.cpp 프로젝트: svkaiser/TurokEX
kexVec4 kexLexer::GetVector4(void) {
#ifdef SC_DEBUG
    SC_DebugPrintf("get vector4 (%s)\n", token);
#endif

    float x, y, z, w;

    ExpectNextToken(TK_LBRACK);
    x = (float)GetFloat();
    y = (float)GetFloat();
    z = (float)GetFloat();
    w = (float)GetFloat();
    ExpectNextToken(TK_RBRACK);

    return kexVec4(x, y, z, w);
}