Doubles (#14)
Added a compile time option to use double precision body positions. Most math remains single precision with minimal performance loss. `BOX3D_DOUBLE_PRECISION` Improved accuracy of body inertia computation when shapes are far from the body origin. WARNING: several APIs changed but migration should be straight forward if doubles are not enabled.
This commit is contained in:
parent
a252f03b19
commit
09c65b08ea
115 changed files with 7591 additions and 5295 deletions
|
|
@ -71,6 +71,16 @@ B3_INLINE b3Vec3 RandomVec3( b3Vec3 lo, b3Vec3 hi )
|
|||
return v;
|
||||
}
|
||||
|
||||
// Random world position with coordinates in range [lo, hi]
|
||||
B3_INLINE b3Pos RandomPos( b3Vec3 lo, b3Vec3 hi )
|
||||
{
|
||||
b3Pos v;
|
||||
v.x = RandomFloatRange( lo.x, hi.x );
|
||||
v.y = RandomFloatRange( lo.y, hi.y );
|
||||
v.z = RandomFloatRange( lo.z, hi.z );
|
||||
return v;
|
||||
}
|
||||
|
||||
B3_INLINE b3Vec3 RandomVec3Uniform( float lo, float hi )
|
||||
{
|
||||
b3Vec3 v;
|
||||
|
|
|
|||
Loading…
Reference in a new issue