collision_space.h | collision_space.h | |||
---|---|---|---|---|
skipping to change at line 112 | skipping to change at line 112 | |||
* with another space. See @c dSpaceSetSublevel for more details. | * with another space. See @c dSpaceSetSublevel for more details. | |||
* | * | |||
* @param space the space to query | * @param space the space to query | |||
* @returns the sublevel value of the space | * @returns the sublevel value of the space | |||
* @ingroup collide | * @ingroup collide | |||
* @see dSpaceSetSublevel | * @see dSpaceSetSublevel | |||
* @see dSpaceCollide2 | * @see dSpaceCollide2 | |||
*/ | */ | |||
ODE_API int dSpaceGetSublevel (dSpaceID space); | ODE_API int dSpaceGetSublevel (dSpaceID space); | |||
/** | ||||
* @brief Sets manual cleanup flag for a space. | ||||
* | ||||
* Manual cleanup flag marks a space as eligible for manual thread data clea | ||||
nup. | ||||
* This function should be called for every space object right after creatio | ||||
n in | ||||
* case if ODE has been initialized with @c dInitFlagManualThreadCleanup fla | ||||
g. | ||||
* | ||||
* Failure to set manual cleanup flag for a space may lead to some resources | ||||
* remaining leaked until the program exit. | ||||
* | ||||
* @param space the space to modify | ||||
* @param mode 1 for manual cleanup mode and 0 for default cleanup mode | ||||
* @ingroup collide | ||||
* @see dSpaceGetManualCleanup | ||||
* @see dInitODE2 | ||||
*/ | ||||
ODE_API void dSpaceSetManualCleanup (dSpaceID space, int mode); | ||||
/** | ||||
* @brief Get manual cleanup flag of a space. | ||||
* | ||||
* Manual cleanup flag marks a space space as eligible for manual thread dat | ||||
a cleanup. | ||||
* See @c dSpaceSetManualCleanup for more details. | ||||
* | ||||
* @param space the space to query | ||||
* @returns 1 for manual cleanup mode and 0 for default cleanup mode of the | ||||
space | ||||
* @ingroup collide | ||||
* @see dSpaceSetManualCleanup | ||||
* @see dInitODE2 | ||||
*/ | ||||
ODE_API int dSpaceGetManualCleanup (dSpaceID space); | ||||
ODE_API void dSpaceAdd (dSpaceID, dGeomID); | ODE_API void dSpaceAdd (dSpaceID, dGeomID); | |||
ODE_API void dSpaceRemove (dSpaceID, dGeomID); | ODE_API void dSpaceRemove (dSpaceID, dGeomID); | |||
ODE_API int dSpaceQuery (dSpaceID, dGeomID); | ODE_API int dSpaceQuery (dSpaceID, dGeomID); | |||
ODE_API void dSpaceClean (dSpaceID); | ODE_API void dSpaceClean (dSpaceID); | |||
ODE_API int dSpaceGetNumGeoms (dSpaceID); | ODE_API int dSpaceGetNumGeoms (dSpaceID); | |||
ODE_API dGeomID dSpaceGetGeom (dSpaceID, int i); | ODE_API dGeomID dSpaceGetGeom (dSpaceID, int i); | |||
/** | /** | |||
* @brief Given a space, this returns its class. | * @brief Given a space, this returns its class. | |||
* | * | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 37 lines changed or added | |||
common.h | common.h | |||
---|---|---|---|---|
skipping to change at line 59 | skipping to change at line 59 | |||
* IASSERT is an internal assertion, i.e. a consistency check. if it fai ls | * IASSERT is an internal assertion, i.e. a consistency check. if it fai ls | |||
* we want to know where. | * we want to know where. | |||
* UASSERT is a user assertion, i.e. if it fails a nice error message | * UASSERT is a user assertion, i.e. if it fails a nice error message | |||
* should be printed for the user. | * should be printed for the user. | |||
* AASSERT is an arguments assertion, i.e. if it fails "bad argument(s)" | * AASSERT is an arguments assertion, i.e. if it fails "bad argument(s)" | |||
* is printed. | * is printed. | |||
* DEBUGMSG just prints out a message | * DEBUGMSG just prints out a message | |||
*/ | */ | |||
#ifndef dNODEBUG | #ifndef dNODEBUG | |||
#ifdef __GNUC__ | # if defined(__STDC__) && __STDC_VERSION__ >= 199901L | |||
#define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \ | # define __FUNCTION__ __func__ | |||
"assertion \"" #a "\" failed in %s() [%s]",__FUNCTION__,__FILE__); | # endif | |||
#define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \ | # ifdef __GNUC__ | |||
msg " in %s()", __FUNCTION__); | # define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \ | |||
#define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, | "assertion \"" #a "\" failed in %s() [%s]",__FUNCTION__,__FILE__); | |||
\ | # define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \ | |||
msg " in %s() File %s Line %d", __FUNCTION__, __FILE__,__LINE__); | msg " in %s()", __FUNCTION__); | |||
# define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, | ||||
\ | ||||
msg " in %s() File %s Line %d", __FUNCTION__, __FILE__,__LINE__); | ||||
# else // not __GNUC__ | ||||
# define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \ | ||||
"assertion \"" #a "\" failed in %s:%d",__FILE__,__LINE__); | ||||
# define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \ | ||||
msg " (%s:%d)", __FILE__,__LINE__); | ||||
# define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, \ | ||||
msg " (%s:%d)", __FILE__,__LINE__); | ||||
# endif | ||||
#else | #else | |||
#define dIASSERT(a) if (!(a)) dDebug (d_ERR_IASSERT, \ | # define dIASSERT(a) ; | |||
"assertion \"" #a "\" failed in %s:%d",__FILE__,__LINE__); | # define dUASSERT(a,msg) ; | |||
#define dUASSERT(a,msg) if (!(a)) dDebug (d_ERR_UASSERT, \ | # define dDEBUGMSG(msg) ; | |||
msg " (%s:%d)", __FILE__,__LINE__); | ||||
#define dDEBUGMSG(msg) dMessage (d_ERR_UASSERT, \ | ||||
msg " (%s:%d)", __FILE__,__LINE__); | ||||
#endif | ||||
#else | ||||
#define dIASSERT(a) ; | ||||
#define dUASSERT(a,msg) ; | ||||
#define dDEBUGMSG(msg) ; | ||||
#endif | #endif | |||
#define dAASSERT(a) dUASSERT(a,"Bad argument(s)") | #define dAASSERT(a) dUASSERT(a,"Bad argument(s)") | |||
// Macro used to suppress unused variable warning | // Macro used to suppress unused variable warning | |||
#define dVARIABLEUSED(a) ((void)a) | #define dVARIABLEUSED(a) ((void)a) | |||
/* floating point data type, vector, matrix and quaternion types */ | /* floating point data type, vector, matrix and quaternion types */ | |||
#if defined(dSINGLE) | #if defined(dSINGLE) | |||
typedef float dReal; | typedef float dReal; | |||
End of changes. 2 change blocks. | ||||
19 lines changed or deleted | 22 lines changed or added | |||
odeinit.h | odeinit.h | |||
---|---|---|---|---|
skipping to change at line 60 | skipping to change at line 60 | |||
* using ODE are to be cleared by library client with explicit call to @c d CleanupODEAllDataForThread. | * using ODE are to be cleared by library client with explicit call to @c d CleanupODEAllDataForThread. | |||
* If this flag is not specified the automatic resource tracking algorithm is used. | * If this flag is not specified the automatic resource tracking algorithm is used. | |||
* | * | |||
* With automatic resource tracking, On Windows, memory allocated for a thr ead may | * With automatic resource tracking, On Windows, memory allocated for a thr ead may | |||
* remain not freed for some time after the thread exits. The resources may be | * remain not freed for some time after the thread exits. The resources may be | |||
* released when one of other threads calls @c dAllocateODEDataForThread. U ltimately, | * released when one of other threads calls @c dAllocateODEDataForThread. U ltimately, | |||
* the resources are released when library is closed with @c dCloseODE. On other | * the resources are released when library is closed with @c dCloseODE. On other | |||
* operating systems resources are always released by the thread itself on its exit | * operating systems resources are always released by the thread itself on its exit | |||
* or on library closure with @c dCloseODE. | * or on library closure with @c dCloseODE. | |||
* | * | |||
* With manual thread data cleanup mode every collision space object must b | ||||
e | ||||
* explicitly switched to manual cleanup mode with @c dSpaceSetManualCleanu | ||||
p | ||||
* after creation. See description of the function for more details. | ||||
* | ||||
* If @c dInitFlagManualThreadCleanup was not specified during initializati on, | * If @c dInitFlagManualThreadCleanup was not specified during initializati on, | |||
* calls to @c dCleanupODEAllDataForThread are not allowed. | * calls to @c dCleanupODEAllDataForThread are not allowed. | |||
* | * | |||
* @see dInitODE2 | * @see dInitODE2 | |||
* @see dAllocateODEDataForThread | * @see dAllocateODEDataForThread | |||
* @see dSpaceSetManualCleanup | ||||
* @see dCloseODE | * @see dCloseODE | |||
* @ingroup init | * @ingroup init | |||
*/ | */ | |||
enum dInitODEFlags { | enum dInitODEFlags { | |||
dInitFlagManualThreadCleanup = 0x00000001, //@< Thread local data is to be cleared explicitly on @c dCleanupODEAllDataForThread function call | dInitFlagManualThreadCleanup = 0x00000001, //@< Thread local data is to be cleared explicitly on @c dCleanupODEAllDataForThread function call | |||
}; | }; | |||
/** | /** | |||
* @brief Initializes ODE library. | * @brief Initializes ODE library. | |||
* | * | |||
skipping to change at line 101 | skipping to change at line 106 | |||
* @param uiInitFlags Initialization options bitmask | * @param uiInitFlags Initialization options bitmask | |||
* @return A nonzero if initialization succeeded and zero otherwise. | * @return A nonzero if initialization succeeded and zero otherwise. | |||
* | * | |||
* This function must be called to initialize ODE library before first use. If | * This function must be called to initialize ODE library before first use. If | |||
* initialization succeeds the function may not be called again until libra ry is | * initialization succeeds the function may not be called again until libra ry is | |||
* closed with a call to @c dCloseODE. | * closed with a call to @c dCloseODE. | |||
* | * | |||
* The @a uiInitFlags parameter specifies initialization options to be used . These | * The @a uiInitFlags parameter specifies initialization options to be used . These | |||
* can be combination of zero or more @c dInitODEFlags flags. | * can be combination of zero or more @c dInitODEFlags flags. | |||
* | * | |||
* @note | ||||
* If @c dInitFlagManualThreadCleanup flag is used for initialization, | ||||
* @c dSpaceSetManualCleanup must be called to set manual cleanup mode for | ||||
every | ||||
* space object right after creation. Failure to do so may lead to resource | ||||
leaks. | ||||
* | ||||
* @see dInitODEFlags | * @see dInitODEFlags | |||
* @see dCloseODE | * @see dCloseODE | |||
* @see dSpaceSetManualCleanup | ||||
* @ingroup init | * @ingroup init | |||
*/ | */ | |||
ODE_API int dInitODE2(unsigned int uiInitFlags/*=0*/); | ODE_API int dInitODE2(unsigned int uiInitFlags/*=0*/); | |||
/** | /** | |||
* @brief ODE data allocation flags. | * @brief ODE data allocation flags. | |||
* | * | |||
* These flags are used to indicate which data is to be pre-allocated in ca ll to | * These flags are used to indicate which data is to be pre-allocated in ca ll to | |||
* @c dAllocateODEDataForThread. | * @c dAllocateODEDataForThread. | |||
* | * | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 15 lines changed or added | |||
odemath.h | odemath.h | |||
---|---|---|---|---|
skipping to change at line 52 | skipping to change at line 52 | |||
*/ | */ | |||
#define dVALIDVEC3(v) (!(dIsNan(v[0]) || dIsNan(v[1]) || dIsNan(v[2]))) | #define dVALIDVEC3(v) (!(dIsNan(v[0]) || dIsNan(v[1]) || dIsNan(v[2]))) | |||
#define dVALIDVEC4(v) (!(dIsNan(v[0]) || dIsNan(v[1]) || dIsNan(v[2]) || dI sNan(v[3]))) | #define dVALIDVEC4(v) (!(dIsNan(v[0]) || dIsNan(v[1]) || dIsNan(v[2]) || dI sNan(v[3]))) | |||
#define dVALIDMAT3(m) (!(dIsNan(m[0]) || dIsNan(m[1]) || dIsNan(m[2]) || dI sNan(m[3]) || dIsNan(m[4]) || dIsNan(m[5]) || dIsNan(m[6]) || dIsNan(m[7]) || dIsNan(m[8]) || dIsNan(m[9]) || dIsNan(m[10]) || dIsNan(m[11]))) | #define dVALIDMAT3(m) (!(dIsNan(m[0]) || dIsNan(m[1]) || dIsNan(m[2]) || dI sNan(m[3]) || dIsNan(m[4]) || dIsNan(m[5]) || dIsNan(m[6]) || dIsNan(m[7]) || dIsNan(m[8]) || dIsNan(m[9]) || dIsNan(m[10]) || dIsNan(m[11]))) | |||
#define dVALIDMAT4(m) (!(dIsNan(m[0]) || dIsNan(m[1]) || dIsNan(m[2]) || dI sNan(m[3]) || dIsNan(m[4]) || dIsNan(m[5]) || dIsNan(m[6]) || dIsNan(m[7]) || dIsNan(m[8]) || dIsNan(m[9]) || dIsNan(m[10]) || dIsNan(m[11]) || dIsNan (m[12]) || dIsNan(m[13]) || dIsNan(m[14]) || dIsNan(m[15]) )) | #define dVALIDMAT4(m) (!(dIsNan(m[0]) || dIsNan(m[1]) || dIsNan(m[2]) || dI sNan(m[3]) || dIsNan(m[4]) || dIsNan(m[5]) || dIsNan(m[6]) || dIsNan(m[7]) || dIsNan(m[8]) || dIsNan(m[9]) || dIsNan(m[10]) || dIsNan(m[11]) || dIsNan (m[12]) || dIsNan(m[13]) || dIsNan(m[14]) || dIsNan(m[15]) )) | |||
/* | /* | |||
* General purpose vector operations with other vectors or constants. | * General purpose vector operations with other vectors or constants. | |||
*/ | */ | |||
#define dOP(a,op,b,c) \ | #define dOP(a,op,b,c) do { \ | |||
(a)[0] = ((b)[0]) op ((c)[0]); \ | (a)[0] = ((b)[0]) op ((c)[0]); \ | |||
(a)[1] = ((b)[1]) op ((c)[1]); \ | (a)[1] = ((b)[1]) op ((c)[1]); \ | |||
(a)[2] = ((b)[2]) op ((c)[2]); | (a)[2] = ((b)[2]) op ((c)[2]); \ | |||
#define dOPC(a,op,b,c) \ | } while (0) | |||
#define dOPC(a,op,b,c) do { \ | ||||
(a)[0] = ((b)[0]) op (c); \ | (a)[0] = ((b)[0]) op (c); \ | |||
(a)[1] = ((b)[1]) op (c); \ | (a)[1] = ((b)[1]) op (c); \ | |||
(a)[2] = ((b)[2]) op (c); | (a)[2] = ((b)[2]) op (c); \ | |||
#define dOPE(a,op,b) \ | } while (0) | |||
#define dOPE(a,op,b) do {\ | ||||
(a)[0] op ((b)[0]); \ | (a)[0] op ((b)[0]); \ | |||
(a)[1] op ((b)[1]); \ | (a)[1] op ((b)[1]); \ | |||
(a)[2] op ((b)[2]); | (a)[2] op ((b)[2]); \ | |||
#define dOPEC(a,op,c) \ | } while (0) | |||
#define dOPEC(a,op,c) do { \ | ||||
(a)[0] op (c); \ | (a)[0] op (c); \ | |||
(a)[1] op (c); \ | (a)[1] op (c); \ | |||
(a)[2] op (c); | (a)[2] op (c); \ | |||
} while (0) | ||||
/// Define an equation with operatos | /// Define an equation with operatos | |||
/// For example this function can be used to replace | /// For example this function can be used to replace | |||
/// <PRE> | /// <PRE> | |||
/// for (int i=0; i<3; ++i) | /// for (int i=0; i<3; ++i) | |||
/// a[i] += b[i] + c[i]; | /// a[i] += b[i] + c[i]; | |||
/// </PRE> | /// </PRE> | |||
#define dOPE2(a,op1,b,op2,c) \ | #define dOPE2(a,op1,b,op2,c) do { \ | |||
(a)[0] op1 ((b)[0]) op2 ((c)[0]); \ | (a)[0] op1 ((b)[0]) op2 ((c)[0]); \ | |||
(a)[1] op1 ((b)[1]) op2 ((c)[1]); \ | (a)[1] op1 ((b)[1]) op2 ((c)[1]); \ | |||
(a)[2] op1 ((b)[2]) op2 ((c)[2]); | (a)[2] op1 ((b)[2]) op2 ((c)[2]); \ | |||
} while (0) | ||||
/* | /* | |||
* Length, and squared length helpers. dLENGTH returns the length of a dVec tor3. | * Length, and squared length helpers. dLENGTH returns the length of a dVec tor3. | |||
* dLENGTHSQUARED return the squared length of a dVector3. | * dLENGTHSQUARED return the squared length of a dVector3. | |||
*/ | */ | |||
#define dLENGTHSQUARED(a) (((a)[0])*((a)[0]) + ((a)[1])*((a)[1]) + ((a)[2]) *((a)[2])) | #define dLENGTHSQUARED(a) (((a)[0])*((a)[0]) + ((a)[1])*((a)[1]) + ((a)[2]) *((a)[2])) | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
End of changes. 7 change blocks. | ||||
10 lines changed or deleted | 15 lines changed or added | |||