#include <math.h>
#include <stdlib.h>
#include <cstdlib>
#include <cfloat>
#include <float.h>
#include <assert.h>
Go to the source code of this file.
#define ATTRIBUTE_ALIGNED128 | ( | a | ) | a |
Definition at line 174 of file btScalar.h.
#define ATTRIBUTE_ALIGNED16 | ( | a | ) | a |
Definition at line 172 of file btScalar.h.
#define ATTRIBUTE_ALIGNED64 | ( | a | ) | a |
Definition at line 173 of file btScalar.h.
#define BT_BULLET_VERSION 276 |
Definition at line 33 of file btScalar.h.
#define BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
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 210 of file btScalar.h.
#define BT_DECLARE_HANDLE | ( | name | ) | typedef struct name##__ { int unused; } *name |
Definition at line 338 of file btScalar.h.
#define BT_LARGE_FLOAT 1e18f |
Definition at line 205 of file btScalar.h.
#define btAssert | ( | x | ) |
Definition at line 182 of file btScalar.h.
Definition at line 346 of file btScalar.h.
#define btFullAssert | ( | x | ) |
Definition at line 186 of file btScalar.h.
#define btLikely | ( | _c | ) | _c |
Definition at line 187 of file btScalar.h.
#define btRecipSqrt | ( | x | ) | ((btScalar)(btScalar(1.0)/btSqrt(btScalar(x)))) /* reciprocal square root */ |
Definition at line 294 of file btScalar.h.
#define btUnlikely | ( | _c | ) | _c |
Definition at line 188 of file btScalar.h.
Definition at line 287 of file btScalar.h.
#define SIMD_DEGS_PER_RAD (btScalar(360.0) / SIMD_2_PI) |
Definition at line 291 of file btScalar.h.
#define SIMD_EPSILON FLT_EPSILON |
Definition at line 301 of file btScalar.h.
#define SIMD_FORCE_INLINE inline |
Definition at line 167 of file btScalar.h.
#define SIMD_HALF_PI (SIMD_2_PI * btScalar(0.25)) |
Definition at line 289 of file btScalar.h.
#define SIMD_INFINITY FLT_MAX |
Definition at line 302 of file btScalar.h.
Definition at line 288 of file btScalar.h.
#define SIMD_RADS_PER_DEG (SIMD_2_PI / btScalar(360.0)) |
Definition at line 290 of file btScalar.h.
#define SIMDSQRT12 btScalar(0.7071067811865475244008443621048490) |
Definition at line 292 of file btScalar.h.
typedef float btScalar |
The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
Definition at line 203 of file btScalar.h.
Definition at line 264 of file btScalar.h.
Definition at line 271 of file btScalar.h.
Definition at line 278 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btAtan2 | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 279 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btAtan2Fast | ( | btScalar | y, |
btScalar | x | ||
) |
Definition at line 305 of file btScalar.h.
Definition at line 261 of file btScalar.h.
Definition at line 336 of file btScalar.h.
SIMD_FORCE_INLINE bool btEqual | ( | btScalar | a, |
btScalar | eps | ||
) |
Definition at line 323 of file btScalar.h.
Definition at line 280 of file btScalar.h.
Definition at line 260 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btFmod | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 283 of file btScalar.h.
Definition at line 341 of file btScalar.h.
SIMD_FORCE_INLINE bool btFuzzyZero | ( | btScalar | x | ) |
Definition at line 321 of file btScalar.h.
int btGetVersion | ( | ) | [inline] |
Definition at line 35 of file btScalar.h.
SIMD_FORCE_INLINE bool btGreaterEqual | ( | btScalar | a, |
btScalar | eps | ||
) |
Definition at line 326 of file btScalar.h.
SIMD_FORCE_INLINE int btIsNegative | ( | btScalar | x | ) |
Definition at line 331 of file btScalar.h.
Definition at line 281 of file btScalar.h.
SIMD_FORCE_INLINE bool btMachineIsLittleEndian | ( | ) |
Definition at line 349 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btNormalizeAngle | ( | btScalar | angleInRadians | ) |
Definition at line 487 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btPow | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 282 of file btScalar.h.
Definition at line 335 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 363 of file btScalar.h.
SIMD_FORCE_INLINE int btSelect | ( | unsigned | condition, |
int | valueIfConditionNonZero, | ||
int | valueIfConditionZero | ||
) |
Definition at line 373 of file btScalar.h.
SIMD_FORCE_INLINE float btSelect | ( | unsigned | condition, |
float | valueIfConditionNonZero, | ||
float | valueIfConditionZero | ||
) |
Definition at line 379 of file btScalar.h.
Definition at line 262 of file btScalar.h.
Definition at line 240 of file btScalar.h.
SIMD_FORCE_INLINE void btSwap | ( | T & | a, |
T & | b | ||
) |
Definition at line 388 of file btScalar.h.
SIMD_FORCE_INLINE unsigned btSwapEndian | ( | unsigned | val | ) |
Definition at line 397 of file btScalar.h.
SIMD_FORCE_INLINE unsigned short btSwapEndian | ( | unsigned short | val | ) |
Definition at line 402 of file btScalar.h.
SIMD_FORCE_INLINE unsigned btSwapEndian | ( | int | val | ) |
Definition at line 407 of file btScalar.h.
SIMD_FORCE_INLINE unsigned short btSwapEndian | ( | short | val | ) |
Definition at line 412 of file btScalar.h.
SIMD_FORCE_INLINE void btSwapEndianDouble | ( | double | d, |
unsigned char * | dst | ||
) |
Definition at line 453 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 423 of file btScalar.h.
Definition at line 263 of file btScalar.h.
SIMD_FORCE_INLINE double btUnswapEndianDouble | ( | const unsigned char * | src | ) |
Definition at line 469 of file btScalar.h.
SIMD_FORCE_INLINE float btUnswapEndianFloat | ( | unsigned int | a | ) |
Definition at line 437 of file btScalar.h.