The Javascript engine of Google Chrome does something strange with the variable values in this prototype.
The prototype is defined with:
function matrix4def()
{
this.m00=0;
this.m01=0;
this.m02=0;
this.m03=0;
this.m10=0;
this.m11=0;
this.m12=0;
this.m13=0;
this.m20=0;
this.m21=0;
this.m22=0;
this.m23=0;
this.m30=0;
this.m31=0;
this.m32=0;
this.m33=0;
};
var value = new matrix4def();
console.log(value)
shows us:
m00: 1
m01: 0
m02: 0
m03: 0
m10: 0
m11: 1
m12: 0
m13: 0
m20: 0
m21: 0
m22: 1
m23: 0
m30: 0
m31: 0
m32: 0
m33: 1
While using console.log(value.m00)
will show us: -6.123031769111886e-17
.
Doing console.log(value); console.log(value.m00); console.log(value);
shows no difference between the first and second call of console.log(value);
.
Doing console.log(typeof(value.m00))
will show us: number
I've tried doing parseFloat(value.m00)
, but that didn't show 1 either...
Storing the value of value.m00
to a temporary value shows me -6.123031769111886e-17
too.
Does anyone have a clue what's happening here?
P.S.: I cannot show you the entire code; it's part of render code that does a lot with these values.