Fix for setting Matrix/Vector values by Index
Many Matrix*/Vector* implementations were throwing IndexOutOfBoundsException when you tried to set their values via their indexer due to a missing else statement.
This commit is contained in:
parent
7961997abe
commit
fc1a8e022b
24 changed files with 24 additions and 24 deletions
|
@ -182,7 +182,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -184,7 +184,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -205,7 +205,7 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ namespace OpenTK
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ namespace OpenTK
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,7 @@ namespace OpenTK
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,7 @@ namespace OpenTK
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@ namespace OpenTK
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -239,7 +239,7 @@ namespace OpenTK
|
||||||
if (rowIndex == 0) Row0[columnIndex] = value;
|
if (rowIndex == 0) Row0[columnIndex] = value;
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -307,7 +307,7 @@ namespace OpenTK
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
else if (rowIndex == 3) Row3[columnIndex] = value;
|
else if (rowIndex == 3) Row3[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ namespace OpenTK
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
else if (rowIndex == 3) Row3[columnIndex] = value;
|
else if (rowIndex == 3) Row3[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ namespace OpenTK
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
else if (rowIndex == 3) Row3[columnIndex] = value;
|
else if (rowIndex == 3) Row3[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -210,7 +210,7 @@ namespace OpenTK
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
else if (rowIndex == 3) Row3[columnIndex] = value;
|
else if (rowIndex == 3) Row3[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ namespace OpenTK
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
else if (rowIndex == 3) Row3[columnIndex] = value;
|
else if (rowIndex == 3) Row3[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ namespace OpenTK
|
||||||
else if (rowIndex == 1) Row1[columnIndex] = value;
|
else if (rowIndex == 1) Row1[columnIndex] = value;
|
||||||
else if (rowIndex == 2) Row2[columnIndex] = value;
|
else if (rowIndex == 2) Row2[columnIndex] = value;
|
||||||
else if (rowIndex == 3) Row3[columnIndex] = value;
|
else if (rowIndex == 3) Row3[columnIndex] = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ namespace OpenTK
|
||||||
} set{
|
} set{
|
||||||
if(index == 0) X = value;
|
if(index == 0) X = value;
|
||||||
else if(index == 1) Y = value;
|
else if(index == 1) Y = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ namespace OpenTK
|
||||||
} set{
|
} set{
|
||||||
if(index == 0) X = value;
|
if(index == 0) X = value;
|
||||||
else if(index == 1) Y = value;
|
else if(index == 1) Y = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ namespace OpenTK
|
||||||
if(index == 0) X = value;
|
if(index == 0) X = value;
|
||||||
else if(index == 1) Y = value;
|
else if(index == 1) Y = value;
|
||||||
else if(index == 2) Z = value;
|
else if(index == 2) Z = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace OpenTK
|
||||||
if(index == 0) X = value;
|
if(index == 0) X = value;
|
||||||
else if(index == 1) Y = value;
|
else if(index == 1) Y = value;
|
||||||
else if(index == 2) Z = value;
|
else if(index == 2) Z = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ namespace OpenTK
|
||||||
else if(index == 1) Y = value;
|
else if(index == 1) Y = value;
|
||||||
else if(index == 2) Z = value;
|
else if(index == 2) Z = value;
|
||||||
else if(index == 3) W = value;
|
else if(index == 3) W = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ namespace OpenTK
|
||||||
else if(index == 1) Y = value;
|
else if(index == 1) Y = value;
|
||||||
else if(index == 2) Z = value;
|
else if(index == 2) Z = value;
|
||||||
else if(index == 3) W = value;
|
else if(index == 3) W = value;
|
||||||
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue