Blender
V3.3
|
#include <math.h>
#include <stdlib.h>
#include <float.h>
#include <assert.h>
Go to the source code of this file.
Classes | |
struct | btInfMaskConverter |
struct | btTypedObject |
rudimentary class to provide type info More... | |
Typedefs | |
typedef float | btScalar |
The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision. More... | |
Variables | |
static btInfMaskConverter | btInfinityMask = 0x7F800000 |
#define ATTRIBUTE_ALIGNED128 | ( | a | ) | a |
Definition at line 287 of file btScalar.h.
#define ATTRIBUTE_ALIGNED16 | ( | a | ) | a |
Definition at line 285 of file btScalar.h.
#define ATTRIBUTE_ALIGNED64 | ( | a | ) | a |
Definition at line 286 of file btScalar.h.
#define BT_BULLET_VERSION 289 |
Definition at line 28 of file btScalar.h.
BT_DECLARE_ALIGNED_ALLOCATOR | ( | ) |
Definition at line 425 of file btScalar.h.
#define BT_DECLARE_HANDLE | ( | name | ) |
Definition at line 591 of file btScalar.h.
#define BT_HALF 0.5f |
Definition at line 548 of file btScalar.h.
#define BT_INFINITY (btInfinityMask.mask) |
Definition at line 405 of file btScalar.h.
#define BT_LARGE_FLOAT 1e18f |
Definition at line 316 of file btScalar.h.
#define BT_NOT_EMPTY_FILE |
Definition at line 66 of file btScalar.h.
#define BT_ONE 1.0f |
Definition at line 545 of file btScalar.h.
#define BT_TWO 2.0f |
Definition at line 547 of file btScalar.h.
#define BT_ZERO 0.0f |
Definition at line 546 of file btScalar.h.
Definition at line 295 of file btScalar.h.
Definition at line 603 of file btScalar.h.
Definition at line 299 of file btScalar.h.
#define btLikely | ( | _c | ) | _c |
Definition at line 300 of file btScalar.h.
#define btRecipSqrt | ( | x | ) | ((btScalar)(btScalar(1.0) / btSqrt(btScalar(x)))) /* reciprocal square root */ |
Definition at line 532 of file btScalar.h.
#define btUnlikely | ( | _c | ) | _c |
Definition at line 301 of file btScalar.h.
Definition at line 527 of file btScalar.h.
Definition at line 530 of file btScalar.h.
#define SIMD_EPSILON FLT_EPSILON |
Definition at line 543 of file btScalar.h.
#define SIMD_FORCE_INLINE inline |
Definition at line 280 of file btScalar.h.
Definition at line 528 of file btScalar.h.
#define SIMD_INFINITY FLT_MAX |
Definition at line 544 of file btScalar.h.
Definition at line 526 of file btScalar.h.
Definition at line 529 of file btScalar.h.
Definition at line 531 of file btScalar.h.
The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
Definition at line 314 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btAcos | ( | btScalar | x | ) |
Definition at line 501 of file btScalar.h.
Referenced by btQuaternion::angle(), angle(), btQuaternion::angleShortestPath(), btQuaternion::getAngle(), btQuaternion::getAngleShortestPath(), btSoftBody::AJoint::Prepare(), and btQuaternion::slerp().
align a pointer to the provided alignment, upwards
Definition at line 814 of file btScalar.h.
Referenced by btAlignedAllocDefault(), and btDefaultSerializer::initDNA().
SIMD_FORCE_INLINE btScalar btAsin | ( | btScalar | x | ) |
Definition at line 509 of file btScalar.h.
Referenced by getEulerYPR(), getEulerZYX(), btQuaternion::getEulerZYX(), matrixToEulerXYZ(), matrixToEulerXZY(), matrixToEulerYXZ(), matrixToEulerYZX(), matrixToEulerZXY(), and matrixToEulerZYX().
SIMD_FORCE_INLINE btScalar btAtan | ( | btScalar | x | ) |
Definition at line 517 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btAtan2 | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 518 of file btScalar.h.
Referenced by btGetAngle(), calcAngleInfo2(), cullPoints2(), getEulerYPR(), getEulerZYX(), btQuaternion::getEulerZYX(), getHingeAngle(), matrixToEulerXYZ(), matrixToEulerXZY(), matrixToEulerYXZ(), matrixToEulerYZX(), matrixToEulerZXY(), matrixToEulerZYX(), resolveConeFrictionConstraintRows(), and testAngLimits().
SIMD_FORCE_INLINE btScalar btAtan2Fast | ( | btScalar | y, |
btScalar | x | ||
) |
Definition at line 553 of file btScalar.h.
References angle(), btFabs(), r, SIMD_PI, x, and y.
Referenced by calcAngleInfo(), and GrahamScanConvexHull2D().
SIMD_FORCE_INLINE btScalar btCos | ( | btScalar | x | ) |
Definition at line 498 of file btScalar.h.
Referenced by calcAngleInfo2(), btSoftBodyHelpers::CreateEllipsoid(), debugDrawConstraint(), btIDebugDraw::drawArc(), btIDebugDraw::drawCapsule(), btIDebugDraw::drawCone(), btIDebugDraw::drawCylinder(), btIDebugDraw::drawSpherePatch(), getEulerZYX(), GetPointForAngle(), btTransformUtil::integrateTransform(), maxdirsterid(), resolveConeFrictionConstraintRows(), btQuaternion::setEuler(), setEulerZYX(), btQuaternion::setEulerZYX(), setMaxSlope(), and btQuaternion::setRotation().
SIMD_FORCE_INLINE btScalar btDegrees | ( | btScalar | x | ) |
Definition at line 589 of file btScalar.h.
References SIMD_DEGS_PER_RAD, and x.
SIMD_FORCE_INLINE bool btEqual | ( | btScalar | a, |
btScalar | eps | ||
) |
Definition at line 574 of file btScalar.h.
References Freestyle::a, and eps.
Referenced by btAngularLimit::fit().
SIMD_FORCE_INLINE btScalar btExp | ( | btScalar | x | ) |
Definition at line 519 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btFabs | ( | btScalar | x | ) |
Definition at line 497 of file btScalar.h.
Referenced by absolute(), btVector4::absolute4(), btSoftBody::applyForces(), bt_line_plane_collision(), btAdjustAngleToLimits(), btAdjustInternalEdgeContacts(), btAtan2Fast(), btFuzzyZero(), btPlaneSpace1(), btShortestAngleUpdate(), btSolveDantzigLCP(), calc_absolute_matrix(), calcAngleInfo(), calculatePrincipalAxisTransform(), ccdEq(), ClusterMetric(), GIM_AABB::collide_ray(), collide_ray(), convertJoint(), cullPoints2(), dBoxBox2(), diagonalize(), btIDebugDraw::drawArc(), gjkepa2_impl::GJK::EncloseOrigin(), GJK< btConvexTemplate >::EncloseOrigin(), extractRotation(), btSoftBodyHelpers::extrapolateBarycentricWeights(), GIM_TRIANGLE::get_uv_parameters(), getEulerYPR(), getEulerZYX(), getInfo2NonVirtual(), btGeometryUtil::getVerticesFromPlaneEquations(), gridRaycast(), ImplicitSolve(), initialize2(), internalUpdateSprings(), IsAlmostZero(), IsAlmostZero1(), LINE_PLANE_COLLISION(), btContactArray::merge_contacts(), gim_contact_array::merge_contacts(), btKrylovSolver< MatrixX >::norm(), btVectorX< T >::nrm2(), gjkepa2_impl::GJK::projectorigin(), GJK< btConvexTemplate >::projectorigin(), btSoftBody::refine(), btSolve2LinearConstraint::resolveBilateralPairConstraint(), resolveConeFrictionConstraintRows(), resolveSingleBilateral(), btSolve2LinearConstraint::resolveUnilateralPairConstraint(), restitutionCurve(), setupMultiBodyContactConstraint(), btSoftBody::setVolumeDensity(), btSoftBody::setVolumeMass(), singularValueDecomposition(), btQuaternion::slerp(), solve33(), sort(), btEigen::system(), ThreePlaneIntersection(), topdown(), btSoftBody::updateArea(), btSoftBody::updateClusters(), wilkinsonShift(), and writeBackJoints().
SIMD_FORCE_INLINE btScalar btFmod | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 522 of file btScalar.h.
Referenced by btNormalizeAngle(), and btNormalizeAnglePositive().
SIMD_FORCE_INLINE btScalar btFsel | ( | btScalar | a, |
btScalar | b, | ||
btScalar | c | ||
) |
Definition at line 598 of file btScalar.h.
References Freestyle::a, usdtokens::b(), and Freestyle::c.
Referenced by btSelect().
SIMD_FORCE_INLINE bool btFuzzyZero | ( | btScalar | x | ) |
Definition at line 572 of file btScalar.h.
References btFabs(), SIMD_EPSILON, and x.
Referenced by btDoSimplex2(), btDoSimplex3(), btDoSimplex4(), btVec3PointSegmentDist2(), btVec3PointTriDist2(), calcAngleInfo2(), ccdSign(), btMLCPSolver::createMLCPFast(), btMultiBodyMLCPConstraintSolver::createMLCPFastMultiBody(), btMultiBodyMLCPConstraintSolver::createMLCPFastRigidBody(), btPolarDecomposition::decompose(), btGjkPairDetector::getClosestPointsNonVirtual(), btSoftBody::RayFromToCaster::rayFromToTriangle(), btLemkeSolver::solveMLCP(), and btDeformableMultiBodyDynamicsWorld::stepSimulation().
|
inline |
Definition at line 406 of file btScalar.h.
References btInfinityMask, and btInfMaskConverter::intmask.
|
inline |
Definition at line 30 of file btScalar.h.
References BT_BULLET_VERSION.
SIMD_FORCE_INLINE bool btGreaterEqual | ( | btScalar | a, |
btScalar | eps | ||
) |
Definition at line 578 of file btScalar.h.
References Freestyle::a, and eps.
|
inline |
Definition at line 35 of file btScalar.h.
SIMD_FORCE_INLINE int btIsNegative | ( | btScalar | x | ) |
Definition at line 583 of file btScalar.h.
References x.
SIMD_FORCE_INLINE btScalar btLargeDot | ( | const btScalar * | a, |
const btScalar * | b, | ||
int | n | ||
) |
Definition at line 750 of file btScalar.h.
References Freestyle::a, usdtokens::b(), q1, and sum().
Referenced by btLCP::AiC_times_qC(), btLCP::AiN_times_qN(), btLDLTRemove(), btLCP::pN_equals_ANC_times_qC(), btLCP::transfer_i_from_N_to_C(), and btLCP::transfer_i_to_C().
SIMD_FORCE_INLINE btScalar btLog | ( | btScalar | x | ) |
Definition at line 520 of file btScalar.h.
SIMD_FORCE_INLINE bool btMachineIsLittleEndian | ( | ) |
Definition at line 605 of file btScalar.h.
SIMD_FORCE_INLINE btScalar btNormalizeAngle | ( | btScalar | angleInRadians | ) |
Definition at line 781 of file btScalar.h.
References btFmod(), SIMD_2_PI, and SIMD_PI.
Referenced by btAdjustAngleToLimits(), btShortestAngularDistance(), btAngularLimit::fit(), btAngularLimit::getHigh(), btAngularLimit::getLow(), btAngularLimit::set(), setAngularLowerLimit(), setAngularLowerLimitReversed(), setAngularUpperLimit(), setAngularUpperLimitReversed(), setLimit(), setLimitReversed(), setLowerAngLimit(), setUpperAngLimit(), and btAngularLimit::test().
SIMD_FORCE_INLINE btScalar btPow | ( | btScalar | x, |
btScalar | y | ||
) |
Definition at line 521 of file btScalar.h.
Referenced by btRigidBody::applyDamping(), and btPolarDecomposition::decompose().
SIMD_FORCE_INLINE btScalar btRadians | ( | btScalar | x | ) |
Definition at line 588 of file btScalar.h.
References SIMD_RADS_PER_DEG, and x.
Referenced by btKinematicCharacterController().
SIMD_FORCE_INLINE float btSelect | ( | unsigned | condition, |
float | valueIfConditionNonZero, | ||
float | valueIfConditionZero | ||
) |
Definition at line 633 of file btScalar.h.
References btFsel().
SIMD_FORCE_INLINE int btSelect | ( | unsigned | condition, |
int | valueIfConditionNonZero, | ||
int | valueIfConditionZero | ||
) |
Definition at line 627 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 617 of file btScalar.h.
Referenced by testQuantizedAabbAgainstQuantizedAabb().
SIMD_FORCE_INLINE void btSetZero | ( | T * | a, |
int | n | ||
) |
Definition at line 739 of file btScalar.h.
References Freestyle::a, and T.
Referenced by btLCP::btLCP(), btSolveDantzigLCP(), btVectorX< T >::setZero(), and btMatrixX< T >::setZero().
SIMD_FORCE_INLINE btScalar btSin | ( | btScalar | x | ) |
Definition at line 499 of file btScalar.h.
Referenced by calcAngleInfo2(), btSoftBodyHelpers::CreateEllipsoid(), debugDrawConstraint(), btIDebugDraw::drawArc(), btIDebugDraw::drawCapsule(), btIDebugDraw::drawCone(), btIDebugDraw::drawCylinder(), btIDebugDraw::drawSpherePatch(), GetPointForAngle(), btTransformUtil::integrateTransform(), maxdirsterid(), resolveConeFrictionConstraintRows(), btQuaternion::setEuler(), setEulerZYX(), btQuaternion::setEulerZYX(), btQuaternion::setRotation(), and btQuaternion::slerp().
SIMD_FORCE_INLINE btScalar btSqrt | ( | btScalar | y | ) |
Definition at line 466 of file btScalar.h.
References sqrtf, x, y, and z.
Referenced by btSoftBody::addAeroForceToFace(), btSoftBody::addAeroForceToNode(), btQuaternion::angle(), angle(), btQuaternion::angleShortestPath(), btDeformableFaceRigidContactConstraint::applyImpulse(), btComputeGjkEpaPenetration(), btConeShape(), btEpsRoot(), btTransformUtil::calculateDiffAxisAngle(), btTransformUtil::calculateDiffAxisAngleQuaternion(), Clamp(), SphereTriangleDetector::collide(), GivensRotation::compute(), btRigidBody::computeGyroscopicForceExplicit(), GivensRotation::computeUnconventional(), coneLocalSupport(), convertContact(), btSoftBodyHelpers::CreateEllipsoid(), CylinderLocalSupportX(), CylinderLocalSupportY(), CylinderLocalSupportZ(), diagonalize(), btPolyhedralContactClipping::findSeparatingAxis(), get_limit_motor_info2(), btQuaternion::getAxis(), btGjkPairDetector::getClosestPointsNonVirtual(), gjkepa2_impl::EPA::getedgedist(), EPA< btConvexTemplate >::getedgedist(), getInfo2InternalUsingFrameOffset(), getInfo2NonVirtual(), getRotation(), gridRaycast(), btTransformUtil::integrateTransform(), internalSetupContactConstraints(), GIM_CONTACT::interpolate_normals(), btQuaternion::length(), length(), localGetSupportVertexWithoutMarginNonVirtual(), polarDecomposition(), btSoftColliders::CollideVF_SS::Process(), gjkepa2_impl::GJK::projectorigin(), GJK< btConvexTemplate >::projectorigin(), ProjectOrigin(), safeNorm(), safeNormalize(), shortestArcQuat(), singularValueDecomposition(), btQuaternion::slerp(), btEigen::system(), btDeformableLagrangianForce::testHessian(), btRaycastVehicle::updateFriction(), and wilkinsonShift().
SIMD_FORCE_INLINE void btSwap | ( | T & | a, |
T & | b | ||
) |
Definition at line 643 of file btScalar.h.
References Freestyle::a, usdtokens::b(), and T.
Referenced by btSoftBody::applyRepulsionForce(), btInternalVertexPair::btInternalVertexPair(), btPolyhedralContactClipping::clipFaceAgainstHull(), btDbvtBroadphase::collide(), continuousCollisionDetection(), gjkepa2_impl::EPA::Evaluate(), EPA< btConvexTemplate >::Evaluate(), btSoftBody::generateClusters(), ImplicitSolve(), btSymMatrix< T >::index(), internalSetupContactConstraints(), btDbvtTreeCollider::Process(), btSoftBody::randomizeConstraints(), btSoftBody::refine(), btConvexHullInternal::shrink(), and sort().
SIMD_FORCE_INLINE unsigned btSwapEndian | ( | int | val | ) |
Definition at line 661 of file btScalar.h.
References btSwapEndian().
SIMD_FORCE_INLINE unsigned short btSwapEndian | ( | short | val | ) |
Definition at line 666 of file btScalar.h.
References btSwapEndian().
SIMD_FORCE_INLINE unsigned short btSwapEndian | ( | unsigned short | val | ) |
Definition at line 656 of file btScalar.h.
SIMD_FORCE_INLINE unsigned btSwapEndian | ( | unsigned | val | ) |
Definition at line 651 of file btScalar.h.
Referenced by btSwapEndian(), and btDefaultSerializer::initDNA().
SIMD_FORCE_INLINE void btSwapEndianDouble | ( | double | d, |
unsigned char * | dst | ||
) |
Definition at line 706 of file btScalar.h.
References src.
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 677 of file btScalar.h.
References Freestyle::a, and src.
SIMD_FORCE_INLINE btScalar btTan | ( | btScalar | x | ) |
Definition at line 500 of file btScalar.h.
SIMD_FORCE_INLINE double btUnswapEndianDouble | ( | const unsigned char * | src | ) |
Definition at line 721 of file btScalar.h.
References src.
SIMD_FORCE_INLINE float btUnswapEndianFloat | ( | unsigned int | a | ) |
Definition at line 691 of file btScalar.h.
References Freestyle::a, and src.
|
static |
Definition at line 404 of file btScalar.h.
Referenced by btGetInfinityMask().