|
| int | b3MinInt (int a, int b) |
| int | b3MaxInt (int a, int b) |
| int | b3ClampInt (int a, int lower, int upper) |
| bool | b3IsValidFloat (float a) |
| | Is this a valid number? Not NaN or infinity.
|
| float | b3AbsFloat (float a) |
| float | b3MinFloat (float a, float b) |
| float | b3MaxFloat (float a, float b) |
| float | b3ClampFloat (float a, float lower, float upper) |
|
float | b3LerpFloat (float a, float b, float alpha) |
| | Interpolate a scalar.
|
| float | b3Atan2 (float y, float x) |
| | Compute an approximate arctangent in the range [-pi, pi] This is hand coded for cross-platform determinism.
|
| b3CosSin | b3ComputeCosSin (float radians) |
| | Compute the cosine and sine of an angle in radians.
|
| float | b3Sin (float radians) |
| float | b3Cos (float radians) |
|
float | b3UnwindAngle (float radians) |
| | Convert any angle into the range [-pi, pi].
|
|
b3Vec3 | b3Add (b3Vec3 a, b3Vec3 b) |
| | Vector addition.
|
|
b3Vec3 | b3Sub (b3Vec3 a, b3Vec3 b) |
| | Vector subtraction.
|
|
b3Vec3 | b3Mul (b3Vec3 a, b3Vec3 b) |
| | Vector component-wise multiplication.
|
|
b3Vec3 | b3Neg (b3Vec3 a) |
| | Vector negation.
|
|
float | b3Dot (b3Vec3 a, b3Vec3 b) |
| | Vector dot product.
|
|
float | b3Length (b3Vec3 v) |
| | Vector length.
|
|
float | b3LengthSquared (b3Vec3 a) |
| | Vector length squared.
|
|
float | b3Distance (b3Vec3 a, b3Vec3 b) |
| | Distance between two points.
|
|
float | b3DistanceSquared (b3Vec3 a, b3Vec3 b) |
| | Squared distance between two points.
|
|
b3Vec3 | b3Normalize (b3Vec3 a) |
| | Normalize a vector. Returns a zero vector if the input vector is very small.
|
| b3Vec3 | b3GetLengthAndNormalize (float *length, b3Vec3 a) |
| | Normalize a vector and return the length.
|
|
b3Vec3 | b3Perp (b3Vec3 a) |
| | Get a unit vector that is perpendicular to the supplied vector.
|
|
bool | b3IsNormalized (b3Vec3 a) |
| | Is a vector normalized? In other words, does it have unit length?
|
|
b3Vec3 | b3MulAdd (b3Vec3 a, float s, b3Vec3 b) |
| | a + s * b
|
|
b3Vec3 | b3MulSub (b3Vec3 a, float s, b3Vec3 b) |
| | a - s * b
|
|
b3Vec3 | b3MulSV (float s, b3Vec3 a) |
| | s * a
|
|
b3Vec3 | b3Cross (b3Vec3 a, b3Vec3 b) |
| | https://en.wikipedia.org/wiki/Cross_product
|
|
b3Vec3 | b3Lerp (b3Vec3 a, b3Vec3 b, float alpha) |
| | Linearly interpolate between two vectors.
|
|
b3Vec3 | b3Blend2 (float s, b3Vec3 a, float t, b3Vec3 b) |
| | Blend two vectors: s * a + t * b.
|
|
b3Vec3 | b3Abs (b3Vec3 a) |
| | Component-wise absolute value.
|
|
b3Vec3 | b3Sign (b3Vec3 a) |
| | Component-wise -1 or 1 (1 if zero).
|
|
b3Vec3 | b3Min (b3Vec3 a, b3Vec3 b) |
| | Component-wise minimum value.
|
|
b3Vec3 | b3Max (b3Vec3 a, b3Vec3 b) |
| | Component-wise maximum value.
|
|
b3Vec3 | b3Clamp (b3Vec3 a, b3Vec3 lower, b3Vec3 upper) |
| | Component-wise clamped value.
|
| b3Vec3 | b3SafeScale (b3Vec3 a) |
| | Create a safe scaling value for scaling collision.
|
|
bool | b3IsNormalizedQuat (b3Quat q) |
| | Does the supplied quaternion have unit length?
|
|
b3Vec3 | b3RotateVector (b3Quat q, b3Vec3 v) |
| | Rotate a vector.
|
|
b3Vec3 | b3InvRotateVector (b3Quat q, b3Vec3 v) |
| | Inverse rotate a vector.
|
|
float | b3DotQuat (b3Quat a, b3Quat b) |
| | Compute dot product of two quaternions. Useful for polarity tests.
|
|
b3Quat | b3MulQuat (b3Quat q1, b3Quat q2) |
| | Multiply two quaternions.
|
| b3Quat | b3InvMulQuat (b3Quat q1, b3Quat q2) |
| | Compute a relative quaternion.
|
|
b3Quat | b3Conjugate (b3Quat q) |
| | Quaternion conjugate (cheap inverse).
|
|
b3Quat | b3NegateQuat (b3Quat q) |
| | Component-wise quaternion negation.
|
|
b3Quat | b3NormalizeQuat (b3Quat q) |
| | Normalize a quaternion.
|
|
b3Quat | b3MakeQuatFromAxisAngle (b3Vec3 axis, float radians) |
| | Make a quaternion that is equivalent to rotating around an axis by a specified angle.
|
|
b3Vec3 | b3GetAxisAngle (float *radians, b3Quat q) |
| | Get the axis and angle from a quaternion. Assumes the quaternion is normalized.
|
|
float | b3GetQuatAngle (b3Quat q) |
| | Get the angle for a quaternion in radians.
|
|
b3Quat | b3MakeQuatFromMatrix (const b3Matrix3 *m) |
| | Extract a quaternion from a rotation matrix.
|
|
b3Quat | b3ComputeQuatBetweenUnitVectors (b3Vec3 v1, b3Vec3 v2) |
| | Find a quaternion that rotates one vector to another.
|
|
float | b3GetTwistAngle (b3Quat q) |
| | Twist angle around the z-axis, used for twist limit and revolute angle limit.
|
|
float | b3GetSwingAngle (b3Quat q) |
| | Swing angle used for cone limit.
|
|
b3Quat | b3NLerp (b3Quat q1, b3Quat q2, float alpha) |
| | Linearly interpolate and normalize between two quaternions.
|
| b3Transform | b3MulTransforms (b3Transform a, b3Transform b) |
| | Multiply two transforms.
|
| B3_FORCE_INLINE b3Transform | b3InvMulTransforms (b3Transform a, b3Transform b) |
| | Creates a transform that converts a local point in frame B to a local point in frame A.
|
|
b3Transform | b3InvertTransform (b3Transform t) |
| | Get the inverse of a transform.
|
|
b3Vec3 | b3TransformPoint (b3Transform t, b3Vec3 v) |
| | Transform a point.
|
|
b3Vec3 | b3InvTransformPoint (b3Transform t, b3Vec3 v) |
| | Inverse transform a point.
|
|
b3Pos | b3ToPos (b3Vec3 v) |
| | Convert a vector to a world position.
|
|
b3Vec3 | b3ToVec3 (b3Pos p) |
| | Lossy conversion of a world position to a float vector.
|
| float | b3RoundDownFloat (double x) |
| | Narrow a world coordinate to float, rounding toward negative infinity.
|
|
float | b3RoundUpFloat (double x) |
| | Narrow a world coordinate to float, rounding toward positive infinity.
|
|
b3Vec3 | b3SubPos (b3Pos a, b3Pos b) |
| | a - b, demoted to float. The primary precision boundary operation.
|
|
b3Pos | b3OffsetPos (b3Pos p, b3Vec3 d) |
| | p + d
|
|
b3Pos | b3LerpPosition (b3Pos a, b3Pos b, float t) |
| | World position interpolation for sweeps and sampling.
|
|
b3Pos | b3TransformWorldPoint (b3WorldTransform t, b3Vec3 p) |
| | Transform a local point to a world position. Rotation in float, translation in double.
|
|
b3Vec3 | b3InvTransformWorldPoint (b3WorldTransform t, b3Pos p) |
| | Transform a world position to a local point. One double subtraction, then float.
|
|
b3Transform | b3InvMulWorldTransforms (b3WorldTransform A, b3WorldTransform B) |
| | Relative transform of frame B in frame A. The narrow phase boundary.
|
|
b3WorldTransform | b3MulWorldTransforms (b3WorldTransform A, b3Transform B) |
| | Compose a world transform with a local transform.
|
|
b3Transform | b3ToRelativeTransform (b3WorldTransform t, b3Pos base) |
| | Shift a world transform into the frame of a base position.
|
|
b3WorldTransform | b3MakeWorldTransform (b3Transform t) |
| | Promote a float transform to a world transform. Lossless.
|
| b3AABB | b3OffsetAABB (b3AABB localBox, b3Pos origin) |
| | Translate a local AABB by a world origin, rounding outward so the float box always contains the double box.
|
|
float | b3Det (b3Matrix3 m) |
| | Compute the determinant of a 3-by-3 matrix.
|
|
b3Vec3 | b3MulMV (b3Matrix3 m, b3Vec3 a) |
| | Multiply a matrix times a column vector.
|
|
b3Matrix3 | b3NegateMat3 (b3Matrix3 a) |
| | Negate a matrix.
|
| b3Matrix3 | b3AddMM (b3Matrix3 a, b3Matrix3 b) |
| | Matrix addition.
|
| b3Matrix3 | b3SubMM (b3Matrix3 a, b3Matrix3 b) |
| | Matrix subtraction.
|
|
b3Matrix3 | b3MulSM (float s, b3Matrix3 a) |
| | Multiply a matrix by a scalar, component-wise.
|
| b3Matrix3 | b3MulMM (b3Matrix3 a, b3Matrix3 b) |
| | Matrix multiplication.
|
|
b3Matrix3 | b3Transpose (b3Matrix3 m) |
| | Matrix transpose.
|
|
b3Matrix3 | b3InvertMatrix (b3Matrix3 m) |
| | General matrix inverse.
|
| b3Vec3 | b3Solve3 (b3Matrix3 m, b3Vec3 a) |
| | Solve a matrix equation.
|
|
b3Matrix3 | b3InvertT (b3Matrix3 m) |
| | Invert a matrix.
|
|
b3Matrix3 | b3AbsMatrix3 (b3Matrix3 m) |
| | Get the component-wise absolute value of a matrix.
|
| B3_FORCE_INLINE b3Matrix3 | b3MakeMatrixFromQuat (b3Quat q) |
| | Make a matrix from a quaternion.
|
| b3Matrix3 | b3Steiner (float mass, b3Vec3 origin) |
| | Get the inertia tensor of an offset point.
|
|
b3AABB | b3MakeAABB (const b3Vec3 *points, int count, float radius) |
| | Get the AABB of a point cloud.
|
|
bool | b3AABB_Contains (b3AABB a, b3AABB b) |
| | Does a fully contain b?
|
|
float | b3AABB_Area (b3AABB a) |
| | Get the surface area of an axis-aligned bounding box.
|
|
b3Vec3 | b3AABB_Center (b3AABB a) |
| | Get the center of an axis-aligned bounding box.
|
|
b3Vec3 | b3AABB_Extents (b3AABB a) |
| | Get the extents (half-widths) of an axis-aligned bounding box.
|
|
b3AABB | b3AABB_Union (b3AABB a, b3AABB b) |
| | Get the union of two axis-aligned bounding boxes.
|
|
b3AABB | b3AABB_Inflate (b3AABB a, float extension) |
| | Add uniform padding to an axis-aligned bounding box.
|
|
bool | b3AABB_Overlaps (b3AABB a, b3AABB b) |
| | Do two axis-aligned boxes overlap?
|
| b3AABB | b3AABB_Transform (b3Transform transform, b3AABB a) |
| | Transform an axis-aligned bounding box.
|
|
b3Vec3 | b3ClosestPointToAABB (b3Vec3 point, b3AABB a) |
| | Get the closest point on an axis-aligned bounding box.
|
|
b3Vec3 | b3PointToSegmentDistance (b3Vec3 a, b3Vec3 b, b3Vec3 q) |
| | Compute the closest point on the segment a-b to the target q.
|
|
b3SegmentDistanceResult | b3LineDistance (b3Vec3 p1, b3Vec3 d1, b3Vec3 p2, b3Vec3 d2) |
| | Compute the closest points on two infinite lines.
|
|
b3SegmentDistanceResult | b3SegmentDistance (b3Vec3 p1, b3Vec3 q1, b3Vec3 p2, b3Vec3 q2) |
| | Compute the closest points on two line segments.
|
|
bool | b3IsValidVec3 (b3Vec3 a) |
| | Is this a valid vector? Not NaN or infinity.
|
|
bool | b3IsValidQuat (b3Quat q) |
| | Is this a valid quaternion? Not NaN or infinity. Is normalized.
|
|
bool | b3IsValidTransform (b3Transform a) |
| | Is this a valid transform? Not NaN or infinity. Is normalized.
|
|
bool | b3IsValidMatrix3 (b3Matrix3 a) |
| | Is this a valid matrix? Not NaN or infinity.
|
|
bool | b3IsValidAABB (b3AABB a) |
| | Is this a valid bounding box? Not Nan or infinity. Upper bound greater than or equal to lower bound.
|
|
bool | b3IsBoundedAABB (b3AABB a) |
| | Is this AABB reasonably close to the origin? See B3_HUGE.
|
|
bool | b3IsSaneAABB (b3AABB a) |
| | Is this AABB valid and reasonable?
|
|
bool | b3IsValidPlane (b3Plane a) |
| | Is this a valid plane? Normal is a unit vector. Not Nan or infinity.
|
|
bool | b3IsValidPosition (b3Pos p) |
| | Is this a valid world position? Not NaN or infinity.
|
|
bool | b3IsValidWorldTransform (b3WorldTransform t) |
| | Is this a valid world transform? Not NaN or infinity. Rotation is normalized.
|