Report any bugs here and we'll post fixes
Moderators: Sascha Willems, Thomas
by misho » Sat Feb 23, 2019 3:51 pm
Hi!
I have my code down to a state where I can link to newest Newton library, without any "tweaks" (just compile and link!)... except one:
In the "default" block, line 314 and 326 of dMatrix::GetEulerAngles(), I have to tweak two hard coded values of 0.99995f and -0.99995f to (in my case) 0.99999995f and -0.99999995f. This higher precision greatly improves my "gimbal lock" situation, which I encounter frequently since my spacecraft is allowed to have all kinds of attitude values while in orbit, in zero G.
Is it possible to implement a method that would allow me to set this value upon Newton setup, rather than being hard-coded? Something like
- Code: Select all
NewtonSetEulerGimbalTolerance(double dTolerance)
Thanks!!
Last edited by
misho on Thu May 09, 2019 3:18 pm, edited 1 time in total.
-
misho
-
- Posts: 673
- Joined: Tue May 04, 2010 10:13 am
by Julio Jerez » Sat Feb 23, 2019 6:59 pm
if liek thsi is ok,
- Code: Select all
#ifdef _NEWTON_USE_DOUBLE
const dFloat tol = 0.99999995f;
#else
const dFloat tol = 0.99995f;
#endif
if (matrix[0][2] > tol) {
sync and is done.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by misho » Sat Feb 23, 2019 7:46 pm
Perfect, thank you sir!!!
-
misho
-
- Posts: 673
- Joined: Tue May 04, 2010 10:13 am
by misho » Tue Apr 02, 2019 5:17 pm
Hi Julio!
I just noticed that this fix was applied at the wrong place. Currently, it is applied to line 176 of the current
dMatrix.cpp. Instead, it needs to be applied on lines 320 and 332 of the current
dMatrix.cpp. It has to pertain to the
default block of the
switch-case statement (on line 312).
After you made this fix, I didn't check, and notice, up until now. Some of my problems wit the parachute system were caused by this
thanks,
Misho
-
misho
-
- Posts: 673
- Joined: Tue May 04, 2010 10:13 am
by Julio Jerez » Tue Apr 02, 2019 5:53 pm
fixed.
-
Julio Jerez
- Moderator
-
- Posts: 12249
- Joined: Sun Sep 14, 2003 2:18 pm
- Location: Los Angeles
-
by misho » Tue Apr 02, 2019 5:55 pm
Thanks!!!
-
misho
-
- Posts: 673
- Joined: Tue May 04, 2010 10:13 am
Return to Bugs and Fixes
Who is online
Users browsing this forum: No registered users and 4 guests