hedgewars/uMatrix.pas
changeset 10133 d73412fbf3b4
parent 10108 c68cf030eded
child 10306 4fca8bcfaff0
equal deleted inserted replaced
10132:701844ed50d3 10133:d73412fbf3b4
   226     Result[3,1]:=lhs[0,3]*rhs[1,0] + lhs[1,3]*rhs[1,1] + lhs[2,3]*rhs[1,2] + lhs[3,3]*rhs[1,3];
   226     Result[3,1]:=lhs[0,3]*rhs[1,0] + lhs[1,3]*rhs[1,1] + lhs[2,3]*rhs[1,2] + lhs[3,3]*rhs[1,3];
   227     Result[3,2]:=lhs[0,3]*rhs[2,0] + lhs[1,3]*rhs[2,1] + lhs[2,3]*rhs[2,2] + lhs[3,3]*rhs[2,3];
   227     Result[3,2]:=lhs[0,3]*rhs[2,0] + lhs[1,3]*rhs[2,1] + lhs[2,3]*rhs[2,2] + lhs[3,3]*rhs[2,3];
   228     Result[3,3]:=lhs[0,3]*rhs[3,0] + lhs[1,3]*rhs[3,1] + lhs[2,3]*rhs[3,2] + lhs[3,3]*rhs[3,3];
   228     Result[3,3]:=lhs[0,3]*rhs[3,0] + lhs[1,3]*rhs[3,1] + lhs[2,3]*rhs[3,2] + lhs[3,3]*rhs[3,3];
   229 }
   229 }
   230 
   230 
   231     {$IFNDEF PAS2C}
       
   232     glPushMatrix;
   231     glPushMatrix;
   233     glLoadMatrixf(@lhs[0, 0]);
   232     glLoadMatrixf(@lhs[0, 0]);
   234     glMultMatrixf(@rhs[0, 0]);
   233     glMultMatrixf(@rhs[0, 0]);
   235     glGetFloatv(GL_MODELVIEW_MATRIX, @test[0, 0]);
   234     glGetFloatv(GL_MODELVIEW_MATRIX, @test[0, 0]);
   236     glPopMatrix;
   235     glPopMatrix;
   239     for i:=0 to 3 do
   238     for i:=0 to 3 do
   240       for j:=0 to 3 do
   239       for j:=0 to 3 do
   241         if Abs(test[i, j] - Result[i, j]) > 0.000001 then
   240         if Abs(test[i, j] - Result[i, j]) > 0.000001 then
   242           error:=true;
   241           error:=true;
   243 
   242 
       
   243     {$IFNDEF PAS2C}
   244     if error then
   244     if error then
   245     begin
   245     begin
   246         writeln('shall:');
   246         writeln('shall:');
   247         for i:=0 to 3 do
   247         for i:=0 to 3 do
   248         begin
   248         begin