Status of double precision

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Status of double precision

Postby Julio Jerez » Fri Apr 01, 2016 11:46 am

oh yes that is happening. I need to fix it,

what happen is that the newton function like get velocity, get omega an so on only write to the x, y, z, of a vector.
I decide that long time agon because many people where using newton which vector classes on only there element.
why this mean is that if I have a vector 4 class, the last value is left undefined.

in 32 bit the engine compiled in sse mode, which do no have problem why moving a value form memory to register of the other way.

in 64 bit it should not happen for any compile that use SSE2.
Microsoft deprecated x87 starting with visual studio 12, so it will not happen there either.

but in visual studio 2010 still issues x87 code, I will not make the all double project compile using SSE2 register set, I will do the other which this is a big task of chasing all places where declare those vectors and change it to the constructor that initialized the members.
    dVector tireOmega(0.0f);
    dVector chassisOmega(0.0f);
thank for the warning. very important :D
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Status of double precision

Postby jamesm6162 » Mon Apr 04, 2016 3:25 am

Wouldn't it be easier/safer to just initialize (at least) the m_w value in the constructor of the vector?

Code: Select all
template<class T>
TemplateVector<T>::TemplateVector():m_x(0),m_y(0),m_z(0),m_w(0) {}
jamesm6162
 
Posts: 49
Joined: Wed Aug 12, 2015 8:50 am

Re: Status of double precision

Postby Julio Jerez » Mon Apr 04, 2016 9:06 am

yes that would be easy, but it will be the wrong thing to do.
sound counter intuitive, but as a good practice, the default constructor of a class should do nothing.

imagine using a vector call that initialize it data, this mean each time we declare an member an array you are paying a high price for initialization of data you do not use.

The correct thing to do is to add a constructor that initialized the data to default value and find all the place where the default constructor is use and change it to use the new one.
I believe I almost have everything covered now.
this only apply to the newton tool and the joint class. The Newton core is fine.

please try again the double, now I added an assert that will show this condition in all configuration and we will know what it is.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Previous

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest