#include <math.h>
#include <stdlib.h>
#include <float.h>
#include <assert.h>
Go to the source code of this file.
#define ATTRIBUTE_ALIGNED128 | ( | a | ) | a |
Definition at line 179 of file btScalar.h.
#define ATTRIBUTE_ALIGNED16 | ( | a | ) | a |
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.
#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 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.
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.
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.
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 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.
Definition at line 269 of file btScalar.h.
Definition at line 276 of file btScalar.h.
Definition at line 283 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btAtan2 | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 284 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btAtan2Fast | ( | btScalar | y, |
btScalar | x | ||
) |
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.
SIMD_FORCE_INLINE btScalar btFmod | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 288 of file btScalar.h.
Definition at line 346 of file btScalar.h.
SIMD_FORCE_INLINE bool btFuzzyZero | ( | btScalar | x | ) |
Definition at line 326 of file btScalar.h.
int btGetVersion | ( | ) | [inline] |
Definition at line 33 of file btScalar.h.
SIMD_FORCE_INLINE bool btGreaterEqual | ( | btScalar | a, |
btScalar | eps | ||
) |
Definition at line 331 of file btScalar.h.
SIMD_FORCE_INLINE int btIsNegative | ( | btScalar | x | ) |
Definition at line 336 of file btScalar.h.
Definition at line 286 of file btScalar.h.
SIMD_FORCE_INLINE bool btMachineIsLittleEndian | ( | ) |
Definition at line 354 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btNormalizeAngle | ( | btScalar | angleInRadians | ) |
Definition at line 492 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btPow | ( | btScalar | x, |
btScalar | y | ||
) |
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.
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.