Classes | Defines | Typedefs | Functions
btScalar.h File Reference
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include <assert.h>
Include dependency graph for btScalar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  btTypedObject
 rudimentary class to provide type info More...

Defines

#define ATTRIBUTE_ALIGNED128(a)   a
#define ATTRIBUTE_ALIGNED16(a)   a
#define ATTRIBUTE_ALIGNED64(a)   a
#define BT_BULLET_VERSION   279
#define BT_DECLARE_ALIGNED_ALLOCATOR()
#define BT_DECLARE_HANDLE(name)   typedef struct name##__ { int unused; } *name
#define BT_LARGE_FLOAT   1e18f
#define btAssert(x)
#define btFsels(a, b, c)   (btScalar)btFsel(a,b,c)
#define btFullAssert(x)
#define btLikely(_c)   _c
#define btRecipSqrt(x)   ((btScalar)(btScalar(1.0)/btSqrt(btScalar(x)))) /* reciprocal square root */
#define btUnlikely(_c)   _c
#define SIMD_2_PI   btScalar(6.283185307179586232)
#define SIMD_DEGS_PER_RAD   (btScalar(360.0) / SIMD_2_PI)
#define SIMD_EPSILON   FLT_EPSILON
#define SIMD_FORCE_INLINE   inline
#define SIMD_HALF_PI   (SIMD_2_PI * btScalar(0.25))
#define SIMD_INFINITY   FLT_MAX
#define SIMD_PI   (SIMD_2_PI * btScalar(0.5))
#define SIMD_RADS_PER_DEG   (SIMD_2_PI / btScalar(360.0))
#define SIMDSQRT12   btScalar(0.7071067811865475244008443621048490)

Typedefs

typedef float btScalar
 The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.

Functions

SIMD_FORCE_INLINE btScalar btAcos (btScalar x)
SIMD_FORCE_INLINE btScalar btAsin (btScalar x)
SIMD_FORCE_INLINE btScalar btAtan (btScalar x)
SIMD_FORCE_INLINE btScalar btAtan2 (btScalar x, btScalar y)
SIMD_FORCE_INLINE btScalar btAtan2Fast (btScalar y, btScalar x)
SIMD_FORCE_INLINE btScalar btCos (btScalar x)
SIMD_FORCE_INLINE btScalar btDegrees (btScalar x)
SIMD_FORCE_INLINE bool btEqual (btScalar a, btScalar eps)
SIMD_FORCE_INLINE btScalar btExp (btScalar x)
SIMD_FORCE_INLINE btScalar btFabs (btScalar x)
SIMD_FORCE_INLINE btScalar btFmod (btScalar x, btScalar y)
SIMD_FORCE_INLINE btScalar btFsel (btScalar a, btScalar b, btScalar c)
SIMD_FORCE_INLINE bool btFuzzyZero (btScalar x)
int btGetVersion ()
SIMD_FORCE_INLINE bool btGreaterEqual (btScalar a, btScalar eps)
SIMD_FORCE_INLINE int btIsNegative (btScalar x)
SIMD_FORCE_INLINE btScalar btLog (btScalar x)
SIMD_FORCE_INLINE bool btMachineIsLittleEndian ()
SIMD_FORCE_INLINE btScalar btNormalizeAngle (btScalar angleInRadians)
SIMD_FORCE_INLINE btScalar btPow (btScalar x, btScalar y)
SIMD_FORCE_INLINE btScalar btRadians (btScalar x)
SIMD_FORCE_INLINE unsigned btSelect (unsigned condition, unsigned valueIfConditionNonZero, unsigned valueIfConditionZero)
SIMD_FORCE_INLINE int btSelect (unsigned condition, int valueIfConditionNonZero, int valueIfConditionZero)
SIMD_FORCE_INLINE float btSelect (unsigned condition, float valueIfConditionNonZero, float valueIfConditionZero)
SIMD_FORCE_INLINE btScalar btSin (btScalar x)
SIMD_FORCE_INLINE btScalar btSqrt (btScalar y)
template<typename T >
SIMD_FORCE_INLINE void btSwap (T &a, T &b)
SIMD_FORCE_INLINE unsigned btSwapEndian (unsigned val)
SIMD_FORCE_INLINE unsigned short btSwapEndian (unsigned short val)
SIMD_FORCE_INLINE unsigned btSwapEndian (int val)
SIMD_FORCE_INLINE unsigned short btSwapEndian (short val)
SIMD_FORCE_INLINE void btSwapEndianDouble (double d, unsigned char *dst)
SIMD_FORCE_INLINE unsigned int btSwapEndianFloat (float d)
 btSwapFloat uses using char pointers to swap the endianness
SIMD_FORCE_INLINE btScalar btTan (btScalar x)
SIMD_FORCE_INLINE double btUnswapEndianDouble (const unsigned char *src)
SIMD_FORCE_INLINE float btUnswapEndianFloat (unsigned int a)

Define Documentation

#define ATTRIBUTE_ALIGNED128 (   a)    a

Definition at line 179 of file btScalar.h.

#define ATTRIBUTE_ALIGNED16 (   a)    a
Todo:
: check out alignment methods for other platforms/compilers define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16))) define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64))) define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))

Definition at line 177 of file btScalar.h.

#define ATTRIBUTE_ALIGNED64 (   a)    a

Definition at line 178 of file btScalar.h.

#define BT_BULLET_VERSION   279

Definition at line 31 of file btScalar.h.

Value:
SIMD_FORCE_INLINE void* operator new(size_t sizeInBytes)   { return btAlignedAlloc(sizeInBytes,16); }   \
   SIMD_FORCE_INLINE void  operator delete(void* ptr)         { btAlignedFree(ptr); }   \
   SIMD_FORCE_INLINE void* operator new(size_t, void* ptr)   { return ptr; }   \
   SIMD_FORCE_INLINE void  operator delete(void*, void*)      { }   \
   SIMD_FORCE_INLINE void* operator new[](size_t sizeInBytes)   { return btAlignedAlloc(sizeInBytes,16); }   \
   SIMD_FORCE_INLINE void  operator delete[](void* ptr)         { btAlignedFree(ptr); }   \
   SIMD_FORCE_INLINE void* operator new[](size_t, void* ptr)   { return ptr; }   \
   SIMD_FORCE_INLINE void  operator delete[](void*, void*)      { }   \

Definition at line 215 of file btScalar.h.

#define BT_DECLARE_HANDLE (   name)    typedef struct name##__ { int unused; } *name

Definition at line 343 of file btScalar.h.

#define BT_LARGE_FLOAT   1e18f

Definition at line 210 of file btScalar.h.

#define btAssert (   x)

Definition at line 187 of file btScalar.h.

#define btFsels (   a,
  b,
 
)    (btScalar)btFsel(a,b,c)

Definition at line 351 of file btScalar.h.

#define btFullAssert (   x)

Definition at line 191 of file btScalar.h.

#define btLikely (   _c)    _c

Definition at line 192 of file btScalar.h.

#define btRecipSqrt (   x)    ((btScalar)(btScalar(1.0)/btSqrt(btScalar(x)))) /* reciprocal square root */

Definition at line 299 of file btScalar.h.

#define btUnlikely (   _c)    _c

Definition at line 193 of file btScalar.h.

#define SIMD_2_PI   btScalar(6.283185307179586232)

Definition at line 292 of file btScalar.h.

#define SIMD_DEGS_PER_RAD   (btScalar(360.0) / SIMD_2_PI)

Definition at line 296 of file btScalar.h.

#define SIMD_EPSILON   FLT_EPSILON

Definition at line 306 of file btScalar.h.

#define SIMD_FORCE_INLINE   inline

Definition at line 172 of file btScalar.h.

#define SIMD_HALF_PI   (SIMD_2_PI * btScalar(0.25))

Definition at line 294 of file btScalar.h.

#define SIMD_INFINITY   FLT_MAX

Definition at line 307 of file btScalar.h.

#define SIMD_PI   (SIMD_2_PI * btScalar(0.5))

Definition at line 293 of file btScalar.h.

#define SIMD_RADS_PER_DEG   (SIMD_2_PI / btScalar(360.0))

Definition at line 295 of file btScalar.h.

#define SIMDSQRT12   btScalar(0.7071067811865475244008443621048490)

Definition at line 297 of file btScalar.h.


Typedef Documentation

typedef float btScalar

The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.

Definition at line 208 of file btScalar.h.


Function Documentation

Definition at line 269 of file btScalar.h.

Definition at line 276 of file btScalar.h.

Definition at line 283 of file btScalar.h.

Definition at line 284 of file btScalar.h.

Definition at line 310 of file btScalar.h.

Definition at line 266 of file btScalar.h.

Definition at line 341 of file btScalar.h.

SIMD_FORCE_INLINE bool btEqual ( btScalar  a,
btScalar  eps 
)

Definition at line 328 of file btScalar.h.

Definition at line 285 of file btScalar.h.

Definition at line 265 of file btScalar.h.

Definition at line 288 of file btScalar.h.

Definition at line 346 of file btScalar.h.

Definition at line 326 of file btScalar.h.

int btGetVersion ( ) [inline]

Definition at line 33 of file btScalar.h.

Definition at line 331 of file btScalar.h.

Definition at line 336 of file btScalar.h.

Definition at line 286 of file btScalar.h.

Definition at line 354 of file btScalar.h.

Definition at line 492 of file btScalar.h.

Definition at line 287 of file btScalar.h.

Definition at line 340 of file btScalar.h.

SIMD_FORCE_INLINE unsigned btSelect ( unsigned  condition,
unsigned  valueIfConditionNonZero,
unsigned  valueIfConditionZero 
)

btSelect avoids branches, which makes performance much better for consoles like Playstation 3 and XBox 360 Thanks Phil Knight. See also http://www.cellperformance.com/articles/2006/04/more_techniques_for_eliminatin_1.html

Definition at line 368 of file btScalar.h.

SIMD_FORCE_INLINE int btSelect ( unsigned  condition,
int  valueIfConditionNonZero,
int  valueIfConditionZero 
)

Definition at line 378 of file btScalar.h.

SIMD_FORCE_INLINE float btSelect ( unsigned  condition,
float  valueIfConditionNonZero,
float  valueIfConditionZero 
)

Definition at line 384 of file btScalar.h.

Definition at line 267 of file btScalar.h.

Definition at line 245 of file btScalar.h.

template<typename T >
SIMD_FORCE_INLINE void btSwap ( T &  a,
T &  b 
)

Definition at line 393 of file btScalar.h.

SIMD_FORCE_INLINE unsigned btSwapEndian ( unsigned  val)

Definition at line 402 of file btScalar.h.

SIMD_FORCE_INLINE unsigned short btSwapEndian ( unsigned short  val)

Definition at line 407 of file btScalar.h.

SIMD_FORCE_INLINE unsigned btSwapEndian ( int  val)

Definition at line 412 of file btScalar.h.

SIMD_FORCE_INLINE unsigned short btSwapEndian ( short  val)

Definition at line 417 of file btScalar.h.

SIMD_FORCE_INLINE void btSwapEndianDouble ( double  d,
unsigned char *  dst 
)

Definition at line 458 of file btScalar.h.

SIMD_FORCE_INLINE unsigned int btSwapEndianFloat ( float  d)

btSwapFloat uses using char pointers to swap the endianness

btSwapFloat/btSwapDouble will NOT return a float, because the machine might 'correct' invalid floating point values Not all values of sign/exponent/mantissa are valid floating point numbers according to IEEE 754. When a floating point unit is faced with an invalid value, it may actually change the value, or worse, throw an exception. In most systems, running user mode code, you wouldn't get an exception, but instead the hardware/os/runtime will 'fix' the number for you. so instead of returning a float/double, we return integer/long long integer

Definition at line 428 of file btScalar.h.

Definition at line 268 of file btScalar.h.

SIMD_FORCE_INLINE double btUnswapEndianDouble ( const unsigned char *  src)

Definition at line 474 of file btScalar.h.

SIMD_FORCE_INLINE float btUnswapEndianFloat ( unsigned int  a)

Definition at line 442 of file btScalar.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


bullet
Author(s): Erwin Coumans, ROS package maintained by Tully Foote
autogenerated on Wed Oct 31 2012 07:54:31