Open Dynamics Engine
ode/src/odemath.h
1 /*************************************************************************
2  * *
3  * Open Dynamics Engine, Copyright (C) 2001,2002 Russell L. Smith. *
4  * All rights reserved. Email: russ@q12.org Web: www.q12.org *
5  * *
6  * This library is free software; you can redistribute it and/or *
7  * modify it under the terms of EITHER: *
8  * (1) The GNU Lesser General Public License as published by the Free *
9  * Software Foundation; either version 2.1 of the License, or (at *
10  * your option) any later version. The text of the GNU Lesser *
11  * General Public License is included with this library in the *
12  * file LICENSE.TXT. *
13  * (2) The BSD-style license that is included with this library in *
14  * the file LICENSE-BSD.TXT. *
15  * *
16  * This library is distributed in the hope that it will be useful, *
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files *
19  * LICENSE.TXT and LICENSE-BSD.TXT for more details. *
20  * *
21  *************************************************************************/
22 
23 #ifndef _ODE__PRIVATE_ODEMATH_H_
24 #define _ODE__PRIVATE_ODEMATH_H_
25 
26 #include <ode/odemath.h>
27 #include "error.h"
28 
29 
30 int _dSafeNormalize3 (dVector3 a);
31 int _dSafeNormalize4 (dVector4 a);
32 
33 ODE_PURE_INLINE void _dNormalize3(dVector3 a)
34 {
35  int bNormalizationResult = _dSafeNormalize3(a);
36  dIVERIFY(bNormalizationResult);
37 }
38 
39 ODE_PURE_INLINE void _dNormalize4(dVector4 a)
40 {
41  int bNormalizationResult = _dSafeNormalize4(a);
42  dIVERIFY(bNormalizationResult);
43 }
44 
45 // For internal use
46 #define dSafeNormalize3(a) _dSafeNormalize3(a)
47 #define dSafeNormalize4(a) _dSafeNormalize4(a)
48 #define dNormalize3(a) _dNormalize3(a)
49 #define dNormalize4(a) _dNormalize4(a)
50 
51 
52 #endif