Fix type-related issues in dependent code. Remove hardcoded mjUSEDOUBLE. Add mjUSESINGLE compiler flag.
This CL does not change the default build behavior of MuJoCo. To use single-precision floating-point, build MuJoCo with `-DmjUSESINGLE`. PiperOrigin-RevId: 644782648 Change-Id: Ie815df9916798ca8054306437b39a33f84ce9e08
This commit is contained in:
committed by
Copybara-Service
parent
7bd7065e0e
commit
3f3b39bbb1
@@ -17,12 +17,8 @@
|
||||
|
||||
//---------------------------------- floating-point definition -------------------------------------
|
||||
|
||||
// compile-time configuration options
|
||||
#define mjUSEDOUBLE // single or double precision for mjtNum
|
||||
|
||||
|
||||
// floating point data type and minval
|
||||
#ifdef mjUSEDOUBLE
|
||||
#ifndef mjUSESINGLE
|
||||
typedef double mjtNum;
|
||||
#define mjMINVAL 1E-15 // minimum value in any denominator
|
||||
#else
|
||||
|
||||
@@ -893,7 +893,7 @@ MJAPI int mjs_isWarning(mjSpec* s);
|
||||
|
||||
//---------------------------------- Standard math -------------------------------------------------
|
||||
|
||||
#ifdef mjUSEDOUBLE
|
||||
#if !defined(mjUSESINGLE)
|
||||
#define mju_sqrt sqrt
|
||||
#define mju_exp exp
|
||||
#define mju_sin sin
|
||||
|
||||
Reference in New Issue
Block a user