christian.wolf2 Posted February 9, 2022 Share Posted February 9, 2022 Hi, for mat3.ToString() and mat4.ToString() there seems to be a missing space character after each column. For example mat3 result = mat3.IDENTITY; string output = mat3.ToString(); //result is 1 0 00 1 00 0 1 Parsing the string in again, considering spaces as split markers, leads to a non-conform matrix. Fixing this bug should be quite easy: mat3.cs - Line 767 //old public override string ToString() => this.m00.ToString() + " " + this.m01.ToString() + " " + this.m02.ToString() + this.m10.ToString() + " " + this.m11.ToString() + " " + this.m12.ToString() + this.m20.ToString() + " " + this.m21.ToString() + " " + this.m22.ToString(); //new public override string ToString() => this.m00.ToString() + " " + this.m01.ToString() + " " + this.m02.ToString() + " " + this.m10.ToString() + " " + this.m11.ToString() + " " + this.m12.ToString() + this.m20.ToString() + " " + this.m21.ToString() + " " + this.m22.ToString(); mat4.cs - Line 1221 //old public override string ToString() => this.m00.ToString() + " " + this.m01.ToString() + " " + this.m02.ToString() + " " + this.m03.ToString() + this.m10.ToString() + " " + this.m11.ToString() + " " + this.m12.ToString() + " " + this.m13.ToString() + this.m20.ToString() + " " + this.m21.ToString() + " " + this.m22.ToString() + " " + this.m23.ToString() + " " + this.m30.ToString() + this.m31.ToString() + " " + this.m32.ToString() + " " + this.m33.ToString(); //new public override string ToString() => this.m00.ToString() + " " + this.m01.ToString() + " " + this.m02.ToString() + " " + this.m03.ToString() + " " + this.m10.ToString() + " " + this.m11.ToString() + " " + this.m12.ToString() + " " + this.m13.ToString() + " " + this.m20.ToString() + " " + this.m21.ToString() + " " + this.m22.ToString() + " " + this.m23.ToString() + " " + this.m30.ToString() + " " + this.m31.ToString() + " " + this.m32.ToString() + " " + this.m33.ToString(); Link to comment
silent Posted February 9, 2022 Share Posted February 9, 2022 Fixed. Thanks! :) How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
christian.wolf2 Posted February 15, 2022 Author Share Posted February 15, 2022 Hi silent, with the ToString()-functions in C# I am facing another inconsistency. While all the matrices functions uses direct ToString-access of their variables (like mat4.m00.ToString() where m00 is a float or double), the vector and quat functions will format their variables with CultureInfo.CurrentCulture. With german formatting the vec3.ToString() functions for example leads to following output: vec3 standardVector = new vec3(0.0002f,0.0f,0.0f); string outputString = standardVector.ToString() // results in 0,0002. 0. 0 For a more convenient behavior I would propose to use direct variable output like in your matrices. Link to comment
silent Posted February 15, 2022 Share Posted February 15, 2022 christian.wolf2 Thanks for pointing that out. We'll see what we can do about this, but more likely this would not be improved in the upcoming 2.15.1 update. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts